Bug 21877

Summary: randr properties don't seem to work on M82 (broken values)
Product: xorg Reporter: Rafał Miłecki <zajec5>
Component: Driver/radeonhdAssignee: Luc Verhaegen <lverhaegen>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg.0.log
none
xrandr --prop --verbose
none
Xorg.0.log.old after crash
none
Fix for DigPropertyControl to return real result
none
Patch that exposes source of crash
none
verbose Xorg.0.log with exposing patch applied none

Description Rafał Miłecki 2009-05-22 07:47:11 UTC
There is example of properties using PANEL:

PANEL connected 1600x900+0+0 (normal left inverted right x axis y axis) 423mm x 238mm
        _HDMI: 8569696 (0x0082c360)     range:  (0,1)
        _Coherent: 150136792 (0x08f2e7d8)       range:  (0,1)
        _Backlight: 150136792 (0x08f2e7d8)      range:  (0,255)
        _PanningArea:
        _OutputNumber: 2 (0x00000002)
        ConnectorNumber: 2 (0x00000002)
        ConnectorType:  Panel
        SignalFormat:   LVDS
                supported: LVDS

As you can see: HDMI, Coherent and Backlight contain completly weird values. It happens with current git on X Server 1.6.1.
Comment 1 Rafał Miłecki 2009-05-22 07:47:37 UTC
Created attachment 26115 [details]
Xorg.0.log
Comment 2 Rafał Miłecki 2009-05-22 07:49:42 UTC
Created attachment 26116 [details]
xrandr --prop --verbose

Also props of DVI-D_1 aren't nice. Backlight is much too big, and _HDMI is 0 even I set it to 1:
$ grep HDMI /etc/X11/xorg.conf
  Option       "HDMI" "DVI-D_1"
Comment 3 Rafał Miłecki 2009-05-22 07:56:38 UTC
Changing _HDMI works fine:
$ xrandr --output PANEL --set _HDMI 1
$ xrandr --prop
PANEL connected 1600x900+0+0 (normal left inverted right x axis y axis) 423mm x 238mm
        _HDMI: 1 (0x00000001)   range:  (0,1)
        _Coherent: 150136792 (0x08f2e7d8)       range:  (0,1)
        _Backlight: 150136792 (0x08f2e7d8)      range:  (0,255)


But changing _Backlight doesn't work:
$ xrandr --output PANEL --set _Backlight 100
$ xrandr --prop
PANEL connected 1600x900+0+0 (normal left inverted right x axis y axis) 423mm x 238mm
        _HDMI: 1 (0x00000001)   range:  (0,1)
        _Coherent: 150136792 (0x08f2e7d8)       range:  (0,1)
        _Backlight: 150136792 (0x08f2e7d8)      range:  (0,255)


Next thing is that changing _HDMI for DVI-D_1 crashes my X:
$ xrandr --output DVI-D_1 --set _HDMI 1
Comment 4 Rafał Miłecki 2009-05-22 07:57:05 UTC
Created attachment 26117 [details]
Xorg.0.log.old after crash
Comment 5 Rafał Miłecki 2009-05-22 09:36:28 UTC
Hm, I'm suspecting some piece of code. Started my debugging with PANEL.


PANEL is driven with:
(--) RADEONHD(0): Attaching Output UNIPHY_KLDSKP_LVTMA to Connector PANEL


My PANEL's Output->Property points to DigPropertyControl.


Here goes some forwardtrace:
1) rhdRROutputGetProperty(PANEL Output, atom_Backlight);
2) DigPropertyControl(PANEL Output, rhdPropertyGet, RHD_OUTPUT_BACKLIGHT, *val);
3) LVDSTransmitterPropertyControl(PANEL Output, rhdPropertyGet, RHD_OUTPUT_BACKLIGHT, *val);

Now:
LVDSTransmitterPropertyControl detects (Private->BlLevel < 0), returns FALSE;
DigPropertyControl doesn't check returned vales, returns TRUE
Comment 6 Rafał Miłecki 2009-05-22 09:41:13 UTC
Created attachment 26120 [details] [review]
Fix for DigPropertyControl to return real result

This fixes DigPropertyControl, now it returns FALSE correctly. Still there is something wrong as Output->Private should be something working (now it doesn't have any my PANELS's properties: backlight, hdmi, coherent).
Comment 7 Rafał Miłecki 2009-06-09 15:17:38 UTC
Reporting unexisting properites was fixed in commit efa0b5475517e4252c5a97389ee5612ed7da453f

Returning 0 for _HDMI every time was fixed in commit b8533a98448f8dc2d67137e02a180430def17e0b

The one left bug is that using:
xrandr --output DVI-D_1 --set _HDMI 0
crashes X.
Comment 8 Rafał Miłecki 2009-06-09 15:18:15 UTC
Created attachment 26602 [details]
Patch that exposes source of crash
Comment 9 Rafał Miłecki 2009-06-09 15:27:25 UTC
Created attachment 26603 [details]
verbose Xorg.0.log with exposing patch applied

What happens is that calling:
xrandr --output DVI-D_1 --set _HDMI 0
executes rhdRROutputSetProperty(...)

-rhdRROutputSetProperty(xf86OutputPtr, atom_HdmiProperty, RRPropertyValuePtr)
--DigPropertyControl(..., rhdPropertySet, RHD_OUTPUT_HDMI, &val)
---TMDSTransmitterPropertyControl(..., rhdPropertySet, RHD_OUTPUT_HDMI, &val)
--DigPropertyControl(..., rhdPropertyCommit, RHD_OUTPUT_HDMI, NULL)
---TMDSTransmitterPropertyControl(..., rhdPropertyCommit, RHD_OUTPUT_HDMI, NULL)

The last TMDSTransmitterPropertyControl executes:
> Output->Mode(Output, Private->Mode);
but Private->Mode is not set. A little deeper ATOMTransmitterSet tries to use Mode->SynthClock and that ends with crash.
Comment 10 Matthias Hopf 2009-06-10 02:37:26 UTC
Thanks for debugging. I'll think of something.
Comment 11 Matthias Hopf 2009-06-15 02:28:44 UTC
Fixed with git commit 4b4a439ef35af340b9c8e48e3760e375b07f873c

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.