aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0309-drm-amd-display-stereo-support.patch
blob: c5c550d85f164cc0103d05b5d7dbf302ec07fd56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 892b52c8fa9f6bd8542fa213b0cba78bb70fba7e Mon Sep 17 00:00:00 2001
From: Vitaly Prosyak <vitaly.prosyak@amd.com>
Date: Mon, 27 Mar 2017 12:48:46 -0500
Subject: [PATCH 0309/4131] drm/amd/display: stereo support

Frame sequential, top-bottom and side-by-side support.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 34 +++++++++++++++++------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 61ca1e2..8f53d7a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -422,6 +422,11 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx)
 	bool sec_split = pipe_ctx->top_pipe &&
 			pipe_ctx->top_pipe->surface == pipe_ctx->surface;
 
+	if (stream->timing.timing_3d_format == TIMING_3D_FORMAT_SIDE_BY_SIDE ||
+		stream->timing.timing_3d_format == TIMING_3D_FORMAT_TOP_AND_BOTTOM) {
+		pri_split = false;
+		sec_split = false;
+	}
 	/* The actual clip is an intersection between stream
 	 * source and surface clip
 	 */
@@ -532,14 +537,27 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skip
 			stream->public.dst.y + stream->public.dst.height
 						- pipe_ctx->scl_data.recout.y;
 
-	/* Handle hsplit */
-	if (pipe_ctx->top_pipe && pipe_ctx->top_pipe->surface == pipe_ctx->surface) {
-		pipe_ctx->scl_data.recout.width /= 2;
-		pipe_ctx->scl_data.recout.x += pipe_ctx->scl_data.recout.width;
-		/* Floor primary pipe, ceil 2ndary pipe */
-		pipe_ctx->scl_data.recout.width += pipe_ctx->scl_data.recout.width % 2;
-	} else if (pipe_ctx->bottom_pipe && pipe_ctx->bottom_pipe->surface == pipe_ctx->surface) {
-		pipe_ctx->scl_data.recout.width /= 2;
+	/* Handle h & vsplit */
+	if (pipe_ctx->top_pipe && pipe_ctx->top_pipe->surface ==
+		pipe_ctx->surface) {
+		if (stream->public.timing.timing_3d_format ==
+			TIMING_3D_FORMAT_TOP_AND_BOTTOM) {
+			pipe_ctx->scl_data.recout.height /= 2;
+			pipe_ctx->scl_data.recout.y += pipe_ctx->scl_data.recout.height;
+			/* Floor primary pipe, ceil 2ndary pipe */
+			pipe_ctx->scl_data.recout.height += pipe_ctx->scl_data.recout.height % 2;
+		} else {
+			pipe_ctx->scl_data.recout.width /= 2;
+			pipe_ctx->scl_data.recout.x += pipe_ctx->scl_data.recout.width;
+			pipe_ctx->scl_data.recout.width += pipe_ctx->scl_data.recout.width % 2;
+		}
+	} else if (pipe_ctx->bottom_pipe &&
+			   pipe_ctx->bottom_pipe->surface == pipe_ctx->surface) {
+		if (stream->public.timing.timing_3d_format ==
+			TIMING_3D_FORMAT_TOP_AND_BOTTOM)
+			pipe_ctx->scl_data.recout.height /= 2;
+		else
+			pipe_ctx->scl_data.recout.width /= 2;
 	}
 
 	/* Unclipped recout offset = stream dst offset + ((surf dst offset - stream src offset)
-- 
2.7.4