xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #56: 1005-remove-fbbase.patch

File 1005-remove-fbbase.patch, 2.5 KB (added by Antoine Martin, 6 years ago)

dummy randr 1.2: patch 5 Get rid of dPtr->FBBase

  • src/dummy.h

    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 b typedef struct dummyRec 
    5050    int cursorFG, cursorBG;
    5151
    5252    dummy_colors colors[256];
    53     pointer* FBBase;
    5453    Bool        (*CreateWindow)() ;     /* wrapped CreateWindow */
    5554    Bool prop;
    5655} DUMMYRec, *DUMMYPtr;
  • src/dummy_cursor.c

    diff --git a/src/dummy_cursor.c b/src/dummy_cursor.c
    index 07a89bf20cb4..d7c67c6962ff 100644
    a b dummySetCursorPosition(ScrnInfoPtr pScrn, int x, int y) 
    3939{
    4040    DUMMYPtr dPtr = DUMMYPTR(pScrn);
    4141
    42 /*     unsigned char *_dest = ((unsigned char *)dPtr->FBBase + */
    43 /*                          pScrn->videoRam * 1024 - 1024); */
    4442    dPtr->cursorX = x;
    4543    dPtr->cursorY = y;
    4644}
  • src/dummy_driver.c

    diff --git a/src/dummy_driver.c b/src/dummy_driver.c
    index 194b39fca817..8262f39f2563 100644
    a b DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    505505    DUMMYPtr dPtr;
    506506    int ret;
    507507    VisualPtr visual;
    508    
     508    void *pixels;
     509
    509510    /*
    510511     * we need to get the ScrnInfoRec for this screen, so let's allocate
    511512     * one first thing
    DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    515516    DUMMYScrn = pScrn;
    516517
    517518
    518     if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
     519    if (!(pixels = malloc(pScrn->videoRam * 1024)))
    519520        return FALSE;
    520521   
    521522    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
    DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    538539     * Call the framebuffer layer's ScreenInit function, and fill in other
    539540     * pScreen fields.
    540541     */
    541     ret = fbScreenInit(pScreen, dPtr->FBBase,
     542    ret = fbScreenInit(pScreen, pixels,
    542543                            pScrn->virtualX, pScrn->virtualY,
    543544                            pScrn->xDpi, pScrn->yDpi,
    544545                            pScrn->displayWidth, pScrn->bitsPerPixel);
    DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL) 
    649650    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    650651    DUMMYPtr dPtr = DUMMYPTR(pScrn);
    651652
    652     if(pScrn->vtSema){
    653         free(dPtr->FBBase);
    654     }
     653    free(pScreen->GetScreenPixmap(pScreen)->devPrivate.ptr);
    655654
    656655    if (dPtr->CursorInfo)
    657656        xf86DestroyCursorInfoRec(dPtr->CursorInfo);