Skip to content

Commit 10eee2e

Browse files
Shirish Salexdeucher
authored andcommitted
drm/amd/display: validate plane in dce110 for scaling
CZ & ST support uptil a limit 2:1 downscaling, this patch adds validate_plane hook, that shall be used to validate the plane attributes sent by the user space based on dce110 capabilities. Signed-off-by: Shirish S <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 843e3c7 commit 10eee2e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,16 @@ static bool dce110_validate_bandwidth(
846846
return result;
847847
}
848848

849+
enum dc_status dce110_validate_plane(const struct dc_plane_state *plane_state,
850+
struct dc_caps *caps)
851+
{
852+
if (((plane_state->dst_rect.width * 2) < plane_state->src_rect.width) ||
853+
((plane_state->dst_rect.height * 2) < plane_state->src_rect.height))
854+
return DC_FAIL_SURFACE_VALIDATE;
855+
856+
return DC_OK;
857+
}
858+
849859
static bool dce110_validate_surface_sets(
850860
struct dc_state *context)
851861
{
@@ -1021,6 +1031,7 @@ static const struct resource_funcs dce110_res_pool_funcs = {
10211031
.link_enc_create = dce110_link_encoder_create,
10221032
.validate_guaranteed = dce110_validate_guaranteed,
10231033
.validate_bandwidth = dce110_validate_bandwidth,
1034+
.validate_plane = dce110_validate_plane,
10241035
.acquire_idle_pipe_for_layer = dce110_acquire_underlay,
10251036
.add_stream_to_ctx = dce110_add_stream_to_ctx,
10261037
.validate_global = dce110_validate_global

0 commit comments

Comments
 (0)