summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
diff options
context:
space:
mode:
authorShirish S2017-08-21 10:32:17 +0200
committerAlex Deucher2017-09-27 00:17:28 +0200
commit4451a2551dcac9ea8c90829e0fcc798b834deb6b (patch)
tree7de164d23db8a1de4878bda441fdd9bac04ae680 /drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
parentdrm/amd/display: Request to have DCN RV pipe Harvesting (diff)
downloadkernel-qcow2-linux-4451a2551dcac9ea8c90829e0fcc798b834deb6b.tar.gz
kernel-qcow2-linux-4451a2551dcac9ea8c90829e0fcc798b834deb6b.tar.xz
kernel-qcow2-linux-4451a2551dcac9ea8c90829e0fcc798b834deb6b.zip
drm/amd/display: dce110: fix plane validation
For MPO to work with per surface rendering and flipping, the previous logic of restricting plane[1] only as underlay needs to be removed. validate_surface_sets() now checks only the width and height bounds in case of underlay rather than checking format. Without this patch one cannot set underlay only. Signed-off-by: Shirish S <shirish.s@amd.com> Reviewed-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/dce110/dce110_resource.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
index 41bfddf9574e..25eda52c32ef 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
@@ -891,21 +891,14 @@ static bool dce110_validate_surface_sets(
if (context->stream_status[i].plane_count > 2)
return false;
- if (context->stream_status[i].plane_states[0]->format
- >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
+ if ((context->stream_status[i].plane_states[i]->format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) &&
+ (context->stream_status[i].plane_states[i]->src_rect.width > 1920 ||
+ context->stream_status[i].plane_states[i]->src_rect.height > 1080))
return false;
- if (context->stream_status[i].plane_count == 2) {
- if (context->stream_status[i].plane_states[1]->format
- < SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
- return false;
- if (context->stream_status[i].plane_states[1]->src_rect.width > 1920
- || context->stream_status[i].plane_states[1]->src_rect.height > 1080)
- return false;
-
- if (context->streams[i]->timing.pixel_encoding != PIXEL_ENCODING_RGB)
- return false;
- }
+ /* irrespective of plane format, stream should be RGB encoded */
+ if (context->streams[i]->timing.pixel_encoding != PIXEL_ENCODING_RGB)
+ return false;
}
return true;