dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Daniel Mack <zonque@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org, jbarnes@virtuousgeek.org,
	harald@redhat.com, Keith Packard <keithp@keithp.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Strange effect with i915 backlight controller
Date: Mon, 14 Nov 2011 14:05:45 +0100	[thread overview]
Message-ID: <s5hmxby6ehi.wl%tiwai@suse.de> (raw)
In-Reply-To: <4EC103A2.7080704@gmail.com>

At Mon, 14 Nov 2011 13:03:46 +0100,
Daniel Mack wrote:
> 
> On 11/14/2011 11:39 AM, Takashi Iwai wrote:
> > [Added Chris to Cc]
> > 
> > At Sun, 13 Nov 2011 17:24:09 +0100,
> > Daniel Mack wrote:
> >>
> >> Hi Takashi,
> >>
> >> On 11/10/2011 04:39 PM, Takashi Iwai wrote:
> >>> At Thu, 10 Nov 2011 16:11:29 +0100,
> >>> Daniel Mack wrote:
> >>>>
> >>>> On 11/08/2011 01:57 AM, Daniel Mack wrote:
> >>>>> Didn't get any response yet, hence copying LKML for a broader audience.
> >>>>
> >>>> Nobody, really?
> >>>>
> >>>> This is a rather annoying regression, as touching the brightness keys
> >>>> appearantly switches off the whole machine. I'm sure this is trivial to
> >>>> fix, I just don't have the insight of this driver and the chipset.
> >>>
> >>> I vaguely remember that the bit 0 is invalid on some old chips.
> >>> Maybe 915GM is one of them, as it's gen3?  If so, the patch like below
> >>> may work.
> >>
> >> Thank you for looking into this.
> >>
> >>> ---
> >>> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> >>> index 499d4c0..be952d1 100644
> >>> --- a/drivers/gpu/drm/i915/intel_panel.c
> >>> +++ b/drivers/gpu/drm/i915/intel_panel.c
> >>> @@ -249,8 +249,11 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level
> >>>  	if (IS_PINEVIEW(dev)) {
> >>>  		tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1);
> >>>  		level <<= 1;
> >>> -	} else
> >>> +	} else {
> >>>  		tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK;
> >>> +		if (INTEL_INFO(dev)->gen < 4)
> >>> +			tmp &= ~1;
> >>> +	}
> >>>  	I915_WRITE(BLC_PWM_CTL, tmp | level);
> >>>  }
> >>>  
> >>
> >> This seems to be the right intention, but the value you want to modify
> >> under this condition is 'level', not 'tmp'.
> > 
> > Ah, of course.  Sorry for that.
> > 
> >> With this amendment of your
> >> patch, things work perfectly fine here.
> > 
> > OK, then perhaps a better fix is to change the check to be equivalent
> > with pineview, as you mentioned in the original post.  The handling of
> > bit 0 for old chips was lost during the refactoring of backlight code
> > since 2.6.37.
> > 
> > Does the patch below work for you?
> 
> Will test, but I only have occasional access to the machine, so this
> will have to wait for some days.

It's an old bug over a year, so no need to hurry.


Takashi

  reply	other threads:[~2011-11-14 13:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 14:36 Strange effect with i915 backlight controller Daniel Mack
2011-11-08  0:57 ` Daniel Mack
2011-11-10 15:11   ` Daniel Mack
2011-11-10 15:39     ` Takashi Iwai
2011-11-13 16:24       ` Daniel Mack
2011-11-14 10:39         ` Takashi Iwai
2011-11-14 12:03           ` Daniel Mack
2011-11-14 13:05             ` Takashi Iwai [this message]
2011-11-16 12:58           ` Daniel Mack
2011-11-16 17:15             ` Takashi Iwai

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=s5hmxby6ehi.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harald@redhat.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zonque@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox