drm/tegra: Add new syncpoint increment IOCTL

Add new syncpoint increment IOCTL in line with the new channel/
syncpoint IOCTLs, that only allows incrementing owned syncpoints.

Change-Id: Ieed11e1ba840da31ecfe7029051bfa61b88cd2b5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284407
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
This commit is contained in:
Mikko Perttunen
2024-10-31 04:29:11 +00:00
committed by Jon Hunter
parent 5362309e7f
commit 92ed8780d2
4 changed files with 40 additions and 0 deletions

View File

@@ -574,3 +574,27 @@ put_syncpts:
return err;
}
int tegra_drm_ioctl_syncpoint_increment(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct drm_tegra_syncpoint_increment *args = data;
struct tegra_drm_file *fpriv = file->driver_priv;
struct host1x_syncpt *sp;
int err;
if (args->padding != 0)
return -EINVAL;
mutex_lock(&fpriv->lock);
sp = xa_load(&fpriv->syncpoints, args->id);
if (!sp) {
mutex_unlock(&fpriv->lock);
return -EINVAL;
}
err = host1x_syncpt_incr(sp);
mutex_unlock(&fpriv->lock);
return err;
}