summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-26 12:11:01 (GMT)
committerDave Airlie <airlied@redhat.com>2012-07-07 09:37:45 (GMT)
commit12905dfaf01088a00f4a0a78cffba03329e7b724 (patch)
treecdc23a5354e8484c6a36899f457838927c1132e2
parenta7c01da54ab43f9d29333ccbd79dfc001f9dc5e3 (diff)
dix/xf86: initial offload slave tracking (v1.1)
add the linked list and provider hooks. v1.1: add another assert in the add path. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--dix/dispatch.c19
-rw-r--r--include/screenint.h6
-rw-r--r--include/scrnintstr.h3
-rw-r--r--randr/rrprovider.c7
4 files changed, 35 insertions, 0 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index bc803d7..bcce22f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3745,6 +3745,7 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
xorg_list_init(&pScreen->pixmap_dirty_list);
xorg_list_init(&pScreen->unattached_list);
xorg_list_init(&pScreen->output_slave_list);
+ xorg_list_init(&pScreen->offload_slave_list);
/*
* This loop gets run once for every Screen that gets added,
@@ -3927,3 +3928,21 @@ DetachOutputGPU(ScreenPtr slave)
xorg_list_del(&slave->output_head);
slave->current_master = NULL;
}
+
+void
+AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+ assert(new->isGPU);
+ assert(!new->current_master);
+ xorg_list_add(&new->offload_head, &pScreen->offload_slave_list);
+ new->current_master = pScreen;
+}
+
+void
+DetachOffloadGPU(ScreenPtr slave)
+{
+ assert(slave->isGPU);
+ xorg_list_del(&slave->offload_head);
+ slave->current_master = NULL;
+}
+
diff --git a/include/screenint.h b/include/screenint.h
index b992cc2..e36b4d8 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -82,6 +82,12 @@ AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new);
extern _X_EXPORT void
DetachOutputGPU(ScreenPtr output);
+extern _X_EXPORT void
+AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new);
+
+extern _X_EXPORT void
+DetachOffloadGPU(ScreenPtr slave);
+
typedef struct _ColormapRec *ColormapPtr;
#endif /* SCREENINT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 5ef37ed..80601b9 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -507,6 +507,9 @@ typedef struct _Screen {
StopPixmapTrackingProcPtr StopPixmapTracking;
struct xorg_list pixmap_dirty_list;
+ struct xorg_list offload_slave_list;
+ struct xorg_list offload_head;
+
} ScreenRec;
static inline RegionPtr
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index f35ca6a..8385d3f 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -76,6 +76,10 @@ ProcRRGetProviders (ClientPtr client)
pScrPriv = rrGetScrPriv(iter);
total_providers += pScrPriv->provider ? 1 : 0;
}
+ xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) {
+ pScrPriv = rrGetScrPriv(iter);
+ total_providers += pScrPriv->provider ? 1 : 0;
+ }
xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
pScrPriv = rrGetScrPriv(iter);
total_providers += pScrPriv->provider ? 1 : 0;
@@ -112,6 +116,9 @@ ProcRRGetProviders (ClientPtr client)
xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
ADD_PROVIDER(iter);
}
+ xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) {
+ ADD_PROVIDER(iter);
+ }
xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
ADD_PROVIDER(iter);
}