Lines Matching defs:vpix
45 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
60 if (vpix->hw) {
75 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
77 if (!spix->damage || vpix->hw || vpix->gmr || vpix->malloc)
91 vmwgfx_pixmap_remove_present(struct vmwgfx_saa_pixmap *vpix)
93 if (vpix->dirty_present)
94 REGION_DESTROY(pixmap->drawable.pScreen, vpix->dirty_present);
95 if (vpix->present_damage)
96 REGION_DESTROY(pixmap->drawable.pScreen, vpix->present_damage);
97 if (vpix->pending_update)
98 REGION_DESTROY(pixmap->drawable.pScreen, vpix->pending_update);
99 if (vpix->pending_present)
100 REGION_DESTROY(pixmap->drawable.pScreen, vpix->pending_present);
101 vpix->dirty_present = NULL;
102 vpix->present_damage = NULL;
103 vpix->pending_update = NULL;
104 vpix->pending_present = NULL;
110 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
115 vpix->dirty_present = REGION_CREATE(pScreen, NULL, 0);
116 if (!vpix->dirty_present)
118 vpix->present_damage = REGION_CREATE(pScreen, NULL, 0);
119 if (!vpix->present_damage)
122 vpix->pending_update = REGION_CREATE(pScreen, NULL, 0);
123 if (!vpix->pending_update)
125 vpix->pending_present = REGION_CREATE(pScreen, NULL, 0);
126 if (!vpix->pending_present)
131 REGION_DESTROY(pScreen, vpix->pending_update);
133 if (vpix->present_damage)
134 REGION_DESTROY(pScreen, vpix->present_damage);
136 if (vpix->dirty_present)
137 REGION_DESTROY(pScreen, vpix->dirty_present);
142 vmwgfx_pixmap_free_storage(struct vmwgfx_saa_pixmap *vpix)
144 if (!(vpix->backing & VMWGFX_PIX_MALLOC) && vpix->malloc) {
145 free(vpix->malloc);
146 vpix->malloc = NULL;
148 if (!(vpix->backing & VMWGFX_PIX_SURFACE) && vpix->hw) {
149 xa_surface_destroy(vpix->hw);
150 vpix->hw = NULL;
152 if (!(vpix->backing & VMWGFX_PIX_GMR) && vpix->gmr) {
153 vmwgfx_dmabuf_destroy(vpix->gmr);
154 vpix->gmr = NULL;
161 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
166 if (vpix->gmr)
174 if (vpix->malloc) {
179 memcpy(addr, vpix->malloc, size);
185 vpix->backing |= VMWGFX_PIX_GMR;
186 vpix->backing &= ~VMWGFX_PIX_MALLOC;
187 vpix->gmr = gmr;
189 vmwgfx_pixmap_free_storage(vpix);
201 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
203 if (!(vpix->backing & (VMWGFX_PIX_MALLOC | VMWGFX_PIX_GMR)))
206 if (!vpix->malloc && (vpix->backing & VMWGFX_PIX_MALLOC)) {
207 vpix->malloc = malloc(pixmap->devKind * pixmap->drawable.height);
208 if (!vpix->malloc)
212 } else if (vpix->backing & VMWGFX_PIX_GMR)
218 free(vpix->malloc);
219 vpix->malloc = NULL;
237 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
241 !vpix->dirty_present)
251 vpix->dirty_present);
266 if (vmwgfx_present_readback(vsaa->drm_fd, vpix->fb_id,
290 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
293 srf = vpix->hw;
295 if (!srf || (!vpix->gmr && !vpix->malloc))
298 if (vpix->gmr && vsaa->can_optimize_dma) {
303 if (vmwgfx_dma(dx, dy, reg, vpix->gmr, pixmap->devKind, handle,
307 uint8_t *data = (uint8_t *) vpix->malloc;
310 if (vpix->gmr) {
311 data = (uint8_t *) vmwgfx_dmabuf_map(vpix->gmr);
328 if (vpix->gmr)
329 vmwgfx_dmabuf_unmap(vpix->gmr);
349 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
359 if (!vpix->hw)
413 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
415 if (vpix->malloc)
416 return vpix->malloc;
417 else if (vpix->gmr)
418 return vmwgfx_dmabuf_map(vpix->gmr);
426 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
428 if (vpix->gmr)
429 return vmwgfx_dmabuf_unmap(vpix->gmr);
441 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
445 WSBMINITLISTHEAD(&vpix->sync_x_head);
446 WSBMINITLISTHEAD(&vpix->scanout_list);
447 WSBMINITLISTHEAD(&vpix->pixmap_list);
456 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
458 if (!vpix->hw)
469 xa_surface_destroy(vpix->hw);
470 vpix->hw = NULL;
476 if (WSBMLISTEMPTY(&vpix->scanout_list))
494 struct vmwgfx_saa_pixmap *vpix =
496 struct saa_pixmap *spix = &vpix->base;
511 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
514 vpix->backing = 0;
515 vmwgfx_pixmap_free_storage(vpix);
523 vmwgfx_pixmap_remove_present(vpix);
524 WSBMLISTDELINIT(&vpix->pixmap_list);
525 WSBMLISTDELINIT(&vpix->sync_x_head);
559 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
570 if (vpix->malloc) {
576 vmwgfx_copy_stride(new_malloc, vpix->malloc, pixmap->devKind,
579 free(vpix->malloc);
580 vpix->malloc = new_malloc;
583 if (vpix->gmr) {
593 old_addr = vmwgfx_dmabuf_map(vpix->gmr);
603 vmwgfx_dmabuf_unmap(vpix->gmr);
606 vmwgfx_dmabuf_destroy(vpix->gmr);
607 vpix->gmr = gmr;
610 if (vpix->hw) {
611 if (!vmwgfx_xa_surface_redefine(vpix, vpix->hw, draw->width,
613 xa_format_unknown, vpix->xa_flags, 1))
626 if (vpix->dirty_present)
627 REGION_INTERSECT(pScreen, vpix->dirty_present, vpix->dirty_present,
629 if (vpix->pending_update)
630 REGION_INTERSECT(pScreen, vpix->pending_update, vpix->pending_update,
632 if (vpix->pending_present)
633 REGION_INTERSECT(pScreen, vpix->pending_present,
634 vpix->pending_present, &b_reg);
635 if (vpix->present_damage)
636 REGION_INTERSECT(pScreen, vpix->present_damage, vpix->present_damage,
649 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
656 if (!vpix) {
662 vpix->backing = 0;
663 vmwgfx_pixmap_free_storage(vpix);
690 if (!vpix->backing)
691 vpix->backing = VMWGFX_PIX_MALLOC;
694 vmwgfx_pixmap_free_storage(vpix);
695 if (WSBMLISTEMPTY(&vpix->pixmap_list))
696 WSBMLISTADDTAIL(&vpix->pixmap_list, &vsaa->pixmaps);
732 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
733 return (vpix->dirty_present != NULL);
738 struct vmwgfx_saa_pixmap *vpix,
746 if (!vpix->hw) {
754 &vpix->base.dirty_hw);
756 &vpix->base.dirty_shadow);
761 REGION_INTERSECT(vsaa->pScreen, &intersection, &vpix->base.dirty_hw,
764 REGION_INTERSECT(vsaa->pScreen, &intersection, &vpix->base.dirty_shadow,
786 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
789 if (vpix->malloc) {
791 } else if (vpix->backing & VMWGFX_PIX_MALLOC) {
792 vpix->backing |= VMWGFX_PIX_GMR;
793 vpix->backing &= ~VMWGFX_PIX_MALLOC;
803 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
811 if (vpix->hw)
814 new_flags = (vpix->xa_flags & ~vpix->staging_remove_flags) |
815 vpix->staging_add_flags | XA_FLAG_SHARED;
822 vpix->staging_format,
825 new_flags = vpix->xa_flags;
826 hw = vpix->hw;
832 vpix->xa_flags = new_flags;
833 vpix->hw = hw;
838 vpix->backing |= VMWGFX_PIX_SURFACE;
839 vmwgfx_pixmap_free_storage(vpix);
850 vpix->hw = NULL;
862 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
871 if (vpix->dirty_present)
872 REGION_UNION(vsaa->pScreen, &intersection, vpix->dirty_present,
893 if (vpix->dirty_present)
894 REGION_SUBTRACT(vsaa->pScreen, vpix->dirty_present,
895 vpix->dirty_present, upload);
1273 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
1282 * For pixmaps for which vpix->hw_is_hosted is true, we can explicitly
1287 if (vpix->hw && (vpix->hw_is_dri2_fronts || vpix->hw_is_hosted)) {
1288 if (pScrn->vtSema && vpix->hw_is_dri2_fronts &&
1295 if (WSBMLISTEMPTY(&vpix->sync_x_head))
1296 WSBMLISTADDTAIL(&vpix->sync_x_head, &vsaa->sync_x_list);
1311 struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix);
1316 if (WSBMLISTEMPTY(&vpix->scanout_list))
1326 if (vpix->scanout_hw) {
1343 if (vpix->dirty_present &&
1344 REGION_NOTEMPTY(vsaa->pScreen, vpix->present_damage)) {
1345 REGION_UNION(vsaa->pScreen, vpix->dirty_present,
1346 vpix->dirty_present, damage);
1347 REGION_EMPTY(vsaa->pScreen, vpix->present_damage);
1349 if (REGION_NOTEMPTY(vsaa->pScreen, vpix->pending_update)) {
1353 REGION_INTERSECT(vsaa->pScreen, ®, vpix->pending_update,
1359 REGION_UNION(vsaa->pScreen, vpix->pending_present,
1360 vpix->pending_present, damage);
1361 if (vpix->dirty_present)
1362 REGION_SUBTRACT(vsaa->pScreen, vpix->dirty_present,
1363 vpix->dirty_present, damage);
1366 if (REGION_NOTEMPTY(vsaa->pScreen, vpix->pending_present)) {
1370 REGION_INTERSECT(vsaa->pScreen, ®, vpix->pending_present,
1376 REGION_UNION(vsaa->pScreen, vpix->pending_update,
1377 vpix->pending_update, damage);
1378 if (vpix->dirty_present)
1379 REGION_SUBTRACT(vsaa->pScreen, vpix->dirty_present,
1380 vpix->dirty_present, damage);
1477 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
1486 REGION_RESET(vsaa->pScreen, vpix->pending_present, &box);
1487 if (vpix->dirty_present)
1488 REGION_SUBTRACT(vsaa->pScreen, vpix->pending_present,
1489 vpix->pending_present, vpix->dirty_present);
1490 REGION_SUBTRACT(vsaa->pScreen, vpix->pending_present,
1491 vpix->pending_present, &vpix->base.dirty_shadow);
1492 REGION_COPY(vsaa->pScreen, vpix->pending_update,
1493 &vpix->base.dirty_shadow);
1509 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
1511 if (WSBMLISTEMPTY(&vpix->scanout_list)) {
1515 vpix->scanout_hw = vsaa->only_hw_presents ||
1518 if (vpix->scanout_hw) {
1526 if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
1528 depth = xa_format_depth(xa_surface_format(vpix->hw));
1538 handle = vpix->gmr->handle;
1553 &vpix->fb_id) != 0)
1557 WSBMLISTADDTAIL(&entry->scanout_head, &vpix->scanout_list);
1558 return vpix->fb_id;
1561 vmwgfx_pixmap_remove_present(vpix);
1565 vpix->fb_id = -1;
1578 struct vmwgfx_saa_pixmap *vpix;
1585 vpix = vmwgfx_saa_pixmap(pixmap);
1588 if (WSBMLISTEMPTY(&vpix->scanout_list)) {
1589 REGION_EMPTY(vsaa->pScreen, vpix->pending_update);
1590 drmModeRmFB(vsaa->drm_fd, vpix->fb_id);
1591 vpix->fb_id = -1;
1593 vmwgfx_pixmap_remove_present(vpix);
1615 struct vmwgfx_saa_pixmap *vpix;
1619 vpix = WSBMLISTENTRY(list, struct vmwgfx_saa_pixmap, pixmap_list);
1620 spix = &vpix->base;
1622 if (!vpix->hw)
1661 struct vmwgfx_saa_pixmap *vpix;
1699 vpix = to_vmwgfx_saa_pixmap(spix);
1713 if (!vpix->hw)
1744 if (xa_copy_prepare(vsaa->xa_ctx, dst, vpix->hw) != XA_ERR_NONE) {