[PATCH xf86-video-dummy 5/6] Get rid of dPtr->FBBase
Aaron Plattner
aplattner at nvidia.com
Sat Jan 24 17:08:12 PST 2015
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.
In addition, don't leak the screen if the server was VT switched.
Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
---
src/dummy.h | 1 -
src/dummy_cursor.c | 2 --
src/dummy_driver.c | 11 +++++------
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/dummy.h b/src/dummy.h
index f902fa607fce..82fbdeaaaa54 100644
--- a/src/dummy.h
+++ b/src/dummy.h
@@ -50,7 +50,6 @@ typedef struct dummyRec
int cursorFG, cursorBG;
dummy_colors colors[256];
- pointer* FBBase;
Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop;
} DUMMYRec, *DUMMYPtr;
diff --git a/src/dummy_cursor.c b/src/dummy_cursor.c
index 07a89bf20cb4..d7c67c6962ff 100644
--- a/src/dummy_cursor.c
+++ b/src/dummy_cursor.c
@@ -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;
}
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 194b39fca817..8262f39f2563 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -505,7 +505,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
@@ -515,7 +516,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
DUMMYScrn = pScrn;
- if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
+ if (!(pixels = malloc(pScrn->videoRam * 1024)))
return FALSE;
DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
@@ -538,7 +539,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);
@@ -649,9 +650,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);
--
2.2.2
More information about the xorg-devel
mailing list