]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amd/display: fix split viewport rounding error
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Fri, 10 Nov 2017 18:53:53 +0000 (13:53 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Nov 2017 22:55:10 +0000 (17:55 -0500)
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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>
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 3dce35e66b0917d2ec93420063b3477443788302..983987f7c9835b824e760ebf98a909a927b96cdd 100644 (file)
@@ -890,6 +890,10 @@ bool dcn_validate_bandwidth(
                                                + pipe->bottom_pipe->plane_res.scl_data.recout.width;
                        }
 
+                       ASSERT(pipe->plane_res.scl_data.ratios.horz.value != dal_fixed31_32_one.value
+                               || v->scaler_rec_out_width[input_idx] == v->viewport_width[input_idx]);
+                       ASSERT(pipe->plane_res.scl_data.ratios.vert.value != dal_fixed31_32_one.value
+                               || v->scaler_recout_height[input_idx] == v->viewport_height[input_idx]);
                        v->dcc_enable[input_idx] = pipe->plane_state->dcc.enable ? dcn_bw_yes : dcn_bw_no;
                        v->source_pixel_format[input_idx] = tl_pixel_format_to_bw_defs(
                                        pipe->plane_state->format);
index 1cd15d1cc3f4112d407c594c3368e5fc1d15a538..655e08df48a012cf94dfbc7b0c8b2856de248fa2 100644 (file)
@@ -516,13 +516,11 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx)
                        right_view = (plane_state->rotation == ROTATION_ANGLE_270) != sec_split;
 
                if (right_view) {
-                       data->viewport.width /= 2;
-                       data->viewport_c.width /= 2;
-                       data->viewport.x +=  data->viewport.width;
-                       data->viewport_c.x +=  data->viewport_c.width;
+                       data->viewport.x +=  data->viewport.width / 2;
+                       data->viewport_c.x +=  data->viewport_c.width / 2;
                        /* Ceil offset pipe */
-                       data->viewport.width += data->viewport.width % 2;
-                       data->viewport_c.width += data->viewport_c.width % 2;
+                       data->viewport.width = (data->viewport.width + 1) / 2;
+                       data->viewport_c.width = (data->viewport_c.width + 1) / 2;
                } else {
                        data->viewport.width /= 2;
                        data->viewport_c.width /= 2;