diff options
-rw-r--r-- | vmwgfx/vmwgfx_crtc.c | 33 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_saa.c | 50 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_saa.h | 7 |
3 files changed, 29 insertions, 61 deletions
diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c index 13ca7e5..eaf87b2 100644 --- a/vmwgfx/vmwgfx_crtc.c +++ b/vmwgfx/vmwgfx_crtc.c @@ -62,7 +62,7 @@ struct crtc_private unsigned cursor_handle; /* Scanout info for pixmaps */ - struct vmwgfx_screen_box box; + struct vmwgfx_screen_entry entry; }; static void @@ -89,8 +89,8 @@ crtc_dpms(xf86CrtcPtr crtc, int mode) * the crtc may be turned on again by * another dpms call, so don't release the scanout pixmap ref. */ - if (!crtc->enabled && crtcp->box.pixmap) { - vmwgfx_scanout_unref(&crtcp->box); + if (!crtc->enabled && crtcp->entry.pixmap) { + vmwgfx_scanout_unref(&crtcp->entry); } break; } @@ -134,7 +134,6 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, int i, ret; unsigned int connector_id; PixmapPtr pixmap; - BoxPtr screen_box; for (i = 0; i < config->num_output; output = NULL, i++) { output = config->output[i]; @@ -187,12 +186,12 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } else pixmap = pScreen->GetScreenPixmap(pScreen); - if (crtcp->box.pixmap != pixmap) { - if (crtcp->box.pixmap) - vmwgfx_scanout_unref(&crtcp->box); + if (crtcp->entry.pixmap != pixmap) { + if (crtcp->entry.pixmap) + vmwgfx_scanout_unref(&crtcp->entry); - crtcp->box.pixmap = pixmap; - crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->box); + crtcp->entry.pixmap = pixmap; + crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry); if (crtcp->scanout_id == -1) { LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n"); return FALSE; @@ -203,12 +202,6 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, if (ret) return FALSE; - screen_box = &crtcp->box.box; - screen_box->x1 = crtc->x; - screen_box->y1 = crtc->y; - screen_box->x2 = screen_box->x1 + mode->HDisplay; - screen_box->y2 = screen_box->y1 + mode->VDisplay; - vmwgfx_scanout_refresh(pixmap); /* Only set gamma when needed, to avoid unneeded delays. */ @@ -380,8 +373,8 @@ crtc_destroy(xf86CrtcPtr crtc) { struct crtc_private *crtcp = crtc->driver_private; - if (!WSBMLISTEMPTY(&crtcp->box.scanout_head)) - vmwgfx_scanout_unref(&crtcp->box); + if (!WSBMLISTEMPTY(&crtcp->entry.scanout_head)) + vmwgfx_scanout_unref(&crtcp->entry); xorg_crtc_cursor_destroy(crtc); @@ -442,8 +435,8 @@ xorg_crtc_init(ScrnInfoPtr pScrn) } crtcp->drm_crtc = drm_crtc; - crtcp->box.pixmap = NULL; - WSBMINITLISTHEAD(&crtcp->box.scanout_head); + crtcp->entry.pixmap = NULL; + WSBMINITLISTHEAD(&crtcp->entry.scanout_head); crtc->driver_private = crtcp; } @@ -456,7 +449,7 @@ PixmapPtr crtc_get_scanout(xf86CrtcPtr crtc) { struct crtc_private *crtcp = crtc->driver_private; - return crtcp->box.pixmap; + return crtcp->entry.pixmap; } /* vim: set sw=4 ts=8 sts=4: */ diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c index b0c8301..4638ef0 100644 --- a/vmwgfx/vmwgfx_saa.c +++ b/vmwgfx/vmwgfx_saa.c @@ -220,8 +220,6 @@ vmwgfx_pixmap_present_readback(struct vmwgfx_saa *vsaa, struct saa_pixmap *spix = saa_get_saa_pixmap(pixmap); struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix); RegionRec intersection; - RegionRec screen_intersection; - struct _WsbmListHead *list; if (!spix->damage || !REGION_NOTEMPTY(vsaa->pScreen, &spix->dirty_hw) || !vpix->dirty_present) @@ -249,38 +247,16 @@ vmwgfx_pixmap_present_readback(struct vmwgfx_saa *vsaa, if (!vmwgfx_pixmap_create_gmr(vsaa, pixmap)) goto out_err; - /* - * Readback regions are not allowed to cross screen boundaries, so - * loop over all scanouts and make sure all readback calls are completely - * contained within a scanout bounding box. - */ - - REGION_NULL(vsaa->pScreen, &screen_intersection); - WSBMLISTFOREACH(list, &vpix->scanout_list) { - struct vmwgfx_screen_box *box = - WSBMLISTENTRY(list, struct vmwgfx_screen_box, scanout_head); - - REGION_RESET(vsaa->pScreen, &screen_intersection, &box->box); - REGION_INTERSECT(vsaa->pScreen, &screen_intersection, - &screen_intersection, &intersection); - - if (vmwgfx_present_readback(vsaa->drm_fd, vpix->fb_id, - &intersection) != 0) - goto out_readback_err; - - REGION_SUBTRACT(vsaa->pScreen, &intersection, &intersection, - &screen_intersection); - REGION_SUBTRACT(vsaa->pScreen, &spix->dirty_hw, - &spix->dirty_hw, &screen_intersection); - } + if (vmwgfx_present_readback(vsaa->drm_fd, vpix->fb_id, + &intersection) != 0) + goto out_err; - REGION_UNINIT(vsaa->pScreen, &screen_intersection); + REGION_SUBTRACT(vsaa->pScreen, &spix->dirty_hw, + &spix->dirty_hw, &intersection); out: REGION_UNINIT(vsaa->pScreen, &intersection); return TRUE; - out_readback_err: - REGION_UNINIT(vsaa->pScreen, &screen_intersection); out_err: REGION_UNINIT(vsaa->pScreen, &intersection); return FALSE; @@ -1367,9 +1343,9 @@ vmwgfx_scanout_refresh(PixmapPtr pixmap) */ uint32_t -vmwgfx_scanout_ref(struct vmwgfx_screen_box *box) +vmwgfx_scanout_ref(struct vmwgfx_screen_entry *entry) { - PixmapPtr pixmap = box->pixmap; + PixmapPtr pixmap = entry->pixmap; struct vmwgfx_saa *vsaa = to_vmwgfx_saa(saa_get_driver(pixmap->drawable.pScreen)); struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap); @@ -1389,14 +1365,14 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_box *box) vpix->gmr->handle, &vpix->fb_id); if (ret) { - box->pixmap = NULL; + entry->pixmap = NULL; vpix->fb_id = -1; goto out_err; } } pixmap->refcnt += 1; - WSBMLISTADDTAIL(&box->scanout_head, &vpix->scanout_list); + WSBMLISTADDTAIL(&entry->scanout_head, &vpix->scanout_list); out_err: return vpix->fb_id; @@ -1408,18 +1384,18 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_box *box) * damage tracking and kms fbs. */ void -vmwgfx_scanout_unref(struct vmwgfx_screen_box *box) +vmwgfx_scanout_unref(struct vmwgfx_screen_entry *entry) { struct vmwgfx_saa *vsaa; struct vmwgfx_saa_pixmap *vpix; - PixmapPtr pixmap = box->pixmap; + PixmapPtr pixmap = entry->pixmap; if (!pixmap) return; vsaa = to_vmwgfx_saa(saa_get_driver(pixmap->drawable.pScreen)); vpix = vmwgfx_saa_pixmap(pixmap); - WSBMLISTDELINIT(&box->scanout_head); + WSBMLISTDELINIT(&entry->scanout_head); if (WSBMLISTEMPTY(&vpix->scanout_list)) { REGION_EMPTY(vsaa->pScreen, vpix->pending_update); @@ -1430,6 +1406,6 @@ vmwgfx_scanout_unref(struct vmwgfx_screen_box *box) vmwgfx_pixmap_remove_damage(pixmap); } - box->pixmap = NULL; + entry->pixmap = NULL; pixmap->drawable.pScreen->DestroyPixmap(pixmap); } diff --git a/vmwgfx/vmwgfx_saa.h b/vmwgfx/vmwgfx_saa.h index 41c6de3..30eeacc 100644 --- a/vmwgfx/vmwgfx_saa.h +++ b/vmwgfx/vmwgfx_saa.h @@ -61,8 +61,7 @@ struct vmwgfx_saa_pixmap { enum xa_formats staging_format; }; -struct vmwgfx_screen_box { - BoxRec box; +struct vmwgfx_screen_entry { struct _WsbmListHead scanout_head; PixmapPtr pixmap; }; @@ -84,10 +83,10 @@ vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat, void (*present_flush)(ScreenPtr pScreen)); extern uint32_t -vmwgfx_scanout_ref(struct vmwgfx_screen_box *box); +vmwgfx_scanout_ref(struct vmwgfx_screen_entry *box); extern void -vmwgfx_scanout_unref(struct vmwgfx_screen_box *box); +vmwgfx_scanout_unref(struct vmwgfx_screen_entry *box); extern void vmwgfx_scanout_refresh(PixmapPtr pixmap); |