* [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off
@ 2013-07-25 11:31 Jani Nikula
2013-08-07 6:26 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2013-07-25 11:31 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
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 <daniel.vetter@ffwll.ch>
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
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off
2013-07-25 11:31 [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off Jani Nikula
@ 2013-08-07 6:26 ` Jani Nikula
2013-08-07 7:52 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2013-08-07 6:26 UTC (permalink / raw)
To: intel-gfx, Daniel Vetter
On Thu, 25 Jul 2013, Jani Nikula <jani.nikula@intel.com> 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 <daniel.vetter@ffwll.ch>
> 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 <fedevx@yahoo.com>
Tested-by: Aximab <laurent.debian@gmail.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785
Tested-by: sfievet <sebastien.fievet@free.fr>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off
2013-08-07 6:26 ` Jani Nikula
@ 2013-08-07 7:52 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2013-08-07 7:52 UTC (permalink / raw)
To: Jani Nikula; +Cc: Daniel Vetter, intel-gfx
On Wed, Aug 07, 2013 at 09:26:34AM +0300, Jani Nikula wrote:
> On Thu, 25 Jul 2013, Jani Nikula <jani.nikula@intel.com> 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 <daniel.vetter@ffwll.ch>
> > 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 <fedevx@yahoo.com>
> Tested-by: Aximab <laurent.debian@gmail.com>
>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785
>
> Tested-by: sfievet <sebastien.fievet@free.fr>
Picked up for -fixes (with a cc: stable), thanks for the patch.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-07 7:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 11:31 [PATCH] drm/i915: do not disable backlight on vgaswitcheroo switch off Jani Nikula
2013-08-07 6:26 ` Jani Nikula
2013-08-07 7:52 ` Daniel Vetter
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.