? man/trident.4 ? src/cscope.files ? src/cscope.out Index: src/blade_accel_exa.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-trident/src/blade_accel_exa.c,v retrieving revision 1.2 diff -u -r1.2 blade_accel_exa.c --- src/blade_accel_exa.c 25 Feb 2006 19:03:36 -0000 1.2 +++ src/blade_accel_exa.c 6 Mar 2006 04:37:27 -0000 @@ -26,28 +26,29 @@ * Trident Blade3D EXA support. * TODO: * Composite hooks (some ops/arg. combos may not be supported) - * Upload/Download from screen (is this even possible with this chip?) - * Fast mixed directoion Blts + * Upload/Download from screen (requires DRM driver) */ +#include + #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" -#include "xf86_OSproc.h" #include "xf86_ansic.h" - -#include "xf86PciInfo.h" +#ifdef XF86DRI +#include "xf86drm.h" +#endif +#include "xf86_OSproc.h" #include "xf86Pci.h" - +#include "xf86PciInfo.h" +#include "xaarop.h" #include "exa.h" #include "trident.h" #include "trident_regs.h" -#include "xaarop.h" - #undef REPLICATE #define REPLICATE(r, bpp) \ { \ @@ -156,10 +157,6 @@ pTrident->BltScanDirection = 0; - /* Blade only supports +xdir,+ydir && -xdir,-ydir */ - if ((xdir * ydir) < 0) - return FALSE; - REPLICATE(planemask, pSrcPixmap->drawable.bitsPerPixel); if (planemask != (unsigned int)-1) { BLADE_OUT(GER_BITMASK, ~planemask); @@ -207,30 +204,316 @@ { } +Bool UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, + int src_pitch) +{ + CARD32 fb_pitch = (exaGetPixmapPitch(pDst) + 7) / 8; + CARD32 fb_off = exaGetPixmapOffset(pDst) / 8; + + TRIDENTPtr pTrident = + TRIDENTPTR(xf86Screens[pDst->drawable.pScreen->myNum]); + return FALSE; + ErrorF("UTS from %p to 0x%lx\n", src, exaGetPixmapOffset(pDst)); + + ErrorF(" src_pitch: %d\n", src_pitch); + ErrorF(" dst pitch, bpp: %ld, %d\n", exaGetPixmapPitch(pDst), + pDst->drawable.bitsPerPixel); + ErrorF(" src height, width: %d, %d\n" , h, w); + return FALSE; + BLADE_OUT(GBM_SYSTEM_ADDR, (CARD32)src); + BLADE_OUT(GBM_SYSTEM_PITCH, src_pitch); + BLADE_OUT(GBM_SRC_HEIGHT, h); + BLADE_OUT(GBM_SRC_WIDTH, w); + BLADE_OUT(GBM_FB_PITCH_ADDR, fb_pitch << 22 | fb_off); + BLADE_OUT(GBM_CTL, GBM_READ); + exaMarkSync(pDst->drawable.pScreen); + return TRUE; +} + +Bool DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, + char *dst, int dst_pitch) +{ + TRIDENTPtr pTrident = + TRIDENTPTR(xf86Screens[pSrc->drawable.pScreen->myNum]); + return FALSE; + ErrorF("DFS from 0x%lx to %p\n", exaGetPixmapOffset(pSrc), dst); + return FALSE; + BLADE_OUT(GBM_SYSTEM_ADDR, (CARD32)dst); + BLADE_OUT(GBM_FB_PITCH_ADDR, exaGetPixmapPitch(pSrc) << 22 | + exaGetPixmapOffset(pSrc)); + BLADE_OUT(GBM_SYSTEM_PITCH, dst_pitch); + BLADE_OUT(GBM_SRC_HEIGHT, h); + BLADE_OUT(GBM_SRC_WIDTH, exaGetPixmapPitch(pSrc)); + BLADE_OUT(GBM_CTL, GBM_WRITE); + exaMarkSync(pSrc->drawable.pScreen); + return TRUE; +} + +#if 0 +struct comp_op_str { + int op; + char *name; +}; + +static struct comp_op_str comp_op_strs[] = { + { PictOpMinimum, "PictOpMinimum" }, + { PictOpClear, "PictOpClear" }, + { PictOpSrc, "PictOpSrc" }, + { PictOpDst, "PictOpDst" }, + { PictOpOver, "PictOpOver" }, + { PictOpOverReverse, "PictOpOverReverse" }, + { PictOpIn, "PictOpIn" }, + { PictOpInReverse, "PictOpInReverse" }, + { PictOpOut, "PictOpOut" }, + { PictOpOutReverse, "PictOpOutReverse" }, + { PictOpAtop, "PictOpAtop" }, + { PictOpAtopReverse, "PictOpAtopReverse" }, + { PictOpXor, "PictOpXor" }, + { PictOpAdd, "PictOpAdd" }, + { PictOpSaturate, "PictOpSaturate" }, + { PictOpMaximum, "PictOpMaximum" }, +}; + +static char *strcompop(int op) +{ + int i; + + for (i = 0; i < sizeof(comp_op_strs); i++) + if (comp_op_strs[i].op == op) + return comp_op_strs[i].name; + return "(unknown)"; +} + /* Composite comes later (if at all) */ -static Bool CheckComposite(int op, PicturePtr pSrcPicture, - PicturePtr pMaskPicture, PicturePtr pDstPicture) +static Bool CheckComposite(int op, PicturePtr pSrc, PicturePtr pMask, + PicturePtr pDst) { - return 0; + static int count; + + return FALSE; + if (count++ % 100 == 0) { + ErrorF("CheckComposite(%s, %p, %p, %p)\n", strcompop(op), pSrc, pMask, + pDst); + if (pSrc && pSrc->transform) + ErrorF("source transform\n"); + if (pDst && pDst->transform) + ErrorF("dst. transform\n"); + } + + /* Don't support transforms yet... */ + if (pSrc->transform || pDst->transform) + return FALSE; + + /* Support simple mask and image overlays */ + if (pMask && !pMask->repeat && + pMask->format == PICT_a8 && + op == PictOpOver && + pSrc->repeat && + pSrc->pDrawable->width == 1 && + pSrc->pDrawable->height == 1 && + PICT_FORMAT_BPP(pSrc->format) == 32 && + (PICT_FORMAT_A(pSrc->format) == 0 || + pSrc->componentAlpha) && + pDst->pDrawable->bitsPerPixel == 32 && + pDst->pDrawable->type == DRAWABLE_WINDOW) + return TRUE; + + if (!pMask && + op == PictOpOver && + !pSrc->repeat && + PICT_FORMAT_A(pSrc->format) == 8 && + PICT_FORMAT_BPP(pSrc->format) == 32 && + pDst->pDrawable->bitsPerPixel == 32 && + pDst->pDrawable->type == DRAWABLE_WINDOW) + return TRUE; + + return FALSE; } static Bool PrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { + TRIDENTPtr pTrident = + TRIDENTPTR(xf86Screens[pDstPicture->pDrawable->pScreen->myNum]); + pTrident->pMask = pMask; + pTrident->pSrc = pSrcPicture; return 0; } -static void Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, +static void Composite(PixmapPtr pDstPixmap, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height) { + TRIDENTPtr pTrident = + TRIDENTPTR(xf86Screens[pDstPixmap->drawable.pScreen->myNum]); + PixmapPtr pMask = pTrident->pMask; + PicturePtr pSrc = pTrident->pSrc; + RegionRec region; + int n; + BoxPtr pbox; + CARD32 rgb; + CARD8 *msk, *mskLine; + int mskBpp; + int mskXoff, mskYoff; + CARD32 *src, *srcLine; + CARD32 *off, *offLine; + int srcXoff, srcYoff; + int srcBpp; + int x_msk, y_msk, x_src, y_src, x_dst, y_dst; + int x2; + int w, h, w_this, h_this, w_remain; + CARD32 *off_screen; + int off_size = tridents->off_screen_size >> 2; + int off_width, off_height; + int stride = pScreenPriv->screen->fb[0].pixelStride; + int mskExtra; + CARD32 off_screen_offset = tridents->off_screen - tridents->screen; + int mode; + + /* Support simple mask and image overlays */ +#define MODE_NONE 0 +#define MODE_IMAGE 1 +#define MODE_MASK 2 + + rgb = *((CARD32 *) ((PixmapPtr) (pSrc->pDrawable))->devPrivate.ptr); + if (pMask && !pMask->repeat && + pMask->format == PICT_a8 && + op == PictOpOver && + pSrc->repeat && + pSrc->pDrawable->width == 1 && + pSrc->pDrawable->height == 1 && + PICT_FORMAT_BPP(pSrc->format) == 32 && + (PICT_FORMAT_A(pSrc->format) == 0 || + (rgb & 0xff000000) == 0xff000000) && + pDst->pDrawable->bitsPerPixel == 32 && + pDst->pDrawable->type == DRAWABLE_WINDOW) + mode = MODE_MASK; + else if (!pMask && + op == PictOpOver && + !pSrc->repeat && + PICT_FORMAT_A(pSrc->format) == 8 && + PICT_FORMAT_BPP(pSrc->format) == 32 && + pDst->pDrawable->bitsPerPixel == 32 && + pDst->pDrawable->type == DRAWABLE_WINDOW) + mode = MODE_IMAGE; + + xDst += pDst->pDrawable->x; + yDst += pDst->pDrawable->y; + xSrc += pSrc->pDrawable->x; + ySrc += pSrc->pDrawable->y; + + if (pMask) { + xMask += pMask->pDrawable->x; + yMask += pMask->pDrawable->y; + mskStride = mskStride * sizeof (FbBits) / sizeof (CARD8); + } + + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, + xMask, yMask, xDst, yDst, width, height)) + return; + + cop->multi = COP_MULTI_PATTERN; + cop->src_offset = off_screen_offset; + + if (mode == MODE_IMAGE) { + cop->multi = (COP_MULTI_ALPHA | + COP_ALPHA_BLEND_ENABLE | + COP_ALPHA_WRITE_ENABLE | + 0x7 << 16 | + COP_ALPHA_DST_BLEND_1_SRC_A | + COP_ALPHA_SRC_BLEND_1); + } else { + rgb &= 0xffffff; + cop->multi = (COP_MULTI_ALPHA | + COP_ALPHA_BLEND_ENABLE | + COP_ALPHA_WRITE_ENABLE | + 0x7 << 16 | + COP_ALPHA_DST_BLEND_1_SRC_A | + COP_ALPHA_SRC_BLEND_SRC_A); + } + + n = REGION_NUM_RECTS (®ion); + pbox = REGION_RECTS (®ion); + + while (n--) { + h = pbox->y2 - pbox->y1; + w = pbox->x2 - pbox->x1; + + offStride = (w + 7) & ~7; + off_height = off_size / offStride; + if (off_height > h) + off_height = h; + + cop->multi = COP_MULTI_STRIDE | (stride << 16) | offStride; + + y_dst = pbox->y1; + y_src = y_dst - yDst + ySrc; + y_msk = y_dst - yDst + yMask; + + x_dst = pbox->x1; + x_src = x_dst - xDst + xSrc; + x_msk = x_dst - xDst + xMask; + + if (mode == MODE_IMAGE) + srcLine = (CARD32 *) srcBits + (y_src - srcYoff) * srcStride + + (x_src - srcXoff); + else + mskLine = (CARD8 *) mskBits + (y_msk - mskYoff) * mskStride + + (x_msk - mskXoff); + + while (h) { + h_this = h; + if (h_this > off_height) + h_this = off_height; + h -= h_this; + + offLine = (CARD32 *) tridents->off_screen; + + _tridentWaitDone(cop); + + cop->dst_start_xy = TRI_XY(x_dst, y_dst); + cop->dst_end_xy = TRI_XY(x_dst + w - 1, y_dst + h_this - 1); + cop->src_start_xy = TRI_XY(0,0); + cop->src_end_xy = TRI_XY(w - 1, h_this - 1); + + if (mode == MODE_IMAGE) { + while (h_this--) { + w_remain = w; + src = srcLine; + srcLine += srcStride; + off = offLine; + offLine += offStride; + while (w_remain--) + *off++ = *src++; + } + } else { + while (h_this--) { + w_remain = w; + msk = mskLine; + mskLine += mskStride; + off = offLine; + offLine += offStride; + while (w_remain--) + *off++ = rgb | (*msk++ << 24); + } + } + + cop->command = (COP_OP_BLT | + COP_SCL_OPAQUE | + COP_OP_FB); + } + pbox++; + } + cop->src_offset = 0; + + exaMarkSync(pDst->pDrawable->pScreen); } static void DoneComposite(PixmapPtr pDst) { } - +#endif static int MarkSync(ScreenPtr pScreen) { return 0; @@ -245,6 +528,10 @@ BLADE_OUT(GER_PATSTYLE, 0); /* Clear pattern & style first? */ BLADEBUSY(busy); + /* Wait for idle before submitting command */ + while (!(MMIO_IN32(pTrident->IOBase, GBM_STATUS) & GBM_STATUS_IDLE)) + ; + while (busy != 0) { if (--cnt < 0) { ErrorF("GE timeout\n"); @@ -258,6 +545,7 @@ static Bool PrepareAccess(PixmapPtr pPix, int index) { + return TRUE; } static void FinishAccess(PixmapPtr pPix, int index) @@ -279,6 +567,119 @@ BLADE_OUT(GER_PATSTYLE, 0); } +Bool BladeInitDRM(ScrnInfoPtr pScrn) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + drmVersionPtr drm_version; + + pTrident->drm_fd = drmOpen("blade_drm", NULL); /* FIXME: multihead */ + + if (pTrident->drm_fd < 0) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Could not open DRM (%s), disabling DMA transfers\n", + strerror(errno)); + return FALSE; + } + + drm_version = drmGetVersion(pTrident->drm_fd); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "DRM version: %d.%d.%d (name: %s)\n", + drm_version->version_major, + drm_version->version_minor, + drm_version->version_patchlevel, + drm_version->name); + + return TRUE; +} + +Bool BladeInitAGP(ScrnInfoPtr pScrn) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + int agp_mode; + + if (drmAgpAcquire(pTrident->drm_fd)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Could not access AGP, disabling DMA transfers\n"); + return FALSE; + } + + pTrident->agpSize = drmAgpSize(pTrident->drm_fd); + pTrident->agpSize = pTrident->agpSize < 2<<21 ? pTrident->agpSize : 1<<21; + pTrident->agpPhysical = drmAgpBase(pTrident->drm_fd); + + agp_mode = drmAgpGetMode(pTrident->drm_fd); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "AGP: version %d.%d\n" + " mode %x\n" + " base=%08lx size=%08lx\n" + , drmAgpVersionMajor(pTrident->drm_fd), + drmAgpVersionMinor(pTrident->drm_fd), agp_mode, + pTrident->agpPhysical, pTrident->agpSize); + + if (drmAgpEnable(pTrident->drm_fd, agp_mode) < 0) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "could not enable AGP\n"); + return FALSE; + } + + if (drmAgpAlloc(pTrident->drm_fd, pTrident->agpSize, 0, 0, + &pTrident->drm_agp_handle)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "could not allocate AGP memory\n"); + return FALSE; + } + + if (drmAgpBind(pTrident->drm_fd, pTrident->drm_agp_handle, 0)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "could not bind AGP memory\n"); + return FALSE; + } + + if (drmAddMap(pTrident->drm_fd, 0, pTrident->agpSize, DRM_AGP, 0, + &pTrident->drm_agp_map_handle)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "could not add AGP map, %s\n", + strerror(errno)); + return FALSE; + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "agp map handle=%08lx\n", + (unsigned long)pTrident->drm_agp_map_handle); + + if (drmMap(pTrident->drm_fd, pTrident->agpPhysical, pTrident->agpSize, + (drmAddressPtr)&pTrident->agpMemory)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "could not map AGP memory: %s\n", + strerror(errno)); + return FALSE; + } + + return TRUE; +} + +static void BladeTestAGP(ScrnInfoPtr pScrn) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + char *tmp; + struct timespec time1, time2; + double mb = pTrident->agpSize / (1024.0*1024.0); + double secs; + + if (!(tmp = malloc(pTrident->agpSize))) + return; + + clock_gettime(CLOCK_MONOTONIC, &time1); + memcpy(tmp, pTrident->agpMemory, pTrident->agpSize); + clock_gettime(CLOCK_MONOTONIC, &time2); + secs = time2.tv_sec - time1.tv_sec; + if (!secs) + secs += (time2.tv_nsec - time1.tv_nsec) / 1000000000.0; + else { + secs += time2.tv_nsec / 1000000000.0; + secs += (1000000000.0 - time1.tv_nsec) / 1000000000.0; + } + ErrorF("agp: Memory benchmark %f MB/s\n", mb / secs); + free(tmp); +} + Bool BladeExaInit(ScreenPtr pScreen) { ExaDriverPtr ExaDriver; @@ -288,6 +689,16 @@ if (pTrident->NoAccel) return FALSE; + /* We need DRM for UTS/DTS */ + if (!BladeInitDRM(pScrn)) { + ErrorF("Blade DRM initialization failed.\n"); + return FALSE; + } + + /* AGP isn't strictly necessary though it's awfully nice */ + if (!BladeInitAGP(pScrn)) + ErrorF("Blade AGP initialization failed.\n"); + ExaDriver = xnfcalloc(sizeof(ExaDriverRec), 1); if (!ExaDriver) { pTrident->NoAccel = TRUE; @@ -296,6 +707,9 @@ pTrident->InitializeAccelerator = BladeInitializeAccelerator; BladeInitializeAccelerator(pScrn); +#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2) + /* This keeps us from getting either -xdir,+ydir or +xdir,-ydir blts */ + ExaDriver->card.flags = EXA_TWO_BITBLT_DIRECTIONS; ExaDriver->card.memoryBase = pTrident->FbBase; ExaDriver->card.memorySize = pScrn->videoRam * 1024; @@ -313,8 +727,8 @@ ExaDriver->card.pixmapOffsetAlign = 32; ExaDriver->card.pixmapPitchAlign = 32; - ExaDriver->card.maxX = 2047; - ExaDriver->card.maxY = 2047; + ExaDriver->card.maxX = 1023; + ExaDriver->card.maxY = 767; ExaDriver->accel.MarkSync = MarkSync; ExaDriver->accel.WaitMarker = WaitMarker; @@ -327,8 +741,15 @@ ExaDriver->accel.Copy = Copy; ExaDriver->accel.DoneCopy = DoneCopy; - /* Composite not done yet */ - + ExaDriver->accel.UploadToScreen = UploadToScreen; + ExaDriver->accel.DownloadFromScreen = DownloadFromScreen; +#if 0 + /* Basic Composite support */ + ExaDriver->accel.CheckComposite = CheckComposite; + ExaDriver->accel.PrepareComposite = PrepareComposite; + ExaDriver->accel.Composite = Composite; + ExaDriver->accel.DoneComposite = DoneComposite; +#endif pTrident->EXADriverPtr = ExaDriver; return exaDriverInit(pScreen, pTrident->EXADriverPtr); Index: src/trident.h =================================================================== RCS file: /cvs/xorg/driver/xf86-video-trident/src/trident.h,v retrieving revision 1.4 diff -u -r1.4 trident.h --- src/trident.h 21 Feb 2006 04:27:00 -0000 1.4 +++ src/trident.h 6 Mar 2006 04:37:27 -0000 @@ -27,6 +27,9 @@ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ +#ifdef XF86DRI +#include "xf86drm.h" +#endif #include "exa.h" #include "xf86Cursor.h" #include "xaa.h" @@ -62,6 +65,14 @@ EntityInfoPtr pEnt; ExaDriverPtr EXADriverPtr; int useEXA; + int drm_fd; + drm_handle_t drm_agp_handle; + drm_handle_t drm_agp_map_handle; + unsigned long agpSize; + unsigned long agpMemory; + unsigned long agpPhysical; + PixmapPtr pMask; + PicturePtr pSrc; int Chipset; int DACtype; int RamDac; Index: src/trident_driver.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-trident/src/trident_driver.c,v retrieving revision 1.15 diff -u -r1.15 trident_driver.c --- src/trident_driver.c 21 Feb 2006 04:27:00 -0000 1.15 +++ src/trident_driver.c 6 Mar 2006 04:37:30 -0000 @@ -569,6 +569,35 @@ NULL }; +#ifdef XF86DRI +static const char *drmSymbols[] = { + "drmOpen", + "drmAddBufs", + "drmAddMap", + "drmAgpAcquire", + "drmAgpVersionMajor", + "drmAgpVersionMinor", + "drmAgpAlloc", + "drmAgpBind", + "drmAgpEnable", + "drmAgpFree", + "drmAgpRelease", + "drmAgpUnbind", + "drmAuthMagic", + "drmCommandNone", + "drmCommandWrite", + "drmCreateContext", + "drmCtlInstHandler", + "drmCtlUninstHandler", + "drmDestroyContext", + "drmFreeVersion", + "drmGetInterruptFromBusID", + "drmGetLibVersion", + "drmGetVersion", + NULL +}; +#endif + #ifdef XFree86LOADER static MODULESETUPPROTO(tridentSetup); @@ -603,6 +632,9 @@ xf86AddDriver(&TRIDENT, module, 0); LoaderRefSymLists(vgahwSymbols, fbSymbols, i2cSymbols, vbeSymbols, ramdacSymbols, int10Symbols, +#ifdef XF86DRI + drmSymbols, +#endif xaaSymbols, exaSymbols, shadowSymbols, NULL); return (pointer)TRUE; } @@ -2461,7 +2493,9 @@ } if (pTrident->useEXA) { - if (!xf86LoadSubModule(pScrn, "exa")) { + if (!xf86LoadSubModule(pScrn, "exa") || + !xf86LoadSubModule(pScrn, "drm")) { + ErrorF("Failed to load EXA or DRM modules\n"); if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); TRIDENTUnmapMem(pScrn); @@ -2470,6 +2504,7 @@ return FALSE; } xf86LoaderReqSymLists(exaSymbols, NULL); + xf86LoaderReqSymLists(drmSymbols, NULL); } switch (pScrn->displayWidth * pScrn->bitsPerPixel / 8) { Index: src/trident_regs.h =================================================================== RCS file: /cvs/xorg/driver/xf86-video-trident/src/trident_regs.h,v retrieving revision 1.3 diff -u -r1.3 trident_regs.h --- src/trident_regs.h 21 Feb 2006 04:27:00 -0000 1.3 +++ src/trident_regs.h 6 Mar 2006 04:37:30 -0000 @@ -251,6 +251,18 @@ #define GER_SRCBASE2 0x21D0 #define GER_SRCBASE3 0x21C4 +/* Cyberblade bus master regs */ +#define GBM_STATUS 0x2204 +#define GBM_STATUS_IDLE (1 << 1) +#define GBM_CTL 0x2300 +#define GBM_READ (1 << 1) +#define GBM_WRITE (1 << 2) +#define GBM_SYSTEM_ADDR 0x2310 +#define GBM_SRC_HEIGHT 0x2314 +#define GBM_SRC_WIDTH 0x2316 +#define GBM_FB_PITCH_ADDR 0x2318 +#define GBM_SYSTEM_PITCH 0x231C + /* Wait for VSync */ #define WAITFORVSYNC \ { \