summaryrefslogtreecommitdiff
path: root/extra/glamor-egl/git-fixes.patch
blob: 7a03a225e39117095c0bba89b132baf1aa27fcd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
From beeddaae1da253d1a442228a75f80ef40a0204ac Mon Sep 17 00:00:00 2001
From: Michel Dänzer <michel.daenzer@amd.com>
Date: Wed, 31 Oct 2012 15:56:00 +0000
Subject: Don't use glBlitFramebufferEXT for overlapping copies.

According to the GL_EXT_framebuffer_blit spec, the result of doing so is
undefined. But we need well-defined results. :)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
diff --git a/src/glamor_copyarea.c b/src/glamor_copyarea.c
index 7d06833..4e6f953 100644
--- a/src/glamor_copyarea.c
+++ b/src/glamor_copyarea.c
@@ -318,7 +318,8 @@ __glamor_copy_n_to_n(DrawablePtr src,
 		dx, dy,
 		src_pixmap, dst_pixmap);
 #ifndef GLAMOR_GLES2
-	if ((overlaped || glamor_priv->state != RENDER_STATE
+	if (!overlaped &&
+	    (glamor_priv->state != RENDER_STATE
 	     || !src_pixmap_priv->base.gl_tex || !dst_pixmap_priv->base.gl_tex)
 	    && glamor_copy_n_to_n_fbo_blit(src, dst, gc, box, nbox, dx,
 					   dy)) {
--
cgit v0.9.0.2-2-gbebe
From f1457c1c59efdadbad25f01dce9433643d688844 Mon Sep 17 00:00:00 2001
From: Zhigang Gong <zhigang.gong@linux.intel.com>
Date: Tue, 13 Nov 2012 02:08:02 +0000
Subject: glamor_compositerects: Need to initialize region before fallback.

As we need to call DamageRegionAppend even for fallback path,
we must initialize the region before do that. Pointed by
Igor Vagulin.

https://bugs.freedesktop.org/show_bug.cgi?id=56940

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
---
diff --git a/src/glamor_compositerects.c b/src/glamor_compositerects.c
index 5fe1bbf..f1564a2 100644
--- a/src/glamor_compositerects.c
+++ b/src/glamor_compositerects.c
@@ -131,16 +131,6 @@ glamor_composite_rectangles(CARD8	 op,
 		return;
 	}
 
-	pixmap = glamor_get_drawable_pixmap(dst->pDrawable);
-	priv = glamor_get_pixmap_private(pixmap);
-
-	if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
-		goto fallback;
-	if (dst->alphaMap) {
-		DEBUGF("%s: fallback, dst has an alpha-map\n", __FUNCTION__);
-		goto fallback;
-	}
-
 	if ((color->red|color->green|color->blue|color->alpha) <= 0x00ff) {
 		switch (op) {
 		case PictOpOver:
@@ -204,6 +194,16 @@ glamor_composite_rectangles(CARD8	 op,
 		return;
 	}
 
+	pixmap = glamor_get_drawable_pixmap(dst->pDrawable);
+	priv = glamor_get_pixmap_private(pixmap);
+
+	if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
+		goto fallback;
+	if (dst->alphaMap) {
+		DEBUGF("%s: fallback, dst has an alpha-map\n", __FUNCTION__);
+		goto fallback;
+	}
+
 	need_free_region = TRUE;
 
 	DEBUGF("%s: drawable extents (%d, %d),(%d, %d) x %d\n",
--
cgit v0.9.0.2-2-gbebe
From 4a0ac3ff00d70b13e8483d50657187c7abdfc110 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Sat, 29 Dec 2012 06:28:17 +0000
Subject: glamor: fix make distcheck part 1

This just adds the headers, then it falls over on the sdk_HEADERS
as it overrides proper install paths by the looks of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 766aac7..e1ee86d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,10 +20,13 @@ AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
 libglamor_la_LDFLAGS = -avoid-version
 
 libglamor_la_SOURCES = \
+	compat-api.h \
 	glamor.c \
 	glamor_copyarea.c \
 	glamor_copywindow.c \
 	glamor_core.c \
+	glamor_debug.h \
+	glamor_gl_dispatch.h \
 	glamor_fill.c \
 	glamor_fillspans.c \
 	glamor_getspans.c \
@@ -42,6 +45,7 @@ libglamor_la_SOURCES = \
 	glamor_copyplane.c\
 	glamor_glyphblt.c\
 	glamor_polyops.c\
+	glamor_priv.h\
 	glamor_pixmap.c\
 	glamor_largepixmap.c\
 	glamor_picture.c\
@@ -49,7 +53,9 @@ libglamor_la_SOURCES = \
 	glamor_gl_dispatch.c\
 	glamor_fbo.c\
 	glamor_compositerects.c\
-	glamor.h
+	glamor_utils.h\
+	glamor.h\
+	glapi.h
 
 sdk_HEADERS = glamor.h
 
--
cgit v0.9.0.2-2-gbebe
From c6d9cb1eb4962a15f8bbc869e9fef6d1464165af Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Sat, 29 Dec 2012 06:42:10 +0000
Subject: glamor: add compiler.h

This is also required for distchecking.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
diff --git a/src/Makefile.am b/src/Makefile.am
index e1ee86d..55721f6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,6 +21,7 @@ libglamor_la_LDFLAGS = -avoid-version
 
 libglamor_la_SOURCES = \
 	compat-api.h \
+	compiler.h \
 	glamor.c \
 	glamor_copyarea.c \
 	glamor_copywindow.c \
--
cgit v0.9.0.2-2-gbebe
From c0729336ae35dcc7e46bcf840d6e9a056d5cdd26 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Sat, 29 Dec 2012 06:42:30 +0000
Subject: glamor_utils: fix unlikely define use

using a define across a split line expression is failure, compiling
with warnings shows this up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
diff --git a/src/glamor_utils.h b/src/glamor_utils.h
index 36beb49..d307838 100644
--- a/src/glamor_utils.h
+++ b/src/glamor_utils.h
@@ -80,8 +80,7 @@
 
 #define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_)		\
    do {								\
-	if (unlikely(_priv_ && (_priv_)->type				\
-		== GLAMOR_TEXTURE_LARGE)) {			\
+	if (unlikely(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) {  \
 		*(_xoff_) = - (_priv_)->large.box.x1;	\
 		*(_yoff_) = - (_priv_)->large.box.y1;	\
 	} else {						\
--
cgit v0.9.0.2-2-gbebe
From 61879504f86c5cb326cc06a5873283234cfbbcd2 Mon Sep 17 00:00:00 2001
From: Michel Dänzer <michel.daenzer@amd.com>
Date: Wed, 13 Mar 2013 16:15:33 +0000
Subject: glamoregl: Use xf86ScreenToScrn()

Fixes crashes when glamor is used for a GPU screen with xserver 1.13 or
newer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200#c17

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
diff --git a/src/glamor_egl.c b/src/glamor_egl.c
index a248aa2..cd0bdc0 100644
--- a/src/glamor_egl.c
+++ b/src/glamor_egl.c
@@ -116,7 +116,7 @@ glamor_egl_get_screen_private(ScrnInfoPtr scrn)
 _X_EXPORT void
 glamor_egl_make_current(ScreenPtr screen)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
 
@@ -139,7 +139,7 @@ glamor_egl_make_current(ScreenPtr screen)
 _X_EXPORT void
 glamor_egl_restore_context(ScreenPtr screen)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
 
@@ -221,7 +221,7 @@ glamor_create_texture_from_image(struct glamor_egl_screen_private
 Bool
 glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl;
 	PixmapPtr	screen_pixmap;
 
@@ -245,7 +245,7 @@ glamor_egl_create_textured_screen_ext(ScreenPtr screen,
 				      int stride,
 				      PixmapPtr *back_pixmap)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl;
 
 	glamor_egl = glamor_egl_get_screen_private(scrn);
@@ -272,7 +272,7 @@ Bool
 glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
 {
 	ScreenPtr screen = pixmap->drawable.pScreen;
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl;
 	EGLImageKHR image;
 	GLuint texture;
@@ -318,7 +318,7 @@ done:
 static void
 _glamor_egl_destroy_pixmap_image(PixmapPtr pixmap)
 {
-	ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
 	EGLImageKHR image;
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
@@ -338,7 +338,7 @@ _glamor_egl_destroy_pixmap_image(PixmapPtr pixmap)
 _X_EXPORT void
 glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
 {
-	ScrnInfoPtr scrn = xf86Screens[front->drawable.pScreen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(front->drawable.pScreen);
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
 	EGLImageKHR old_front_image;
@@ -371,7 +371,7 @@ glamor_egl_close_screen(CLOSE_SCREEN_ARGS_DECL)
 	PixmapPtr screen_pixmap;
 	EGLImageKHR back_image;
 
-	scrn = xf86Screens[screen->myNum];
+	scrn = xf86ScreenToScrn(screen);
 	glamor_egl = glamor_egl_get_screen_private(scrn);
 	screen_pixmap = screen->GetScreenPixmap(screen);
 
@@ -417,7 +417,7 @@ glamor_egl_has_extension(struct glamor_egl_screen_private *glamor_egl,
 void
 glamor_egl_screen_init(ScreenPtr screen)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
 
@@ -588,7 +588,7 @@ glamor_gl_dispatch_init(ScreenPtr screen,
 			struct glamor_gl_dispatch *dispatch,
 			int gl_version)
 {
-	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	struct glamor_egl_screen_private *glamor_egl =
 	    glamor_egl_get_screen_private(scrn);
 	if (!glamor_gl_dispatch_init_impl
--
cgit v0.9.0.2-2-gbebe
From 3cd34ba9f0708ab7d816eeee80139257fafcb4ad Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Wed, 13 Mar 2013 17:28:57 +0000
Subject: Silence Automake 1.13 warnings

warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 55721f6..2140b81 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,7 @@ endif
 
 instdir = $(moduledir)
 
-INCLUDES = \
+AM_CPPFLAGS = \
 	$(XORG_INCS)
 
 AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
--
cgit v0.9.0.2-2-gbebe
From c7241f097ddb4d3bfb832f6b4ee6fafe8b4d2cfe Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Wed, 13 Mar 2013 17:28:58 +0000
Subject: Properly dist necesary headers

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2140b81..0879287 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,7 @@ libglamor_la_SOURCES = \
 	glamor_fill.c \
 	glamor_fillspans.c \
 	glamor_getspans.c \
+	glamor_glext.h \
 	glamor_glyphs.c \
 	glamor_polyfillrect.c \
 	glamor_polylines.c \
--
cgit v0.9.0.2-2-gbebe
From f2d7f1cf351bdc3a8a00fe564cd6a937db3b4e19 Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Wed, 13 Mar 2013 17:49:32 +0000
Subject: First attempt to make libglamor.so shared versioned library

As recommended by Michel in this thread reply:
http://lists.freedesktop.org/archives/glamor/2013-March/000305.html

v2: Correct shared library location in glamor.pc.in

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62259

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
---
diff --git a/glamor.pc.in b/glamor.pc.in
index 74ecd2e..5257468 100644
--- a/glamor.pc.in
+++ b/glamor.pc.in
@@ -2,12 +2,11 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
-moduledir=@moduledir@
 sdkdir=@sdkdir@
 GLAMOR_GL_CFLAGS=@GLAMOR_GL_CFLAGS@
 
 Name: glamor
 Description: X.Org glamor common library.
 Version: @PACKAGE_VERSION@
-Cflags: -I${sdkdir} -L${moduledir} -lglamor ${GLAMOR_GL_CFLAGS}
-
+Cflags: -I${sdkdir} ${GLAMOR_GL_CFLAGS}
+Libs: -L${libdir} -lglamor
diff --git a/src/Makefile.am b/src/Makefile.am
index 0879287..4beb559 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-inst_LTLIBRARIES = libglamor.la
+lib_LTLIBRARIES = libglamor.la
 
 # Override these since glamor doesn't need them and the needed files aren't
 # built (in hw/xfree86/os-support/solaris) until after glamor is built
@@ -10,14 +10,12 @@ else
 libglamor_la_LIBADD = $(GL_LIBS)
 endif
 
-instdir = $(moduledir)
-
 AM_CPPFLAGS = \
 	$(XORG_INCS)
 
 AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
 
-libglamor_la_LDFLAGS = -avoid-version
+libglamor_la_LDFLAGS = -version-info 0:0:0
 
 libglamor_la_SOURCES = \
 	compat-api.h \
@@ -65,7 +63,8 @@ if EGL
 LIBGLAMOREGL = libglamoregl.la
 module_LTLIBRARIES = $(LIBGLAMOREGL)
 libglamoregl_la_DEPENDENCIES = libglamor.la
-libglamoregl_la_LDFLAGS = -avoid-version -module $(EGL_LIBS) -lglamor $(GLX_SYS_LIBS)
+libglamoregl_la_LDFLAGS = -avoid-version -module
+libglamoregl_la_LIBADD = $(EGL_LIBS) $(GLX_SYS_LIBS) libglamor.la
 libglamoregl_la_SOURCES = glamor_eglmodule.c $(top_srcdir)/src/glamor_egl.c
 libglamoregl_la_CFLAGS = $(AM_CFLAGS) $(GLX_DEFINES) -I$(top_srcdir)/src $(LIBDRM_CFLAGS) $(EGL_CFLAGS)
 endif
--
cgit v0.9.0.2-2-gbebe
From 81aadb8ae204f58d77a948c8624f1e72659dcdf0 Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Wed, 13 Mar 2013 17:49:33 +0000
Subject: Don't use AC_PROG_LIBTOOL

Autoconf only needs libtool macros which are copied when
autoreconf is run. There is no need for looking for
"libtool" program in PATH. This properly disables static
libraries from being built and installed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
---
diff --git a/configure.ac b/configure.ac
index 230543c..5ff6ae1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,6 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE([enable])
 
 # Initialize libtool
-AC_PROG_LIBTOOL
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
--
cgit v0.9.0.2-2-gbebe