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: 1004-remove-dga.patch

File 1004-remove-dga.patch, 7.4 KB (added by Antoine Martin, 6 years ago)

dummy randr 1.2: patch 4 Remove DGA support

  • configure.ac

    DGA was so 2004.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    ---
     configure.ac       |   8 ---
     src/Makefile.am    |   5 --
     src/dummy.h        |   7 ---
     src/dummy_dga.c    | 175 -----------------------------------------------------
     src/dummy_driver.c |   8 ---
     5 files changed, 203 deletions(-)
     delete mode 100644 src/dummy_dga.c
    
    diff --git a/configure.ac b/configure.ac
    index e6e00433d69f..cc25cfdff335 100644
    a b AC_PROG_LIBTOOL 
    4646AH_TOP([#include "xorg-server.h"])
    4747
    4848# Define a configure option for an alternate module directory
    49 AC_ARG_ENABLE(dga,           AS_HELP_STRING([--disable-dga], [Build DGA extension (default: yes)]), [DGA=$enableval], [DGA=yes])
    5049AC_ARG_WITH(xorg-module-dir, [  --with-xorg-module-dir=DIR ],
    5150                             [ moduledir="$withval" ],
    5251                             [ moduledir="$libdir/xorg/modules" ])
    AC_SUBST(moduledir) 
    5756XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
    5857XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
    5958
    60 if test "x$DGA" = xyes; then
    61         XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
    62         AC_DEFINE(USE_DGA, 1, [Support DGA extension])
    63 fi
    64 AC_SUBST([DGA])
    65 AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
    66 
    6759# Obtain compiler/linker options for the driver dependencies
    6860PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $REQUIRED_MODULES)
    6961
  • src/Makefile.am

    diff --git a/src/Makefile.am b/src/Makefile.am
    index da1dd9a9abe6..c0d82e0a585a 100644
    a b dummy_drv_la_SOURCES = \ 
    3737         dummy_cursor.c \
    3838         dummy_driver.c \
    3939         dummy.h
    40 
    41 if DGA
    42 dummy_drv_la_SOURCES += \
    43          dummy_dga.c
    44 endif
  • src/dummy.h

    diff --git a/src/dummy.h b/src/dummy.h
    index 705b9e5ed8b9..f902fa607fce 100644
    a b extern Bool DUMMYCursorInit(ScreenPtr pScrn); 
    2828extern void DUMMYShowCursor(ScrnInfoPtr pScrn);
    2929extern void DUMMYHideCursor(ScrnInfoPtr pScrn);
    3030
    31 /* in dummy_dga.c */
    32 Bool DUMMYDGAInit(ScreenPtr pScreen);
    33 
    3431/* globals */
    3532typedef struct _color
    3633{
    typedef struct _color 
    4138
    4239typedef struct dummyRec
    4340{
    44     DGAModePtr          DGAModes;
    45     int                 numDGAModes;
    46     Bool                DGAactive;
    47     int                 DGAViewportStatus;
    4841    /* options */
    4942    OptionInfoPtr Options;
    5043    Bool swCursor;
  • deleted file src/dummy_dga.c

    diff --git a/src/dummy_dga.c b/src/dummy_dga.c
    deleted file mode 100644
    index d16d09f1bfc8..000000000000
    + -  
    1 #ifdef HAVE_CONFIG_H
    2 #include "config.h"
    3 #endif
    4 
    5 #include "xf86.h"
    6 #include "xf86_OSproc.h"
    7 #include "dgaproc.h"
    8 #include "dummy.h"
    9 
    10 static Bool DUMMY_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
    11                                         int *, int *, int *);
    12 static Bool DUMMY_SetMode(ScrnInfoPtr, DGAModePtr);
    13 static int  DUMMY_GetViewport(ScrnInfoPtr);
    14 static void DUMMY_SetViewport(ScrnInfoPtr, int, int, int);
    15 
    16 static
    17 DGAFunctionRec DUMMYDGAFuncs = {
    18    DUMMY_OpenFramebuffer,
    19    NULL,
    20    DUMMY_SetMode,
    21    DUMMY_SetViewport,
    22    DUMMY_GetViewport,
    23    NULL,
    24    NULL,
    25    NULL,
    26 #if 0
    27    DUMMY_BlitTransRect
    28 #else
    29    NULL
    30 #endif
    31 };
    32 
    33 Bool
    34 DUMMYDGAInit(ScreenPtr pScreen)
    35 {   
    36    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    37    DUMMYPtr pDUMMY = DUMMYPTR(pScrn);
    38    DGAModePtr modes = NULL, newmodes = NULL, currentMode;
    39    DisplayModePtr pMode, firstMode;
    40    int Bpp = pScrn->bitsPerPixel >> 3;
    41    int num = 0, imlines, pixlines;
    42 
    43    imlines =  (pScrn->videoRam * 1024) /
    44       (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
    45 
    46    pixlines =   imlines;
    47 
    48    pMode = firstMode = pScrn->modes;
    49 
    50    while(pMode) {
    51 
    52         newmodes = realloc(modes, (num + 1) * sizeof(DGAModeRec));
    53 
    54         if(!newmodes) {
    55            free(modes);
    56            return FALSE;
    57         }
    58         modes = newmodes;
    59 
    60         currentMode = modes + num;
    61         num++;
    62 
    63         currentMode->mode = pMode;
    64         currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE;
    65         if(pMode->Flags & V_DBLSCAN)
    66            currentMode->flags |= DGA_DOUBLESCAN;
    67         if(pMode->Flags & V_INTERLACE)
    68            currentMode->flags |= DGA_INTERLACED;
    69         currentMode->byteOrder = pScrn->imageByteOrder;
    70         currentMode->depth = pScrn->depth;
    71         currentMode->bitsPerPixel = pScrn->bitsPerPixel;
    72         currentMode->red_mask = pScrn->mask.red;
    73         currentMode->green_mask = pScrn->mask.green;
    74         currentMode->blue_mask = pScrn->mask.blue;
    75         currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor;
    76         currentMode->viewportWidth = pMode->HDisplay;
    77         currentMode->viewportHeight = pMode->VDisplay;
    78         currentMode->xViewportStep = 1;
    79         currentMode->yViewportStep = 1;
    80         currentMode->viewportFlags = DGA_FLIP_RETRACE;
    81         currentMode->offset = 0;
    82         currentMode->address = (unsigned char *)pDUMMY->FBBase;
    83 
    84         currentMode->bytesPerScanline =
    85                         ((pScrn->displayWidth * Bpp) + 3) & ~3L;
    86         currentMode->imageWidth = pScrn->displayWidth;
    87         currentMode->imageHeight =  imlines;
    88         currentMode->pixmapWidth = currentMode->imageWidth;
    89         currentMode->pixmapHeight = pixlines;
    90         currentMode->maxViewportX = currentMode->imageWidth -
    91                                         currentMode->viewportWidth;
    92         currentMode->maxViewportY = currentMode->imageHeight -
    93                                         currentMode->viewportHeight;
    94 
    95         pMode = pMode->next;
    96         if(pMode == firstMode)
    97            break;
    98    }
    99 
    100    pDUMMY->numDGAModes = num;
    101    pDUMMY->DGAModes = modes;
    102 
    103    return DGAInit(pScreen, &DUMMYDGAFuncs, modes, num); 
    104 }
    105 
    106 static DisplayModePtr DUMMYSavedDGAModes[MAXSCREENS];
    107 
    108 static Bool
    109 DUMMY_SetMode(
    110    ScrnInfoPtr pScrn,
    111    DGAModePtr pMode
    112 ){
    113    int index = pScrn->pScreen->myNum;
    114    DUMMYPtr pDUMMY = DUMMYPTR(pScrn);
    115 
    116    if(!pMode) { /* restore the original mode */
    117         if(pDUMMY->DGAactive) {
    118             pScrn->currentMode = DUMMYSavedDGAModes[index];
    119             DUMMYSwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
    120             DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
    121             pDUMMY->DGAactive = FALSE;
    122         }
    123    } else {
    124         if(!pDUMMY->DGAactive) {  /* save the old parameters */
    125             DUMMYSavedDGAModes[index] = pScrn->currentMode;
    126             pDUMMY->DGAactive = TRUE;
    127         }
    128 
    129         DUMMYSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode));
    130    }
    131    
    132    return TRUE;
    133 }
    134 
    135 static int 
    136 DUMMY_GetViewport(
    137   ScrnInfoPtr pScrn
    138 ){
    139     DUMMYPtr pDUMMY = DUMMYPTR(pScrn);
    140 
    141     return pDUMMY->DGAViewportStatus;
    142 }
    143 
    144 static void
    145 DUMMY_SetViewport(
    146    ScrnInfoPtr pScrn,
    147    int x, int y,
    148    int flags
    149 ){
    150    DUMMYPtr pDUMMY = DUMMYPTR(pScrn);
    151 
    152    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y));
    153    pDUMMY->DGAViewportStatus = 0; 
    154 }
    155 
    156 
    157 static Bool
    158 DUMMY_OpenFramebuffer(
    159    ScrnInfoPtr pScrn,
    160    char **name,
    161    unsigned char **mem,
    162    int *size,
    163    int *offset,
    164    int *flags
    165 ){
    166     DUMMYPtr pDUMMY = DUMMYPTR(pScrn);
    167 
    168     *name = NULL;               /* no special device */
    169     *mem = (unsigned char*)pDUMMY->FBBase;
    170     *size = pScrn->videoRam * 1024;
    171     *offset = 0;
    172     *flags = DGA_NEED_ROOT;
    173 
    174     return TRUE;
    175 }
  • src/dummy_driver.c

    diff --git a/src/dummy_driver.c b/src/dummy_driver.c
    index 4d833f90cc63..194b39fca817 100644
    a b  
    3939#include <X11/Xproto.h>
    4040#include "scrnintstr.h"
    4141#include "servermd.h"
    42 #ifdef USE_DGA
    43 #define _XF86DGA_SERVER_
    44 #include <X11/extensions/xf86dgaproto.h>
    45 #endif
    4642
    4743/* Mandatory functions */
    4844static const OptionInfoRec *    DUMMYAvailableOptions(int chipid, int busid);
    DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) 
    569565
    570566    xf86SetBlackWhitePixels(pScreen);
    571567
    572 #ifdef USE_DGA
    573     DUMMYDGAInit(pScreen);
    574 #endif
    575    
    576568    if (dPtr->swCursor)
    577569        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Software Cursor.\n");
    578570