diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2004-11-14 18:13:27 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2004-11-14 18:13:27 +0000 |
commit | 2b3cb71eb2cdd71bda3e3e0072fc3df9f111e0a4 (patch) | |
tree | aa18cc2d85832737cedd3a1f08f9e996cb9cfd33 /src/nv_cursor.c | |
parent | bbafc6d2fcb21671de3cfb4ff973409405162e7a (diff) |
(Bugzilla #1777) Import Mark Vojkovich's changes to NV driver since last
sync with XFree86, including: Support for new NVIDIA chips. Egbert has
a laptop that needs some DPMS ordering reversed. New chip support and
workaround for Toshiba M30 laptop issue. PCI-Xpress chip support. DPMS
support for DVI. Cursor changes for NV11 so that alpha blended cursors
will work in conjunction with dithering (laptop panels). It previously
did not. HW support for alpha blended stretch blits on NV5 and higher,
though nothing is using them at this point. Add support for VBlank
syncing the Xv Blit adaptor on hardware that supports it (NV11 and
higher). Make console restoration a little more robust. We were making
an assumption that failed on a newer laptop. Workaround for some NV31
DVI artifacts.
Also add nVidia license statement to nv man page to comply with requirement
that it appear in "user documentation"
Diffstat (limited to 'src/nv_cursor.c')
-rw-r--r-- | src/nv_cursor.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/nv_cursor.c b/src/nv_cursor.c index 85ac42a..f22e3d7 100644 --- a/src/nv_cursor.c +++ b/src/nv_cursor.c @@ -37,7 +37,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_cursor.c,v 1.12 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_cursor.c,v 1.13 2004/03/13 22:07:05 mvojkovi Exp $ */ #include "nv_include.h" @@ -239,28 +239,37 @@ NVLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs) NVPtr pNv = NVPTR(pScrn); CARD32 *image = pCurs->bits->argb; CARD32 *dst = (CARD32*)pNv->CURSOR; + CARD32 alpha, tmp; int x, y, w, h; w = pCurs->bits->width; h = pCurs->bits->height; -#if X_BYTE_ORDER == X_BIG_ENDIAN - if((pNv->Chipset & 0x0ff0) == 0x0110) { - CARD32 tmp; - + if((pNv->Chipset & 0x0ff0) == 0x0110) { /* premultiply */ for(y = 0; y < h; y++) { for(x = 0; x < w; x++) { - tmp = *image++; - *dst++ = BYTE_SWAP_32(tmp); - } - for(; x < 64; x++) - *dst++ = 0; - } - } else + alpha = *image >> 24; + if(alpha == 0xff) + tmp = *image; + else { + tmp = (alpha << 24) | + (((*image & 0xff) * alpha) / 255) | + ((((*image & 0xff00) * alpha) / 255) & 0xff00) | + ((((*image & 0xff0000) * alpha) / 255) & 0xff0000); + } + image++; +#if X_BYTE_ORDER == X_BIG_ENDIAN + *dst++ = BYTE_SWAP_32(tmp); +#else + *dst++ = tmp; #endif - { + } + for(; x < 64; x++) + *dst++ = 0; + } + } else { for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) + for(x = 0; x < w; x++) *dst++ = *image++; for(; x < 64; x++) *dst++ = 0; @@ -299,9 +308,7 @@ NVCursorInit(ScreenPtr pScreen) infoPtr->UseHWCursor = NVUseHWCursor; #ifdef ARGB_CURSOR - if(pNv->alphaCursor && - (((pNv->Chipset & 0x0ff0) != 0x0110) || !pNv->FPDither)) - { + if(pNv->alphaCursor) { infoPtr->UseHWCursorARGB = NVUseHWCursorARGB; infoPtr->LoadCursorARGB = NVLoadCursorARGB; } |