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;
dummy_colors colors[256];
pointer* FBBase;
Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop;
} DUMMYRec, *DUMMYPtr;

View File

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

View File

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