[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4DC841FD020000230002C5BF@novprvlin0050.provo.novell.com>
Date: Mon, 09 May 2011 03:35:25 -0600
From: "Joey Lee" <jlee@...ell.com>
To: <chris@...is-wilson.co.uk>, <melchior.franz@...il.com>,
<dri-devel@...ts.freedesktop.org>, "Joey Lee" <JLee@...ell.com>,
"Michael Chang" <MChang@...ell.com>, <tiwai@...e.de>,
<linux-kernel@...r.kernel.org>
Subject: Re: i915/kms/backlight-combo mode problem
於 一,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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists