Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add VC for VESA Aux Backlight Control

[WHY]
There is no way to distinguish
the static backlight control type
being used and the VABC support
without the use of a debugger or
reading DPCD registers.

[HOW]
Add Visual Confirm support
for VESA Aux-based Backlight Control.

Reviewed-by: Harry Vanzylldejong <harry.vanzylldejong@amd.com>
Signed-off-by: Iswara Nagulendran <Iswara.Nagulendran@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Iswara Nagulendran and committed by
Alex Deucher
d566fc42 41c18333

+44 -3
+2
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 1236 1236 get_mclk_switch_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color)); 1237 1237 else if (dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS2) 1238 1238 get_fams2_visual_confirm_color(dc, context, pipe_ctx, &(pipe_ctx->visual_confirm_color)); 1239 + else if (dc->debug.visual_confirm == VISUAL_CONFIRM_VABC) 1240 + get_vabc_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color)); 1239 1241 } 1240 1242 } 1241 1243 }
+38
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
··· 425 425 } 426 426 } 427 427 428 + /* Visual Confirm color definition for VABC */ 429 + void get_vabc_visual_confirm_color( 430 + struct pipe_ctx *pipe_ctx, 431 + struct tg_color *color) 432 + { 433 + uint32_t color_value = MAX_TG_COLOR_VALUE; 434 + struct dc_link *edp_link = NULL; 435 + 436 + if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link) { 437 + if (pipe_ctx->stream->link->connector_signal == SIGNAL_TYPE_EDP) 438 + edp_link = pipe_ctx->stream->link; 439 + } 440 + 441 + if (edp_link) { 442 + switch (edp_link->backlight_control_type) { 443 + case BACKLIGHT_CONTROL_PWM: 444 + color->color_r_cr = color_value; 445 + color->color_g_y = 0; 446 + color->color_b_cb = 0; 447 + break; 448 + case BACKLIGHT_CONTROL_AMD_AUX: 449 + color->color_r_cr = 0; 450 + color->color_g_y = color_value; 451 + color->color_b_cb = 0; 452 + break; 453 + case BACKLIGHT_CONTROL_VESA_AUX: 454 + color->color_r_cr = 0; 455 + color->color_g_y = 0; 456 + color->color_b_cb = color_value; 457 + break; 458 + } 459 + } else { 460 + color->color_r_cr = 0; 461 + color->color_g_y = 0; 462 + color->color_b_cb = 0; 463 + } 464 + } 465 + 428 466 void get_subvp_visual_confirm_color( 429 467 struct pipe_ctx *pipe_ctx, 430 468 struct tg_color *color)
+1
drivers/gpu/drm/amd/display/dc/dc.h
··· 489 489 VISUAL_CONFIRM_MCLK_SWITCH = 16, 490 490 VISUAL_CONFIRM_FAMS2 = 19, 491 491 VISUAL_CONFIRM_HW_CURSOR = 20, 492 + VISUAL_CONFIRM_VABC = 21, 492 493 }; 493 494 494 495 enum dc_psr_power_opts {
+3 -3
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
··· 194 194 DMUB_SUBVP_SAVE_SURF_ADDR, 195 195 HUBP_WAIT_FOR_DCC_META_PROP, 196 196 DMUB_FAMS2_GLOBAL_CONTROL_LOCK_FAST, 197 - 198 197 }; 199 198 200 199 struct block_sequence { ··· 484 485 void get_mpctree_visual_confirm_color( 485 486 struct pipe_ctx *pipe_ctx, 486 487 struct tg_color *color); 487 - 488 + void get_vabc_visual_confirm_color( 489 + struct pipe_ctx *pipe_ctx, 490 + struct tg_color *color); 488 491 void get_subvp_visual_confirm_color( 489 492 struct pipe_ctx *pipe_ctx, 490 493 struct tg_color *color); 491 - 492 494 void get_fams2_visual_confirm_color( 493 495 struct dc *dc, 494 496 struct dc_state *context,