Bug 21877 - randr properties don't seem to work on M82 (broken values)
Summary: randr properties don't seem to work on M82 (broken values)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/radeonhd (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Luc Verhaegen
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-22 07:47 UTC by Rafał Miłecki
Modified: 2009-06-15 02:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log (36.91 KB, text/plain)
2009-05-22 07:47 UTC, Rafał Miłecki
no flags Details
xrandr --prop --verbose (8.72 KB, text/plain)
2009-05-22 07:49 UTC, Rafał Miłecki
no flags Details
Xorg.0.log.old after crash (54.08 KB, text/plain)
2009-05-22 07:57 UTC, Rafał Miłecki
no flags Details
Fix for DigPropertyControl to return real result (434 bytes, patch)
2009-05-22 09:41 UTC, Rafał Miłecki
no flags Details | Splinter Review
Patch that exposes source of crash (850 bytes, text/plain)
2009-06-09 15:18 UTC, Rafał Miłecki
no flags Details
verbose Xorg.0.log with exposing patch applied (175.06 KB, text/plain)
2009-06-09 15:27 UTC, Rafał Miłecki
no flags Details

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.