All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] HAX: Do not restore mode through fbcon
Date: Fri, 13 Oct 2017 16:10:46 +0200	[thread overview]
Message-ID: <20171013141049.5242-1-maarten.lankhorst@linux.intel.com> (raw)

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

             reply	other threads:[~2017-10-13 14:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 14:10 Maarten Lankhorst [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171013141049.5242-1-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.