Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208504
b: refs/heads/master
c: 2bb567a
h: refs/heads/master
v: v3
  • Loading branch information
Maurus Cuelenaere authored and Linus Torvalds committed Aug 11, 2010
1 parent 47591f6 commit ea9a05f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04ab9ef97771ba88789672a1f0d0ddcf8dbc0924
refs/heads/master: 2bb567a38950f0917aecfe1a3e46720d8bbb0020
25 changes: 25 additions & 0 deletions trunk/drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,28 @@ static struct fb_ops s3c_fb_ops = {
.fb_ioctl = s3c_fb_ioctl,
};

/**
* 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.
Expand Down Expand Up @@ -1364,6 +1386,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, fbdrv->win[win],
&sfb->windows[win]);
if (ret < 0) {
Expand Down

0 comments on commit ea9a05f

Please sign in to comment.