anv/dg1: Don't use SET_TILING kernel uapi.

It is not available on discrete platforms anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>
This commit is contained in:
Rafael Antognolli
2020-04-27 22:54:51 +00:00
committed by Jordan Justen
parent e658835436
commit 37a724e4ae
2 changed files with 20 additions and 4 deletions

View File

@@ -227,6 +227,11 @@ anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle)
.handle = gem_handle,
};
/* FIXME: On discrete platforms we don't have DRM_IOCTL_I915_GEM_GET_TILING
* anymore, so we will need another way to get the tiling. Apparently this
* is only used in Android code, so we may need some other way to
* communicate the tiling mode.
*/
if (gen_ioctl(device->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling)) {
assert(!"Failed to get BO tiling");
return -1;
@@ -241,6 +246,12 @@ anv_gem_set_tiling(struct anv_device *device,
{
int ret;
/* On discrete platforms we don't have DRM_IOCTL_I915_GEM_SET_TILING. So
* nothing needs to be done.
*/
if (!device->info.has_tiling_uapi)
return 0;
/* set_tiling overwrites the input on the error path, so we have to open
* code gen_ioctl.
*/

View File

@@ -93,7 +93,8 @@ choose_isl_surf_usage(VkImageCreateFlags vk_create_flags,
}
static isl_tiling_flags_t
choose_isl_tiling_flags(const struct anv_image_create_info *anv_info,
choose_isl_tiling_flags(const struct gen_device_info *devinfo,
const struct anv_image_create_info *anv_info,
const struct isl_drm_modifier_info *isl_mod_info,
bool legacy_scanout)
{
@@ -117,8 +118,12 @@ choose_isl_tiling_flags(const struct anv_image_create_info *anv_info,
if (anv_info->isl_tiling_flags)
flags &= anv_info->isl_tiling_flags;
if (legacy_scanout)
flags &= ISL_TILING_LINEAR_BIT | ISL_TILING_X_BIT;
if (legacy_scanout) {
isl_tiling_flags_t legacy_mask = ISL_TILING_LINEAR_BIT;
if (devinfo->has_tiling_uapi)
legacy_mask |= ISL_TILING_X_BIT;
flags &= legacy_mask;
}
assert(flags);
@@ -734,7 +739,7 @@ anv_image_create(VkDevice _device,
assert(format != NULL);
const isl_tiling_flags_t isl_tiling_flags =
choose_isl_tiling_flags(create_info, isl_mod_info,
choose_isl_tiling_flags(&device->info, create_info, isl_mod_info,
image->needs_set_tiling);
image->n_planes = format->n_planes;