.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;
{
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.
*/
}
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)
{
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);
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;