Re: [RFC][PATCH] drm/radeon/hdmi: use separated file for DCE 3.1+ hw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On 12 May 2014 20:09, Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
> As far as I recall, 3.1 is
> pretty much the same as 3.0 from a programming perspective, but it's
> been a while since I looked at it in detail.

Please take a look at attached dce31.html file. It's a dump from fglrx
operations during HDMI mode setup.

You can see it's very similar for DCE 3.2 except for
AUDIO_PACKET_CONTROL and INFOFRAME_CONTROL0. But I think it's still
easier to add 2 or 3 /ifs/ in the code shared between DCE 3.1 and DCE
3.2

Apart from the above exceptions:

1) DCE3.1 uses AFMT_AUDIO_PACKET_CONTROL2 like DCE3.2
I don't think DCE2/3 had AUDIO_LAYOUT_OVRD or 60958_CS_SOURCE.

2) DCE3.1 controls ACR_AUTO_SEND with HDMI_ACR_PACKET_CONTROL like
DCE3.2. In DCE2/3 it was handled in HDMI0_ACR_PACKET_CONTROL register,
but wasn't touched by fglrx code.

3) DCE3.1 has this new AFMT_60958_2 register just like DCE3.2
It wasn't present in DCE2/3, see:
/* HDMI0_60958_2 is r7xx only */

4) DCE3.1 has AUDIO_DESCRIPTORs, like DCE3.2
I believe they were not present on DCE2/3

5) DCE3.1 enables audio engines just like DCE3.2 (using extra 0x7308
register during en/disable)

So I'm pretty sure we don't want to share code between DCE2/3.0 and DCE3.1.

The question is if we want separated code for DCE3.1 and DCE3.2. So
far it seems we can handle DCE3.1 and DCE3.2 with shared simply using
2 or 3 conditions.

-- 
Rafał
Title: Log of fglrx with faked reads (returning 0xFFFFFFFF)
Description DCE 3.1 DCE 3.2
HD4850 RV770 HD4550 RV710
PCIe PCIe
Normal Reads hacked to 0x0 Reads hacked to 0xF Normal Reads hacked to 0x0 Reads hacked to 0xF
RREG32(0x000079a0) → 0x00000300 WREG32(0x000079a0) ← 0x10000300 RREG32(0x000079c0) → 0x00000001 WREG32(0x000079c0) ← 0x00000001 WREG32(0x000079cc) ← 0x00000000 RREG32(0x000079a0) → 0x10000300 WREG32(0x000079a0) ← 0x10000310 RREG32(0x000075a0) → 0x00000300 WREG32(0x000075a0) ← 0x00000310
HDMI_CONTROL HDMI_CONTROL HDMI_AUDIO_PACKET_CONTROL HDMI_AUDIO_PACKET_CONTROL AFMT_AUDIO_PACKET_CONTROL AFMT_AUDIO_PACKET_CONTROL AFMT_AUDIO_PACKET_CONTROL2 AFMT_AUDIO_PACKET_CONTROL2 HDMI_ACR_PACKET_CONTROL HDMI_ACR_PACKET_CONTROL HDMI_VBI_PACKET_CONTROL HDMI_VBI_PACKET_CONTROL RREG32(0x00007800) → 0x00000011 WREG32(0x00007800) ← 0x00000011 RREG32(0x00007808) → 0x00000810 WREG32(0x00007808) ← 0x040a0811 RREG32(0x0000782c) → 0x00000000 WREG32(0x0000782c) ← 0x00000000 RREG32(0x0000780c) → 0x00010000 WREG32(0x0000780c) ← 0x00011000 RREG32(0x00007810) → 0x00000000 WREG32(0x00007810) ← 0x05001031 RREG32(0x00007400) → 0x00000011 WREG32(0x00007400) ← 0x00000011 RREG32(0x00007408) → 0x00000010 WREG32(0x00007408) ← 0x000a0010 RREG32(0x00007604) → 0x00000800 WREG32(0x00007604) ← 0x04000801 RREG32(0x0000742c) → 0x00000000 WREG32(0x0000742c) ← 0x00000000 RREG32(0x0000740c) → 0x00010000 WREG32(0x0000740c) ← 0x00011000 RREG32(0x00007410) → 0x00000000 WREG32(0x00007410) ← 0x05001031
RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000 RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO2 AFMT_AVI_INFO3 WREG32(0x00007854) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007858) ← 0x00000000 WREG32(0x0000785c) ← 0x00000000 WREG32(0x00007860) ← 0x02000000 WREG32(0x00007454) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007458) ← 0x00000000 WREG32(0x0000745c) ← 0x00000000 WREG32(0x00007460) ← 0x02000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO3 AFMT_AVI_INFO4 AFMT_AVI_INFO0 AFMT_AVI_INFO0 RREG32(0x00007854) → 0x83281e00 RREG32(0x00007858) → 0x00000000 RREG32(0x0000785c) → 0x00000000 RREG32(0x00007860) → 0x02000000 RREG32(0x00007854) → 0x83281e00 WREG32(0x00007854) ← 0x83281ea6 RREG32(0x00007454) → 0x83281e00 RREG32(0x00007458) → 0x00000000 RREG32(0x0000745c) → 0x00000000 RREG32(0x00007460) → 0x02000000 RREG32(0x00007454) → 0x83281e00 WREG32(0x00007454) ← 0x83281ea6
HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL1 HDMI_INFOFRAME_CONTROL1 HDMI_GENERIC_PACKET_CONTROL HDMI_GENERIC_PACKET_CONTROL HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL0 AFMT_INFOFRAME_CONTROL0 AFMT_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL1 HDMI_INFOFRAME_CONTROL1 RREG32(0x00007814) → 0x00000000 WREG32(0x00007814) ← 0x00000093 RREG32(0x00007818) → 0x00000000 WREG32(0x00007818) ← 0x00000202 RREG32(0x0000781c) → 0x00000000 WREG32(0x0000781c) ← 0x00000000 RREG32(0x00007814) → 0x00000093 WREG32(0x00007814) ← 0x00000093 RREG32(0x00007818) → 0x00000202 WREG32(0x00007818) ← 0x00000202 RREG32(0x00007414) → 0x00000000 WREG32(0x00007414) ← 0x00000013 RREG32(0x00007418) → 0x00000000 WREG32(0x00007418) ← 0x00000202 RREG32(0x0000741c) → 0x00000000 WREG32(0x0000741c) ← 0x00000000 RREG32(0x00007414) → 0x00000013 WREG32(0x00007414) ← 0x00000013 RREG32(0x0000760c) → 0x00000000 WREG32(0x0000760c) ← 0x00000080 RREG32(0x00007418) → 0x00000202 WREG32(0x00007418) ← 0x00000202
HDMI_GC HDMI_GC RREG32(0x00007828) → 0x00000000 WREG32(0x00007828) ← 0x00000000 RREG32(0x00007428) → 0x00000000 WREG32(0x00007428) ← 0x00000000
HDMI_ACR_32_0 HDMI_ACR_32_0 HDMI_ACR_32_1 HDMI_ACR_32_1 HDMI_ACR_44_0 HDMI_ACR_44_0 HDMI_ACR_44_1 HDMI_ACR_44_1 HDMI_ACR_48_0 HDMI_ACR_48_0 HDMI_ACR_48_1 HDMI_ACR_48_1 RREG32(0x000078ac) → 0x00000000 WREG32(0x000078ac) ← 0x1a5e0000 RREG32(0x000078b0) → 0x00000000 WREG32(0x000078b0) ← 0x00001000 RREG32(0x000078b4) → 0x00000000 WREG32(0x000078b4) ← 0x1a5e0000 RREG32(0x000078b8) → 0x00000000 WREG32(0x000078b8) ← 0x00001880 RREG32(0x000078bc) → 0x00000000 WREG32(0x000078bc) ← 0x1a5e0000 RREG32(0x000078c0) → 0x00000000 WREG32(0x000078c0) ← 0x00001800 RREG32(0x000074ac) → 0x00000000 WREG32(0x000074ac) ← 0x1a5e0000 RREG32(0x000074b0) → 0x00000000 WREG32(0x000074b0) ← 0x00001000 RREG32(0x000074b4) → 0x00000000 WREG32(0x000074b4) ← 0x1a5e0000 RREG32(0x000074b8) → 0x00000000 WREG32(0x000074b8) ← 0x00001880 RREG32(0x000074bc) → 0x00000000 WREG32(0x000074bc) ← 0x1a5e0000 RREG32(0x000074c0) → 0x00000000 WREG32(0x000074c0) ← 0x00001800
AFMT_60958_0 AFMT_60958_0 AFMT_60958_1 AFMT_60958_1 AFMT_60958_2 AFMT_60958_2 RREG32(0x000078d4) → 0x10000000 WREG32(0x000078d4) ← 0x00100000 RREG32(0x000078d8) → 0x00000000 WREG32(0x000078d8) ← 0x00200000 RREG32(0x000078f0) → 0x00000000 WREG32(0x000078f0) ← 0x00876543 RREG32(0x000074d4) → 0x10000000 WREG32(0x000074d4) ← 0x00100000 RREG32(0x000074d8) → 0x00000000 WREG32(0x000074d8) ← 0x00200000 RREG32(0x000074f0) → 0x00000000 WREG32(0x000074f0) ← 0x00876543
R600_AUDIO_CLK_SRCSEL R600_AUDIO_CLK_SRCSEL RREG32(0x00000534) → 0x00000001 WREG32(0x00000534) ← 0x00000001 RREG32(0x00000534) → 0x00000001 WREG32(0x00000534) ← 0x00000000
R600_AUDIO_TIMING R600_AUDIO_TIMING RREG32(0x00007344) → 0x00001270 WREG32(0x00007344) ← 0x00001170 RREG32(0x00007344) → 0x00000270 WREG32(0x00007344) ← 0x00000170
DCCG_AUDIO_DTO1_MODULE DCCG_AUDIO_DTO1_MODULE DCCG_AUDIO_DTO1_PHASE DCCG_AUDIO_DTO1_PHASE RREG32(0x00000528) → 0x00000064 WREG32(0x00000528) ← 0x0001a5e0 RREG32(0x00000524) → 0x00000018 WREG32(0x00000524) ← 0x00005dc0 RREG32(0x00000518) → 0x00000000 WREG32(0x00000518) ← 0x0001a5e0 RREG32(0x00000514) → 0x00000000 WREG32(0x00000514) ← 0x00005dc0
AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR2 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR3 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR4 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR5 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR6 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR7 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR9 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR10 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR11 AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR13 RREG32(0x000071bc) → 0x00000000 WREG32(0x000071bc) ← 0x0000005f RREG32(0x000071c4) → 0x00000000 WREG32(0x000071c4) ← 0x00000040 WREG32(0x000071c8) ← 0x7f070707 WREG32(0x000071cc) ← 0x00500705 WREG32(0x00007398) ← 0x00000005 WREG32(0x000071d0) ← 0x00000000 WREG32(0x000071d4) ← 0x00000000 WREG32(0x000071d8) ← 0x00000000 WREG32(0x000071dc) ← 0x00000000 WREG32(0x000071e0) ← 0x00c01e05 WREG32(0x000071e4) ← 0x00000000 WREG32(0x000071ec) ← 0x00000607 WREG32(0x000071f0) ← 0x00017e07 WREG32(0x000071f4) ← 0x00007e07 WREG32(0x000071fc) ← 0x00000000 RREG32(0x000071bc) → 0x00000000 WREG32(0x000071bc) ← 0x0001005f RREG32(0x000071c4) → 0x00000000 WREG32(0x000071c4) ← 0x00000040 WREG32(0x000071c8) ← 0x7f070707 WREG32(0x000071cc) ← 0x00500705 WREG32(0x00007398) ← 0x00000005 WREG32(0x000071d0) ← 0x00000000 WREG32(0x000071d4) ← 0x00000000 WREG32(0x000071d8) ← 0x00000000 WREG32(0x000071dc) ← 0x00000000 WREG32(0x000071e0) ← 0x00c01e05 WREG32(0x000071e4) ← 0x00000000 WREG32(0x000071ec) ← 0x00000607 WREG32(0x000071f0) ← 0x00017e07 WREG32(0x000071f4) ← 0x00007e07 WREG32(0x000071fc) ← 0x00000000
(...)
RREG32(0x00000538) → 0x00000001 WREG32(0x00000538) ← 0x00000001 RREG32(0x00000538) → 0x00000001 RREG32(0x00000538) → 0x00000001 WREG32(0x00000538) ← 0x00000001 RREG32(0x00000538) → 0x00000001
(...) (...)
RREG32(0x000079c0) → 0x00000001 WREG32(0x000079c0) ← 0x00000001 WREG32(0x000079cc) ← 0x00000000 RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000 RREG32(0x000075c0) → 0x00000001 WREG32(0x000075c0) ← 0x00000001 WREG32(0x000075cc) ← 0x00000000 RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO2 AFMT_AVI_INFO3 WREG32(0x00007854) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007858) ← 0x00000000 WREG32(0x0000785c) ← 0x00000000 WREG32(0x00007860) ← 0x02000000 WREG32(0x00007454) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007458) ← 0x00000000 WREG32(0x0000745c) ← 0x00000000 WREG32(0x00007460) ← 0x02000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO3 AFMT_AVI_INFO4 AFMT_AVI_INFO0 AFMT_AVI_INFO0 RREG32(0x00007854) → 0x83281e00 RREG32(0x00007858) → 0x00000000 RREG32(0x0000785c) → 0x00000000 RREG32(0x00007860) → 0x02000000 RREG32(0x00007854) → 0x83281e00 WREG32(0x00007854) ← 0x83281ea6 RREG32(0x00007454) → 0x83281e00 RREG32(0x00007458) → 0x00000000 RREG32(0x0000745c) → 0x00000000 RREG32(0x00007460) → 0x02000000 RREG32(0x00007454) → 0x83281e00 WREG32(0x00007454) ← 0x83281ea6
HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL1 HDMI_INFOFRAME_CONTROL1 HDMI_GENERIC_PACKET_CONTROL HDMI_GENERIC_PACKET_CONTROL RREG32(0x00007814) → 0x00000013 WREG32(0x00007814) ← 0x00000093 RREG32(0x00007818) → 0x00000202 WREG32(0x00007818) ← 0x00000202 RREG32(0x0000781c) → 0x00000000 WREG32(0x0000781c) ← 0x00000000 RREG32(0x00007414) → 0x00000013 WREG32(0x00007414) ← 0x00000013 RREG32(0x00007418) → 0x00000202 WREG32(0x00007418) ← 0x00000202 RREG32(0x0000741c) → 0x00000000 WREG32(0x0000741c) ← 0x00000000
(...) (...)
RREG32(0x00000538) → 0x00000001 WREG32(0x00000538) ← 0x00000001 RREG32(0x00000538) → 0x00000001 RREG32(0x00000538) → 0x00000001 WREG32(0x00000538) ← 0x00000001 RREG32(0x00000538) → 0x00000001
(...) (...)
R600_AUDIO_ENABLE R600_AUDIO_ENABLE RREG32(0x00007300) → 0x001000f0 RREG32(0x00007308) → 0x00000000 WREG32(0x00007308) ← 0x00000001 WREG32(0x00007300) ← 0x8f1000f0 RREG32(0x00007300) → 0x001000f0 RREG32(0x00007308) → 0x00000000 WREG32(0x00007308) ← 0x00000001 WREG32(0x00007300) ← 0x8f1000f0
(...) (...)
RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000 RREG32(0x00006588) → 0x00000000 RREG32(0x0000658c) → 0x00000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO2 AFMT_AVI_INFO3 WREG32(0x00007854) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007858) ← 0x00000000 WREG32(0x0000785c) ← 0x00000000 WREG32(0x00007860) ← 0x02000000 WREG32(0x00007454) ← 0x83281e00 RREG32(0x000060b4) → 0x00000000 WREG32(0x00007458) ← 0x00000000 WREG32(0x0000745c) ← 0x00000000 WREG32(0x00007460) ← 0x02000000
AFMT_AVI_INFO0 AFMT_AVI_INFO1 AFMT_AVI_INFO3 AFMT_AVI_INFO4 AFMT_AVI_INFO0 AFMT_AVI_INFO0 RREG32(0x00007854) → 0x83281e00 RREG32(0x00007858) → 0x00000000 RREG32(0x0000785c) → 0x00000000 RREG32(0x00007860) → 0x02000000 RREG32(0x00007854) → 0x83281e00 WREG32(0x00007854) ← 0x83281ea6 RREG32(0x00007454) → 0x83281e00 RREG32(0x00007458) → 0x00000000 RREG32(0x0000745c) → 0x00000000 RREG32(0x00007460) → 0x02000000 RREG32(0x00007454) → 0x83281e00 WREG32(0x00007454) ← 0x83281ea6
HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL0 HDMI_INFOFRAME_CONTROL1 HDMI_INFOFRAME_CONTROL1 HDMI_GENERIC_PACKET_CONTROL HDMI_GENERIC_PACKET_CONTROL RREG32(0x00007814) → 0x00000013 WREG32(0x00007814) ← 0x00000093 RREG32(0x00007818) → 0x00000202 WREG32(0x00007818) ← 0x00000202 RREG32(0x0000781c) → 0x00000000 WREG32(0x0000781c) ← 0x00000000 RREG32(0x00007414) → 0x00000013 WREG32(0x00007414) ← 0x00000013 RREG32(0x00007418) → 0x00000202 WREG32(0x00007418) ← 0x00000202 RREG32(0x0000741c) → 0x00000000 WREG32(0x0000741c) ← 0x00000000
R600_AUDIO_ENABLE RREG32(0x00007300) → 0x8f1000f0 RREG32(0x00007300) → 0x8f1000f0
Playing PCM 32000 Hz
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux