From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off Date: Wed, 07 Aug 2013 09:26:34 +0300 Message-ID: <87y58eyq1x.fsf@intel.com> References: <1374751890-9194-1-git-send-email-jani.nikula@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id B0D68E5CCE for ; Tue, 6 Aug 2013 23:24:51 -0700 (PDT) In-Reply-To: <1374751890-9194-1-git-send-email-jani.nikula@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org, Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Thu, 25 Jul 2013, Jani Nikula wrote: > On muxed systems, the other vgaswitcheroo client may depend on i915 to > handle the backlight. We began switching off the backlight since > > commit a261b246ebd552fd5d5a8ed84cc931bb821c427f > Author: Daniel Vetter > Date: Thu Jul 26 19:21:47 2012 +0200 > > drm/i915: disable all crtcs at suspend time > > breaking backlight on discreet graphics in (some) muxed systems. > > Keep the backlight on when the state is changed through vgaswitcheroo. > > Note: The alternative would be to add a quirk table to achieve the same > based on system identifiers, but AFAICS it would asymptotically approach > effectively the same as this patch as more IDs are added, but with the > maintenance burden of the quirk table. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55311 Tested-by: Fede Tested-by: Aximab > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785 Tested-by: sfievet > Signed-off-by: Jani Nikula > --- > drivers/gpu/drm/i915/intel_panel.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c > index 67e2c1f..1062154 100644 > --- a/drivers/gpu/drm/i915/intel_panel.c > +++ b/drivers/gpu/drm/i915/intel_panel.c > @@ -515,6 +515,17 @@ void intel_panel_disable_backlight(struct drm_device *dev) > struct drm_i915_private *dev_priv = dev->dev_private; > unsigned long flags; > > + /* > + * Do not disable backlight on the vgaswitcheroo path. When switching > + * away from i915, the other client may depend on i915 to handle the > + * backlight. This will leave the backlight on unnecessarily when > + * another client is not activated. > + */ > + if (dev->switch_power_state == DRM_SWITCH_POWER_CHANGING) { > + DRM_DEBUG_DRIVER("Skipping backlight disable on vga switch\n"); > + return; > + } > + > spin_lock_irqsave(&dev_priv->backlight.lock, flags); > > dev_priv->backlight.enabled = false; > -- > 1.7.9.5 > -- Jani Nikula, Intel Open Source Technology Center