host1x_emu: Fix NvHost Interface and IOCTL

1. The nvhost interface like syncpoint offset/aperture were
taking "pdev" of Host1x device, but emulated syncpoint driver
implementd the interface with "pdev" of clinet device. This was
done to align all other interface input parameter.

This patch revert the above alignment of intput parameter change.

2. This patch modify SyncpointWait IOCTL handler to return timestamp
of signal observed by KMD to UMD

Bug 4895937

Change-Id: I61ba02992963ba272e5c2514ffe8c24fff510c3a
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3226744
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
This commit is contained in:
amitabhd
2024-10-09 10:19:23 +00:00
committed by Jon Hunter
parent d32b4667a5
commit d1d3b883df
3 changed files with 63 additions and 34 deletions

View File

@@ -218,19 +218,27 @@ static int host1x_ioctl_syncpoint_wait(
struct host1x_emu_ctrl_syncpt_wait_args *args)
{
signed long timeout_jiffies;
struct host1x_syncpt *sp;
struct host1x *host = ctx->host;
signed long timeout_jiffies;
struct host1x_syncpt *sp;
struct host1x *host = ctx->host;
ktime_t ts;
int err;
sp = HOST1X_EMU_EXPORT_CALL(host1x_syncpt_get_by_id_noref(host, args->id));
if (!sp)
return -EINVAL;
timeout_jiffies = timeout_abs_to_jiffies(args->timeout_ns);
sp = HOST1X_EMU_EXPORT_CALL(host1x_syncpt_get_by_id_noref(host, args->id));
if (!sp)
return -EINVAL;
return HOST1X_EMU_EXPORT_CALL(host1x_syncpt_wait(sp,
args->threshold,
timeout_jiffies,
&args->value));
timeout_jiffies = timeout_abs_to_jiffies(args->timeout_ns);
err = HOST1X_EMU_EXPORT_CALL(host1x_syncpt_wait_ts(sp,
args->threshold,
timeout_jiffies,
&args->value,
&ts));
if (err)
return err;
args->timestamp = ktime_to_ns(ts);
return 0;
}
static long host1x_ctrlctl(struct file *filp, unsigned int cmd, unsigned long arg)