Lines Matching refs:pPriv

151     DRI2DrawablePtr pPriv;
156 pPriv = malloc(sizeof *pPriv);
157 if (pPriv == NULL)
160 pPriv->dri2_screen = ds;
161 pPriv->drawable = pDraw;
162 pPriv->width = pDraw->width;
163 pPriv->height = pDraw->height;
164 pPriv->buffers = NULL;
165 pPriv->bufferCount = 0;
166 pPriv->swapsPending = 0;
167 pPriv->blockedClient = NULL;
168 pPriv->blockedOnMsc = FALSE;
169 pPriv->swap_count = 0;
170 pPriv->target_sbc = -1;
171 pPriv->swap_interval = 1;
173 if (!ds->GetMSC || !(*ds->GetMSC)(pDraw, &ust, &pPriv->last_swap_target))
174 pPriv->last_swap_target = 0;
176 pPriv->swap_limit = 1; /* default to double buffering */
177 pPriv->last_swap_msc = 0;
178 pPriv->last_swap_ust = 0;
179 list_init(&pPriv->reference_list);
180 pPriv->serialNumber = DRI2DrawableSerial(pDraw);
184 dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv);
187 dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv);
190 return pPriv;
202 DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id)
206 list_for_each_entry(ref, &pPriv->reference_list, link) {
215 DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
224 if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) {
228 if (!DRI2LookupDrawableRef(pPriv, id))
229 if (!AddResource(id, dri2DrawableRes, pPriv)) {
239 list_add(&ref->link, &pPriv->reference_list);
248 DRI2DrawablePtr pPriv;
252 pPriv = DRI2GetDrawable(pDraw);
253 if (pPriv == NULL)
254 pPriv = DRI2AllocateDrawable(pDraw);
255 if (pPriv == NULL)
259 rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv);
268 DRI2DrawablePtr pPriv = p;
269 DRI2ScreenPtr ds = pPriv->dri2_screen;
276 list_for_each_entry_safe(ref, next, &pPriv->reference_list, link) {
281 if (!DRI2LookupDrawableRef(pPriv, ref->id))
294 if (!list_is_empty(&pPriv->reference_list))
297 pDraw = pPriv->drawable;
306 if (pPriv->buffers != NULL) {
307 for (i = 0; i < pPriv->bufferCount; i++)
308 (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
310 free(pPriv->buffers);
313 free(pPriv);
319 find_attachment(DRI2DrawablePtr pPriv, unsigned attachment)
323 if (pPriv->buffers == NULL) {
327 for (i = 0; i < pPriv->bufferCount; i++) {
328 if ((pPriv->buffers[i] != NULL)
329 && (pPriv->buffers[i]->attachment == attachment)) {
339 DRI2DrawablePtr pPriv,
343 int old_buf = find_attachment(pPriv, attachment);
347 || (pPriv->buffers[old_buf]->format != format)) {
349 pPriv->serialNumber = DRI2DrawableSerial(pDraw);
353 *buffer = pPriv->buffers[old_buf];
354 pPriv->buffers[old_buf] = NULL;
360 update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw,
366 if (pPriv->buffers != NULL) {
367 for (i = 0; i < pPriv->bufferCount; i++) {
368 if (pPriv->buffers[i] != NULL) {
369 (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
373 free(pPriv->buffers);
376 pPriv->buffers = buffers;
377 pPriv->bufferCount = *out_count;
378 pPriv->width = pDraw->width;
379 pPriv->height = pDraw->height;
380 *width = pPriv->width;
381 *height = pPriv->height;
390 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
400 if (!pPriv) {
407 dimensions_match = (pDraw->width == pPriv->width)
408 && (pDraw->height == pPriv->height)
409 && (pPriv->serialNumber == DRI2DrawableSerial(pDraw));
417 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
453 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
464 if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft,
478 update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
490 box.x2 = pPriv->width;
491 box.y2 = pPriv->height;
498 return pPriv->buffers;
512 update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
536 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
539 if (!pPriv)
542 list_for_each_entry(ref, &pPriv->reference_list, link)
556 DRI2DrawablePtr pPriv;
558 pPriv = DRI2GetDrawable(pDraw);
559 if (pPriv == NULL)
563 if ((pPriv->swapsPending >= pPriv->swap_limit) &&
564 !pPriv->blockedClient) {
568 pPriv->blockedClient = client;
576 __DRI2BlockClient(ClientPtr client, DRI2DrawablePtr pPriv)
578 if (pPriv->blockedClient == NULL) {
580 pPriv->blockedClient = client;
587 DRI2DrawablePtr pPriv;
589 pPriv = DRI2GetDrawable(pDraw);
590 if (pPriv == NULL)
593 __DRI2BlockClient(client, pPriv);
594 pPriv->blockedOnMsc = TRUE;
602 DRI2DrawablePtr pPriv;
606 pPriv = DRI2GetDrawable(pDraw);
607 if (pPriv == NULL)
612 for (i = 0; i < pPriv->bufferCount; i++)
614 if (pPriv->buffers[i]->attachment == dest)
615 pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
616 if (pPriv->buffers[i]->attachment == src)
617 pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i];
673 DRI2DrawablePtr pPriv;
675 pPriv = DRI2GetDrawable(pDraw);
676 if (pPriv == NULL)
680 frame, pPriv->swap_count);
682 if (pPriv->blockedClient)
683 AttendClient(pPriv->blockedClient);
685 pPriv->blockedClient = NULL;
686 pPriv->blockedOnMsc = FALSE;
694 DRI2DrawablePtr pPriv;
696 pPriv = DRI2GetDrawable(pDraw);
697 if (pPriv == NULL) {
711 if (pPriv->target_sbc != -1 &&
712 pPriv->target_sbc <= pPriv->swap_count) {
714 frame, pPriv->swap_count);
715 pPriv->target_sbc = -1;
717 AttendClient(pPriv->blockedClient);
718 pPriv->blockedClient = NULL;
719 } else if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) {
720 if (pPriv->blockedClient) {
721 AttendClient(pPriv->blockedClient);
722 pPriv->blockedClient = NULL;
733 DRI2DrawablePtr pPriv;
738 pPriv = DRI2GetDrawable(pDraw);
739 if (pPriv == NULL) {
745 pPriv->swapsPending--;
746 pPriv->swap_count++;
758 swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count);
760 pPriv->last_swap_msc = frame;
761 pPriv->last_swap_ust = ust;
769 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable);
774 if (pPriv &&
775 pPriv->swapsPending &&
776 pPriv->blockedClient == NULL) {
779 __DRI2BlockClient(client, pPriv);
793 DRI2DrawablePtr pPriv;
798 pPriv = DRI2GetDrawable(pDraw);
799 if (pPriv == NULL) {
805 for (i = 0; i < pPriv->bufferCount; i++) {
806 if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft)
807 pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
808 if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft)
809 pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i];
818 if (!ds->ScheduleSwap || !pPriv->swap_interval) {
828 pPriv->swapsPending++;
850 pPriv->last_swap_target = 0;
852 if (current_msc < pPriv->last_swap_target)
853 pPriv->last_swap_target = current_msc;
862 *swap_target = pPriv->last_swap_target + pPriv->swap_interval;
869 pPriv->swapsPending++;
873 pPriv->swapsPending--; /* didn't schedule */
879 pPriv->last_swap_target = *swap_target;
884 *swap_target = pPriv->swap_count + pPriv->swapsPending;
895 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable);
897 if (pPriv == NULL) {
904 pPriv->swap_interval = interval;
912 DRI2DrawablePtr pPriv;
915 pPriv = DRI2GetDrawable(pDraw);
916 if (pPriv == NULL) {
925 *sbc = pPriv->swap_count;
938 *sbc = pPriv->swap_count;
948 DRI2DrawablePtr pPriv;
951 pPriv = DRI2GetDrawable(pDraw);
952 if (pPriv == NULL)
972 DRI2DrawablePtr pPriv;
974 pPriv = DRI2GetDrawable(pDraw);
975 if (pPriv == NULL)
982 target_sbc = pPriv->swap_count + pPriv->swapsPending;
988 if (pPriv->swap_count >= target_sbc) {
989 ProcDRI2WaitMSCReply(client, pPriv->last_swap_ust,
990 pPriv->last_swap_msc, pPriv->swap_count);
994 pPriv->target_sbc = target_sbc;
995 __DRI2BlockClient(client, pPriv);