drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c:350:11: warning: variable 'pixel_width' set but not used

From: kernel test robot
Date: Wed Jun 17 2020 - 03:52:21 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 69119673bd50b176ded34032fadd41530fb5af21
commit: 476e955dd679673c81c35f383ffff8f7dbd70d97 drm/amd/display: Hook DCN2 into amdgpu_dm and expose as config (v2)
date: 12 months ago
config: i386-randconfig-m021-20200617 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c:233:6: warning: no previous prototype for 'dpp2_cnv_set_bias_scale' [-Wmissing-prototypes]
233 | void dpp2_cnv_set_bias_scale(
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c: In function 'dpp2_get_optimal_number_of_taps':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c:350:11: warning: variable 'pixel_width' set but not used [-Wunused-but-set-variable]
350 | uint32_t pixel_width;
| ^~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:32,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c:28:
At top level:
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:120:22: warning: 'DP_DVI_CONVERTER_ID_4' defined but not used [-Wunused-const-variable=]
120 | static const uint8_t DP_DVI_CONVERTER_ID_4[] = "m2DVIa";
| ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:118:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_3' defined but not used [-Wunused-const-variable=]
118 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_3[] = "dnomlA";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:116:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_2' defined but not used [-Wunused-const-variable=]
116 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_2[] = "sivarT";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:37,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c:26:
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
| ^~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
| ^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
| ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:67:32: warning: 'dc_fixpt_zero' defined but not used [-Wunused-const-variable=]
67 | static const struct fixed31_32 dc_fixpt_zero = { 0 };
| ^~~~~~~~~~~~~
--
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:530:17: warning: no previous prototype for 'wbscl_get_filter_3tap_16p' [-Wmissing-prototypes]
530 | const uint16_t *wbscl_get_filter_3tap_16p(struct fixed31_32 ratio)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:542:17: warning: no previous prototype for 'wbscl_get_filter_4tap_16p' [-Wmissing-prototypes]
542 | const uint16_t *wbscl_get_filter_4tap_16p(struct fixed31_32 ratio)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c: In function 'dwb_program_horz_scalar':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:725:11: warning: variable 'h_ratio_chroma' set but not used [-Wunused-but-set-variable]
725 | uint32_t h_ratio_chroma = 1;
| ^~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c: In function 'dwb_program_vert_scalar':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:806:11: warning: variable 'v_ratio_chroma' set but not used [-Wunused-but-set-variable]
806 | uint32_t v_ratio_chroma = 1;
| ^~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:32,
from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/resource.h:28,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:28:
At top level:
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:120:22: warning: 'DP_DVI_CONVERTER_ID_4' defined but not used [-Wunused-const-variable=]
120 | static const uint8_t DP_DVI_CONVERTER_ID_4[] = "m2DVIa";
| ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:118:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_3' defined but not used [-Wunused-const-variable=]
118 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_3[] = "dnomlA";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/ddc_service_types.h:116:22: warning: 'DP_VGA_LVDS_CONVERTER_ID_2' defined but not used [-Wunused-const-variable=]
116 | static const uint8_t DP_VGA_LVDS_CONVERTER_ID_2[] = "sivarT";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:37,
from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/reg_helper.h:28,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb_scl.c:26:
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
| ^~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
| ^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
| ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:67:32: warning: 'dc_fixpt_zero' defined but not used [-Wunused-const-variable=]
67 | static const struct fixed31_32 dc_fixpt_zero = { 0 };
| ^~~~~~~~~~~~~

vim +/pixel_width +350 drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dpp.c

f7de96ee8b5f4d Harry Wentland 2019-02-22 232
f7de96ee8b5f4d Harry Wentland 2019-02-22 @233 void dpp2_cnv_set_bias_scale(
f7de96ee8b5f4d Harry Wentland 2019-02-22 234 struct dpp *dpp_base,
f7de96ee8b5f4d Harry Wentland 2019-02-22 235 struct dc_bias_and_scale *bias_and_scale)
f7de96ee8b5f4d Harry Wentland 2019-02-22 236 {
f7de96ee8b5f4d Harry Wentland 2019-02-22 237 struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
f7de96ee8b5f4d Harry Wentland 2019-02-22 238
f7de96ee8b5f4d Harry Wentland 2019-02-22 239 REG_UPDATE(FCNV_FP_BIAS_R, FCNV_FP_BIAS_R, bias_and_scale->bias_red);
f7de96ee8b5f4d Harry Wentland 2019-02-22 240 REG_UPDATE(FCNV_FP_BIAS_G, FCNV_FP_BIAS_G, bias_and_scale->bias_green);
f7de96ee8b5f4d Harry Wentland 2019-02-22 241 REG_UPDATE(FCNV_FP_BIAS_B, FCNV_FP_BIAS_B, bias_and_scale->bias_blue);
f7de96ee8b5f4d Harry Wentland 2019-02-22 242 REG_UPDATE(FCNV_FP_SCALE_R, FCNV_FP_SCALE_R, bias_and_scale->scale_red);
f7de96ee8b5f4d Harry Wentland 2019-02-22 243 REG_UPDATE(FCNV_FP_SCALE_G, FCNV_FP_SCALE_G, bias_and_scale->scale_green);
f7de96ee8b5f4d Harry Wentland 2019-02-22 244 REG_UPDATE(FCNV_FP_SCALE_B, FCNV_FP_SCALE_B, bias_and_scale->scale_blue);
f7de96ee8b5f4d Harry Wentland 2019-02-22 245 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 246
f7de96ee8b5f4d Harry Wentland 2019-02-22 247 /*compute the maximum number of lines that we can fit in the line buffer*/
f7de96ee8b5f4d Harry Wentland 2019-02-22 248 void dscl2_calc_lb_num_partitions(
f7de96ee8b5f4d Harry Wentland 2019-02-22 249 const struct scaler_data *scl_data,
f7de96ee8b5f4d Harry Wentland 2019-02-22 250 enum lb_memory_config lb_config,
f7de96ee8b5f4d Harry Wentland 2019-02-22 251 int *num_part_y,
f7de96ee8b5f4d Harry Wentland 2019-02-22 252 int *num_part_c)
f7de96ee8b5f4d Harry Wentland 2019-02-22 253 {
f7de96ee8b5f4d Harry Wentland 2019-02-22 254 int line_size = scl_data->viewport.width < scl_data->recout.width ?
f7de96ee8b5f4d Harry Wentland 2019-02-22 255 scl_data->viewport.width : scl_data->recout.width;
f7de96ee8b5f4d Harry Wentland 2019-02-22 256 int line_size_c = scl_data->viewport_c.width < scl_data->recout.width ?
f7de96ee8b5f4d Harry Wentland 2019-02-22 257 scl_data->viewport_c.width : scl_data->recout.width;
f7de96ee8b5f4d Harry Wentland 2019-02-22 258 int memory_line_size_y = (line_size + 5) / 6; /* +5 to ceil */
f7de96ee8b5f4d Harry Wentland 2019-02-22 259 int memory_line_size_c = (line_size_c + 5) / 6; /* +5 to ceil */
f7de96ee8b5f4d Harry Wentland 2019-02-22 260 int memory_line_size_a = (line_size + 5) / 6; /* +5 to ceil */
f7de96ee8b5f4d Harry Wentland 2019-02-22 261 int lb_memory_size, lb_memory_size_c, lb_memory_size_a, num_partitions_a;
f7de96ee8b5f4d Harry Wentland 2019-02-22 262
f7de96ee8b5f4d Harry Wentland 2019-02-22 263 if (lb_config == LB_MEMORY_CONFIG_1) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 264 lb_memory_size = 970;
f7de96ee8b5f4d Harry Wentland 2019-02-22 265 lb_memory_size_c = 970;
f7de96ee8b5f4d Harry Wentland 2019-02-22 266 lb_memory_size_a = 970;
f7de96ee8b5f4d Harry Wentland 2019-02-22 267 } else if (lb_config == LB_MEMORY_CONFIG_2) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 268 lb_memory_size = 1290;
f7de96ee8b5f4d Harry Wentland 2019-02-22 269 lb_memory_size_c = 1290;
f7de96ee8b5f4d Harry Wentland 2019-02-22 270 lb_memory_size_a = 1290;
f7de96ee8b5f4d Harry Wentland 2019-02-22 271 } else if (lb_config == LB_MEMORY_CONFIG_3) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 272 /* 420 mode: using 3rd mem from Y, Cr and Cb */
f7de96ee8b5f4d Harry Wentland 2019-02-22 273 lb_memory_size = 970 + 1290 + 484 + 484 + 484;
f7de96ee8b5f4d Harry Wentland 2019-02-22 274 lb_memory_size_c = 970 + 1290;
f7de96ee8b5f4d Harry Wentland 2019-02-22 275 lb_memory_size_a = 970 + 1290 + 484;
f7de96ee8b5f4d Harry Wentland 2019-02-22 276 } else {
f7de96ee8b5f4d Harry Wentland 2019-02-22 277 lb_memory_size = 970 + 1290 + 484;
f7de96ee8b5f4d Harry Wentland 2019-02-22 278 lb_memory_size_c = 970 + 1290 + 484;
f7de96ee8b5f4d Harry Wentland 2019-02-22 279 lb_memory_size_a = 970 + 1290 + 484;
f7de96ee8b5f4d Harry Wentland 2019-02-22 280 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 281 *num_part_y = lb_memory_size / memory_line_size_y;
f7de96ee8b5f4d Harry Wentland 2019-02-22 282 *num_part_c = lb_memory_size_c / memory_line_size_c;
f7de96ee8b5f4d Harry Wentland 2019-02-22 283 num_partitions_a = lb_memory_size_a / memory_line_size_a;
f7de96ee8b5f4d Harry Wentland 2019-02-22 284
f7de96ee8b5f4d Harry Wentland 2019-02-22 285 if (scl_data->lb_params.alpha_en
f7de96ee8b5f4d Harry Wentland 2019-02-22 286 && (num_partitions_a < *num_part_y))
f7de96ee8b5f4d Harry Wentland 2019-02-22 287 *num_part_y = num_partitions_a;
f7de96ee8b5f4d Harry Wentland 2019-02-22 288
f7de96ee8b5f4d Harry Wentland 2019-02-22 289 if (*num_part_y > 64)
f7de96ee8b5f4d Harry Wentland 2019-02-22 290 *num_part_y = 64;
f7de96ee8b5f4d Harry Wentland 2019-02-22 291 if (*num_part_c > 64)
f7de96ee8b5f4d Harry Wentland 2019-02-22 292 *num_part_c = 64;
f7de96ee8b5f4d Harry Wentland 2019-02-22 293 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 294
f7de96ee8b5f4d Harry Wentland 2019-02-22 295 void dpp2_cnv_set_alpha_keyer(
f7de96ee8b5f4d Harry Wentland 2019-02-22 296 struct dpp *dpp_base,
f7de96ee8b5f4d Harry Wentland 2019-02-22 297 struct cnv_color_keyer_params *color_keyer)
f7de96ee8b5f4d Harry Wentland 2019-02-22 298 {
f7de96ee8b5f4d Harry Wentland 2019-02-22 299 struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
f7de96ee8b5f4d Harry Wentland 2019-02-22 300
f7de96ee8b5f4d Harry Wentland 2019-02-22 301 REG_UPDATE(COLOR_KEYER_CONTROL, COLOR_KEYER_EN, color_keyer->color_keyer_en);
f7de96ee8b5f4d Harry Wentland 2019-02-22 302
f7de96ee8b5f4d Harry Wentland 2019-02-22 303 REG_UPDATE(COLOR_KEYER_CONTROL, COLOR_KEYER_MODE, color_keyer->color_keyer_mode);
f7de96ee8b5f4d Harry Wentland 2019-02-22 304
f7de96ee8b5f4d Harry Wentland 2019-02-22 305 REG_UPDATE(COLOR_KEYER_ALPHA, COLOR_KEYER_ALPHA_LOW, color_keyer->color_keyer_alpha_low);
f7de96ee8b5f4d Harry Wentland 2019-02-22 306 REG_UPDATE(COLOR_KEYER_ALPHA, COLOR_KEYER_ALPHA_HIGH, color_keyer->color_keyer_alpha_high);
f7de96ee8b5f4d Harry Wentland 2019-02-22 307
f7de96ee8b5f4d Harry Wentland 2019-02-22 308 REG_UPDATE(COLOR_KEYER_RED, COLOR_KEYER_RED_LOW, color_keyer->color_keyer_red_low);
f7de96ee8b5f4d Harry Wentland 2019-02-22 309 REG_UPDATE(COLOR_KEYER_RED, COLOR_KEYER_RED_HIGH, color_keyer->color_keyer_red_high);
f7de96ee8b5f4d Harry Wentland 2019-02-22 310
f7de96ee8b5f4d Harry Wentland 2019-02-22 311 REG_UPDATE(COLOR_KEYER_GREEN, COLOR_KEYER_GREEN_LOW, color_keyer->color_keyer_green_low);
f7de96ee8b5f4d Harry Wentland 2019-02-22 312 REG_UPDATE(COLOR_KEYER_GREEN, COLOR_KEYER_GREEN_HIGH, color_keyer->color_keyer_green_high);
f7de96ee8b5f4d Harry Wentland 2019-02-22 313
f7de96ee8b5f4d Harry Wentland 2019-02-22 314 REG_UPDATE(COLOR_KEYER_BLUE, COLOR_KEYER_BLUE_LOW, color_keyer->color_keyer_blue_low);
f7de96ee8b5f4d Harry Wentland 2019-02-22 315 REG_UPDATE(COLOR_KEYER_BLUE, COLOR_KEYER_BLUE_HIGH, color_keyer->color_keyer_blue_high);
f7de96ee8b5f4d Harry Wentland 2019-02-22 316 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 317
f7de96ee8b5f4d Harry Wentland 2019-02-22 318 void dpp2_set_cursor_attributes(
f7de96ee8b5f4d Harry Wentland 2019-02-22 319 struct dpp *dpp_base,
f7de96ee8b5f4d Harry Wentland 2019-02-22 320 enum dc_cursor_color_format color_format)
f7de96ee8b5f4d Harry Wentland 2019-02-22 321 {
f7de96ee8b5f4d Harry Wentland 2019-02-22 322 struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
f7de96ee8b5f4d Harry Wentland 2019-02-22 323 int cur_rom_en = 0;
f7de96ee8b5f4d Harry Wentland 2019-02-22 324
f7de96ee8b5f4d Harry Wentland 2019-02-22 325 if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
f7de96ee8b5f4d Harry Wentland 2019-02-22 326 color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA)
f7de96ee8b5f4d Harry Wentland 2019-02-22 327 cur_rom_en = 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 328
f7de96ee8b5f4d Harry Wentland 2019-02-22 329 REG_UPDATE_3(CURSOR0_CONTROL,
f7de96ee8b5f4d Harry Wentland 2019-02-22 330 CUR0_MODE, color_format,
f7de96ee8b5f4d Harry Wentland 2019-02-22 331 CUR0_EXPANSION_MODE, 0,
f7de96ee8b5f4d Harry Wentland 2019-02-22 332 CUR0_ROM_EN, cur_rom_en);
f7de96ee8b5f4d Harry Wentland 2019-02-22 333
f7de96ee8b5f4d Harry Wentland 2019-02-22 334 if (color_format == CURSOR_MODE_MONO) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 335 /* todo: clarify what to program these to */
f7de96ee8b5f4d Harry Wentland 2019-02-22 336 REG_UPDATE(CURSOR0_COLOR0,
f7de96ee8b5f4d Harry Wentland 2019-02-22 337 CUR0_COLOR0, 0x00000000);
f7de96ee8b5f4d Harry Wentland 2019-02-22 338 REG_UPDATE(CURSOR0_COLOR1,
f7de96ee8b5f4d Harry Wentland 2019-02-22 339 CUR0_COLOR1, 0xFFFFFFFF);
f7de96ee8b5f4d Harry Wentland 2019-02-22 340 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 341 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 342
f7de96ee8b5f4d Harry Wentland 2019-02-22 343 #define IDENTITY_RATIO(ratio) (dc_fixpt_u3d19(ratio) == (1 << 19))
f7de96ee8b5f4d Harry Wentland 2019-02-22 344
f7de96ee8b5f4d Harry Wentland 2019-02-22 345 bool dpp2_get_optimal_number_of_taps(
f7de96ee8b5f4d Harry Wentland 2019-02-22 346 struct dpp *dpp,
f7de96ee8b5f4d Harry Wentland 2019-02-22 347 struct scaler_data *scl_data,
f7de96ee8b5f4d Harry Wentland 2019-02-22 348 const struct scaling_taps *in_taps)
f7de96ee8b5f4d Harry Wentland 2019-02-22 349 {
f7de96ee8b5f4d Harry Wentland 2019-02-22 @350 uint32_t pixel_width;
f7de96ee8b5f4d Harry Wentland 2019-02-22 351
f7de96ee8b5f4d Harry Wentland 2019-02-22 352 if (scl_data->viewport.width > scl_data->recout.width)
f7de96ee8b5f4d Harry Wentland 2019-02-22 353 pixel_width = scl_data->recout.width;
f7de96ee8b5f4d Harry Wentland 2019-02-22 354 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 355 pixel_width = scl_data->viewport.width;
f7de96ee8b5f4d Harry Wentland 2019-02-22 356
f7de96ee8b5f4d Harry Wentland 2019-02-22 357 /* Some ASICs does not support FP16 scaling, so we reject modes require this*/
f7de96ee8b5f4d Harry Wentland 2019-02-22 358 if (scl_data->viewport.width != scl_data->h_active &&
f7de96ee8b5f4d Harry Wentland 2019-02-22 359 scl_data->viewport.height != scl_data->v_active &&
f7de96ee8b5f4d Harry Wentland 2019-02-22 360 dpp->caps->dscl_data_proc_format == DSCL_DATA_PRCESSING_FIXED_FORMAT &&
f7de96ee8b5f4d Harry Wentland 2019-02-22 361 scl_data->format == PIXEL_FORMAT_FP16)
f7de96ee8b5f4d Harry Wentland 2019-02-22 362 return false;
f7de96ee8b5f4d Harry Wentland 2019-02-22 363
f7de96ee8b5f4d Harry Wentland 2019-02-22 364 if (scl_data->viewport.width > scl_data->h_active &&
f7de96ee8b5f4d Harry Wentland 2019-02-22 365 dpp->ctx->dc->debug.max_downscale_src_width != 0 &&
f7de96ee8b5f4d Harry Wentland 2019-02-22 366 scl_data->viewport.width > dpp->ctx->dc->debug.max_downscale_src_width)
f7de96ee8b5f4d Harry Wentland 2019-02-22 367 return false;
f7de96ee8b5f4d Harry Wentland 2019-02-22 368
f7de96ee8b5f4d Harry Wentland 2019-02-22 369 /* TODO: add lb check */
f7de96ee8b5f4d Harry Wentland 2019-02-22 370
f7de96ee8b5f4d Harry Wentland 2019-02-22 371 /* No support for programming ratio of 8, drop to 7.99999.. */
f7de96ee8b5f4d Harry Wentland 2019-02-22 372 if (scl_data->ratios.horz.value == (8ll << 32))
f7de96ee8b5f4d Harry Wentland 2019-02-22 373 scl_data->ratios.horz.value--;
f7de96ee8b5f4d Harry Wentland 2019-02-22 374 if (scl_data->ratios.vert.value == (8ll << 32))
f7de96ee8b5f4d Harry Wentland 2019-02-22 375 scl_data->ratios.vert.value--;
f7de96ee8b5f4d Harry Wentland 2019-02-22 376 if (scl_data->ratios.horz_c.value == (8ll << 32))
f7de96ee8b5f4d Harry Wentland 2019-02-22 377 scl_data->ratios.horz_c.value--;
f7de96ee8b5f4d Harry Wentland 2019-02-22 378 if (scl_data->ratios.vert_c.value == (8ll << 32))
f7de96ee8b5f4d Harry Wentland 2019-02-22 379 scl_data->ratios.vert_c.value--;
f7de96ee8b5f4d Harry Wentland 2019-02-22 380
f7de96ee8b5f4d Harry Wentland 2019-02-22 381 /* Set default taps if none are provided */
f7de96ee8b5f4d Harry Wentland 2019-02-22 382 if (in_taps->h_taps == 0) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 383 if (dc_fixpt_ceil(scl_data->ratios.horz) > 4)
f7de96ee8b5f4d Harry Wentland 2019-02-22 384 scl_data->taps.h_taps = 8;
f7de96ee8b5f4d Harry Wentland 2019-02-22 385 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 386 scl_data->taps.h_taps = 4;
f7de96ee8b5f4d Harry Wentland 2019-02-22 387 } else
f7de96ee8b5f4d Harry Wentland 2019-02-22 388 scl_data->taps.h_taps = in_taps->h_taps;
f7de96ee8b5f4d Harry Wentland 2019-02-22 389 if (in_taps->v_taps == 0) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 390 if (dc_fixpt_ceil(scl_data->ratios.vert) > 4)
f7de96ee8b5f4d Harry Wentland 2019-02-22 391 scl_data->taps.v_taps = 8;
f7de96ee8b5f4d Harry Wentland 2019-02-22 392 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 393 scl_data->taps.v_taps = 4;
f7de96ee8b5f4d Harry Wentland 2019-02-22 394 } else
f7de96ee8b5f4d Harry Wentland 2019-02-22 395 scl_data->taps.v_taps = in_taps->v_taps;
f7de96ee8b5f4d Harry Wentland 2019-02-22 396 if (in_taps->v_taps_c == 0) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 397 if (dc_fixpt_ceil(scl_data->ratios.vert_c) > 4)
f7de96ee8b5f4d Harry Wentland 2019-02-22 398 scl_data->taps.v_taps_c = 4;
f7de96ee8b5f4d Harry Wentland 2019-02-22 399 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 400 scl_data->taps.v_taps_c = 2;
f7de96ee8b5f4d Harry Wentland 2019-02-22 401 } else
f7de96ee8b5f4d Harry Wentland 2019-02-22 402 scl_data->taps.v_taps_c = in_taps->v_taps_c;
f7de96ee8b5f4d Harry Wentland 2019-02-22 403 if (in_taps->h_taps_c == 0) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 404 if (dc_fixpt_ceil(scl_data->ratios.horz_c) > 4)
f7de96ee8b5f4d Harry Wentland 2019-02-22 405 scl_data->taps.h_taps_c = 4;
f7de96ee8b5f4d Harry Wentland 2019-02-22 406 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 407 scl_data->taps.h_taps_c = 2;
f7de96ee8b5f4d Harry Wentland 2019-02-22 408 } else if ((in_taps->h_taps_c % 2) != 0 && in_taps->h_taps_c != 1)
f7de96ee8b5f4d Harry Wentland 2019-02-22 409 /* Only 1 and even h_taps_c are supported by hw */
f7de96ee8b5f4d Harry Wentland 2019-02-22 410 scl_data->taps.h_taps_c = in_taps->h_taps_c - 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 411 else
f7de96ee8b5f4d Harry Wentland 2019-02-22 412 scl_data->taps.h_taps_c = in_taps->h_taps_c;
f7de96ee8b5f4d Harry Wentland 2019-02-22 413
f7de96ee8b5f4d Harry Wentland 2019-02-22 414 if (!dpp->ctx->dc->debug.always_scale) {
f7de96ee8b5f4d Harry Wentland 2019-02-22 415 if (IDENTITY_RATIO(scl_data->ratios.horz))
f7de96ee8b5f4d Harry Wentland 2019-02-22 416 scl_data->taps.h_taps = 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 417 if (IDENTITY_RATIO(scl_data->ratios.vert))
f7de96ee8b5f4d Harry Wentland 2019-02-22 418 scl_data->taps.v_taps = 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 419 if (IDENTITY_RATIO(scl_data->ratios.horz_c))
f7de96ee8b5f4d Harry Wentland 2019-02-22 420 scl_data->taps.h_taps_c = 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 421 if (IDENTITY_RATIO(scl_data->ratios.vert_c))
f7de96ee8b5f4d Harry Wentland 2019-02-22 422 scl_data->taps.v_taps_c = 1;
f7de96ee8b5f4d Harry Wentland 2019-02-22 423 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 424
f7de96ee8b5f4d Harry Wentland 2019-02-22 425 return true;
f7de96ee8b5f4d Harry Wentland 2019-02-22 426 }
f7de96ee8b5f4d Harry Wentland 2019-02-22 427

:::::: The code at line 350 was first introduced by commit
:::::: f7de96ee8b5f4d0d4ef7b00b8868049a6869a10f drm/amd/display: Add DCN2 DPP

:::::: TO: Harry Wentland <harry.wentland@xxxxxxx>
:::::: CC: Alex Deucher <alexander.deucher@xxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip