mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
anv: Use intel_ioctl() helper for GEM_SET_TILING
Replace opencoded ioctl() usage with a common intel_ioctl() helper. Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23399>
This commit is contained in:
parent
16cc0c0eda
commit
4a2655d084
1 changed files with 6 additions and 12 deletions
|
|
@ -146,8 +146,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.
|
||||
*/
|
||||
|
|
@ -157,17 +155,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);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue