Skip to content

Commit 07acf4b

Browse files
claudiubezneasravnborg
authored andcommitted
drm: atmel-hlcdc: use double rate for pixel clock only if supported
Doubled system clock should be used as pixel cock source only if this is supported. This is emphasized by the value of atmel_hlcdc_crtc::dc::desc::fixed_clksrc. Fixes: a6eca2a ("drm: atmel-hlcdc: add config option for clock selection") Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: <[email protected]> # v5.3+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent bf04600 commit 07acf4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
9595
(adj->crtc_hdisplay - 1) |
9696
((adj->crtc_vdisplay - 1) << 16));
9797

98+
prate = clk_get_rate(crtc->dc->hlcdc->sys_clk);
99+
mode_rate = adj->crtc_clock * 1000;
98100
if (!crtc->dc->desc->fixed_clksrc) {
101+
prate *= 2;
99102
cfg |= ATMEL_HLCDC_CLKSEL;
100103
mask |= ATMEL_HLCDC_CLKSEL;
101104
}
102105

103-
prate = 2 * clk_get_rate(crtc->dc->hlcdc->sys_clk);
104-
mode_rate = adj->crtc_clock * 1000;
105-
106106
div = DIV_ROUND_UP(prate, mode_rate);
107107
if (div < 2) {
108108
div = 2;

0 commit comments

Comments
 (0)