All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HAX: Do not restore mode through fbcon
@ 2017-10-13 14:10 Maarten Lankhorst
  2017-10-13 14:10 ` [PATCH i-g-t 1/2] tests/kms_plane_lowres: Rework tests to work without fbcon Maarten Lankhorst
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-10-13 14:10 UTC (permalink / raw)
  To: intel-gfx

Lets try it and see what breaks!

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 6a31d13f2f81..0414da99de5b 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -352,7 +352,8 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
 	struct drm_device *dev = fb_helper->dev;
 	struct drm_plane *plane;
 	struct drm_atomic_state *state;
-	int i, ret;
+	struct drm_crtc *crtc;
+	int ret;
 	unsigned int plane_mask;
 	struct drm_modeset_acquire_ctx ctx;
 
@@ -381,32 +382,23 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
 		plane->old_fb = plane->fb;
 		plane_mask |= 1 << drm_plane_index(plane);
 
-		/* disable non-primary: */
-		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
-
 		ret = __drm_atomic_helper_disable_plane(plane, plane_state);
 		if (ret != 0)
 			goto out_state;
 	}
 
-	for (i = 0; i < fb_helper->crtc_count; i++) {
-		struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
+	drm_for_each_crtc(crtc, dev) {
+		struct drm_crtc_state *crtc_state = drm_atomic_get_crtc_state(state, crtc);
 
-		ret = __drm_atomic_helper_set_config(mode_set, state);
-		if (ret != 0)
+		if (IS_ERR(crtc_state)) {
+			ret = PTR_ERR(crtc_state);
 			goto out_state;
-
-		/*
-		 * __drm_atomic_helper_set_config() sets active when a
-		 * mode is set, unconditionally clear it if we force DPMS off
-		 */
-		if (!active) {
-			struct drm_crtc *crtc = mode_set->crtc;
-			struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
-
-			crtc_state->active = false;
 		}
+
+		crtc_state->active = false;
+		ret = drm_atomic_set_mode_for_crtc(crtc_state, NULL);
+		if (ret)
+			goto out_state;
 	}
 
 	ret = drm_atomic_commit(state);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread
* [PATCH] HAX: Do not restore mode through fbcon
@ 2017-10-13  7:51 Maarten Lankhorst
  0 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-10-13  7:51 UTC (permalink / raw)
  To: intel-gfx

Lets try it and see what breaks!

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 6a31d13f2f81..0414da99de5b 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -352,7 +352,8 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
 	struct drm_device *dev = fb_helper->dev;
 	struct drm_plane *plane;
 	struct drm_atomic_state *state;
-	int i, ret;
+	struct drm_crtc *crtc;
+	int ret;
 	unsigned int plane_mask;
 	struct drm_modeset_acquire_ctx ctx;
 
@@ -381,32 +382,23 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
 		plane->old_fb = plane->fb;
 		plane_mask |= 1 << drm_plane_index(plane);
 
-		/* disable non-primary: */
-		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
-
 		ret = __drm_atomic_helper_disable_plane(plane, plane_state);
 		if (ret != 0)
 			goto out_state;
 	}
 
-	for (i = 0; i < fb_helper->crtc_count; i++) {
-		struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
+	drm_for_each_crtc(crtc, dev) {
+		struct drm_crtc_state *crtc_state = drm_atomic_get_crtc_state(state, crtc);
 
-		ret = __drm_atomic_helper_set_config(mode_set, state);
-		if (ret != 0)
+		if (IS_ERR(crtc_state)) {
+			ret = PTR_ERR(crtc_state);
 			goto out_state;
-
-		/*
-		 * __drm_atomic_helper_set_config() sets active when a
-		 * mode is set, unconditionally clear it if we force DPMS off
-		 */
-		if (!active) {
-			struct drm_crtc *crtc = mode_set->crtc;
-			struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
-
-			crtc_state->active = false;
 		}
+
+		crtc_state->active = false;
+		ret = drm_atomic_set_mode_for_crtc(crtc_state, NULL);
+		if (ret)
+			goto out_state;
 	}
 
 	ret = drm_atomic_commit(state);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-10-23 10:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 14:10 [PATCH] HAX: Do not restore mode through fbcon Maarten Lankhorst
2017-10-13 14:10 ` [PATCH i-g-t 1/2] tests/kms_plane_lowres: Rework tests to work without fbcon Maarten Lankhorst
2017-10-13 14:10 ` [PATCH i-g-t] tests/pm_backlight: Enable connected output to allow tests to succeed, v2 Maarten Lankhorst
2017-10-13 14:58   ` [PATCH i-g-t] tests/kms_plane_lowres: Rework tests to work without fbcon Maarten Lankhorst
2017-10-23 10:05     ` Mika Kahola
2017-10-23 10:14       ` Maarten Lankhorst
2017-10-13 14:10 ` [PATCH i-g-t 2/2] tests/drm_read: Change tests to not require fbcon Maarten Lankhorst
2017-10-13 14:22   ` Chris Wilson
2017-10-16  7:40     ` Maarten Lankhorst
2017-10-13 16:44 ` ✗ Fi.CI.BAT: failure for HAX: Do not restore mode through fbcon (rev2) Patchwork
2017-10-13 19:06 ` ✗ Fi.CI.BAT: warning for tests/pm_backlight: Enable connected output to allow tests to succeed, v2. (rev2) Patchwork
2017-10-20 14:12 ` ✗ Fi.CI.BAT: failure for HAX: Do not restore mode through fbcon (rev2) Patchwork
2017-10-20 15:07 ` Patchwork
2017-10-20 15:17 ` ✗ Fi.CI.IGT: " Patchwork
2017-10-20 17:08 ` Patchwork
2017-10-21 12:53 ` ✗ Fi.CI.BAT: " Patchwork
2017-10-21 13:43 ` ✗ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-10-13  7:51 [PATCH] HAX: Do not restore mode through fbcon Maarten Lankhorst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.