From 0955b8b8a539e42dace0242dbf44287fade1c139 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Wed, 15 Jun 2022 14:42:09 +0300 Subject: [PATCH] drm/tegra: Add support for secondary syncpoint Add support for secondary (non-job tracking) syncpoint used for NVENC slice encoding. Bug 3589873 Signed-off-by: Mikko Perttunen Change-Id: I80204c23486dd476c6b67a3897934f301833c7f5 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2729281 Reviewed-by: svc_kernel_abi Reviewed-by: Jonathan Hunter GVS: Gerrit_Virtual_Submit --- drivers/gpu/host1x/hw/channel_hw.c | 2 ++ drivers/gpu/host1x/include/linux/host1x-next.h | 3 +++ drivers/gpu/host1x/job.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 4eda10a3..ba556ba1 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -217,6 +217,8 @@ static int channel_submit(struct host1x_job *job) syncval = host1x_syncpt_incr_max(sp, user_syncpt_incrs); host1x_hw_syncpt_assign_to_channel(host, sp, ch); + if (job->secondary_syncpt) + host1x_hw_syncpt_assign_to_channel(host, job->secondary_syncpt, ch); job->syncpt_end = syncval; diff --git a/drivers/gpu/host1x/include/linux/host1x-next.h b/drivers/gpu/host1x/include/linux/host1x-next.h index 406a401b..251cd471 100644 --- a/drivers/gpu/host1x/include/linux/host1x-next.h +++ b/drivers/gpu/host1x/include/linux/host1x-next.h @@ -290,6 +290,9 @@ struct host1x_job { u32 syncpt_incrs; u32 syncpt_end; + /* Non-job tracking related syncpoint */ + struct host1x_syncpt *secondary_syncpt; + /* Completion waiter ref */ void *waiter; diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 117a8f5f..2754f9ac 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -95,6 +95,9 @@ static void job_free(struct kref *ref) if (job->syncpt) host1x_syncpt_put(job->syncpt); + if (job->secondary_syncpt) + host1x_syncpt_put(job->secondary_syncpt); + kfree(job); }