Bug 19626 - X.org should accept that VGA framebuffer is not always available
Summary: X.org should accept that VGA framebuffer is not always available
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: PowerPC All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: https://bugs.gentoo.org/show_bug.cgi?...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-17 05:32 UTC by Kadianakis George
Modified: 2018-05-15 18:22 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Possible fix (1.31 KB, patch)
2009-02-26 10:32 UTC, Michel Dänzer
no flags Details | Splinter Review

Description Kadianakis George 2009-01-17 05:32:47 UTC
Greetings,

the following bug was submitted by Dave at the Gentoo bugzilla:
https://bugs.gentoo.org/show_bug.cgi?id=253149

Basically, X.org was trying to access the VGA framebuffer by mmaping the newly introduced in kernel (>=2.6.28) legacy_mem file in sysfs. The legacy_mem file was not supported in Power Book G4, tho, and that lead in a -ENXIO and a X.org crash.

Before 2.6.28, X.org didn't use the legacy_mem file and used to play with /proc, which wasn't crashing. So, we made a patch that checked whether a legacy_mem mmap was successfull and in case it failed we fell back to ol' good /proc. It seemed to work, but according to Benjamin at: 
http://marc.info/?l=linux-kernel&m=123176085927767&w=2
X.org "shouldn't fallback to /proc or whatever junk it did with /dev/mem, it should understand that as "the kernel supports the legacy interfaces, and tells you this machine has no access to legacy mem" and thus disable all attempts at whacking VGA text mode.".
Comment 1 Daniel Drake 2009-01-17 05:44:39 UTC
Aaron, do you have any input here?
xf86-video-nv is attempting to map VGA framebuffer on platforms that do not have one.
Comment 2 Kadianakis George 2009-02-26 08:58:14 UTC
Shameless reminder that the bug is still out there, feeding it's hunger with every little -ENXIO mmap return value.
Comment 3 Michel Dänzer 2009-02-26 10:32:45 UTC
Created attachment 23328 [details] [review]
Possible fix

Does this fix it? Only compile tested.
Comment 4 Kadianakis George 2009-02-26 11:17:47 UTC
(In reply to comment #3)
> Created an attachment (id=23328) [details]
> Possible fix
> 
> Does this fix it? Only compile tested.
> 

If I'm not mistaken, what your patch does is falling back to linuxMapPci if the legacy_mem mmaping fails.

As a matter of fact, we already tried that (also mentioned in the first post) (you can find the patch in the Gentoo bug report page) and it worked, but Benjamin (http://marc.info/?l=linux-kernel&m=123179656720273&w=2) says that 'It shouldn't fallback to /proc or whatever junk it did with /dev/mem, it should understand that as "the kernel supports the legacy interfaces, and tells you this machine has no access to legacy mem" and thus disable all attempts at whacking VGA text mode.'.
Comment 5 Michel Dänzer 2009-02-26 11:25:07 UTC
(In reply to comment #4)
> As a matter of fact, we already tried that (also mentioned in the first post)
> (you can find the patch in the Gentoo bug report page)

Sigh. In the future, please always provide all relevant information including attachments here directly.

> and it worked, but Benjamin (http://marc.info/?l=linux-kernel
> m=123179656720273&w=2) says that 'It shouldn't fallback to /proc or whatever
> junk it did with /dev/mem, it should understand that as "the kernel supports
> the legacy interfaces, and tells you this machine has no access to legacy mem"
> and thus disable all attempts at whacking VGA text mode.'.

I'm not sure what these patches have to do with whacking VGA text mode - they should just make the code behave the same as if the legacy_mem file didn't exist.
Comment 6 Benjamin Herrenschmidt 2009-02-26 12:56:17 UTC
Due to the mess in fixing X (Jesse also tried a few things but that were not satisfactory), I pushed upstream a kernel hack that causes PowerPC to now expose a legacy_mem file -always- and back it with anonymous memory when legacy memory isn't supported on the platform.
Comment 7 Kadianakis George 2009-02-26 17:25:04 UTC
(In reply to comment #6)
> Due to the mess in fixing X (Jesse also tried a few things but that were not
> satisfactory), I pushed upstream a kernel hack that causes PowerPC to now
> expose a legacy_mem file -always- and back it with anonymous memory when legacy
> memory isn't supported on the platform.
> 

I guess that you are referring to:
http://kerneltrap.org/mailarchive/git-commits-head/2009/2/10/4945094
which came off this discussion:
http://www.mail-archive.com/kernel-testers@vger.kernel.org/msg03078.html

Please, give out links when you are talking about specific patches. It saves some searching time for the other people.

Anyway, good to hear that a patch (even a hack) came out regarding this bug! :)
Comment 8 Adam Jackson 2018-05-15 18:22:45 UTC
Closing per comment #6, though none of the guilty code exists in X anymore afaict.


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.