* + s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch added to -mm tree
@ 2010-07-15 18:52 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2010-07-15 18:52 UTC (permalink / raw)
To: mm-commits
Cc: mcuelenaere, ben-linux, inki.dae, kyungmin.park, m.szyprowski,
p.osciak
The patch titled
s3c-fb: automatically calculate pixel clock when none is given
has been added to the -mm tree. Its filename is
s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: s3c-fb: automatically calculate pixel clock when none is given
From: Maurus Cuelenaere <mcuelenaere@gmail.com>
Add 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@gmail.com>
Cc: Pawel Osciak <p.osciak@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: InKi Dae <inki.dae@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/video/s3c-fb.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff -puN drivers/video/s3c-fb.c~s3c-fb-automatically-calculate-pixel-clock-when-none-is-given drivers/video/s3c-fb.c
--- a/drivers/video/s3c-fb.c~s3c-fb-automatically-calculate-pixel-clock-when-none-is-given
+++ a/drivers/video/s3c-fb.c
@@ -1027,6 +1027,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.
@@ -1364,6 +1386,9 @@ static int __devinit s3c_fb_probe(struct
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) {
_
Patches currently in -mm which might be from mcuelenaere@gmail.com are
linux-next.patch
s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* + s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch added to -mm tree
@ 2010-07-15 19:36 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2010-07-15 19:36 UTC (permalink / raw)
To: mm-commits
Cc: mcuelenaere, ben-linux, inki.dae, kyungmin.park, m.szyprowski,
p.osciak, rmk
The patch titled
s3c-fb: automatically calculate pixel clock when none is given
has been added to the -mm tree. Its filename is
s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: s3c-fb: automatically calculate pixel clock when none is given
From: Maurus Cuelenaere <mcuelenaere@gmail.com>
Add 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@gmail.com>
Cc: Pawel Osciak <p.osciak@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: InKi Dae <inki.dae@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/video/s3c-fb.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff -puN drivers/video/s3c-fb.c~s3c-fb-automatically-calculate-pixel-clock-when-none-is-given drivers/video/s3c-fb.c
--- a/drivers/video/s3c-fb.c~s3c-fb-automatically-calculate-pixel-clock-when-none-is-given
+++ a/drivers/video/s3c-fb.c
@@ -1027,6 +1027,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.
@@ -1364,6 +1386,9 @@ static int __devinit s3c_fb_probe(struct
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) {
_
Patches currently in -mm which might be from mcuelenaere@gmail.com are
linux-next.patch
s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch
arm-samsung-remove-pixclock-from-several-boards.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-15 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15 19:36 + s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch added to -mm tree akpm
-- strict thread matches above, loose matches on Subject: below --
2010-07-15 18:52 akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox