summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_cdma.h
diff options
context:
space:
mode:
authorKen Adams <kadams@nvidia.com>2011-06-18 10:14:42 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:24 -0800
commit74460b7effdcd931f287da336e664f5819ee12c5 (patch)
treec08687063d197438eaa40725bb864866078eae66 /drivers/video/tegra/host/nvhost_cdma.h
parentdc83973f99b5567af802f70f40bcf602952f43ca (diff)
video: tegra: refactor for multiple chip support
Original-Change-Id: Ia203886a3b013612b4159393ff43a25a313d1ece Reviewed-on: http://git-master/r/35911 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R01b763362c13e09111f60700c3d3a7d2a9a3fc1c
Diffstat (limited to 'drivers/video/tegra/host/nvhost_cdma.h')
-rw-r--r--drivers/video/tegra/host/nvhost_cdma.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/video/tegra/host/nvhost_cdma.h b/drivers/video/tegra/host/nvhost_cdma.h
index a5876670a20a..64d17249f6af 100644
--- a/drivers/video/tegra/host/nvhost_cdma.h
+++ b/drivers/video/tegra/host/nvhost_cdma.h
@@ -45,13 +45,6 @@
* update - call to update sync queue and push buffer, unpin memory
*/
-/* Size of the sync queue. If it is too small, we won't be able to queue up
- * many command buffers. If it is too large, we waste memory. */
-#define NVHOST_SYNC_QUEUE_SIZE 8192
-
-/* Number of gathers we allow to be queued up per channel. Must be a
- power of two. Currently sized such that pushbuffer is 4KB (512*8B). */
-#define NVHOST_GATHER_QUEUE_SIZE 512
struct push_buffer {
struct nvmap_handle_ref *mem; /* handle to pushbuffer memory */
@@ -64,7 +57,7 @@ struct push_buffer {
struct sync_queue {
unsigned int read; /* read position within buffer */
unsigned int write; /* write position within buffer */
- u32 buffer[NVHOST_SYNC_QUEUE_SIZE]; /* queue data */
+ u32 *buffer; /* queue data */
};
enum cdma_event {
@@ -84,8 +77,17 @@ struct nvhost_cdma {
struct push_buffer push_buffer; /* channel's push buffer */
struct sync_queue sync_queue; /* channel's sync queue */
bool running;
+
};
+#define cdma_to_channel(cdma) container_of(cdma, struct nvhost_channel, cdma)
+#define cdma_to_dev(cdma) ((cdma_to_channel(cdma))->dev)
+#define cdma_op(cdma) (cdma_to_dev(cdma)->op.cdma)
+#define cdma_to_nvmap(cdma) ((cdma_to_dev(cdma))->nvmap)
+#define pb_to_cdma(pb) container_of(pb, struct nvhost_cdma, push_buffer)
+#define cdma_pb_op(cdma) (cdma_to_dev(cdma)->op.push_buffer)
+
+
int nvhost_cdma_init(struct nvhost_cdma *cdma);
void nvhost_cdma_deinit(struct nvhost_cdma *cdma);
void nvhost_cdma_stop(struct nvhost_cdma *cdma);
@@ -100,4 +102,5 @@ void nvhost_cdma_flush(struct nvhost_cdma *cdma);
void nvhost_cdma_peek(struct nvhost_cdma *cdma,
u32 dmaget, int slot, u32 *out);
+unsigned int nvhost_cdma_wait(struct nvhost_cdma *cdma, enum cdma_event event);
#endif