diff options
author | Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> | 2018-04-18 14:19:23 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-18 17:08:23 -0400 |
commit | 0002d3ac8aadcb2850475557de32234b447ba502 (patch) | |
tree | 8f8bfa025dd21f14724aba885a59216099107e2b | |
parent | ab9c2062d960df84d41c03efc49cb01071b398c6 (diff) |
drm/amd/display: truncate scaling ratios and inits to 19 bit precision
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>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 25 |
1 files changed, 17 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 082458f2097c..751f3ac9d921 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |||
@@ -652,6 +652,14 @@ static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx) | |||
652 | pipe_ctx->plane_res.scl_data.ratios.horz_c.value /= 2; | 652 | pipe_ctx->plane_res.scl_data.ratios.horz_c.value /= 2; |
653 | pipe_ctx->plane_res.scl_data.ratios.vert_c.value /= 2; | 653 | pipe_ctx->plane_res.scl_data.ratios.vert_c.value /= 2; |
654 | } | 654 | } |
655 | pipe_ctx->plane_res.scl_data.ratios.horz = dc_fixpt_truncate( | ||
656 | pipe_ctx->plane_res.scl_data.ratios.horz, 19); | ||
657 | pipe_ctx->plane_res.scl_data.ratios.vert = dc_fixpt_truncate( | ||
658 | pipe_ctx->plane_res.scl_data.ratios.vert, 19); | ||
659 | pipe_ctx->plane_res.scl_data.ratios.horz_c = dc_fixpt_truncate( | ||
660 | pipe_ctx->plane_res.scl_data.ratios.horz_c, 19); | ||
661 | pipe_ctx->plane_res.scl_data.ratios.vert_c = dc_fixpt_truncate( | ||
662 | pipe_ctx->plane_res.scl_data.ratios.vert_c, 19); | ||
655 | } | 663 | } |
656 | 664 | ||
657 | static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx, struct view *recout_skip) | 665 | static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx, struct view *recout_skip) |
@@ -688,17 +696,18 @@ static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx, struct view *r | |||
688 | * init_bot = init + scaling_ratio | 696 | * init_bot = init + scaling_ratio |
689 | * init_c = init + truncated_vp_c_offset(from calculate viewport) | 697 | * init_c = init + truncated_vp_c_offset(from calculate viewport) |
690 | */ | 698 | */ |
691 | data->inits.h = dc_fixpt_div_int( | 699 | data->inits.h = dc_fixpt_truncate(dc_fixpt_div_int( |
692 | dc_fixpt_add_int(data->ratios.horz, data->taps.h_taps + 1), 2); | 700 | dc_fixpt_add_int(data->ratios.horz, data->taps.h_taps + 1), 2), 19); |
693 | 701 | ||
694 | data->inits.h_c = dc_fixpt_add(data->inits.h_c, dc_fixpt_div_int( | 702 | data->inits.h_c = dc_fixpt_truncate(dc_fixpt_add(data->inits.h_c, dc_fixpt_div_int( |
695 | dc_fixpt_add_int(data->ratios.horz_c, data->taps.h_taps_c + 1), 2)); | 703 | dc_fixpt_add_int(data->ratios.horz_c, data->taps.h_taps_c + 1), 2)), 19); |
696 | 704 | ||
697 | data->inits.v = dc_fixpt_div_int( | 705 | data->inits.v = dc_fixpt_truncate(dc_fixpt_div_int( |
698 | dc_fixpt_add_int(data->ratios.vert, data->taps.v_taps + 1), 2); | 706 | dc_fixpt_add_int(data->ratios.vert, data->taps.v_taps + 1), 2), 19); |
707 | |||
708 | data->inits.v_c = dc_fixpt_truncate(dc_fixpt_add(data->inits.v_c, dc_fixpt_div_int( | ||
709 | dc_fixpt_add_int(data->ratios.vert_c, data->taps.v_taps_c + 1), 2)), 19); | ||
699 | 710 | ||
700 | data->inits.v_c = dc_fixpt_add(data->inits.v_c, dc_fixpt_div_int( | ||
701 | dc_fixpt_add_int(data->ratios.vert_c, data->taps.v_taps_c + 1), 2)); | ||
702 | 711 | ||
703 | 712 | ||
704 | /* Adjust for viewport end clip-off */ | 713 | /* Adjust for viewport end clip-off */ |