drm/amd/display: Set add_stream_ctx for CZ, Hawaii and others
authorHarry Wentland <harry.wentland@amd.com>
Fri, 25 Aug 2017 20:33:40 +0000 (16:33 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:17:21 +0000 (18:17 -0400)
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@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/dce100/dce100_resource.c
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c

index 36d79175354cf0123322c085dbd22884f86d7e2f..ca6c7c2a1b4ccb3efe557463b9000442cd3fc2c8 100644 (file)
@@ -713,6 +713,24 @@ enum dc_status dce100_validate_global(
        return DC_OK;
 }
 
+enum dc_status dce100_add_stream_to_ctx(
+               struct dc *dc,
+               struct dc_state *new_ctx,
+               struct dc_stream_state *dc_stream)
+{
+       enum dc_status result = DC_ERROR_UNEXPECTED;
+
+       result = resource_map_pool_resources(dc, new_ctx, dc_stream);
+
+       if (result == DC_OK)
+               result = resource_map_clock_resources(dc, new_ctx, dc_stream);
+
+       if (result == DC_OK)
+               result = build_mapped_resource(dc, new_ctx, dc_stream);
+
+       return result;
+}
+
 enum dc_status dce100_validate_guaranteed(
                struct dc  *dc,
                struct dc_stream_state *dc_stream,
@@ -769,6 +787,7 @@ static const struct resource_funcs dce100_res_pool_funcs = {
        .validate_guaranteed = dce100_validate_guaranteed,
        .validate_bandwidth = dce100_validate_bandwidth,
        .validate_plane = dce100_validate_plane,
+       .add_stream_to_ctx = dce100_add_stream_to_ctx,
        .validate_global = dce100_validate_global
 };
 
index ca7b2b7c1a48e0f1963aeb943def8b50457090aa..f52cae24ee23349ea676d9531130f57f6705fea8 100644 (file)
@@ -18,4 +18,9 @@ struct resource_pool *dce100_create_resource_pool(
 
 enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state);
 
+enum dc_status dce100_add_stream_to_ctx(
+               struct dc *dc,
+               struct dc_state *new_ctx,
+               struct dc_stream_state *dc_stream);
+
 #endif /* DCE100_RESOURCE_H_ */
index 4942460d42cabfbe4f09b337692cc4e3f0742616..41bfddf9574e597f493f11716be08fd4a0a23964 100644 (file)
@@ -921,6 +921,25 @@ enum dc_status dce110_validate_global(
        return DC_OK;
 }
 
+static enum dc_status dce110_add_stream_to_ctx(
+               struct dc *dc,
+               struct dc_state *new_ctx,
+               struct dc_stream_state *dc_stream)
+{
+       enum dc_status result = DC_ERROR_UNEXPECTED;
+
+       result = resource_map_pool_resources(dc, new_ctx, dc_stream);
+
+       if (result == DC_OK)
+               result = resource_map_clock_resources(dc, new_ctx, dc_stream);
+
+
+       if (result == DC_OK)
+               result = build_mapped_resource(dc, new_ctx, dc_stream);
+
+       return result;
+}
+
 static enum dc_status dce110_validate_guaranteed(
                struct dc *dc,
                struct dc_stream_state *dc_stream,
@@ -1030,6 +1049,7 @@ static const struct resource_funcs dce110_res_pool_funcs = {
        .validate_guaranteed = dce110_validate_guaranteed,
        .validate_bandwidth = dce110_validate_bandwidth,
        .acquire_idle_pipe_for_layer = dce110_acquire_underlay,
+       .add_stream_to_ctx = dce110_add_stream_to_ctx,
        .validate_global = dce110_validate_global
 };
 
index 316080767a21baf83423eeab5b0b6537ba1c0073..9234086aac27f306a47b4beb86d03c629026415c 100644 (file)
@@ -791,6 +791,7 @@ static const struct resource_funcs dce80_res_pool_funcs = {
        .validate_guaranteed = dce80_validate_guaranteed,
        .validate_bandwidth = dce80_validate_bandwidth,
        .validate_plane = dce100_validate_plane,
+       .add_stream_to_ctx = dce100_add_stream_to_ctx,
        .validate_global = dce80_validate_global
 };