summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-19 13:45:32 +1000
committerDave Airlie <airlied@gmail.com>2012-08-16 14:42:41 +1000
commitb0be0ac86bae871c9f1724c40298d50d7f2b08e4 (patch)
tree12f13ec7998129d831970dfe545bdcf8fa8f0e63
parentbaf485b1d304d741073f058d524ca698af3c15cd (diff)
nouveau: add pixmap tracking/updating support.
This should allow nouveau to act as an output master for driving output slaves. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/nv_driver.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 6988b55..a02cef3 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -428,6 +428,39 @@ NVFlushCallback(CallbackListPtr *list, pointer user_data, pointer call_data)
nouveau_pushbuf_kick(pNv->pushbuf, pNv->pushbuf->channel);
}
+#ifdef NOUVEAU_PIXMAP_SHARING
+static void
+redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+{
+ RegionRec pixregion;
+
+ PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
+
+ PixmapSyncDirtyHelper(dirty, &pixregion);
+
+ DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ RegionUninit(&pixregion);
+}
+
+static void
+nouveau_dirty_update(ScreenPtr screen)
+{
+ RegionPtr region;
+ PixmapDirtyUpdatePtr ent;
+
+ if (xorg_list_is_empty(&screen->pixmap_dirty_list))
+ return;
+
+ xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
+ region = DamageRegion(ent->damage);
+ if (RegionNotEmpty(region)) {
+ redisplay_dirty(screen, ent);
+ DamageEmpty(ent->damage);
+ }
+ }
+}
+#endif
+
static void
NVBlockHandler (BLOCKHANDLER_ARGS_DECL)
{
@@ -439,6 +472,10 @@ NVBlockHandler (BLOCKHANDLER_ARGS_DECL)
(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = NVBlockHandler;
+#ifdef NOUVEAU_PIXMAP_SHARING
+ nouveau_dirty_update(pScreen);
+#endif
+
if (pScrn->vtSema && !pNv->NoAccel)
nouveau_pushbuf_kick(pNv->pushbuf, pNv->pushbuf->channel);
@@ -1278,6 +1315,11 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
pNv->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = NVCreateScreenResources;
+#ifdef NOUVEAU_PIXMAP_SHARING
+ pScreen->StartPixmapTracking = PixmapStartDirtyTracking;
+ pScreen->StopPixmapTracking = PixmapStopDirtyTracking;
+#endif
+
if (!xf86CrtcScreenInit(pScreen))
return FALSE;