drm/amd/display: Set addressable region as active + border
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Thu, 5 Oct 2017 23:15:25 +0000 (19:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:50:04 +0000 (16:50 -0400)
This ensures that we do not draw the blank region onscreen, and that we
do underscan instead.

Signed-off-by: Andrew Jiang <Andrew.Jiang@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/core/dc_resource.c

index 303d7ec684d915956c8790e5351a90aed5738b82..454a521a268d286b35fba69e0b397da9d8d89dea 100644 (file)
@@ -850,6 +850,20 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
         */
        pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
 
+       /**
+        * KMD sends us h and v_addressable without the borders, which causes us sometimes to draw
+        * the blank region on-screen. Correct for this by adding the borders back to their
+        * respective addressable values, and by shifting recout.
+        */
+       timing->h_addressable += timing->h_border_left + timing->h_border_right;
+       timing->v_addressable += timing->v_border_top + timing->v_border_bottom;
+       pipe_ctx->plane_res.scl_data.recout.y += timing->v_border_top;
+       pipe_ctx->plane_res.scl_data.recout.x += timing->h_border_left;
+       timing->v_border_top = 0;
+       timing->v_border_bottom = 0;
+       timing->h_border_left = 0;
+       timing->h_border_right = 0;
+
        pipe_ctx->plane_res.scl_data.h_active = timing->h_addressable;
        pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;