diff options
author | Adam Jackson <ajax@redhat.com> | 2012-02-16 15:01:36 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2014-05-21 10:23:29 -0400 |
commit | 087b3e0718b17e4c92142cf3063ff02ae8ede437 (patch) | |
tree | ba5cbe3788ab93af3e0fa34f56dce848dec38056 | |
parent | bd57f9f9988d781d2ba4e0fbf88ea746fc16e578 (diff) |
Remove old-school static rotation
This should happen in RANDR 1.2 if at all.
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | src/mga.h | 6 | ||||
-rw-r--r-- | src/mga_driver.c | 50 | ||||
-rw-r--r-- | src/mga_merge.c | 2 | ||||
-rw-r--r-- | src/mga_shadow.c | 200 |
4 files changed, 2 insertions, 256 deletions
@@ -66,7 +66,6 @@ typedef enum { OPTION_SET_MCLK, OPTION_OVERCLOCK_MEM, OPTION_VIDEO_KEY, - OPTION_ROTATE, OPTION_TEXTURED_VIDEO, OPTION_CRTC2HALF, OPTION_CRTC2RAM, @@ -579,7 +578,6 @@ typedef struct { int colorKey; int videoKey; int fifoCount; - int Rotate; MGAFBLayout CurrentLayout; Bool DrawTransparent; int MaxBlitDWORDS; @@ -730,10 +728,6 @@ void MGAPolyArcThinSolid(DrawablePtr, GCPtr, int, xArc*); Bool MGADGAInit(ScreenPtr pScreen); void MGARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); -void MGARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); -void MGARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); -void MGARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox); -void MGARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void mgaDoSetupForScreenToScreenCopy( ScrnInfoPtr pScrn, int xdir, int ydir, int rop, unsigned int planemask, int trans, unsigned int bpp ); diff --git a/src/mga_driver.c b/src/mga_driver.c index 103d0da..034d072 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -532,7 +532,6 @@ static const OptionInfoRec MGAOptions[] = { { OPTION_SET_MCLK, "SetMclk", OPTV_FREQ, {0}, FALSE }, { OPTION_OVERCLOCK_MEM, "OverclockMem", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE }, - { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE }, { OPTION_TEXTURED_VIDEO, "TexturedVideo",OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRTC2HALF, "Crtc2Half", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRTC2RAM, "Crtc2Ram", OPTV_INTEGER, {0}, FALSE }, @@ -1959,35 +1958,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pScrn->LeaveVT = fbdevHWLeaveVTWeak(); pScrn->ValidMode = fbdevHWValidModeWeak(); } - pMga->Rotate = 0; - if ((s = xf86GetOptValString(pMga->Options, OPTION_ROTATE))) { - if(!pMga->MergedFB) { - if(!xf86NameCmp(s, "CW")) { - pMga->ShadowFB = TRUE; - pMga->NoAccel = TRUE; - pMga->HWCursor = FALSE; - pMga->Rotate = 1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Rotating screen clockwise - acceleration disabled\n"); - } else - if(!xf86NameCmp(s, "CCW")) { - pMga->ShadowFB = TRUE; - pMga->NoAccel = TRUE; - pMga->HWCursor = FALSE; - pMga->Rotate = -1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Rotating screen counter clockwise - acceleration disabled\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "\"%s\" is not a valid value for Option \"Rotate\"\n", s); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Valid options are \"CW\" or \"CCW\"\n"); - } - } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - " -- Rotation disabled.\n"); - } - } /* Load XAA if needed */ if (!pMga->NoAccel) { @@ -3229,12 +3199,6 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL) height = pScrn->virtualY; displayWidth = pScrn->displayWidth; - - if(pMga->Rotate) { - height = pScrn->virtualX; - width = pScrn->virtualY; - } - if(pMga->ShadowFB) { pMga->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); pMga->ShadowPtr = malloc(pMga->ShadowPitch * height); @@ -3374,20 +3338,6 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL) if(pMga->ShadowFB) { RefreshAreaFuncPtr refreshArea = MGARefreshArea; - if(pMga->Rotate) { - if (!pMga->PointerMoved) { - pMga->PointerMoved = pScrn->PointerMoved; - pScrn->PointerMoved = MGAPointerMoved; - } - - switch(pScrn->bitsPerPixel) { - case 8: refreshArea = MGARefreshArea8; break; - case 16: refreshArea = MGARefreshArea16; break; - case 24: refreshArea = MGARefreshArea24; break; - case 32: refreshArea = MGARefreshArea32; break; - } - } - ShadowFBInit(pScreen, refreshArea); } diff --git a/src/mga_merge.c b/src/mga_merge.c index 0248fd3..49ef9ab 100644 --- a/src/mga_merge.c +++ b/src/mga_merge.c @@ -337,8 +337,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) pMga->TexturedVideo = pMga1->TexturedVideo; pMga->MergedFB = TRUE; - pMga->Rotate = 0; - switch (pMga->Chipset) { case PCI_CHIP_MGA2064: case PCI_CHIP_MGA2164: diff --git a/src/mga_shadow.c b/src/mga_shadow.c index a8d5cfb..d059852 100644 --- a/src/mga_shadow.c +++ b/src/mga_shadow.c @@ -15,8 +15,6 @@ #include "shadowfb.h" #include "servermd.h" - - void MGARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { @@ -51,202 +49,8 @@ MGAPointerMoved(SCRN_ARG_TYPE arg, int x, int y) MGAPtr pMga = MGAPTR(pScrn); int newX, newY; - if(pMga->Rotate == 1) { - newX = pScrn->pScreen->height - y - 1; - newY = x; - } else { - newX = y; - newY = pScrn->pScreen->width - x - 1; - } + newX = y; + newY = pScrn->pScreen->width - x - 1; (*pMga->PointerMoved)(arg, newX, newY); } - -void -MGARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) -{ - MGAPtr pMga = MGAPTR(pScrn); - int count, width, height, y1, y2, dstPitch, srcPitch; - CARD8 *dstPtr, *srcPtr, *src; - CARD32 *dst; - - dstPitch = pScrn->displayWidth; - srcPitch = -pMga->Rotate * pMga->ShadowPitch; - - while(num--) { - width = pbox->x2 - pbox->x1; - y1 = pbox->y1 & ~3; - y2 = (pbox->y2 + 3) & ~3; - height = (y2 - y1) >> 2; /* in dwords */ - - if(pMga->Rotate == 1) { - dstPtr = pMga->FbStart + - (pbox->x1 * dstPitch) + pScrn->virtualX - y2; - srcPtr = pMga->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; - } else { - dstPtr = pMga->FbStart + - ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; - srcPtr = pMga->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1; - } - - while(width--) { - src = srcPtr; - dst = (CARD32*)dstPtr; - count = height; - while(count--) { - *(dst++) = src[0] | (src[srcPitch] << 8) | - (src[srcPitch * 2] << 16) | - (src[srcPitch * 3] << 24); - src += srcPitch * 4; - } - srcPtr += pMga->Rotate; - dstPtr += dstPitch; - } - - pbox++; - } -} - - -void -MGARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) -{ - MGAPtr pMga = MGAPTR(pScrn); - int count, width, height, y1, y2, dstPitch, srcPitch; - CARD16 *dstPtr, *srcPtr, *src; - CARD32 *dst; - - dstPitch = pScrn->displayWidth; - srcPitch = -pMga->Rotate * pMga->ShadowPitch >> 1; - - while(num--) { - width = pbox->x2 - pbox->x1; - y1 = pbox->y1 & ~1; - y2 = (pbox->y2 + 1) & ~1; - height = (y2 - y1) >> 1; /* in dwords */ - - if(pMga->Rotate == 1) { - dstPtr = (CARD16*)pMga->FbStart + - (pbox->x1 * dstPitch) + pScrn->virtualX - y2; - srcPtr = (CARD16*)pMga->ShadowPtr + - ((1 - y2) * srcPitch) + pbox->x1; - } else { - dstPtr = (CARD16*)pMga->FbStart + - ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; - srcPtr = (CARD16*)pMga->ShadowPtr + - (y1 * srcPitch) + pbox->x2 - 1; - } - - while(width--) { - src = srcPtr; - dst = (CARD32*)dstPtr; - count = height; - while(count--) { - *(dst++) = src[0] | (src[srcPitch] << 16); - src += srcPitch * 2; - } - srcPtr += pMga->Rotate; - dstPtr += dstPitch; - } - - pbox++; - } -} - - -/* this one could be faster */ -void -MGARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) -{ - MGAPtr pMga = MGAPTR(pScrn); - int count, width, height, y1, y2, dstPitch, srcPitch; - CARD8 *dstPtr, *srcPtr, *src; - CARD32 *dst; - - dstPitch = BitmapBytePad(pScrn->displayWidth * 24); - srcPitch = -pMga->Rotate * pMga->ShadowPitch; - - while(num--) { - width = pbox->x2 - pbox->x1; - y1 = pbox->y1 & ~3; - y2 = (pbox->y2 + 3) & ~3; - height = (y2 - y1) >> 2; /* blocks of 3 dwords */ - - if(pMga->Rotate == 1) { - dstPtr = pMga->FbStart + - (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3); - srcPtr = pMga->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); - } else { - dstPtr = pMga->FbStart + - ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3); - srcPtr = pMga->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3; - } - - while(width--) { - src = srcPtr; - dst = (CARD32*)dstPtr; - count = height; - while(count--) { - dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) | - (src[srcPitch] << 24); - dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) | - (src[srcPitch * 2] << 16) | - (src[(srcPitch * 2) + 1] << 24); - dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) | - (src[(srcPitch * 3) + 1] << 16) | - (src[(srcPitch * 3) + 2] << 24); - dst += 3; - src += srcPitch * 4; - } - srcPtr += pMga->Rotate * 3; - dstPtr += dstPitch; - } - - pbox++; - } -} - -void -MGARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) -{ - MGAPtr pMga = MGAPTR(pScrn); - int count, width, height, dstPitch, srcPitch; - CARD32 *dstPtr, *srcPtr, *src, *dst; - - dstPitch = pScrn->displayWidth; - srcPitch = -pMga->Rotate * pMga->ShadowPitch >> 2; - - while(num--) { - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - - if(pMga->Rotate == 1) { - dstPtr = (CARD32*)pMga->FbStart + - (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2; - srcPtr = (CARD32*)pMga->ShadowPtr + - ((1 - pbox->y2) * srcPitch) + pbox->x1; - } else { - dstPtr = (CARD32*)pMga->FbStart + - ((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1; - srcPtr = (CARD32*)pMga->ShadowPtr + - (pbox->y1 * srcPitch) + pbox->x2 - 1; - } - - while(width--) { - src = srcPtr; - dst = dstPtr; - count = height; - while(count--) { - *(dst++) = *src; - src += srcPitch; - } - srcPtr += pMga->Rotate; - dstPtr += dstPitch; - } - - pbox++; - } -} - - - |