.. | .. |
---|
91 | 91 | DSCL_MODE_DSCL_BYPASS = 6 |
---|
92 | 92 | }; |
---|
93 | 93 | |
---|
94 | | -enum gamut_remap_select { |
---|
95 | | - GAMUT_REMAP_BYPASS = 0, |
---|
96 | | - GAMUT_REMAP_COEFF, |
---|
97 | | - GAMUT_REMAP_COMA_COEFF, |
---|
98 | | - GAMUT_REMAP_COMB_COEFF |
---|
99 | | -}; |
---|
100 | | - |
---|
101 | 94 | void dpp_read_state(struct dpp *dpp_base, |
---|
102 | 95 | struct dcn_dpp_state *s) |
---|
103 | 96 | { |
---|
104 | 97 | struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); |
---|
105 | 98 | |
---|
| 99 | + REG_GET(DPP_CONTROL, |
---|
| 100 | + DPP_CLOCK_ENABLE, &s->is_enabled); |
---|
106 | 101 | REG_GET(CM_IGAM_CONTROL, |
---|
107 | 102 | CM_IGAM_LUT_MODE, &s->igam_lut_mode); |
---|
108 | 103 | REG_GET(CM_IGAM_CONTROL, |
---|
.. | .. |
---|
114 | 109 | REG_GET(CM_GAMUT_REMAP_CONTROL, |
---|
115 | 110 | CM_GAMUT_REMAP_MODE, &s->gamut_remap_mode); |
---|
116 | 111 | |
---|
117 | | - s->gamut_remap_c11_c12 = REG_READ(CM_GAMUT_REMAP_C11_C12); |
---|
118 | | - s->gamut_remap_c13_c14 = REG_READ(CM_GAMUT_REMAP_C13_C14); |
---|
119 | | - s->gamut_remap_c21_c22 = REG_READ(CM_GAMUT_REMAP_C21_C22); |
---|
120 | | - s->gamut_remap_c23_c24 = REG_READ(CM_GAMUT_REMAP_C23_C24); |
---|
121 | | - s->gamut_remap_c31_c32 = REG_READ(CM_GAMUT_REMAP_C31_C32); |
---|
122 | | - s->gamut_remap_c33_c34 = REG_READ(CM_GAMUT_REMAP_C33_C34); |
---|
| 112 | + if (s->gamut_remap_mode) { |
---|
| 113 | + s->gamut_remap_c11_c12 = REG_READ(CM_GAMUT_REMAP_C11_C12); |
---|
| 114 | + s->gamut_remap_c13_c14 = REG_READ(CM_GAMUT_REMAP_C13_C14); |
---|
| 115 | + s->gamut_remap_c21_c22 = REG_READ(CM_GAMUT_REMAP_C21_C22); |
---|
| 116 | + s->gamut_remap_c23_c24 = REG_READ(CM_GAMUT_REMAP_C23_C24); |
---|
| 117 | + s->gamut_remap_c31_c32 = REG_READ(CM_GAMUT_REMAP_C31_C32); |
---|
| 118 | + s->gamut_remap_c33_c34 = REG_READ(CM_GAMUT_REMAP_C33_C34); |
---|
| 119 | + } |
---|
123 | 120 | } |
---|
124 | 121 | |
---|
125 | 122 | /* Program gamut remap in bypass mode */ |
---|
.. | .. |
---|
132 | 129 | |
---|
133 | 130 | #define IDENTITY_RATIO(ratio) (dc_fixpt_u2d19(ratio) == (1 << 19)) |
---|
134 | 131 | |
---|
135 | | -static bool dpp_get_optimal_number_of_taps( |
---|
| 132 | +bool dpp1_get_optimal_number_of_taps( |
---|
136 | 133 | struct dpp *dpp, |
---|
137 | 134 | struct scaler_data *scl_data, |
---|
138 | 135 | const struct scaling_taps *in_taps) |
---|
139 | 136 | { |
---|
140 | | - uint32_t pixel_width; |
---|
141 | | - |
---|
142 | | - if (scl_data->viewport.width > scl_data->recout.width) |
---|
143 | | - pixel_width = scl_data->recout.width; |
---|
144 | | - else |
---|
145 | | - pixel_width = scl_data->viewport.width; |
---|
146 | | - |
---|
147 | 137 | /* Some ASICs does not support FP16 scaling, so we reject modes require this*/ |
---|
148 | 138 | if (scl_data->format == PIXEL_FORMAT_FP16 && |
---|
149 | 139 | dpp->caps->dscl_data_proc_format == DSCL_DATA_PRCESSING_FIXED_FORMAT && |
---|
.. | .. |
---|
293 | 283 | enum surface_pixel_format format, |
---|
294 | 284 | enum expansion_mode mode, |
---|
295 | 285 | struct dc_csc_transform input_csc_color_matrix, |
---|
296 | | - enum dc_color_space input_color_space) |
---|
| 286 | + enum dc_color_space input_color_space, |
---|
| 287 | + struct cnv_alpha_2bit_lut *alpha_2bit_lut) |
---|
297 | 288 | { |
---|
298 | 289 | uint32_t pixel_format; |
---|
299 | 290 | uint32_t alpha_en; |
---|
.. | .. |
---|
424 | 415 | |
---|
425 | 416 | void dpp1_set_cursor_attributes( |
---|
426 | 417 | struct dpp *dpp_base, |
---|
427 | | - enum dc_cursor_color_format color_format) |
---|
| 418 | + struct dc_cursor_attributes *cursor_attributes) |
---|
428 | 419 | { |
---|
| 420 | + enum dc_cursor_color_format color_format = cursor_attributes->color_format; |
---|
429 | 421 | struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); |
---|
430 | 422 | |
---|
431 | 423 | REG_UPDATE_2(CURSOR0_CONTROL, |
---|
.. | .. |
---|
446 | 438 | struct dpp *dpp_base, |
---|
447 | 439 | const struct dc_cursor_position *pos, |
---|
448 | 440 | const struct dc_cursor_mi_param *param, |
---|
449 | | - uint32_t width) |
---|
| 441 | + uint32_t width, |
---|
| 442 | + uint32_t height) |
---|
450 | 443 | { |
---|
451 | 444 | struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); |
---|
452 | 445 | int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x; |
---|
| 446 | + int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y; |
---|
453 | 447 | uint32_t cur_en = pos->enable ? 1 : 0; |
---|
| 448 | + |
---|
| 449 | + // Cursor width/height and hotspots need to be rotated for offset calculation |
---|
| 450 | + if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) { |
---|
| 451 | + swap(width, height); |
---|
| 452 | + if (param->rotation == ROTATION_ANGLE_90) { |
---|
| 453 | + src_x_offset = pos->x - pos->y_hotspot - param->viewport.x; |
---|
| 454 | + src_y_offset = pos->y - pos->x_hotspot - param->viewport.y; |
---|
| 455 | + } |
---|
| 456 | + } else if (param->rotation == ROTATION_ANGLE_180) { |
---|
| 457 | + src_x_offset = pos->x - param->viewport.x; |
---|
| 458 | + src_y_offset = pos->y - param->viewport.y; |
---|
| 459 | + } |
---|
| 460 | + |
---|
454 | 461 | |
---|
455 | 462 | if (src_x_offset >= (int)param->viewport.width) |
---|
456 | 463 | cur_en = 0; /* not visible beyond right edge*/ |
---|
457 | 464 | |
---|
458 | 465 | if (src_x_offset + (int)width <= 0) |
---|
459 | 466 | cur_en = 0; /* not visible beyond left edge*/ |
---|
| 467 | + |
---|
| 468 | + if (src_y_offset >= (int)param->viewport.height) |
---|
| 469 | + cur_en = 0; /* not visible beyond bottom edge*/ |
---|
| 470 | + |
---|
| 471 | + if (src_y_offset + (int)height <= 0) |
---|
| 472 | + cur_en = 0; /* not visible beyond top edge*/ |
---|
460 | 473 | |
---|
461 | 474 | REG_UPDATE(CURSOR0_CONTROL, |
---|
462 | 475 | CUR0_ENABLE, cur_en); |
---|
.. | .. |
---|
497 | 510 | .dpp_read_state = dpp_read_state, |
---|
498 | 511 | .dpp_reset = dpp_reset, |
---|
499 | 512 | .dpp_set_scaler = dpp1_dscl_set_scaler_manual_scale, |
---|
500 | | - .dpp_get_optimal_number_of_taps = dpp_get_optimal_number_of_taps, |
---|
| 513 | + .dpp_get_optimal_number_of_taps = dpp1_get_optimal_number_of_taps, |
---|
501 | 514 | .dpp_set_gamut_remap = dpp1_cm_set_gamut_remap, |
---|
502 | 515 | .dpp_set_csc_adjustment = dpp1_cm_set_output_csc_adjustment, |
---|
503 | 516 | .dpp_set_csc_default = dpp1_cm_set_output_csc_default, |
---|
.. | .. |
---|
518 | 531 | .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes, |
---|
519 | 532 | .dpp_dppclk_control = dpp1_dppclk_control, |
---|
520 | 533 | .dpp_set_hdr_multiplier = dpp1_set_hdr_multiplier, |
---|
| 534 | + .dpp_program_blnd_lut = NULL, |
---|
| 535 | + .dpp_program_shaper_lut = NULL, |
---|
| 536 | + .dpp_program_3dlut = NULL |
---|
521 | 537 | }; |
---|
522 | 538 | |
---|
523 | 539 | static struct dpp_caps dcn10_dpp_cap = { |
---|