Lines Matching refs:pDRIPriv
284 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in dri_crtc_notify() local
287 xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); in dri_crtc_notify()
289 pDRIPriv->xf86_crtc_notify = in dri_crtc_notify()
358 DRIScreenPrivPtr pDRIPriv; in DRIScreenInit() local
411 pDRIPriv = (DRIScreenPrivPtr) calloc(1, sizeof(DRIScreenPrivRec)); in DRIScreenInit()
412 if (!pDRIPriv) { in DRIScreenInit()
417 dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, pDRIPriv); in DRIScreenInit()
418 pDRIPriv->drmFD = pDRIEntPriv->drmFD; in DRIScreenInit()
419 pDRIPriv->directRenderingSupport = TRUE; in DRIScreenInit()
420 pDRIPriv->pDriverInfo = pDRIInfo; in DRIScreenInit()
421 pDRIPriv->nrWindows = 0; in DRIScreenInit()
422 pDRIPriv->nrWindowsVisible = 0; in DRIScreenInit()
423 pDRIPriv->fullscreen = NULL; in DRIScreenInit()
425 pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx; in DRIScreenInit()
426 pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv; in DRIScreenInit()
428 pDRIPriv->grabbedDRILock = FALSE; in DRIScreenInit()
429 pDRIPriv->drmSIGIOHandlerInstalled = FALSE; in DRIScreenInit()
430 *pDRMFD = pDRIPriv->drmFD; in DRIScreenInit()
434 if (drmAddMap(pDRIPriv->drmFD, in DRIScreenInit()
436 pDRIPriv->pDriverInfo->SAREASize, in DRIScreenInit()
437 DRM_SHM, 0, &pDRIPriv->hSAREA) < 0) { in DRIScreenInit()
438 pDRIPriv->directRenderingSupport = FALSE; in DRIScreenInit()
440 drmClose(pDRIPriv->drmFD); in DRIScreenInit()
446 (int) pDRIPriv->pDriverInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA); in DRIScreenInit()
449 if (drmMap(pDRIPriv->drmFD, in DRIScreenInit()
450 pDRIPriv->hSAREA, in DRIScreenInit()
451 pDRIPriv->pDriverInfo->SAREASize, in DRIScreenInit()
452 (drmAddressPtr) (&pDRIPriv->pSAREA)) < 0) { in DRIScreenInit()
453 pDRIPriv->directRenderingSupport = FALSE; in DRIScreenInit()
455 drmClose(pDRIPriv->drmFD); in DRIScreenInit()
460 (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); in DRIScreenInit()
461 memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); in DRIScreenInit()
466 pDRIPriv->hSAREA = pDRIEntPriv->hLSAREA; in DRIScreenInit()
467 pDRIPriv->pSAREA = (XF86DRISAREAPtr) pDRIEntPriv->pLSAREA; in DRIScreenInit()
471 pDRIPriv->hLSAREA = pDRIEntPriv->hLSAREA; in DRIScreenInit()
472 pDRIPriv->pLSAREA = pDRIEntPriv->pLSAREA; in DRIScreenInit()
474 if (!pDRIPriv->pDriverInfo->dontMapFrameBuffer) { in DRIScreenInit()
475 if (drmAddMap(pDRIPriv->drmFD, in DRIScreenInit()
476 (uintptr_t) pDRIPriv->pDriverInfo-> in DRIScreenInit()
478 pDRIPriv->pDriverInfo->frameBufferSize, DRM_FRAME_BUFFER, in DRIScreenInit()
479 0, &pDRIPriv->pDriverInfo->hFrameBuffer) < 0) { in DRIScreenInit()
480 pDRIPriv->directRenderingSupport = FALSE; in DRIScreenInit()
482 drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); in DRIScreenInit()
483 drmClose(pDRIPriv->drmFD); in DRIScreenInit()
488 (void *) (uintptr_t) pDRIPriv->pDriverInfo->hFrameBuffer); in DRIScreenInit()
499 if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, in DRIScreenInit()
508 drmAddContextTag(pDRIPriv->drmFD, reserved[r], tag); in DRIScreenInit()
518 if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) || in DRIScreenInit()
519 (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) { in DRIScreenInit()
522 pDRIPriv->pDriverInfo->maxDrawableTableEntry); in DRIScreenInit()
526 for (i = 0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { in DRIScreenInit()
527 pDRIPriv->DRIDrawables[i] = NULL; in DRIScreenInit()
528 pDRIPriv->pSAREA->drawableTable[i].stamp = 0; in DRIScreenInit()
529 pDRIPriv->pSAREA->drawableTable[i].flags = 0; in DRIScreenInit()
532 pDRIPriv->pLockRefCount = &pDRIEntPriv->lockRefCount; in DRIScreenInit()
533 pDRIPriv->pLockingContext = &pDRIEntPriv->lockingContext; in DRIScreenInit()
551 &pDRIPriv->myContext, in DRIScreenInit()
556 pDRIPriv->myContextPriv = pDRIContextPriv; in DRIScreenInit()
559 "X context handle = %p\n", (void *) (uintptr_t) pDRIPriv->myContext); in DRIScreenInit()
565 pDRIPriv->grabbedDRILock = TRUE; in DRIScreenInit()
568 pDRIPriv->hiddenContextStore = NULL; in DRIScreenInit()
569 pDRIPriv->partial3DContextStore = NULL; in DRIScreenInit()
578 pDRIPriv->hiddenContextStore in DRIScreenInit()
580 if (!pDRIPriv->hiddenContextStore) { in DRIScreenInit()
588 pDRIPriv->partial3DContextStore in DRIScreenInit()
590 if (!pDRIPriv->partial3DContextStore) { in DRIScreenInit()
593 free(pDRIPriv->hiddenContextStore); in DRIScreenInit()
603 pDRIPriv->hiddenContextStore, in DRIScreenInit()
612 if (!(pDRIPriv->drmSIGIOHandlerInstalled = in DRIScreenInit()
613 drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) { in DRIScreenInit()
616 free(pDRIPriv->hiddenContextStore); in DRIScreenInit()
617 free(pDRIPriv->partial3DContextStore); in DRIScreenInit()
636 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIFinishScreenInit() local
637 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRIFinishScreenInit()
641 pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; in DRIFinishScreenInit()
645 pDRIPriv->DestroyWindow = pScreen->DestroyWindow; in DRIFinishScreenInit()
648 pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, in DRIFinishScreenInit()
652 pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; in DRIFinishScreenInit()
656 pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; in DRIFinishScreenInit()
662 pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; in DRIFinishScreenInit()
665 pDRIPriv->wrapped = TRUE; in DRIFinishScreenInit()
675 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICloseScreen() local
683 if (pDRIPriv) { in DRICloseScreen()
685 pDRIInfo = pDRIPriv->pDriverInfo; in DRICloseScreen()
687 if (pDRIPriv->wrapped) { in DRICloseScreen()
690 pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; in DRICloseScreen()
691 pDRIPriv->wrap.WindowExposures = NULL; in DRICloseScreen()
693 if (pDRIPriv->DestroyWindow) { in DRICloseScreen()
694 pScreen->DestroyWindow = pDRIPriv->DestroyWindow; in DRICloseScreen()
695 pDRIPriv->DestroyWindow = NULL; in DRICloseScreen()
698 xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); in DRICloseScreen()
701 pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; in DRICloseScreen()
702 pDRIPriv->wrap.CopyWindow = NULL; in DRICloseScreen()
705 pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; in DRICloseScreen()
706 pDRIPriv->wrap.ClipNotify = NULL; in DRICloseScreen()
711 scrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; in DRICloseScreen()
712 pDRIPriv->wrap.AdjustFrame = NULL; in DRICloseScreen()
715 pDRIPriv->wrapped = FALSE; in DRICloseScreen()
718 if (pDRIPriv->drmSIGIOHandlerInstalled) { in DRICloseScreen()
719 if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) { in DRICloseScreen()
725 if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) { in DRICloseScreen()
726 DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv); in DRICloseScreen()
729 if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) { in DRICloseScreen()
738 if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, in DRICloseScreen()
743 DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, in DRICloseScreen()
754 drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); in DRICloseScreen()
755 pDRIPriv->pLockRefCount = NULL; in DRICloseScreen()
758 if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) { in DRICloseScreen()
761 … (int) pDRIInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); in DRICloseScreen()
762 if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { in DRICloseScreen()
767 (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); in DRICloseScreen()
774 if (closeMaster || (pDRIEntPriv->drmFD != pDRIPriv->drmFD)) { in DRICloseScreen()
775 drmClose(pDRIPriv->drmFD); in DRICloseScreen()
776 if (pDRIEntPriv->drmFD == pDRIPriv->drmFD) { in DRICloseScreen()
782 free(pDRIPriv); in DRICloseScreen()
848 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIQueryDirectRenderingCapable() local
850 if (pDRIPriv) in DRIQueryDirectRenderingCapable()
851 *isCapable = pDRIPriv->directRenderingSupport; in DRIQueryDirectRenderingCapable()
861 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIOpenConnection() local
863 *hSAREA = pDRIPriv->hSAREA; in DRIOpenConnection()
864 *busIdString = pDRIPriv->pDriverInfo->busIdString; in DRIOpenConnection()
872 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIAuthConnection() local
874 if (drmAuthMagic(pDRIPriv->drmFD, magic)) in DRIAuthConnection()
891 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetClientDriverName() local
893 *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion; in DRIGetClientDriverName()
894 *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion; in DRIGetClientDriverName()
895 *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion; in DRIGetClientDriverName()
896 *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName; in DRIGetClientDriverName()
917 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICreateContextPriv() local
919 if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) { in DRICreateContextPriv()
930 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICreateContextPrivFromHandle() local
935 pDRIPriv->pDriverInfo->contextSize; in DRICreateContextPrivFromHandle()
941 drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv); in DRICreateContextPrivFromHandle()
949 if (drmSetContextFlags(pDRIPriv->drmFD, hHWContext, DRM_CONTEXT_2DONLY)) { in DRICreateContextPrivFromHandle()
957 if (drmSetContextFlags(pDRIPriv->drmFD, in DRICreateContextPrivFromHandle()
971 DRIScreenPrivPtr pDRIPriv; in DRIDestroyContextPriv() local
976 pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); in DRIDestroyContextPriv()
982 if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext)) in DRIDestroyContextPriv()
991 drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext); in DRIDestroyContextPriv()
999 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICreateDummyContext() local
1004 DRICreateContextPriv(pScreen, &pDRIPriv->pSAREA->dummy_context, 0))) { in DRICreateDummyContext()
1009 if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { in DRICreateDummyContext()
1010 if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, NULL, in DRICreateDummyContext()
1011 pDRIPriv->pSAREA-> in DRICreateDummyContext()
1020 pDRIPriv->dummyCtxPriv = pDRIContextPriv; in DRICreateDummyContext()
1027 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDestroyDummyContext() local
1028 DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv; in DRIDestroyDummyContext()
1033 if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) { in DRIDestroyDummyContext()
1035 pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, in DRIDestroyDummyContext()
1041 DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv); in DRIDestroyDummyContext()
1042 pDRIPriv->dummyCtxPriv = NULL; in DRIDestroyDummyContext()
1049 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICreateContext() local
1053 if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) { in DRICreateContext()
1054 if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) { in DRICreateContext()
1066 if (pDRIPriv->pDriverInfo->CreateContext) { in DRICreateContext()
1067 if (!((*pDRIPriv->pDriverInfo->CreateContext) (pScreen, NULL, in DRICreateContext()
1096 DRIScreenPrivPtr pDRIPriv; in DRIContextPrivDelete() local
1099 pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); in DRIContextPrivDelete()
1100 if (pDRIPriv->pDriverInfo->DestroyContext) { in DRIContextPrivDelete()
1102 pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, in DRIContextPrivDelete()
1120 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIClipNotifyAllDrawables() local
1122 for (i = 0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { in DRIClipNotifyAllDrawables()
1123 pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; in DRIClipNotifyAllDrawables()
1130 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRITransitionToSharedBuffers() local
1131 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRITransitionToSharedBuffers()
1142 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRITransitionToPrivateBuffers() local
1143 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRITransitionToPrivateBuffers()
1154 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRITransitionTo3d() local
1155 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRITransitionTo3d()
1166 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRITransitionTo2d() local
1167 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRITransitionTo2d()
1182 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDCNTreeTraversal() local
1193 pDRIPriv->nrWalked++; in DRIDCNTreeTraversal()
1196 if (pDRIPriv->nrWindows == pDRIPriv->nrWalked) in DRIDCNTreeTraversal()
1206 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDriverClipNotify() local
1208 if (pDRIPriv->pDriverInfo->ClipNotify) { in DRIDriverClipNotify()
1209 WindowPtr *pDRIWindows = calloc(sizeof(WindowPtr), pDRIPriv->nrWindows); in DRIDriverClipNotify()
1210 DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; in DRIDriverClipNotify()
1212 if (pDRIPriv->nrWindows > 0) { in DRIDriverClipNotify()
1213 pDRIPriv->nrWalked = 0; in DRIDriverClipNotify()
1218 pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); in DRIDriverClipNotify()
1227 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIIncreaseNumberVisible() local
1229 switch (++pDRIPriv->nrWindowsVisible) { in DRIIncreaseNumberVisible()
1246 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDecreaseNumberVisible() local
1248 switch (--pDRIPriv->nrWindowsVisible) { in DRIDecreaseNumberVisible()
1266 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICreateDrawable() local
1276 drmCreateDrawable(pDRIPriv->drmFD, in DRICreateDrawable()
1287 if (drmCreateDrawable(pDRIPriv->drmFD, in DRICreateDrawable()
1302 pDRIPriv->nrWindows++; in DRICreateDrawable()
1314 drmUpdateDrawableInfo(pDRIPriv->drmFD, in DRICreateDrawable()
1335 DRIScreenPrivPtr pDRIPriv; in DRIDrawablePrivDestroy() local
1341 pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDrawablePrivDestroy()
1345 pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp in DRIDrawablePrivDestroy()
1349 pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; in DRIDrawablePrivDestroy()
1352 pDRIPriv->nrWindows--; in DRIDrawablePrivDestroy()
1357 drmDestroyDrawable(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable); in DRIDrawablePrivDestroy()
1435 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetDrawableInfo() local
1442 pDRIPriv->pDriverInfo->maxDrawableTableEntry); in DRIGetDrawableInfo()
1454 while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) { in DRIGetDrawableInfo()
1455 if (!(pDRIPriv->DRIDrawables[i])) { in DRIGetDrawableInfo()
1456 pDRIPriv->DRIDrawables[i] = pDrawable; in DRIGetDrawableInfo()
1458 pDRIPriv->pSAREA->drawableTable[i].stamp = in DRIGetDrawableInfo()
1466 if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) { in DRIGetDrawableInfo()
1470 i = pDRIPriv->pDriverInfo->maxDrawableTableEntry; in DRIGetDrawableInfo()
1472 if (pDRIPriv->pSAREA->drawableTable[i].stamp < in DRIGetDrawableInfo()
1476 pDRIPriv->pSAREA->drawableTable[i].stamp; in DRIGetDrawableInfo()
1482 pOldWin = (WindowPtr) pDRIPriv->DRIDrawables[oldestIndex]; in DRIGetDrawableInfo()
1487 pDRIPriv->DRIDrawables[oldestIndex] = pDrawable; in DRIGetDrawableInfo()
1490 pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp = in DRIGetDrawableInfo()
1498 i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; in DRIGetDrawableInfo()
1500 pDRIPriv->pSAREA->drawableTable[i].stamp = in DRIGetDrawableInfo()
1509 if (pDRIPriv->pDriverInfo->SetDrawableIndex) in DRIGetDrawableInfo()
1510 pDRIPriv->pDriverInfo->SetDrawableIndex(pWin, in DRIGetDrawableInfo()
1516 (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS)) { in DRIGetDrawableInfo()
1517 (*pDRIPriv->pDriverInfo->InitBuffers) (pWin, in DRIGetDrawableInfo()
1525 *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; in DRIGetDrawableInfo()
1533 if (!*numClipRects && pDRIPriv->fullscreen) { in DRIGetDrawableInfo()
1535 pDRIPriv->fullscreen_rect.x1 = *X; in DRIGetDrawableInfo()
1536 pDRIPriv->fullscreen_rect.y1 = *Y; in DRIGetDrawableInfo()
1537 pDRIPriv->fullscreen_rect.x2 = *X + *W; in DRIGetDrawableInfo()
1538 pDRIPriv->fullscreen_rect.y2 = *Y + *H; in DRIGetDrawableInfo()
1541 *pClipRects = &pDRIPriv->fullscreen_rect; in DRIGetDrawableInfo()
1547 if (pDRIPriv->nrWindowsVisible == 1 && *numClipRects) { in DRIGetDrawableInfo()
1569 pDRIPriv->private_buffer_rect.x1 = x0; in DRIGetDrawableInfo()
1570 pDRIPriv->private_buffer_rect.y1 = y0; in DRIGetDrawableInfo()
1571 pDRIPriv->private_buffer_rect.x2 = x1; in DRIGetDrawableInfo()
1572 pDRIPriv->private_buffer_rect.y2 = y1; in DRIGetDrawableInfo()
1575 *pBackClipRects = &(pDRIPriv->private_buffer_rect); in DRIGetDrawableInfo()
1604 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetDeviceInfo() local
1606 *hFrameBuffer = pDRIPriv->pDriverInfo->hFrameBuffer; in DRIGetDeviceInfo()
1608 *fbSize = pDRIPriv->pDriverInfo->frameBufferSize; in DRIGetDeviceInfo()
1609 *fbStride = pDRIPriv->pDriverInfo->frameBufferStride; in DRIGetDeviceInfo()
1610 *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize; in DRIGetDeviceInfo()
1611 *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate; in DRIGetDeviceInfo()
1656 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIWakeupHandler() local
1658 if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) in DRIWakeupHandler()
1659 (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result); in DRIWakeupHandler()
1670 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIBlockHandler() local
1672 if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) in DRIBlockHandler()
1673 (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout); in DRIBlockHandler()
1680 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDoWakeupHandler() local
1683 if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { in DRIDoWakeupHandler()
1685 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRIDoWakeupHandler()
1688 pDRIPriv->partial3DContextStore, in DRIDoWakeupHandler()
1690 pDRIPriv->hiddenContextStore); in DRIDoWakeupHandler()
1697 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDoBlockHandler() local
1699 if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { in DRIDoBlockHandler()
1701 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRIDoBlockHandler()
1706 pDRIPriv->partial3DContextStore); in DRIDoBlockHandler()
1709 if (pDRIPriv->windowsTouched) in DRIDoBlockHandler()
1710 DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); in DRIDoBlockHandler()
1711 pDRIPriv->windowsTouched = FALSE; in DRIDoBlockHandler()
1722 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRISwapContext() local
1757 if (!pDRIPriv->pDriverInfo->SwapContext) { in DRISwapContext()
1763 if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { in DRISwapContext()
1776 (newContext->hwContext != pDRIPriv->myContext)) { in DRISwapContext()
1797 pDRIPriv->lastPartial3DContext = oldContext; in DRISwapContext()
1800 if (pDRIPriv->lastPartial3DContext == newContext) { in DRISwapContext()
1816 DRIGetContextStore(pDRIPriv->lastPartial3DContext); in DRISwapContext()
1817 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRISwapContext()
1830 (newContext->hwContext != pDRIPriv->myContext)) { in DRISwapContext()
1846 (newContext->hwContext != pDRIPriv->myContext)) { in DRISwapContext()
1857 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRISwapContext()
1874 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIWindowExposures() local
1878 (*pDRIPriv->pDriverInfo->InitBuffers) (pWin, prgn, in DRIWindowExposures()
1883 if (pDRIPriv && pDRIPriv->wrap.WindowExposures) { in DRIWindowExposures()
1886 pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; in DRIWindowExposures()
1892 pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; in DRIWindowExposures()
1904 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRITreeTraversal() local
1910 pDRIPriv->nrWalked++; in DRITreeTraversal()
1913 if (pDRIPriv->nrWindows == pDRIPriv->nrWalked) in DRITreeTraversal()
1923 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIDestroyWindow() local
1929 if (pDRIPriv->DestroyWindow) { in DRIDestroyWindow()
1931 pScreen->DestroyWindow = pDRIPriv->DestroyWindow; in DRIDestroyWindow()
1937 pDRIPriv->DestroyWindow = pScreen->DestroyWindow; in DRIDestroyWindow()
1948 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRICopyWindow() local
1950 if (!pDRIPriv) in DRICopyWindow()
1953 if (pDRIPriv->nrWindowsVisible > 0) { in DRICopyWindow()
1957 pDRIPriv->nrWalked = 0; in DRICopyWindow()
1966 (*pDRIPriv->pDriverInfo->MoveBuffers) (pWin, ptOldOrg, ®, in DRICopyWindow()
1967 pDRIPriv->pDriverInfo-> in DRICopyWindow()
1975 if (pDRIPriv->wrap.CopyWindow) { in DRICopyWindow()
1977 pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; in DRICopyWindow()
1983 pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; in DRICopyWindow()
2050 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRILockTree() local
2052 if (!pDRIPriv) in DRILockTree()
2056 if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { in DRILockTree()
2057 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRILockTree()
2062 pDRIPriv->partial3DContextStore); in DRILockTree()
2072 DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs */ in DRILockTree()
2078 if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { in DRILockTree()
2080 (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, in DRILockTree()
2083 pDRIPriv->partial3DContextStore, in DRILockTree()
2085 pDRIPriv->hiddenContextStore); in DRILockTree()
2093 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIClipNotify() local
2096 if (!pDRIPriv) in DRIClipNotify()
2102 if (!pDRIPriv->windowsTouched) { in DRIClipNotify()
2104 pDRIPriv->windowsTouched = TRUE; in DRIClipNotify()
2116 pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp in DRIClipNotify()
2119 drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, in DRIClipNotify()
2125 if (pDRIPriv->wrap.ClipNotify) { in DRIClipNotify()
2128 pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; in DRIClipNotify()
2134 pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; in DRIClipNotify()
2143 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetDrawableIndex() local
2151 index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry; in DRIGetDrawableIndex()
2160 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetDrawableStamp() local
2162 return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp; in DRIGetDrawableStamp()
2168 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIPrintDrawableLock() local
2170 ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock); in DRIPrintDrawableLock()
2176 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRILock() local
2178 if (!pDRIPriv || !pDRIPriv->pLockRefCount) in DRILock()
2181 if (!*pDRIPriv->pLockRefCount) { in DRILock()
2182 DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext, in DRILock()
2184 *pDRIPriv->pLockingContext = pDRIPriv->myContext; in DRILock()
2186 else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) { in DRILock()
2191 pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); in DRILock()
2193 (*pDRIPriv->pLockRefCount)++; in DRILock()
2199 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIUnlock() local
2201 if (!pDRIPriv || !pDRIPriv->pLockRefCount) in DRIUnlock()
2204 if (*pDRIPriv->pLockRefCount > 0) { in DRIUnlock()
2205 if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) { in DRIUnlock()
2209 pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); in DRIUnlock()
2211 (*pDRIPriv->pLockRefCount)--; in DRIUnlock()
2218 if (!*pDRIPriv->pLockRefCount) in DRIUnlock()
2219 DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext); in DRIUnlock()
2225 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetSAREAPrivate() local
2227 if (!pDRIPriv) in DRIGetSAREAPrivate()
2230 return (void *) (((char *) pDRIPriv->pSAREA) + sizeof(XF86DRISAREARec)); in DRIGetSAREAPrivate()
2236 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetContext() local
2238 if (!pDRIPriv) in DRIGetContext()
2241 return pDRIPriv->myContext; in DRIGetContext()
2249 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIGetTexOffsetFuncs() local
2251 if (!pDRIPriv) in DRIGetTexOffsetFuncs()
2254 *texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart; in DRIGetTexOffsetFuncs()
2255 *texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish; in DRIGetTexOffsetFuncs()
2278 _DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) in _DRIAdjustFrame() argument
2280 pDRIPriv->pSAREA->frame.x = x; in _DRIAdjustFrame()
2281 pDRIPriv->pSAREA->frame.y = y; in _DRIAdjustFrame()
2282 pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1; in _DRIAdjustFrame()
2283 pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1; in _DRIAdjustFrame()
2290 DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); in DRIAdjustFrame() local
2293 if (!pDRIPriv || !pDRIPriv->pSAREA) { in DRIAdjustFrame()
2295 pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); in DRIAdjustFrame()
2299 if (pDRIPriv->fullscreen) { in DRIAdjustFrame()
2301 pScrn->frameX0 = pDRIPriv->pSAREA->frame.x; in DRIAdjustFrame()
2302 pScrn->frameY0 = pDRIPriv->pSAREA->frame.y; in DRIAdjustFrame()
2303 pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1; in DRIAdjustFrame()
2304 pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1; in DRIAdjustFrame()
2322 if (pDRIPriv->wrap.AdjustFrame) { in DRIAdjustFrame()
2324 pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; in DRIAdjustFrame()
2328 pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; in DRIAdjustFrame()
2332 _DRIAdjustFrame(pScrn, pDRIPriv, x, y); in DRIAdjustFrame()