Comment 13 for bug 541501

Revision history for this message
In , Kronos-it (kronos-it) wrote :

(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 :
    0000: USHORT usStructureSize = 0x000c (12)
    0002: UCHAR ucTableFormatRevision = 0x01 (1)
    0003: UCHAR ucTableContentRevision = 0x02 (2)
  0004: ATOM_SPREAD_SPECTRUM_ASSIGNMENT asSS_Info [0] :
    0004: USHORT usSpreadSpectrumPercentage = 0x001e (30)
    0006: UCHAR ucSpreadSpectrumType = 0x01 (1)
    0007: UCHAR ucSS_Step = 0x01 (1)
    0008: UCHAR ucSS_Delay = 0x2a (42)
    0009: UCHAR ucSS_Id = 0x01 (1)
    000a: UCHAR ucRecommandedRef_Div = 0x02 (2)
    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] usSpreadSpectrumPercentage = 0xf8
[ 37.652783] ucSpreadSpectrumType = 0x1
[ 37.652824] ucSS_Step = 0x2
[ 37.652867] ucSS_Delay = 0xf
[ 37.652910] ucSS_Range = 0x0
[ 37.652953] ucRecommendedRef_Div = 0x3c

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.