<div dir="ltr">Ping. Any bit of info appreciated wrt. the DCE-11.2+ situation.<div>-mario</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 25, 2021 at 8:24 PM Mario Kleiner <<a href="mailto:mario.kleiner.de@gmail.com">mario.kleiner.de@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Alex and Nicholas! Brings quite a bit of extra shiny to those older asics :)</div><div><br></div><div>Nicholas, any thoughts on my cover-letter wrt. why a similar patch (that I wrote and tested to no good or bad effect) not seem to be needed on DCN, and probably not DCE-11.2+ either? Is what is left in DC for those asic's just dead code? My Atombios disassembly sort of pointed into that direction, but reading disassembly is not easy on the brain, and my brain was getting quite mushy towards the end of digging through all the code. So some official statement would add peace of mind on my side. Is there a certain DCE version at which your team starts validating output precision / HDR etc. on hw?<br></div><div><br></div><div>Thanks,</div><div>-mario</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 25, 2021 at 8:16 PM Kazlauskas, Nicholas <<a href="mailto:nicholas.kazlauskas@amd.com" target="_blank">nicholas.kazlauskas@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2021-01-25 12:57 p.m., Alex Deucher wrote:<br>
> On Thu, Jan 21, 2021 at 1:17 AM Mario Kleiner<br>
> <<a href="mailto:mario.kleiner.de@gmail.com" target="_blank">mario.kleiner.de@gmail.com</a>> wrote:<br>
>><br>
>> This fixes corrupted display output in HDMI deep color<br>
>> 10/12 bpc mode at least as observed on AMD Mullins, DCE-8.3.<br>
>><br>
>> It will hopefully also provide fixes for other DCE's up to<br>
>> DCE-11, assuming those will need similar fixes, but i could<br>
>> not test that for HDMI due to lack of suitable hw, so viewer<br>
>> discretion is advised.<br>
>><br>
>> dce110_stream_encoder_hdmi_set_stream_attribute() is used for<br>
>> HDMI setup on all DCE's and is missing color_depth assignment.<br>
>><br>
>> dce110_program_pix_clk() is used for pixel clock setup on HDMI<br>
>> for DCE 6-11, and is missing color_depth assignment.<br>
>><br>
>> Additionally some of the underlying Atombios specific encoder<br>
>> and pixelclock setup functions are missing code which is in<br>
>> the classic amdgpu kms modesetting path and the in the radeon<br>
>> kms driver for DCE6/DCE8.<br>
>><br>
>> encoder_control_digx_v3() - Was missing setup code wrt. amdgpu<br>
>> and radeon kms classic drivers. Added here, but untested due to<br>
>> lack of suitable test hw.<br>
>><br>
>> encoder_control_digx_v4() - Added missing setup code.<br>
>> Successfully tested on AMD mullins / DCE-8.3 with HDMI deep color<br>
>> output at 10 bpc and 12 bpc.<br>
>><br>
>> Note that encoder_control_digx_v5() has proper setup code in place<br>
>> and is used, e.g., by DCE-11.2, but this code wasn't used for deep<br>
>> color setup due to the missing cntl.color_depth setup in the calling<br>
>> function for HDMI.<br>
>><br>
>> set_pixel_clock_v5() - Missing setup code wrt. classic amdgpu/radeon<br>
>> kms. Added here, but untested due to lack of hw.<br>
>><br>
>> set_pixel_clock_v6() - Missing setup code added. Successfully tested<br>
>> on AMD mullins DCE-8.3. This fixes corrupted display output at HDMI<br>
>> deep color output with 10 bpc or 12 bpc.<br>
>><br>
>> Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")<br>
>><br>
>> Signed-off-by: Mario Kleiner <<a href="mailto:mario.kleiner.de@gmail.com" target="_blank">mario.kleiner.de@gmail.com</a>><br>
>> Cc: Harry Wentland <<a href="mailto:harry.wentland@amd.com" target="_blank">harry.wentland@amd.com</a>><br>
> <br>
> These make sense. I've applied the series. I'll let the display guys<br>
> gauge the other points in your cover letter.<br>
> <br>
> Alex<br>
<br>
I don't have any concerns with this patch.<br>
<br>
Even though it's already applied feel free to have my:<br>
<br>
Reviewed-by: Nicholas Kazlauskas <<a href="mailto:nicholas.kazlauskas@amd.com" target="_blank">nicholas.kazlauskas@amd.com</a>><br>
<br>
Regards,<br>
Nicholas Kazlauskas<br>
<br>
> <br>
> <br>
>> ---<br>
>> .../drm/amd/display/dc/bios/command_table.c | 61 +++++++++++++++++++<br>
>> .../drm/amd/display/dc/dce/dce_clock_source.c | 14 +++++<br>
>> .../amd/display/dc/dce/dce_stream_encoder.c | 1 +<br>
>> 3 files changed, 76 insertions(+)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c<br>
>> index 070459e3e407..afc10b954ffa 100644<br>
>> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c<br>
>> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c<br>
>> @@ -245,6 +245,23 @@ static enum bp_result encoder_control_digx_v3(<br>
>> cntl->enable_dp_audio);<br>
>> params.ucLaneNum = (uint8_t)(cntl->lanes_number);<br>
>><br>
>> + switch (cntl->color_depth) {<br>
>> + case COLOR_DEPTH_888:<br>
>> + params.ucBitPerColor = PANEL_8BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_101010:<br>
>> + params.ucBitPerColor = PANEL_10BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_121212:<br>
>> + params.ucBitPerColor = PANEL_12BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_161616:<br>
>> + params.ucBitPerColor = PANEL_16BIT_PER_COLOR;<br>
>> + break;<br>
>> + default:<br>
>> + break;<br>
>> + }<br>
>> +<br>
>> if (EXEC_BIOS_CMD_TABLE(DIGxEncoderControl, params))<br>
>> result = BP_RESULT_OK;<br>
>><br>
>> @@ -274,6 +291,23 @@ static enum bp_result encoder_control_digx_v4(<br>
>> cntl->enable_dp_audio));<br>
>> params.ucLaneNum = (uint8_t)(cntl->lanes_number);<br>
>><br>
>> + switch (cntl->color_depth) {<br>
>> + case COLOR_DEPTH_888:<br>
>> + params.ucBitPerColor = PANEL_8BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_101010:<br>
>> + params.ucBitPerColor = PANEL_10BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_121212:<br>
>> + params.ucBitPerColor = PANEL_12BIT_PER_COLOR;<br>
>> + break;<br>
>> + case COLOR_DEPTH_161616:<br>
>> + params.ucBitPerColor = PANEL_16BIT_PER_COLOR;<br>
>> + break;<br>
>> + default:<br>
>> + break;<br>
>> + }<br>
>> +<br>
>> if (EXEC_BIOS_CMD_TABLE(DIGxEncoderControl, params))<br>
>> result = BP_RESULT_OK;<br>
>><br>
>> @@ -1057,6 +1091,19 @@ static enum bp_result set_pixel_clock_v5(<br>
>> * driver choose program it itself, i.e. here we program it<br>
>> * to 888 by default.<br>
>> */<br>
>> + if (bp_params->signal_type == SIGNAL_TYPE_HDMI_TYPE_A)<br>
>> + switch (bp_params->color_depth) {<br>
>> + case TRANSMITTER_COLOR_DEPTH_30:<br>
>> + /* yes this is correct, the atom define is wrong */<br>
>> + clk.sPCLKInput.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_32BPP;<br>
>> + break;<br>
>> + case TRANSMITTER_COLOR_DEPTH_36:<br>
>> + /* yes this is correct, the atom define is wrong */<br>
>> + clk.sPCLKInput.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP;<br>
>> + break;<br>
>> + default:<br>
>> + break;<br>
>> + }<br>
>><br>
>> if (EXEC_BIOS_CMD_TABLE(SetPixelClock, clk))<br>
>> result = BP_RESULT_OK;<br>
>> @@ -1135,6 +1182,20 @@ static enum bp_result set_pixel_clock_v6(<br>
>> * driver choose program it itself, i.e. here we pass required<br>
>> * target rate that includes deep color.<br>
>> */<br>
>> + if (bp_params->signal_type == SIGNAL_TYPE_HDMI_TYPE_A)<br>
>> + switch (bp_params->color_depth) {<br>
>> + case TRANSMITTER_COLOR_DEPTH_30:<br>
>> + clk.sPCLKInput.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP_V6;<br>
>> + break;<br>
>> + case TRANSMITTER_COLOR_DEPTH_36:<br>
>> + clk.sPCLKInput.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP_V6;<br>
>> + break;<br>
>> + case TRANSMITTER_COLOR_DEPTH_48:<br>
>> + clk.sPCLKInput.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP;<br>
>> + break;<br>
>> + default:<br>
>> + break;<br>
>> + }<br>
>><br>
>> if (EXEC_BIOS_CMD_TABLE(SetPixelClock, clk))<br>
>> result = BP_RESULT_OK;<br>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c<br>
>> index fb733f573715..466f8f5803c9 100644<br>
>> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c<br>
>> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c<br>
>> @@ -871,6 +871,20 @@ static bool dce110_program_pix_clk(<br>
>> bp_pc_params.flags.SET_EXTERNAL_REF_DIV_SRC =<br>
>> pll_settings->use_external_clk;<br>
>><br>
>> + switch (pix_clk_params->color_depth) {<br>
>> + case COLOR_DEPTH_101010:<br>
>> + bp_pc_params.color_depth = TRANSMITTER_COLOR_DEPTH_30;<br>
>> + break;<br>
>> + case COLOR_DEPTH_121212:<br>
>> + bp_pc_params.color_depth = TRANSMITTER_COLOR_DEPTH_36;<br>
>> + break;<br>
>> + case COLOR_DEPTH_161616:<br>
>> + bp_pc_params.color_depth = TRANSMITTER_COLOR_DEPTH_48;<br>
>> + break;<br>
>> + default:<br>
>> + break;<br>
>> + }<br>
>> +<br>
>> if (clk_src->bios->funcs->set_pixel_clock(<br>
>> clk_src->bios, &bp_pc_params) != BP_RESULT_OK)<br>
>> return false;<br>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c<br>
>> index ada57f745fd7..19e380e0a330 100644<br>
>> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c<br>
>> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c<br>
>> @@ -564,6 +564,7 @@ static void dce110_stream_encoder_hdmi_set_stream_attribute(<br>
>> cntl.enable_dp_audio = enable_audio;<br>
>> cntl.pixel_clock = actual_pix_clk_khz;<br>
>> cntl.lanes_number = LANE_COUNT_FOUR;<br>
>> + cntl.color_depth = crtc_timing->display_color_depth;<br>
>><br>
>> if (enc110->base.bp->funcs->encoder_control(<br>
>> enc110->base.bp, &cntl) != BP_RESULT_OK)<br>
>> --<br>
>> 2.25.1<br>
>><br>
>> _______________________________________________<br>
>> dri-devel mailing list<br>
>> <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
>> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cnicholas.kazlauskas%40amd.com%7C598b2b5e841940b8c27708d8c15aa80d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637471942408643835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b9C3Xi%2F2RmNsGyGUN5oBF8U%2BuGyt2w4jUZ2dK8NM4AY%3D&reserved=0" rel="noreferrer" target="_blank">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cnicholas.kazlauskas%40amd.com%7C598b2b5e841940b8c27708d8c15aa80d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637471942408643835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b9C3Xi%2F2RmNsGyGUN5oBF8U%2BuGyt2w4jUZ2dK8NM4AY%3D&reserved=0</a><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cnicholas.kazlauskas%40amd.com%7C598b2b5e841940b8c27708d8c15aa80d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637471942408643835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b9C3Xi%2F2RmNsGyGUN5oBF8U%2BuGyt2w4jUZ2dK8NM4AY%3D&reserved=0" rel="noreferrer" target="_blank">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cnicholas.kazlauskas%40amd.com%7C598b2b5e841940b8c27708d8c15aa80d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637471942408643835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b9C3Xi%2F2RmNsGyGUN5oBF8U%2BuGyt2w4jUZ2dK8NM4AY%3D&reserved=0</a><br>
> <br>
<br>
</blockquote></div>
</blockquote></div>