Re: [Intel-gfx] [PATCH i-g-t v3 08/11] lib/ioctl_wrappers: update set_domain for discrete

Dixit, Ashutosh
2021-08-02T06:24:52Z

On Fri, 30 Jul 2021 01:53:45 -0700, Matthew Auld wrote:
>
> On discrete set_domain is now gone, instead we just need to add the
> wait.

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> ---
> lib/ioctl_wrappers.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 7e27a1b3..09eb3ce7 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -565,7 +565,12 @@ int __gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write)
> */
> void gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write)
> {
> - igt_assert_eq(__gem_set_domain(fd, handle, read, write), 0);
> + int ret = __gem_set_domain(fd, handle, read, write);
> +
> + if (ret == -ENODEV && gem_has_lmem(fd))
> + igt_assert_eq(gem_wait(fd, handle, 0), 0);
> + else
> + igt_assert_eq(ret, 0);
> }
>
> /**
> --
> 2.26.3
>