[PATCH xserver] xfree86/modes: Use xf86ScrnToScreen in xf86RandR12LoadPalette

Keith Packard keithp at keithp.com
Sat Jul 30 00:54:30 UTC 2016


Michel Dänzer <michel at daenzer.net> writes:

> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Fixes crash in ScreenInit -> xf86HandleColormaps ->
> xf86RandR12LoadPalette with drivers which don't assign pScrn->pScreen
> in ScreenInit.

That's a terrible interface. This should be fixed by wrapping the driver
ScreenInit and getting pScrn->pScreen set before the 'real' driver
ScreenInit is called; that way pScrn->pScreen will *always* be valid.

We could then eliminate the xf86ScrnToScreen API entirely at some point.

Here's an untested patch which should fix this:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xfree86-Set-pScrn-pScreen-before-driver-ScreenInit-i.patch
Type: text/x-diff
Size: 2443 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160729/f96510eb/attachment.patch>
-------------- next part --------------

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160729/f96510eb/attachment.sig>


More information about the xorg-devel mailing list