[PATCH:xf86-video-ati] Make RADEONCopySwap deal with misaligned buffers.

Mark Kettenis mark.kettenis at xs4all.nl
Tue Feb 4 20:47:29 CET 2014


> From: Martin Husemann <martin at NetBSD.org>
> Date: Mon,  3 Feb 2014 20:36:13 +0100
> 
> When using xvideo on alignement critical architectures (for example a sparc64
> with the XVR100 graphics adapter) some screen positions (easily reproducable
> with xfce and gmplayer by moving the video window partly out of the screen
> on the left side) cause misaligned pointers being passed to RADEONCopySwap -
> and cause the X server to crash.
> 
> This may be bugs in the calling code (e.g. RADEONPutImage), but it only
> seems to try to align to 16 bit anyway - and actually some calls end up
> even with only byte aligned buffers.
> 
> This change notices the misalignement and uses less efficient, smaller
> copies. But at least the X server does not crash (and all usual screen
> positions seem to end up in proper aligned buffers).

It really doesn't make a lot of sense to be byte swapping 32-bit words
that aren't aligned properly.

Must admit I haven't used the XVR-100 in my Sun Blade 1000
extensively, but I've never had it crash on OpenBSD/sparc64.  And no,
the OpenBSD kernel doesn't silently patch up unaligned access like
some other OSes do.

I'll see if I can find some time to see if I can reproduce it here.


More information about the xorg-devel mailing list