Skip to contentSkip to conversation

fbdev: da8xx:: fix reporting of the display timing info

PATCH In review Anatolij Gustschin 2 participants 3 messages Mar 9, 2012 – Mar 13, 2012 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fbdev: da8xx:: fix reporting of the display timing info

Timing info is not properly reported by the driver, e.g.:

$ fbset -i
mode "480x272-95"
    # D: 21.429 MHz, H: 33.018 kHz, V: 95.429 Hz
    geometry 480 272 480 544 16
    timings 46666 64 64 32 32 41 10

According to the timing values defined for LK043T1DG01 display it should be reported as:

mode "480x272-52"

    # D: 7.834 MHz, H: 14.921 kHz, V: 51.810 Hz
    geometry 480 272 480 544 16
    timings 127655 2 2 2 2 41 10

Initialize additional fb_var_screeninfo fields so fix this problem.

Cc Manjunathappa, Prakash <[email protected]>
---
 drivers/video/da8xx-fb.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/video/da8xx-fb.c +13 -0
index 29577bf..27c2794 100644
@@ -240,6 +240,14 @@ static struct da8xx_panel known_lcd_panels[] = {
 	},
 };
 
+static inline unsigned long hz_to_ps(unsigned long hz_val)
+{
+	unsigned long long num = 1000000000000ULL;
+
+	do_div(num, hz_val);
+	return (unsigned long)num;
+}
+
 /* Enable the Raster Engine of the LCD Controller */
 static inline void lcd_enable_raster(void)
 {
@@ -1209,6 +1217,11 @@ static int __devinit fb_probe(struct platform_device *device)
 
 	da8xx_fb_var.hsync_len = lcdc_info->hsw;
 	da8xx_fb_var.vsync_len = lcdc_info->vsw;
+	da8xx_fb_var.right_margin = lcdc_info->hfp;
+	da8xx_fb_var.left_margin  = lcdc_info->hbp;
+	da8xx_fb_var.lower_margin = lcdc_info->vfp;
+	da8xx_fb_var.upper_margin = lcdc_info->vbp;
+	da8xx_fb_var.pixclock = hz_to_ps(lcdc_info->pxl_clk);
 
 	/* Initialize fbinfo */
 	da8xx_fb_info->flags = FBINFO_FLAG_DEFAULT;
Signature · 1 line
1.7.7.6
#1 lore raw

Hi,

Quoted 30 lines · Anatolij Gustschin

Timing info is not properly reported by the driver, e.g.:

$ fbset -i
mode "480x272-95"
    # D: 21.429 MHz, H: 33.018 kHz, V: 95.429 Hz
    geometry 480 272 480 544 16
    timings 46666 64 64 32 32 41 10

According to the timing values defined for LK043T1DG01 display it should be reported as:

mode "480x272-52"

    # D: 7.834 MHz, H: 14.921 kHz, V: 51.810 Hz
    geometry 480 272 480 544 16
    timings 127655 2 2 2 2 41 10

Initialize additional fb_var_screeninfo fields so fix this problem.

Cc Manjunathappa, Prakash <[email protected]>
---
 drivers/video/da8xx-fb.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/video/da8xx-fb.c +0 -0
index 29577bf..27c2794 100644
@@ -240,6 +240,14 @@ static struct da8xx_panel known_lcd_panels[] = {
 	},

drivers/video/da8xx-fb.c static struct da8xx_panel known_lcd_panels[] = { · line 250

Quoted 10 lines
drivers/video/da8xx-fb.c +8 -0
 };
 
+static inline unsigned long hz_to_ps(unsigned long hz_val)
+{
+	unsigned long long num = 1000000000000ULL;
+
+	do_div(num, hz_val);
+	return (unsigned long)num;
+}
+

I have patch to take care of this:

http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-v2-video-da8xx-fb-calculate-pixel-clock-period-for-the-panel-tt7268377.html#none

drivers/video/da8xx-fb.c static int __devinit fb_probe(struct platform_device *device) · line 1225

Quoted 13 lines
drivers/video/da8xx-fb.c +5 -0
 /* Enable the Raster Engine of the LCD Controller */
 static inline void lcd_enable_raster(void)
 {
@@ -1209,6 +1217,11 @@ static int __devinit fb_probe(struct platform_device *device)
 
 	da8xx_fb_var.hsync_len = lcdc_info->hsw;
 	da8xx_fb_var.vsync_len = lcdc_info->vsw;
+	da8xx_fb_var.right_margin = lcdc_info->hfp;
+	da8xx_fb_var.left_margin  = lcdc_info->hbp;
+	da8xx_fb_var.lower_margin = lcdc_info->vfp;
+	da8xx_fb_var.upper_margin = lcdc_info->vbp;
+	da8xx_fb_var.pixclock = hz_to_ps(lcdc_info->pxl_clk);
 

Above specified patch takes care of updating "pixclock". Remaining updates seems ok.

Thanks,
Prakash

Quoted 6 lines
drivers/video/da8xx-fb.c +0 -0
 	/* Initialize fbinfo */
 	da8xx_fb_info->flags = FBINFO_FLAG_DEFAULT;
Signature · 1 line
1.7.7.6
#2 lore raw
In reply to Anatolij Gustschin

Hi,

On Mon, 12 Mar 2012 05:19:54 +0000 "Manjunathappa, Prakash" <[email protected]> wrote:
...

Quoted 11 lines

drivers/video/da8xx-fb.c static struct da8xx_panel known_lcd_panels[] = { · line 250

Quoted 8 lines
drivers/video/da8xx-fb.c +8 -0
+static inline unsigned long hz_to_ps(unsigned long hz_val)
+{
+	unsigned long long num = 1000000000000ULL;
+
+	do_div(num, hz_val);
+	return (unsigned long)num;
+}
+

I have patch to take care of this:

Quoted 1 line

http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-v2-video-da8xx-fb-calculate-pixel-clock-period-for-the-panel-tt7268377.html#none

Okay, thanks for the info! I'll rebase my patches and then resubmit.

Thanks,
Anatolij