Re: i915/kms/backlight-combo mode problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



æ äï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);
 }
 


_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux