(In reply to comment #12)
> Created an attachment (id=32336) [details]
> add missing breaks
>
> This patch should fix it.
The EDID is back, the flickering is still there, but I think I see the problem.
The old code used "id" as offset into the asSS_Info array; now this is the PPLL_SS_Info table on my M76:
Note that the size is 12 bytes, so there's only one ATOM_SPREAD_SPECTRUM_ASSIGNMENT; ucSS_Id in the LVDS block is 0x1 and the old code ended up reading past the end of array. For example now it's trying to set:
I guess that atombios validates the data and discards it. The new code picks up the correct data... and causes flickering. Why is this causing flickering on the _external_ display? I'm not sure what happens at boot when the outputs are cloned, but with X running the outputs are "uncloned" and are using different CRTCs; the kernel module enables SS on CRTC 1, and xrandr reports that it's used by LVDS.
(In reply to comment #12)
> Created an attachment (id=32336) [details]
> add missing breaks
>
> This patch should fix it.
The EDID is back, the flickering is still there, but I think I see the problem.
The old code used "id" as offset into the asSS_Info array; now this is the PPLL_SS_Info table on my M76:
data_table 0000ae26 #12 (PPLL_SS_Info):
Size 000c
Format Rev. 01
Param Rev. 00
Content Rev. 02
00000000: 1e00 0101 2a01 0202 ....*...
0000: ATOM_COMMON_ TABLE_HEADER sHeader : vision = 0x01 (1) evision = 0x02 (2) SPECTRUM_ ASSIGNMENT asSS_Info [0] : mPercentage = 0x001e (30) mType = 0x01 (1) f_Div = 0x02 (2)
0000: USHORT usStructureSize = 0x000c (12)
0002: UCHAR ucTableFormatRe
0003: UCHAR ucTableContentR
0004: ATOM_SPREAD_
0004: USHORT usSpreadSpectru
0006: UCHAR ucSpreadSpectru
0007: UCHAR ucSS_Step = 0x01 (1)
0008: UCHAR ucSS_Delay = 0x2a (42)
0009: UCHAR ucSS_Id = 0x01 (1)
000a: UCHAR ucRecommandedRe
000b: UCHAR ucSS_Range = 0x02 (2)
[cut]
Note that the size is 12 bytes, so there's only one ATOM_SPREAD_ SPECTRUM_ ASSIGNMENT; ucSS_Id in the LVDS block is 0x1 and the old code ended up reading past the end of array. For example now it's trying to set:
[ 37.652741] usSpreadSpectru mPercentage = 0xf8 mType = 0x1 f_Div = 0x3c
[ 37.652783] ucSpreadSpectru
[ 37.652824] ucSS_Step = 0x2
[ 37.652867] ucSS_Delay = 0xf
[ 37.652910] ucSS_Range = 0x0
[ 37.652953] ucRecommendedRe
I guess that atombios validates the data and discards it. The new code picks up the correct data... and causes flickering. Why is this causing flickering on the _external_ display? I'm not sure what happens at boot when the outputs are cloned, but with X running the outputs are "uncloned" and are using different CRTCs; the kernel module enables SS on CRTC 1, and xrandr reports that it's used by LVDS.