Skip to content

Commit d9a5158

Browse files
ideakrodrigovivi
authored andcommitted
drm/i915/gen9+: Fix initial readout for Y tiled framebuffers
If BIOS configured a Y tiled FB we failed to set up the backing object tiling accordingly, leading to a lack of GT fence installed and a garbled console. The problem was bisected to commit 011f22e ("drm/i915: Do NOT skip the first 4k of stolen memory for pre-allocated buffers v2") but it just revealed a pre-existing issue. Kudos to Ville who suspected a missing fence looking at the corruption on the screen. Cc: Ville Syrjälä <[email protected]> Cc: Mika Westerberg <[email protected]> Cc: Hans de Goede <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Reported-by: Mika Westerberg <[email protected]> Reported-by: <[email protected]> Tested-by: <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108264 Fixes: bc8d7df ("drm/i915/skl: Provide a Skylake version of get_plane_config()") Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 914a4fd) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent ab0d6a1 commit d9a5158

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,6 +2722,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
27222722
if (size_aligned * 2 > dev_priv->stolen_usable_size)
27232723
return false;
27242724

2725+
switch (fb->modifier) {
2726+
case DRM_FORMAT_MOD_LINEAR:
2727+
case I915_FORMAT_MOD_X_TILED:
2728+
case I915_FORMAT_MOD_Y_TILED:
2729+
break;
2730+
default:
2731+
DRM_DEBUG_DRIVER("Unsupported modifier for initial FB: 0x%llx\n",
2732+
fb->modifier);
2733+
return false;
2734+
}
2735+
27252736
mutex_lock(&dev->struct_mutex);
27262737
obj = i915_gem_object_create_stolen_for_preallocated(dev_priv,
27272738
base_aligned,
@@ -2731,8 +2742,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
27312742
if (!obj)
27322743
return false;
27332744

2734-
if (plane_config->tiling == I915_TILING_X)
2735-
obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X;
2745+
switch (plane_config->tiling) {
2746+
case I915_TILING_NONE:
2747+
break;
2748+
case I915_TILING_X:
2749+
case I915_TILING_Y:
2750+
obj->tiling_and_stride = fb->pitches[0] | plane_config->tiling;
2751+
break;
2752+
default:
2753+
MISSING_CASE(plane_config->tiling);
2754+
return false;
2755+
}
27362756

27372757
mode_cmd.pixel_format = fb->format->format;
27382758
mode_cmd.width = fb->width;
@@ -8865,6 +8885,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
88658885
fb->modifier = I915_FORMAT_MOD_X_TILED;
88668886
break;
88678887
case PLANE_CTL_TILED_Y:
8888+
plane_config->tiling = I915_TILING_Y;
88688889
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
88698890
fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
88708891
else

0 commit comments

Comments
 (0)