mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
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 <mperttunen@nvidia.com> Change-Id: I80204c23486dd476c6b67a3897934f301833c7f5 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2729281 Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
9734cc0d92
commit
381919e9c3
@@ -34,7 +34,7 @@
|
||||
#define DRIVER_DATE "20120330"
|
||||
#define DRIVER_MAJOR 1
|
||||
#define DRIVER_MINOR 0
|
||||
#define DRIVER_PATCHLEVEL 0
|
||||
#define DRIVER_PATCHLEVEL 99
|
||||
|
||||
#define CARVEOUT_SZ SZ_64M
|
||||
#define CDMA_GATHER_FETCHES_MAX_NB 16383
|
||||
|
||||
@@ -916,6 +916,8 @@ struct drm_tegra_submit_syncpt {
|
||||
__u32 value;
|
||||
};
|
||||
|
||||
#define DRM_TEGRA_SUBMIT_SECONDARY_SYNCPT (1<<0)
|
||||
|
||||
struct drm_tegra_channel_submit {
|
||||
/**
|
||||
* @context: [in]
|
||||
@@ -989,6 +991,20 @@ struct drm_tegra_channel_submit {
|
||||
* Information about the syncpoint the job will increment.
|
||||
*/
|
||||
struct drm_tegra_submit_syncpt syncpt;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* @secondary_syncpt_id: [in]
|
||||
*
|
||||
* Secondary syncpoint the job may increment, not used for job tracking.
|
||||
*/
|
||||
__u32 secondary_syncpt_id;
|
||||
};
|
||||
|
||||
struct drm_tegra_syncpoint_allocate {
|
||||
|
||||
@@ -350,6 +350,16 @@ static int submit_get_syncpt(struct tegra_drm_context *context, struct host1x_jo
|
||||
job->syncpt = host1x_syncpt_get(sp);
|
||||
job->syncpt_incrs = args->syncpt.increments;
|
||||
|
||||
if (args->flags & DRM_TEGRA_SUBMIT_SECONDARY_SYNCPT) {
|
||||
sp = xa_load(syncpoints, args->secondary_syncpt_id);
|
||||
if (!sp) {
|
||||
SUBMIT_ERR(context, "secondary syncpt was not allocated");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
job->secondary_syncpt = host1x_syncpt_get(sp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -532,6 +542,11 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (args->flags & !(DRM_TEGRA_SUBMIT_SECONDARY_SYNCPT)) {
|
||||
SUBMIT_ERR(context, "invalid flags '%#x'", args->flags);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (args->syncobj_in) {
|
||||
struct dma_fence *fence;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user