[Intel-gfx] [PATCH i-g-t 6/7] lib/ioctl_wrappers: update set_domain for discrete

Matthew Auld
2021-07-26T12:04:16Z

On discrete set_domain is now gone, instead we just need to add the
wait.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.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);
}

/**