[PATCH:xf86-video-mga] Fix pointer cast warning.

Daniel Stone daniel at fooishbar.org
Wed Feb 25 03:33:43 PST 2015


Hi,

On 25 February 2015 at 10:31, Tormod Volden <lists.tormod at gmail.com> wrote:
> On Tue, Feb 24, 2015 at 7:36 AM, Mark Kettenis <mark.kettenis at xs4all.nl> wrote:
>> This code makes no sense to me.  exaGetPixmapFirstPixel() returns a pixel
>> value.  Interpreting that as a pointer to the first pixel must be wrong.
>
> Are you sure about this? What would be the utility of a function
> returning the pixel /value/ of the first pixel in a pixmap?

That is literally what it does: the body of the function just calls
GetImage on a 1x1 area. Using it as a pointer will lead to a crash at
best.

>> Note that the actual usage of mgaDownloadFromScreen() is #if 0'ed out.
>> Perhaps this code should just be removed from the driver?  Or perhaps the
>> code was #if 0'ed out because the code didn't work?
>
> About the EXA code working or not, see also
> https://bugs.freedesktop.org/show_bug.cgi?id=53423

If pSrcPict->pDrawable is NULL, it means it's a special picture such
as a solid colour or gradient.

I think it's safe to say this code is spectacularly broken, and should
be disabled by default, and probably removed unless someone with the
hardware and motivation wants to make it actually function at all.

Cheers,
Daniel


More information about the xorg-devel mailing list