diff options
author | Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> | 2017-07-26 15:51:31 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:15:54 -0400 |
commit | 792671d7e1e28995c6a63104fac1208e19a0ab08 (patch) | |
tree | f24a6d9b7f64e55ff4eb9cd5005f0b2282b8c8f0 /drivers/gpu/drm/amd/display/dc/dce100 | |
parent | 49baf95740b4f233ea286ebbe7c1066c03f5dd3b (diff) |
drm/amd/display: Add per surface validation hook.
For now just validate pixel format in the hook.
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@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>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce100')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c index 9ac246f05110..59f4caf057f7 100644 --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c @@ -804,12 +804,22 @@ static void dce100_destroy_resource_pool(struct resource_pool **pool) *pool = NULL; } +enum dc_status dce100_validate_surface(const struct dc_surface *surface) +{ + + if (surface->format < SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) + return DC_OK; + + return DC_FAIL_SURFACE_VALIDATE; +} + static const struct resource_funcs dce100_res_pool_funcs = { .destroy = dce100_destroy_resource_pool, .link_enc_create = dce100_link_encoder_create, .validate_with_context = dce100_validate_with_context, .validate_guaranteed = dce100_validate_guaranteed, - .validate_bandwidth = dce100_validate_bandwidth + .validate_bandwidth = dce100_validate_bandwidth, + .validate_surface = dce100_validate_surface, }; static bool construct( diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h index bfd7518c94c9..13fc637eb731 100644 --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.h @@ -16,4 +16,6 @@ struct resource_pool *dce100_create_resource_pool( uint8_t num_virtual_links, struct core_dc *dc); +enum dc_status dce100_validate_surface(const struct dc_surface *surface); + #endif /* DCE100_RESOURCE_H_ */ |