]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: simpledrm: fix wrong unit with pixel clock
authorAlejandro Concepcion-Rodriguez <asconcepcion@acoro.eu>
Sun, 12 Dec 2021 16:06:02 +0000 (16:06 +0000)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 13 Dec 2021 10:25:06 +0000 (11:25 +0100)
Pixel clock has to be set in kHz.

Signed-off-by: Alejandro Concepcion-Rodriguez <asconcepcion@acoro.eu>
Fixes: 674ba85dedf1 ("drm: Add simpledrm driver")
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/6f8554ef-1305-0dda-821c-f7d2e5644a48@acoro.eu
drivers/gpu/drm/tiny/simpledrm.c

index 481b48bde0473fe56a9f56e970ce4ba130111c2b..5a6e89825bc2fc54ec02dcda1da5a47cc2212f02 100644 (file)
@@ -458,7 +458,7 @@ static struct drm_display_mode simpledrm_mode(unsigned int width,
 {
        struct drm_display_mode mode = { SIMPLEDRM_MODE(width, height) };
 
-       mode.clock = 60 /* Hz */ * mode.hdisplay * mode.vdisplay;
+       mode.clock = mode.hdisplay * mode.vdisplay * 60 / 1000 /* kHz */;
        drm_mode_set_name(&mode);
 
        return mode;