Skip to contentSkip to conversation

drm/i915: Only call skl_check_plane_surface() for visible planes

PATCH In review Matt Roper 3 participants 4 messages Jan 13, 2017 – Jan 16, 2017

Subsystems (2)
lore
Share & tools
lore

Matt Roper

author
#0 lore raw

PATCH 1/1 drm/i915: Only call skl_check_plane_surface() for visible planes

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.

Cc Ville Syrjälä <[email protected]>
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

---
There may be additional IGT tests (e.g., in kms_plane) that also trip over this. I only listed the two that I was using for debugging when I tracked this down.

 drivers/gpu/drm/i915/intel_display.c | 2 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 0a38de9..9295f8a 100644
@@ -15149,7 +15149,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;
drivers/gpu/drm/i915/intel_sprite.c +1 -1
index ada8f7a..5cedea4 100644
@@ -967,7 +967,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
 	dst->y1 = crtc_y;
 	dst->y2 = crtc_y + crtc_h;
 
-	if (INTEL_GEN(dev) >= 9) {
+	if (INTEL_GEN(dev) >= 9 && state->base.visible) {
 		ret = skl_check_plane_surface(state);
 		if (ret)
 			return ret;
Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw

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

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ä <[email protected]>
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

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index fd5fbc8..3baba59 100644
@@ -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;
drivers/gpu/drm/i915/intel_sprite.c +1 -1
index 7031bc7..b7b16a15 100644
@@ -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;
Signature · 6 lines
2.10.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✓ Fi.CI.BAT: success for drm/i915: Only call skl_check_plane_surface() for visible planes (rev2)

In reply to Matt Roper
== Series Details ==

== Series Details ==

Series: drm/i915: Only call skl_check_plane_surface() for visible planes (rev2)
URL : https://patchwork.freedesktop.org/series/17996/
State : success

== Summary ==

Series 17996v2 drm/i915: Only call skl_check_plane_surface() for visible planes
https://patchwork.freedesktop.org/api/1.0/series/17996/revisions/2/mbox/

fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

a957dfe613ab43c6af84833f2b88ea941320250f drm-tip: 2017y-01m-13d-18h-49m-04s UTC integration manifest daf8ca0 drm/i915: Only call skl_check_plane_surface() for visible planes (v2)

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3514/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Matt Roper
Quoted 45 lines · Matt Roper

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.

Cc Ville Syrjälä <[email protected]>
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

---
There may be additional IGT tests (e.g., in kms_plane) that also trip over this. I only listed the two that I was using for debugging when I tracked this down.

 drivers/gpu/drm/i915/intel_display.c | 2 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 0a38de9..9295f8a 100644
@@ -15149,7 +15149,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;
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index ada8f7a..5cedea4 100644

drivers/gpu/drm/i915/intel_sprite.c intel_check_sprite_plane(struct drm_plane *plane, · line 973

Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -1
@@ -967,7 +967,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
 	dst->y1 = crtc_y;
 	dst->y2 = crtc_y + crtc_h;
 
-	if (INTEL_GEN(dev) >= 9) {
+	if (INTEL_GEN(dev) >= 9 && state->base.visible) {
 		ret = skl_check_plane_surface(state);
 		if (ret)
 			return ret;

So kinda like
https://patchwork.freedesktop.org/patch/120204/

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx