]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amd/display: fix dml pipe merge logic
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Sun, 5 Apr 2020 20:41:02 +0000 (16:41 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Apr 2020 14:43:17 +0000 (10:43 -0400)
Dml merges mpc/odm combine pipes to do calculations. This merge is
imperfect if there is a viewport overlap. This change saves pre overlap
viewport for dml use.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h

index 7b32a34908c80d66fba85d64d47f7cb0888618ad..12f5c6881cd0dd1a52c1dc2ba2a6914f3186c94e 100644 (file)
@@ -692,6 +692,9 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx)
        /* Round up, assume original video size always even dimensions */
        data->viewport_c.width = (data->viewport.width + vpc_div - 1) / vpc_div;
        data->viewport_c.height = (data->viewport.height + vpc_div - 1) / vpc_div;
+
+       data->viewport_unadjusted = data->viewport;
+       data->viewport_c_unadjusted = data->viewport_c;
 }
 
 static void calculate_recout(struct pipe_ctx *pipe_ctx)
index 5cdbba0cd87316a7df2611b434f885412e7f4fd4..9e1d2b2e58f975c1ff8909f78d2db450244b495e 100644 (file)
@@ -2212,12 +2212,12 @@ int dcn20_populate_dml_pipes_from_context(
                                        || pipes[pipe_cnt].pipe.dest.odm_combine != dm_odm_combine_mode_disabled;
                        pipes[pipe_cnt].pipe.src.source_scan = pln->rotation == ROTATION_ANGLE_90
                                        || pln->rotation == ROTATION_ANGLE_270 ? dm_vert : dm_horz;
-                       pipes[pipe_cnt].pipe.src.viewport_y_y = scl->viewport.y;
-                       pipes[pipe_cnt].pipe.src.viewport_y_c = scl->viewport_c.y;
-                       pipes[pipe_cnt].pipe.src.viewport_width = scl->viewport.width;
-                       pipes[pipe_cnt].pipe.src.viewport_width_c = scl->viewport_c.width;
-                       pipes[pipe_cnt].pipe.src.viewport_height = scl->viewport.height;
-                       pipes[pipe_cnt].pipe.src.viewport_height_c = scl->viewport_c.height;
+                       pipes[pipe_cnt].pipe.src.viewport_y_y = scl->viewport_unadjusted.y;
+                       pipes[pipe_cnt].pipe.src.viewport_y_c = scl->viewport_c_unadjusted.y;
+                       pipes[pipe_cnt].pipe.src.viewport_width = scl->viewport_unadjusted.width;
+                       pipes[pipe_cnt].pipe.src.viewport_width_c = scl->viewport_c_unadjusted.width;
+                       pipes[pipe_cnt].pipe.src.viewport_height = scl->viewport_unadjusted.height;
+                       pipes[pipe_cnt].pipe.src.viewport_height_c = scl->viewport_c_unadjusted.height;
                        pipes[pipe_cnt].pipe.src.surface_width_y = pln->plane_size.surface_size.width;
                        pipes[pipe_cnt].pipe.src.surface_height_y = pln->plane_size.surface_size.height;
                        pipes[pipe_cnt].pipe.src.surface_width_c = pln->plane_size.chroma_size.width;
index fecc80c47c267eb015572bf6df6a3708088e73ef..2947d1b15512910658a06a07792414bfab21fc25 100644 (file)
@@ -173,6 +173,8 @@ struct scaler_data {
        struct scaling_taps taps;
        struct rect viewport;
        struct rect viewport_c;
+       struct rect viewport_unadjusted;
+       struct rect viewport_c_unadjusted;
        struct rect recout;
        struct scaling_ratios ratios;
        struct scl_inits inits;