From: Corbin McElhanney Date: Thu, 1 Jun 2017 19:40:04 +0000 (-0400) Subject: drm/amd/display: Don't update surface if dimensions are 0 X-Git-Tag: v5.15~9960^2~23^2~438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7b1322e15ea66c135ff98c1eb15fc542ef79c89;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/display: Don't update surface if dimensions are 0 Signed-off-by: Corbin McElhanney Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 323a5e7..976229e 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1250,8 +1250,15 @@ void dc_update_surfaces_and_stream(struct dc *dc, } } - /* only proceed if we need to make a surface update */ - if (!srf_updates) + /* do not perform surface update if surface has invalid dimensions + * (all zero) and no scaling_info is provided + */ + if (surface_count > 0 && + srf_updates->surface->src_rect.width == 0 && + srf_updates->surface->src_rect.height == 0 && + srf_updates->surface->dst_rect.width == 0 && + srf_updates->surface->dst_rect.height == 0 && + !srf_updates->scaling_info) return; update_type = dc_check_update_surfaces_for_stream(