Message ID | e0a2240f863279b65a1fdc7f8c27ede9f8e37893.1685342739.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] drm/amd/display: Fix an erroneous sanity check in get_dmif_switch_time_us() | expand |
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c index 4cdd4dacb761..091f0d68a045 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c @@ -683,7 +683,7 @@ static uint32_t get_dmif_switch_time_us( /*return double of frame time*/ const uint32_t single_frame_time_multiplier = 2; - if (!h_total || v_total || !pix_clk_khz) + if (!h_total || !v_total || !pix_clk_khz) return single_frame_time_multiplier * min_single_frame_time_us; /*TODO: should we use pixel format normalized pixel clock here?*/
It is likely that there is a typo in the sanity check for 'v_total'. If it is 0, then 'pixels_per_frame' will also be 0, and in this case, we also return 'single_frame_time_multiplier * min_single_frame_time_us'. So test for !v_total which looks much more logical. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)