From patchwork Mon May 9 09:35:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Lee X-Patchwork-Id: 768802 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p499ZhZO001013 for ; Mon, 9 May 2011 09:36:05 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0933D9F757 for ; Mon, 9 May 2011 02:35:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from novprvlin0050.provo.novell.com (novprvlin0050.provo.novell.com [137.65.248.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 346789F706 for ; Mon, 9 May 2011 02:35:28 -0700 (PDT) Received: from INET-PRV1-MTA by novprvlin0050.provo.novell.com with Novell_GroupWise; Mon, 09 May 2011 03:35:27 -0600 Message-Id: <4DC841FD020000230002C5BF@novprvlin0050.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Mon, 09 May 2011 03:35:25 -0600 From: "Joey Lee" To: , , , "Joey Lee" , "Michael Chang" , , Subject: Re: i915/kms/backlight-combo mode problem References: <201105072222.41807@rk-nord.at> <4DC72A34020000230002C541@novprvlin0050.provo.novell.com> <201105081605.46617@rk-nord.at> <4DC8378A020000230002C5A8@novprvlin0050.provo.novell.com> In-Reply-To: Mime-Version: 1.0 Content-Disposition: inline X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 09 May 2011 09:36:05 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter2.kernel.org id p499ZhZO001013 ? ??2011-05-09 ? 11:00 +0200?Takashi Iwai ??? > At Mon, 09 May 2011 02:50:50 -0600, > Joey Lee wrote: > > > > We need to know some run time value when intel_panel_set_backlight call by funciton key. > > Yes, that'll help understanding. > > > Please help to apply the attached debug patch to intel_panel.c then attached dmesg. > > The patch has an obvious typo :) > Also, we should track the value in intel_panel_get_backlight(), too. > > > Takashi > Thank's for Takashi's review and sorry for my typo. Follow Takashi's suggestion, I added a debug message in get_backlight, the following is new debug patch: diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index f8f86e5..9695840 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -199,6 +199,7 @@ u32 intel_panel_get_backlight(struct drm_device *dev) val = I915_READ(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; } else { val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; + DRM_DEBUG_DRIVER("get backlight val = %d\n", val); if (IS_PINEVIEW(dev)) val >>= 1; @@ -236,17 +237,22 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) u32 max = intel_panel_get_max_backlight(dev); u8 lbpc; + DRM_DEBUG_DRIVER("set backlight max = %d\n", max); lbpc = level * 0xfe / max + 1; + DRM_DEBUG_DRIVER("set backlight lbpc = %d\n", lbpc); level /= lbpc; pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); } tmp = I915_READ(BLC_PWM_CTL); + DRM_DEBUG_DRIVER("set backlight tmp(1) = %d\n", tmp); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; + DRM_DEBUG_DRIVER("set backlight tmp(2) = %d\n", tmp); + DRM_DEBUG_DRIVER("set backlight level = %d\n", level); I915_WRITE(BLC_PWM_CTL, tmp | level); }