📄 gamma_macros.h
字号:
dma.send_list = NULL; \ dma.send_sizes = NULL; \ dma.flags = GAMMA_DMA_GET_FLAGS; \ dma.request_count = (n); \ dma.request_size = GAMMA_DMA_BUFFER_SIZE; \ dma.request_list = (idx); \ dma.request_sizes = (size); \ \ do { \ if ((retcode = drmDMA((fd), &dma))) { \ DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \ } \ } while (!(dma).granted_count); \ \ for (i = 0; i < (n); i++) { \ (size)[i] >>= 2; /* Convert from bytes to words */ \ } \} while (0)#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \do { \ drmDMAReq dma; \ int retcode, i; \ \ for (i = 0; i < (n); i++) { \ (cnt)[i] <<= 2; /* Convert from words to bytes */ \ } \ \ dma.context = (hHWCtx); \ dma.send_count = 1; \ dma.send_list = (idx); \ dma.send_sizes = (cnt); \ dma.flags = GAMMA_DMA_SEND_FLAGS; \ dma.request_count = 0; \ dma.request_size = 0; \ dma.request_list = NULL; \ dma.request_sizes = NULL; \ \ if ((retcode = drmDMA((fd), &dma))) { \ DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \ } \ \ for (i = 0; i < (n); i++) { \ (cnt)[i] = 0; \ } \} while (0)#endif#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, gPriv) \do { \ int i; \ \ GET_DMA(fd, hHWCtx, n, idx, size); \ \ for (i = 0; i < (n); i++) { \ (buf)[i] = (dmaBuf)(gPriv)->bufs->list[(idx)[i]].address; \ (cnt)[i] = 0; \ } \} while (0)#define PROCESS_DMA_BUFFER_TOP_HALF(gcp) \do { \ SEND_DMA((gcp)->driFd, \ (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufCount); \} while (0)#define PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp) \do { \ GET_DMA((gcp)->driFd, \ (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufSize); \ \ (gcp)->buf = \ (dmaBuf)(gcp)->gammaScreen->bufs->list[(gcp)->bufIndex].address; \} while (0)#define PROCESS_DMA_BUFFER(gcp) \do { \ VALIDATE_DRAWABLE_INFO(gcp); \ PROCESS_DMA_BUFFER_TOP_HALF(gcp); \ PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp); \} while (0)#ifdef DO_VALIDATE#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \do { \ /*__DRIscreenPrivate *psp = gcp->driScreen;*/ \ __DRIdrawablePrivate *pdp = gcp->driDrawable; \ \ if (*(pdp->pStamp) != pdp->lastStamp) { \ int old_index = pdp->index; \ while (*(pdp->pStamp) != pdp->lastStamp) { \ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ } \ if (pdp->index != old_index) { \ gcp->Window &= ~W_GIDMask; \ gcp->Window |= (pdp->index << 5); \ CHECK_WC_DMA_BUFFER(gcp, 1); \ WRITE(gcp->WCbuf, GLINTWindow, gcp->Window|(gcp->FrameCount<<9));\ } \ \ gammaUpdateViewportOffset( gcp->glCtx); \ \ if (pdp->numClipRects == 1 && \ pdp->pClipRects->x1 == pdp->x && \ pdp->pClipRects->x2 == (pdp->x+pdp->w) && \ pdp->pClipRects->y1 == pdp->y && \ pdp->pClipRects->y2 == (pdp->y+pdp->h)) { \ CHECK_WC_DMA_BUFFER(gcp, 1); \ WRITE(gcp->WCbuf, Rectangle2DControl, 0); \ gcp->NotClipped = GL_TRUE; \ } else { \ CHECK_WC_DMA_BUFFER(gcp, 1); \ WRITE(gcp->WCbuf, Rectangle2DControl, 1); \ gcp->NotClipped = GL_FALSE; \ } \ gcp->WindowChanged = GL_TRUE; \ \ if (gcp->WCbufCount) { \ SEND_DMA((gcp)->gammaScreen->driScreen->fd, \ (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \ &(gcp)->WCbufCount); \ (gcp)->WCbufIndex = -1; \ } \ } \} while (0)#define VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp) \do { \ if ((gcp)->WCbufIndex < 0) { \ GET_DMA((gcp)->gammaScreen->driScreen->fd, \ (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \ &(gcp)->WCbufSize); \ \ (gcp)->WCbuf = \ (dmaBuf)(gcp)->gammaScreen->bufs-> \ list[(gcp)->WCbufIndex].address; \ } \} while (0)#define VALIDATE_DRAWABLE_INFO(gcp) \do { \ __DRIscreenPrivate *psp = gcp->driScreen; \if (gcp->driDrawable) { \ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp); \ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp); \} \} while (0)#else#define VALIDATE_DRAWABLE_INFO(gcp)#endif#define CALC_LOG2(l2,s) \do { \ int __s = s; \ l2 = 0; \ while (__s > 1) { ++l2; __s >>= 1; } \} while (0)#endif /* _GAMMA_MACROS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -