Re: [PATCH v2] s3c-fb: Automatically calculate pixel clock when none is given

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

 



 I tested this patch by using s5pv210.
It is verified by linux-2.6.32.
The result of test is the same pixel clock as before applying patch.

Tested-by: Donghwa Lee <yiffie9819@xxxxxxxxx>


2010/7/13 Maurus Cuelenaere <mcuelenaere@xxxxxxxxx>
> This patch adds a simple algorithm which calculates the pixel clock based on the
> video mode parameters. This is only done when no pixel clock is supplied through
> the platform data.
>
> Signed-off-by: Maurus Cuelenaere <mcuelenaere@xxxxxxxxx>
> ---
>
> Changes since v1:
> Re-posted this to the correct fbdev mailing list.
>
> ---
>  drivers/video/s3c-fb.c |   25 +++++++++++++++++++++++++
>  1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 9682ecc..e4715eb 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -654,6 +654,28 @@ static struct fb_ops s3c_fb_ops = {
>  };
>  
>  /**
> + * s3c_fb_missing_pixclock() - calculates pixel clock
> + * @mode: The video mode to change.
> + *
> + * Calculate the pixel clock when none has been given through platform data.
> + */
> +static void __devinit s3c_fb_missing_pixclock(struct fb_videomode *mode)
> +{
> +	u64 pixclk = 1000000000000ULL;
> +	u32 div;
> +
> +	div  = mode->left_margin + mode->hsync_len + mode->right_margin +
> +	       mode->xres;
> +	div *= mode->upper_margin + mode->vsync_len + mode->lower_margin +
> +	       mode->yres;
> +	div *= mode->refresh ? : 60;
> +
> +	do_div(pixclk, div);
> +
> +	mode->pixclock = pixclk;
> +}
> +
> +/**
>   * s3c_fb_alloc_memory() - allocate display memory for framebuffer window
>   * @sfb: The base resources for the hardware.
>   * @win: The window to initialise memory for.
> @@ -925,6 +947,9 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  		if (!pd->win[win])
>  			continue;
>  
> +		if (!pd->win[win]->win_mode.pixclock)
> +			s3c_fb_missing_pixclock(&pd->win[win]->win_mode);
> +
>  		ret = s3c_fb_probe_win(sfb, win, &sfb->windows[win]);
>  		if (ret < 0) {
>  			dev_err(dev, "failed to create window %d\n", win);

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux