aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Roberto de Souza <[email protected]>2021-05-06 19:19:27 +0300
committerImre Deak <[email protected]>2021-05-07 11:13:01 +0300
commit2ac5620fbe31d4a2364b82390deaf59892a0d4f4 (patch)
treec841b1f6bb638988523a5eddef00f3902eb73c82
parente7367af1ee3df07820de61e9b9896c4979f4132c (diff)
drm/i915/adl_p: Add stride restriction when using DPT
Alderlake-P have a new stride restriction when using DPT and it is used by non linear framebuffers. Stride needs to be a power of two to take full DPT rows, but stride is a parameter set by userspace. What we could do is use a fake stride when doing DPT allocation so HW requirements are met and userspace don't need to be changed to met this power of two restrictions but this change will take a while to be implemented so for now adding this restriction in driver to reject atomic commits that would cause visual corruptions. BSpec: 53393 Acked-by: Matt Roper <[email protected]> Cc: Matt Roper <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Stanislav Lisovskiy <[email protected]> Signed-off-by: José Roberto de Souza <[email protected]> Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Clint Taylor <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/i915/display/intel_display.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 53dbf3d0f3b2..bd6655045118 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -11580,6 +11580,15 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
}
}
+ if (IS_ALDERLAKE_P(dev_priv) &&
+ mode_cmd->modifier[i] != DRM_FORMAT_MOD_LINEAR &&
+ !is_power_of_2(mode_cmd->pitches[i])) {
+ drm_dbg_kms(&dev_priv->drm,
+ "plane %d pitch (%d) must be power of two for tiled buffers\n",
+ i, mode_cmd->pitches[i]);
+ goto err;
+ }
+
fb->obj[i] = &obj->base;
}