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

drm/amd/display: Correct color depth for SelectCRTC_Source

Pass the correct enum values as expected by the VBIOS.
Previously the actual bit depth integer value was passed,
which was a mistake.

Fixes: 7fb4f254c8eb ("drm/amd/display: Add SelectCRTC_Source to BIOS parser")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cdf6e4c0cdab129ffc4e41a8ac53a0738f805072)

authored by

Timur Kristóf and committed by
Alex Deucher
fd40c146 7ed51e3a

+26 -29
+24 -1
drivers/gpu/drm/amd/display/dc/bios/command_table.c
··· 1797 1797 &params.ucEncodeMode)) 1798 1798 return BP_RESULT_BADINPUT; 1799 1799 1800 - params.ucDstBpc = bp_params->bit_depth; 1800 + switch (bp_params->color_depth) { 1801 + case COLOR_DEPTH_UNDEFINED: 1802 + params.ucDstBpc = PANEL_BPC_UNDEFINE; 1803 + break; 1804 + case COLOR_DEPTH_666: 1805 + params.ucDstBpc = PANEL_6BIT_PER_COLOR; 1806 + break; 1807 + default: 1808 + case COLOR_DEPTH_888: 1809 + params.ucDstBpc = PANEL_8BIT_PER_COLOR; 1810 + break; 1811 + case COLOR_DEPTH_101010: 1812 + params.ucDstBpc = PANEL_10BIT_PER_COLOR; 1813 + break; 1814 + case COLOR_DEPTH_121212: 1815 + params.ucDstBpc = PANEL_12BIT_PER_COLOR; 1816 + break; 1817 + case COLOR_DEPTH_141414: 1818 + dm_error("14-bit color not supported by SelectCRTC_Source v3\n"); 1819 + break; 1820 + case COLOR_DEPTH_161616: 1821 + params.ucDstBpc = PANEL_16BIT_PER_COLOR; 1822 + break; 1823 + } 1801 1824 1802 1825 if (EXEC_BIOS_CMD_TABLE(SelectCRTC_Source, params)) 1803 1826 result = BP_RESULT_OK;
+1 -27
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
··· 1610 1610 struct dc_bios *bios = link->ctx->dc_bios; 1611 1611 struct bp_crtc_source_select crtc_source_select = {0}; 1612 1612 enum engine_id engine_id = link->link_enc->preferred_engine; 1613 - uint8_t bit_depth; 1614 1613 1615 1614 if (dc_is_rgb_signal(pipe_ctx->stream->signal)) 1616 1615 engine_id = link->link_enc->analog_engine; 1617 1616 1618 - switch (pipe_ctx->stream->timing.display_color_depth) { 1619 - case COLOR_DEPTH_UNDEFINED: 1620 - bit_depth = 0; 1621 - break; 1622 - case COLOR_DEPTH_666: 1623 - bit_depth = 6; 1624 - break; 1625 - default: 1626 - case COLOR_DEPTH_888: 1627 - bit_depth = 8; 1628 - break; 1629 - case COLOR_DEPTH_101010: 1630 - bit_depth = 10; 1631 - break; 1632 - case COLOR_DEPTH_121212: 1633 - bit_depth = 12; 1634 - break; 1635 - case COLOR_DEPTH_141414: 1636 - bit_depth = 14; 1637 - break; 1638 - case COLOR_DEPTH_161616: 1639 - bit_depth = 16; 1640 - break; 1641 - } 1642 - 1643 1617 crtc_source_select.controller_id = CONTROLLER_ID_D0 + pipe_ctx->stream_res.tg->inst; 1644 - crtc_source_select.bit_depth = bit_depth; 1618 + crtc_source_select.color_depth = pipe_ctx->stream->timing.display_color_depth; 1645 1619 crtc_source_select.engine_id = engine_id; 1646 1620 crtc_source_select.sink_signal = pipe_ctx->stream->signal; 1647 1621
+1 -1
drivers/gpu/drm/amd/display/include/bios_parser_types.h
··· 136 136 enum engine_id engine_id; 137 137 enum controller_id controller_id; 138 138 enum signal_type sink_signal; 139 - uint8_t bit_depth; 139 + enum dc_color_depth color_depth; 140 140 }; 141 141 142 142 struct bp_transmitter_control {