From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935202Ab1KJPja (ORCPT ); Thu, 10 Nov 2011 10:39:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52221 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933707Ab1KJPj3 (ORCPT ); Thu, 10 Nov 2011 10:39:29 -0500 Date: Thu, 10 Nov 2011 16:39:27 +0100 Message-ID: From: Takashi Iwai To: Daniel Mack Cc: dri-devel@lists.freedesktop.org, jbarnes@virtuousgeek.org, harald@redhat.com, Keith Packard , linux-kernel@vger.kernel.org Subject: Re: Strange effect with i915 backlight controller In-Reply-To: <4EBBE9A1.8020501@gmail.com> References: <4EB3F860.6010408@gmail.com> <4EB87E6A.3060403@gmail.com> <4EBBE9A1.8020501@gmail.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Takashi --- 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); }