drm/amd/display: Don't update surface if dimensions are 0
authorCorbin McElhanney <corbin.mcelhanney@amd.com>
Thu, 1 Jun 2017 19:40:04 +0000 (15:40 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:07:46 +0000 (18:07 -0400)
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>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 323a5e7..976229e 100644 (file)
@@ -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(