Lines Matching refs:pPriv

158 dri2WakeAll(ClientPtr client, DRI2DrawablePtr pPriv, enum DRI2WakeType t)  in dri2WakeAll()  argument
162 if (!pPriv->blocked[t]) in dri2WakeAll()
165 count = ClientSignalAll(client, dri2WakeClient, Wake(pPriv, t)); in dri2WakeAll()
166 pPriv->blocked[t] -= count; in dri2WakeAll()
171 dri2Sleep(ClientPtr client, DRI2DrawablePtr pPriv, enum DRI2WakeType t) in dri2Sleep() argument
173 if (ClientSleep(client, dri2WakeClient, Wake(pPriv, t))) { in dri2Sleep()
174 pPriv->blocked[t]++; in dri2Sleep()
238 DRI2DrawablePtr pPriv; in DRI2AllocateDrawable() local
243 pPriv = malloc(sizeof *pPriv); in DRI2AllocateDrawable()
244 if (pPriv == NULL) in DRI2AllocateDrawable()
247 pPriv->dri2_screen = ds; in DRI2AllocateDrawable()
248 pPriv->drawable = pDraw; in DRI2AllocateDrawable()
249 pPriv->width = pDraw->width; in DRI2AllocateDrawable()
250 pPriv->height = pDraw->height; in DRI2AllocateDrawable()
251 pPriv->buffers = NULL; in DRI2AllocateDrawable()
252 pPriv->bufferCount = 0; in DRI2AllocateDrawable()
253 pPriv->swapsPending = 0; in DRI2AllocateDrawable()
254 pPriv->swap_count = 0; in DRI2AllocateDrawable()
255 pPriv->target_sbc = -1; in DRI2AllocateDrawable()
256 pPriv->swap_interval = 1; in DRI2AllocateDrawable()
258 if (!ds->GetMSC || !(*ds->GetMSC) (pDraw, &ust, &pPriv->last_swap_target)) in DRI2AllocateDrawable()
259 pPriv->last_swap_target = 0; in DRI2AllocateDrawable()
261 memset(pPriv->blocked, 0, sizeof(pPriv->blocked)); in DRI2AllocateDrawable()
262 pPriv->swap_limit = 1; /* default to double buffering */ in DRI2AllocateDrawable()
263 pPriv->last_swap_msc = 0; in DRI2AllocateDrawable()
264 pPriv->last_swap_ust = 0; in DRI2AllocateDrawable()
265 xorg_list_init(&pPriv->reference_list); in DRI2AllocateDrawable()
266 pPriv->needInvalidate = FALSE; in DRI2AllocateDrawable()
267 pPriv->redirectpixmap = NULL; in DRI2AllocateDrawable()
268 pPriv->prime_slave_pixmap = NULL; in DRI2AllocateDrawable()
271 dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); in DRI2AllocateDrawable()
275 dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); in DRI2AllocateDrawable()
278 return pPriv; in DRI2AllocateDrawable()
284 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); in DRI2SwapLimit() local
287 if (!pPriv) in DRI2SwapLimit()
290 ds = pPriv->dri2_screen; in DRI2SwapLimit()
295 pPriv->swap_limit = swap_limit; in DRI2SwapLimit()
298 if (pPriv->swapsPending >= pPriv->swap_limit) in DRI2SwapLimit()
301 dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP); in DRI2SwapLimit()
314 DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id) in DRI2LookupDrawableRef() argument
318 xorg_list_for_each_entry(ref, &pPriv->reference_list, link) { in DRI2LookupDrawableRef()
327 DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, in DRI2AddDrawableRef() argument
336 if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) { in DRI2AddDrawableRef()
340 if (!DRI2LookupDrawableRef(pPriv, id)) in DRI2AddDrawableRef()
341 if (!AddResource(id, dri2DrawableRes, pPriv)) { in DRI2AddDrawableRef()
351 xorg_list_add(&ref->link, &pPriv->reference_list); in DRI2AddDrawableRef()
361 DRI2DrawablePtr pPriv; in DRI2CreateDrawable2() local
366 pPriv = DRI2GetDrawable(pDraw); in DRI2CreateDrawable2()
367 if (pPriv == NULL) in DRI2CreateDrawable2()
368 pPriv = DRI2AllocateDrawable(pDraw); in DRI2CreateDrawable2()
369 if (pPriv == NULL) in DRI2CreateDrawable2()
372 pPriv->prime_id = dri2_client->prime_id; in DRI2CreateDrawable2()
375 rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv); in DRI2CreateDrawable2()
395 DRI2DrawablePtr pPriv = p; in DRI2DrawableGone() local
402 xorg_list_for_each_entry_safe(ref, next, &pPriv->reference_list, link) { in DRI2DrawableGone()
407 if (!DRI2LookupDrawableRef(pPriv, ref->id)) in DRI2DrawableGone()
420 if (!xorg_list_is_empty(&pPriv->reference_list)) in DRI2DrawableGone()
423 pDraw = pPriv->drawable; in DRI2DrawableGone()
433 if (pPriv->prime_slave_pixmap) { in DRI2DrawableGone()
434 …(*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pi… in DRI2DrawableGone()
435 (*pPriv->prime_slave_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap); in DRI2DrawableGone()
438 if (pPriv->buffers != NULL) { in DRI2DrawableGone()
439 for (i = 0; i < pPriv->bufferCount; i++) in DRI2DrawableGone()
440 destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id); in DRI2DrawableGone()
442 free(pPriv->buffers); in DRI2DrawableGone()
445 if (pPriv->redirectpixmap) { in DRI2DrawableGone()
446 (*pDraw->pScreen->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE); in DRI2DrawableGone()
447 (*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap); in DRI2DrawableGone()
450 dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP); in DRI2DrawableGone()
451 dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_MSC); in DRI2DrawableGone()
452 dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SBC); in DRI2DrawableGone()
454 free(pPriv); in DRI2DrawableGone()
487 find_attachment(DRI2DrawablePtr pPriv, unsigned attachment) in find_attachment() argument
491 if (pPriv->buffers == NULL) { in find_attachment()
495 for (i = 0; i < pPriv->bufferCount; i++) { in find_attachment()
496 if ((pPriv->buffers[i] != NULL) in find_attachment()
497 && (pPriv->buffers[i]->attachment == attachment)) { in find_attachment()
507 DRI2DrawablePtr pPriv, in allocate_or_reuse_buffer() argument
511 int old_buf = find_attachment(pPriv, attachment); in allocate_or_reuse_buffer()
515 || !dimensions_match || (pPriv->buffers[old_buf]->format != format)) { in allocate_or_reuse_buffer()
521 *buffer = pPriv->buffers[old_buf]; in allocate_or_reuse_buffer()
526 pPriv->buffers[old_buf] = NULL; in allocate_or_reuse_buffer()
532 update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw, in update_dri2_drawable_buffers() argument
538 if (pPriv->buffers != NULL) { in update_dri2_drawable_buffers()
539 for (i = 0; i < pPriv->bufferCount; i++) { in update_dri2_drawable_buffers()
540 if (pPriv->buffers[i] != NULL) { in update_dri2_drawable_buffers()
541 destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id); in update_dri2_drawable_buffers()
545 free(pPriv->buffers); in update_dri2_drawable_buffers()
548 pPriv->buffers = buffers; in update_dri2_drawable_buffers()
549 pPriv->bufferCount = out_count; in update_dri2_drawable_buffers()
550 pPriv->width = pDraw->width; in update_dri2_drawable_buffers()
551 pPriv->height = pDraw->height; in update_dri2_drawable_buffers()
552 *width = pPriv->width; in update_dri2_drawable_buffers()
553 *height = pPriv->height; in update_dri2_drawable_buffers()
561 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); in do_get_buffers() local
572 if (!pPriv) { in do_get_buffers()
579 ds = DRI2GetScreenPrime(pDraw->pScreen, pPriv->prime_id); in do_get_buffers()
581 dimensions_match = (pDraw->width == pPriv->width) in do_get_buffers()
582 && (pDraw->height == pPriv->height); in do_get_buffers()
592 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment, in do_get_buffers()
627 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft, in do_get_buffers()
638 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft, in do_get_buffers()
652 update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, in do_get_buffers()
665 box.x2 = pPriv->width; in do_get_buffers()
666 box.y2 = pPriv->height; in do_get_buffers()
673 pPriv->needInvalidate = TRUE; in do_get_buffers()
675 return pPriv->buffers; in do_get_buffers()
691 update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, in do_get_buffers()
716 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); in DRI2InvalidateDrawable() local
719 if (!pPriv || !pPriv->needInvalidate) in DRI2InvalidateDrawable()
722 pPriv->needInvalidate = FALSE; in DRI2InvalidateDrawable()
724 xorg_list_for_each_entry(ref, &pPriv->reference_list, link) in DRI2InvalidateDrawable()
738 DRI2DrawablePtr pPriv; in DRI2ThrottleClient() local
740 pPriv = DRI2GetDrawable(pDraw); in DRI2ThrottleClient()
741 if (pPriv == NULL) in DRI2ThrottleClient()
745 if (pPriv->swapsPending >= pPriv->swap_limit) { in DRI2ThrottleClient()
746 if (dri2Sleep(client, pPriv, WAKE_SWAP)) { in DRI2ThrottleClient()
759 DRI2DrawablePtr pPriv; in DRI2BlockClient() local
761 pPriv = DRI2GetDrawable(pDraw); in DRI2BlockClient()
762 if (pPriv == NULL) in DRI2BlockClient()
765 dri2Sleep(client, pPriv, WAKE_MSC); in DRI2BlockClient()
818 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); in DRI2UpdatePrime() local
831 if (pPriv->redirectpixmap && in DRI2UpdatePrime()
832 pPriv->redirectpixmap->drawable.width == pDraw->width && in DRI2UpdatePrime()
833 pPriv->redirectpixmap->drawable.height == pDraw->height && in DRI2UpdatePrime()
834 pPriv->redirectpixmap->drawable.depth == pDraw->depth) { in DRI2UpdatePrime()
835 mpix = pPriv->redirectpixmap; in DRI2UpdatePrime()
848 pPriv->redirectpixmap = mpix; in DRI2UpdatePrime()
852 } else if (pPriv->redirectpixmap) { in DRI2UpdatePrime()
853 (*master->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE); in DRI2UpdatePrime()
854 (*master->DestroyPixmap)(pPriv->redirectpixmap); in DRI2UpdatePrime()
855 pPriv->redirectpixmap = NULL; in DRI2UpdatePrime()
859 slave = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); in DRI2UpdatePrime()
862 if (pPriv->prime_slave_pixmap) { in DRI2UpdatePrime()
863 if (pPriv->prime_slave_pixmap->master_pixmap == mpix) in DRI2UpdatePrime()
864 return &pPriv->prime_slave_pixmap->drawable; in DRI2UpdatePrime()
866 PixmapUnshareSlavePixmap(pPriv->prime_slave_pixmap); in DRI2UpdatePrime()
867 …(*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pi… in DRI2UpdatePrime()
868 (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap); in DRI2UpdatePrime()
869 pPriv->prime_slave_pixmap = NULL; in DRI2UpdatePrime()
877 pPriv->prime_slave_pixmap = spix; in DRI2UpdatePrime()
890 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); in dri2_copy_region() local
894 primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); in dri2_copy_region()
903 if (pPriv->prime_id) { in dri2_copy_region()
922 DRI2DrawablePtr pPriv; in DRI2CopyRegion() local
926 pPriv = DRI2GetDrawable(pDraw); in DRI2CopyRegion()
927 if (pPriv == NULL) in DRI2CopyRegion()
932 for (i = 0; i < pPriv->bufferCount; i++) { in DRI2CopyRegion()
933 if (pPriv->buffers[i]->attachment == dest) in DRI2CopyRegion()
934 pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; in DRI2CopyRegion()
935 if (pPriv->buffers[i]->attachment == src) in DRI2CopyRegion()
936 pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; in DRI2CopyRegion()
990 DRI2DrawablePtr pPriv; in DRI2WaitMSCComplete() local
992 pPriv = DRI2GetDrawable(pDraw); in DRI2WaitMSCComplete()
993 if (pPriv == NULL) in DRI2WaitMSCComplete()
997 frame, pPriv->swap_count); in DRI2WaitMSCComplete()
999 dri2WakeAll(client, pPriv, WAKE_MSC); in DRI2WaitMSCComplete()
1007 DRI2DrawablePtr pPriv; in DRI2WakeClient() local
1009 pPriv = DRI2GetDrawable(pDraw); in DRI2WakeClient()
1010 if (pPriv == NULL) { in DRI2WakeClient()
1024 if (pPriv->target_sbc != -1 && pPriv->target_sbc <= pPriv->swap_count) { in DRI2WakeClient()
1025 if (dri2WakeAll(client, pPriv, WAKE_SBC)) { in DRI2WakeClient()
1027 frame, pPriv->swap_count); in DRI2WakeClient()
1028 pPriv->target_sbc = -1; in DRI2WakeClient()
1032 dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP); in DRI2WakeClient()
1041 DRI2DrawablePtr pPriv; in DRI2SwapComplete() local
1046 pPriv = DRI2GetDrawable(pDraw); in DRI2SwapComplete()
1047 if (pPriv == NULL) { in DRI2SwapComplete()
1053 pPriv->swapsPending--; in DRI2SwapComplete()
1054 pPriv->swap_count++; in DRI2SwapComplete()
1066 swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count); in DRI2SwapComplete()
1068 pPriv->last_swap_msc = frame; in DRI2SwapComplete()
1069 pPriv->last_swap_ust = ust; in DRI2SwapComplete()
1077 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); in DRI2WaitSwap() local
1081 if (pPriv && pPriv->swapsPending) { in DRI2WaitSwap()
1082 if (dri2Sleep(client, pPriv, WAKE_SWAP)) { in DRI2WaitSwap()
1101 DRI2DrawablePtr pPriv; in DRI2SwapBuffers() local
1106 pPriv = DRI2GetDrawable(pDraw); in DRI2SwapBuffers()
1107 if (pPriv == NULL) { in DRI2SwapBuffers()
1119 *swap_target = pPriv->swap_count + pPriv->swapsPending + 1; in DRI2SwapBuffers()
1121 for (i = 0; i < pPriv->bufferCount; i++) { in DRI2SwapBuffers()
1122 if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft) in DRI2SwapBuffers()
1123 pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; in DRI2SwapBuffers()
1124 if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft) in DRI2SwapBuffers()
1125 pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; in DRI2SwapBuffers()
1134 if (!ds->ScheduleSwap || !pPriv->swap_interval || pPriv->prime_id) { in DRI2SwapBuffers()
1144 pPriv->swapsPending++; in DRI2SwapBuffers()
1166 pPriv->last_swap_target = 0; in DRI2SwapBuffers()
1168 if (current_msc < pPriv->last_swap_target) in DRI2SwapBuffers()
1169 pPriv->last_swap_target = current_msc; in DRI2SwapBuffers()
1178 target_msc = pPriv->last_swap_target + pPriv->swap_interval; in DRI2SwapBuffers()
1182 pPriv->swapsPending++; in DRI2SwapBuffers()
1186 pPriv->swapsPending--; /* didn't schedule */ in DRI2SwapBuffers()
1192 pPriv->last_swap_target = target_msc; in DRI2SwapBuffers()
1203 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); in DRI2SwapInterval() local
1205 if (pPriv == NULL) { in DRI2SwapInterval()
1212 pPriv->swap_interval = interval; in DRI2SwapInterval()
1220 DRI2DrawablePtr pPriv; in DRI2GetMSC() local
1223 pPriv = DRI2GetDrawable(pDraw); in DRI2GetMSC()
1224 if (pPriv == NULL) { in DRI2GetMSC()
1233 *sbc = pPriv->swap_count; in DRI2GetMSC()
1246 *sbc = pPriv->swap_count; in DRI2GetMSC()
1256 DRI2DrawablePtr pPriv; in DRI2WaitMSC() local
1259 pPriv = DRI2GetDrawable(pDraw); in DRI2WaitMSC()
1260 if (pPriv == NULL) in DRI2WaitMSC()
1281 DRI2DrawablePtr pPriv; in DRI2WaitSBC() local
1283 pPriv = DRI2GetDrawable(pDraw); in DRI2WaitSBC()
1284 if (pPriv == NULL) in DRI2WaitSBC()
1287 if (pPriv->target_sbc != -1) /* already in use */ in DRI2WaitSBC()
1294 target_sbc = pPriv->swap_count + pPriv->swapsPending; in DRI2WaitSBC()
1300 if (pPriv->swap_count >= target_sbc) { in DRI2WaitSBC()
1301 ProcDRI2WaitMSCReply(client, pPriv->last_swap_ust, in DRI2WaitSBC()
1302 pPriv->last_swap_msc, pPriv->swap_count); in DRI2WaitSBC()
1306 if (!dri2Sleep(client, pPriv, WAKE_SBC)) in DRI2WaitSBC()
1309 pPriv->target_sbc = target_sbc; in DRI2WaitSBC()