Skip to contentSkip to conversation

drm/i915: Don't call intel_plane_restore() when the prop value didn't change

PATCH In review [email protected] 2 participants 3 messages Sep 1, 2014 – Sep 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Don't call intel_plane_restore() when the prop value didn't change

From: Ville Syrjälä <[email protected]>

No point in calling intel_plane_restore() in .set_property() if the value didn't change.

More importantly this papers over a bug where the current primary plane code forgets to update the user coordinates we store under intel_plane unless the primary plane .update_plane() hook is actually called. This means we have 0 in the coordinates straight after boot and any call to intel_restore_plane() (such as from restore_fbdev_mode()) will actually turn off the primary plane. This mess needs to be fixed properly but that's a bigger task and the first step there is killing off intel_pipe_set_base() and just calling the primary plane .update_plane() hook. For the immediate problem of black screen after boot this small patch is enough to hide it.

The problem originates from these two commits:
commit 3a5f87c286515c54ff5c52c3e64d0c522b7570c0
Author: Thomas Wood <[email protected]>
Date: Wed Aug 20 14:45:00 2014 +0100

drm: fix plane rotation when restoring fbdev configuration

commit d91a2cb8e5104233c02bbde539bd4ee455ec12ac
Author: Sonika Jindal <[email protected]>
Date: Fri Aug 22 14:06:04 2014 +0530

drm/i915: Add 180 degree primary plane rotation support

---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index fd5f271..cf596cd 100644
@@ -1232,6 +1232,9 @@ int intel_plane_set_property(struct drm_plane *plane,
 		if (hweight32(val & 0xf) != 1)
 			return -EINVAL;
 
+		if (intel_plane->rotation == val)
+			return 0;
+
 		old_val = intel_plane->rotation;
 		intel_plane->rotation = val;
 		ret = intel_plane_restore(plane);
Signature · 6 lines
1.8.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · On Mon, Sep 01, 2014 at 06:08:25PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

No point in calling intel_plane_restore() in .set_property() if the value didn't change.

More importantly this papers over a bug where the current primary plane code forgets to update the user coordinates we store under intel_plane unless the primary plane .update_plane() hook is actually called. This means we have 0 in the coordinates straight after boot and any call to intel_restore_plane() (such as from restore_fbdev_mode()) will actually turn off the primary plane. This mess needs to be fixed properly but that's a bigger task and the first step there is killing off intel_pipe_set_base() and just calling the primary plane .update_plane() hook. For the immediate problem of black screen after boot this small patch is enough to hide it.

The problem originates from these two commits:
commit 3a5f87c286515c54ff5c52c3e64d0c522b7570c0
Author: Thomas Wood <[email protected]>
Date: Wed Aug 20 14:45:00 2014 +0100

drm: fix plane rotation when restoring fbdev configuration

commit d91a2cb8e5104233c02bbde539bd4ee455ec12ac
Author: Sonika Jindal <[email protected]>
Date: Fri Aug 22 14:06:04 2014 +0530

Quoted 6 lines

drm/i915: Add 180 degree primary plane rotation support

Signature · 1 line
Damien
Quoted 25 lines
---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index fd5f271..cf596cd 100644
@@ -1232,6 +1232,9 @@ int intel_plane_set_property(struct drm_plane *plane,
 		if (hweight32(val & 0xf) != 1)
 			return -EINVAL;
 
+		if (intel_plane->rotation == val)
+			return 0;
+
 		old_val = intel_plane->rotation;
 		intel_plane->rotation = val;
 		ret = intel_plane_restore(plane);
Signature · 6 lines
1.8.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx