[PATCH v2 02/20] drm: Don't update plane properties for atomic planes if it stays the same

Maarten Lankhorst
2015-07-07T07:08:13Z

This allows the first atomic call during hw init to be a real modeset,
which is useful for forcing a recalculation.

Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/drm_fb_helper.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index cac422916c7a..33b5e4ecaf46 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -322,10 +322,12 @@ static bool restore_fbdev_mode(struct drm_fb_helper *fb_helper)
drm_warn_on_modeset_not_all_locked(dev);

list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
- if (plane->type != DRM_PLANE_TYPE_PRIMARY)
+ if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
+ (!plane->state || plane->state->fb))
drm_plane_force_disable(plane);

- if (dev->mode_config.rotation_property) {
+ if (dev->mode_config.rotation_property &&
+ (!plane->state || plane->state->rotation != BIT(DRM_ROTATE_0))) {
drm_mode_plane_set_obj_prop(plane,
dev->mode_config.rotation_property,
BIT(DRM_ROTATE_0));
--
2.1.0