Skip to content

Commit

Permalink
fix bo create failure when run with prelim kernel
Browse files Browse the repository at this point in the history
It seems prelim kernel doesn't support set_tiling/get_tiling ioctl

Signed-off-by: Fei Jiang <[email protected]>
  • Loading branch information
feijiang1 authored and HaihongxLi committed Feb 27, 2024
1 parent b4da934 commit 8d96239
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ static int i915_add_combinations(struct driver *drv)
render = unset_flags(render, linear_mask | camera_mask);
scanout_and_render = unset_flags(scanout_and_render, linear_mask |camera_mask);

if (is_kvm && i915->is_adlp) {
scanout_and_render = unset_flags(scanout_and_render, BO_USE_SCANOUT);
}

/* On dGPU, only use linear */
if (i915->genx10 >= 125)
Expand Down Expand Up @@ -860,7 +863,7 @@ static int i915_bo_create_from_metadata(struct bo *bo)
for (plane = 0; plane < bo->meta.num_planes; plane++)
bo->handles[plane].u32 = gem_handle;

if (i915_dev->genx10 != 125) {
if (!is_prelim_kernel && i915_dev->genx10 != 125) {
memset(&gem_set_tiling, 0, sizeof(gem_set_tiling));
gem_set_tiling.handle = bo->handles[0].u32;
gem_set_tiling.tiling_mode = bo->meta.tiling;
Expand Down Expand Up @@ -895,7 +898,7 @@ static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
if (ret)
return ret;

if (i915_dev->genx10 != 125) {
if (!is_prelim_kernel && i915_dev->genx10 != 125) {
/* TODO(gsingh): export modifiers and get rid of backdoor tiling. */
memset(&gem_get_tiling, 0, sizeof(gem_get_tiling));
gem_get_tiling.handle = bo->handles[0].u32;
Expand Down

0 comments on commit 8d96239

Please sign in to comment.