1 diff --git a/Makefile b/Makefile
2 index b8069f9..b13ed33 100644
5 @@ -347,23 +347,19 @@ GALLIUM_FILES = \
8 $(DIRECTORY)/include/GL/internal/dri_interface.h \
9 - $(DIRECTORY)/include/GL/internal/glcore.h \
10 $(DIRECTORY)/include/GL/internal/sarea.h \
11 $(DIRECTORY)/src/glx/Makefile \
12 - $(DIRECTORY)/src/glx/Makefile \
13 $(DIRECTORY)/src/glx/*.[ch] \
14 $(DIRECTORY)/src/mesa/drivers/dri/Makefile \
15 $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
16 $(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
17 - $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
18 $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
19 $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
20 $(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
21 $(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
22 $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
23 $(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
24 - $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
25 - $(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
26 + $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
29 $(DIRECTORY)/src/glu/Makefile \
30 diff --git a/docs/devinfo.html b/docs/devinfo.html
31 index df0e726..2d1c125 100644
32 --- a/docs/devinfo.html
33 +++ b/docs/devinfo.html
34 @@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
38 -Update the docs/news.html file and docs/download.html files.
39 +Update docs/news.html.
43 @@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
46 Make an announcement on the mailing lists:
47 -<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
48 -<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
50 +<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
51 +<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
53 -<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
54 +<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
58 diff --git a/docs/news.html b/docs/news.html
59 index b3fb8b5..72d38ee 100644
66 +<h2>October 4, 2010</h2>
69 +<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
74 <h2>September 27, 2010</h2>
77 -<a href="relnotes-7.9.0.html">Mesa 7.9.0-rc1</a> is released. This is a
78 +<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
79 release candidate for the 7.9 development release.
82 diff --git a/docs/relnotes-7.8.2.html b/docs/relnotes-7.8.2.html
83 index e1b0f2d..1393b2e 100644
84 --- a/docs/relnotes-7.8.2.html
85 +++ b/docs/relnotes-7.8.2.html
86 @@ -26,7 +26,15 @@ for DRI hardware acceleration.
88 <h2>MD5 checksums</h2>
91 +c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
92 +6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
93 +a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
94 +7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
95 +757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
96 +8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
97 +b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
98 +a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
99 +9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
103 @@ -44,10 +52,95 @@ tbd
105 <li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
106 <li>Fixed Gallium Cell driver to buildable, runable state
107 +<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
108 +<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
109 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
112 +<li>Assorted i965 driver fixes.
113 + Including but not limited to:
115 + <li>Fix scissoring when width or height is
116 + 0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
118 + <li>Fix bit allocation for number of color regions for
119 + ARB_draw_buffers.</li>
120 + <li>Set the correct provoking vertex for clipped first-mode
121 + trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
123 + <li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
124 + <li>Fix assertion for surface tile offset usage on Ironlake.</li>
125 + <li>Fix cube map layouts on Ironlake.</li>
126 + <li>When an RB gets a new region, clear the old from the state
127 + cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
129 + <li>Reject shaders with uninlined function calls instead of hanging.</li>
133 +<li>Assorted i915 driver fixes. Including but not limited to:
135 + <li>Fixed texture LOD clamping in i915 driver.
136 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
138 + <li>Fix off-by-one for drawing rectangle.
139 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
144 +<li>Fixed hangs in etracer on 830 and 845
145 + chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
147 +<li>Fixed tiling of small textures on all Intel drivers.</li>
148 +<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
149 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
152 +<li>Assorted GLX fixes. Including but not limited to:
154 + <li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
155 + unrecognized fbconfig tags.</li>
156 + <li>Fixed regression with <code>GLX_USE_GL</code>.
157 + <li>Fixed config chooser logic for 'mask' matching.</li>
158 + <li>Report swap events correctly in direct rendered case (DRI2)</li>
159 + <li>Fixed build with dri2proto which doesn't define
160 + <code>X_DRI2SwapInterval</code>.</li>
161 + <li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
162 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
167 +<li>Assorted GLSL fixes. Including but not limited to:
169 + <li>Change variable declared assertion into conditional in GLSL
170 + compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
172 + <li>Fix instruction indexing
173 + bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
175 + <li>Updated uniform location / offset encoding to be more like
176 + other implementations.</li>
177 + <li>Don't overwrite a driver's shader infolog with generic failure
182 +<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
183 +<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
184 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
186 +<li>Fixed handling of multiple render targets in fixed-function
187 + texture envrionmnent programs.</li>
188 +<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
190 +<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
191 +<li>Various build fixes for OpenBSD.</li>
192 +<li>Various build fixes for OS X.</li>
193 +<li>Various build fixes for GCC 3.3.</li>
201 diff --git a/docs/relnotes-7.8.3.html b/docs/relnotes-7.8.3.html
203 index 0000000..1e9f433
205 +++ b/docs/relnotes-7.8.3.html
209 +<TITLE>Mesa Release Notes</TITLE>
211 +<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
215 +<body bgcolor="#eeeeee">
217 +<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
220 +Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
223 +Mesa 7.8.3 implements the OpenGL 2.1 API, but the version reported by
224 +glGetString(GL_VERSION) depends on the particular driver being used.
225 +Some drivers don't support all the features required in OpenGL 2.1.
228 +See the <a href="install.html">Compiling/Installing page</a> for prerequisites
229 +for DRI hardware acceleration.
233 +<h2>MD5 checksums</h2>
235 +x MesaLib-7.8.3.tar.gz
236 +x MesaLib-7.8.3.tar.bz2
238 +x MesaDemos-7.8.3.tar.gz
239 +x MesaDemos-7.8.3.tar.bz2
240 +x MesaDemos-7.8.3.zip
241 +x MesaGLUT-7.8.3.tar.gz
242 +x MesaGLUT-7.8.3.tar.bz2
243 +x MesaGLUT-7.8.3.zip
247 +<h2>New features</h2>
253 +<li>The radeon driver should use less memory when searching for a valid mip
260 +<li>Fix unsupported FB with D24S8 (bug
261 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
262 +<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
263 +<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
264 +<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
265 + memory debugging features.</li>
266 +<li>Fixed an issue rendering to 32-bit channels with swrast (bug
267 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
268 +<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
269 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
270 +<li>GLSL: fix for bug
271 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
272 +<li>GLSL: fix zw fragcoord entries in some cases (bug
273 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
274 +<li>Fix texture env generation in some cases (bug
275 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
276 +<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
277 + <a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
278 +<li>A bug was fixed which could cause Mesa to ignore the
279 + <TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
280 +<li>A bug related to specular highlights on backfaces was fixed.</li>
281 +<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
283 +<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
285 +<li>r600: fix sin+cos normalization.</li>
286 +<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
288 +<li>radeon: avoid flushing when the context is not current.</li>
289 +<li>r300c: a bug affecting unaligned BOs was fixed.</li>
290 +<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
296 diff --git a/docs/relnotes-7.9.html b/docs/relnotes-7.9.html
297 index b09fb1d..fe1fd5e 100644
298 --- a/docs/relnotes-7.9.html
299 +++ b/docs/relnotes-7.9.html
300 @@ -28,12 +28,12 @@ for DRI hardware acceleration.
302 <h2>MD5 checksums</h2>
304 -f1f01a7baec255f13e9468fb4b05922a MesaLib-7.9-rc1.tar.gz
305 -7ffbda3b7056c60b8f87e3082d853af1 MesaLib-7.9-rc1.tar.bz2
306 -9d4650df4e5b530178d6fde840f76664 MesaLib-7.9-rc1.zip
307 -a81c2e7a0c7832e67c768d6f209f2c8f MesaGLUT-7.9-rc1.tar.gz
308 -b4c1c2f0b47a07be10fa2dd42e6a63d7 MesaGLUT-7.9-rc1.tar.bz2
309 -c9dd7419a19bcb24a1fe556ec2e78451 MesaGLUT-7.9-rc1.zip
310 +ed65ab425b25895c7f473d0a5e6e64f8 MesaLib-7.9.tar.gz
311 +82c740c49d572baa6da2b1a1eee90bca MesaLib-7.9.tar.bz2
312 +cd2b6ecec759b0457475e94bbb38fedb MesaLib-7.9.zip
313 +7b54af9fb9b1f6a1a65db2520f50848f MesaGLUT-7.9.tar.gz
314 +20d07419d1929f833fdb36bced290ad5 MesaGLUT-7.9.tar.bz2
315 +62a7edecd7c92675cd6029b05217eb0a MesaGLUT-7.9.zip
319 diff --git a/docs/relnotes.html b/docs/relnotes.html
320 index 47e7f80..4487af9 100644
321 --- a/docs/relnotes.html
322 +++ b/docs/relnotes.html
323 @@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
326 <LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
327 +<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
328 <LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
329 <LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
330 <LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
331 diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
332 index 9c4ff56..4a6506c 100644
333 --- a/src/egl/drivers/dri2/egl_dri2.c
334 +++ b/src/egl/drivers/dri2/egl_dri2.c
335 @@ -741,7 +741,7 @@ dri2_create_screen(_EGLDisplay *disp)
336 if (dri2_dpy->dri2->base.version >= 2)
337 api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
339 - api_mask = __DRI_API_OPENGL;
340 + api_mask = 1 << __DRI_API_OPENGL;
342 disp->ClientAPIsMask = 0;
343 if (api_mask & (1 <<__DRI_API_OPENGL))
344 diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
345 index bc22913..763b1b3 100644
346 --- a/src/egl/main/eglcontext.c
347 +++ b/src/egl/main/eglcontext.c
348 @@ -272,10 +272,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
349 if (!surfaceless && (draw == NULL || read == NULL))
350 return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
352 - /* context stealing from another thread is not allowed */
353 - if (ctx->Binding && ctx->Binding != t)
354 - return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
359 @@ -283,16 +279,23 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
360 * bound to contexts in another thread, an EGL_BAD_ACCESS error is
366 * "at most one context may be bound to a particular surface at a given
369 - * The latter is more restrictive so we can check only the latter case.
371 - if ((draw && draw->CurrentContext && draw->CurrentContext != ctx) ||
372 - (read && read->CurrentContext && read->CurrentContext != ctx))
373 + if (ctx->Binding && ctx->Binding != t)
374 return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
375 + if (draw && draw->CurrentContext && draw->CurrentContext != ctx) {
376 + if (draw->CurrentContext->Binding != t ||
377 + draw->CurrentContext->ClientAPI != ctx->ClientAPI)
378 + return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
380 + if (read && read->CurrentContext && read->CurrentContext != ctx) {
381 + if (read->CurrentContext->Binding != t ||
382 + read->CurrentContext->ClientAPI != ctx->ClientAPI)
383 + return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
386 /* simply require the configs to be equal */
387 if ((draw && draw->Config != ctx->Config) ||
388 diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
389 index c0164da..3bde397 100644
390 --- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
391 +++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
392 @@ -609,8 +609,10 @@ egl_g3d_wait_client(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
394 gctx->stctxi->flush(gctx->stctxi,
395 PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
396 - screen->fence_finish(screen, fence, 0);
397 - screen->fence_reference(screen, &fence, NULL);
399 + screen->fence_finish(screen, fence, 0);
400 + screen->fence_reference(screen, &fence, NULL);
405 diff --git a/src/gallium/state_trackers/vega/api_context.c b/src/gallium/state_trackers/vega/api_context.c
406 index 0d04d8e..d6bbda5 100644
407 --- a/src/gallium/state_trackers/vega/api_context.c
408 +++ b/src/gallium/state_trackers/vega/api_context.c
409 @@ -73,7 +73,8 @@ void vegaFinish(void)
412 pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
414 - pipe->screen->fence_finish(pipe->screen, fence, 0);
415 - pipe->screen->fence_reference(pipe->screen, &fence, NULL);
417 + pipe->screen->fence_finish(pipe->screen, fence, 0);
418 + pipe->screen->fence_reference(pipe->screen, &fence, NULL);
421 diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
422 index e799674..232deef 100644
423 --- a/src/gallium/state_trackers/vega/vg_manager.c
424 +++ b/src/gallium/state_trackers/vega/vg_manager.c
425 @@ -352,7 +352,7 @@ vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
428 /* only 1.0 is supported */
429 - if (attribs->major != 1 || attribs->minor > 0)
430 + if (attribs->major > 1 || (attribs->major == 1 && attribs->minor > 0))
433 pipe = smapi->screen->context_create(smapi->screen, NULL);
434 diff --git a/src/gallium/state_trackers/xorg/Makefile b/src/gallium/state_trackers/xorg/Makefile
435 index cb2c3ae..7a44d28 100644
436 --- a/src/gallium/state_trackers/xorg/Makefile
437 +++ b/src/gallium/state_trackers/xorg/Makefile
438 @@ -10,7 +10,7 @@ LIBRARY_INCLUDES = \
439 $(shell pkg-config libkms --atleast-version=1.0 \
440 && echo "-DHAVE_LIBKMS") \
441 $(shell pkg-config libkms --silence-errors --cflags-only-I) \
442 - $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
443 + $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
444 -I$(TOP)/src/gallium/include \
445 -I$(TOP)/src/gallium/auxiliary \
447 diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
448 index 26a907f..80af82d 100644
449 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c
450 +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
451 @@ -234,6 +234,10 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
452 64, 64, (void*)image, 64 * 4, 0, 0);
453 ms->ctx->transfer_unmap(ms->ctx, transfer);
454 ms->ctx->transfer_destroy(ms->ctx, transfer);
456 + if (crtc->cursor_shown)
457 + drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
458 + crtcp->cursor_handle, 64, 64);
462 @@ -271,6 +275,10 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
463 memcpy(ptr, image, 64*64*4);
464 kms_bo_unmap(crtcp->cursor_bo);
466 + if (crtc->cursor_shown)
467 + drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
468 + crtcp->cursor_handle, 64, 64);
473 @@ -353,7 +361,7 @@ crtc_destroy(xf86CrtcPtr crtc)
475 drmModeFreeCrtc(crtcp->drm_crtc);
479 crtc->driver_private = NULL;
482 @@ -401,7 +409,7 @@ xorg_crtc_init(ScrnInfoPtr pScrn)
486 - crtcp = xcalloc(1, sizeof(struct crtc_private));
487 + crtcp = calloc(1, sizeof(struct crtc_private));
489 xf86CrtcDestroy(crtc);
491 diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c
492 index 704aed6..b723a8e 100644
493 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c
494 +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c
495 @@ -201,11 +201,11 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
496 DRI2Buffer2Ptr buffer;
497 BufferPrivatePtr private;
499 - buffer = xcalloc(1, sizeof *buffer);
500 + buffer = calloc(1, sizeof *buffer);
504 - private = xcalloc(1, sizeof *private);
505 + private = calloc(1, sizeof *private);
509 @@ -217,9 +217,9 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
510 if (dri2_do_create_buffer(pDraw, (DRI2BufferPtr)buffer, format))
521 @@ -229,8 +229,8 @@ dri2_destroy_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
522 /* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */
523 dri2_do_destroy_buffer(pDraw, (DRI2BufferPtr)buffer);
525 - xfree(buffer->driverPrivate);
527 + free(buffer->driverPrivate);
531 #endif /* DRI2INFOREC_VERSION >= 2 */
532 @@ -244,11 +244,11 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
533 DRI2BufferPtr buffers;
536 - buffers = xcalloc(count, sizeof *buffers);
537 + buffers = calloc(count, sizeof *buffers);
541 - privates = xcalloc(count, sizeof *privates);
542 + privates = calloc(count, sizeof *privates);
546 @@ -263,9 +263,9 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
558 @@ -280,8 +280,8 @@ dri2_destroy_buffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
562 - xfree(buffers[0].driverPrivate);
564 + free(buffers[0].driverPrivate);
569 diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
570 index e10ff2f..1ec772d 100644
571 --- a/src/gallium/state_trackers/xorg/xorg_driver.c
572 +++ b/src/gallium/state_trackers/xorg/xorg_driver.c
574 #include "miscstruct.h"
575 #include "dixstruct.h"
577 +#include "xorgVersion.h"
578 #ifndef XSERVER_LIBPCIACCESS
579 #error "libpciaccess needed"
581 @@ -122,7 +123,7 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
583 xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
585 - char *BusID = xalloc(64);
586 + char *BusID = malloc(64);
587 sprintf(BusID, "pci:%04x:%02x:%02x.%d",
588 device->domain, device->bus,
589 device->dev, device->func);
590 @@ -130,14 +131,14 @@ xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
591 if (drmCheckModesettingSupported(BusID)) {
592 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
593 "Drm modesetting not supported %s\n", BusID);
599 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
600 "Drm modesetting supported on %s\n", BusID);
607 @@ -174,7 +175,7 @@ drv_free_rec(ScrnInfoPtr pScrn)
608 if (!pScrn->driverPrivate)
611 - xfree(pScrn->driverPrivate);
612 + free(pScrn->driverPrivate);
614 pScrn->driverPrivate = NULL;
616 @@ -274,7 +275,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
620 - BusID = xalloc(64);
621 + BusID = malloc(64);
622 sprintf(BusID, "PCI:%d:%d:%d",
623 ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
624 ms->PciInfo->dev, ms->PciInfo->func
625 @@ -283,7 +284,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
627 ms->fd = drmOpen(driver_descriptor.driver_name, BusID);
634 @@ -369,6 +370,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
635 ms = modesettingPTR(pScrn);
640 pScrn->displayWidth = 640; /* default it */
642 @@ -402,19 +404,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
643 if (!drv_init_drm(pScrn))
646 - use3D = cust ? !cust->no_3d : TRUE;
647 - ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
649 - X_CONFIG : X_PROBED;
653 - if (!drv_init_resource_management(pScrn)) {
654 - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
655 - "Gallium3D or libKMS.");
659 pScrn->monitor = pScrn->confScreen->monitor;
660 pScrn->progClock = TRUE;
662 @@ -444,11 +433,24 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
664 /* Process the options */
665 xf86CollectOptions(pScrn, NULL);
666 - if (!(ms->Options = xalloc(sizeof(drv_options))))
667 + if (!(ms->Options = malloc(sizeof(drv_options))))
669 memcpy(ms->Options, drv_options, sizeof(drv_options));
670 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
672 + use3D = cust ? !cust->no_3d : TRUE;
673 + ms->from_3D = xf86GetOptValBool(ms->Options, OPTION_3D_ACCEL,
675 + X_CONFIG : X_PROBED;
679 + if (!drv_init_resource_management(pScrn)) {
680 + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not init "
681 + "Gallium3D or libKMS.");
685 /* Allocate an xf86CrtcConfig */
686 xf86CrtcConfigInit(pScrn, &crtc_config_funcs);
687 xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
688 @@ -791,7 +793,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
690 xf86_cursors_init(pScreen, 64, 64,
691 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
692 - HARDWARE_CURSOR_ARGB);
693 + HARDWARE_CURSOR_ARGB |
694 + ((cust && cust->unhidden_hw_cursor_update) ?
695 + HARDWARE_CURSOR_UPDATE_UNHIDDEN : 0));
697 /* Must force it before EnterVT, so we are in control of VT and
698 * later memory should be bound when allocating, e.g rotate_mem */
699 @@ -862,8 +866,10 @@ drv_leave_vt(int scrnIndex, int flags)
703 - drmModeRmFB(ms->fd, ms->fb_id);
705 + if (ms->fb_id != -1) {
706 + drmModeRmFB(ms->fd, ms->fb_id);
712 @@ -944,7 +950,6 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
716 - drmModeRmFB(ms->fd, ms->fb_id);
717 ms->destroy_front_buffer(pScrn);
720 @@ -1178,6 +1183,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
724 +#if (XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 9, 99, 1, 0))
726 /* This a hack to work around EnableDisableFBAccess setting the pointer
727 * the real fix would be to replace pScrn->EnableDisableFBAccess hook
728 * and set the rootPixmap->devPrivate.ptr to something valid before that.
729 @@ -1187,6 +1194,8 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
731 pScrn->pixmapPrivate.ptr = ptr;
738 diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
739 index 6b2c80f..0e5693d 100644
740 --- a/src/gallium/state_trackers/xorg/xorg_exa.c
741 +++ b/src/gallium/state_trackers/xorg/xorg_exa.c
742 @@ -720,7 +720,7 @@ ExaCreatePixmap(ScreenPtr pScreen, int size, int align)
744 struct exa_pixmap_priv *priv;
746 - priv = xcalloc(1, sizeof(struct exa_pixmap_priv));
747 + priv = calloc(1, sizeof(struct exa_pixmap_priv));
751 @@ -737,7 +737,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
753 pipe_resource_reference(&priv->tex, NULL);
760 @@ -975,7 +975,7 @@ xorg_exa_close(ScrnInfoPtr pScrn)
763 exaDriverFini(pScrn->pScreen);
769 @@ -987,7 +987,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
771 CustomizerPtr cust = ms->cust;
773 - exa = xcalloc(1, sizeof(struct exa_context));
774 + exa = calloc(1, sizeof(struct exa_context));
778 diff --git a/src/gallium/state_trackers/xorg/xorg_output.c b/src/gallium/state_trackers/xorg/xorg_output.c
779 index 61206ed..5555b51 100644
780 --- a/src/gallium/state_trackers/xorg/xorg_output.c
781 +++ b/src/gallium/state_trackers/xorg/xorg_output.c
782 @@ -128,7 +128,7 @@ output_get_modes(xf86OutputPtr output)
783 for (i = 0; i < drm_connector->count_modes; i++) {
784 drm_mode = &drm_connector->modes[i];
786 - mode = xcalloc(1, sizeof(DisplayModeRec));
787 + mode = calloc(1, sizeof(DisplayModeRec));
790 mode->Clock = drm_mode->clock;
791 @@ -195,7 +195,7 @@ output_destroy(xf86OutputPtr output)
793 struct output_private *priv = output->driver_private;
794 drmModeFreeConnector(priv->drm_connector);
797 output->driver_private = NULL;
800 @@ -262,14 +262,14 @@ xorg_output_init(ScrnInfoPtr pScrn)
801 drm_connector->connector_type_id);
804 - priv = xcalloc(sizeof(*priv), 1);
805 + priv = calloc(sizeof(*priv), 1);
810 output = xf86OutputCreate(pScrn, &output_funcs, name);
817 diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h
818 index be1a9fd..a3fb5e5 100644
819 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h
820 +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h
821 @@ -76,6 +76,7 @@ typedef struct _CustomizerRec
822 Bool dirty_throttling;
823 Bool swap_throttling;
825 + Bool unhidden_hw_cursor_update;
826 Bool (*winsys_pre_init) (struct _CustomizerRec *cust, int fd);
827 Bool (*winsys_screen_init)(struct _CustomizerRec *cust);
828 Bool (*winsys_screen_close)(struct _CustomizerRec *cust);
829 diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
830 index f98bd93..f64959f 100644
831 --- a/src/gallium/state_trackers/xorg/xorg_xv.c
832 +++ b/src/gallium/state_trackers/xorg/xorg_xv.c
833 @@ -536,8 +536,10 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
834 dst_surf = xorg_gpu_surface(pPriv->r->pipe->screen, dst);
835 hdtv = ((src_w >= RES_720P_X) && (src_h >= RES_720P_Y));
838 REGION_TRANSLATE(pScrn->pScreen, dstRegion, -pPixmap->screen_x,
842 dxo = dstRegion->extents.x1;
843 dyo = dstRegion->extents.y1;
844 @@ -562,11 +564,16 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
845 int box_y2 = pbox->y2;
846 float diff_x = (float)src_w / (float)dst_w;
847 float diff_y = (float)src_h / (float)dst_h;
848 - float offset_x = box_x1 - dstX + pPixmap->screen_x;
849 - float offset_y = box_y1 - dstY + pPixmap->screen_y;
850 + float offset_x = box_x1 - dstX;
851 + float offset_y = box_y1 - dstY;
856 + offset_x += pPixmap->screen_x;
857 + offset_y += pPixmap->screen_y;
863 diff --git a/src/gallium/targets/Makefile.xorg b/src/gallium/targets/Makefile.xorg
864 index 762c905..87eedd7 100644
865 --- a/src/gallium/targets/Makefile.xorg
866 +++ b/src/gallium/targets/Makefile.xorg
867 @@ -29,7 +29,7 @@ INCLUDES = \
868 LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
870 ifeq ($(MESA_LLVM),1)
873 LDFLAGS += $(LLVM_LDFLAGS)
875 DRIVER_PIPES += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
876 @@ -42,7 +42,7 @@ endif
877 default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
879 $(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES)
880 - $(MKLIB) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
881 + $(MKLIB) -linker $(CC) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
883 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
885 diff --git a/src/gallium/targets/egl/Makefile b/src/gallium/targets/egl/Makefile
886 index 47c24ce..38e60db 100644
887 --- a/src/gallium/targets/egl/Makefile
888 +++ b/src/gallium/targets/egl/Makefile
889 @@ -24,7 +24,9 @@ common_CPPFLAGS := \
890 -I$(TOP)/src/gallium/auxiliary \
891 -I$(TOP)/src/gallium/drivers \
892 -I$(TOP)/src/gallium/include \
893 - -I$(TOP)/src/gallium/winsys
894 + -I$(TOP)/src/gallium/winsys \
899 $(TOP)/src/gallium/drivers/identity/libidentity.a \
900 @@ -41,11 +43,11 @@ egl_SYS := -lm $(DLOPEN_LIBS) -L$(TOP)/$(LIB_DIR) -lEGL
901 egl_LIBS := $(TOP)/src/gallium/state_trackers/egl/libegl.a
903 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
904 -egl_SYS += -lX11 -lXext -lXfixes
905 +egl_SYS += -lX11 -lXext -lXfixes $(LIBDRM_LIB)
906 egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
908 -ifneq ($(findstring kms, $(EGL_PLATFORMS)),)
910 +ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
911 +egl_SYS += $(LIBDRM_LIB)
913 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
914 egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
915 diff --git a/src/gallium/targets/egl/pipe_i965.c b/src/gallium/targets/egl/pipe_i965.c
916 index 43bf646..36b03b3 100644
917 --- a/src/gallium/targets/egl/pipe_i965.c
918 +++ b/src/gallium/targets/egl/pipe_i965.c
921 #include "target-helpers/inline_wrapper_sw_helper.h"
922 #include "target-helpers/inline_debug_helper.h"
923 +#include "target-helpers/inline_wrapper_sw_helper.h"
924 #include "state_tracker/drm_driver.h"
925 #include "i965/drm/i965_drm_public.h"
926 #include "i965/brw_public.h"
927 diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c b/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c
928 index 237b308..9b422e6 100644
929 --- a/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c
930 +++ b/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c
932 * allows X clients to communicate with the driver.
935 +#include <xorg-server.h>
936 #include "dixstruct.h"
937 #include "extnsionst.h"
939 @@ -211,7 +212,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
940 struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
943 - rects = xcalloc(number, sizeof(*rects));
944 + rects = calloc(number, sizeof(*rects));
948 @@ -224,7 +225,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
950 vmw_ioctl_update_layout(vmw, number, rects);
957 diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c b/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c
958 index 7c799b5..7625d2f 100644
959 --- a/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c
960 +++ b/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c
961 @@ -165,7 +165,7 @@ vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *han
962 struct drm_vmw_dmabuf_rep *rep = &arg.rep;
965 - buf = xcalloc(1, sizeof(*buf));
966 + buf = calloc(1, sizeof(*buf));
970 @@ -192,7 +192,7 @@ vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *han
979 @@ -211,7 +211,7 @@ vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf)
980 arg.handle = buf->handle;
981 drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
988 diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_screen.c b/src/gallium/targets/xorg-vmwgfx/vmw_screen.c
989 index 8173908..7662203 100644
990 --- a/src/gallium/targets/xorg-vmwgfx/vmw_screen.c
991 +++ b/src/gallium/targets/xorg-vmwgfx/vmw_screen.c
992 @@ -245,6 +245,7 @@ vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
993 cust->winsys_enter_vt = vmw_screen_enter_vt;
994 cust->winsys_leave_vt = vmw_screen_leave_vt;
996 + cust->unhidden_hw_cursor_update = TRUE;
999 pScrn->driverPrivate = cust;
1000 diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_video.c b/src/gallium/targets/xorg-vmwgfx/vmw_video.c
1001 index eced60d..94465e5 100644
1002 --- a/src/gallium/targets/xorg-vmwgfx/vmw_video.c
1003 +++ b/src/gallium/targets/xorg-vmwgfx/vmw_video.c
1004 @@ -300,7 +300,7 @@ vmw_video_init(struct vmw_customizer *vmw)
1006 overlayAdaptors = &newAdaptor;
1008 - newAdaptors = xalloc((numAdaptors + 1) *
1009 + newAdaptors = malloc((numAdaptors + 1) *
1010 sizeof(XF86VideoAdaptorPtr*));
1012 xf86XVFreeVideoAdaptorRec(newAdaptor);
1013 @@ -320,7 +320,7 @@ vmw_video_init(struct vmw_customizer *vmw)
1017 - xfree(newAdaptors);
1018 + free(newAdaptors);
1021 debug_printf("Initialized VMware Xv extension successfully\n");
1022 @@ -438,7 +438,7 @@ vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw)
1026 - video = xcalloc(1, sizeof(*video));
1027 + video = calloc(1, sizeof(*video));
1029 debug_printf("Not enough memory.\n");
1030 xf86XVFreeVideoAdaptorRec(adaptor);
1031 @@ -742,7 +742,7 @@ vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size,
1035 - out->extra_data = xcalloc(1, size);
1036 + out->extra_data = calloc(1, size);
1038 debug_printf("\t\t%s: allocated buffer %p of size %i\n", __func__, out, size);
1040 @@ -773,7 +773,7 @@ vmw_video_buffer_free(struct vmw_customizer *vmw,
1044 - xfree(out->extra_data);
1045 + free(out->extra_data);
1046 vmw_ioctl_buffer_unmap(vmw, out->buf);
1047 vmw_ioctl_buffer_destroy(vmw, out->buf);
1049 diff --git a/src/mesa/Makefile b/src/mesa/Makefile
1050 index c41c38c..7a6936e 100644
1051 --- a/src/mesa/Makefile
1052 +++ b/src/mesa/Makefile
1053 @@ -34,7 +34,7 @@ ES1_CPPFLAGS := -DFEATURE_ES1=1 $(DEFINES)
1054 ES2_CPPFLAGS := -DFEATURE_ES2=1 $(DEFINES)
1056 # append include dirs
1057 -MESA_CPPFLAGS += $(INCLUDE_DIRS)
1058 +MESA_CPPFLAGS += $(INCLUDE_DIRS) $(TALLOC_CFLAGS)
1059 ES1_CPPFLAGS += -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
1060 ES2_CPPFLAGS += -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
1062 diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c
1063 index dbf4ad4..160e7e7 100644
1064 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c
1065 +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
1066 @@ -319,10 +319,9 @@ static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim)
1070 - return (ctx->Point.PointSprite ||
1071 - ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) &&
1072 - !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ?
1073 - R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS;
1074 + return (((R200_CONTEXT(ctx))->radeon.radeonScreen->drmSupportsPointSprites &&
1075 + !(ctx->_TriangleCaps & DD_POINT_SMOOTH)) ?
1076 + R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS);
1080 @@ -613,6 +612,9 @@ static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim )
1081 r200ContextPtr rmesa = R200_CONTEXT(ctx);
1083 radeon_prepare_render(&rmesa->radeon);
1084 + if (rmesa->radeon.NewGLState)
1085 + r200ValidateState( ctx );
1088 if (rmesa->radeon.swtcl.hw_primitive != hwprim) {
1089 /* need to disable perspective-correct texturing for point sprites */
1090 diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
1091 index 4ae0f30..2743997 100644
1092 --- a/src/mesa/drivers/dri/r200/r200_tcl.c
1093 +++ b/src/mesa/drivers/dri/r200/r200_tcl.c
1094 @@ -68,9 +68,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1098 -#define HW_POINTS ((ctx->Point.PointSprite || \
1099 - ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) && \
1100 - !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ? \
1101 +#define HW_POINTS (((R200_CONTEXT(ctx))->radeon.radeonScreen->drmSupportsPointSprites && \
1102 + !(ctx->_TriangleCaps & DD_POINT_SMOOTH)) ? \
1103 R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS)
1104 #define HW_LINES R200_VF_PRIM_LINES
1105 #define HW_LINE_LOOP 0
1106 @@ -265,6 +264,8 @@ void r200TclPrimitive( GLcontext *ctx,
1107 GLuint newprim = hw_prim | R200_VF_TCL_OUTPUT_VTX_ENABLE;
1109 radeon_prepare_render(&rmesa->radeon);
1110 + if (rmesa->radeon.NewGLState)
1111 + r200ValidateState( ctx );
1113 if (newprim != rmesa->tcl.hw_primitive ||
1114 !discrete_prim[hw_prim&0xf]) {
1115 diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c
1116 index 5ae9f49..767778b 100644
1117 --- a/src/mesa/drivers/dri/r300/r300_draw.c
1118 +++ b/src/mesa/drivers/dri/r300/r300_draw.c
1119 @@ -717,6 +717,10 @@ static void r300DrawPrims(GLcontext *ctx,
1123 + struct r300_context *r300 = R300_CONTEXT(ctx);
1124 + radeonContextPtr radeon = &r300->radeon;
1126 + radeon_prepare_render(radeon);
1128 /* This check should get folded into just the places that
1129 * min/max index are really needed.
1130 diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
1131 index cf89ab7..bb8f914 100644
1132 --- a/src/mesa/drivers/dri/r300/r300_render.c
1133 +++ b/src/mesa/drivers/dri/r300/r300_render.c
1134 @@ -327,8 +327,6 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim)
1135 BATCH_LOCALS(&rmesa->radeon);
1136 int type, num_verts;
1138 - radeon_prepare_render(&rmesa->radeon);
1140 type = r300PrimitiveType(rmesa, prim);
1141 num_verts = r300NumVerts(rmesa, end - start, prim);
1143 diff --git a/src/mesa/drivers/dri/r600/evergreen_render.c b/src/mesa/drivers/dri/r600/evergreen_render.c
1144 index 27089bf..1fa53d7 100644
1145 --- a/src/mesa/drivers/dri/r600/evergreen_render.c
1146 +++ b/src/mesa/drivers/dri/r600/evergreen_render.c
1147 @@ -909,6 +909,10 @@ static void evergreenDrawPrims(GLcontext *ctx,
1149 GLboolean retval = GL_FALSE;
1151 + context_t *context = EVERGREEN_CONTEXT(ctx);
1152 + radeonContextPtr radeon = &context->radeon;
1153 + radeon_prepare_render(radeon);
1155 /* This check should get folded into just the places that
1156 * min/max index are really needed.
1158 diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
1159 index 85e4988..d4c7864 100644
1160 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
1161 +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
1162 @@ -251,9 +251,9 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
1163 radeon->texture_rect_row_align = 512;
1164 radeon->texture_compressed_row_align = 512;
1166 - radeon->texture_row_align = 256;
1167 - radeon->texture_rect_row_align = 256;
1168 - radeon->texture_compressed_row_align = 256;
1169 + radeon->texture_row_align = radeon->radeonScreen->group_bytes;
1170 + radeon->texture_rect_row_align = radeon->radeonScreen->group_bytes;
1171 + radeon->texture_compressed_row_align = radeon->radeonScreen->group_bytes;
1173 } else if (IS_R200_CLASS(radeon->radeonScreen) ||
1174 IS_R100_CLASS(radeon->radeonScreen)) {
1175 @@ -521,6 +521,7 @@ void radeon_prepare_render(radeonContextPtr radeon)
1176 __DRIcontext *driContext = radeon->dri.context;
1177 __DRIdrawable *drawable;
1178 __DRIscreen *screen;
1179 + struct radeon_framebuffer *draw;
1181 screen = driContext->driScreenPriv;
1182 if (!screen->dri2.loader)
1183 @@ -531,9 +532,10 @@ void radeon_prepare_render(radeonContextPtr radeon)
1184 if (drawable->lastStamp != drawable->dri2.stamp)
1185 radeon_update_renderbuffers(driContext, drawable, GL_FALSE);
1187 - /* Intel driver does the equivalent of this, no clue if it is needed:
1188 - * radeon_draw_buffer(radeon->glCtx, &(drawable->driverPrivate)->base);
1190 + /* Intel driver does the equivalent of this, no clue if it is needed:*/
1191 + draw = drawable->driverPrivate;
1192 + radeon_draw_buffer(radeon->glCtx, &draw->base);
1194 driContext->dri2.draw_stamp = drawable->dri2.stamp;
1197 @@ -738,10 +740,9 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable,
1202 fprintf(stderr, "failed to attach %s %d\n",
1203 regname, buffers[i].name);
1208 ret = radeon_bo_get_tiling(bo, &tiling_flags, &pitch);
1209 diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
1210 index 2ea77e5..0ca052d 100644
1211 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c
1212 +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
1213 @@ -1138,6 +1138,8 @@ radeonCreateScreen( __DRIscreen *sPriv )
1215 screen->chip_flags |= RADEON_CLASS_R600;
1217 + /* set group bytes for r6xx+ */
1218 + screen->group_bytes = 256;
1219 screen->cpp = dri_priv->bpp / 8;
1220 screen->AGPMode = dri_priv->AGPMode;
1222 @@ -1382,7 +1384,8 @@ radeonCreateScreen2(__DRIscreen *sPriv)
1224 screen->chip_flags |= RADEON_CLASS_R600;
1226 - /* r6xx+ tiling */
1227 + /* r6xx+ tiling, default to 256 group bytes */
1228 + screen->group_bytes = 256;
1229 if (IS_R600_CLASS(screen) && (sPriv->drm_version.minor >= 6)) {
1230 ret = radeonGetParam(sPriv, RADEON_INFO_TILE_CONFIG, &temp);
1232 diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
1233 index 29defe7..0a81843 100644
1234 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
1235 +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
1236 @@ -412,6 +412,8 @@ static GLboolean radeon_run_render( GLcontext *ctx,
1239 radeon_prepare_render(&rmesa->radeon);
1240 + if (rmesa->radeon.NewGLState)
1241 + radeonValidateState( ctx );
1243 tnl->Driver.Render.Start( ctx );
1245 diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c
1246 index 5e1718f..ded3ebe 100644
1247 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c
1248 +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c
1249 @@ -253,6 +253,8 @@ void radeonTclPrimitive( GLcontext *ctx,
1250 GLuint newprim = hw_prim | RADEON_CP_VC_CNTL_TCL_ENABLE;
1252 radeon_prepare_render(&rmesa->radeon);
1253 + if (rmesa->radeon.NewGLState)
1254 + radeonValidateState( ctx );
1256 if (newprim != rmesa->tcl.hw_primitive ||
1257 !discrete_prim[hw_prim&0xf]) {
1258 diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
1259 index 4797f29..d9eaada 100644
1260 --- a/src/mesa/main/bufferobj.c
1261 +++ b/src/mesa/main/bufferobj.c
1266 + * Used as a placeholder for buffer objects between glGenBuffers() and
1267 + * glBindBuffer() so that glIsBuffer() can work correctly.
1269 +static struct gl_buffer_object DummyBufferObject;
1273 * Return pointer to address of a buffer object target.
1274 * \param ctx the GL context
1275 * \param target the buffer object target to be retrieved.
1276 @@ -554,6 +561,9 @@ _mesa_copy_buffer_subdata(GLcontext *ctx,
1278 _mesa_init_buffer_objects( GLcontext *ctx )
1280 + memset(&DummyBufferObject, 0, sizeof(DummyBufferObject));
1281 + DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */
1283 _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj,
1284 ctx->Shared->NullBufferObj);
1285 _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj,
1286 @@ -611,8 +621,10 @@ bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer)
1288 /* non-default buffer object */
1289 newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
1291 - /* if this is a new buffer object id, allocate a buffer object now */
1292 + if (!newBufObj || newBufObj == &DummyBufferObject) {
1293 + /* If this is a new buffer object id, or one which was generated but
1294 + * never used before, allocate a buffer object now.
1296 ASSERT(ctx->Driver.NewBufferObject);
1297 newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target);
1299 @@ -992,7 +1004,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
1300 struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
1303 - ASSERT(bufObj->Name == ids[i]);
1304 + ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
1306 if (_mesa_bufferobj_mapped(bufObj)) {
1307 /* if mapped, unmap it now */
1308 @@ -1033,7 +1045,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
1311 /* The ID is immediately freed for re-use */
1312 - _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name);
1313 + _mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]);
1314 _mesa_reference_buffer_object(ctx, &bufObj, NULL);
1317 @@ -1072,18 +1084,10 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer)
1319 first = _mesa_HashFindFreeKeyBlock(ctx->Shared->BufferObjects, n);
1321 - /* Allocate new, empty buffer objects and return identifiers */
1322 + /* Insert the ID and pointer to dummy buffer object into hash table */
1323 for (i = 0; i < n; i++) {
1324 - struct gl_buffer_object *bufObj;
1325 - GLuint name = first + i;
1326 - GLenum target = 0;
1327 - bufObj = ctx->Driver.NewBufferObject( ctx, name, target );
1329 - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
1330 - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenBuffersARB");
1333 - _mesa_HashInsert(ctx->Shared->BufferObjects, first + i, bufObj);
1334 + _mesa_HashInsert(ctx->Shared->BufferObjects, first + i,
1335 + &DummyBufferObject);
1336 buffer[i] = first + i;
1339 @@ -1109,7 +1113,7 @@ _mesa_IsBufferARB(GLuint id)
1340 bufObj = _mesa_lookup_bufferobj(ctx, id);
1341 _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
1343 - return bufObj ? GL_TRUE : GL_FALSE;
1344 + return bufObj && bufObj != &DummyBufferObject;
1348 diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
1349 index 9db9f1c..c3fe8a3 100644
1350 --- a/src/mesa/main/formats.c
1351 +++ b/src/mesa/main/formats.c
1352 @@ -1109,6 +1109,7 @@ _mesa_format_to_type_and_comps(gl_format format,
1353 case MESA_FORMAT_ARGB8888:
1354 case MESA_FORMAT_ARGB8888_REV:
1355 case MESA_FORMAT_XRGB8888:
1356 + case MESA_FORMAT_XRGB8888_REV:
1357 *datatype = GL_UNSIGNED_BYTE;
1360 @@ -1135,6 +1136,11 @@ _mesa_format_to_type_and_comps(gl_format format,
1364 + case MESA_FORMAT_RGBA5551:
1365 + *datatype = GL_UNSIGNED_SHORT_5_5_5_1;
1369 case MESA_FORMAT_AL88:
1370 case MESA_FORMAT_AL88_REV:
1371 *datatype = GL_UNSIGNED_BYTE;
1372 @@ -1156,6 +1162,7 @@ _mesa_format_to_type_and_comps(gl_format format,
1373 case MESA_FORMAT_L8:
1374 case MESA_FORMAT_I8:
1375 case MESA_FORMAT_CI8:
1376 + case MESA_FORMAT_S8:
1377 *datatype = GL_UNSIGNED_BYTE;
1380 @@ -1201,12 +1208,26 @@ _mesa_format_to_type_and_comps(gl_format format,
1384 + case MESA_FORMAT_SIGNED_R8:
1385 + *datatype = GL_BYTE;
1388 + case MESA_FORMAT_SIGNED_RG88:
1389 + *datatype = GL_BYTE;
1392 case MESA_FORMAT_SIGNED_RGBA8888:
1393 case MESA_FORMAT_SIGNED_RGBA8888_REV:
1394 + case MESA_FORMAT_SIGNED_RGBX8888:
1395 *datatype = GL_BYTE;
1399 + case MESA_FORMAT_RGBA_16:
1400 + *datatype = GL_UNSIGNED_SHORT;
1404 case MESA_FORMAT_SIGNED_R_16:
1405 *datatype = GL_SHORT;
1407 @@ -1331,9 +1352,14 @@ _mesa_format_to_type_and_comps(gl_format format,
1412 + case MESA_FORMAT_NONE:
1413 + case MESA_FORMAT_COUNT:
1414 + /* For debug builds, warn if any formats are not handled */
1417 - _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps");
1419 + _mesa_problem(NULL, "bad format %s in _mesa_format_to_type_and_comps",
1420 + _mesa_get_format_name(format));
1424 diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
1425 index 3d1a4c4..71aa8c2 100644
1426 --- a/src/mesa/main/mipmap.c
1427 +++ b/src/mesa/main/mipmap.c
1428 @@ -288,6 +288,54 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
1429 dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
1433 + else if (datatype == GL_SHORT && comps == 4) {
1435 + const GLshort(*rowA)[4] = (const GLshort(*)[4]) srcRowA;
1436 + const GLshort(*rowB)[4] = (const GLshort(*)[4]) srcRowB;
1437 + GLshort(*dst)[4] = (GLshort(*)[4]) dstRow;
1438 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1439 + i++, j += colStride, k += colStride) {
1440 + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4;
1441 + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4;
1442 + dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4;
1443 + dst[i][3] = (rowA[j][3] + rowA[k][3] + rowB[j][3] + rowB[k][3]) / 4;
1446 + else if (datatype == GL_SHORT && comps == 3) {
1448 + const GLshort(*rowA)[3] = (const GLshort(*)[3]) srcRowA;
1449 + const GLshort(*rowB)[3] = (const GLshort(*)[3]) srcRowB;
1450 + GLshort(*dst)[3] = (GLshort(*)[3]) dstRow;
1451 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1452 + i++, j += colStride, k += colStride) {
1453 + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4;
1454 + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4;
1455 + dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4;
1458 + else if (datatype == GL_SHORT && comps == 2) {
1460 + const GLshort(*rowA)[2] = (const GLshort(*)[2]) srcRowA;
1461 + const GLshort(*rowB)[2] = (const GLshort(*)[2]) srcRowB;
1462 + GLshort(*dst)[2] = (GLshort(*)[2]) dstRow;
1463 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1464 + i++, j += colStride, k += colStride) {
1465 + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4;
1466 + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4;
1469 + else if (datatype == GL_SHORT && comps == 1) {
1471 + const GLshort *rowA = (const GLshort *) srcRowA;
1472 + const GLshort *rowB = (const GLshort *) srcRowB;
1473 + GLshort *dst = (GLshort *) dstRow;
1474 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1475 + i++, j += colStride, k += colStride) {
1476 + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
1480 else if (datatype == GL_FLOAT && comps == 4) {
1482 const GLfloat(*rowA)[4] = (const GLfloat(*)[4]) srcRowA;
1483 @@ -507,6 +555,37 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
1484 dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red;
1487 + else if (datatype == GL_UNSIGNED_SHORT_5_5_5_1 && comps == 4) {
1489 + const GLushort *rowA = (const GLushort *) srcRowA;
1490 + const GLushort *rowB = (const GLushort *) srcRowB;
1491 + GLushort *dst = (GLushort *) dstRow;
1492 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1493 + i++, j += colStride, k += colStride) {
1494 + const GLint rowAr0 = (rowA[j] >> 11) & 0x1f;
1495 + const GLint rowAr1 = (rowA[k] >> 11) & 0x1f;
1496 + const GLint rowBr0 = (rowB[j] >> 11) & 0x1f;
1497 + const GLint rowBr1 = (rowB[k] >> 11) & 0x1f;
1498 + const GLint rowAg0 = (rowA[j] >> 6) & 0x1f;
1499 + const GLint rowAg1 = (rowA[k] >> 6) & 0x1f;
1500 + const GLint rowBg0 = (rowB[j] >> 6) & 0x1f;
1501 + const GLint rowBg1 = (rowB[k] >> 6) & 0x1f;
1502 + const GLint rowAb0 = (rowA[j] >> 1) & 0x1f;
1503 + const GLint rowAb1 = (rowA[k] >> 1) & 0x1f;
1504 + const GLint rowBb0 = (rowB[j] >> 1) & 0x1f;
1505 + const GLint rowBb1 = (rowB[k] >> 1) & 0x1f;
1506 + const GLint rowAa0 = (rowA[j] & 0x1);
1507 + const GLint rowAa1 = (rowA[k] & 0x1);
1508 + const GLint rowBa0 = (rowB[j] & 0x1);
1509 + const GLint rowBa1 = (rowB[k] & 0x1);
1510 + const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2;
1511 + const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2;
1512 + const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2;
1513 + const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2;
1514 + dst[i] = (red << 11) | (green << 6) | (blue << 1) | alpha;
1518 else if (datatype == GL_UNSIGNED_BYTE_3_3_2 && comps == 3) {
1520 const GLubyte *rowA = (const GLubyte *) srcRowA;
1521 @@ -606,7 +685,7 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth,
1525 - if ((datatype == GL_BYTE) && (comps == 4)) {
1526 + else if ((datatype == GL_BYTE) && (comps == 4)) {
1527 DECLARE_ROW_POINTERS(GLbyte, 4);
1529 for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1530 @@ -682,6 +761,44 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth,
1534 + else if ((datatype == GL_SHORT) && (comps == 4)) {
1535 + DECLARE_ROW_POINTERS(GLshort, 4);
1537 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1538 + i++, j += colStride, k += colStride) {
1545 + else if ((datatype == GL_SHORT) && (comps == 3)) {
1546 + DECLARE_ROW_POINTERS(GLshort, 3);
1548 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1549 + i++, j += colStride, k += colStride) {
1555 + else if ((datatype == GL_SHORT) && (comps == 2)) {
1556 + DECLARE_ROW_POINTERS(GLshort, 2);
1558 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1559 + i++, j += colStride, k += colStride) {
1564 + else if ((datatype == GL_SHORT) && (comps == 1)) {
1565 + DECLARE_ROW_POINTERS(GLshort, 1);
1567 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1568 + i++, j += colStride, k += colStride) {
1572 else if ((datatype == GL_FLOAT) && (comps == 4)) {
1573 DECLARE_ROW_POINTERS(GLfloat, 4);
1575 @@ -910,6 +1027,55 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth,
1576 dst[i] = (a << 15) | (b << 10) | (g << 5) | r;
1579 + else if ((datatype == GL_UNSIGNED_SHORT_5_5_5_1) && (comps == 4)) {
1580 + DECLARE_ROW_POINTERS0(GLushort);
1582 + for (i = j = 0, k = k0; i < (GLuint) dstWidth;
1583 + i++, j += colStride, k += colStride) {
1584 + const GLint rowAr0 = (rowA[j] >> 11) & 0x1f;
1585 + const GLint rowAr1 = (rowA[k] >> 11) & 0x1f;
1586 + const GLint rowBr0 = (rowB[j] >> 11) & 0x1f;
1587 + const GLint rowBr1 = (rowB[k] >> 11) & 0x1f;
1588 + const GLint rowCr0 = (rowC[j] >> 11) & 0x1f;
1589 + const GLint rowCr1 = (rowC[k] >> 11) & 0x1f;
1590 + const GLint rowDr0 = (rowD[j] >> 11) & 0x1f;
1591 + const GLint rowDr1 = (rowD[k] >> 11) & 0x1f;
1592 + const GLint rowAg0 = (rowA[j] >> 6) & 0x1f;
1593 + const GLint rowAg1 = (rowA[k] >> 6) & 0x1f;
1594 + const GLint rowBg0 = (rowB[j] >> 6) & 0x1f;
1595 + const GLint rowBg1 = (rowB[k] >> 6) & 0x1f;
1596 + const GLint rowCg0 = (rowC[j] >> 6) & 0x1f;
1597 + const GLint rowCg1 = (rowC[k] >> 6) & 0x1f;
1598 + const GLint rowDg0 = (rowD[j] >> 6) & 0x1f;
1599 + const GLint rowDg1 = (rowD[k] >> 6) & 0x1f;
1600 + const GLint rowAb0 = (rowA[j] >> 1) & 0x1f;
1601 + const GLint rowAb1 = (rowA[k] >> 1) & 0x1f;
1602 + const GLint rowBb0 = (rowB[j] >> 1) & 0x1f;
1603 + const GLint rowBb1 = (rowB[k] >> 1) & 0x1f;
1604 + const GLint rowCb0 = (rowC[j] >> 1) & 0x1f;
1605 + const GLint rowCb1 = (rowC[k] >> 1) & 0x1f;
1606 + const GLint rowDb0 = (rowD[j] >> 1) & 0x1f;
1607 + const GLint rowDb1 = (rowD[k] >> 1) & 0x1f;
1608 + const GLint rowAa0 = (rowA[j] & 0x1);
1609 + const GLint rowAa1 = (rowA[k] & 0x1);
1610 + const GLint rowBa0 = (rowB[j] & 0x1);
1611 + const GLint rowBa1 = (rowB[k] & 0x1);
1612 + const GLint rowCa0 = (rowC[j] & 0x1);
1613 + const GLint rowCa1 = (rowC[k] & 0x1);
1614 + const GLint rowDa0 = (rowD[j] & 0x1);
1615 + const GLint rowDa1 = (rowD[k] & 0x1);
1616 + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1,
1617 + rowCr0, rowCr1, rowDr0, rowDr1);
1618 + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1,
1619 + rowCg0, rowCg1, rowDg0, rowDg1);
1620 + const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1,
1621 + rowCb0, rowCb1, rowDb0, rowDb1);
1622 + const GLint a = FILTER_SUM_3D(rowAa0, rowAa1, rowBa0, rowBa1,
1623 + rowCa0, rowCa1, rowDa0, rowDa1);
1625 + dst[i] = (r << 11) | (g << 6) | (b << 1) | a;
1628 else if ((datatype == GL_UNSIGNED_BYTE_3_3_2) && (comps == 3)) {
1629 DECLARE_ROW_POINTERS0(GLushort);
1631 diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
1632 index 3145416..c54baf4 100644
1633 --- a/src/mesa/state_tracker/st_cb_eglimage.c
1634 +++ b/src/mesa/state_tracker/st_cb_eglimage.c
1635 @@ -129,6 +129,7 @@ st_bind_surface(GLcontext *ctx, GLenum target,
1637 /* FIXME create a non-default sampler view from the pipe_surface? */
1638 pipe_resource_reference(&stObj->pt, ps->texture);
1639 + pipe_sampler_view_reference(&stObj->sampler_view, NULL);
1640 pipe_resource_reference(&stImage->pt, stObj->pt);
1642 stObj->width0 = ps->width;
1643 diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
1644 index 66e32b4..cd418a0 100644
1645 --- a/src/mesa/state_tracker/st_manager.c
1646 +++ b/src/mesa/state_tracker/st_manager.c
1647 @@ -486,9 +486,18 @@ st_context_notify_invalid_framebuffer(struct st_context_iface *stctxi,
1648 stfb = st_ws_framebuffer(st->ctx->WinSysDrawBuffer);
1649 if (!stfb || stfb->iface != stfbi)
1650 stfb = st_ws_framebuffer(st->ctx->WinSysReadBuffer);
1651 - assert(stfb && stfb->iface == stfbi);
1653 - p_atomic_set(&stfb->revalidate, TRUE);
1654 + if (stfb && stfb->iface == stfbi) {
1655 + p_atomic_set(&stfb->revalidate, TRUE);
1658 + /* This function is probably getting called when we've detected a
1659 + * change in a window's size but the currently bound context is
1660 + * not bound to that window.
1661 + * If the st_framebuffer_iface structure had a pointer to the
1662 + * corresponding st_framebuffer we'd be able to handle this.
1668 diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
1669 index 3fc554c..198f0e2 100644
1670 --- a/src/mesa/swrast/s_texfilter.c
1671 +++ b/src/mesa/swrast/s_texfilter.c
1672 @@ -2972,11 +2972,16 @@ choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda)
1676 - lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
1678 - level = (GLint) lambda;
1680 - level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
1681 + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) {
1682 + /* no mipmapping - use base level */
1683 + level = tObj->BaseLevel;
1686 + /* choose mipmap level */
1687 + lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
1688 + level = (GLint) lambda;
1689 + level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);