[PATCH] drm/i915: Only call skl_check_plane_surface() for visible planes (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a plane is fully clipped (either because it's positioned offscreen,
or because the CRTC is currently off), the clipping calculations we do
during check_plane will leave nonsense/negative coordinates in plane's
source rectangle.  This is generally harmless since we recognize that
the plane should be turned off and we don't try to actually do anything
with those values.  However on gen9 platforms, we still try to do
surface offset math in skl_check_plane_surface() which gets confused and
reports "Unable to find suitable display surface offset."  Given that
the plane will be disabled anyway, none of these calculations are
actually necessary, so just skip calling the function on non-visible
planes.

v2: Rebase

Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
Fixes: b63a16f6cd ("drm/i915: Compute display surface offset in the plane check hook for SKL+")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98258
Testcase: igt/pm_rpm/legacy-planes
Testcase: igt/pm_rpm/universal-planes
Signed-off-by: Matt Roper <matthew.d.roper@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fd5fbc8..3baba59 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14924,7 +14924,7 @@ intel_check_primary_plane(struct drm_plane *plane,
 	if (!state->base.fb)
 		return 0;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
+	if (INTEL_GEN(dev_priv) >= 9 && state->base.visible) {
 		ret = skl_check_plane_surface(state);
 		if (ret)
 			return ret;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 7031bc7..b7b16a15 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -918,7 +918,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
 	dst->y1 = crtc_y;
 	dst->y2 = crtc_y + crtc_h;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
+	if (INTEL_GEN(dev_priv) >= 9 && state->base.visible) {
 		ret = skl_check_plane_surface(state);
 		if (ret)
 			return ret;
-- 
2.10.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux