drm/amd/display: Add check update surfaces for stream wrapper
authorAndrew Jiang <Andrew.Jiang@amd.com>
Wed, 8 Nov 2017 17:15:17 +0000 (12:15 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:47:43 +0000 (12:47 -0500)
This allows us to properly clear and set the update flags for all cases.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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
drivers/gpu/drm/amd/display/dc/dc.h

index 369a5e7af47e8e5169c0a99b3f0580aa698a3b99..63872ce500b86cc15205927caa80bad19a64383a 100644 (file)
@@ -1310,7 +1310,7 @@ static enum surface_update_type det_surface_update(const struct dc *dc,
        return overall_type;
 }
 
-enum surface_update_type dc_check_update_surfaces_for_stream(
+static enum surface_update_type check_update_surfaces_for_stream(
                struct dc *dc,
                struct dc_surface_update *updates,
                int surface_count,
@@ -1330,7 +1330,6 @@ enum surface_update_type dc_check_update_surfaces_for_stream(
                enum surface_update_type type =
                                det_surface_update(dc, &updates[i]);
 
-               updates[i].surface->update_type = type;
                if (type == UPDATE_TYPE_FULL)
                        return type;
 
@@ -1340,6 +1339,27 @@ enum surface_update_type dc_check_update_surfaces_for_stream(
        return overall_type;
 }
 
+enum surface_update_type dc_check_update_surfaces_for_stream(
+               struct dc *dc,
+               struct dc_surface_update *updates,
+               int surface_count,
+               struct dc_stream_update *stream_update,
+               const struct dc_stream_status *stream_status)
+{
+       int i;
+       enum surface_update_type type;
+
+       for (i = 0; i < surface_count; i++)
+               updates[i].surface->update_flags.raw = 0;
+
+       type = check_update_surfaces_for_stream(dc, updates, surface_count, stream_update, stream_status);
+       if (type == UPDATE_TYPE_FULL)
+               for (i = 0; i < surface_count; i++)
+                       updates[i].surface->update_flags.bits.full_update = 1;
+
+       return type;
+}
+
 static struct dc_stream_status *stream_get_status(
        struct dc_state *ctx,
        struct dc_stream_state *stream)
index fb45e1170f42ba4548bf00d32eb2dca5a142715c..5fe86fab6995eef41ae22dfb1bcb90c25cf51a15 100644 (file)
@@ -453,6 +453,7 @@ union surface_update_flags {
                uint32_t bandwidth_change:1;
                uint32_t clock_change:1;
                uint32_t stereo_format_change:1;
+               uint32_t full_update:1;
        } bits;
 
        uint32_t raw;
@@ -492,7 +493,6 @@ struct dc_plane_state {
        bool horizontal_mirror;
 
        union surface_update_flags update_flags;
-       enum surface_update_type update_type;
        /* private to DC core */
        struct dc_plane_status status;
        struct dc_context *ctx;