diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-05-19 16:26:16 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-05-20 18:35:32 -0400 |
commit | 278ad73475bd137eac8a49ec7a22406bfc2867e7 (patch) | |
tree | 98fc6def968e71b701f360527e25ea9d01147696 | |
parent | 7583471e1fe181dc7c26b7d0a0d16f70eb10dd21 (diff) | |
download | xorg-driver-xf86-video-nouveau-278ad73475bd137eac8a49ec7a22406bfc2867e7.tar.gz |
nv04-nv40: don't attempt to do 32-bit shifts
A 32-bit shift is a no-op, which will also make the new planemask get
or'd with ~0, thus negating the usefulness of the subsequent
planemask != ~0 check. Only do this if it's a less-than-32-bit per pixel
format, in which case it will have the desired effect of setting the
high bits.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Martin Peres <martin.peres@free.fr>
-rw-r--r-- | src/nv04_exa.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nv04_exa.c b/src/nv04_exa.c index 7a58dd7..d5dec68 100644 --- a/src/nv04_exa.c +++ b/src/nv04_exa.c @@ -49,7 +49,8 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask) NVPtr pNv = NVPTR(pScrn); struct nouveau_pushbuf *push = pNv->pushbuf; - planemask |= ~0 << ppix->drawable.bitsPerPixel; + if (ppix->drawable.bitsPerPixel < 32) + planemask |= ~0 << ppix->drawable.bitsPerPixel; if (planemask != ~0 || alu != GXcopy) { if (ppix->drawable.bitsPerPixel == 32) return FALSE; |