From c1ac4ea13e27bafa51d54e8bf9584a0b96ec5de6 Mon Sep 17 00:00:00 2001 From: Dmitry Osipenko Date: Thu, 30 Mar 2023 21:21:24 +0300 Subject: [PATCH] hasvk: Use intel_ioctl() helper for GEM_SET_TILING MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace opencoded ioctl() usage with a common intel_ioctl() helper. Reviewed-by: José Roberto de Souza Signed-off-by: Dmitry Osipenko Part-of: --- src/intel/vulkan_hasvk/anv_gem.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/intel/vulkan_hasvk/anv_gem.c b/src/intel/vulkan_hasvk/anv_gem.c index 5844016952a..3d9d51e6563 100644 --- a/src/intel/vulkan_hasvk/anv_gem.c +++ b/src/intel/vulkan_hasvk/anv_gem.c @@ -225,8 +225,6 @@ int anv_gem_set_tiling(struct anv_device *device, uint32_t gem_handle, uint32_t stride, uint32_t tiling) { - int ret; - /* On discrete platforms we don't have DRM_IOCTL_I915_GEM_SET_TILING. So * nothing needs to be done. */ @@ -236,17 +234,13 @@ anv_gem_set_tiling(struct anv_device *device, /* set_tiling overwrites the input on the error path, so we have to open * code intel_ioctl. */ - do { - struct drm_i915_gem_set_tiling set_tiling = { - .handle = gem_handle, - .tiling_mode = tiling, - .stride = stride, - }; + struct drm_i915_gem_set_tiling set_tiling = { + .handle = gem_handle, + .tiling_mode = tiling, + .stride = stride, + }; - ret = ioctl(device->fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); - - return ret; + return intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); } bool