aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch')
-rw-r--r--common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch362
1 files changed, 362 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch b/common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch
new file mode 100644
index 00000000..00c36adf
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0904-drm-amd-dal-bw-calculations-fixed-for-displays-4-6.patch
@@ -0,0 +1,362 @@
+From 4611e5b60b8b8beab49a192ea35d2a813088df34 Mon Sep 17 00:00:00 2001
+From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
+Date: Mon, 14 Mar 2016 15:20:31 -0400
+Subject: [PATCH 0904/1110] drm/amd/dal: bw calculations fixed for displays 4-6
+
+Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c | 191 ++++++++++++++++++++-
+ drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h | 24 ++-
+ 2 files changed, 211 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c b/drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c
+index c64efe6..f39499a 100644
+--- a/drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c
++++ b/drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c
+@@ -357,7 +357,7 @@ static void calculate_bandwidth(
+ results->scale_ratio[i] =
+ mode_data->d1_graphics_scale_ratio;
+ stereo_mode[i] = mode_data->d1_graphics_stereo_mode;
+- } else {
++ } else if (i == 6) {
+ results->compression_rate[i] = bw_int_to_fixed(1);
+ results->access_one_channel_only[i] = 0;
+ results->h_total[i] = bw_int_to_fixed(
+@@ -372,6 +372,51 @@ static void calculate_bandwidth(
+ results->scale_ratio[i] =
+ mode_data->d2_graphics_scale_ratio;
+ stereo_mode[i] = mode_data->d2_graphics_stereo_mode;
++ } else if (i == 7) {
++ results->compression_rate[i] = bw_int_to_fixed(1);
++ results->access_one_channel_only[i] = 0;
++ results->h_total[i] = bw_int_to_fixed(
++ mode_data->d3_htotal);
++ results->pixel_rate[i] = mode_data->d3_pixel_rate;
++ results->src_width[i] = bw_int_to_fixed(
++ mode_data->d3_graphics_src_width);
++ results->src_height[i] = bw_int_to_fixed(
++ mode_data->d3_graphics_src_height);
++ results->pitch_in_pixels[i] = bw_int_to_fixed(
++ mode_data->d3_graphics_src_width);
++ results->scale_ratio[i] =
++ mode_data->d3_graphics_scale_ratio;
++ stereo_mode[i] = mode_data->d3_graphics_stereo_mode;
++ } else if (i == 8) {
++ results->compression_rate[i] = bw_int_to_fixed(1);
++ results->access_one_channel_only[i] = 0;
++ results->h_total[i] = bw_int_to_fixed(
++ mode_data->d4_htotal);
++ results->pixel_rate[i] = mode_data->d4_pixel_rate;
++ results->src_width[i] = bw_int_to_fixed(
++ mode_data->d4_graphics_src_width);
++ results->src_height[i] = bw_int_to_fixed(
++ mode_data->d4_graphics_src_height);
++ results->pitch_in_pixels[i] = bw_int_to_fixed(
++ mode_data->d4_graphics_src_width);
++ results->scale_ratio[i] =
++ mode_data->d4_graphics_scale_ratio;
++ stereo_mode[i] = mode_data->d4_graphics_stereo_mode;
++ } else {
++ results->compression_rate[i] = bw_int_to_fixed(1);
++ results->access_one_channel_only[i] = 0;
++ results->h_total[i] = bw_int_to_fixed(
++ mode_data->d5_htotal);
++ results->pixel_rate[i] = mode_data->d5_pixel_rate;
++ results->src_width[i] = bw_int_to_fixed(
++ mode_data->d5_graphics_src_width);
++ results->src_height[i] = bw_int_to_fixed(
++ mode_data->d5_graphics_src_height);
++ results->pitch_in_pixels[i] = bw_int_to_fixed(
++ mode_data->d5_graphics_src_width);
++ results->scale_ratio[i] =
++ mode_data->d5_graphics_scale_ratio;
++ stereo_mode[i] = mode_data->d5_graphics_stereo_mode;
+ }
+ results->cursor_width_pixels[i] = bw_int_to_fixed(
+ vbios->cursor_width);
+@@ -3729,10 +3774,46 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+
+ switch (mode_data->number_of_displays) {
+ case (6):
++ bw_data_internal->d5_htotal =
++ mode_data->displays_data[5].h_total;
++ bw_data_internal->d5_pixel_rate =
++ mode_data->displays_data[5].pixel_rate;
++ bw_data_internal->d5_graphics_src_width =
++ mode_data->displays_data[5].graphics_src_width;
++ bw_data_internal->d5_graphics_src_height =
++ mode_data->displays_data[5].graphics_src_height;
++ bw_data_internal->d5_graphics_scale_ratio =
++ mode_data->displays_data[5].graphics_scale_ratio;
++ bw_data_internal->d5_graphics_stereo_mode =
++ mode_data->displays_data[5].graphics_stereo_mode;
+ /* fall through */
+ case (5):
++ bw_data_internal->d4_htotal =
++ mode_data->displays_data[4].h_total;
++ bw_data_internal->d4_pixel_rate =
++ mode_data->displays_data[4].pixel_rate;
++ bw_data_internal->d4_graphics_src_width =
++ mode_data->displays_data[4].graphics_src_width;
++ bw_data_internal->d4_graphics_src_height =
++ mode_data->displays_data[4].graphics_src_height;
++ bw_data_internal->d4_graphics_scale_ratio =
++ mode_data->displays_data[4].graphics_scale_ratio;
++ bw_data_internal->d4_graphics_stereo_mode =
++ mode_data->displays_data[4].graphics_stereo_mode;
+ /* fall through */
+ case (4):
++ bw_data_internal->d3_htotal =
++ mode_data->displays_data[3].h_total;
++ bw_data_internal->d3_pixel_rate =
++ mode_data->displays_data[3].pixel_rate;
++ bw_data_internal->d3_graphics_src_width =
++ mode_data->displays_data[3].graphics_src_width;
++ bw_data_internal->d3_graphics_src_height =
++ mode_data->displays_data[3].graphics_src_height;
++ bw_data_internal->d3_graphics_scale_ratio =
++ mode_data->displays_data[3].graphics_scale_ratio;
++ bw_data_internal->d3_graphics_stereo_mode =
++ mode_data->displays_data[3].graphics_stereo_mode;
+ /* fall through */
+ case (3):
+ bw_data_internal->d2_htotal =
+@@ -3888,6 +3969,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->nbp_state_change_wm_ns[2].a_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ nbp_state_change_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[3].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[4].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[5].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->stutter_exit_wm_ns[0].a_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3898,6 +3988,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->stutter_exit_wm_ns[2].a_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ stutter_exit_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[3].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[4].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[5].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->urgent_wm_ns[0].a_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3908,6 +4007,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->urgent_wm_ns[2].a_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ urgent_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[3].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[4].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[5].a_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[9], bw_int_to_fixed(1000)));
+
+ /*TODO check correctness*/
+ ((struct bw_calcs_vbios *)vbios)->low_sclk = mid_sclk;
+@@ -3923,6 +4031,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->nbp_state_change_wm_ns[2].b_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ nbp_state_change_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[3].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[4].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[5].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->stutter_exit_wm_ns[0].b_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3933,6 +4050,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->stutter_exit_wm_ns[2].b_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ stutter_exit_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[3].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[4].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[5].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->urgent_wm_ns[0].b_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3943,6 +4069,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->urgent_wm_ns[2].b_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ urgent_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[3].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[4].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[5].b_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[9], bw_int_to_fixed(1000)));
+
+ /*TODO check correctness*/
+ ((struct bw_calcs_vbios *)vbios)->low_sclk = low_sclk;
+@@ -3959,6 +4094,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->nbp_state_change_wm_ns[2].c_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ nbp_state_change_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[3].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[4].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[5].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->stutter_exit_wm_ns[0].c_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3969,6 +4113,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->stutter_exit_wm_ns[2].c_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ stutter_exit_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[3].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[4].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[5].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->urgent_wm_ns[0].c_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -3979,6 +4132,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->urgent_wm_ns[2].c_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ urgent_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[3].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[4].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[5].c_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[9], bw_int_to_fixed(1000)));
+
+ ((struct bw_calcs_vbios *)vbios)->low_yclk = high_yclk;
+ ((struct bw_calcs_vbios *)vbios)->mid_yclk = high_yclk;
+@@ -3997,6 +4159,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->nbp_state_change_wm_ns[2].d_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ nbp_state_change_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[3].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[4].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->nbp_state_change_wm_ns[5].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ nbp_state_change_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->stutter_exit_wm_ns[0].d_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -4007,6 +4178,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->stutter_exit_wm_ns[2].d_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ stutter_exit_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[3].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[4].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->stutter_exit_wm_ns[5].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ stutter_exit_watermark[9], bw_int_to_fixed(1000)));
+
+ calcs_output->urgent_wm_ns[0].d_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+@@ -4017,6 +4197,15 @@ bool bw_calcs(struct dc_context *ctx, const struct bw_calcs_dceip *dceip,
+ calcs_output->urgent_wm_ns[2].d_mark =
+ bw_fixed_to_int(bw_mul(bw_results_internal->
+ urgent_watermark[6], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[3].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[7], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[4].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[8], bw_int_to_fixed(1000)));
++ calcs_output->urgent_wm_ns[5].d_mark =
++ bw_fixed_to_int(bw_mul(bw_results_internal->
++ urgent_watermark[9], bw_int_to_fixed(1000)));
+
+ ((struct bw_calcs_vbios *)vbios)->low_yclk = low_yclk;
+ ((struct bw_calcs_vbios *)vbios)->mid_yclk = mid_yclk;
+diff --git a/drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h b/drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h
+index 023efd3..d6a599c 100644
+--- a/drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h
++++ b/drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h
+@@ -228,6 +228,24 @@ struct bw_calcs_mode_data_internal {
+ uint32_t d2_graphics_src_height;
+ struct bw_fixed d2_graphics_scale_ratio;
+ enum bw_defines d2_graphics_stereo_mode;
++ uint32_t d3_htotal;
++ struct bw_fixed d3_pixel_rate;
++ uint32_t d3_graphics_src_width;
++ uint32_t d3_graphics_src_height;
++ struct bw_fixed d3_graphics_scale_ratio;
++ enum bw_defines d3_graphics_stereo_mode;
++ uint32_t d4_htotal;
++ struct bw_fixed d4_pixel_rate;
++ uint32_t d4_graphics_src_width;
++ uint32_t d4_graphics_src_height;
++ struct bw_fixed d4_graphics_scale_ratio;
++ enum bw_defines d4_graphics_stereo_mode;
++ uint32_t d5_htotal;
++ struct bw_fixed d5_pixel_rate;
++ uint32_t d5_graphics_src_width;
++ uint32_t d5_graphics_src_height;
++ struct bw_fixed d5_graphics_scale_ratio;
++ enum bw_defines d5_graphics_stereo_mode;
+ };
+
+ struct bw_calcs_input_single_display {
+@@ -475,9 +493,9 @@ struct bw_calcs_output {
+ bool stutter_mode_enable;
+ bool nbp_state_change_enable;
+ bool all_displays_in_sync;
+- struct bw_watermarks urgent_wm_ns[4];
+- struct bw_watermarks stutter_exit_wm_ns[4];
+- struct bw_watermarks nbp_state_change_wm_ns[4];
++ struct bw_watermarks urgent_wm_ns[6];
++ struct bw_watermarks stutter_exit_wm_ns[6];
++ struct bw_watermarks nbp_state_change_wm_ns[6];
+ uint32_t required_sclk;
+ uint32_t required_sclk_deep_sleep;
+ uint32_t required_yclk;
+--
+2.7.4
+