summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2014-07-17 19:21:34 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:40 -0400
commitbcf60a22c3e8671468517d34aa37548272455c1f (patch)
treec3544f6714c291e611e33a8d0e39c5cb2c795821 /drivers/gpu/nvgpu/gk20a/channel_gk20a.h
parent55295c6087ed975be12e92f9be799269aef94678 (diff)
gpu: nvgpu: Add gk20a_fence type
When moving compression state tracking and compbit management ops to kernel, we need to attach a fence to dma-buf metadata, along with the compbit state. To make in-kernel fence management easier, introduce a new gk20a_fence abstraction. A gk20a_fence may be backed by a semaphore or a syncpoint (id, value) pair. If the kernel is configured with CONFIG_SYNC, it will also contain a sync_fence. The gk20a_fence can easily be converted back to a syncpoint (id, value) parir or sync FD when we need to return it to user space. Change gk20a_submit_channel_gpfifo to return a gk20a_fence instead of nvhost_fence. This is to facilitate work submission initiated from kernel. Bug 1509620 Change-Id: I6154764a279dba83f5e91ba9e0cb5e227ca08e1b Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Reviewed-on: http://git-master/r/439846 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
index 161d2b83..2ea3eccb 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
@@ -29,6 +29,7 @@
29struct gk20a; 29struct gk20a;
30struct gr_gk20a; 30struct gr_gk20a;
31struct dbg_session_gk20a; 31struct dbg_session_gk20a;
32struct gk20a_fence;
32 33
33#include "channel_sync_gk20a.h" 34#include "channel_sync_gk20a.h"
34 35
@@ -68,8 +69,8 @@ struct channel_ctx_gk20a {
68struct channel_gk20a_job { 69struct channel_gk20a_job {
69 struct mapped_buffer_node **mapped_buffers; 70 struct mapped_buffer_node **mapped_buffers;
70 int num_mapped_buffers; 71 int num_mapped_buffers;
71 struct gk20a_channel_fence pre_fence; 72 struct gk20a_fence *pre_fence;
72 struct gk20a_channel_fence post_fence; 73 struct gk20a_fence *post_fence;
73 struct list_head list; 74 struct list_head list;
74}; 75};
75 76
@@ -117,8 +118,9 @@ struct channel_gk20a {
117 118
118 bool cmds_pending; 119 bool cmds_pending;
119 struct { 120 struct {
120 struct gk20a_channel_fence pre_fence; 121 /* These fences should be accessed with submit_lock held. */
121 struct gk20a_channel_fence post_fence; 122 struct gk20a_fence *pre_fence;
123 struct gk20a_fence *post_fence;
122 } last_submit; 124 } last_submit;
123 125
124 void (*remove_support)(struct channel_gk20a *); 126 void (*remove_support)(struct channel_gk20a *);
@@ -184,8 +186,9 @@ void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a);
184int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, 186int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
185 struct nvhost_gpfifo *gpfifo, 187 struct nvhost_gpfifo *gpfifo,
186 u32 num_entries, 188 u32 num_entries,
189 u32 flags,
187 struct nvhost_fence *fence, 190 struct nvhost_fence *fence,
188 u32 flags); 191 struct gk20a_fence **fence_out);
189 192
190int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c, 193int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
191 struct nvhost_alloc_gpfifo_args *args); 194 struct nvhost_alloc_gpfifo_args *args);