]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
videomodes: Add pixelclock_khz and refresh fields to ctfb_res_modes
authorHans de Goede <hdegoede@redhat.com>
Fri, 19 Dec 2014 09:38:49 +0000 (10:38 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 14 Jan 2015 13:56:37 +0000 (14:56 +0100)
Add pixelclock_khz and refresh fields to ctfb_res_modes:

1) pixelclocks are usually referred to in hz, not picoseconds, and e.g
pll-s are also typically programmed in hz, not ps. Converting between the
2 leads to rounding differences, add a pixelclock_khz field to directly
store the *exact* pixelclock for a mode, so that drivers do not need to
resort to rounding tricks to try and guess the exact pixelclock;

2) The video-mode environment variable, as parsed by video_get_video_mode
also contains the vertical refresh rate, add a refresh field, so that
the refresh-rate can be matched when parsing the video-mode environment
variable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
drivers/video/videomodes.c
drivers/video/videomodes.h

index 18c1f3d8acc0e90d27a90a3460bb2758827a3f58..3e5b168e20ebc416782e2f14164cc1b72b947b5e 100644 (file)
@@ -84,13 +84,13 @@ const struct ctfb_vesa_modes vesa_modes[VESA_MODES_COUNT] = {
        {0x31B, RES_MODE_1280x1024, 24},
 };
 const struct ctfb_res_modes res_mode_init[RES_MODES_COUNT] = {
-       /* x     y pixclk   le  ri  up  lo   hs vs  s  vmode */
-       {640, 480, 39721, 40, 24, 32, 11, 96, 2, 0, FB_VMODE_NONINTERLACED},
-       {800, 600, 27778, 64, 24, 22, 1, 72, 2, 0, FB_VMODE_NONINTERLACED},
-       {1024, 768, 15384, 168, 8, 29, 3, 144, 4, 0, FB_VMODE_NONINTERLACED},
-       {960, 720, 13100, 160, 40, 32, 8, 80, 4, 0, FB_VMODE_NONINTERLACED},
-       {1152, 864, 12004, 200, 64, 32, 16, 80, 4, 0, FB_VMODE_NONINTERLACED},
-       {1280, 1024, 9090, 200, 48, 26, 1, 184, 3, 0, FB_VMODE_NONINTERLACED},
+       /*  x     y  hz  pixclk ps/kHz   le   ri  up  lo   hs vs  s  vmode */
+       { 640,  480, 60, 39721,  25180,  40,  24, 32, 11,  96, 2, 0, FB_VMODE_NONINTERLACED},
+       { 800,  600, 60, 27778,  36000,  64,  24, 22,  1,  72, 2, 0, FB_VMODE_NONINTERLACED},
+       {1024,  768, 60, 15384,  65000, 168,   8, 29,  3, 144, 4, 0, FB_VMODE_NONINTERLACED},
+       { 960,  720, 80, 13100,  76335, 160,  40, 32,  8,  80, 4, 0, FB_VMODE_NONINTERLACED},
+       {1152,  864, 60, 12004,  83300, 200,  64, 32, 16,  80, 4, 0, FB_VMODE_NONINTERLACED},
+       {1280, 1024, 60,  9090, 110000, 200,  48, 26,  1, 184, 3, 0, FB_VMODE_NONINTERLACED},
 };
 
 /************************************************************************
@@ -183,6 +183,7 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv)
        while ((i = video_get_param_len (p, ',')) != 0) {
                GET_OPTION ("x:", pPar->xres)
                        GET_OPTION ("y:", pPar->yres)
+                       GET_OPTION ("refresh:", pPar->refresh)
                        GET_OPTION ("le:", pPar->left_margin)
                        GET_OPTION ("ri:", pPar->right_margin)
                        GET_OPTION ("up:", pPar->upper_margin)
@@ -192,6 +193,7 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv)
                        GET_OPTION ("sync:", pPar->sync)
                        GET_OPTION ("vmode:", pPar->vmode)
                        GET_OPTION ("pclk:", pPar->pixclock)
+                       GET_OPTION ("pclk_khz:", pPar->pixclock_khz)
                        GET_OPTION ("depth:", bpp)
                        p += i;
                if (*p != 0)
index d83993a563ae1bf062c38ded938d6b92de922686..94b13e6956ebd72d540f4086560e784c8816af95 100644 (file)
 struct ctfb_res_modes {
        int xres;               /* visible resolution           */
        int yres;
+       int refresh;            /* vertical refresh rate in hz  */
        /* Timing: All values in pixclocks, except pixclock (of course) */
        int pixclock;           /* pixel clock in ps (pico seconds) */
+       int pixclock_khz;       /* pixel clock in kHz           */
        int left_margin;        /* time from sync to picture    */
        int right_margin;       /* time from picture to sync    */
        int upper_margin;       /* time from sync to picture    */