Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-03 Thread Dave Airlie
On Mon, Jul 2, 2012 at 11:45 PM, Keith Packard kei...@keithp.com wrote:
 Dave Airlie airl...@gmail.com writes:

 On Mon, Jul 2, 2012 at 8:11 PM, Keith Packard kei...@keithp.com wrote:

 Well an unbound gpu you probably don't know its a slave, its just
 unbound.

 It's about to become a slave though

It may not be in the future though, for xinerama emulation it might
become another master.

That policy decision is up to the client.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

This list is meant for attaching unbound gpu screens to initially,
before the client side rebinds them.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 dix/dispatch.c   |   19 +++
 include/screenint.h  |5 +
 include/scrnintstr.h |6 ++
 3 files changed, 30 insertions(+)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index b0fc531..b9da233 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3740,6 +3740,8 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
 pScreen-ClipNotify = 0;/* for R4 ddx compatibility */
 pScreen-CreateScreenResources = 0;
 
+xorg_list_init(pScreen-unattached_list);
+
 /*
  * This loop gets run once for every Screen that gets added,
  * but thats ok.  If the ddx layer initializes the formats
@@ -3888,3 +3890,20 @@ RemoveGPUScreen(ScreenPtr pScreen)
 free(pScreen);
 
 }
+
+void
+AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)
+{
+assert(new-isGPU);
+xorg_list_add(new-unattached_head, pScreen-unattached_list);
+new-current_master = pScreen;
+}
+
+void
+DetachUnboundGPU(ScreenPtr slave)
+{
+assert(slave-isGPU);
+xorg_list_del(slave-unattached_head);
+slave-current_master = NULL;
+}
+
diff --git a/include/screenint.h b/include/screenint.h
index 8205f63..c0c60ef 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -71,6 +71,11 @@ extern _X_EXPORT int AddGPUScreen(Bool (*pfnInit) (ScreenPtr 
/*pScreen */ ,
 
 extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen);
 
+extern _X_EXPORT void
+AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new);
+extern _X_EXPORT void
+DetachUnboundGPU(ScreenPtr unbound);
+
 typedef struct _ColormapRec *ColormapPtr;
 
 #endif  /* SCREENINT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 840c3ac..8a21c2c 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -477,6 +477,12 @@ typedef struct _Screen {
 Bool canDoBGNoneRoot;
 
 Bool isGPU;
+
+struct xorg_list unattached_list;
+struct xorg_list unattached_head;
+
+ScreenPtr current_master;
+
 } ScreenRec;
 
 static inline RegionPtr
-- 
1.7.10.2

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread walter harms


Am 02.07.2012 12:13, schrieb Dave Airlie:
 From: Dave Airlie airl...@redhat.com
 
 This list is meant for attaching unbound gpu screens to initially,
 before the client side rebinds them.
 
 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  dix/dispatch.c   |   19 +++
  include/screenint.h  |5 +
  include/scrnintstr.h |6 ++
  3 files changed, 30 insertions(+)
 
 diff --git a/dix/dispatch.c b/dix/dispatch.c
 index b0fc531..b9da233 100644
 --- a/dix/dispatch.c
 +++ b/dix/dispatch.c
 @@ -3740,6 +3740,8 @@ static int init_screen(ScreenPtr pScreen, int i, Bool 
 gpu)
  pScreen-ClipNotify = 0;/* for R4 ddx compatibility */
  pScreen-CreateScreenResources = 0;
  
 +xorg_list_init(pScreen-unattached_list);
 +
  /*
   * This loop gets run once for every Screen that gets added,
   * but thats ok.  If the ddx layer initializes the formats
 @@ -3888,3 +3890,20 @@ RemoveGPUScreen(ScreenPtr pScreen)
  free(pScreen);
  
  }
 +
 +void
 +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)
 +{
 +assert(new-isGPU);
 +xorg_list_add(new-unattached_head, pScreen-unattached_list);
 +new-current_master = pScreen;
 +}
 +
 +void
 +DetachUnboundGPU(ScreenPtr slave)
 +{
 +assert(slave-isGPU);
 +xorg_list_del(slave-unattached_head);
 +slave-current_master = NULL;
 +}
 +

I do not know the code so your are sure that there is no second user
so no lock is needed ?

re,
 wh


 diff --git a/include/screenint.h b/include/screenint.h
 index 8205f63..c0c60ef 100644
 --- a/include/screenint.h
 +++ b/include/screenint.h
 @@ -71,6 +71,11 @@ extern _X_EXPORT int AddGPUScreen(Bool (*pfnInit) 
 (ScreenPtr /*pScreen */ ,
  
  extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen);
  
 +extern _X_EXPORT void
 +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new);
 +extern _X_EXPORT void
 +DetachUnboundGPU(ScreenPtr unbound);
 +
  typedef struct _ColormapRec *ColormapPtr;
  
  #endif  /* SCREENINT_H */
 diff --git a/include/scrnintstr.h b/include/scrnintstr.h
 index 840c3ac..8a21c2c 100644
 --- a/include/scrnintstr.h
 +++ b/include/scrnintstr.h
 @@ -477,6 +477,12 @@ typedef struct _Screen {
  Bool canDoBGNoneRoot;
  
  Bool isGPU;
 +
 +struct xorg_list unattached_list;
 +struct xorg_list unattached_head;
 +
 +ScreenPtr current_master;
 +
  } ScreenRec;
  
  static inline RegionPtr
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread Dave Airlie
On Mon, Jul 2, 2012 at 5:31 PM, walter harms wha...@bfs.de wrote:


 Am 02.07.2012 12:13, schrieb Dave Airlie:
 From: Dave Airlie airl...@redhat.com

 This list is meant for attaching unbound gpu screens to initially,
 before the client side rebinds them.

 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  dix/dispatch.c   |   19 +++
  include/screenint.h  |5 +
  include/scrnintstr.h |6 ++
  3 files changed, 30 insertions(+)

 diff --git a/dix/dispatch.c b/dix/dispatch.c
 index b0fc531..b9da233 100644
 --- a/dix/dispatch.c
 +++ b/dix/dispatch.c
 @@ -3740,6 +3740,8 @@ static int init_screen(ScreenPtr pScreen, int i, Bool 
 gpu)
  pScreen-ClipNotify = 0;/* for R4 ddx compatibility */
  pScreen-CreateScreenResources = 0;

 +xorg_list_init(pScreen-unattached_list);
 +
  /*
   * This loop gets run once for every Screen that gets added,
   * but thats ok.  If the ddx layer initializes the formats
 @@ -3888,3 +3890,20 @@ RemoveGPUScreen(ScreenPtr pScreen)
  free(pScreen);

  }
 +
 +void
 +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)
 +{
 +assert(new-isGPU);
 +xorg_list_add(new-unattached_head, pScreen-unattached_list);
 +new-current_master = pScreen;
 +}
 +
 +void
 +DetachUnboundGPU(ScreenPtr slave)
 +{
 +assert(slave-isGPU);
 +xorg_list_del(slave-unattached_head);
 +slave-current_master = NULL;
 +}
 +

 I do not know the code so your are sure that there is no second user
 so no lock is needed ?

server has no threads and I don't think sigio will get in here.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread Keith Packard
Dave Airlie airl...@gmail.com writes:

 From: Dave Airlie airl...@redhat.com

 This list is meant for attaching unbound gpu screens to initially,
 before the client side rebinds them.

You'll need this before 10/36 can be applied. Seems like simply
reordering the patches should work, or possibly merging them together.

 +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)

pScreen is 'master' and 'new' is 'slave', right? Could you change the names?

Otherwise,

Reviewed-by: Keith Packard kei...@keithp.com

-- 
keith.pack...@intel.com


pgp8J7Vm0falN.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread Dave Airlie
On Mon, Jul 2, 2012 at 8:11 PM, Keith Packard kei...@keithp.com wrote:
 Dave Airlie airl...@gmail.com writes:

 From: Dave Airlie airl...@redhat.com

 This list is meant for attaching unbound gpu screens to initially,
 before the client side rebinds them.

 You'll need this before 10/36 can be applied. Seems like simply
 reordering the patches should work, or possibly merging them together.

 +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)

 pScreen is 'master' and 'new' is 'slave', right? Could you change the names?


Well an unbound gpu you probably don't know its a slave, its just unbound.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 12/36] dix: add unattached list for attaching screens to initially.

2012-07-02 Thread Keith Packard
Dave Airlie airl...@gmail.com writes:

 On Mon, Jul 2, 2012 at 8:11 PM, Keith Packard kei...@keithp.com wrote:

 Well an unbound gpu you probably don't know its a slave, its just
 unbound.

It's about to become a slave though

-- 
keith.pack...@intel.com


pgpLuUPZWcpA4.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel