All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: jbarnes@virtuousgeek.org, intel-gfx@lists.freedesktop.org,
	eric@anholt.net, keithp@keithp.com
Cc: Simon Que <sque@chromium.org>, bleung@chromium.org
Subject: Re: [PATCH] xf86-video-intel: change order of DPMS operations
Date: Thu, 08 Dec 2011 14:10:06 +0000	[thread overview]
Message-ID: <f80fcd$2pj45v@fmsmga001.fm.intel.com> (raw)
In-Reply-To: <1323303641-13277-1-git-send-email-sque@chromium.org>

On Wed,  7 Dec 2011 16:20:41 -0800, Simon Que <sque@chromium.org> wrote:
> The operations when setting dpms on should be in the order opposite
> of what's done when setting dpms off.
> 
> This is because of potentially conflicting effects:
> ~ drmModeConnectoSetProperty() enables/disables the backlight driver.
> Some backlight drivers such as intel_backlight set the backlight to 0
> when disabled and to max when enabled.
> ~ intel_output_dpms_backlight() saves the backlight value when turning
> DPMS off and restores it when turning DPMS on.
> 
> Here's the current order of operations:
> 
> xset dpms force off (backlight is nonzero)
>    drmModeConnectoSetProperty(DPMSModeOff)
>       kernel: disable backlight, backlight=0
>    intel_output_dpms_backlight(DPMSModeOff)
>       save backlight value (0) <-- it has been set to 0 by kernel
>       set backlight to 0
> 
> xset dpms force on
>    drmModeConnectoSetProperty(DPMSModeOn)
>       kernel: enable backlight, backlight=max
>    intel_output_dpms_backlight(DPMSModeOn)
>       set backlight to saved value (0)
> 
> The correct way to do this would be to reverse the operations during
> xset dpms force off:
>    intel_output_dpms_backlight(DPMSModeOff)
>       save backlight value (nonzero)
>       set backlight to 0
>    drmModeConnectoSetProperty(DPMSModeOff)
>       kernel: enable backlight, backlight=0
> 
> This restores the saved nonzero backlight value during the force on.
> 
> Signed-off-by: Simon Que <sque@chromium.org>

I had to remind myself why both the driver and the kernel are both
touching the backlight across DPMS; the answer as I see it is that the
kernel only knows about the raw backlight interface whereas the driver
adjusts it via the preferred interface (which should handle the cases
where the backlight modulation is handled independently of the PWM
registers). So given that there seems to be a need for the driver to
set the backlight, the order it does so is important given the
interaction with the kernel.

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2011-12-08 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08  0:20 [PATCH] xf86-video-intel: change order of DPMS operations Simon Que
2011-12-08 14:10 ` Chris Wilson [this message]
2011-12-08 16:35   ` Keith Packard
2011-12-08 16:37     ` Chris Wilson

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='f80fcd$2pj45v@fmsmga001.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=bleung@chromium.org \
    --cc=eric@anholt.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=keithp@keithp.com \
    --cc=sque@chromium.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.