Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245Ab1D3IMA (ORCPT ); Sat, 30 Apr 2011 04:12:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59416 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753144Ab1D3ILn (ORCPT ); Sat, 30 Apr 2011 04:11:43 -0400 Date: Sat, 30 Apr 2011 10:11:40 +0200 Message-ID: From: Takashi Iwai To: Melchior FRANZ Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Chris Wilson , dri-devel@lists.freedesktop.org Subject: Re: i915/kms/backlight-combo mode problem (was: Re: Linux 2.6.39-rc5) In-Reply-To: <201104292209.55154@rk-nord.at> References: <201104291941.53663@rk-nord.at> <201104292209.55154@rk-nord.at> 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.2 (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 Content-Length: 1563 Lines: 48 At Fri, 29 Apr 2011 22:09:54 +0200, Melchior FRANZ wrote: > > * Takashi Iwai -- Friday 29 April 2011: > [https://bugzilla.kernel.org/show_bug.cgi?id=31522] > > Looking at bugzilla, the problem seems like the case lbpc=0. > > What about the patch below instead? > > > - val *= lbpc; > > + if (lbpc) > > + val *= lbpc; > > Yes, that works as well. (I had assumed that this was the problem, > but wasn't sure if a zero was even a legitimate value, or rather > a sign for a problem or wrong assumption elsewhere.) Well, this was just my wild guess. I remember vaguely that the value zero could be interpreted as the max. It might be depending on the hardware. So, the patch below may work better in your case. Also, with the patch, does the backlight level can be adjusted correctly to different values? I wonder whether LBPC adjustment really works or not on your machine. Takashi --- diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a06ff07..aaa1f9e 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -207,6 +207,8 @@ u32 intel_panel_get_backlight(struct drm_device *dev) val &= ~1; pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); + if (!lbpc) + lbpc = 0xff; /* max value */ val *= lbpc; } } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/