From: Corbin McElhanney <corbin.mcelhanney@amd.com>
Date: Thu, 1 Jun 2017 15:40:04 -0400
Subject: drm/amd/display: Don't update surface if dimensions are 0
Git-commit: e7b1322e15ea66c135ff98c1eb15fc542ef79c89
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
Signed-off-by: Corbin McElhanney <corbin.mcelhanney@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- 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(struc
}
}
- /* 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(