Get rid of dPtr->FBBase

The pointer to the screen's pixels is stored in the screen pixmap's
devPrivate.ptr field.  Just use that instead of storing it
redundantly.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Bob Terek <xorg@esoterek.com>
Tested-by: Antoine Martin <antoine@nagafix.co.uk>
This commit is contained in:
Aaron Plattner 2017-08-05 21:34:31 +07:00
parent 87249af5fa
commit 33e6818566
3 changed files with 5 additions and 9 deletions

View File

@ -50,7 +50,6 @@ typedef struct dummyRec
int cursorFG, cursorBG; int cursorFG, cursorBG;
dummy_colors colors[256]; dummy_colors colors[256];
pointer* FBBase;
Bool (*CreateWindow)() ; /* wrapped CreateWindow */ Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop; Bool prop;
} DUMMYRec, *DUMMYPtr; } DUMMYRec, *DUMMYPtr;

View File

@ -39,8 +39,6 @@ dummySetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
{ {
DUMMYPtr dPtr = DUMMYPTR(pScrn); DUMMYPtr dPtr = DUMMYPTR(pScrn);
/* unsigned char *_dest = ((unsigned char *)dPtr->FBBase + */
/* pScrn->videoRam * 1024 - 1024); */
dPtr->cursorX = x; dPtr->cursorX = x;
dPtr->cursorY = y; dPtr->cursorY = y;
} }

View File

@ -501,7 +501,8 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
DUMMYPtr dPtr; DUMMYPtr dPtr;
int ret; int ret;
VisualPtr visual; VisualPtr visual;
void *pixels;
/* /*
* we need to get the ScrnInfoRec for this screen, so let's allocate * we need to get the ScrnInfoRec for this screen, so let's allocate
* one first thing * one first thing
@ -511,7 +512,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
DUMMYScrn = pScrn; DUMMYScrn = pScrn;
if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024))) if (!(pixels = malloc(pScrn->videoRam * 1024)))
return FALSE; return FALSE;
/* /*
@ -532,7 +533,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
* Call the framebuffer layer's ScreenInit function, and fill in other * Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields. * pScreen fields.
*/ */
ret = fbScreenInit(pScreen, dPtr->FBBase, ret = fbScreenInit(pScreen, pixels,
pScrn->virtualX, pScrn->virtualY, pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi, pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth, pScrn->bitsPerPixel); pScrn->displayWidth, pScrn->bitsPerPixel);
@ -644,9 +645,7 @@ DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL)
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
DUMMYPtr dPtr = DUMMYPTR(pScrn); DUMMYPtr dPtr = DUMMYPTR(pScrn);
if(pScrn->vtSema){ free(pScreen->GetScreenPixmap(pScreen)->devPrivate.ptr);
free(dPtr->FBBase);
}
if (dPtr->CursorInfo) if (dPtr->CursorInfo)
xf86DestroyCursorInfoRec(dPtr->CursorInfo); xf86DestroyCursorInfoRec(dPtr->CursorInfo);