Bug 98145 - X modesetting problem on dell laptop
Summary: X modesetting problem on dell laptop
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/modesetting (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-07 14:59 UTC by Klaus Kusche
Modified: 2018-12-13 18:13 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (36.07 KB, text/plain)
2016-10-07 14:59 UTC, Klaus Kusche
no flags Details
dmesg (83.54 KB, text/plain)
2016-10-07 15:00 UTC, Klaus Kusche
no flags Details
disable gtf modes (443 bytes, patch)
2017-05-31 12:06 UTC, Henri Kemppainen
no flags Details | Splinter Review

Description Klaus Kusche 2016-10-07 14:59:02 UTC
When I returned to our university after my summer holidays,
I noticed that all our VGA beamers in the lecture halls no longer 
synced to my laptop (they did with no problem several months ago).


In detail:

* All the beamers are 1024x768@60, no more.
Some of them send broken EDID data,
some of them do not send EDID at all
(I'm not sure if any beamer sends valid EDID data).
Doesn't make any visible difference for my problem.

* The linux kernel configures them correctly in framebuffer text mode.

* After starting X, they are out of sync.

* Setting the VGA mode with xrandr takes 10-20 seconds 
(laptop completely blocked) and results in the wrong mode:

No matter if I specify the mode as 1024x768, or as 1024x768 at 60,
or by hex (0x59), or if I define my own 1024x768@60 mode and use that
(as I did for the log files attached: Added a VESA-compatible 1024x768 mode
and set the VGA output to that),
in most cases the VGA output is (again?) set to a 1024x768 @ 120 mode
(hex 0x58, 1024x768 @ 60 double scan, detected by the beamers as
2048x1536 or 1024x768@120, not syncable), and in rare cases it is set
to some seemingly random mode (also too fast for the beamers).

* Turning the VGA output off with xrandr and setting it again
in many cases results in the correct 1024x768@60 after many seconds, 
the beamers sync.
Sometimes, this results in the same unuseable 1024x768 doublescan mode
as before.


Strange observations:

* The evil 0x58 double scan mode cannot be removed from the VGA output
or the mode table by xrandr. It seems to be hardcoded
(and it seems to be a valid mode for the builtin laptop display).

* In some rare cases, xrandr --verbose shows the output in the desired 
0x59 mode (1024x768@60), but the VGA output is actually still running 
at 0x58 1024x768 doublescan 
(i.e. what xrandr thinks is not what the hardware does)!

* Even setting the VGA output to 1024x768@60 the hard way
(using a "video" kernel boot parameter) does not keep X 
from setting it to 1024x768 double scan.


Hardware and software:

* Dell precision M6700 laptop with ATI "cap verde" graphics:
[drm] initializing kernel modesetting (VERDE 0x1002:0x6825 0x1028:0x053F 0x00)

Of course, dell configures it as a professional "fire" graphics card...

* Recent Dell BIOS, which causes an error message in the kernel:
radeon 0000:01:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
ATOM BIOS: Heathrow

Tried several BIOS versions, reflashed several times, error persists.

* Gentoo linux, locally compiled kernel, up to date (currently 4.7.6),
up-to-date radeon microcode (loads without errors).

* Kernel modesetting & drm, X started after login 
in existing framebuffer vt and login session (not opening a new vt), 
in non-root (non-suid) mode.

* Xorg server version 1.18.4, running builtin modesetting driver
( *not* radeon driver, but the last time I tried the radeon driver
some months ago, modesetting behaviour was identical in both drivers).


Problems (I think these are really two distinct and independent problems?!):

1.) Where does that evil 0x58 1024x768 doublescan mode 
listed by xrandr as a valid mode for the VGA output (!) come from?
(definitely not from any beamer's EDID !)

And why does X choose that mode as the default mode for VGA on startup?
Especially if the beamer is not sending EDID (or a broken EDID),
1024x768@120 is *not* a reasonable default VGA mode
(by far too fast for all common VGA devices)!

The kernel knows that 1024x768@60 is the mode to use
and sets it correctly without even trying 1024x768@120.
Why is X pretending to know better than the kernel?
There is a correct builtin 1024x768@60 mode listed in xrandr, 
it should be used by default at startup
(especially if the kernel was started with video=VGA-1:1024x768M@60 !)

And why is the hardware set to this mode 0x58 by xrandr
even if a completely different 1024x768 mode (0x59 or user-defined) 
is specified in xrandr?
(and why does the mode shown in xrandr in rare cases not correspond 
to the mode the hardware uses)?

2.) Why is any mode change taking ages (many seconds),
with the laptop being blocked and the displays (both internal
and external) being all black or randomly flashing or out of sync
or showing only part of the screen?

There are some ATOMbios errors related to that (see dmesg),
but I think only for xrandr mode changes.
As for as I can tell, there are no errors for the initial modeset.



Unfortunately, I can't bisect.
Last known good is not known and at least 6-12 months in the past,
and I use Gentoo (rolling upgrades) and update every week...

I'll attach Xorg.log and dmesg.
Comment 1 Klaus Kusche 2016-10-07 14:59:59 UTC
Created attachment 127099 [details]
Xorg log
Comment 2 Klaus Kusche 2016-10-07 15:00:21 UTC
Created attachment 127100 [details]
dmesg
Comment 3 Alex Deucher 2016-10-07 15:06:29 UTC
Set this to the driver until we determine where the bug is.
Comment 4 Henri Kemppainen 2017-05-31 12:05:15 UTC
This looks very much like symptoms of bug 101249: https://bugs.freedesktop.org/show_bug.cgi?id=101249

Klaus if you're still around, you could try a workaround to test the theory.  See next attachment.
Comment 5 Henri Kemppainen 2017-05-31 12:06:10 UTC
Created attachment 131597 [details] [review]
disable gtf modes
Comment 6 Klaus Kusche 2017-05-31 15:14:42 UTC
(In reply to Henri Kemppainen from comment #4)
> Klaus if you're still around, you could try a workaround to test the theory.
> See next attachment.

I'll try to test it, but it will take some days.
Comment 7 Klaus Kusche 2017-06-03 17:08:03 UTC
(In reply to Henri Kemppainen from comment #5)
> Created attachment 131597 [details] [review] [review]
> disable gtf modes

Patch works perfectly:

* The beamers are now auto-configuring the correct mode on startup,
without any manual intervention.

* When setting mode 1024x768 manually, it works almost immediately
and chooses the correct frequency.

* xrandr --verbose only shows modes the hardware is actually able to sync to.
Comment 8 Alex Deucher 2017-06-05 14:25:23 UTC
re-assigning to modesetting ddx.
Comment 9 Klaus Kusche 2018-05-20 08:02:35 UTC
Could you please fix that in the official xserver releases?

I still need to apply that patch manually to any xserver I install.
Without it, both the automatically selected modes 
and the manually selectable modes are still totally broken,
at least for 1024x768, my most common beamer resolution.
Comment 10 GitLab Migration User 2018-12-13 18:13:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/74.


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.