summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-24 15:39:05 +0100
committerDave Airlie <airlied@redhat.com>2012-07-07 10:37:10 +0100
commit382dd45bb88fa92764bf0ecd655cb9890eb84960 (patch)
tree85b930bba263dd8f4fd174ec09df3612be978965
parent05d2472cd242293a5fa205efff5734a3380072b4 (diff)
dix: add ability to link output slave gpus to the current gpu (v1.1)
Just add the interfaces to attach/detach output slaves, and a linked list to keep track of them. Hook up the randr providers list to include these slaves. v1.1: add another assert to 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.c17
-rw-r--r--include/screenint.h6
-rw-r--r--include/scrnintstr.h3
-rw-r--r--randr/rrprovider.c7
4 files changed, 33 insertions, 0 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 9e8462124..29ac5a45a 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3743,6 +3743,7 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
pScreen->CreateScreenResources = 0;
xorg_list_init(&pScreen->unattached_list);
+ xorg_list_init(&pScreen->output_slave_list);
/*
* This loop gets run once for every Screen that gets added,
@@ -3909,3 +3910,19 @@ DetachUnboundGPU(ScreenPtr slave)
slave->current_master = NULL;
}
+void
+AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+ assert(new->isGPU);
+ assert(!new->current_master);
+ xorg_list_add(&new->output_head, &pScreen->output_slave_list);
+ new->current_master = pScreen;
+}
+
+void
+DetachOutputGPU(ScreenPtr slave)
+{
+ assert(slave->isGPU);
+ xorg_list_del(&slave->output_head);
+ slave->current_master = NULL;
+}
diff --git a/include/screenint.h b/include/screenint.h
index c0c60ef3a..b992cc224 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -76,6 +76,12 @@ AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new);
extern _X_EXPORT void
DetachUnboundGPU(ScreenPtr unbound);
+extern _X_EXPORT void
+AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new);
+
+extern _X_EXPORT void
+DetachOutputGPU(ScreenPtr output);
+
typedef struct _ColormapRec *ColormapPtr;
#endif /* SCREENINT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 6b738de92..7efc5c3c1 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -485,6 +485,9 @@ typedef struct _Screen {
ScreenPtr current_master;
+ struct xorg_list output_slave_list;
+ struct xorg_list output_head;
+
} ScreenRec;
static inline RegionPtr
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index aae309501..377320032 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -72,6 +72,10 @@ ProcRRGetProviders (ClientPtr client)
if (pScrPriv->provider)
total_providers++;
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_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;
@@ -105,6 +109,9 @@ ProcRRGetProviders (ClientPtr client)
providers = (RRProvider *)extra;
ADD_PROVIDER(pScreen);
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+ ADD_PROVIDER(iter);
+ }
xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
ADD_PROVIDER(iter);
}