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

drm/amd/display: disable eDP backlight for extend monitor only reboot use case.

Signed-off-by: Yongqiang Sun <yongqiang.sun@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>

authored by

Yongqiang Sun and committed by
Alex Deucher
91178796 146a9f63

+27 -1
+27 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 649 649 return ret; 650 650 } 651 651 652 + static void disable_eDP_not_in_use(struct dc *dc, struct dc_state *context) 653 + { 654 + int i; 655 + struct dc_link *link = NULL; 652 656 657 + /* check if eDP panel is suppose to be set mode, if yes, no need to disable */ 658 + for (i = 0; i < context->stream_count; i++) { 659 + if (context->streams[i]->signal == SIGNAL_TYPE_EDP) 660 + return; 661 + } 662 + 663 + /* check if there is an eDP panel not in use */ 664 + for (i = 0; i < dc->link_count; i++) { 665 + if (dc->links[i]->local_sink && 666 + dc->links[i]->local_sink->sink_signal == SIGNAL_TYPE_EDP) { 667 + link = dc->links[i]; 668 + break; 669 + } 670 + } 671 + 672 + if (link) { 673 + dc->hwss.edp_backlight_control(link, false); 674 + dc->hwss.edp_power_control(link, false); 675 + } 676 + } 653 677 /* 654 678 * Applies given context to HW and copy it into current context. 655 679 * It's up to the user to release the src context afterwards. ··· 691 667 for (i = 0; i < context->stream_count; i++) 692 668 dc_streams[i] = context->streams[i]; 693 669 694 - if (!dcb->funcs->is_accelerated_mode(dcb)) 670 + if (!dcb->funcs->is_accelerated_mode(dcb)) { 695 671 dc->hwss.enable_accelerated_mode(dc); 672 + disable_eDP_not_in_use(dc, context); 673 + } 696 674 697 675 /* re-program planes for existing stream, in case we need to 698 676 * free up plane resource for later use