]> git.pld-linux.org Git - packages/xorg-driver-video-ati.git/blob - xorg_list.patch
43fa945f9aea5b054f72c22bed756b0516354f9e
[packages/xorg-driver-video-ati.git] / xorg_list.patch
1 From c66ae235700f5efe64eb168327551b8f1d153c9c Mon Sep 17 00:00:00 2001
2 From: Michel Dänzer <michel.daenzer@amd.com>
3 Date: Mon, 13 Feb 2012 09:43:58 +0000
4 Subject: Handle new xorg_list API.
5
6 Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45937
7
8 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
9 ---
10 diff --git a/configure.ac b/configure.ac
11 index 29f129a..0083325 100644
12 --- a/configure.ac
13 +++ b/configure.ac
14 @@ -234,10 +234,18 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
15               [#include "xorg-server.h"])
16  
17  AC_CHECK_HEADERS([list.h],
18 -                [], [],
19 +                [have_list_h="yes"], [have_list_h="no"],
20                  [#include <X11/Xdefs.h>
21                   #include "xorg-server.h"])
22  
23 +if test "x$have_list_h" = xyes; then
24 +    AC_CHECK_DECL(xorg_list_init,
25 +                 [AC_DEFINE(HAVE_XORG_LIST, 1, [Have xorg_list API])], [],
26 +                 [#include <X11/Xdefs.h>
27 +                  #include "xorg-server.h"
28 +                  #include "list.h"])
29 +fi
30 +
31  CPPFLAGS="$SAVE_CPPFLAGS"
32  
33  AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
34 diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
35 index 835575f..cf905a1 100644
36 --- a/src/radeon_dri2.c
37 +++ b/src/radeon_dri2.c
38 @@ -40,6 +40,13 @@
39  
40  #if HAVE_LIST_H
41  #include "list.h"
42 +#if !HAVE_XORG_LIST
43 +#define xorg_list                      list
44 +#define xorg_list_init                 list_init
45 +#define xorg_list_add                  list_add
46 +#define xorg_list_del                  list_del
47 +#define xorg_list_for_each_entry       list_for_each_entry
48 +#endif
49  #endif
50  
51  #ifdef RADEON_DRI2
52 @@ -515,11 +522,11 @@ typedef struct _DRI2FrameEvent {
53  
54      Bool valid;
55  
56 -    struct list link;
57 +    struct xorg_list link;
58  } DRI2FrameEventRec, *DRI2FrameEventPtr;
59  
60  typedef struct _DRI2ClientEvents {
61 -    struct list   reference_list;
62 +    struct xorg_list   reference_list;
63  } DRI2ClientEventsRec, *DRI2ClientEventsPtr;
64  
65  #if HAS_DEVPRIVATEKEYREC
66 @@ -538,7 +545,7 @@ DevPrivateKey DRI2ClientEventsPrivateKey = &DRI2ClientEventsPrivateKeyIndex;
67      dixLookupPrivate(&(pClient)->devPrivates, DRI2ClientEventsPrivateKey))
68  
69  static int
70 -ListAddDRI2ClientEvents(ClientPtr client, struct list *entry)
71 +ListAddDRI2ClientEvents(ClientPtr client, struct xorg_list *entry)
72  {
73      DRI2ClientEventsPtr pClientPriv;
74      pClientPriv = GetDRI2ClientEvents(client);
75 @@ -547,12 +554,12 @@ ListAddDRI2ClientEvents(ClientPtr client, struct list *entry)
76          return BadAlloc;
77      }
78  
79 -    list_add(entry, &pClientPriv->reference_list);
80 +    xorg_list_add(entry, &pClientPriv->reference_list);
81      return 0;
82  }
83  
84  static void
85 -ListDelDRI2ClientEvents(ClientPtr client, struct list *entry)
86 +ListDelDRI2ClientEvents(ClientPtr client, struct xorg_list *entry)
87  {
88      DRI2ClientEventsPtr pClientPriv;
89      pClientPriv = GetDRI2ClientEvents(client);
90 @@ -560,7 +567,7 @@ ListDelDRI2ClientEvents(ClientPtr client, struct list *entry)
91      if (!pClientPriv) {
92          return;
93      }
94 -    list_del(entry);
95 +    xorg_list_del(entry);
96  }
97  
98  static void
99 @@ -574,7 +581,7 @@ radeon_dri2_client_state_changed(CallbackListPtr *ClientStateCallback, pointer d
100  
101      switch (pClient->clientState) {
102      case ClientStateInitial:
103 -        list_init(&pClientEventsPriv->reference_list);
104 +        xorg_list_init(&pClientEventsPriv->reference_list);
105          break;
106      case ClientStateRunning:
107          break;
108 @@ -582,7 +589,7 @@ radeon_dri2_client_state_changed(CallbackListPtr *ClientStateCallback, pointer d
109      case ClientStateRetained:
110      case ClientStateGone:
111          if (pClientEventsPriv) {
112 -            list_for_each_entry(ref, &pClientEventsPriv->reference_list, link) {
113 +            xorg_list_for_each_entry(ref, &pClientEventsPriv->reference_list, link) {
114                  ref->valid = FALSE;
115              }
116          }
117 --
118 cgit v0.9.0.2-2-gbebe
This page took 0.160414 seconds and 2 git commands to generate.