Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382Ab1BDBO2 (ORCPT ); Thu, 3 Feb 2011 20:14:28 -0500 Received: from home.keithp.com ([63.227.221.253]:59248 "EHLO keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585Ab1BDBOZ (ORCPT ); Thu, 3 Feb 2011 20:14:25 -0500 X-Greylist: delayed 504 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Feb 2011 20:14:25 EST From: Keith Packard To: Linus Torvalds , Dave Airlie Cc: Carlos Mafra , Dave Airlie , "Rafael J. Wysocki" , Takashi Iwai , Linux Kernel Mailing List , Maciej Rutecki , Florian Mickler , Andrew Morton , Kernel Testers List , Network Development , Linux ACPI , Linux PM List , Linux SCSI List , Linux Wireless List , DRI Subject: Re: 2.6.38-rc3-git1: Reported regressions 2.6.36 -> 2.6.37 In-Reply-To: References: <201102032009.17100.rjw@sisk.pl> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 03 Feb 2011 17:05:54 -0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4525 Lines: 128 --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, 3 Feb 2011 16:30:56 -0800, Linus Torvalds wrote: > On Thu, Feb 3, 2011 at 4:06 PM, Dave Airlie wrote: > > > > If we are setting a mode on a connector it automatically will end up > > in a DPMS on state, > > so this seemed correct from what I can see. >=20 > The more I look at that function, the more I disagree with you and > with that patch. >=20 > The code is just crazy. >=20 > First off, it isn't even necessarily setting a mode to begin with, > because as far as I can tell. If the mode doesn't change, neither > mode_changed nor fb_changed will be true, afaik. There seems to be a > fair amount of code there explicitly to avoid changing modes if not > necessary. >=20 > But even _if_ we are setting a mode, if I read the code correctly, the > mode may be set to NULL - which seems to mean "turn it off". In which > case it looks to me that drm_helper_disable_unused_functions() will > actually do a >=20 > (*crtc_funcs->dpms)(crtc, DRM_MODE_DPMS_OFF); >=20 > call on the crtc in question. So then blindly just saying "it's mode > DRM_MODE_DPMS_ON" afterwards looks rather bogus to me. >=20 > _Maybe_ it would work if it was done before that whole > "disable_unused" logic. Or maybe it should just be done in > drm_crtc_helper_set_mode(), which is what actually sets the mode (but > there's the 'fb_changed' case too) >=20 > > A future mode set shouldn't ever not turn the connector on, since > > modesetting is an implicit > > DPMS, > > > > It sounds like something more subtle than that, though I'm happy to > > revert this for now, and let Keith > > think about it a bit more. >=20 > So I haven't heard anything from Keith. Keith? Just revert it? Or do > you have a patch for people to try? The goal is to make it so that when you *do* set a mode, DPMS gets set to ON (as the monitor will actually be "on" at that point). Here's a patch which does the DPMS_ON precisely when setting a mode. Dave thinks we should instead force dpms to match crtc->enabled, I'd rather have dpms get set when we know the hardware has been changed. (note, this patch compiles, but is otherwise only lightly tested). From=2038507bb3a67441425e11085d17d727f3b230f927 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 3 Feb 2011 16:57:28 -0800 Subject: [PATCH] drm: Only set DPMS ON when actually configuring a mode In drm_crtc_helper_set_config, instead of always forcing all outputs to DRM_MODE_DPMS_ON, only set them if the CRTC is actually getting a mode set, as any mode set will turn all outputs on. Signed-off-by: Keith Packard =2D-- drivers/gpu/drm/drm_crtc_helper.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_h= elper.c index 952b3d4..17459ee 100644 =2D-- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -665,6 +665,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *se= t) ret =3D -EINVAL; goto fail; } + DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); + for (i =3D 0; i < set->num_connectors; i++) { + DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]-= >base.id, + drm_get_connector_name(set->connectors[i])); + set->connectors[i]->dpms =3D DRM_MODE_DPMS_ON; + } } drm_helper_disable_unused_functions(dev); } else if (fb_changed) { @@ -681,12 +687,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *se= t) goto fail; } } =2D DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); =2D for (i =3D 0; i < set->num_connectors; i++) { =2D DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]-= >base.id, =2D drm_get_connector_name(set->connectors[i])); =2D set->connectors[i]->dpms =3D DRM_MODE_DPMS_ON; =2D } =20 kfree(save_connectors); kfree(save_encoders); =2D-=20 1.7.2.3 =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFNS1DyQp8BWwlsTdMRAvOJAKDPOT2MtyMRveY5kOoJJ4EKjm9qMQCbBiwj dsr57celRU5NJXl467pe5dU= =nXhj -----END PGP SIGNATURE----- --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/