Skip to content

Commit 47e157a

Browse files
committed
drm/i915/plane: warn on non-zero plane offset
We assume the plane offset is 0. Warn if it's not. This also fixes a warn on unused but set variable offset. v2: initialize offset on the gen2/3 path (Ville) Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230526172218.1597394-1-jani.nikula@intel.com
1 parent 8690be0 commit 47e157a

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpu/drm/i915/display/i9xx_plane.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,10 +1033,13 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
10331033
DSPLINOFF(i9xx_plane));
10341034
base = intel_de_read(dev_priv, DSPSURF(i9xx_plane)) & DISP_ADDR_MASK;
10351035
} else {
1036+
offset = 0;
10361037
base = intel_de_read(dev_priv, DSPADDR(i9xx_plane));
10371038
}
10381039
plane_config->base = base;
10391040

1041+
drm_WARN_ON(&dev_priv->drm, offset != 0);
1042+
10401043
val = intel_de_read(dev_priv, PIPESRC(pipe));
10411044
fb->width = REG_FIELD_GET(PIPESRC_WIDTH_MASK, val) + 1;
10421045
fb->height = REG_FIELD_GET(PIPESRC_HEIGHT_MASK, val) + 1;

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,6 +2529,7 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
25292529
plane_config->base = base;
25302530

25312531
offset = intel_de_read(dev_priv, PLANE_OFFSET(pipe, plane_id));
2532+
drm_WARN_ON(&dev_priv->drm, offset != 0);
25322533

25332534
val = intel_de_read(dev_priv, PLANE_SIZE(pipe, plane_id));
25342535
fb->height = REG_FIELD_GET(PLANE_HEIGHT_MASK, val) + 1;

0 commit comments

Comments
 (0)