mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: add user API to get a syncpoint
Add new user API NVGPU_IOCTL_CHANNEL_GET_USER_SYNCPOINT which will expose per-channel allocated syncpoint to user space API will also return current value of the syncpoint On supported platforms, this API will also return a RW semaphore address (corresponding to syncpoint shim) to user space Add new characteristics flag NVGPU_GPU_FLAGS_SUPPORT_USER_SYNCPOINT to indicate support for this new API Add new flag NVGPU_SUPPORT_USER_SYNCPOINT for use of core driver Set this flag for GV11B and GP10B for now Add a new API (*syncpt_address) in struct gk20a_channel_sync to get GPU_VA address of a syncpoint Add new API nvgpu_nvhost_syncpt_read_maxval() which will read and return MAX value of syncpoint Bug 200326065 Jira NVGPU-179 Change-Id: I9da6f17b85996f4fc6731c0bf94fca6f3181c3e0 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1658009 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
180604fec0
commit
8d5536271f
@@ -294,6 +294,13 @@ static int gk20a_channel_syncpt_id(struct gk20a_channel_sync *s)
|
||||
return sp->id;
|
||||
}
|
||||
|
||||
static u64 gk20a_channel_syncpt_address(struct gk20a_channel_sync *s)
|
||||
{
|
||||
struct gk20a_channel_syncpt *sp =
|
||||
container_of(s, struct gk20a_channel_syncpt, ops);
|
||||
return sp->syncpt_buf.gpu_va;
|
||||
}
|
||||
|
||||
static void gk20a_channel_syncpt_destroy(struct gk20a_channel_sync *s)
|
||||
{
|
||||
struct gk20a_channel_syncpt *sp =
|
||||
@@ -345,6 +352,7 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c)
|
||||
sp->ops.set_min_eq_max = gk20a_channel_syncpt_set_min_eq_max;
|
||||
sp->ops.signal_timeline = gk20a_channel_syncpt_signal_timeline;
|
||||
sp->ops.syncpt_id = gk20a_channel_syncpt_id;
|
||||
sp->ops.syncpt_address = gk20a_channel_syncpt_address;
|
||||
sp->ops.destroy = gk20a_channel_syncpt_destroy;
|
||||
|
||||
return &sp->ops;
|
||||
@@ -865,6 +873,11 @@ static int gk20a_channel_semaphore_syncpt_id(struct gk20a_channel_sync *s)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static u64 gk20a_channel_semaphore_syncpt_address(struct gk20a_channel_sync *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s)
|
||||
{
|
||||
struct gk20a_channel_semaphore *sema =
|
||||
@@ -916,6 +929,7 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c)
|
||||
sema->ops.set_min_eq_max = gk20a_channel_semaphore_set_min_eq_max;
|
||||
sema->ops.signal_timeline = gk20a_channel_semaphore_signal_timeline;
|
||||
sema->ops.syncpt_id = gk20a_channel_semaphore_syncpt_id;
|
||||
sema->ops.syncpt_address = gk20a_channel_semaphore_syncpt_address;
|
||||
sema->ops.destroy = gk20a_channel_semaphore_destroy;
|
||||
|
||||
return &sema->ops;
|
||||
|
||||
Reference in New Issue
Block a user