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: 1001-remove-pointless-functions.patch

File 1001-remove-pointless-functions.patch, 2.9 KB (added by Antoine Martin, 6 years ago)

dummy randr 1.2: patch 1 Remove pointless empty functions

  • src/dummy_driver.c

    These functions might be useful in a real driver, but with no
    hardware, they're pointless.  Get rid of them.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    ---
     src/dummy_driver.c | 56 ------------------------------------------------------
     1 file changed, 56 deletions(-)
    
    diff --git a/src/dummy_driver.c b/src/dummy_driver.c
    index 6062c39d2a4d..e5ff4dae34f3 100644
    a b static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, 
    6565static Bool     DUMMYSaveScreen(ScreenPtr pScreen, int mode);
    6666
    6767/* Internally used functions */
    68 static Bool     dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
    69 static void     dummySave(ScrnInfoPtr pScrn);
    70 static void     dummyRestore(ScrnInfoPtr pScrn, Bool restoreText);
    7168static Bool     dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
    7269                                pointer ptr);
    7370
    DUMMYEnterVT(VT_FUNC_ARGS_DECL) 
    463460{
    464461    SCRN_INFO_PTR(arg);
    465462   
    466     /* Should we re-save the text mode on each VT enter? */
    467     if(!dummyModeInit(pScrn, pScrn->currentMode))
    468       return FALSE;
    469 
    470463    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
    471464
    472465    return TRUE;
    DUMMYEnterVT(VT_FUNC_ARGS_DECL) 
    476469static void
    477470DUMMYLeaveVT(VT_FUNC_ARGS_DECL)
    478471{
    479     SCRN_INFO_PTR(arg);
    480     dummyRestore(pScrn, TRUE);
    481472}
    482473
    483474static void
    DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    536527    if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
    537528        return FALSE;
    538529   
    539     /*
    540      * next we save the current state and setup the first mode
    541      */
    542     dummySave(pScrn);
    543    
    544     if (!dummyModeInit(pScrn,pScrn->currentMode))
    545         return FALSE;
    546530    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
    547531
    548532    /*
    DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    665649Bool
    666650DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
    667651{
    668     SCRN_INFO_PTR(arg);
    669     return dummyModeInit(pScrn, mode);
    670652}
    671653
    672654/* Mandatory */
    673655void
    674656DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL)
    675657{
    676     SCRN_INFO_PTR(arg);
    677     int Base;
    678 
    679     Base = (y * pScrn->displayWidth + x) >> 2;
    680 
    681     /* Scale Base by the number of bytes per pixel. */
    682     switch (pScrn->depth) {
    683     case  8 :
    684         break;
    685     case 15 :
    686     case 16 :
    687         Base *= 2;
    688         break;
    689     case 24 :
    690         Base *= 3;
    691         break;
    692     default :
    693         break;
    694     }
    695658}
    696659
    697660/* Mandatory */
    DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL) 
    702665    DUMMYPtr dPtr = DUMMYPTR(pScrn);
    703666
    704667    if(pScrn->vtSema){
    705         dummyRestore(pScrn, TRUE);
    706668        free(dPtr->FBBase);
    707669    }
    708670
    DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) 
    744706    return(MODE_OK);
    745707}
    746708
    747 static void
    748 dummySave(ScrnInfoPtr pScrn)
    749 {
    750 }
    751 
    752 static void
    753 dummyRestore(ScrnInfoPtr pScrn, Bool restoreText)
    754 {
    755 }
    756    
    757 static Bool
    758 dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
    759 {
    760     dummyRestore(pScrn, FALSE);
    761    
    762     return(TRUE);
    763 }
    764 
    765709Atom VFB_PROP  = 0;
    766710#define  VFB_PROP_NAME  "VFB_IDENT"
    767711