Compare commits

..

1479 Commits
useful ... 7.11

Author SHA1 Message Date
Jonas Maebe
1bdf31e8da darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 5fdf1f784b)
2012-09-24 16:07:14 -07:00
Jeremy Huddleston
ecf0bef4cd darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d65bd195ec)
2012-05-16 18:59:30 -07:00
Jeremy Huddleston
60fa18b90f darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit a73a800b32)
2012-05-16 18:59:28 -07:00
Jeremy Huddleston
62058968e7 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
(cherry picked from commit 1a33c1b2b8)
2012-04-24 00:27:44 -07:00
Jonas Maebe
1fa6c87c88 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c60ffd2840)
2012-04-23 16:18:36 -07:00
Jonas Maebe
00d310a130 glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8d09f4d0cc)
2012-04-22 20:41:36 -07:00
Jeremy Huddleston
906f670f1a configure.ac: Don't use $CLANG since it will collide with the static analyzer.
We just prefix the $CLANG environment variable in configure.ac with acv_mesa_

Found by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b728eefb06)
2012-01-27 09:05:10 -08:00
Anuj Phogat
9ae2499be2 mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D()
with width = 0. Texture with zero size skips miptree allocation due to a
condition in function _mesa_store_teximage3d(). While calling glGetTexImage()
it results in assertion failure in intel_map_texture_image() due to null mt
pointer.

This patch fixes the issue by detecting the zero size texture early in
glGetTexImage and glGetCompressedTexImage functions. In such a case function
simply returns doing nothing.
Verified that below mentioned bug is fixed by this patch.

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

NOTE: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f1a9a9bcd1)

Conflicts:

	src/mesa/main/teximage.h
2012-01-19 12:56:15 -08:00
Anuj Phogat
9b3ac17991 intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation
fault in function intelDRI2Flush. All the gl calls should be
ignored after setting the current context to null. So the contents
of framebuffer stay unchanged. But the driver should not seg fault.

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

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Yi Sun <yi.sun@intel.com>
(cherry picked from commit dd7220652e)

Conflicts:

	src/mesa/drivers/dri/intel/intel_screen.c
2012-01-19 12:56:15 -08:00
Vinson Lee
d7d47d6c0b i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e18ad7fd7)
2012-01-19 12:56:15 -08:00
Paul Berry
29f07f6461 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f6f43bd5a2)
2012-01-19 12:56:15 -08:00
Brian Paul
1f18137d28 glw: s/lighgrey/lightgrey/
http://bugs.freedesktop.org/show_bug.cgi?id=44844
2012-01-16 15:07:23 -07:00
Ian Romanick
7722a54e60 glsl: Don't use base type for bit-not when there's an error
Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit 3946448951)
2012-01-04 12:44:49 -08:00
Ian Romanick
bc507471db glsl: Clamp vector indices when lowering to swizzles
This prevents other code from seeing a swizzle of the 16th component
of a vector, for example.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Christian Holler <choller@mozilla.com>
(cherry picked from commit 6f5c737970)
2012-01-03 19:23:15 -08:00
Ian Romanick
42d1a7b3de glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"
ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f0dd21ac88)
2011-12-22 17:01:53 -08:00
Marcin Slusarz
237d6fa97a nv50/nvc0: fix crash when channel allocation fails 2011-12-11 17:00:42 +01:00
Christoph Bumiller
0e9b79c22a nv50,nvc0: use screen instead of context for flush notifier
Context may become NULL and we still have to be able to flush
pending fences.

(Cherry picked from commit 3069a7eaa5)
Fixes crash on screen shutdown: https://bugs.freedesktop.org/show_bug.cgi?id=43428
2011-12-11 16:58:09 +01:00
Brian Paul
7a18f005ed gallivm: fix build with llvm 3.0svn
https://bugs.freedesktop.org/show_bug.cgi?id=41065
(cherry picked from commit 51002968c9)
2011-12-05 08:58:18 -07:00
Tobias Droste
95a3724c69 gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn added SubtargetInfo as additional parameter to
createMCDisassembler() and createMCInstPrinter().
See revision 139237 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 1795372fee)
2011-12-05 08:58:12 -07:00
Tobias Droste
98e8fb84de gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn moved TargetRegistry.h and TargetSelect.h.
See revision 138450 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
(cherry picked from commit 4a468de2d7)
2011-12-05 08:58:06 -07:00
Tobias Droste
5b5c436c65 llvmpipe: fix build with LLVM 3.0svn
LLVM 3.0svn introduced a new type system. It defines a new way to create
named structs and removes the (now not needed) LLVMInvalidateStructLayout
function.  See revision 134829 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3143e95353)
2011-12-05 08:58:00 -07:00
Vinson Lee
970df845ef gallivm: Rename createAsmInfo to createMCAsmInfo with llvm-3.0.
llvm-3.0svn r135219 renamed createAsmInfo to createMCAsmInfo in
include/llvm/Target/TargetRegistry.h.
(cherry picked from commit 9228bfb375)
2011-12-05 08:57:49 -07:00
Vinson Lee
32f4a83fe8 gallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.
LLVMUnionTypeKind is not in llvm-2.6, llvm-2.8, llvm-2.9, or llvm-3.0svn.
(cherry picked from commit 1844ae7e7e)
2011-12-05 08:57:42 -07:00
Vinson Lee
2c1998b3b9 gallivm: Remove LLVMOpaqueKindType case with llvm-3.0.
llvm-3.0svn r134829 removed LLVMOpaqueKindType from enum LLVMTypeKind in
include/llvm-c/Core.h.
(cherry picked from commit e4189f2e2e)
2011-12-05 08:57:11 -07:00
Vinson Lee
a3337a66ef gallivm: Rename TargetInstrDesc to MCInstrDesc when using llvm-3.0.
llvm-3.0svn revision 134021 renamed TargetInstrDesc to MCInstrDesc.
(cherry picked from commit b61e56756c)
2011-12-05 08:57:00 -07:00
Brian Paul
25ba654229 docs: update news, relnotes list for 7.11.2 release 2011-11-28 08:24:19 -07:00
Ian Romanick
733478975d docs: Add 7.11.2 release md5sums 2011-11-27 14:06:59 -08:00
Ian Romanick
ea72e3cda8 docs: Add 7.11.2 release notes 2011-11-27 14:04:48 -08:00
Ian Romanick
835205e295 mesa: Bump version to 7.11.2 (final) 2011-11-27 14:04:05 -08:00
Chad Versace
2a45566587 intel: Fix separate stencil in builtin DRI2 backend
intelAllocateBuffer() was oblivious to separate stencil buffers.  This
patch fixes it to allocate a non-tiled stencil buffer with special pitch,
just as the DDX does.

Without this, any app that attempted to create an EGL surface with stencil
bits would crash. Of course, this affected only environments that used the
builtin DRI2 backend, such as Android and Wayland.

Fixes GLBenchmark2.1 on Android on gen7.

Note: This is a candidate for the 7.11 branch.
Tested-by: Louie Tsaie <louie.tsai@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 79653c12d6)

Conflicts:

	src/mesa/drivers/dri/intel/intel_screen.c
2011-11-21 16:11:50 -08:00
Chad Versace
68060d6bfd intel: Fix region dimensions for stencil buffers received from DDX
I changed the dimensions of the stencil buffer's region, as allocated by
the DDX, at xf86-video-intel commit
   commit 3e55f3e88b40471706d5cd45c4df4010f8675c75
   dri: Do not tile stencil buffer
But I forgot to make the analogous update to the Intel DRI2 glue in Mesa.
This patch makes that update.

Surprisingly, the mismatch did not cause any bugs. But the mismatch, if
left unfixed, *would* create bugs in the next commit.

Note: This is a candidate for the 7.11 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 50b3356078)
2011-11-21 16:10:49 -08:00
Chad Versace
fd35fab340 intel: Simplify stencil detiling arithmetic
When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit dc4c3a31c6)

Conflicts:

	src/mesa/drivers/dri/intel/intel_fbo.c
	src/mesa/drivers/dri/intel/intel_span.c
2011-11-21 16:10:22 -08:00
Brian Paul
658d994473 mesa: use format string in _mesa_error() call to silence warning
(cherry picked from commit 5485192fc8)
2011-11-21 19:49:48 +01:00
Brian Paul
8a8ccc00b5 docs: update news.html and relnotes.html for 7.11.1 release 2011-11-21 09:16:38 -07:00
Brian Paul
21364bd09d mesa: fix format selection for meta CopyTexSubImage()
When we do a glReadPixels into the temporary buffer, we don't want to
use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will
compute L=R+G+B which is not what we want.

This bug has existed all along but was only exposed by the elimination
of the driver hook for glCopyTexImage() in
5874890c26.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e4fdc95277)

(cherry-pick note: This patch and the one before it combine to fix
CopyTexImage from RGBA window to LA texture.  This was believed to
already be fixed by commit 296e6b9, but these changes were also
necessary.)
2011-11-18 12:18:19 -08:00
Brian Paul
6b2c771ddd mesa: stop using ctx->Driver.CopyTexImage1D/2D() hooks
(cherry picked from commit 5874890c26)
2011-11-18 12:12:22 -08:00
Ian Romanick
22ff4ec969 mesa: set version string to 7.11.2-devel 2011-11-18 11:06:33 -08:00
Ian Romanick
228da884c9 docs: Add 7.11.1 release md5sums 2011-11-17 12:12:34 -08:00
Ian Romanick
c0009739bf docs: Add 7.11.1 release notes 2011-11-17 11:45:06 -08:00
Ian Romanick
bb7d993953 mesa: set version string to 7.11.1 2011-11-17 11:44:08 -08:00
Eric Anholt
172de77b12 glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.
A driver trying to set up builtin uniforms is faced with a problem:
How do I walk the ir_variable structure (representing an array of
structs, or array of matrices, or struct, or whatever), and set up
driver structures so that dereference of that uniform gets the
corresponding ParameterValues[] entry.  The rule in general is that
each corresponding vector-sized field of an array of structs is one
builtin uniform state slot.  i965 relied on another invariant: each
state slot has a number of unique channel swizzles corresponding to
the number of elements in the field's vector, to avoid needing to walk
the glsl_type in parallel to get at vector_elements.

All of the builtin uniforms followed this behavior, except for
gl_NormalMatrix.  That's a mat3 (so 3 vec3s), but it was swizzled as 3
vec4s.

Fixes piglit glsl-fs-normalmatrix.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit cc4ddc3a1e)
2011-11-10 10:36:52 -08:00
Kenneth Graunke
6b151886fd mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.
It's required for ES 1.0 and 1.1, and isn't specified for ES 2.

While the comment says Mesa depends on it internally, removing it from
ES2 doesn't seem to regress any Piglit or ES2 conformance tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 5785cd2bf5)
2011-11-10 10:21:14 -08:00
José Fonseca
436db5df9c docs: Update llvmpipe docs.
Recommend LLVM 2.9, it has been working quite well, and unlike earlier
versions, it works out-of-the-box without patches.

Update Windows instructions.
2011-11-05 11:03:11 +00:00
Yuanhan Liu
5459781715 intel: don't call unmap pbo if pbo is not mapped
The PBO only needs to be unmapped if one of the previous calls to
_mesa_validate_pbo_* succeeded.  In this case, pixels will be
non-NULL.  Various paths through _mesa_unmap_texmiage_pbo can hit
assertion failures or segfaults if the buffer is not mapped.

To work around this, move the call to _mesa_unmap_teximage_pbo inside
the last 'if (pixels)' block.

NOTE: this is just for 7.11 stable branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42268
2011-11-03 11:55:39 -07:00
Michel Dänzer
b95767a57a r300g: Fix queries on big endian hosts.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-11-02 22:29:14 +01:00
Michel Dänzer
f60e81ecb2 gallium/util: Add macros for converting from little endian to CPU byte order.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4a3be16fd2)
2011-11-02 22:29:07 +01:00
Marek Olšák
d15ce8dd29 r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo
This was dead code anyway.
(cherry picked from commit 21e3c585f7)
2011-11-02 22:27:05 +01:00
Tom Fogal
449b301eec Only use gcc visibility support with gcc4+.
I had a colleague hitting issues compiling with an old gcc3.2
system.  These patches got them through.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry-picked from commit cbb2b4149b)
2011-11-02 12:58:34 -06:00
Adam Jackson
4464ee1a9a glx: Don't enable INTEL_swap_event unconditionally
DRI2 supports this now - and already enables it explicitly - but drisw
does not and should not.  Otherwise toolkits like clutter will only ever
SwapBuffers once and wait forever for an event that's not coming.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 25620eb1d2)
2011-10-28 20:41:45 -04:00
Kenneth Graunke
439628318b i965: Apply post-sync non-zero workaround to homebrew workaround.
In commit 3e5d3626, Eric added a homebrew workaround to fix GPU hangs in
the Mesa "engine" demo and oglc's api-texcoord test.

Unfortunately, his PIPE_CONTROL contains a Depth Stall, which
necessitates the post-sync non-zero workaround,

Fixes GPU hangs in Civilization 4, PlaneShift, Minecraft, Neverwinter
Nights, 3DMMES, and hopefully Heroes of Newerth as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41096
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Joel <k00_fol@k.kth.se> (Neverwinter Nights)
Tested-by: brot <brot@minad.de> (Minecraft)
Tested-by: Eric Anholt <eric@anholt.net> (3DMMES)
Tested-by: Kenneth Graunke <kenneth@whitecape.org> (Civ 4 & PlaneShift)

(cherry-picked from commit 3cc0a7be23)
2011-10-27 10:37:40 -07:00
Marek Olšák
00c44de1a6 r600g: set correct tiling flags in depth info
The kernel currently overwrites the flags, but if we stopped doing that,
this would break badly.
(cherry picked from commit faa16dc456)

BTW, this may be an actual fix for very old kernels.
https://bugs.freedesktop.org/show_bug.cgi?id=42175

Conflicts:

	src/gallium/drivers/r600/evergreen_state.c
	src/gallium/drivers/r600/r600_state.c
2011-10-26 14:51:30 +02:00
Brian Paul
e4f88bcad3 mesa: fix format/type check in unpack_image() for bitmaps
Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.
(cherry picked from commit 2ce8c3553b)
2011-10-25 18:41:29 -07:00
Brian Paul
0092375714 mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()
The spec says GL_INVALID_OPERATION is generated when texture!=0 and
textarget is not a legal value.  We had this right for the 2D function.
(cherry picked from commit ccecc08f79)
2011-10-25 18:41:29 -07:00
Ben Widawsky
c4d37ed43a intel: GetBuffer fix
After copy buffer on preGEN6, it is necessary to wait for the blit to
complete before returning data to the user.

This should fix the piglit test: copy_buffer_coherency (pre-GEN6).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit fa351bd2e0)
2011-10-25 18:41:29 -07:00
Eric Anholt
242a18dc46 mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)
The existing error result doesn't appear in the GL 2.1 or 3.2
compatibility specs, and triggers an unexpected GL error in Intel's
oglconform when it tries to reset the feedback state after usage so
that the "diff the state at error time vs. context init time" code
doesn't generate spurious diffs.  The unexpected GL error then
translates into testcase failure.  Brian wants the safety check on
buffer = NULL, though, so that people can't as easily set up a broken
buffer.
(cherry picked from commit 07e5295b6f)
2011-10-25 18:41:29 -07:00
Ian Romanick
0abee468f8 mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 24a113093b)
2011-10-25 18:41:29 -07:00
Ian Romanick
72ea656dad mesa: Remove redundant compressed paletted texture error checks
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 13757f7080)
2011-10-25 18:41:29 -07:00
Ian Romanick
30b199f867 mesa: Refactor compressed texture error checks to work with paletted textures
This code was really broken before.  A lot of the error checks were
done much later (too late), and some of the error checks would fail.
The underlying problem is that Mesa doesn't ever keep compressed paletted
textures in their original format.  The textures are immediately
converted to some RGB or RGBA format.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39991
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 3ebbfc8372)
2011-10-25 18:41:29 -07:00
Ian Romanick
9b242a03d5 mesa: Add _mesa_cpal_compressed_format_type
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit b433e7ba07)
2011-10-25 18:41:29 -07:00
Ian Romanick
8317a43a75 mesa: Refactor expected texture size check in cpal_get_info
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit a2cab751be)
2011-10-25 18:41:29 -07:00
Ian Romanick
625fdf58c6 mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit fc0fa16be3)
2011-10-25 18:41:29 -07:00
Ian Romanick
5f776f2a7d mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit a454c835fa)
2011-10-25 18:41:29 -07:00
Chia-I Wu
d2e633a8bd intel: fix GLESv1 support
Add intelInitExtensionsES1 to enable required and optional GLESv1
extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6b9e4b6ca7)
2011-10-25 18:41:29 -07:00
Chia-I Wu
135501c201 intel: rename intel_extensions_es2.c to intel_extensions_es.c
We'd like to add intelInitExtensionsES1 to it later.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 820789ac69)
2011-10-25 18:41:29 -07:00
Jeremy Huddleston
681f4820ab apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5c44c1348e)
2011-10-24 16:26:17 -07:00
Yuanhan Liu
4b7ad91990 mesa: handle PBO access error in display list mode
Simply generate GL_INVALID_OPERATION error at display list mode. As
explained by Brian, we are going to access PBO data at compile time.
No need to defer the error at execution time.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 46d5fb576a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
cd114ba503 mesa: handle the pbo case for save_Bitmap
Wrap _mesa_unpack_bitmap to handle the case that data is stored in pixel
buffer object.

This would make calling Bitmap with data stored in PBO by display list work.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 02b801c1ed)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
b8cc97ed26 mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB
It seems like a typo.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 403cf7c56f)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
53a3e743ae mesa: generate error if pbo offset is not aligned with the size of specified type
v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
    more readable. (comments from Ian)

v3: Cast the offset by GLintptr to remove the compile warning(comments
    from Brian).

    I also found that I should use _mesa_sizeof_packed_type() instead,
    as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9024d8af0a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
a31eec0d10 i965: setup address rounding enable bits
The patch(based on the reading of the emulator) came from while I was
trying to fix the oglc pbo texImage.1PBODefaults fail. This case
generates a texture with the width and height equal to window's width
and height respectively, then try to texture it on the whole window.
So, it's exactly one texel for one pixel.  And, the min filter and mag
filter are GL_LINEAR. It runs with swrast OK, as expected. But it failed
with i965 driver.

Well, you can't tell the difference from the screen, as the error is
quite tiny. From my digging, it seems that there are some tiny error
happened while getting tex address. This will break the one texel for
one pixel rule in this case. Thus the linear result is taken, with tiny
error.

This patch would fix all oglc pbo subcase fail with the same issue on
both ILK, SNB and IVB.

v2: comments from Ian, make the address_round filed assignment consistent.
    (the sampler is alread memset to 0 by the xxx_update_samper_state
     caller, so need to assign 0 first)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit 76669381c0)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
6c85918159 mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image
Introuduce a simple function called copy_data to do the image data copy
stuff for all the save_CompressedTex*Image function. The function check
the NULL data case to avoid some potential segfault. This also would
make the code a bit simpler and less redundance.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e9edcf8b1d)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
eaad245418 intel: fix the wrong code to detect null texture.
There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a662e7c18)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
0a77734c62 mesa: fix error handling for glMaterial*
Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

Trigger GL_INVALID_VALUE error if the GL_SHININESS value is out side
[0, ctx->Constant.MaxShiniess].

v2: fix the max shininess value.

v3: suggested by Brian, move the face check into glMaterialfv function
    to reduce code duplicate. Also, refactor the error message.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a11b4c1e7a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
8d0d4381da mesa: fix error handling for glMapBufferRange
Accroding the man page, GL_INVALID_VALUE would generated if access has any
bits set other than those valid defined bits.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 099af9e9df)
2011-10-24 15:54:31 -07:00
Brian Paul
a0eefc9bd0 mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End
(cherry picked from commit 386ec5e80e)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
2af0708c85 mesa: fix error handling for glSelectBuffer
According the man page, trigger a GL_INVALID_VALUE if size < 0.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 57b8f13aa4)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
8fb8b8528d mesa: fix error handling for glPixelZoom
According the man page, GL_INVALID_OPERATION should generated if
glPixelZoom is executed between the execution of glBegin and the
corresponding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7a9a8bbabd)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
0ebdfa31bc mesa: fix error handling for glIsEnabled
According the man page, GL_INVALID_OPERATION should be generated if
glIsEnabled is executed betwwen the execution of glBegin and the
correspoding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6a98802243)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
ab68b00453 mesa: fix error handling for glTexEnv
Fix error handling while calling glTexEnv with invalid texture
environment parameters.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b020b111a8)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
a895cce693 mesa: fix error handling for some glGet* functions
According to the man page, it should trigger a GL_INVALID_OPERATION
while calling some glGet* functions inside glBegin and glEnd.

This patch dose handle the following functions:
 glGetBooleanv
 glGetFloatv
 glGetIntegerv
 glGetInteger64v
 glGetDoublev

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f1ddde5c16)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
23a3753a28 mesa: fix error handling for glEvalMesh1/2D
According man page, trigger error when calling glEvalMesh1/2D inside
glBegin/glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 21b2895bd0)
2011-10-24 15:54:30 -07:00
Brian Paul
b53035e10d mesa: fix error handling for dlist image unpacking
When compiling glDrawPixels, glTexImage(), etc. and we're copying
the user's image we need to be careful about GL error checking.
Previously, we were incorrectly generating GL_OUT_OF_MEMORY in
unpack_image() if width <= 0 or height <= 0 or for invalid format/type
values.  We now check those arguments in unpack_image() and return NULL
if there's a bad value.  The command will get compiled with the
arguments as-is and image=NULL.  Later, when the command is executed the
correct errors will be generated.

This issue was reported by Yuanhan Liu <yuanhan.liu@linux.intel.com>

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit 6fd6efa7bf)
2011-10-24 15:54:30 -07:00
Adam Jackson
b2fbf8225b drisw: Remove cargo culting that breaks GLX 1.3 ctors
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit d44f821213)
2011-10-24 13:56:46 -04:00
Jeremy Huddleston
bf7b347c10 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 9f2abbee62)
2011-10-21 00:35:34 -07:00
Jeremy Huddleston
7e90db0ddc apple: Silence some debug spew
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 098ecfad83)
2011-10-21 00:35:29 -07:00
Marek Olšák
521819f29c r300g: don't return NULL in resource_from_handle if the resource is too small
The DDX may allocate a buffer with a too small size.
Instead of failing, let's pretend everything's alright.

Such bugs should be fixed in the DDX, of course.

NOTE: This is a candidate for the stable branches.
(cherry picked from commit a04f8c3612)

Conflicts:

	src/gallium/drivers/r300/r300_texture.c
	src/gallium/drivers/r300/r300_texture.h
	src/gallium/drivers/r300/r300_texture_desc.c
2011-10-21 00:31:06 +02:00
Marek Olšák
8b4315cb47 pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 39d7de69b1)
2011-10-20 23:47:51 +02:00
Neil Roberts
986319cd20 meta: Fix saving the active program
When saving the active program in _mesa_meta_begin, it was actually
saving the fragment program instead. This means that if the
application binds a program that only has a vertex shader then when
the meta saved state is restored it will forget the bound program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41969
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 5625f78cd7)
2011-10-18 11:15:05 -07:00
Yuanhan Liu
c3fd76ce09 i965: fix the constant interp bitmask for flat mode
Fix the constant interpolation enable bit mask for flat light mode.
FRAG_BIT_COL0 attribute bit might be 0, in which case we need to
shift one more bit right.

This would fix the oglc specularColor test fail on both Sandybridge and
Ivybridge.

v2: move the constant interp bitmask setup code into for(; attr <
FRAG_ATTRIB_MAX; attr++) loop suggested by Eric.

Also fixes the Civilization 4 intro videos.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit cd6b8421ca)
2011-10-17 14:22:03 -07:00
Marcin Slusarz
08fa61dab6 nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

(commit 9849f366cb in master)
2011-10-17 23:01:41 +02:00
Marcin Slusarz
8d1f1eae93 nouveau: fix crash during fence emission
Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.

Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush

This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.

This issue was reported by Maxim Levitsky.

(commit e1e03ce492 in master)
2011-10-17 23:00:39 +02:00
Marek Olšák
b9cc9166cf Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"
This reverts commit b9c7773e0d.

It breaks more things than it fixes.
2011-10-16 03:21:02 +02:00
Kenneth Graunke
07210d5c77 intel: Depth format fixes
This is a squash of:

    intel: Recognize all depth formats in get_teximage_readbuffer.

    The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
    wrongly returning the color buffer instead of the depth buffer.

    Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
    CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
    format, which (prior to this patch) resulted in an attempt to copy
    ARGB8888 to X8_Z24.

    Instead of adding the missing enumeration directly, convert the code to
    use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
    should catch any newly added depth formats in the future.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry-picked from commit 440224ab73)

And:

    i915: Fix depth texturing since 86e62b2357

    The 965 driver already had the X8_Z24 case, but 915 was missing it.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 6aae729d6e)
2011-10-14 17:28:45 -07:00
Eric Anholt
57a6e6092f intel: Mark MESA_FORMAT_X8_Z24 as always supported.
This prevents developer surprise at seeing a GL_DEPTH_COMPONENT
texture have stencil bits, and avoids the metaops path accidentally
copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and
being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is
broken).

Acked-by: Chad Versace <chad@chad-versace.us>

(cherry-picked from commit 86e62b2357)
2011-10-14 17:28:45 -07:00
Chris Wilson
5b09cf5c57 i915: out-of-bounds write in calc_live_regs()
From a Coverity defect report.

src/mesa/drivers/dri/i915/i915_fragprog.c
   301  /*
   302   * TODO: consider moving this into core
   303   */
   304  static bool calc_live_regs( struct i915_fragment_program *p )
   305  {
   306      const struct gl_fragment_program *program = &p->FragProg;
   307      GLuint regsUsed = 0xffff0000;
-> 308      uint8_t live_components[16] = { 0, };
   309      GLint i;
   310
   311      for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
   312          struct prog_instruction *inst =
&program->Base.Instructions[i];
   313          int opArgs = _mesa_num_inst_src_regs(inst->Opcode);
   314          int a;
   315
   316          /* Register is written to: unmark as live for this and
preceeding ops */
   317          if (inst->DstReg.File == PROGRAM_TEMPORARY) {
-> 318              if (inst->DstReg.Index > 16)
   319                 return false;
   320
-> 321              live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask;
   322              if (live_components[inst->DstReg.Index] == 0)
   323                  regsUsed &= ~(1 << inst->DstReg.Index);
   324          }
   325
   326          for (a = 0; a < opArgs; a++) {
   327              /* Register is read from: mark as live for this and preceeding ops */
   328              if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) {
   329                  unsigned c;
   330
   331                  if (inst->SrcReg[a].Index > 16)
   332                     return false;
   333
   334                  regsUsed |= 1 << inst->SrcReg[a].Index;
   335
   336                  for (c = 0; c < 4; c++) {
   337                      const unsigned field = GET_SWZ(inst->SrcReg[a].Swizzle, c);
   338
   339                      if (field <= SWIZZLE_W)
   340                          live_components[inst->SrcReg[a].Index] |= (1U << field);
   341                  }
   342              }
   343          }
   344
   345          p->usedRegs[i] = regsUsed;
   346      }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40022
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 67582e6eef)
2011-10-14 17:28:45 -07:00
Carl Worth
eb0fd67f6a glcpp: Add a test for #elif with an undefined macro.
As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

	#ifndef MAYBE_UNDEFINED
	#elif MAYBE_UNDEFINED < 5
	...
	#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 201485bae0)
2011-10-14 17:28:45 -07:00
Carl Worth
c6dfde2136 glcpp: Raise error if defining any macro containing two consecutive underscores
The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

	spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
	spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit c4aaf7943c)
2011-10-14 17:28:45 -07:00
Carl Worth
71bd5d424c glcpp: Implement token pasting for non-function-like macros
This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

	spec/glsl-1.30/preprocessor/concat/concat-01.frag
	spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 28842c2331)
2011-10-14 17:28:45 -07:00
Carl Worth
33e1019d95 glcpp: Test a non-function-like macro using the token paste operator
Apparently we never implemented this, (but we've got a GLSL 1.30 test
in piglit that is exercising this case).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 7bb3403e01)
2011-10-14 17:28:45 -07:00
Carl Worth
ab94d6f902 glcpp: Fix two (or more) successive applications of token pasting
There was already a loop here to look for multiple token pastes, but
it was mistakenly incrementing the iterator counter after performing
one paste.

Instead, leave the loop iterator in place to coalesce as many tokens
as necessary into one.

This fixes the recently add 096-paste-twice test as well as the
following piglit test:

	spec/glsl-1.30/preprocessor/concat/concat-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 3c01a58944)
2011-10-14 17:28:45 -07:00
Ian Romanick
5becf89a17 i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks
This makes piglit a lot more happy.  The errors are logged when
INTEL_DEBUG=fallbacks because the application is about to hit a big
software fallback.  We frequently ask people to run applications that
are hitting software fallbacks with INTEL_DEBUG=fallbacks so the we
can help them debug the reason for the software fallback.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 0290a018a5)
2011-10-14 17:28:45 -07:00
Ian Romanick
13a2d4a985 i915: Fail without crashing if a Mesa IR program uses too many registers
This can only happen in GLSL shaders because assembly shaders that use
too many temps are rejected by core Mesa.  It is easiest to make this
happen with shaders that contain flow-control that could not be lowered.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3bb2f0dde1)
2011-10-14 17:28:45 -07:00
Ian Romanick
f2d166583d ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered
Rely on the driver to do the right thing.  This probably means falling
back to software.  Page 88 of the OpenGL 2.1 spec specifically says:

    "A shader should not fail to compile, and a program object should
    not fail to link due to lack of instruction space or lack of
    temporary variables. Implementations should ensure that all valid
    shaders and program objects may be successfully compiled, linked
    and executed."

There is no provision for saying "No" to a valid shader that is
difficult for the hardware to handle, so stop doing that.

On i915 this causes a large number of piglit tests to change from FAIL
to WARN.  The warning is because the driver still emits messages to
stderr like "i915_program_error: Unsupported opcode: BGNLOOP".

It also fixes ES2 conformance CorrectFull_frag and CorrectParse1_frag
on i915 (and probably other hardware that can't handle loops).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 322c3bf9dc)
2011-10-14 17:28:42 -07:00
Ian Romanick
49d2c552a5 ir_to_mesa: Use Add linker_error instead of fail_link
The functions were almost identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8aadd89d07)
2011-10-14 17:28:03 -07:00
Ian Romanick
a864b15b83 mesa: Ensure that gl_shader_program::InfoLog is never NULL
This prevents assertion failures in ralloc_strcat.  The ralloc_free in
_mesa_free_shader_program_data can be omitted because freeing the
gl_shader_program in _mesa_delete_shader_program will take care of
this automatically.

A bunch of this code could use a refactor to use ralloc a bit more
effectively.  A bunch of the things that are allocated with malloc and
owned by the gl_shader_program should be allocated with ralloc (using
the gl_shader_program as the context).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 89193933cb)
2011-10-14 17:27:17 -07:00
Ian Romanick
e458c3ddbb linker: Make linker_{error,warning} generally available
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 379a32f42e)
2011-10-14 17:27:17 -07:00
Ian Romanick
b8a46f910d linker: Make linker_error set LinkStatus to false
Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error.  The function linker_error
was previously known as linker_error_printf.  The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 586e741ac1)
2011-10-14 17:27:17 -07:00
Kenneth Graunke
eca2a91a9b i965: Fix inconsistent indentation in brw_eu_emit.c.
Most of these functions used three spaces for the first level of
indentation, but four spaces for the next level.  One used tabs and then
three spaces.  Some used 3/4 in a then block but 3/3 in the else block.

Normally I try to avoid field days like this, but since the functions
were so inconsistent, even internally, it was making it difficult to
edit without introducing spurious whitespace changes.

So, just get it over with.  git diff -b shows 0 lines changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b861479f83)
2011-10-13 16:35:40 -07:00
Kenneth Graunke
1f083e1839 i965: Allow SIMD16 color writes on Ivybridge.
Again, the check was needlessly specific: this works fine on Gen7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7db874bf4c4273d2d46218b1490d312fe2654284)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
9bbf2a343f i965/fs: Allow SIMD16 with control flow on Ivybridge.
The check was designed to forbid it on old generations (Gen5/Ironlake),
not on new ones.  It just works on Gen7/Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ae5da817e2aeb9f9447fdd6d2eb4b22d6f8f6a87)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
38dfedccb2 i965: Emit depth stalls and flushes before changing depth state on Gen6+.
Fixes OpenArena on Gen7.  Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 02c4dc807e91640c69c8addc3c797300a3c536ad)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
1e0e116d6d i965: Fix incorrect maximum PS thread count shift on Ivybridge.
At one point, the documentation said that max thread count in 3DSTATE_PS
was at bit offset 23, but it's actually 24 on Ivybridge.  Not only did
this halve our thread count, it caused us to write 1 into a bit 23, which
is marked as MBZ (must be zero).  Furthermore, it made us write an even
number into this field, which is apparently not allowed.  Apparently we
were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 556e7eea80de778b44a37d51cb757ce32221d1e3)
2011-10-13 14:06:11 -07:00
Eric Anholt
aaadd4c111 i965: Fix polygon stipple offset state flagging.
_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit d598851d401f7f34d623c9cfbd85d7f5faccd7c2)
2011-10-13 13:59:06 -07:00
Eric Anholt
0d31b130bb i965: Add missing _NEW_POLYGON flag to polygon stipple upload.
Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit e19541aa2ad05f687c859001b62713209787c9c8)
2011-10-13 13:58:57 -07:00
Kenneth Graunke
e4b1dce9ec i965: Use proper texture alignment units for cubemaps on Gen5+.
In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e0e688ca5441e2c8bc59ec7488bc1bc4ba196602)
2011-10-13 13:58:51 -07:00
Kenneth Graunke
0f87fe948a i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.
For power-of-two sizes, h0 == mt->height0 since it's already a multiple
of two.  However, for NPOT, they're different; h1 should be computed
based on the original size.

Fixes piglit test "cubemap npot" and oglconform test "textureNPOT".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bebc19448f45dbe8c3b016d440403f52e1036e15)
2011-10-13 13:58:45 -07:00
Eric Anholt
f484fc7476 i965/fs: Respect ARB_color_buffer_float clamping.
This was done in the old codegen path, but not the new one.  Caught by
piglit fbo tests after the conversion to GLSL ff_fragment_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit da53ca641106e47f1d74386d8dc0f7eebeec5225)
2011-10-13 13:58:37 -07:00
Marek Olšák
b9c7773e0d r300g: fix rendering with a non-zero index bias in draw_elements_immediate
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 5506f6ef96)
2011-10-04 17:48:33 +02:00
Paul Berry
7d2ff4ae77 glsl: improve the accuracy of the asin() builtin function.
The previous formula for asin(x) was algebraically equivalent to:

sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2))

where A, B, and C were arbitrary constants determined by a curve fit.

This formula had a worst case absolute error of 0.00448, an unbounded
worst case relative error, and a discontinuity near x=0.

Changed the formula to:

sign(x)*(pi/2 - sqrt(1-|x|)*(pi/2 + (pi/4-1)|x| + A|x|^2 + B|x|^3))

where A and B are arbitrary constants determined by a curve fit.  This
has a worst case absolute error of 0.00039, a worst case relative
error of 0.000405, and no discontinuities.

I don't expect a significant performance degradation, since the extra
multiply-accumulate should be fast compared to the sqrt() computation.

Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-*
(cherry picked from commit d4c80f5f85)
2011-10-02 21:39:30 +02:00
Paul Berry
1bbf124ff8 glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.
This patch fixes a bug in ir_hirearchical_visitor: when traversing an
exec_list representing the formal or actual parameters of a function,
it modified base_ir to point to each parameter in turn, rather than
leaving it as a pointer to the enclosing statement.  This was a
problem, since base_ir is used by visitor classes to locate the
statement containing the node being visited (usually so that
additional statements can be inserted before or after it).  Without
this fix, visitors might attempt to insert statements into parameter
lists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit cc81eb09b9)
2011-10-02 19:57:57 +02:00
Eric Anholt
ca7560765c glsl: When assiging from a whole array, mark it as used.
Fixes piglit link-uniform-array-size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 407a1001ae)
2011-10-02 19:57:57 +02:00
Eric Anholt
878d701da4 glsl: When assigning to a whole array, mark the array as accessed.
The vs-varying-array-mat2-col-row-wr test writes a mat2[3] constant to
a mat2[3] varying out array, and also statically accesses element 1 of
it on the VS and FS sides.  At link time it would get trimmed down to
just 2 elements, and then codegen of the VS would end up generating
assignments to the unallocated last entry of the array.  On the new
i965 VS backend, that happened to land on the vertex position.

Some issues remain in this test on softpipe, i965/old-vs and
i965/new-vs on visual inspection, but i965 is passing because only one
green pixel is probed, not the whole split green/red quad.
2011-10-02 19:57:56 +02:00
Paul Berry
c19b963ad6 glsl: Remove field array_lvalue from ir_variable.
The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.

However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).

This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).

This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation.  Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.

Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 00792e3586)
2011-10-02 19:57:08 +02:00
Eric Anholt
95185c7fe2 glsl: Clarify error message about whole-array assignment in GLSL 1.10.
Previously, it would produce:

    Failed to compile FS: 0:6(7): error: non-lvalue in assignment

and now it produces:

    Failed to compile FS: 0:5(7): error: whole array assignment is not
    allowed in GLSL 1.10 or GLSL ES 1.00.

Also, add spec quotation to the two places we have code for array
lvalues in GLSL 1.10.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 525cec98a5)
2011-10-02 19:56:53 +02:00
Paul Berry
e1221a8811 glsl: Rework oversize array check for gl_TexCoord.
The check now applies both when explicitly declaring the size of
gl_TexCoord and when implicitly setting the size of gl_TexCoord by
accessing it using integral constant expressions.

This is prep work for adding similar size checks to gl_ClipDistance.

Fixes piglit tests texcoord/implicit-access-max.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 93b9758d01)
2011-10-02 19:21:49 +02:00
Paul Berry
f732b5a999 glsl: Fix type error when lowering integer divisions
This patch fixes a bug when lowering an integer division:

  x/y

to a multiplication by a reciprocal:

  int(float(x)*reciprocal(float(y)))

If x was a plain int and y was an ivecN, the lowering pass
incorrectly assigned the type of the product to be float, when in fact
it should be vecN.  This caused mesa to abort with an IR validation
error.

Fixes piglit tests {fs,vs}-op-div-int-ivec{2,3,4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit af501e2b29)
2011-10-02 19:19:49 +02:00
Paul Berry
0129d5297b glsl: Perform implicit type conversions on function call out parameters.
When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value.  In other words, we convert code like the
following:

void f(out int x);
float value;
f(value);

Into IR that's equivalent to this:

void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);

This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.

Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.

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

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 67b5a3267d)
2011-10-02 19:19:08 +02:00
Paul Berry
27f00df2b7 glsl: Check array size is const before asserting that no IR was generated.
process_array_type() contains an assertion to verify that no IR
instructions are generated while processing the expression that
specifies the size of the array.  This assertion needs to happen
_after_ checking whether the expression is constant.  Otherwise we may
crash on an illegal shader rather than reporting an error.

Fixes piglit tests array-size-non-builtin-function.vert and
array-size-with-side-effect.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d4144a123b)
2011-10-02 19:17:42 +02:00
Paul Berry
8dcfe15a9a glsl: Constant-fold built-in functions before outputting IR
Rearranged the logic for converting the ast for a function call to
hir, so that we constant fold before emitting any IR.  Previously we
would emit some IR, and then only later detect whether we could
constant fold.  The unnecessary IR would usually get cleaned up by a
later optimization step, however in the case of a builtin function
being used to compute an array size, it was causing an assertion.

Fixes Piglit test array-size-constant-relational.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38625
(cherry picked from commit 789ee6516b)
2011-10-02 19:16:47 +02:00
Paul Berry
2c0e00de23 glsl: Emit function signatures at toplevel, even for built-ins.
The ast-to-hir conversion needs to emit function signatures in two
circumstances: when a function declaration (or definition) is
encountered, and when a built-in function is encountered.

To avoid emitting a function signature in an illegal place (such as
inside a function), emit_function() checked whether we were inside a
function definition, and if so, emitted the signature before the
function definition.

However, this didn't cover the case of emitting function signatures
for built-in functions when those built-in functions are called from
inside the constant integer expression that specifies the length of a
global array.  This failed because when processing an array length, we
are emitting IR into a dummy exec_list (see process_array_type() in
ast_to_hir.cpp).  process_array_type() later checks (via an assertion)
that no instructions were emitted to the dummy exec_list, based on the
reasonable assumption that we shouldn't need to emit instructions to
calculate the value of a constant.

This patch changes emit_function() so that it emits function
signatures at toplevel in all cases.

This partially fixes bug 38625
(https://bugs.freedesktop.org/show_bug.cgi?id=38625).  The remainder
of the fix is in the patch that follows.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0d81b0e184)
2011-10-02 19:03:22 +02:00
Paul Berry
1895de7a32 Revert "glsl: Skip processing the first function's body in do_dead_functions()."
opt_dead_functions contained a shortcut to skip processing the first
function's body, based on the assumption that IR functions are
topologically sorted, with callees always coming before their callers
(therefore the first function cannot contain any calls).

This assumption turns out not to be true in general.  For example, the
following code snippet gets translated to IR that violates this
assumption:

    void f();
    void g();
    void f() { g(); }
    void g() { ... }

In practice, the shortcut didn't cause bugs because of a coincidence
of the circumstances in which opt_dead_functions is called:

(a) we do inlining right before dead function elimination, and
    inlining (when successful) eliminates all calls.

(b) for user-defined functions, inlining is always successful, because
    previous optimization passes (during compilation) have reduced
    them to a form that is eligible for inlining.

(c) the function that appears first in the IR can't possibly call a
    built-in function, because built-in functions are always emitted
    before the function that calls them.

It seems unnecessarily fragile to have opt_dead_functions depend on
these coincidences.  And the next patch in this series will break (c).
So I'm reverting the shortcut.  The consequence will be a slight
increase in link time for complex shaders.

This reverts commit c75427f4c8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 482338842d)
2011-10-02 19:02:30 +02:00
Paul Berry
7dc636dd77 glsl: improve the accuracy of the atan(x,y) builtin function.
The previous formula for atan(x,y) returned a value of +/- pi whenever
|x|<0.0001, and used a formula based on atan(y/x) otherwise.  This
broke in cases where both x and y were small (e.g. atan(1e-5, 1e-5)).

This patch modifies the formula so that it returns a value of +/- pi
whenever |x|<1e-8*|y|, and uses the formula based on atan(y/x)
otherwise.
(cherry picked from commit b1b4ea0b36)
2011-10-02 19:00:31 +02:00
Paul Berry
e42b822fec glsl: improve the accuracy of the radians() builtin function
The constant used in the radians() function didn't have enough
precision, causing a relative error of 1.676e-5, which is far worse
than the precision of 32-bit floats.  This patch reduces the relative
error to 1.14e-9, which is the best we can do in 32 bits.

Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit fe33c886a7)
2011-10-02 18:50:28 +02:00
Paul Berry
0501cee136 glsl: Lower break instructions when necessary at the end of a loop.
Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.
(cherry picked from commit 067c9d7bd7)

Conflicts:

	src/glsl/lower_jumps.cpp
2011-10-02 18:48:27 +02:00
Paul Berry
38ae26b709 glsl: In lower_jumps.cpp, lower both branches of a conditional.
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.
(cherry picked from commit e71b4ab8a6)
2011-10-02 18:45:10 +02:00
Paul Berry
de798938d4 glsl: Use foreach_list in lower_jumps.cpp
The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 382cee91a4)
2011-10-02 18:44:50 +02:00
Paul Berry
acd2a03ffb glsl: lower unconditional returns and continues in loops.
Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.
(cherry picked from commit 03145ba655)

Conflicts:

	src/glsl/lower_jumps.cpp
2011-10-02 18:44:31 +02:00
Paul Berry
d1786cea1c glsl: Refactor logic for determining whether to lower return statements.
Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.
(cherry picked from commit dbaa2e627e)
2011-10-02 18:43:00 +02:00
Paul Berry
934c7a0661 glsl: Lower unconditional return statements.
Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.
(cherry picked from commit afc9a50fba)
2011-10-02 18:35:00 +02:00
Brian Paul
2ba0d0a5e8 mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()
If color material mode is enabled, constant buffer entries related
to the material coefficients will depend on glColor.  So add
_NEW_CURRENT_ATTRIB to the bitset returned for material-related
constants in _mesa_program_state_flags().

This fixes a bug exercised by the new piglit draw-arrays-colormaterial
test.

Note: This is a candidate for the 7.11 branch.
(cherry picked from commit 57169c4694)
2011-10-02 18:10:40 +02:00
Marek Olšák
1cf8f9599c r600g: add index_bias to index buffer bounds
This fixes ARB_draw_elements_base_vertex with max_index != ~0.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 44afac04ea)
2011-10-02 18:10:19 +02:00
Brian Paul
2781baaa64 meta: fix broken sRGB mipmap generation
If we're generating a mipmap for an sRGB texture we need to bypass
sRGB->linear conversion.  Otherwise the destination mipmap level
(drawn with a textured quad) will have the wrong colors.
If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode)
we need to use the software fallback for mipmap generation.

Note: This is a candidate for the 7.11 branch.
(cherry picked from commit 1e939f5374)
2011-10-02 18:09:22 +02:00
Brian Paul
a74400ca30 mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros
The 1-bit alpha channel was incorrectly encoded.  Previously, any non-zero
alpha value for the ubyte alpha value would set A=1.  Instead, use the
most significant bit of the ubyte alpha to determine the A bit.  This is
consistent with the other channels and other OpenGL implementations.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
(cherry picked from commit 4731a598f0)
2011-10-02 18:08:31 +02:00
Tom Stellard
a5e2074fdd r300/compiler: Fix regalloc for values with multiple writers
https://bugs.freedesktop.org/show_bug.cgi?id=40062
https://bugs.freedesktop.org/show_bug.cgi?id=36939

Note: This is a candidate for the 7.11 branch.
(applied diff manually from 2d1004d9aa)
2011-10-02 18:07:53 +02:00
Brian Paul
fad6e2ea5a meta: fix/add checks for GL_EXT_framebuffer_sRGB
This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension
is not supported.

Note: This is a candidate for the 7.11 branch
(cherry picked from commit 6e423253e7)
2011-10-02 18:05:03 +02:00
Vadim Girlin
a73c667069 r600g: fix replace_gpr_with_pv_ps
Instructions with 3 source operands have no write mask, so we may replace their
destinations with PV/PS in the next group even if their dst.write is 0.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit fdb62ef3f5)
2011-10-02 18:04:38 +02:00
Vadim Girlin
e87f79c8a4 r600g: fix check_and_set_bank_swizzle
Need to do full check when not all bank swizzles in the group are forced
(e.g. when trying to merge interp_* group with the next instruction)

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6ba68c7654)

Conflicts:

	src/gallium/drivers/r600/r600_asm.c
2011-10-02 18:04:22 +02:00
Chad Versace
fa8cfbfb64 x86-64: Fix compile error with clang
Remove the 'f' suffix from a float literal.
    - .float 0.0f+1.0
    + .float 1.0

This fixes the following compile error with clang:
    error: unexpected token in directive
    .float 0.0f+1.0
              ^

Note: This is a candidate for the stable branches.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 9cd64ec35a)
2011-10-02 18:00:27 +02:00
Brian Paul
446a67b74e swrast: don't try to do depth testing if there's no depth buffer
Fixes piglit hiz-depth-stencil-test-fbo-d0-s8 crash.
See http://bugs.freedesktop.org/show_bug.cgi?id=37907

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 37a64baea8)
2011-10-02 18:00:13 +02:00
Kenneth Graunke
d5c84929a7 mesa: In validate_program(), initialize errMsg for safety.
validate_program relies on validate_shader_program to fill in errMsg;
empirically, there exist cases where that doesn't happen.

While tracking those down may be worthwhile, initializing the string so
we don't try to ralloc_strdup random garbage also seems wise.

Fixes issues caught by valgrind while running some test case.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit db726b048e)
2011-10-02 18:00:03 +02:00
Christopher James Halse Rogers
dd9b78e212 glx/dri2: Paper over errors in DRI2Connect when indirect
DRI2 will throw BadRequest for this when the client is not local, but
DRI2 is an implementation detail and not something callers should have
to know about.  Silently swallow errors in this case, and just propagate
the failure through DRI2Connect's return code.

Note: This is a candidate for the stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
(cherry picked from commit fbc2fcf685)
2011-10-02 17:59:54 +02:00
Chia-I Wu
2cadae90c0 glsl: empty declarations should be valid
Unlike C++, empty declarations such as

  float;

should be valid.  The spec is not explicit about this actually.

Some apps that generate their shader sources may rely on this.  This was
noted when porting one of them to Linux from Windows.

Reviewed-by: Chad Versace <chad@chad-versace.us>

Note: this is a candidate for the 7.11 branch.
(cherry picked from commit 547212d963)
2011-10-02 17:59:26 +02:00
Vadim Girlin
ffb0f94136 r600g: take into account force_add_cf in pops
When we have two ENDIFs in a row, we shouldn't modify the pop_count
for the same alu clause twice.

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

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2bde0cc95d)
2011-10-02 17:58:50 +02:00
Vadim Girlin
badd2900ea r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6eb94fc344)
2011-10-02 17:58:40 +02:00
Chad Versace
6c032dd837 glsl: Fix conversions in array constructors
Array constructors obey narrower conversion rules than other constructors
[1] --- they use the implicit conversion rules [2] instead of the scalar
constructor conversions [3].  But process_array_constructor() was
incorrectly applying the broader rules.

[1] GLSL 1.50 spec, Section 5.4.4 Array Constructors, page 52 (58 of pdf)
[2] GLSL 1.50 spec, Section 4.1.10 Implicit Conversions, page 25 (31 of pdf)
[3] GLSL 1.50 spec, Section 5.4.1 Conversion, page 48 (54 of pdf)

To fix this, first check (with glsl_type::can_be_implicitly_converted_to)
if an implicit conversion is legal before performing the conversion.

Fixes:
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec*-vec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit a5ab9398e3)
2011-10-02 17:58:28 +02:00
Chad Versace
70c5be6c91 glsl: Remove ir_function.cpp:type_compare()
The function is no longer used and has been replaced by
glsl_type::can_implicitly_convert_to().

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 6efe1a8495)
2011-10-02 17:00:59 +02:00
Chad Versace
3b92831fab glsl: Fix implicit conversions in non-constructor function calls
Context
-------
In ast_function_expression::hir(), parameter_lists_match() checks if the
function call's actual parameter list matches the signature's parameter
list, where the match may require implicit conversion of some arguments.
To check if an implicit conversion exists between individual arguments,
type_compare() is used.

Problems
--------
type_compare() allowed the following illegal implicit conversions:
    bool -> float
    bvecN -> vecN

    int -> uint
    ivecN -> uvecN

    uint -> int
    uvecN -> ivecN

Change
------
type_compare() is buggy, so replace it with glsl_type::can_be_implicitly_converted_to().
This comprises a rewrite of parameter_lists_match().

Fixes piglit:spec/glsl-1.20/compiler/built-in-functions/outerProduct-bvec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 8b3627fd7b)
2011-10-02 17:00:45 +02:00
Chad Versace
e6d07585f8 glsl: Add method glsl_type::can_implicitly_convert_to()
This method checks if a source type is identical to or can be implicitly
converted to a target type according to the GLSL 1.20 spec, Section 4.1.10
Implicit Conversions.

The following commits use the method for a bugfix:
    glsl: Fix implicit conversions in non-constructor function calls
    glsl: Fix implicit conversions in array constructors

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 200e4972c1)
2011-10-02 16:57:32 +02:00
Brian Paul
4bd0f04531 mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
And fix indentation.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit dc1f32deae)
2011-10-02 16:53:57 +02:00
Alex Deucher
45716cffbe r600g: fix up vs export handling
Certain attributes (position, psize, etc.) don't
count as params; they are handled separately by the hw.
However, the VS is required to export at least one param
and r600_shader_from_tgsi() takes care of adding a dummy
export if there is none.  Make sure the VS param export
count in the SPI properly accounts for this.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit dc1c0ca22a)
2011-10-02 16:53:44 +02:00
Marek Olšák
ae633fa0ef configure.ac: fix xlib-based softpipe build
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit c6f59fcd00)

Conflicts:

	configure.ac
2011-10-02 16:53:21 +02:00
Kenneth Graunke
25861dc7f3 glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.
When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes.  Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol.  It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations.  Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol.  While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine.  Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
      make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3875526926)
2011-10-02 16:50:39 +02:00
Marcin Baczyński
3fc660e896 configure: allow C{,XX}FLAGS override
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ff2efdf599)
2011-10-02 16:49:56 +02:00
Marcin Baczyński
0fbf3562d1 configure: fix gcc version check
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fa013419de)
2011-10-02 16:49:49 +02:00
Vadim Girlin
13476840a6 st/mesa: flush bitmap cache on query and conditional render boundaries
Bitmap caching shouldn't affect the results of the queries and
conditional render.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4f4855b249)
2011-10-02 16:49:34 +02:00
Henri Verbeet
5336f7f5a5 mesa: Fix a couple of TexEnv unit limits.
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit bfe284fd26)
2011-10-02 16:46:10 +02:00
Henri Verbeet
a470104763 mesa: Use the Elements macro for the sampler index assert in validate_samplers().
This is probably nicer if the array size ever changes.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 4744195628)
2011-10-02 16:46:02 +02:00
Henri Verbeet
338cf7128c mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.
The total number of units used by a shader is limited to MAX_TEXTURE_UNITS,
but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS,
since they're shared between vertex and fragment shaders.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 86adc2b29e)
2011-10-02 16:45:54 +02:00
Henri Verbeet
36dab12726 mesa: Check the texture against all units in unbind_texobj_from_texunits().
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2e35d90fb9)
2011-10-02 16:45:46 +02:00
Brian Paul
dc253d3100 mesa: fix texstore addressing bugs for depth/stencil formats
Using GLuint pointers worked when the pixel size was four bytes
or the row stride was a multiple of four but was otherwise broken.
Fixes failures found with the piglit fbo-stencil test.

This helps to fix https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b786db0654)
2011-10-02 16:43:08 +02:00
Brian Paul
9f362a587e softpipe: add missing stencil format case in convert_quad_stencil()
Part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch
(cherry picked from commit 057a107d44)

Conflicts:

	src/gallium/drivers/softpipe/sp_quad_depth_test.c
2011-10-02 16:42:54 +02:00
Henri Verbeet
8b5257a96f r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 39fecd3229)
2011-10-02 16:38:09 +02:00
Eric Anholt
94e12df164 glsl: Allow ir_assignment() constructor to not specify condition.
We almost never want to specify a condition, and when we do we're
already thinking about it (because we're writing a lowering pass
generating the condition), so a default argument should make the code
more pleasant to read.

NOTE: This is a candidate for the 7.11 branch (we want to be able to
cherry-pick future code).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e617a53a74)
2011-10-02 16:31:16 +02:00
Eric Anholt
ac6a24001b mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.
Like the previous commit, but fixes
ARB_vertex_program/getlocal4d-with-error.

v2: Move the success case line into the conditional, use ASSIGN_4V more.
(cherry picked from commit c9aac11713)
2011-10-02 15:33:05 +02:00
Eric Anholt
b7e69912fa mesa: Throw an error when starting conditional render on an active query.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-while-active.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fd17de2123)
2011-10-02 15:33:05 +02:00
Eric Anholt
268a2c1a8a mesa: Throw an error instead of asserting for condrender with query == 0.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7371224c06)
2011-10-02 15:33:05 +02:00
Eric Anholt
28b95b2b01 mesa: Add support for Begin/EndConditionalRender in display lists.
Fixes piglit nv_conditional_render-dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8899f6e93c)
2011-10-02 15:33:05 +02:00
Ian Romanick
0a6ef34741 mesa: Make _mesa_get_compressed_formats match the texture compression specs
The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations.  A giant comment block was added to
justify the somewhat odd behavior of this function.

In addition, the interface had unnecessary cruft.  The 'all' parameter
was false at all callers, so it has been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b189d1635d)
2011-10-02 15:33:04 +02:00
Ian Romanick
545ecf6542 mesa: Return the correct internal fmt when a generic compressed fmt was used
If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 143b65f761)
2011-10-02 15:33:04 +02:00
Ian Romanick
a88f4914a3 mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 09916e877f)
2011-10-02 15:33:04 +02:00
Eric Anholt
ad2b567f51 mesa: Fix glGetUniform() type conversions.
We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9fa41f0742)

Conflicts:

	src/mesa/main/uniforms.c
2011-10-02 15:33:04 +02:00
Marek Olšák
37c2c9688c u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 60a77cf316)
2011-10-02 15:33:04 +02:00
Marek Olšák
012b2057e8 u_vbuf_mgr: rework user buffer uploads
- first determine the buffer range to upload for each buffer by walking over
  vertex elements
- take buffer_offset into account
- take src_offset into account
- take src_format into account in more places
- don't just blindly upload (stride*count) bytes

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit cd9bbb3935)
2011-10-02 15:33:03 +02:00
Marek Olšák
eb2a04b467 u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED
(cherry picked from commit 315300e444)
2011-10-02 15:33:03 +02:00
Marek Olšák
060e22c212 u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_
(cherry picked from commit 28fb798911)

Conflicts:

	src/gallium/auxiliary/util/u_vbuf_mgr.c
	src/gallium/drivers/r600/r600_state_common.c
2011-10-02 15:33:03 +02:00
Marek Olšák
2330b7267c u_vbuf_mgr: fix max_index computation for large src_offset
NOTE: This is a candidate for the 7.11 branch.
2011-10-02 15:33:02 +02:00
Marek Olšák
7a7377a090 u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index
NOTE: This is a candidate for the 7.11 branch.
2011-10-02 15:33:02 +02:00
Marek Olšák
d79d69c933 u_vbuf_mgr: cleanup original vs real vertex buffer arrays
It can now override both buffer offsets and strides in additions to resources.
Overriding buffer offsets was kinda hackish and could cause issues with
non-native vertex formats.
2011-10-02 15:33:02 +02:00
Henri Verbeet
d072260921 mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().
Without this we'd miss the last update in a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called
updated_drawbuffers() when the buffer count changed, but later realized that
was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for
output colors beyond <n> is set to NONE.", and this is queryable state.
This fixes piglit arb_draw_buffers-state_change.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a4d72189b2)
2011-10-02 15:33:02 +02:00
Michel Dänzer
942c1b8de1 glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
As already done in dri2CopySubBuffer().

Should fix:

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

Might fix:

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d8c443ddde)
2011-10-02 03:54:02 +02:00
Kristian Høgsberg
0502da1ade glx: Don't flush twice if we fallback to dri2CopySubBuffer
The flush extensions flush call indicates end of frame and should only
be called once per frame.  However, in the dri2SwapBuffer fallback
path, we call flush and then call dri2CopySubBuffer, which also calls
flush.  Refactor the code to only call flush once.
(cherry picked from commit 4a7667b96b)
2011-10-02 03:53:55 +02:00
Michel Dänzer
bb38f931a8 st/mesa: Finalize texture on render-to-texture.
This makes sure that stObj->pt exists and is up to date.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit
fbo-incomplete-texture-03.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit de414f4915)
2011-10-02 03:45:43 +02:00
Brian Paul
726ce042f8 st/mesa: Convert size assertions to conditionals in st_texture_image_copy.
Prevents potential assertion failures in piglit fbo-incomplete-texture-03 test.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 4beb8f9e9d)
2011-10-02 03:45:36 +02:00
Eric Anholt
4ebd2c7c09 mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.
Fixes a bug caught by oglconform, and now piglit
ARB_vertex_program/getenv4d-with-error.  The wrapping of an existing
GL function made it so that we couldn't distinguish an error in
looking up our arguments from an existing error.  Instead, make a
helper function to choose the param, and use it from multiple callers.

v2: Move the success case line into the conditional, use COPY_4V more.
(cherry picked from commit e9d563e3ff)
2011-10-02 03:25:03 +02:00
Marcin Slusarz
e7794048ca nouveau: fix nouveau_fence leak
(commit 96054375b1 in master)
2011-09-13 15:36:01 +02:00
Carl Simonson
e20346bfc8 i830: Add missing vtable entry for i830 from the hiz work.
(cherry picked from commit 09eeb0ff27)
2011-09-10 18:33:13 -07:00
David Reveman
2217a70aaf i915g: Fix off-by-one in scissors. 2011-08-26 17:43:20 -07:00
Tobias Droste
6c1a9a327d r300/compiler: simplify code in peephole_add_presub_add
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 84f8548dfc)
2011-08-07 18:36:17 +02:00
Marek Olšák
e33f306d67 r300/compiler: remove an unused-but-set variable and simplify the code
(cherry picked from commit ed5e95ada6)
2011-08-07 18:36:10 +02:00
Marek Olšák
f69357d77a r300/compiler: fix a warning that a variable may be uninitialized
(cherry picked from commit 2ce6c3ea6e)
2011-08-07 18:36:03 +02:00
Marek Olšák
d8a0c1b4bc winsys/radeon: fix space checking
We should remove the relocations which caused a validation failure
from the list, so that the kernel receives only the validated ones.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 64ab39b035)

Conflicts:

	src/gallium/winsys/radeon/drm/radeon_drm_cs.c
2011-08-07 18:35:06 +02:00
Marek Olšák
f396e43b7d vbo: do not call _mesa_max_buffer_index in debug builds
That code drops performance in Unigine Heaven and Tropics
by a factor of 10. That's too crazy even for a debug build.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c251d83d91)
2011-08-07 18:28:51 +02:00
Brian Paul
aedfd07fb2 docs: news item for 7.11 release 2011-08-02 10:38:17 -06:00
Brian Paul
9e669d9f28 docs: add 7.11 md5 sums 2011-08-02 10:38:03 -06:00
Marc Pignat
4258e9b3a5 drisw: Fix 24bpp software rendering, take 2
This patch add the support for 24bpp in the dri/swrast implementation.
See http://bugs.freedesktop.org/show_bug.cgi?id=23525

Signed-off-by: Marc Pignat <marc at pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfec000e75)
2011-08-02 10:03:15 -06:00
Ian Romanick
de8f22af28 mesa: Bump version to 7.11 (final) 2011-07-31 22:48:10 -07:00
Ian Romanick
6ee71bab94 docs: More bits of 7.11 release notes 2011-07-31 22:47:26 -07:00
Jeremy Huddleston
6c72801c2b darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5b3c719983)
2011-07-31 09:47:56 -07:00
Jeremy Huddleston
0d2c369535 Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e737a99a6f)
2011-07-31 09:47:51 -07:00
Ian Romanick
fffd20cdc1 Merge remote-tracking branch 'origin/7.11' into 7.11 2011-07-28 16:18:51 -07:00
Ian Romanick
fad610fec9 mesa: Bump version to 7.11-rc4 2011-07-28 16:08:42 -07:00
Vadim Girlin
9ca791d380 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 19:05:59 -04:00
Kenneth Graunke
69720cb0c4 i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f73caddd33)
2011-07-28 14:23:08 -07:00
Kenneth Graunke
8589ca000a i965: Check actual tile offsets in Gen4 miptree workaround.
The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 15c0bc5eef)
2011-07-28 14:22:59 -07:00
Kenneth Graunke
dcbd00e73c i965/gen4: Fix message parameter loading for 1D TXD sampling.
We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e1fd13f60)
2011-07-28 14:22:48 -07:00
Fredrik Höglund
bba1600531 st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-28 11:56:45 -07:00
Ian Romanick
f4c55ea016 mesa: Ensure that r300 compiler files only appear once in the tarballs
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Andreas Radke <a.radke@arcor.de>
2011-07-28 11:47:46 -07:00
Ian Romanick
aa05fbe14d mesa: Bump version to 7.11-rc3 2011-07-28 11:47:45 -07:00
Ian Romanick
0a7574f62c mesa: Use --dereference to avoid symlinks in tarballs 2011-07-28 11:47:45 -07:00
Eric Anholt
1098f9228d i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3daa2d97eb)
2011-07-28 11:47:45 -07:00
Eric Anholt
5238303790 i965: Fix many of the trivial WebGL demos that broke due to IB optimization.
The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.
(cherry picked from commit 818db3848b)
2011-07-28 11:47:45 -07:00
Eric Anholt
a03974ffb9 i965: Emit texture cache flushes on gen6 along with render cache flushes.
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.
(cherry picked from commit 185868c9c2)
2011-07-28 11:47:45 -07:00
Paul Berry
2d64d34cb9 i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d92463d5dc)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
66b41af391 i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 572f631895)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
67aa20d9d5 i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156cef0fba)
2011-07-28 11:47:45 -07:00
Ian Romanick
7d6c37b0c2 glsl: Treat ir_dereference_array of non-var as a constant for lowering
Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156f85336f)
2011-07-28 11:47:45 -07:00
Ian Romanick
32c7224edb i965: When emitting a src/dst read of an output, keep the swizzle and neg
Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1d3f09f159)
2011-07-28 11:47:45 -07:00
Ian Romanick
788acd552e i965: When emitting a src/dst write of an output, keep the write mask
Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 337e2dfad0)
2011-07-28 11:47:45 -07:00
Ian Romanick
a2b8802ed5 prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit fbeb68e880)
2011-07-28 11:47:45 -07:00
Ian Romanick
8b41ae0b2a ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f7cd9a858c)
2011-07-28 11:47:44 -07:00
Ian Romanick
b00b5fe267 ir_to_mesa: Add each relative address to the previous
This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d6e1a8f714)
2011-07-28 11:47:44 -07:00
Ian Romanick
3a5a7cfd2a glsl: When lowering non-constant vector indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 601428d2bb)
2011-07-28 11:47:44 -07:00
Ian Romanick
aad12d15bb glsl: When lowering non-constant array indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5f83dfe5b7)
2011-07-28 11:47:44 -07:00
Ian Romanick
977db7cc65 glsl: Rework lowering of non-constant array indexing
The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1731ac3086)

To make bisects work, this also squashes in:

glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c1e591eed4)
2011-07-28 11:47:44 -07:00
Ian Romanick
d31c1c33ed glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d2296e784a)
2011-07-28 11:47:44 -07:00
Ian Romanick
3481a5a1e6 glsl: Move is_array_or_matrix outside visitor class
There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8d5f3cef79)
2011-07-28 11:47:44 -07:00
Marek Olšák
a26b6cc001 configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 0aed27ee37)
2011-07-28 00:29:07 +02:00
Benjamin Franzke
7d992b8471 wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
(cherry picked from commit 79dcfb266a)
2011-07-27 10:08:01 +02:00
Tobias Droste
0bfa310049 egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit d4d5e3a336)
2011-07-27 09:43:03 +02:00
Benjamin Franzke
7555eb7478 Fix broken merge in cherry-pick from 42cdf407
Was cherry-picked to 337102684b.
2011-07-27 09:25:54 +02:00
Bryan Cain
fd461c5888 util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:18 -05:00
Bryan Cain
208bae4251 st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:15 -05:00
Marek Olšák
13d12b35e9 configure.ac: do not check for llvm-config if llvm is disabled 2011-07-25 23:54:28 +02:00
Benjamin Franzke
337102684b configure: Move gbm before egl in SRC_DIRS
egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
(cherry picked from commit 42cdf4074e)
2011-07-25 09:47:39 +02:00
Marek Olšák
b305c956be configure.ac: check for libdrm_radeon only when building classic
(cherry picked from commit 50e32fefb1)
2011-07-23 16:00:27 +02:00
Ian Romanick
7c98381ed4 glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 02c5ae1b3f)

This also squashes in the following commit to make sure that bisects
in scons builds work:

glsl: Add ir_function_detect_recursion.cpp to SConscript.
(cherry picked from commit 76bccaff0c)
2011-07-23 01:55:25 -07:00
Ian Romanick
0ce6506d6e glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ad3ba4ad9)
2011-07-23 01:53:59 -07:00
Stéphane Marchesin
7fc66f0bed Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
(cherry picked from commit 3c0c624879)
2011-07-23 01:53:40 -07:00
Chia-I Wu
e24c3575e4 u_vbuf_mgr: restore buffer offsets
u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
(cherry picked from commit afc160e1c8)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-21 22:18:56 +02:00
Marek Olšák
2e50a93cf3 r600g: more valgrind fixes
(cherry picked from commit dc9d789d1b)
2011-07-21 15:03:03 +02:00
Marek Olšák
2c29c24543 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
(cherry picked from commit daf6604435)
2011-07-21 15:02:53 +02:00
Marek Olšák
4cbaa2283c configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit c2426bbf86)

Conflicts:

	configure.ac
2011-07-21 14:57:19 +02:00
Marek Olšák
e29d44eacd mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 000896c0bb)
2011-07-21 14:54:09 +02:00
Andrew Randrianasulu
f29208aa9b dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Broken accidentally in f4efc256fd,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.
2011-07-21 10:33:33 +02:00
David Heidelberger
7af4e18dcd nvfx: handle PIPE_CAP_SM3
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2011-07-21 10:33:03 +02:00
Eric Anholt
344db29ede i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e5d36267d)
2011-07-20 12:50:06 -07:00
Eric Anholt
680c468f61 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
(cherry picked from commit 407785d0e9)
2011-07-20 12:50:06 -07:00
Eric Anholt
7ee4cb453b i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dc7422405f)
2011-07-20 12:50:06 -07:00
Eric Anholt
a152ab6df1 i915: Simplify intel_wpos_* with a helper function.
(cherry picked from commit cb5e0ba2aa)
2011-07-20 12:50:06 -07:00
Eric Anholt
a99914509e i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
(cherry picked from commit fceda4342c)
2011-07-20 12:50:06 -07:00
Eric Anholt
891073fea3 i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
(cherry picked from commit debf751aea)
2011-07-20 12:50:06 -07:00
Eric Anholt
dcaec739ea i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
(cherry picked from commit 79fee3a76b)
2011-07-20 12:50:06 -07:00
Eric Anholt
ea241750f7 i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
(cherry picked from commit fc4fba52cf)
2011-07-20 12:50:06 -07:00
Eric Anholt
9efd6dc677 i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 4c47fce92e)
2011-07-20 12:50:06 -07:00
Eric Anholt
c6ddeeed7a i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 94efc350b4)
2011-07-20 12:50:05 -07:00
Eric Anholt
108e807b7b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit c68270a26b)
2011-07-20 12:50:05 -07:00
Eric Anholt
421bca32fb i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 15af0f54b8)
2011-07-20 12:50:05 -07:00
Eric Anholt
0f0ab15a46 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit dd898c3e89)
2011-07-20 12:50:05 -07:00
Eric Anholt
b3c2438d4e intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit f34ec6169d)
2011-07-20 12:50:05 -07:00
Brian Paul
25287008b6 glsl: silence warning in linker.cpp
(cherry picked from commit 4470ff2ebf)
2011-07-20 09:02:22 -07:00
Jørgen Lind
62b282e749 Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
(cherry picked from commit 496bf3822a)
2011-07-20 09:02:18 -07:00
Paul Berry
9aa8c02ae2 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3097715d41)
2011-07-20 08:15:32 -07:00
Paul Berry
b0ecde7f39 glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9c4445de6e)
2011-07-20 08:15:21 -07:00
Marek Olšák
fe70a40e47 prog_optimize: fix a warning that a variable may be uninitialized
(cherry picked from commit dade65505b)
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-20 08:01:47 -06:00
Ian Romanick
73b68316f4 mesa: Bump version to 7.11-rc2 2011-07-19 16:39:57 -07:00
Brian Paul
7ba7531929 mesa: remove depend files from tarballs
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-19 16:39:57 -07:00
Kenneth Graunke
2826e3a000 glsl: Correctly handle function matching when there are multiple inexact matches
This is a squash cherry pick commit of:

    glsl: Find the "closest" signature when there are multiple matches.

    Previously, ir_function::matching_signature had a fatal bug: if a
    function had more than one non-exact match, it would simply return NULL.

    This occured, for example, when looking for max(uvec3, uvec3):
    - max(vec3, vec3)   -> score 1 (found first)
    - max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
    - max(uvec3, uvec3) -> score 0 (exact match...the right answer)

    This did not occur for max(ivec3, ivec3) since the second match found
    was an exact match.

    The new behavior is to return a match with the lowest score.  If there
    is an exact match, that will be returned.  Otherwise, a match with the
    least number of implicit conversions is chosen.

    Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 60eb63a855)

    glsl: Suppress warning from matching_signature change.

    gcc isn't smart enough to see that we only look at matched_score after
    we've initialized it (because match != NULL happens at the same time)
    (cherry picked from commit b043409adf)

    glsl: Reject ambiguous function calls (multiple inexact matches).

    According to the GLSL 1.20 specification, "it is a semantic error if
    there are multiple ways to apply [implicit] conversions [...] such that
    the call can be made to match multiple signatures."

    Fixes a regression caused by 60eb63a855,
    which implemented the wrong policy of finding a "closest" match.
    However, this is not a revert, since the original code failed to
    continue looking for an exact match once it found two inexact matches.

    It's OK to have multiple inexact matches if there's also an exact match.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 7304909d65)
2011-07-19 16:39:56 -07:00
Paul Berry
f80ae99cbd glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f07221056e)
2011-07-19 16:39:56 -07:00
Paul Berry
ae11fb02dd glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
(cherry picked from commit ddc1c96390)
2011-07-19 16:39:56 -07:00
Ian Romanick
a90b88f354 linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d)
2011-07-19 16:39:56 -07:00
Ian Romanick
0e699cc0e8 configure.ac: Make --{without,with}-gallium-drivers work as expected
This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit db311b45be)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
e6e7c456de i965/gen7: Add support for gl_PointCoord.
This is exactly analogous to Eric's Gen6 change in commit
6861a70177.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 186e37c754)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
31f4ab790f i965/gen7: Fix point sprite texture coordinate overrides.
This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 147d010295)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
9f978104d8 i965/gen7: Refactor SF setup a bit to handle overrides in one place.
This is exactly analogous to Eric's Gen6 change in commit
e7280b16d6.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 5edb3ddf41)
2011-07-19 16:39:55 -07:00
Kenneth Graunke
9d78935100 i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 57b57f6d1c)
2011-07-19 16:39:55 -07:00
Henri Verbeet
d469ebaa0a glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
(cherry picked from commit 0f20e2e18f)
2011-07-19 23:29:16 +02:00
Chad Versace
f5fa4606ea intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f7dbcba280)
2011-07-19 13:15:00 -07:00
Vadim Girlin
89ed95ad3d r600g: fix corner case checks for the queries 2011-07-18 09:00:42 -04:00
Christoph Bumiller
3b605cb0d6 nv50,nvc0: add correct storage type for Z32_FLOAT 2011-07-18 13:48:19 +02:00
Christoph Bumiller
9bfb79923f nv50,nvc0: don't advertise unaligned texture format support
Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.
2011-07-18 13:45:52 +02:00
Vadim Girlin
7d8a04643f r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:43:48 -04:00
Alex Deucher
3065bae508 r600c/g: add new NI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-15 10:56:31 -04:00
Chia-I Wu
443ff6024d targets/egl-static: fix a linking error
rbug is always linked in and it needs libpthread.
(cherry picked from commit 5fe5d236c2)
2011-07-14 11:56:39 +08:00
Eric Anholt
a20a950829 i915: Add support for gl_FragData[0] for output color.
We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
(cherry picked from commit 556a47a262)
2011-07-13 13:14:09 -07:00
Eric Anholt
9279c1e556 i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f2fd0d6304)
2011-07-13 13:14:09 -07:00
Eric Anholt
b8f722a82e i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6e6b388604)
2011-07-13 13:14:09 -07:00
Eric Anholt
9304645a07 i965: Fix fp-dst-aliasing-[12].vpfp.
There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 46a7639174)
2011-07-13 13:14:09 -07:00
Eric Anholt
c3b3719096 i965: Fix fp-lit-src-equals-dst.
We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e3ea5bc08e)
2011-07-13 13:14:09 -07:00
Eric Anholt
55a75856fb intel: Remove gratuitous context checks in intel_delete_renderbuffer().
Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 007c2d6cd2)
2011-07-13 13:14:09 -07:00
Eric Anholt
e3e99be131 intel: Allow intel_region_reference() with *dst != NULL.
This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 036b74a7f8)
(cherry picked from commit d8f65c07e9)
2011-07-13 13:12:55 -07:00
Eric Anholt
5a7d1c9710 glsl: Fix make clean for dricore.
(cherry picked from commit abbbd14dd4)
2011-07-13 13:08:23 -07:00
Eric Anholt
6ac5554298 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
(cherry picked from commit a09c5c2e30)
2011-07-13 13:08:23 -07:00
Eric Anholt
9eace71048 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
(cherry picked from commit cd7bfd5d44)
2011-07-13 13:08:23 -07:00
Stéphane Marchesin
8d9202c162 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 12:08:10 -07:00
Alex Deucher
ef9f16f632 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:04:57 -04:00
Brian Paul
d739434af8 glx: add a few missing glXChooseFBConfig() attributes
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit d60880db35)
2011-07-12 09:46:50 -06:00
Brian Paul
72f2bd2a41 glext.h: update to version 71
(cherry picked from commit bb0d5cae00)
2011-07-12 09:46:42 -06:00
Benjamin Franzke
b0549fab5c configure: Require libudev for drm & wayland egl platforms
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 7ed1826e2e)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
ac88916978 configure: Fix typo in gbm check for egl drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 9b8cd49930)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
336b2c7fbd configure: Enable st/gbm if st/egl has drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b18b2994ef)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
a8907c6005 egl_dri2: Fix compilation if udev devel files are not installed
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b2d6375e6a)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
89af428aea egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 992680c8b4)
2011-07-12 09:58:11 +02:00
Marek Olšák
8a77029f4c swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit d1214cca08)
2011-07-11 23:03:34 +02:00
Marek Olšák
928bf189ff mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
(cherry picked from commit 83478e5d59)
2011-07-11 23:03:25 +02:00
Vadim Girlin
a9e34ada26 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:30:20 -04:00
Eric Anholt
804995807d i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d03fdc4cde)
2011-07-09 07:52:35 -07:00
Ian Romanick
b033f050fd mesa: Fix the parsers build rule so that 'make tarballs' can work
You'd think that with all the commit messages about adding stuff to
tarballs or fixing 'make tarballs' that someone would have noticed
that it was completely broken for 4 months (3158cc7).
2011-07-08 18:47:21 -07:00
Ian Romanick
c66982f7dc mesa: Bump version to 7.11-rc1 2011-07-08 18:26:39 -07:00
Ian Romanick
530c68d616 glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d2c6cef18a)
2011-07-08 16:02:20 -07:00
Vadim Girlin
576f489dad r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:54 -04:00
Vadim Girlin
270de51f1d r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:34 -04:00
Vadim Girlin
57fe695a17 r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:21 -04:00
Vadim Girlin
189303fb30 r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:07 -04:00
Brian Paul
c4da12e74f glsl: use casts to silence warning
(cherry picked from commit 7eb7d67d50)
2011-07-08 08:03:56 -06:00
Brian Paul
8428b48673 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fc98444bd5)

Conflicts:

	src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
2011-07-08 08:03:40 -06:00
Marek Olšák
b0a4f34ea8 st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7de28e80dc)
2011-07-08 13:24:50 +02:00
Marek Olšák
efd0ffd1b0 st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 292148dc4b)
2011-07-08 13:24:42 +02:00
Stéphane Marchesin
dc062db95d i915g: Improve flushing using heuristics. 2011-07-08 00:28:29 -07:00
Stéphane Marchesin
b292ef8f88 i915g: Move back to the old method for target format fixup.
Conflicts:

	src/gallium/drivers/i915/i915_state_emit.c
2011-07-08 00:27:59 -07:00
Eric Anholt
d3bfa9bb4a intel: Fix use of freed buffer if glBitmap is called after a swap.
Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
(cherry picked from commit 066bee64e1)
2011-07-07 15:05:24 -07:00
Paul Berry
98af042079 glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
(cherry picked from commit b078aad8ab)
2011-07-07 14:23:08 -07:00
Ian Romanick
127bd9d5b6 linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit d32d4f780f)
2011-07-06 17:06:29 -07:00
Ian Romanick
b8972db223 glsl: Don't choke when printing an anonymous function parameter
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 174cef7fee)
2011-07-06 17:06:19 -07:00
Ian Romanick
f28cf18609 ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dbda466fc0)
2011-07-06 17:05:50 -07:00
Ian Romanick
42cd6192a2 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
(cherry picked from commit 0eb9797958)
2011-07-06 17:05:36 -07:00
Vadim Girlin
1ae00c5960 r600g: fix buffer overflow check in r600_query_begin 2011-07-05 16:16:54 -04:00
Vadim Girlin
65d0d69c91 r600g: fix bo map usage flags in r600_query_begin 2011-07-05 16:16:40 -04:00
Vadim Girlin
433afb7352 r600g: reduce flushes for queries 2011-07-05 16:16:23 -04:00
Vadim Girlin
f70c2f8521 r600g: fix buffer offset in r600_query_begin 2011-07-05 16:16:05 -04:00
Chia-I Wu
e4cef07b87 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
(cherry picked from commit f2001df508)
2011-07-02 18:25:28 +09:00
Vadim Girlin
2196feb47f r600g: fix check for empty cs 2011-06-30 16:40:45 -04:00
Chia-I Wu
b90c710c6c target/egl-static: fix a compiler warning
(cherry picked from commit 3e3df5fcd1)
2011-06-30 15:01:17 +09:00
Chia-I Wu
bd1ceb5c5b targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
(cherry picked from commit 24137afb31)
2011-06-30 15:01:17 +09:00
Chia-I Wu
567778e49a targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
(cherry picked from commit 56ec8e17d3)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0fafcc6919 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
(cherry picked from commit 1e9f0b1736)
2011-06-30 15:01:17 +09:00
Chia-I Wu
29574af377 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
(cherry picked from commit 8ea5330200)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0eb780262c st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
(cherry picked from commit aa281dd392)
2011-06-30 15:01:16 +09:00
Chia-I Wu
e43a096f0c st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
(cherry picked from commit 3a07d9594a)
2011-06-30 15:01:16 +09:00
Chia-I Wu
52aa06a2cd st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
(cherry picked from commit ed47d65c7c)
2011-06-30 15:01:16 +09:00
Chia-I Wu
5d1561b4ab st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
(cherry picked from commit 73df31eedd)
2011-06-30 15:01:16 +09:00
Kenneth Graunke
a8d7f36d65 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry-picked from commit 5ddc518401)
2011-06-29 11:00:16 -07:00
Emil Velikov
82ebfa6387 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9b5c538726)
2011-06-29 07:20:08 -06:00
Andre Maasikas
ee416c6ffe st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 19789e403c)
2011-06-29 06:59:46 -06:00
Marek Olšák
ebc884d3dd r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit bc517d64da)
2011-06-25 20:05:08 +02:00
Brian Paul
9383cfb4ba Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:20:32 -06:00
Stéphane Marchesin
ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt
773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin
7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin
3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin
1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul
6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry
95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher
3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher
feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace
6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin
407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák
100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

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

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke
629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin
eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin
d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin
8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt
0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt
3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt
6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt
18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul
d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat
c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul
08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul
b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy
c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu
febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu
875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu
b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu
7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00
Chia-I Wu
a000745f80 targets/egl-static: add support for driver lookup
Use pci id to driver map to look up the driver name.  This is based on
a433755ec5.
2011-06-24 16:43:03 +09:00
Chia-I Wu
f36d210c93 targets/gbm: build pipe drivers
Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]
2011-06-24 16:43:03 +09:00
Benjamin Franzke
15e64242f9 configure: Disable drm egl platform by default
So that gbm(_dri) which pulls in shared-glapi is not needed.
2011-06-24 09:37:19 +02:00
Stéphane Marchesin
d3d3fea720 dri/r200: properly spell current_atom. 2011-06-23 21:00:26 -07:00
Stéphane Marchesin
5f691ba36f dri/r200: rename __atom to current_atom.
__atom is defined by gcc when the atom compile optimizations are used.
2011-06-23 20:58:05 -07:00
Vinson Lee
ad7387fe12 gallivm: Fix x86 build with llvm-3.0svn.
LLVM revision 133739 renamed StackAlignment to StackAlignmentOverride.
2011-06-23 20:48:05 -07:00
Chia-I Wu
45aecf0114 st/egl: drop guess_gl_api from egl_g3d_loader
It is not used and confusing.
2011-06-24 12:18:52 +09:00
Chia-I Wu
cb29ee91a2 st/egl: use a helper to get st_api from the loader 2011-06-24 12:18:52 +09:00
Brian Paul
ca7510bbf9 mesa: fix incorrect error string 2011-06-23 17:09:13 -06:00
Christoph Bumiller
9c5d15e929 nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned
libdrm_nouveau/winsys changes which are likely to cause major
changes to this bo validation code too.
2011-06-24 00:15:58 +02:00
Brian Paul
1f544cc587 st/mesa: fix format selection regression
Note all gallium formats are supported by Mesa so disable them.
Fixes regression from 1a339b6c71.

See https://bugs.freedesktop.org/show_bug.cgi?id=38602
2011-06-23 16:06:42 -06:00
Eric Anholt
d631c19db4 vbo: Don't discount stride == 0 for testing all varyings in VBOs.
In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:23 -07:00
Eric Anholt
8f28c05d07 vbo: Don't bother checking for stride == 0 for "any varying in a VBO".
We would still want to consider that data as being in a VBO even if we
managed to produce this case, which as far as I know we can't.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:17 -07:00
Eric Anholt
babe1fc004 i965/gen6: Add a couple more packets to the nonpipelined workaround list.
All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined.  We
could stand a review by looking at all packets emitted and identifying
what kind they are.
2011-06-23 13:41:42 -07:00
Paul Berry
935e7e4126 glsl: Flagged extension EXT_texture3D as "supported" in the builtin compiler.
Previously, the builtins in OES_texture_3D.{frag,vert} were only
compiling properly as a consequence of bug 38015, which allows
unsupported extensions to be enabled.  This fix eliminates the builtin
compiler's reliance on bug 38015, so that bug 38015 can be fixed.
2011-06-23 13:39:47 -07:00
Benjamin Franzke
e9d49d282d st/egl: Fix scons build 2011-06-23 22:23:57 +02:00
Benjamin Franzke
737bd7367e st/egl: Hookup gbm for drm backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
e5fc4c81ce egl_dri2: Hookup gbm as drm platform 2011-06-23 21:07:17 +02:00
Benjamin Franzke
48d4a001b3 gbm: Add gallium (drm) backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
2ff797060d gbm: Add dri backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
eddcecbf74 Add gbm (generic/graphics buffer manager) 2011-06-23 21:07:17 +02:00
Benjamin Franzke
15d7f1c1c7 st/dri: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
3af3c58dfd intel: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
5fbbd4c19f dri: Add dupImage to DRIimageExtension 2011-06-23 21:07:17 +02:00
Benjamin Franzke
fa5478c5fe r600g: Add R8G8B8A8_UNORM to evergreen colorswap table
Fixes broken glTexImage2D with format=GL_RGBA since
1a339b6c71

The origin for this behaviour is that r600_is_format_supported
checks only against r600_state_inline.h tables not evergreens.
2011-06-23 21:06:36 +02:00
Marek Olšák
1e5cef96d1 r600g: bump shader input limits 2011-06-23 15:58:49 +02:00
Brian Paul
8a5a28b731 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
2011-06-23 06:54:53 -06:00
Benjamin Franzke
87c3bb65bb st/egl/wayland: Take resize parameters only if size changes
This matches what we do in egl_dri2, and clients should
behave like this anyway.
2011-06-23 12:17:48 +02:00
Chia-I Wu
7587c140cd st/mesa: use a helper for st_framebuffer creation
In st_api_make_current, we would like to reuse the exising
st_framebuffer if possible.  Use a helper function to make the code
clearer.
2011-06-23 10:36:00 +09:00
Stéphane Marchesin
1a339b6c71 st/mesa: prefer native texture formats when possible.
If possible, we want to match the hardware format to what the app uses. By
doing so, we avoid the need for pixel conversions and therefore greatly speed
up texture uploads.
2011-06-22 17:02:21 -07:00
Stéphane Marchesin
98ce1373e4 i915g: Add draw point sprites.
It's not that much work; hopefully blend func separate also works and we get GL 2.0 for real.
2011-06-22 16:51:02 -07:00
Stéphane Marchesin
468c2c0841 i915g: Fix comment.
Reported-by: Marcin Baczynski <marbacz@gmail.com>
2011-06-22 16:47:36 -07:00
Stéphane Marchesin
465183c6ae i915g: Support more texture and render target formats. 2011-06-22 16:44:54 -07:00
Alex Deucher
5ff22ab229 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:38:29 -04:00
Alex Deucher
c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Michel Dänzer
eb2c9b5814 r600g: Fix use of uninitialized local variable extra_size.
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=38566 .
2011-06-22 16:23:36 +02:00
Thierry Vignaud
76bd1c1818 mesa: add missing DRI Makefiles to tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-22 08:22:02 -06:00
Brian Paul
9786688672 mesa: comments and 80-column wrapping 2011-06-22 08:12:10 -06:00
Brian Paul
3c95ff209f mesa: update comments in update_program_enables() 2011-06-22 08:12:10 -06:00
Brian Paul
79dddedfd1 mesa: update/fix comments in update_program() 2011-06-22 08:12:10 -06:00
Brian Paul
f3f080e526 mesa: update comment for gl_texture_unit 2011-06-22 08:12:10 -06:00
Marcin Slusarz
50d7d03a79 xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card.
Doing it in screen_create would be too late.
2011-06-22 12:35:40 +02:00
Andre Maasikas
63e8cda9f1 r600c: use BASE_VTX_LOC & AUTO_INDEX for drawing nonindexed with offset
Saves cmd buffer space as we were generating indexes into cs  in this case.
This was laying around in https://bugs.freedesktop.org/show_bug.cgi?id=32768
for a long time.
2011-06-22 12:40:12 +03:00
Alex Deucher
21972c85ea r600g: fix fbo depth/stencil texture allocation for evergreen+
evergreen+ stores depth and stencil separately so when we
allocate a depth/stencil fbo, make sure we allocate enough
memory for both depth and stencil buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-21 17:32:42 -04:00
Chad Versace
3db27d4a4a intel: Allocate s8_z24 non-texture renderbuffers when using separate stencil
Now all infrastructure is in place to support s8_z24 non-texture
renderbuffers for gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:22:05 -07:00
Chad Versace
36e05c6870 intel: Unobfuscate intel_alloc_renderbuffer_storage
Hiz buffer allocation can only occur if the 'else' branch has been taken,
so move the hiz buffer allocation into the 'else' branch.

Having the hiz buffer allocation dangling outside of the if-tree was just
damn confusing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
39d0e3632a intel: Add fields to intel_renderbuffer for unwrapping packed depth/stencil buffers
Add the following fields:
    intel_renderbuffer.wrapped_depth;
    intel_renderbuffer.wrapped_stencil

If the intel_context is using separate stencil and the renderbuffer has
a packed depth/stencil format, then wrapped_depth and wrapped_stencil are
the real renderbuffers.

Alter the following functions to accomodate the wrapped buffers:
    intel_delete_renderbuffer
    intel_draw_buffer
    intel_get_renderbuffer
    intel_renderbuffer_map
    intel_renderbuffer_unmap

Subsequent commits allocate renderbuffer storage for wrapped_depth and
wrapped_stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
23ed3b90c7 intel: Unconditionally enable support for S8_Z24 texture format
Commit b5c847c7ca erroneously disabled
support for S8_Z24 texture format when the context required separate
stencil (intel_context.must_use_separate_stencil).

But the GL spec requires implementations to support GL_DEPTH24_STENCIL8.
So we better find a way to fake it...

From page 180 (196 of pdf) of the OpenGL 3.0 spec:
    In addition, implementations are required to support the following
    sized internal [texture] formats.

    [...]

    - Combined depth+stencil formats: DEPTH32F_STENCIL8 and and
      DEPTH24_STENCIL8.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Benjamin Franzke
0cb356dd5c egl_dri2/wayland: Hook up new buffer.release event 2011-06-21 13:11:43 -04:00
Benjamin Franzke
8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Benjamin Franzke
0c74091591 st/mesa: Invalidate drawables on context switch 2011-06-21 15:09:55 +02:00
Dave Airlie
e251b3903a r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 15:18:44 +10:00
Dave Airlie
59a402cecd r600g: optimise draw vbo function a bit more.
this drop a bunch of unnecessary checks (i.e. should be trapped
at gallium level), and also removes the switch statement in favour
of some calculated values for the vgt values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 14:20:49 +10:00
Pierre-Eric Pelloux-Prayer
abe74a9820 r600g: reorder LIT instructions to support src == dst
the attached patch should be an improvement over Vadim Girlin's patch
fixing LIT instruction for r600g (commit
2fe39b46e7).

Instructions used in tgsi_lit have been reordered to always write to a
dst channel after the same channel in src has been read (so if src ==
dst, input values are not overwritten before being used).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 12:50:44 +10:00
Ben Skeggs
4112ca54e3 nvfx: nasty hack to make glFinish() actually finish..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-21 12:59:53 +10:00
Stéphane Marchesin
75be6b76ee glx: Fix compile. 2011-06-20 17:19:00 -07:00
Stéphane Marchesin
649d03d54d st/mesa: Remove unneeded texture format terminators.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-20 18:15:50 -06:00
Brian Paul
bc60a7515a st/mesa: put const qualifer on format_map table 2011-06-20 18:15:50 -06:00
Jeremy Huddleston
4fbdde889c glx: Bind to our context before __glXSetCurrentContext
We want to bind to our context before calling __glXSetCurrentContext or
messing with the gc rect in order to properly handle error conditions.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
517614141b glx: Destroy the old context only after the new one has been bound
This fixes a regression introduced by 49d7e48b33

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
fbd7448977 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so
FramebufferTextureLayerARB needs to be listed as an alias of
FramebufferTextureLayerEXT rather than FramebufferTextureLayer.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Ian Romanick
de77324d8f linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 15:01:10 -07:00
Dan Nicholson
4e5c51a05e glw: Mark all extern symbols GLAPI to regain default visibility (#31294)
Since switching to hidden visibility on gcc, GLw apps were failing to
link. Use the GLAPI definition to use default visibility where necessary.

$ nm lib/libGLw.so | grep DrawingArea
0000000000004020 T GLwCreateMDrawingArea
0000000000003430 T GLwDrawingAreaMakeCurrent
0000000000003410 T GLwDrawingAreaSwapBuffers
0000000000204c60 D glwDrawingAreaClassRec
0000000000204d48 D glwDrawingAreaWidgetClass
00000000002053c0 D glwMDrawingAreaClassRec
00000000002054e0 D glwMDrawingAreaWidgetClass

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: justin <jlec@gentoo.org>
2011-06-20 12:31:01 -07:00
Eric Anholt
f6e5230b26 i965/gen6: Apply documented workaround for nonpipelined state packets.
Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 08:42:16 -07:00
Eric Anholt
0ab7d6f437 i965/gen6: Limit the workaround flush to once per primitive.
We're about to call this function in a bunch of state emits, so let's
not spam the hardware with flushes too hard.
2011-06-20 08:37:43 -07:00
Eric Anholt
dfada714f8 i965/gen6: Use an BO instead of writing to address 0 for PIPE_CONTROL W/A.
This was spectacularly unsafe.  On my system, address 0 happens to be
the hardware status page for the render ring, and the first quadword
of that happens to contain nothing we ever look at, but I sure didn't
look forward to having to debug some day when, for example, the kernel
happened to bind the ringbuffer before binding the hwsp.
2011-06-20 08:37:43 -07:00
Eric Anholt
8f9e8d79c8 i965/gen6: Factor the PIPE_CONTROL workaround to a separate function.
We're need this workaorund a lot more than we're currently doing, so
let's reuse it.
2011-06-20 08:37:43 -07:00
Eric Anholt
911768700e i965/gen6: Remove state flagging on BRW_NEW_CURBE_OFFSETS.
That flag was leftover from gen4, where brw_curbe.c is choosing ranges
of the CURBE space for constants to live in, and the unit state tells
where to load them from.  That's not the case on gen6 -- we don't set
this flag (since constants aren't in the URB), nor do we have any
state like that to upload.
2011-06-20 08:37:43 -07:00
Eric Anholt
c860f48f11 i965/gen4: Remove old VS unit state key structure.
We're streaming VS state out now, not caching it.
2011-06-20 08:37:42 -07:00
Eric Anholt
7d4d608240 i965/gen6: Add missing state flag for VS push constants.
It was already annotated up above and everything.
2011-06-20 08:37:42 -07:00
Eric Anholt
b46dc45cee i965/gen6+: Correct gratuitous dependency on NEW_POLYGONSTIPPLE.
That flag is for the contents of the stipple, not the enable flag.
2011-06-20 08:37:42 -07:00
Eric Anholt
416a698b3c i965/gen6+: Add a missing state flag for WM constants. 2011-06-20 08:37:42 -07:00
Kristian Høgsberg
16a04e019d wayland: Pass use_invalidate extension to driver 2011-06-20 11:05:26 -04:00
Benjamin Franzke
80636ff2da egl_dri2/x11: Check availability of the dri2 extension
Do this before query versions, or xcb will shutdown
and the connection can not be used for swrast.
2011-06-20 10:06:24 -04:00
Chia-I Wu
8eea050f5a docs: update EGL for changed configure options 2011-06-20 11:19:16 +09:00
Chia-I Wu
66c71d150a configure.ac: remove deprecated EGL options 2011-06-20 11:19:16 +09:00
Marcin Slusarz
c772d4e6f3 xorg/nouveau: rename to nouveau2
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:29:28 +02:00
Marcin Slusarz
a97b40a886 st/xorg: initialize drm_mode.type
it's uninitialized, but used by kernel (drm_mode_setcrtc -> drm_mode_set_crtcinfo)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:28:02 +02:00
Marcin Slusarz
21c0556b61 st/xorg: add GALLIUM_AUXILIARIES to target dependencies
Without it changes to GALLIUM_AUXILIARIES don't induce target rebuild

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:26:53 +02:00
Marcin Slusarz
2f6a9687cf gallium/nouveau: remove unused nouveau_screen_bo_user 2011-06-20 02:23:12 +02:00
Marcin Slusarz
fe20edf959 st/xorg: fix crash triggered by rendercheck -t composite -f a8r8g8b8 -o Src, Saturate
samplers[0] may remain uninititialized if src picture/pixmap is null
2011-06-20 02:20:26 +02:00
Marcin Slusarz
54d1b718b8 st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear 2011-06-20 02:11:12 +02:00
Marek Olšák
badf0335ef r600g: implement seamless_cube_map on r600-r700
st/mesa guarantees that all bound sampler states have the same value
in seamless_cube_map.
2011-06-20 00:19:07 +02:00
Marek Olšák
9bcce02f47 r600g: remove some magic numbers 2011-06-19 23:28:33 +02:00
Marek Olšák
1251e1df0f configure.ac: add back --enable-gallium-egl 2011-06-19 21:15:55 +02:00
Cyril Brulebois
9ba2907f2e configure.ac: Avoid running llvm-config when it hadn't been checked for.
If --disable-gallium is passed, llvm-config isn't checked for, so mark
it explicitly as absent, through LLVM_CONFIG=no.

Passing --disable-gallium would result in:
| ../configure: line 9739: --version: command not found
| ../configure: line 9740: --cppflags: command not found
| ../configure: line 9741: --libs: command not found
| ../configure: line 9743: --ldflags: command not found

With this commit, one gets that instead:
| configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-19 21:15:55 +02:00
Marek Olšák
0c7c5b6876 configure.ac: build r600g by default
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:52 +02:00
Marek Olšák
58b6a19ea4 configure.ac: add option --with-gallium-drivers=DIRS
This removes all the --enable-gallium-$driver options and --disable-gallium.

Gallium can be disabled by --with-gallium-drivers= (without parameters).

Default is:
--with-gallium-drivers=r300,swrast

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:48 +02:00
Marek Olšák
440d71db78 configure.ac: remove --with-state-trackers
There is an obvious redundancy:

--with-driver=dri VS --with-state-trackers=dri
--with-driver=xlib VS --with-state-trackers=glx
--enable-openvg VS --with-state-trackers=vega
--enable-egl VS --with-state-trackers=egl

This patch adds two new options for the remaining state trackers:
--enable-xorg
--enable-d3d1x

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:45 +02:00
Marek Olšák
ad50abbac9 configure.ac: remove redundant option --enable-gallium-egl
We already have --enable-gallium, --enable-egl, and --with-state-trackers=egl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:13:57 +02:00
Marek Olšák
d1f66a9424 u_vbuf_mgr: make u_vbuf_mgr_draw_begin return flags in a bitmask 2011-06-19 21:09:18 +02:00
Marek Olšák
8623c68aec r600g: fix warning: assignment discards qualifiers from pointer target type 2011-06-19 21:09:18 +02:00
Marek Olšák
0d58723cde u_vbuf_mgr: fix uploading if format size is greater than stride 2011-06-19 21:09:18 +02:00
Kenneth Graunke
dd3b812962 i965: Enable extension GL_ARB_shader_texture_lod.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36987

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:54:01 -07:00
Kenneth Graunke
6430df3773 i965/fs: Add support for TXD with shadow comparisons.
Our hardware doesn't have a sample_d_c message, so we have to do a
regular sample_d and emit instructions to manually perform the
comparison.

This requires a state dependent recompile whenever the sampler's compare
mode or function change.  This adds the per-sampler comparison functions
to brw_wm_prog_key, but only sets them when the sampler's compare mode
is GL_COMPARE_R_TO_TEXTURE (i.e. only for shadow sampling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:57 -07:00
Kenneth Graunke
01fa9addf4 i965/fs: Refactor texture result swizzling into a helper function.
The next patch will add a few additional uses.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:55 -07:00
Kenneth Graunke
f1622cfe9c i965/fs: Move sampler fetch to the top of the ir_texture visit function.
This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:53 -07:00
Kenneth Graunke
6c947cfd19 i965/fs: Add support for non-shadow textureGrad (TXD) on gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:52 -07:00
Kenneth Graunke
2f4a4b943f i965/fs: Add support for non-shadow textureGrad (TXD) on gen5/6.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:50 -07:00
Kenneth Graunke
3fa910fff9 i965/fs: Add support for non-shadow textureGrad (TXD) on Ivybridge.
This is somewhat ugly, but I couldn't think of a nicer way to handle the
interleaved coordinate/derivative parameter loading.

Ironlake and Sandybridge will still hit an assertion in visit().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:47 -07:00
Kenneth Graunke
ad9481e128 i965/fs: Check for compilation failure and bail before optimizing.
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:24 -07:00
Eric Anholt
c173541d97 i965: Use state streaming on programs, and state base address on gen5+.
There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6).  No statistically significant performance difference
on nexuiz (n=5).
2011-06-18 16:00:45 -07:00
Eric Anholt
962dab9486 i965: Only flag the new-batch related state as dirty at new batch time.
This was debug code from the initial import of the driver.  No
statistically significant performance difference on cairo-gl or
nexuiz (n=6).
2011-06-18 16:00:45 -07:00
Eric Anholt
6f998b58bc mesa: Fix render-to-texture regression.
Accidentally introduced in fc8c4a3a7b.
Fixes fbo-drawbuffers-maxtargets and friends.
2011-06-18 15:59:00 -07:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Eric Anholt
a5a36d9b15 i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to
be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS
currently loaded in the hardware.  However, we might be at a smaller
offset than the previous set of VERTEX_BUFFERS, so we can't reuse
because that packet made the first entry be its starting offset (you
can't access outside the given bounds).

Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
2011-06-18 15:20:36 -07:00
Eric Anholt
5c2c60175d i965: Add missing state flag for vertex elements on current VS program.
Fixes a missing 3DSTATE_VERTEX_ELEMENTS on topogun.trace.
2011-06-18 15:20:35 -07:00
Marek Olšák
a4f4e24f07 r300g: rename AOS -> VARRAYS 2011-06-18 21:09:08 +02:00
Marek Olšák
7df7eaf845 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
2011-06-18 21:09:08 +02:00
Vadim Girlin
2fe39b46e7 r600g: fix LIT to handle src==dst properly
Current LIT implementation uses dst components for storing temp
results, possibly overwriting still needed values (depends on the
swizzles).
This patch uses temp reg for one of such cases (found in etqw) and
fixes "LIT R.z, R.xyzz".

Tested on evergreen. Fixes some etqw-demo rendering glitches when
"Lighting" is set to "High" in the settings.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:03:04 +10:00
Vadim Girlin
8ab1c5328b r600g: fix RSQ to use abs value of operand on evergreen
fixes https://bugs.freedesktop.org/show_bug.cgi?id=36917

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:01:03 +10:00
Vadim Girlin
a916d4279a r600g: fix source box in r600_resource_copy_region
Source box needs to be adjusted for blitting from compressed formats.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 15:45:59 +10:00
Brian Paul
753660780a mesa: allow depth texture arrays
The GL_EXT_texture_array spec allows this (Section 3.8.1).
Fixes failing piglit fbo-depth-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-06-17 13:44:59 -06:00
Brian Paul
da5c852d63 st/mesa: remove unneeded test for GL_TRUE 2011-06-17 13:44:59 -06:00
Brian Paul
15750d89b9 st/mesa: remove redundant _mesa_is_depth_format() call
The _mesa_is_depth_or_stencil_format() call covers all depth
format cases too.
2011-06-17 13:44:59 -06:00
Brian Paul
3ea6fdfdf1 st/mesa: remove trailing whitespace in st_format.c 2011-06-17 13:44:59 -06:00
Brian Paul
befaab8fa1 st/mesa: move comment for ChooseTextureFormat() to right place 2011-06-17 13:44:59 -06:00
Jeremy Huddleston
cb5a5f055b apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-17 12:20:57 -07:00
José Fonseca
10562fbc5c scons: List all targets. 2011-06-17 20:13:16 +01:00
José Fonseca
ef4bf40db0 scons: Remember the options set on the command line.
Save them in config.py
2011-06-17 20:13:16 +01:00
José Fonseca
c9be435c79 scons: Don't list MSVS_VERSION option outside windows platforms. 2011-06-17 20:13:16 +01:00
José Fonseca
d6a0fe19e8 scons: Correct glapi USE_xxx_ASM flags. 2011-06-17 20:13:16 +01:00
José Fonseca
c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
Stéphane Marchesin
bf69ce37f0 glx: implement drawable refcounting.
The current dri context unbind logic will leak drawables until the process
dies (they will then get released by the GEM code). There are two ways to fix
this: either always call driReleaseDrawables every time we unbind a context
(but that costs us round trips to the X server at getbuffers() time) or
implement proper drawable refcounting. This patch implements the latter.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-17 11:20:19 -07:00
José Fonseca
8173471fc2 scons: Move all env setup to scons/gallium.py 2011-06-17 16:41:05 +01:00
José Fonseca
4175010749 scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
2011-06-17 14:50:37 +01:00
Brian Paul
fc8c4a3a7b mesa: use helper functions to distinguish between user/winsys FBOs
And replace IS_CUBE_FACE() macro w/ inline function.
2011-06-16 07:31:58 -06:00
Brian Paul
37e6ab7b2d mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
2011-06-16 07:31:58 -06:00
Brian Paul
2960526816 mesa: updated comments in _make_current() 2011-06-16 07:31:58 -06:00
Vadim Girlin
016621ee14 r600: fix SPI inputs setup on r600/r700
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-16 15:23:06 +10:00
Chad Versace
8875dd5871 intel: Fix typo in intel_offset_S8 comments
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:50:45 -07:00
Chad Versace
d105f6684d i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer
When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
    fbo-alphatest-nocolor
    fbo-depth-sample-compare
    fbo
    hiz-depth-read-fbo-d24-s0
    hiz-depth-stencil-test-fbo-d24-s0
    hiz-depth-test-fbo-d24-s0
    hiz-stencil-read-fbo-d0-s8
    hiz-stencil-test-fbo-d0-s8
    fbo-missing-attachment-clear
    fbo-clear-formats
    fbo-depth-*

Changes piglit test result from crash to fail:
    hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:47:59 -07:00
Marek Olšák
6f243ec25d r600g: disable render condition for some blitter operations 2011-06-15 15:24:37 +02:00
Mike Kaplinskiy
40aec11b75 r600g: fix TXD src regs needing fetching.
[airlied: final chunk of Mike's patch from bug 37476
this uses a loop to emit the GRADIENTS and does a check to
see if we need to fetch to a temporary register. It also
increases the context src gpr to 4 which is needed here.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Mike Kaplinskiy
6415f25663 r600g: use inlines for some common tex instr setup code.
[airlied: taken from Mike's patch in bug 37476]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Kenneth Graunke
ef8f6a8c59 glsl/builtins: Actually implement int/ivec variants of abs().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches (and don't forget
      to re-run "make builtins" after cherry-picking.)
2011-06-14 23:41:16 -07:00
Mike Kaplinskiy
de91ea1c06 r600g: fix TXD when shadowing is enabled.
Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:54:21 +10:00
Dave Airlie
13c9a8552b r600g: add TXD support.
This at least passes the piglit arb_shader_texture_lod-texgrad test,
the AMD shader analyzer seems to multiply the V component by an unspecified
constant value no idea why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:18:42 +10:00
Brian Paul
34a774797c i915g: add const qualifier to silence warning 2011-06-14 20:47:47 -06:00
Marek Olšák
d9ca94836e r600g: also set TILE_MODE of the base level 2011-06-15 04:16:05 +02:00
Marek Olšák
677a4406d2 r600g: force OpenGL's BASE_LEVEL behavior on r600-r700
This sets the base level as the zero level, which fixes
piglit/texturing/tex-miplevel-selection*.

The r600 hardware ignores the BASE_LEVEL field in some cases, so we can't
use it.

Evergreen might need this too.
2011-06-15 03:39:24 +02:00
Kenneth Graunke
7c7a8a38e5 glsl/generate_builtins.py: Remove regexp to kill pointer addresses.
Commit 56ef62d988
"glsl: Generate readable unique names at print time."
changed ir_print_visitor to not generate @0x1234567 suffixes except
where necessary.  So there's no need to manually remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-14 18:29:48 -07:00
Jeremy Huddleston
1e16c34c5c glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
This change to _glapi_create_table_from_handle causes it to fill the dispatch
table with NoOps for unimplemented functionality.  This matches what is done
in indirect_init.c and also allows us to enable logging (when built with
-DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to
catch cases where clients are trying to use these unimplemented extentions.

Additionally, this fixes some gcc -pedantic warnings.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 18:22:01 -07:00
Brian Paul
3751aa4592 st/mesa: fix indentation, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
99feecc7d1 st/mesa: replace st->ctx with ctx 2011-06-14 17:19:53 -06:00
Brian Paul
c1477f6ffe st/mesa: fix comments, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
cbad86841b docs: 7.10.3 updates 2011-06-14 17:19:53 -06:00
Brian Paul
ee231b30a8 st/mesa: improved is_interleaved_arrays() checking
Check that the difference in array pointers/offsets from the 0th
array are less than the stride, for both VBOs and user-space arrays.
Previously, we were only doing this for the later.

This tightens up the interleaved array test and fixes a problem with
the llvmpipe driver where we were creating way too many vertex fetch
variants only because the pipe_vertex_element::src_offset values were
changing frequently.  This change results in a 5x speed-up for one of
the viewperf tests.

Also, clean up the function to make it easier to understand.
2011-06-14 17:19:53 -06:00
Alex Deucher
24a760e9cb r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:40:37 -04:00
Marek Olšák
7d488ade23 r600g: fix RGB32F texturing 2011-06-14 20:47:57 +02:00
Marek Olšák
df6355512a r600g: fix indentation and comments 2011-06-14 20:37:57 +02:00
Eric Anholt
10e418f381 mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
2011-06-14 11:17:39 -07:00
Eric Anholt
b0c4db68b2 mesa: Remove uncompressed code from generate_mipmaps_compressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
2bfd81df0a mesa: Remove compressed code from generate_mipmaps_uncompressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
ba55ccd312 mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.
The path taken is wildly different based on this (do we generate from
a temporary image, or from level-1's data), and we appear to have
stride bugs in the compressed case that are tough to disentangle.

This just duplicates the code for the moment, the followon commit will
do the actual changes.  Only real code change here is handling
maxLevel in one common place.
2011-06-14 11:17:39 -07:00
Eric Anholt
b9fbb9df22 intel: Fix miptree height alignment for compressed NPOT textures.
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
2011-06-14 11:17:39 -07:00
Eric Anholt
56965aa007 intel: Drop dead preinitialization of align_w, align_h. 2011-06-14 11:17:39 -07:00
Eric Anholt
f94fef83db intel: Drop the cpp argument to intel_miptree_create(). 2011-06-14 11:17:39 -07:00
Eric Anholt
6dcc398ac0 intel: Calculate compress_byte in intel_miptree_create.
One less argument and thing to get wrong.
2011-06-14 11:17:39 -07:00
Eric Anholt
9c5fdbb721 intel: Use the gl_format to get the base_format for miptree create.
One less argument to this insanely long function call.
2011-06-14 11:17:39 -07:00
Eric Anholt
9a523a48af intel: Drop the internal_format field of the mipmap tree.
This has been replaced with the gl_format now.
2011-06-14 11:17:38 -07:00
Eric Anholt
0fac09a87c intel: Make the intel_miptree_match_image format check more specific.
We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen.  We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification.  However, we should be making
consistent decisions for this check anyway.
2011-06-14 11:17:38 -07:00
Eric Anholt
afbe605eff i915: Drop dead argument to translate_texture_format(). 2011-06-14 11:17:38 -07:00
Eric Anholt
4a60b0c8d2 intel: Add block alignment for RGTC textures.
We were using the default 4x2 alignment instead of the 4x4 required
for RGTC textures.
2011-06-14 11:17:26 -07:00
Eric Anholt
d5809115b5 intel: Add the MESA_FORMAT as a field of the miptree.
We only had internal_format before, which is way more irritating to
work with.
2011-06-14 11:15:43 -07:00
Eric Anholt
51ce86b781 intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()
Generally image uploads to a the region occur at TexImage time, but
that's not the case for fallback _mesa_generate_mipmap(), and in this
path we were forgetting to align the width when dividing height.  We
were just leaving out parts of the compressed block at 2x2 and 1x1
levels.

Fixes gen-compressed-teximage.
2011-06-14 11:15:29 -07:00
Marek Olšák
13dcf3f20d r600g: disable shader_texture_lod until there is driver support 2011-06-14 20:03:04 +02:00
Adam Jackson
130e7ead87 llvmpipe: SSE2 fastpaths for b8g8r8x8 {un,}swizzle
Copy-and-paste from the bgra cases.  The C paths attempt to avoid
copying the 'x' channel, but it's harmless, you might as well.  Good for
about 5% in glxgears (740 to 780 fps).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-14 11:51:13 -04:00
Christoph Bumiller
a8b9a75b92 nv50: fix copy/paste error in nv50_gmtyprog_validate
Used the vertprog instead of gmtyprog.
2011-06-14 17:15:08 +02:00
Jeremy Huddleston
a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Marek Olšák
c17fb8539f configure.ac: cleanup the gallium-r300 option 2011-06-14 04:11:26 +02:00
Marek Olšák
e823ab1b00 st/xorg: remove unused variable 2011-06-14 03:49:26 +02:00
Marek Olšák
f318a15f45 r600g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
b5b7d2acc6 r300g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
be2b9bdcee xorg-radeon: rename to xorg-r300 2011-06-14 01:45:11 +02:00
Marek Olšák
63e38bd0f6 target-helpers: remove copy-pasted function inline_noop_helper 2011-06-14 01:45:11 +02:00
Vadim Girlin
9346d895e7 r600g: skip SPI setup for position and face inputs
fixes fdo bug 38145

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Dave Airlie
2743851c1a r600g: move depth texture flushing out of line.
this needs a piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Eric Anholt
296e6b9038 meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.
glReadPixels() was performing RGB -> L conversion differently from the
glTexImage() style conversion appropriate for glCopyTexImage().

Fixes gles2conform copy_texture.
2011-06-13 15:56:36 -07:00
Eric Anholt
df46eb8ec0 intel: Fix mipmap and format handling of blit glCopyPixels().
Fixes fbo-mipmap-copypix.
2011-06-13 15:56:36 -07:00
Eric Anholt
ef0d548838 intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
We were mapping the renderbuffer once, then walking over all the
buffers to map just the texture ones using the other texture mapping
function that handled the x/y offset to the image in the region.  But
then we would go and overwrite *those* mappings with the original
mappings for depth/stencil, which was wrong.

Instead, just walk over the attachments once and map the attachments.
Wasn't that easy?
2011-06-13 15:56:36 -07:00
Eric Anholt
fb60e2061b intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
d29117752f intel: Clean up intel_render_texture with a rename and a helper function.
The "newImage" isn't particularly new -- it might be the same texture
that was attached to the same attachment point before.  This function
also gets called when just rebinding back to an FBO with a texture
attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
b17aab5753 intel: Move the draw_x/draw_y to the renderbuffer where it belongs.
It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky.  Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Brian Paul
4fa01d705f dri: include swrast.h, not s_texrender.h 2011-06-13 16:07:55 -06:00
Jeremy Huddleston
816b8acfe8 glx: Remove check for gc->vtable->destroy
gc->vtable->destroy is always set and is used unconditionally
in other places, so don't bother checking for it first.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
b44d13e67b glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:50:37 -07:00
Daniel Vetter
df8d26ec09 i915g: add a few more render target formats
Snatched from xvmc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 23:05:43 +02:00
Brian Paul
755f2e2ae5 mesa: move texrender.c to swrast
This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-13 13:45:39 -06:00
Brian Paul
8852e35e29 vbo: minor simplification in print_draw_arrays() debug function 2011-06-13 13:45:39 -06:00
Brian Paul
e6e1864f1c mesa: move invariant code out of loop in get_tex_rgba() 2011-06-13 13:45:39 -06:00
Mathias Fröhlich
2f0b44f981 r600g: Put shaders into immutable buffers.
Put the shader programs into an immutable buffer object.
Also make sure that those object can be taken from the user
space buffer object pool.
2011-06-13 11:33:20 -04:00
Mathias Fröhlich
b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich
e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Mathias Fröhlich
e2529442e6 r600g: Fix typo.
Fix an obvious typo in the yet unused part of the shader setup.
2011-06-13 11:31:13 -04:00
Pierre-Eric Pelloux-Prayer
92563476e4 r600g: remove useless call to u_upload_flush
No regressions found with :
- piglit (quick.tests)
- Unigine Heaven
- Lightsmark
- openarena
- Imprudence (Second Life fork)

agd5f Note: this patch was previously reverted due to piglit
regressions, but I'm not able to reproduce them here.
See this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=34008
and discussion:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011996.html

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-13 11:26:54 -04:00
Marek Olšák
317247390a st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirty
This fixes piglit/vbo-bufferdata. It's a regression in 7.11.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-13 17:03:56 +02:00
Pierre-Eric Pelloux-Prayer
b19d86701e r600g: fixed bo memory leak issue
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168
2011-06-13 10:47:07 -04:00
Chia-I Wu
77b7e1b58f mapi: declare x86_entry_start/end static
x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.
2011-06-13 12:19:47 +08:00
Benjamin Franzke
3e1caf5d26 mapi: Fix tls with shared/es-glapi on x86-64
x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).
2011-06-13 12:19:47 +08:00
Chia-I Wu
982cb36584 wayland-drm: remove depend on "make clean" 2011-06-13 12:19:47 +08:00
Chia-I Wu
77e031a1c4 egl_dri2: try swrastg_dri if swrast_dri fails
Per libGL.
2011-06-13 12:19:39 +08:00
Chia-I Wu
cf69eeacc6 egl_dri2: add dri2_load_driver_swrast
Refactor dri2_load_driver and add dri2_load_driver_swrast for loading
swrast DRI driver.
2011-06-13 11:11:43 +08:00
Benjamin Franzke
16e30276e8 egl_dri2: Compare configs before matching them
This compares attribs like buffer size, and will prevent merging
unequal configs because of match criterion is e.g. ATLEAST.
2011-06-12 08:56:35 -04:00
Benjamin Franzke
a23bf646bd st/eglwayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Benjamin Franzke
b8325fd255 egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Jeremy Huddleston
9a00dd9746 apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:38 -07:00
Jeremy Huddleston
df1dacf093 apple: Store the CGL API version number for future reference
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:03 -07:00
Jeremy Huddleston
02b6e97c75 apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 22:54:59 -07:00
Jeremy Huddleston
f35913b96e apple: Use _glapi_create_table_from_handle to initialize our dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Jeremy Huddleston
85937f4c0d glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:

void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle, "gl");

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Marek Olšák
837dc61011 r300g: max_anisotropy of 1 is not anisotropic filtering 2011-06-11 23:03:20 +02:00
Daniel Vetter
219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Eric Anholt
4176025d46 i965: Add support for GL_FIXED vertex attributes.
This sadly requires work in the VS to rescale them, because the
hardware doesn't support this format natively.

Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-10 13:17:10 -07:00
Eric Anholt
20f087863d glsl: Fix incorrect optimization of instructions before discard statements.
The function was named "find_unconditional_discard", but didn't
actually check that the discard statement found was unconditional.
Fixes piglit glsl-fs-discard-04.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 13:17:01 -07:00
Eugeni Dodonov
23ef4a6063 Fix format not a string literal error with -Werror=format-security
A trivial fix for error: format not a string literal and no format
arguments with compiling with -Werror=format-security flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 12:20:07 -07:00
Chad Versace
97d230b0bc i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached
If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-10 10:37:30 -07:00
Alex Deucher
eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher
8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Eric Anholt
6861a70177 i965/gen6: Add support for gl_PointCoord.
This is just like PointSprite overrides, but it's always on for that
attribute.

Fixes glsl-fs-pointcoord, gtf/point_sprites.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:54 -07:00
Eric Anholt
f304bb8a5d i965/gen6: Fix point sprite texture coordinate overrides.
We were assuming that the input attribute n to the FS was
FRAG_ATTRIB_TEXn, which happened to be true often enough for our
testcases.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:51 -07:00
Eric Anholt
e7280b16d6 i965/gen6: Refactor SF setup a bit to handle overrides in one place.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:45 -07:00
Marek Olšák
da8b4c0798 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
2011-06-09 04:19:03 +02:00
Marek Olšák
466ce95ddf r300g: don't enable aniso with nearest filtering 2011-06-09 04:19:03 +02:00
Dave Airlie
04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Marek Olšák
d56fe67c62 r600g: remove unused variable 2011-06-09 01:34:24 +02:00
Marek Olšák
578d4539ba r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
2011-06-09 01:25:52 +02:00
Marek Olšák
f48412c39f r300g: make translate_primitive table-driven 2011-06-09 01:25:52 +02:00
Roland Scheidegger
d302804deb util: fix strict aliasing issues in u_format_r11g11b10f.h 2011-06-09 01:14:51 +02:00
Roland Scheidegger
c1090f3019 mesa: get rid of homegrown logbase2 implementation in drivers
Some of the logbase2 functions did just the same as _mesa_logbase2,
though they were taking signed numbers (but it shouldn't matter for them).
2011-06-09 01:14:51 +02:00
Roland Scheidegger
da009212fe mesa: fix gcc version check for _mesa_bitcount
The version check was bogus, and only inside a non-gcc block anyway.
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b537f54b3a mesa: use __builtin_clz for logbase2 when available
Also rename to _mesa_logbase2 and move to imports.h to keep the ugly
ifdef GNUC stuff outside other files (also to allow reuse).
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b3d5822e93 util: add gcc version check for builtins
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12 util: better logbase2/next_power_of_two implementations
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
José Fonseca
9f865646f1 glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. 2011-06-08 22:53:27 +01:00
Kenneth Graunke
4ef8464068 i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2

Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
acf82657f4 i965/gen7: Enable SIMD16 fragment shader dispatch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
2a63807616 i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.
According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
626440add5 i965/gen7: Program stencil buffers on Ivybridge.
Thanks to Chad's hard work implementing separate stencil and HiZ
support, this is entirely straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
53b53a141e i965/gen7: Add a prepare_depthbuffer function.
We need to call add_validated_bo to do proper aperture space accounting.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:50:38 -07:00
Kenneth Graunke
a00ca90815 i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.
For ctx->Depth.Mask.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:12 -07:00
Kenneth Graunke
bd265201da i965/gen7: Remove stencil renderbuffer from gen7_depth_format.
Since Gen7 doesn't support packed depth/stencil, the stencil buffer
can't possibly be relevant for determining the depth format.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:04 -07:00
Brian Paul
e37e196151 st/mesa: more helpful debug message in destroy_program_variants_cb() 2011-06-08 15:15:07 -06:00
Brian Paul
2d22186ca8 svga: fix typos, update comments 2011-06-08 15:08:19 -06:00
Jeremy Huddleston
3b23cf43a4 glx: Remove some GLX_USE_APPLEGL guards around glapi
Now that we're using glapi, we don't need some GLX_USE_APPLEGL ifdef-foo

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 12:03:10 -07:00
Jeremy Huddleston
1b90d7d36b darwin: Use -fvisibility=hidden to set default symbol visibility
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:47:00 -07:00
Jeremy Huddleston
2835c5112d darwin: mklib: Make the real file match the id
This makes mesa more consistent with glibtool and XCode where the
generated file matches the dylib id rather using an extra symlink

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:24:26 -07:00
Chad Versace
aea2236af6 intel: Request DRI2 buffers for separate stencil and hiz
When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
f4efb7ff4f intel: Add assertions to intelCreateBuffer()
Assert that the GLX config has an expected depth/stencil bit combination:
one of d24/s8, d16/s0, d0/s0. These are the only depth/stencil
configurations that we advertise.

Remove the check for software stencil, because given the assertions'
constraints the check always fails.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
89d34cfd3e intel: Refactor intel_update_renderbuffers()
Extract the code that queries DRI2 to obtain the DRIdrawable's buffers
into intel_query_dri2_buffers_no_separate_stencil().

Extract the code that assigns the DRI buffer's DRM region to the
corresponding renderbuffer into
intel_process_dri2_buffer_no_separate_stencil().

Rationale
---------
The next commit enables intel_update_renderbuffers() to query for separate
stencil and hiz buffers. Without separating the separate-stencil and
no-separate-stencil paths, intel_update_renderbuffers() degenerates into
an impenetrable labyrinth of if-trees.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
84294fe26c intel: Add function intel_renderbuffer_set_hiz_region()
It's the analog of intel_renderbuffer_set_region(), but for the hiz region
of course.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
beb8b7da20 intel/intel_context.c: Remove unused functions
Remove functions intel_override_hiz() and
intel_override_separate_stencil(). They are now located in intel_screen.c.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
6b2bf272ee intel: Add flags to intel_screen for hiz and separate stencil
Add the fields below to intel_screen. The expression in parens is the
value to which intelInitScreen2() currently sets the field.
    GLboolean hw_has_separate_stencil      (true iff gen >= 7)
    GLboolean hw_must_use_separate_stencil (true iff gen >= 7)
    GLboolean hw_has_hiz                   (always false)
    enum intel_dri2_has_hiz dri2_has_hiz   (INTEL_DRI2_HAS_HIZ_UNKNOWN)

The analogous fields in intel_context now inherit their values from
intel_screen.

When hiz and separate stencil become completely implemented for a given
chipset, then the respective fields need to be enabled.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
df9f533c67 intel: Define enum intel_dri2_has_hiz
... which indicates if the X driver supports DRI2BufferHiz and
DRI2BufferStencil.

I'm placing this in its own commit due to the large comment block.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
4501a5d6e8 dri2: Add token for DRI2BufferHiz
CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
ff99103c0a intel: Define span functions for S8 renderbuffers
Since the stencil buffer is interleaved, the generic Mesa renderbuffer
accessors do not suffice. Custom span functions are necessary.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chad Versace
2abc8cae87 i965/brw: Emit state for hiz and separate stencil buffers
When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chia-I Wu
6b492d0976 st/egl: set EGL_ALPHA_MASK_SIZE 2011-06-09 00:23:24 +08:00
Chia-I Wu
4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu
0dc45374f2 mesa: fix function remapping for dlist
glapidispatch.h should not be included directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36282
2011-06-08 23:18:57 +08:00
Chia-I Wu
fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Alex Deucher
fe3a343441 r600g: fix mixup in GPR resource reg setup
GLOBAL_GPR regs should be 0.  Need to set the
number of temp regs in SQ_GPR_RESOURCE_MGMT_1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-08 10:50:18 -04:00
Brian Paul
7c2847a972 vbo: run 'indent' on vbo_save_api.c 2011-06-08 08:05:41 -06:00
Brian Paul
9404835ccd mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1733d16de vbo: rename DO_FALLBACK -> dlist_fallback 2011-06-08 08:05:41 -06:00
Brian Paul
62811057f4 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1cdce95f6 vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
a25271fcb8 st: use _mesa_is_bufferobj() 2011-06-08 08:05:41 -06:00
Brian Paul
d329b68f35 vbo: added a comment 2011-06-08 08:05:41 -06:00
Brian Paul
713fb50759 gallium: fix comments for pipe_stream_output_state 2011-06-08 08:05:40 -06:00
Brian Paul
3d75c42bbf mesa: remove old comment 2011-06-08 08:05:40 -06:00
Brian Paul
f9c2feb96b mesa: add more sampler types to is_sampler_type() 2011-06-08 08:05:40 -06:00
Brian Paul
5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Brian Paul
f6572017b9 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
2011-06-08 08:05:40 -06:00
Jeremy Huddleston
0e8d045bf8 osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3a71f880d2 apple: Update dispatch table to current OpenGL specs
This updates the apple dispatch table to match the current glapi.
Aliases are still not handled very well.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3871e74733 apple: Dead code removal
Now that we're using glapi, all of this is no longer needed.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
e157f381f2 apple: Remove apple_glx_get_proc_address
Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
7d215e7c4d apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch.  In this implementation, two dispatch tables are created:

__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used.  It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework

The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.

This is a good step towards supporting both indirect and direct rendering
on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Jeremy Huddleston
88cec59170 apple: Rename __gl_api to __ogl_framework_api
In starting the migration to using mapi, rename __gl_api to
__ogl_framework_api since it is a vtable for OpenGL.framework

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Dave Airlie
19b9e523c5 r600g: missed one line in eg dyn gpr fallback.
need more sleep or something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:53:11 +10:00
Dave Airlie
9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
190bfea2de r600g: condition evergreen dyn gpr resource management
So only with kernel version 2.7 can this work, thanks to Alex
for pointing that out. Also add a workaround for a hw bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie
c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie
f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie
a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie
745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie
e66053d01c r600g: take alpha ref update out of line.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Ian Romanick
bb4758669c mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Ian Romanick
7f9c17aaa8 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Nicolas Kaiser
1d71bbed3b mga: enable GL_ARB_vertex_array_object extension
Tested on a Matrox G550 AGP.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-07 16:32:30 -06:00
Benjamin Franzke
ac3c2c8ece egl_dri2: Add missing header 2011-06-07 17:59:16 -04:00
Benjamin Franzke
3b11d67ef6 egl_dri2: Add missing license 2011-06-07 17:58:59 -04:00
Benjamin Franzke
ec2b08de77 egl_dri2: Use libudev only if available
Broken since 7f881c43df.
2011-06-07 17:58:47 -04:00
Pierre-Eric Pelloux-Prayer
bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

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

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher
5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher
7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Marek Olšák
d7111353bd r300g: consolidate deducing chipset info
Use the new PCI ID table, make it simpler.
2011-06-07 21:02:52 +02:00
Marek Olšák
4123131f3c r300_pci_ids: set families to match r300g 2011-06-07 21:02:52 +02:00
Marek Olšák
eaae63b715 r600g: add missing r300 families
Wondering why r600g needs to include r300_pci_ids.h
2011-06-07 21:02:52 +02:00
Eric Anholt
6d894f68af intel: Update intel-decode.c from intel-gpu-tools. 2011-06-07 11:44:11 -07:00
Eric Anholt
23b6f9606d intel: Implement glFinish() correctly by waiting on all previous rendering.
Before, we were waiting for (most of) the current framebuffer to be
done, which is not quite the same thing.
2011-06-07 10:46:04 -07:00
Jeremy Huddleston
6ea70600b9 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Jeremy Huddleston
cebdffaa2a darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Marek Olšák
ed0e4bb4c1 r300_pci_ids: add missing 4B48
Found in r300_chipset.h.
2011-06-07 18:45:23 +02:00
Benjamin Franzke
42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
6b82193677 radeon: Use pciid list to generate PCI_CHIP_<FAMILY>_<ID> defines
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
a433755ec5 targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
7f881c43df egl_dri2: Use external driver pci list
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
88fd16d548 Add radeon pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
09f83ce4da Add intel pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Brian Paul
681ed756c0 tgsi: s/varient/variant/ 2011-06-07 07:57:26 -06:00
Brian Paul
b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Brian Paul
47f3d5d42d draw/llvm: whitespace, formatting fixes 2011-06-07 07:57:26 -06:00
Brian Paul
57f2f84f0e draw: s/1/TRUE/ 2011-06-07 07:57:26 -06:00
Eric Anholt
ef59049c52 i965: Fix flipped GT1 vs GT2 URB VS entry count limits. 2011-06-07 00:08:42 -07:00
Stéphane Marchesin
7d2cb9a53c Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-06-06 20:42:30 -07:00
Stéphane Marchesin
abb4365269 i915g: Do generic remapping.
With complex shaders there are often "holes" in the fs inputs, and we only
have 8 tex coorsd to map those to. To fix this, we remap fs inputs to [0..8].
This lets us to run many more GLSL programs.
2011-06-06 20:40:16 -07:00
Jeremy Huddleston
22c320aa2c darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 19:56:19 -04:00
Dave Airlie
ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie
63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie
f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie
be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie
cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie
eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie
6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Stéphane Marchesin
2292025c49 i915g: implement more opcodes. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0f091333d1 i915g: implement TGSI_OPCODE_SEQ. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0ce977a66e i915g: handle varyings properly. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
893b92adff i915g: add missing and unsupported PIPE_CAPs to avoid debug messages. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3d3ecb8520 dri2: protect dri2FlushFrontBuffer against NULL buffers. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
cec2082ae5 Gallium: fix indentation in u_blitter.c 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3103c08ae9 i915g: don't destroy a texture buffer if it's NULL. 2011-06-06 12:35:58 -07:00
Stéphane Marchesin
1af8b7250f llvmpipe: use $(CXX) instead of g++ for linking.
This allows setting the path to the C++ compiler.
2011-06-06 12:35:58 -07:00
Kenneth Graunke
c2e659037f i965: Update SURFACE_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
4ba9cfe4b8 i965: Update SAMPLER_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
f9a3200adb i965: Update SF_CLIP_VIEWPORT state dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:04 -07:00
Jeremy Huddleston
e5d241ddb2 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 12:48:08 -04:00
Jeremy Huddleston
d563009cd1 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:38:05 -04:00
Jeremy Huddleston
2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston
7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Andreas Faenger
f4537f99cc softpipe: Anisotropic filtering extension.
Reference implementation which produces high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-06 08:21:09 -06:00
Brian Paul
b438005d96 st/mesa: fix renderbuffer internal format for accum buffer
Fixes an accum buffer regression since switching to the table-based
format selection code.
2011-06-06 08:06:34 -06:00
Marcin Slusarz
155cf15ce2 util: add \n to debug_checkpoint_full
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Marcin Slusarz
fb40f1f532 nv50: fix nv50_sampler_state_delete array overflow
num_samplers is array of 3 elements, not 5
2011-06-06 11:20:54 +02:00
Jeremy Huddleston
5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

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

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Jeremy Huddleston
1885cf27c9 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

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

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
3843bbcb4c glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
8593bb32ea apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Jeremy Huddleston
7cdf969527 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Ben Skeggs
1d24e6ec1d dri/nouveau: fix gnome-shell segfault
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-06 10:17:59 +10:00
Jeremy Huddleston
279e471750 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:22:47 -04:00
Jeremy Huddleston
b7f0ed8444 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:19:59 -04:00
Jeremy Huddleston
488d6c739f apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
22613d1670 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
bb621cb61e apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:07:05 -04:00
Jeremy Huddleston
4c9bab78a1 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:45 -04:00
Jeremy Huddleston
8e89d0bea7 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:44 -04:00
Eric Anholt
e8ea8793e3 meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.
Fixes fbo-srgb-blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:29:00 -07:00
Eric Anholt
a513bee2f2 meta: Don't do srgb to linear decode when blitting srgb textures.
Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:28:59 -07:00
Eric Anholt
164108e3db glx: Fix use-before-null-check in dri2InvalidateBuffers().
The compiler used our dereference here to skip the NULL check below.
Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
OpenJDK 6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-03 16:03:34 -07:00
Eric Anholt
836a595594 i965: Drop remaining strict conformance fallback for GL_POINT_SMOOTH.
We actually could do this in hardware in the fragment shader using
gl_PointCoord and the point's size.
2011-06-03 16:03:18 -07:00
Eric Anholt
e9868979c5 i965: Drop strict conformance fallback for GL_LINE_STIPPLE.
We implement line stipples, just not *quite* correctly.  We have a
piglit testcase to use when we want to fix it, if we do.  Until then,
don't lie to our test suites.
2011-06-03 16:03:18 -07:00
Eric Anholt
d313346db6 i965: Drop strict conformance fallback for GL_LINE_SMOOTH.
We do have hardware antialised lines.  If we care, we should actually
fix them to be conformant (or as close as possible) instead of using
this knob to fool testcases using swrast.

For some interesting reading on the state of GL_*_SMOOTH across
several drivers, see:
http://homepage.mac.com/arekkusu/bugs/invariance/HWAA.html
2011-06-03 16:03:18 -07:00
Eric Anholt
d8b733643d i965: Drop strict conformance fallback for GL_POLYGON_SMOOTH.
From my reading of the GL 2.1 spec, no antialiasing is strictly
conformant for polygon smoothing.  Yes, it's absurd, but then,
hardware doesn't support this so maybe it's not so absurd.
2011-06-03 16:03:18 -07:00
Eric Anholt
3f05374574 i965: Drop INTEL_CONFORMANCE=2 fallback code.
This was just a duplicate of no_rast=true driconf option, which is
relatively standard across drivers.
2011-06-03 16:03:18 -07:00
Paul Berry
6491e9593d glsl: fixed printing of structure constants.
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 12:48:49 -06:00
Paul Berry
26b566e19c AST dump: fixed printing of conditionals.
ast_expression::print() had an incorrect index into the subexpressions
array, so (a ? b : c) was being incorrectly rendered as (a ? b : b).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 11:07:00 -06:00
Dave Airlie
4077336fc7 r600g: move spi update to only when states change.
This updates the spi state after ps/vs binding or rasteriser state
change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:27:00 +10:00
Dave Airlie
1dbcb83881 cso: move cso hashes to a more table driven scheme
this removes a bad branch pain in the hash table lookup fn.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
970726dd6f u_prim: convert u_trim_pipe_prim to table driven.
This makes this function not be an always miss for the branch predictor.

Noticed using cachegrind, makes a minor difference to gears numbers on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
de0adb691f r600g: make conv pipe prim table driven.
This is a lot more branch predictor friendly, it actually
showed up in cachegrind profiles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
aaeb9a8216 mesa: fix typo (s/GLGL/GLSL/) 2011-06-02 21:49:49 -06:00
Brian Paul
52f6e79b7c mesa: 80-column wrapping 2011-06-02 21:49:49 -06:00
Brian Paul
9653acc52a mesa: consolidate glGetUniform code 2011-06-02 21:49:49 -06:00
Brian Paul
bbce18c647 mesa: refactor/consolidate uniform lookup code 2011-06-02 21:49:49 -06:00
Brian Paul
230c71d9ee mesa: add some minor fixes for geometry shaders 2011-06-02 21:49:49 -06:00
Brian Paul
b03296c1e9 dri: add missing files from 873379a881 2011-06-02 18:27:10 -06:00
Pierre-Eric Pelloux-Prayer
09201cc7a0 mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:48 -06:00
Pierre-Eric Pelloux-Prayer
0dae94610e glapi: regenerated files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:13 -06:00
Brian Paul
898f4c5133 glapi: add glDrawElementsInstancedBaseVertex() function to xml
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:54:55 -06:00
Johannes Obermayr
873379a881 dri/nouveau: Fix build with --enable-shared-dricore.
- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:21:26 -06:00
Brian Paul
a9c5efb111 r300: remove MIN3 macro, already defined in macros.h 2011-06-02 17:21:26 -06:00
Dave Airlie
51d0892ee2 r600g: sampler and texture state doesn't need a range/block.
These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 08:54:25 +10:00
Adam Jackson
e09e5cb7d8 glx: Remove (unused, broken) fastImageUnpack fast path
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:22 -04:00
Adam Jackson
776a2a5447 glx: Fix another case of using req outside of the display lock
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:21 -04:00
Marek Olšák
bddf275db4 softpipe: add a better fake implementation of fences
The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.
2011-06-02 16:50:46 +02:00
Brian Paul
f62e1f41b4 util: faster logbase2 2011-06-02 08:45:27 -06:00
Benjamin Bellec
bab3b4a758 mesa: faster logbase2
With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 08:31:20 -06:00
Brian Paul
029ea39fb9 st/mesa: add GL_R11F_G11F_B10F to format table
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-02 08:01:28 -06:00
Christoph Bumiller
d1fd740bb7 d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0 2011-06-02 14:10:37 +02:00
Christoph Bumiller
a531513b06 d3d1x/sm4: fix swizzle for 1 component operands
For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.
2011-06-02 14:10:34 +02:00
Chris Wilson
f61d1deac7 i965: Raise const.MaxTextureLevels to 14 (8192)
Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-02 08:30:21 +01:00
Dave Airlie
b0dc2d0c3b r600g: add spi state and move spi/vgt to modify register
This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:08:24 +10:00
Dave Airlie
573758fd09 r600g: decrease CPU time on set buffer resources
This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:03:52 +10:00
Dave Airlie
4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie
42502b6f03 r600g: deinline r600_pipe_state_add_reg.
This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:53:15 +10:00
Dave Airlie
7f6672f6a7 r600g: prepare for passing ctx into _r600_pipe_state_add_reg
This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:50:18 +10:00
Dave Airlie
991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie
c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie
8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie
9eb86f89a9 r600g: optimise state setting in r600_draw_vbo.
This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Dave Airlie
8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Brian Paul
57242715cb st/mesa: add format table entry for GL_RGB9_E5
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-01 16:25:42 -06:00
Nathan Kidd
f3652f0983 glapi: Make xserver location error more helpful
glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-01 08:30:59 -06:00
Marek Olšák
b9e9df78a0 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-01 16:07:58 +02:00
Marek Olšák
d69dc2e203 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-01 16:03:26 +02:00
Marek Olšák
37a85b1830 r300g: remove unused debug option DBG_UPLOAD
And renumber the options.
2011-06-01 04:47:41 +02:00
Alex Deucher
c5903ed454 r600c: add support for llano
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher
414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Eric Anholt
c331b3123e i965/fs: Use the embedded compare in SEL on gen6+.
This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:23:50 -07:00
Benjamin Franzke
089aa313b4 wayland-drm: Check visual for being NULL 2011-05-31 15:13:37 -04:00
Benjamin Franzke
fc5aec9342 Fiuxp make tarballs for wayland-egl/drm 2011-05-31 15:13:37 -04:00
Benjamin Franzke
a7cd65fb38 st/egl: Fix udev linkage when egl_dri2 is not build 2011-05-31 15:13:37 -04:00
Benjamin Franzke
aa87a938fb egl_dri2: Fix usage of bool values 2011-05-31 15:13:36 -04:00
Benjamin Franzke
5bf6cc95c1 wayland-egl: Remove left-over headers and struct 2011-05-31 15:13:36 -04:00
Eric Anholt
f04765922c i965: Remove brw_surface_state struct that is now unused.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
ee643b23ff i965: Switch brw_state_dump to using bitshifting for surface state.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
e764f10ea5 i965: Replace struct with bit shifting for WM null surfaces.
Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
9bdc44a528 i965: Replace struct with bit shifting for WM pull constant surfaces.
This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ac11c01dde i965: Replace struct with bit shifting for WM render target surfaces.
This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ae5c1fceba i965: Replace structs with bitfield shifting for WM texture surfaces.
This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
7d437b1f7f i965: Add defines for surface state setup using bitfield shifting.
It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).
2011-05-31 12:07:28 -07:00
Eric Anholt
3412069e23 i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:07:28 -07:00
Eric Anholt
bcbb1a536f i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
d1946f5348 i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Ian Romanick
f29bc77572 intel: Remove unused NO_TILE macro
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-31 11:46:29 -07:00
Marek Olšák
b1246cf13b r300g: set squared microtiling for the dummy zbuffer
The pitch of 4 is allowed for squared microtiling only.
2011-05-31 18:19:27 +02:00
Alex Deucher
b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Marek Olšák
c4175c811e r300g: log when getting unsupported texture format 2011-05-31 15:20:38 +02:00
Dave Airlie
d2ede5e648 gallium: include limits.h in p_config.h
We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-31 17:28:48 +10:00
Dave Airlie
0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie
65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Marek Olšák
29ceeeba20 mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 16:26:02 +02:00
Marek Olšák
1b37a41661 st/mesa: don't use resource_copy_region for CopyPixels with conditional render
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:06 +02:00
Marek Olšák
8d45bbc422 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:03 +02:00
Marek Olšák
91e56c8897 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:01 +02:00
Marek Olšák
ccfeb90b75 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:58 +02:00
Marek Olšák
c0277d9539 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:53 +02:00
Marek Olšák
1c95c3ef9c st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:43 +02:00
Marek Olšák
24ed0b384b st/mesa: fix typos and add some format fallbacks in format_map
Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:35 +02:00
Marek Olšák
6c638b7ca1 st/mesa: consolidate listing of depth formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:31 +02:00
Marek Olšák
26d718ff71 st/mesa: add GL_DEPTH_COMPONENT32 fallback formats
This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:27 +02:00
Marek Olšák
49d4e803d3 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:21 +02:00
Marek Olšák
ff038170ff tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:48:03 +02:00
Marek Olšák
f133ff51a2 trace: implement texture_barrier 2011-05-29 16:17:11 +02:00
Marek Olšák
b9e8cb0a59 trace: implement render_condition 2011-05-29 16:17:11 +02:00
Marek Olšák
76056510bc r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
2011-05-29 16:17:11 +02:00
Tom Stellard
aae56150f5 r300g: Fix non-dri builds
This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.
2011-05-28 21:16:00 -07:00
Marek Olšák
f76787b3ea r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
2011-05-29 05:15:27 +02:00
Marek Olšák
d18792f93d r300g: cleanup render_condition a bit 2011-05-29 05:15:27 +02:00
Marek Olšák
70b86fb273 r300g: remove fake occlusion queries (debug option) 2011-05-29 05:15:27 +02:00
Marek Olšák
2397f20b6b r300g: remove debug option DBG_FALL 2011-05-29 05:15:27 +02:00
Marek Olšák
9a3f861faf r300g: print some HyperZ debug info 2011-05-29 03:03:14 +02:00
Stéphane Marchesin
fc48de4fab glx: Fix glXGetFBConfigFromVisualSGIX.
We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Pierre-Eric Pelloux-Prayer
4eeabd5a3d mesa: set parameter list StateFlags field in _mesa_layout_parameters()
When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Eric Anholt
0653c450cc i965/fs: Fix up for 8752764076.
I failed to commit and squash before pushing.
2011-05-27 09:51:28 -07:00
Eric Anholt
9bd7e9c6b2 mesa: Include shader target in dumps of GLSL source.
This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 09:07:32 -07:00
Eric Anholt
8752764076 i965/fs: Do a FS compile up front at link time to produce link errors.
At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.
2011-05-27 09:07:32 -07:00
Eric Anholt
d1f70a8a6c i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:40 -07:00
Eric Anholt
11dd9e9c0f i965/fs: Split the BRW native code emit to brw_fs_emit.cpp
This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:39 -07:00
Eric Anholt
b7b700aeb0 i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:30 -07:00
Eric Anholt
14b86f3c91 i965: Move non-FS-specific shader support to brw_shader.cpp.
These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:05 -07:00
Eric Anholt
53c89c67f3 i965: Avoid generating MOVs for assignments of expressions.
No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.
2011-05-27 08:19:52 -07:00
Eric Anholt
1791857d7d i965/fs: Move the computation of register block count from unit to compile.
No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:19:27 -07:00
Eric Anholt
615117ce4e i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b890 in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34968
2011-05-27 08:08:23 -07:00
Eric Anholt
40540cc517 i965/fs: Add a helper function for add_dep(before, after, before->latency).
This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:08:23 -07:00
Trevor Davenport
828b26b7eb nv50: fix emit_add_a16 to emit correct source reg
emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.
2011-05-27 10:25:40 +02:00
Brian Paul
4609e80288 mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648
2011-05-26 19:25:44 -06:00
Brian Paul
e401c1f57f mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table 2011-05-26 19:25:44 -06:00
Brian Paul
6126d50e75 mesa: plug in GL_ARB_vertex_array_object display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
e00481586c mesa: more geometry shader display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
3b0f431820 mesa: more transform feedback display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
919e260bff mesa: make query object API functions static
Only directly referenced by the _mesa_init_queryobj_dispatch() function.
2011-05-26 19:25:44 -06:00
Brian Paul
848bcd2e8c mesa: simplify query object display list dispatch setup 2011-05-26 19:25:44 -06:00
Eric Anholt
f7b3f40b70 i965: Pack the lookup and line_aa bits into the first dword of the key.
They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
9a729ab4b2 i965: Remove dead shadowtex_mask entry in the WM key.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
f147599ef4 i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
c095335fa5 intel: Drop doubly irrelevant code in intelReadBuffers.
First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
6d4b974e89 mesa: Flush vertices before updating drawbuffer computed state.
Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
d3451f7f9c mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
f73ff463a2 mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Brian Paul
179a88d52c mesa: minor whitespace fixes 2011-05-25 21:07:50 -06:00
Brian Paul
f84be846ca mesa: plug in sync object display list functions
Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.
2011-05-25 21:06:51 -06:00
Brian Paul
95fa22c864 mesa: display list support for glProgramParameteriARB() 2011-05-25 20:44:35 -06:00
Brian Paul
001aa6c979 mesa: plug shader object functions into display list dispatch 2011-05-25 20:39:08 -06:00
Brian Paul
4535c98cdb mesa: plug in GL 3.0 ClearBuffer() display list functions 2011-05-25 20:27:44 -06:00
Brian Paul
8f7c815568 mesa: fill in missing sampler object display list functions 2011-05-25 20:20:22 -06:00
Brian Paul
3e06803c2c st/mesa: simplify some st_context(ctx)->pipe code 2011-05-25 18:16:03 -06:00
Brian Paul
bf14ab417c st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-25 18:07:35 -06:00
Jakob Bornecrantz
1697dac642 i915g: Bump texture sizes
Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-05-25 22:06:11 +02:00
Eric Anholt
b5846865de i965: Warnings cleanup.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Eric Anholt
fa42de5ad7 i965: Fix assertion failures in unused brw_reg setup by deleting it.
I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Alex Deucher
5ed7a7b720 r600g: remove duplicate opcode in r600_opcodes.h
V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 11:04:25 -04:00
Chad Versace
e7bcfadc22 intel: Change FBO validation criteria to accomodate hiz and seprate stencil
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
ce8fdf666f intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
c270f1a628 intel: Add hiz_region to intel_mipmap_tree
When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
6ed829fe50 intel: Refactor the wrapping of textures with renderbuffers
Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
7c0e6d9bbc intel: Add hiz_region to intel_renderbuffer
A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
a9e6509785 intel: Add is_hiz_depth_format() to intel_contex.vtbl
Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
b5c847c7ca intel: Change supported texture formats for separate stencil
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
4e0654ec29 mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
76f77cb07e intel: Add flags to intel_context for hiz and separate stencil
Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Adam Jackson
a95ec18549 glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-25 06:19:29 -04:00
Alex Deucher
c44dad559a egl_dri2: add new cayman pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 01:27:34 -04:00
Alex Deucher
017cd5dcc3 r600g: fix eg/cayman scissor workaround
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-24 22:44:16 -04:00
Dave Airlie
868c04205c r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:50:17 +10:00
Dave Airlie
7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie
d1b8f8e8b3 r600g: don't lookup a vs semantic for position/face.
These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 10:01:25 +10:00
Dave Airlie
ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Adam Jackson
3869be74af glx: More comment cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:45:02 -04:00
Adam Jackson
a3aecd190b glx: Remove some misleading comments
These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:33 -04:00
Adam Jackson
5a6897ff0b drisw: Namespace better for ease of navigation
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:21 -04:00
Adam Jackson
b24f291e42 drisw: dead store removal
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:43:53 -04:00
Mike Kaplinskiy
d3b6e8a2b8 mesa: fix glGetTexImage for cases when srgb decode is skipped
See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-24 09:06:04 -06:00
Brian Paul
cd5417aac7 st/mesa: prefer formats without stencil for DEPTH_COMPONENT
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.
2011-05-24 09:00:17 -06:00
Brian Paul
d57e95f22a st/mesa: rewrite st_choose_format() to be table driven
Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.
2011-05-24 08:49:01 -06:00
José Fonseca
c3c1976f52 wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-05-24 13:12:39 +01:00
Thierry Reding
5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
Adam Jackson
e8b1c6d6f5 mesa: Fix return type of _mesa_get_format_bytes() (#37351)
Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-23 11:07:34 -04:00
Kenneth Graunke
d0c6d24a9e i965/gen7: Fix miptree layout for cube surfaces.
Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Kenneth Graunke
b522eb0717 i965: Remove comments about pre-965 hardware.
They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
pepp
fd6f2d6e57 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-21 09:49:14 -06:00
Christian König
3c5e741862 r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 16:40:20 +02:00
Kenneth Graunke
9be8524af7 i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
24de02acac i965: Remove "TXD" from justification of sampler message headers.
The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
5e48560926 i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
The same as 3e43adef95 but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:31:18 -07:00
Benjamin Franzke
733fa000ce st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ea90eca44b st/dri: Support dri2 useflags in dri2_create_image 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ca79036fe8 st/egl/wayland: Deal with wayland visual changes
Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.
2011-05-20 13:05:14 -04:00
Thierry Reding
8e7d4d4e0c mesa: Emit definition of GLAPIENTRYP in es_generator.py.
GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.
2011-05-20 12:59:23 +01:00
José Fonseca
075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca
a436b3b2d4 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-05-20 11:54:52 +01:00
Brian Paul
4f59b32178 r300: move declaration before code 2011-05-19 21:23:39 -06:00
Brian Paul
38f89c7008 st/glx: define/set new ST_CONTEXT_FLAG_bits 2011-05-19 21:18:33 -06:00
Brian Paul
1929d52fd9 st/glx: pass major, minor, context flags, etc to XMesaCreateContext() 2011-05-19 21:18:33 -06:00
Brian Paul
d1cd1cc871 st/glx: implement glXCreateContextAttribsARB() 2011-05-19 21:18:33 -06:00
Brian Paul
81183b1e3e st/glx: pass version, context flags, etc to create_context() 2011-05-19 21:18:33 -06:00
Brian Paul
7be3e50731 st/glx: refactor create-context functions 2011-05-19 21:18:33 -06:00
Brian Paul
43bdabd47d mesa: fix vertex array enable checking in check_valid_to_render()
In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-19 21:18:33 -06:00
Roland Scheidegger
be0a2f62f3 mesa: handle some srgb cases in the fast path in _mesa_get_teximage
Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).
2011-05-20 01:43:40 +02:00
Kristian Høgsberg
339544f4bb wayland-drm: Use new generic error event 2011-05-19 12:07:00 -04:00
José Fonseca
ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
José Fonseca
f4a9868811 mesa: add another missing GLAPIENTRY keyword
NOTE: this is a candidate for the 7.10 branch.
2011-05-19 16:39:57 +01:00
Maxim Levitsky
116133af34 nv50: add support for user clip planes
Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.
2011-05-19 12:50:28 +02:00
Kristian Høgsberg
bfaa458445 wayland: Fix link order for libwayland-drm.a 2011-05-18 18:57:05 -04:00
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Eric Anholt
a98dd64af7 i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
2011-05-18 13:57:17 -07:00
Eric Anholt
64f8ddaf9b i965/gen6: Add support for point min/max size from ARB_point_parameters.
Fixes glean pointAtten.
2011-05-18 13:57:17 -07:00
Eric Anholt
90e922267a i965/fs: Don't emit a header on gen5+ sample messages unless required.
Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
4bbc7915f1 i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
b126a0c0cb i965: Add support for correct GL_CLAMP behavior by clamping coordinates.
This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-05-18 13:57:17 -07:00
Eric Anholt
7592f00560 i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.
2011-05-18 13:57:17 -07:00
Eric Anholt
136eb2bde7 i965/fs: Add support for "if" statements in 16-wide mode on gen6+.
It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
27b0392661 i965/fs: Fix discard and alpha test in 16-wide.
As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
367020d87c i965/gen6: Fix blending state when no color buffer is bound.
This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.
2011-05-18 13:57:16 -07:00
Eric Anholt
51761a1aef i965/fs: Cut an instruction and a temporary from gen6 discard statements.
I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:16 -07:00
Eric Anholt
5dd5be69f0 i965/fs: Fix compiler warnings about dead code from 9634318290 2011-05-18 13:57:16 -07:00
José Fonseca
61c67eca7d gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-05-18 18:14:37 +01:00
Andreas Faenger
8a98aabe0b swrast: anisotropic filtering extension
Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-18 08:14:33 -06:00
Brian Paul
707eadcb7f mesa: simplify error check in _mesa_MapBufferRange() 2011-05-18 08:14:32 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
de1df26b5c mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
2011-05-18 07:51:33 -06:00
Kenneth Graunke
3e0bb02358 i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 01:31:29 -07:00
Tapani Pälli
2758e65f28 add $SELINUX_LIBS to EGL and OpenVG lib deps
Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:58:53 +10:00
Dave Airlie
bb31ecf4fb mesa/st: split updating vertex and fragment shader stages.
this seems like a logical thing to do and sets the correct st flags
for vertex textures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
6bd8647b54 st/mesa: only memset sampler when about to use it.
This function was taking a lot more CPU than required due to it memsetting
a bunch of memory that didn't require it from what I can see.

We should only memset here when we are about to fill out the sampler,
otherwise we end up doing a bunch of memsets for everytime this function
is called, basically setting 0 memory to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Eric Anholt
4e98318fc1 i965: Instead of fallback on missing region, just bind a null renderbuffer.
The change for GPU hanging in 13bab58f04
fell back even when rb == NULL, which is wrong for GLES2 and caused
segfaulting in GLES2 conformance.  For the GPU hang case (where the
broken 2D driver failed to allocate a BO for the window system
renderbuffer), it also would assertion fail/segfault immediately after
the fallback setup when the renderbuffer map failed.

Fixes GLES2 conformance packed_depth_stencil.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:17 -07:00
Kenneth Graunke
461e193971 i965: Updated fixed-point sizes in Ivybridge SAMPLER_STATE.
Texture LOD Bias is now S4.8 instead of S4.6;
Min LOD, and Max LOD are now U4.8 instead of U4.6.

Fixes piglit test tex-miplevel-selection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:16 -07:00
Kenneth Graunke
ead7d73a51 i965: Ivybridge uses the Gen4 SAMPLER_BORDER_COLOR_STATE.
Volume 5c 1.13.7 lists it as [PreDevILK] and [DevIVB+].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:47:52 -07:00
Kenneth Graunke
b2c1f8ff1d egl: Recognize Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
1b3d354743 intel: Recognize new Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
7f5e0d2a90 i965: Disable register spilling on Ivybridge for now.
The data port messages for this are rather different.  For now, fail to
compile rather than hanging the GPU.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
344283de5d i965: Fix RNDZ and RNDE on Sandybridge and Ivybridge.
On gen4/5, the RNDZ and RNDE instructions return floor(x), but set special
"round increment bits" in the flag register; a predicated ADD (+1) fixes
the result.

The documentation still lists '.r' as existing, and says that the
predicated add is necessary, but it apparently lies.  According to the
simulator, BRW_CONDITIONAL_R (7) is not a valid conditional modifier
and the RNDZ and RNDE instructions simply produce the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
199a2f90ab i965: Fix data port reads on Ivybridge.
These also need to use gen7_dp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
2a95568f64 i965: Avoid register coalescing away MATH workarounds on Ivybridge.
The MATH instruction cannot handle source modifiers, even on Gen7.
So, apply this workaround for Sandybridge on Ivybridge as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
6e918163df i965: Make the CONT instruction point to the WHILE instruction.
This fixes piglit test glsl-fs-loop-continue.shader_test on Ivybridge.
According to the documentation, the CONT instruction's UIP field should
point to the WHILE instruction on both Sandybridge and Ivybridge.

The previous code made UIP point to the implicit DO instruction, which
seems incorrect.  I'm not sure how it could have worked on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
77397ef96e i965: Add support for loops on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
64ce592679 i965: Add support for IF/ELSE/ENDIF control flow on Ivybridge.
Ivybridge's IF instruction doesn't support conditional modifiers.
It also introduces UIP, which must point to the ENDIF instruction.

ELSE and ENDIF remain the same except that JIP moves from dst to src1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
ff6e3c73f6 i965: Add support for Ivybridge texturing messages.
Ivybridge puts the shadow comparator first, then lod/bias, and finally
the coordinate---unlike previous generations which always reserved four
slots for the coordinate at the beginning.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
36f8de02e7 i965: Fix sampler message descriptor on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3f44043da3 i965: Fix SAMPLER_STATE on Ivybridge.
Most of this code copied from brw_wm_sampler_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3984372104 i965: Mark some brw_wm_sampler_state.c helper functions as non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
b2b6cc6622 i965: Update SURFACE_STATE for Ivybridge.
I'm still not happy with the amount of code duplication here, but it
will have to do for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
c12a93d5c4 i965: Mark a few more brw_wm_surface_state functions as non-static.
I need to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
70c6cd39bd i965: Change brw_format_for_mesa_format to a non-static function.
This will make it easier to share between files.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
62b79b4bb9 i965: Set Address Modify Enable in VERTEX_BUFFER on Ivybridge.
Otherwise, Ivybridge seems to ignore the newly supplied data, giving us
rubbish for vertices.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
09d881bf74 i965: Enable channel masks in Ivybridge's URB_WRITE_HWORD header.
This shouldn't be done using MRFs, but until I have a proper solution
for dealing with MRFs, this allows my hack to keep working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
97d4d6f77e i965: Fix the URB write message descriptor on Ivybridge.
The message header is still incorrect, but this is a start.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
ce526a7452 i965: Fix render target writes on Ivybridge.
Ivybridge shifts the data port messages by one bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
482e8a6cd5 i965: Mad hacks to avoid using MRFs on Ivybridge.
Ivybridge's SEND instruction uses GRFs instead of MRFs.  Unfortunately,
a lot of our code explicitly uses MRFs, and rewriting it would take a
fair bit of effort.  In the meantime, use a hack:

- Change brw_set_dest, brw_set_src0, and brw_set_src1 to implicitly
  convert any MRFs into the top 16 GRFs.
- Enable gen6_resolve_implied_move on Ivybridge: Moving g0 to m0
  actually moves it to g111 thanks to the previous hack.

It remains to officially reserve these registers so the allocator
doesn't try to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
550ad737f7 i965: Emit 3DPRIMITIVE Ivybridge-style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
fa4b23581b i965: Don't use the GS for breaking down quads on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
d58400eb4a i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
8c8985bdd7 i965: Add depth buffer support on Ivybridge.
This also disables the HiZ and separate stencil buffers.  We still need
to implement stencil.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
bc08d4ebb8 i965: Upload sampler state pointers on Ivybridge.
Since we currently only support sampling in the fragment shader, we only
bother to emit the PS variant.  In the future we'll need to emit others.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
a94fe79464 i965: Disable binding table pointers for unused pipeline stages.
This may not be necessary, but it seems like a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
706dbf85f1 i965: Upload binding table pointers on Ivybridge.
Ivybridge uses per-stage commands to update binding table pointers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
e0e2c04596 i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.
Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits.  Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
bac10b58de i965: Explicitly disable unused pipeline stages on Ivybridge.
This may not be strictly necessary, but seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
6b2010df7d i965: Initial Ivybridge VS state.
Copied from gen6_vs_state.c; reuses create_vs_constant_bo from there.

The 3DSTATE_VS command is identical but 3DSTATE_CONSTANT_VS is not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
18402fbf79 i965: Initial Ivybridge Viewport state setup.
SF and CLIP viewport state has been combined into SF_CLIP_VIEWPORT;
SF_CLIP and CC state pointers can now be uploaded independently.

Some portions of the hardware documentation refer to separate upload
commands for SF and CLIP; these are outdated and incorrect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
81fd03fe56 i965: Initial Ivybridge Clip state setup.
Copied from gen6_clip_state.c.

This enables early culling and sets the necessary fields.  Otherwise, it
is entirely the same, so I doubt this patch is strictly necessary for a
functional driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
24d0ed72c1 i965: Initial Ivybridge CC state setup.
The state itself still seems to be the same; the only change is that
each part (CC, BLEND, DEPTH_STENCIL) can now be uploaded independently.
Thus, we still rely on the code in gen6_cc.c to set up the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
a924d69b57 i965: Initial Ivybridge WM/PS state setup.
Copied from gen6_wm_state.c.

The main change from Sandybridge seems to be that 3DSTATE_WM was split
into two separate state packet commands: 3DSTATE_WM and 3DSTATE_PS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
7d608d0c33 i965: Initial Ivybridge SF/SBE state setup.
Copied from gen6_sf_state.c.

The main change from Sandybridge seems to be that 3DSTATE_SF was split
into two separate state packet commands: 3DSTATE_SF and 3DSTATE_SBE
("setup backend").  The bit-offsets are even the same - only the DWords
numbers have shuffled around a bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
3dc4bc1f78 i965: Make gen6_sf_state.c's get_attr_override non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
8832920c29 i965: Initial Ivybridge URB space partitioning, including push constants.
Currently this always reserves 16kB for push constants, regardless of
how much space is needed, and partitions it evenly betwen the VS and FS.
This is probably not ideal, but is straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
477e2fe031 i965: Set maximum number of threads for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
235fa21a09 i965: Split out tracked state atoms for Ivybridge.
Currently, gen7_atoms is a verbatim copy of gen6_atoms; future commits
will update it to contain gen7-specific state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
89a82d72ca intel: Initial IS_GEN7 plumbing.
Currently, IS_GEN7, IS_IVYBRIDGE, IS_IVB_GT1, and IS_IVB_GT2 all return
false.  This allows me to write the code for them before actually adding
the PCI IDs and thus enabling the hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d55471768e i965: Rename max_vs_handles to max_vs_entries for consistency.
The documentation uses the term "vertex URB entries", the code talks
about "entry size", and so on.  Also, handles are just "pointers" to
entries (actually small integers).

Also rename max_gs_handles to max_gs_entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d0f0d06482 i965: Convert BRW_NEW_* dirty bits to use an enum.
This will make it much easier to add new dirty bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
c638180fc7 i965: Rework IF/ELSE jump target back-patching.
The primary motivation for this is to better support Ivybridge control
flow.  Ivybridge IF instructions need to point to the first instruction
of the ELSE block -and- the ENDIF instruction; the existing code only
supported back-patching one instruction ago.

A second goal is to simplify and centralize the back-patching, hopefully
clarifying the code somewhat.

Previously, brw_ELSE back-patched the IF instruction, and brw_ENDIF
back-patched the previous instruction (IF or ELSE).  With this patch,
brw_ENDIF is responsible for patching both the IF and (optional) ELSE.

To support this, the control flow stack (if_stack) maintains pointers to
both the IF and ELSE instructions.  Unfortunately, in single program
flow (SPF) mode, both were emitted as ADD instructions, and thus
indistinguishable.

To remedy this, this patch simply emits IF and ELSE, rather than ADDs;
brw_ENDIF will convert them to ADDs (the SPF version of back-patching).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
5936d96d33 i965: Move IF stack handling into the EU abstraction layer/brw_compile.
This hides the IF stack and back-patching of IF/ELSE instructions from
each of the code generators, greatly simplifying the interface.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
774fb90db3 i965: Get a ralloc context into brw_compile.
This would be so much easier if we were using C++; we could simply use
constructors and destructors.  Instead, we have to update all the
callers.

While we're at it, ralloc various brw_wm_compile fields rather than
explicitly calloc/free'ing them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
ebeea98573 i965/gs: Move generation check for bailing earlier.
On Sandybridge, we don't need to break down primitives.  There's no need
to bother setting up brw_compile and such if it's not going to be used;
bail as early as possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:57 -07:00
Kenneth Graunke
c6175d7870 i965: Add _NEW_LIGHT to Gen6 clip state dirty bits.
ctx->Light.ProvokingVertex depends on _NEW_LIGHT.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:30:46 -07:00
Brian Paul
3559440873 mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
2011-05-17 21:24:05 -06:00
Tom Stellard
217cd216ea r300/compiler: Fix bug in rc_get_variables()
Variables that write to the same source select need to pe paired
together otherwise the register allocator might fail.

https://bugs.freedesktop.org/show_bug.cgi?id=36753
2011-05-17 19:13:47 -07:00
Marek Olšák
390196ecc7 u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset 2011-05-17 01:21:30 +02:00
Marek Olšák
a3ac28a736 mesa: make RGB9_E5 non-renderable on swrast again
_BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
2011-05-17 00:13:43 +02:00
Marek Olšák
947190ab4b Revert "mesa: set reasonable defaults in update_wrapper"
This reverts commit 1d5f16ff8f.

It breaks fbo-readpixels on swrast.
For some reason, swrast likes GL_RGBA and CHAN_TYPE.
2011-05-17 00:13:43 +02:00
Kenneth Graunke
1309d2ea72 i965: Pass brw_compile pointer to brw_set_src[01].
This makes it symmetric with brw_set_dest, which is convenient, and will
also allow for assertions to be made based off of intel->gen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-16 13:30:16 -07:00
Kenneth Graunke
2b8e7215eb i965: Fix "Paramater" typo in gen6_wm_state.c.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-16 09:41:00 -07:00
Benjamin Franzke
b8033a5651 egl: Compile wayland-drm.a into libEGL independent of egl_dri2
Fixes egl_gallium when egl_dri2 is not enabled.
2011-05-16 10:36:36 +02:00
Dave Airlie
c9aa3bbda4 st/mesa: overhaul vertex/fragment sampler and sampler views.
This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me.

I've no idea if someone had another plan for this that is smarter than what
I've done here, but what I've basically done is

split fragment and vertex sampler and sampler_view setup function, factor
out the common chunks of both.

side-cleanups:
drop st->state.sampler_list - unused
don't update border color if we have no border color.

should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bc16c73407 gallium: block signals for new thread when spawning threads
I'm hard pressed to think of any reason a gallium thread would want to
receive a signal, especially considering its probably loaded as a library
and you don't want the threads interfering with the main threads signal
handling.

This solves a problem loading llvmpipe into the X server for AIGLX,
where the X server relies on the SIGIO signal going to the main thread,
but once llvmpipe loads the SIGIO can end up in any of its threads.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Tom Stellard
6d539579ad r300/compiler: Use ALU Result for IF conditionals
This saves one instruction per IF.
2011-05-14 22:35:28 -07:00
Marek Olšák
8a4136f624 r300g: HiZ fixes
Nothing special, just changing conditions for when HiZ can be enabled and
when HiZ memory becomes invalid.

I was thinking about it again and realized it had not been quite right.
2011-05-15 03:28:32 +02:00
Marek Olšák
19f59dd413 r300g: don't set other HyperZ states if depth and stencil tests are disabled
Such as HiZ.
2011-05-15 03:28:32 +02:00
Marek Olšák
fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Marek Olšák
904f43f190 r300g: fix conversion from int to boolean 2011-05-15 03:26:29 +02:00
Marek Olšák
51095f74cf u_vbuf_mgr: fix max_index computation once again
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.

Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Marek Olšák
ad2999d211 st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels
GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-14 01:53:30 +02:00
Kenneth Graunke
2bba244329 i965: Use BRW_DATAPORT_READ_TARGET_DATA_CACHE instead of 0.
Using the #define'd constant is better than 0 with a comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-13 15:20:52 -07:00
Kenneth Graunke
c77855d64e i965: Rename dp_render_target struct to gen6_dp.
This is actually just the message descriptor for Gen6+ dataport access;
it has nothing to do with the render cache.  Access to the sampler cache
and constant cache also would use this struct; rename for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:20:45 -07:00
Kenneth Graunke
17eaff77b0 i965: Attempt to un-muddle Gen6 data port message target defines.
These are documented on page 245 of IHD_OS_Vol4_Part2.pdf (the public
Sandybridge documentation/SEND instruction description).

Somebody had the bright idea to reuse gen4/5 defines labelled READ/WRITE
which just happened to be the same values as Render Cache/Sampler Cache.
It turns out that this field has nothing to do with READ/WRITE on
Sandybridge, but rather represents which data port to direct it to.

This was especially confusing in brw_set_dp_read_message, which
used "BRW_MESSAGE_TARGET_DATAPORT_WRITE."  In a read function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:19:31 -07:00
Christoph Bumiller
5f5d486717 nvc0: prevent overlap between load address and destination regs
For example, an indirect load like "ld b128 $r0q c0[$r0]" seems to
overwrite the address register before finishing the load, but only
if there are a lot of threads running.

Visible as displaced geoemtry in Unigine Heaven.
2011-05-13 18:47:54 +02:00
Marek Olšák
dd445ae120 docs: update relnotes-7.11 2011-05-13 18:10:30 +02:00
Marek Olšák
e28e3a774c st/mesa: expose ARB_shader_texture_lod if SM3 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-13 17:57:56 +02:00
Matt Turner
fae77579ad util_logbase2 takes and returns unsigned, not int
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:50 -06:00
Matt Turner
c5ac8a8aa2 Remove redundant util_unsigned_logbase2
util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8 u_math.h: Remove redundant mingw32 ffs definition
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Benjamin Franzke
184bb09ff5 st/egl: Implement EGL_WL_bind_wayland_display for x11,drm,wayland 2011-05-13 09:31:10 -04:00
Benjamin Franzke
83c68758be egl_dri2: Discard similar configs 2011-05-13 09:31:09 -04:00
Kristian Høgsberg
93aea63a33 egl_dri2: Make it possible to not compile in the X11 platform 2011-05-13 09:31:09 -04:00
Francesco Marella
64e3cd0c42 nvfx: fill some PIPE_CAPs
Signed-off-by: Francesco Marella <francesco.marella@gmail.com>
2011-05-13 14:56:40 +02:00
Kenneth Graunke
f247b2d633 i965: Fix incorrectly named data port define.
According to my documentation this is actually "Media Block Write" on
Gen4-5; there has never been a "DWord Block Write."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:36:07 -07:00
Kenneth Graunke
ceaec24149 i965: Fix typo in Gen6 "DWord Scattered Write" message define.
It's DWORD, not DWORLD.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:35:13 -07:00
Vinson Lee
ac85ab066b i915g: Fix typos in print messages. 2011-05-12 23:21:58 -07:00
Dave Airlie
c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Dave Airlie
1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie
240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie
d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie
d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie
5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
José Fonseca
5de2c67ba7 egl/dri2: Avoid unused static functions. 2011-05-12 15:24:26 +01:00
José Fonseca
4a47d6d46b egl/dri2: Prevent uninitialized variable dereference. 2011-05-12 15:23:48 +01:00
José Fonseca
6c26072bd1 egl/dri2: Fix const pointer duplication, prevent unitialized variable dereference.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:23:02 +01:00
José Fonseca
6a661895e9 egl: Fix int <-> ptr casts.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:12:16 +01:00
zhigang gong
6699cd4e8d glu: Fix _GLUfuncptr typedef.
typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning:
function declaration isn't a prototype.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-05-12 11:45:30 +01:00
José Fonseca
32a95cb70c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 01:09:55 +01:00
Tom Stellard
95c93651b4 r300/compiler: Fix bug in rc_get_variables()
Variables that share readers were not always being linked together.

https://bugs.freedesktop.org/show_bug.cgi?id=36939
2011-05-11 16:16:29 -07:00
Tom Stellard
4612554dce r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

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

Note: This is a candidate for the 7.10 branch.
2011-05-11 16:16:29 -07:00
Tom Stellard
d1e8195c07 r300/compiler: Add simple unit test framework
Plus three tests for rc_inst_can_use_presub()
2011-05-11 16:16:29 -07:00
Alex Deucher
b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca
7a271151a5 mesa: Don't append fog code for programs that don't output color.
Fixes fdo 36919.

NOTE: This is a candidate for the stable branches.

It should be cherry-picked to the sames branches that
3aa21f93dc was.
2011-05-11 14:04:08 +01:00
José Fonseca
2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
José Fonseca
a67ecfeebc st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-05-10 16:13:05 +01:00
Maxim Levitsky
d6b248652a nv50: fix mistake in pipe caps for pre-NVA0 cards
Introduced by 531b12af35.
2011-05-10 10:16:54 +02:00
Kenneth Graunke
68074387a4 ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
5a3a242a8f glsl: Add compiler support for ARB_shader_texture_lod.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
1d4eb8d5d8 mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-09 11:23:54 -07:00
Marcin Slusarz
4e1b1cbd0d nv50/nvc0: make transfers aware of PIPE_TRANSFER_MAP_DIRECTLY
If state tracker asked us to map resource directly and we can't
do it (because of tiling), return NULL instead of doing full transfer
- state tracker should handle it and fallback to some other method
or repeat transfer without PIPE_TRANSFER_MAP_DIRECTLY.

It greatly improves performance of xorg state tracker on nv50+,
because its fallback (DFS/UTS) is much faster than full transfer.
2011-05-09 20:19:19 +02:00
Matt Turner
86852236a3 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
2011-05-09 20:01:58 +02:00
Marek Olšák
7297f2ac3c r300g: unreference a zbuffer surface after decompression 2011-05-09 20:01:58 +02:00
Marek Olšák
56b39fcd8b r300g: remove redundant state variable hyperz_locked 2011-05-09 20:01:58 +02:00
Marek Olšák
801fbdf286 mesa: document instructions ir_to_mesa emits
GLSL stopped using:
   BRA, EXP, LOG, LRP, NRM3, NRM4, XPD.

GLSL started using:
   KIL, SCS, SSG, SWZ.
(omg why SWZ? isn't proc_src_register flexible enough?)

GLSL doesn't use these opcodes some Radeons do support:
   ARR, DP2A, DST, LRP, XPD.

These opcodes are now unused:
   AND, NOT, NRM3, NRM4, OR, XOR.
(plus maybe the NV extensions which are unused by Gallium)

In addition to that, we don't use two-dimensional indirect addressing,
which the Mesa IR can do.
2011-05-09 20:01:58 +02:00
Michel Dänzer
39be542f73 r300c: Fix up for register allocator rewrite.
Was broken by commit fe622bac0c ('r300/compiler:
Rewrite register allocator').
2011-05-09 18:26:50 +02:00
Jerome Glisse
b9e8ea6a27 r600g: anisotropic filtering support for evergreen hw
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-05-09 12:18:41 -04:00
Carl-Philip Haensch
ad904cdf98 r600g: add support for anisotropic filtering 2011-05-09 12:09:16 -04:00
Michel Dänzer
9d792d013c gallium: Factor out unknown endianness detection. 2011-05-09 12:29:47 +02:00
Matt Turner
991c1f0249 Don't allow compilation if endianness isn't known
PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of
ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here
only serves to allow bad things to happen.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:23:21 +02:00
Matt Turner
5e945863ca p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:22:59 +02:00
Marcin Slusarz
bd3ce30ee7 st/xorg: add some debugging messages to xorg_exa.c 2011-05-09 12:22:50 +02:00
Marcin Slusarz
6e0263fdd4 st/xorg: remove DEBUG_PRINT macro and add exa_debug_printf
Localizes preprocessor usage to one place.
2011-05-09 12:22:45 +02:00
Marcin Slusarz
7c5eaf5a2d st/xorg: fix compilation of xorg_exa.c with DEBUG_PRINT set to 1 2011-05-09 12:22:24 +02:00
Nicolas Kaiser
7074801ed7 cell: fix unbalanced parenthesis
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-08 07:41:26 -06:00
Matt Turner
de3d9fa956 mesa: add precision to M_PI constant
Value found in my math.h header.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:36:32 -06:00
Matt Turner
ebc0b2dca0 mesa: replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such.

log2(e) = ln(e)/ln(2) = 1/ln(2)

Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2
(right beside each other!) weren't the same.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:33:15 -06:00
Marek Olšák
03615c02d8 r300/compiler: implement TXD and TXL opcodes 2011-05-07 02:51:38 +02:00
Marek Olšák
d8e222d887 r300g: handle seamless_cube_map caps 2011-05-07 02:51:38 +02:00
Benjamin Franzke
6bb230970c egl/wayland: Follow wl_resource_destroy changes 2011-05-06 16:50:45 -04:00
Christoph Bumiller
531b12af35 nv50,nvc0: activate seamless cube map filtering 2011-05-06 21:11:03 +02:00
Marek Olšák
27d3e0b25c docs: update relnotes-7.11 2011-05-06 20:14:28 +02:00
Marek Olšák
483d2ea5e3 docs: update GL3 status 2011-05-06 20:14:28 +02:00
Marek Olšák
d931b0d8b3 r600g: implement seamless_cube_map for evergreen
The r600/r700 support will follow soon.
2011-05-06 20:13:05 +02:00
Marek Olšák
a5f0a11477 gallium: implement seamless cubemap extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
bf65c9ea41 mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Alex Deucher
3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Marcin Slusarz
3b2bc4ac5b gallium/xorg st/nv50: add PIPE_BIND_CURSOR
We need to distinguish surfaces for mouse cursors from scanouts,
because nv50 hardware display engine ignores tiling flags.
2011-05-06 19:09:23 +02:00
Kostas Georgiou
8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher
2c3232da7a egl_dri2: add new radeon pci ids
There seriously needs to be a better way to do
this.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:02:24 -04:00
Kristian Høgsberg
e5169e9615 egl: Add a cursor use bit to MESA_drm_image 2011-05-06 10:33:50 -04:00
Benjamin Franzke
834b84149d egl/wayland-drm: Generalize interface
Do not depend on _EGLDisplay and _EGLImage.
2011-05-06 10:33:50 -04:00
nobled
a3e2c8f31f glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the
DRI2 flush extension, in which case this would've
pointed to out of bounds memory...
2011-05-06 09:39:24 +02:00
Alex Deucher
31d27259b6 r600g: add back SOURCE_FORMAT setting that get accidently dropped
Spotted by Henri Verbeet

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 19:30:30 -04:00
Alex Deucher
5939bc03bc r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization.
Leaving SOURCE_FORMAT at 0 will work in all cases, but is less
efficient.  The conditions for the setting the EXPORT_NORM
optimization are as follows:

R600/RV6xx:
BLEND_CLAMP is enabled
BLEND_FLOAT32 is disabled
11-bit or smaller UNORM/SNORM/SRGB

R7xx/evergreen:
11-bit or smaller UNORM/SNORM/SRGB
16-bit or smaller FLOAT

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:54:03 -04:00
Alex Deucher
bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie
5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher
d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Marcin Slusarz
a041525ed9 mesa: don't call git if it's not git repository
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:21 -07:00
Marcin Slusarz
02a6c9428d mesa: don't touch git_sha1.h if sha1 didn't change
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:15 -07:00
Henri Verbeet
f60235e73a r600g: Match alpha ref precision to color format precision.
This fixes piglit fbo-alphatest-formats on Evergreen.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-05-05 21:00:38 +02:00
Dave Airlie
dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Dave Airlie
ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Jesse Barnes
70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Jesse Barnes
6ae9e8cbab GLX: don't crash when indirect clients try to set an event mask
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
José Fonseca
37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca
da87370032 mesa/gdi: Silence gcc warning about unused result. 2011-05-04 14:10:15 +01:00
José Fonseca
9fbd708932 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-05-04 13:09:14 +01:00
José Fonseca
c636daa145 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-05-04 13:09:13 +01:00
Brian Paul
fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Brian Paul
f85cd39fc4 mesa: remove unused restart.[ch] files
_mesa_PrimitiveRestartIndex() is in varray.c and glPrimitiveRestart()
is handled in the vbo module.
2011-05-03 18:22:04 -06:00
Ian Romanick
0f0179b8c2 glsl: Remove extra newline from error message 2011-05-03 14:51:02 -07:00
Alex Deucher
27477248d3 r600c: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:12:04 -04:00
Alex Deucher
c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Marcin Slusarz
a8bbce8d6d st/xorg: flush after loading the cursor
We need cursor data to land in destination buffer before drmModeSetCursor.
It fixes "cursor lag" on nv50.
2011-05-03 16:36:54 +02:00
Michel Dänzer
5829332a9b gallium/draw: Fix enum type taken by draw_get_shader_param().
Pointed out by clang:

src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion
from enumeration type 'enum pipe_cap' to different enumeration type
'enum pipe_shader_cap' [-Wconversion]
      return tgsi_exec_get_shader_param(param);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
2011-05-03 16:33:15 +02:00
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
Marek Olšák
93754d8499 r600g: reorder caps 2011-05-03 12:03:22 +02:00
Marek Olšák
320adb93a1 r600g: set correct PIPE_CAP_MAX_COMBINED_SAMPLERS 2011-05-03 12:03:22 +02:00
Marek Olšák
a677952e68 mesa: make AMD_draw_buffers_blend an alias of the ARB variant
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
3be1c7f260 glapi: regenerate files for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
Marek Olšák
9ecb46f59e glapi: add functions for AMD_draw_buffers_blend
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
62aa51b78a mesa: flush vertices before changing GL_RASTERIZER_DISCARD state, not after
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
aafbaa9e6a mesa: make _NEW_TEXTURE dirty when changing GL_TEXTURE_CUBE_MAP_SEAMLESS
Otherwise there would be no way to know whether the state has been changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Christoph Bumiller
220abb7adf nv50,nvc0: advertise GL_FIXED vertex buffers as supported
We'll handle them like f64 vertex buffers, by falling back to
copying vertex data to the command buffer through translate.
2011-05-03 00:02:36 +02:00
Christoph Bumiller
f986a6560f mesa,st/mesa: fix WPOS adjustment
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-03 00:00:55 +02:00
Jon TURNEY
9cb800a97c Default to --disable-gallium-r300 if not --with-driver=dri
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-05-02 17:34:42 +02:00
Marek Olšák
02b352e2ac gallium: reorder fields of pipe_rasterizer_state to pack it more tightly
sizeof(struct pipe_rasterizer_state):
    Before: 32 bytes
    After: 28 bytes

Reviewed-by: Brian Paul <brianp@vmare.com>
2011-05-02 17:16:09 +02:00
Marek Olšák
ca6896ba14 r600g: document some new evergreen formats 2011-05-02 17:16:09 +02:00
Marek Olšák
929b3d8233 r600g: remove some more FIXME comments 2011-05-02 13:15:43 +02:00
Michel Dänzer
5815d06ac5 st/xorg: Fix two more instances of typo 'accle'. 2011-05-02 09:36:49 +02:00
Marcin Slusarz
951244c4cd st/xorg: fix typos 2011-05-02 09:28:16 +02:00
Eric Anholt
484b51d484 i965/gen6: Align interleaved URB writes for overflow outputs as well.
Fixes glsl-max-varyings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35614
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-01 20:13:10 -07:00
Marcin Slusarz
eb0a9e9a5a targets/xorg-nouveau: load nouveau_dri.so instead of i915_dri.so 2011-05-02 02:39:44 +02:00
Marcin Slusarz
1654988562 targets/xorg-nouveau: add libnvc0.a to nouveau libs 2011-05-02 02:39:44 +02:00
Marek Olšák
0d5ceb5891 r600g: remove some FIXME comments
All texture LOD tests pass.
2011-05-02 01:43:33 +02:00
Marek Olšák
72c6a748b9 Revert "r600g: truncate point sampled texture coordinates"
This reverts commit 1dc204d145.

MC_COORD_TRUNCATE is for MPEG and produces quite an interesting behavior
on regular textures. Anyway that commit broke filtering in demos/cubemap.
2011-05-02 01:20:22 +02:00
Marek Olšák
fb8786bda3 st/mesa: remove set-but-unused variables 2011-05-01 14:31:41 +02:00
Marek Olšák
08520bdea2 tgsi: remove set-but-unused variables 2011-05-01 14:13:09 +02:00
Marek Olšák
cacdc42e36 draw: remove set-but-unused variable 2011-05-01 14:12:47 +02:00
Marek Olšák
425cfa139b rbug: remove set-but-unused variables 2011-05-01 14:07:31 +02:00
Marek Olšák
847d397b34 ir_to_mesa: remove set-but-unused variables 2011-05-01 14:02:36 +02:00
Marek Olšák
2032daced1 mesa: remove set-but-unused variables in texcompress_s3tc 2011-05-01 14:02:35 +02:00
Marek Olšák
2d2b546189 mesa: remove set-but-unused variable in bind_attrib_location 2011-05-01 14:02:35 +02:00
Marek Olšák
f507530d25 mesa: remove unused-but-set variable in extract_uint_rgba 2011-05-01 14:02:35 +02:00
Marek Olšák
97398d1d56 r300/compiler: remove set-but-unused variables 2011-05-01 14:02:35 +02:00
Marek Olšák
56e83b4aa2 r600g: remove set-but-unused variable 2011-05-01 13:25:52 +02:00
Marek Olšák
e9d2ef79de r600g: remove FIXME comment
DONTBLOCK is correctly handled in r600_bo_map.
2011-05-01 01:54:29 +02:00
José Fonseca
dc9e5ed5e1 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:38:00 +01:00
Tom Stellard
7679a4ddf4 r300/compiler: Cleanups from the regalloc merge 2011-04-30 13:15:29 -07:00
Tom Stellard
d7cf9833d7 r300/compiler: Add return statement to rc_list() 2011-04-30 12:57:09 -07:00
Tom Stellard
7edf7d1169 r300g: Fix scons build
Broken by the dependency on ralloc introduced by
fe622bac0c
2011-04-30 12:35:06 -07:00
Daniel Vetter
899b786b19 i915g: enable X-tiling for s3tc textures
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-04-30 20:42:34 +02:00
Tom Stellard
d379e938f0 r300/compiler: Enable swizzle packing in the allocator for r300 and r400 2011-04-30 11:00:16 -07:00
Tom Stellard
1b75d48e84 r300/compiler: Handle loops in the register allocator 2011-04-30 11:00:16 -07:00
Tom Stellard
ac952a11df r300/compiler: Handle loops in rc_get_readers() 2011-04-30 11:00:16 -07:00
Tom Stellard
fe622bac0c r300/compiler: Rewrite register allocator
The new allocator uses ra and does swizzle packing.

Also, a data structure (struct rc_variable) and associated functions have
been added for generating UD and DU chains.
2011-04-30 11:00:15 -07:00
Tom Stellard
e4a765ae2d ra: Add ra_set_node_reg()
This function can be used to avoid creating single register classes for
input/payload registers.  This makes optimistic coloring less likely
to fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-30 11:00:15 -07:00
Tom Stellard
dbac75fa2f r300/compiler: Use RC_MASK_W when converting RGB to Alpha instructions 2011-04-30 11:00:15 -07:00
Tom Stellard
4f4d1d06da r300/compiler: rc_reader_data: Add ExitOnAbort flag 2011-04-30 11:00:15 -07:00
Tom Stellard
bbcee3268a r300/compiler: Add more info to struct rc_reader
For pair instructions we need a reference to both the arg
and source.
2011-04-30 11:00:15 -07:00
Tom Stellard
6a6068e5e1 r300/compiler: Add remove dead sources pass
The instruction scheduler will sometimes leave orphaned sources when
converting instructions from RGB to Alpha.  If one of these orphaned
sources has an index greater than the maximum temporary register index,
then the compiler will incorrectly report "Too many hardware temporaries
used".  The dead sources pass cleans up these orphaned sources.
2011-04-30 11:00:15 -07:00
Marek Olšák
bd661a933b docs: add ARB_ES2_compatibility in relnotes-7.11 2011-04-30 12:02:01 +02:00
Marek Olšák
fdff7e635b st/mesa: expose ARB_ES2_compatibility if GL_FIXED vertex format is supported
Tested with softpipe and llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Marek Olšák
0f1e59deac mesa: accept GL_FIXED in glVertexAttribPointer (ARB_ES2_compatibility)
GL_FIXED should not be accepted in the other gl*Pointer calls in OpenGL.

There is a new piglit for this: arb_es2_compatibility-fixed-type.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Brian Paul
076bd11112 mesa: fix error string, remove out of date comment 2011-04-29 18:42:09 -06:00
Brian Paul
be293c14c6 mesa: remove commented-out #include 2011-04-29 18:40:56 -06:00
Thierry Vignaud
04bdb2f314 mesa: fix tarball creation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-29 17:56:35 -06:00
Eric Anholt
6a02679f01 i965/gen6: Fix LogicOp handling for GL_COPY and/or floating-point RTs.
We were accidentally leaving blending enabled for LogicOp GL_COPY,
which ARB_color_buffer_float/GL_RGBA32F-render (and friends) caught.
Additionally, the GL spec says that no LogicOp should be done to
floating-point targets, and the GPU gets really angry even if you say
to LogicOp GL_COPY to float.
2011-04-29 15:27:02 -07:00
Eric Anholt
3032582d03 i965: Remove dead entrypoints to state cache, rename the one that's left.
As we expanded the usage of the state cache, it grew extra
functionality.  However, with the recent state streaming rework, we're
back to the state cache being used only for shader kernels, which is
the piece of GPU state that's actually expensive to compute again from
scratch, since it involves compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:27:02 -07:00
Eric Anholt
acb4d5cd96 i965/gen4: Move the GS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:56 -07:00
Eric Anholt
8ba0c025a4 i965/gen4: Move clip state to state streaming
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
d6ba7b1603 i965: Drop the now unused brw_cache_data() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
bb7ff01deb i965: Fix up state dumping for SF state.
It was moved to state streaming a while back and this was left over.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
588cebce2d i965/gen4: Move VS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:43 -07:00
Eric Anholt
04e3f1d3c2 mesa: Add a bunch of documentation to the register allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:34 -07:00
Eric Anholt
a82a43e8d9 i965/gen6: Use the dynamic state base address to reduce relocations.
Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:23 -07:00
Eric Anholt
855f56ca13 i965/gen6: Move scissor state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:18 -07:00
Eric Anholt
5c742ea1ee i965: Move sampler state to state streaming.
Overall, across this series since the last set of numbers, gen6 3DMMES
taiji performance has dropped 0.8% +/- 0.3% (n=15), probably due to
the increased reissuing of state from some of the state objects that
otherwise never changed, and increased occurrence of the per-batch
overhead as we've increased how much we put in the batch BO without
increasing the batch BO's size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:14 -07:00
Eric Anholt
1a447749ed i965/gen4: Move WM state to state streaming.
The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:04 -07:00
Eric Anholt
c108a3f863 i965/gen6: Move the depth/stencil state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:59 -07:00
Eric Anholt
35e8fe5c99 i965/gen6: Move the blend state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:54 -07:00
Eric Anholt
2ee1fd2e8f i965/gen6: Move the color calc state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:50 -07:00
Eric Anholt
d67c08319f i965: Move the CC VP to state streaming.
This is in a way a revert of f5bb775fd1.
The tiny win that had will be overwhelmed by the win of using the gen6
dynamic state base address.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:49 -07:00
Eric Anholt
8d2047ca7e i965/gen6: Move the SF VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:45 -07:00
Eric Anholt
3628e123f1 i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:41 -07:00
Eric Anholt
32cc0c9d8d i965/gen6: Stream the VS push constants.
Improves 3DMMES taiji demo performance by 10.1% +/- 0.9% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:37 -07:00
Eric Anholt
90c70123b8 i965/gen6: Stream the WM push constants.
Improves 3DMMES taiji demo performance by 5.1% +/- 1.9% (n=15), by
reducing CPU time spent thrashing around those tiny little constant BOs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:30 -07:00
Eric Anholt
530de3a2f5 i965: Give the push constants and pull constants unique function names.
This helps clarify profiling results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:23:21 -07:00
Eric Anholt
03b2e0fcdf i965: Fix fragcoord_w on gen6 with 16-wide.
The payload regs can go all the way up to register 60+, so just give
them 8 bits to be addressed by instead of 3-4 (which made source_w_reg
of 8 end up 0).  There's no reason to aggressively pack these fields,
as they are just used as compiler information, where being easier to
access is probably more important than shaving a byte or two off of
the structure.

Fixes piglit fragcoord_w.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36649
2011-04-29 12:25:21 -07:00
Eric Anholt
8c1637a4c2 meta: Don't ask for floating point textures if not ARB_texture_float.
I was promoting to float for ARB_color_buffer_float unclamped, which
failed when ARB_texture_float wasn't present.  Since the metaops don't
need results outside of [0,1] when not drawing to a floating point
destination, they can just use a fixed point texture when floating
point destinations are impossible.

Fixes regression in fdo23670-depth_test when --enable-texture-float is
not present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
2011-04-29 12:02:44 -07:00
Brian Paul
2be2e1d3ad mesa: fix a few incorrect error messages 2011-04-29 12:03:48 -06:00
Benjamin Franzke
dc520d4fef egl/wayland: Fix possible lockup in drm initialization
Lockup happens when wl_drm interface is not available.
2011-04-29 17:05:16 +02:00
Jon TURNEY
8a58eccc62 Add git_sha1.h to .gitignore
Since commit de579a1 "Include GIT SHA1 in GL version string"

$ git status
 On branch master
 Your branch is ahead of 'origin/master' by 2 commits.

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       src/mesa/main/git_sha1.h
nothing added to commit but untracked files present (use "git add" to track)

Add git_sha1.h to .gitignore so git knows not to warn it is present but untracked

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-29 12:56:53 +01:00
Marek Olšák
f8279fb9d8 r600g: print opcodes names instead of numbers 2011-04-29 13:16:40 +02:00
Marek Olšák
f974bdebee docs: update relnotes-7.11 2011-04-29 11:32:55 +02:00
Marek Olšák
aed76e5af3 docs: update GL3 status 2011-04-29 11:32:55 +02:00
Marek Olšák
aeac658e25 mesa: remove unused variable bytesPerRow 2011-04-29 11:32:55 +02:00
Marek Olšák
8b558451ad r600g: implement EXT_packed_float 2011-04-29 11:31:55 +02:00
Marek Olšák
e62530a6c0 st/mesa: support EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
631d23daa9 mesa: implement EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-29 11:31:55 +02:00
Marek Olšák
b48359184e util: implement R11G11B10_FLOAT pack/unpack functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615 mesa, util: move RGB9E5 conversion functions to gallium/util
Also use MAX3 and incorporate Ian's suggestion in texformat.c.

I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
de9f55437a r600g: trivially implement EXT_texture_shared_exponent
Nothing else needed.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36 util: implement R9G9B9E5 pack and unpack functions
softpipe and llvmpipe support done (sampler only).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1da44f5923 st/mesa: support EXT_texture_shared_exponent
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
9d7698c468 mesa: implement EXT_texture_shared_exponent
swrast support done.

There is no renderbuffer support in swrast, because it's not required
by the extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1d5f16ff8f mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5.

Instead of setting GL_RGBA and CHAN_TYPE for most types,
use the helper functions to obtain the info.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Christopher Egert
608a4a17fe i915g: Enable S3TC texture support
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-29 02:15:07 +02:00
Kenneth Graunke
19efd1442c prog_print: Add support for printing the TXD opcode.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-28 14:51:29 -07:00
Brian Paul
8cce283038 llvmpipe: move active_query assignment
Fixes piglit regression.
2011-04-28 12:41:49 -06:00
Brian Paul
284191560b llvmpipe: move active_query assignment in lp_setup_begin_query()
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-28 07:51:55 -06:00
José Fonseca
fa7a051c25 sgi: Fix MSVC build.
Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.
2011-04-27 19:06:07 +01:00
Brian Paul
f9cc6acbfa st/mesa: raise shader MaxParameters if driver supports more
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-27 11:58:42 -06:00
Brian Paul
f3c92c2323 mesa: emit more info in program parser error message 2011-04-27 11:57:04 -06:00
Brian Paul
0be6ae74e9 svga: emit user-defined clip plane state
User-defined clip planes were a swtnl fallback before.
2011-04-27 11:51:30 -06:00
Eric Anholt
33afdf8356 docs: Note that ES2_compatibility is already done. 2011-04-27 09:48:38 -07:00
Eric Anholt
aa3e1c25d3 Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69.

Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake).  The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering.  Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
2011-04-27 09:48:26 -07:00
Brian Paul
66d95919d5 st/mesa: choose 3-component float formats before 4-component formats
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float
texture formats before trying the 4-component ones.  Before this,
GL_RGB16/32F were treated the same as GL_RGBA16/32F.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-27 09:06:31 -06:00
Brian Paul
48aa772589 st/mesa: whitespace fixes 2011-04-27 09:05:30 -06:00
Marek Olšák
b8de75d537 util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient 2011-04-27 13:16:35 +02:00
Marek Olšák
069a9766a9 mesa: add macros MIN3 and MAX3 2011-04-27 13:16:35 +02:00
Marek Olšák
7e5953fca2 gallium/nouveau: fix printf warnings 2011-04-27 13:16:35 +02:00
Marek Olšák
31200d0688 gallivm: fix warning: ‘value’ may be used uninitialized in this function
The path where it's uninitialized is guarded by an assert.
2011-04-27 13:16:35 +02:00
Marek Olšák
e031bed122 st/mesa: fix warning: ‘user_memory’ may be used uninitialized in this function
It's initialized later in a conditional the condition of which is always true
the first time it's evaluated.
2011-04-27 13:16:35 +02:00
Marek Olšák
1e5dc6a778 svga: fix warning: ‘uc.ui’ may be used uninitialized in this function
This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.
2011-04-27 13:16:35 +02:00
nobled
39cd791f34 os: simplify ifdef
The actual code that needs this include is just using
"if defined (PIPE_OS_UNIX)", and the two conditions should match.

This should also make the file compile under Hurd.
2011-04-27 11:35:02 +01:00
Brian Paul
2d422a6c48 docs: fix typo, wrap lines in 7.11 release notes 2011-04-26 14:58:33 -06:00
Brian Paul
83eda35f16 docs: add GL_ARB_robustness to 7.11 release notes 2011-04-26 14:57:57 -06:00
Brian Paul
6b329b9274 Squashed commit of the following:
commit 864fe253b04105b7469e5f7b064dc37637b944f8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 21 20:13:07 2011 -0600

    mesa: s/exec/disp/ in _mesa_init_histogram_dispatch()

    This function isn't normally compiled (FEATURE_histogram).

commit f4bf45e2b94b582cacd19cdca873c5be627e4250
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: hook up GL_ARB_robustness dispatch functions

    ...and advertise the extension.

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 2b89e38e5f572dc40cebc06381ae7c5d04386998
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: regenerated API files for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    glapi: add ARB_robustness xml

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: implement GL_ARB_robustness functions

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 938fd71f4c4742f274922d53492a7290ab8d9c9b
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add context fields for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 72075137bc79e65be03dac7e97b6dba93c3a86a4
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize more bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 32a3fc23746db49da903fbc08afa0135af3007d2
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize some bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit cecbf1f4d164207de373dec0cadee2e84e1f9656
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add more bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit edc895b52383d5bd274422db56adead1d81daf5f
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 3a96ef28a538f158a219b406cd090dee70470c85
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: use is_bufferobj() helper function

    Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-26 14:54:41 -06:00
Eric Anholt
37642518b8 i965/fs: Add support for compute-to-mrf in 16-wide mode.
This is more painful than instruction scheduling, as we have to
compare two MRF writes to see if they coincide, and have to handle
partial GRF writes before that (for example, the result of a math
instruction written to color).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:22 -07:00
Eric Anholt
445289b509 i965/fs: Typo fix a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:19 -07:00
Eric Anholt
0834607a89 i965/fs: Enable constant propagation in 16-wide.
All that needed fixing was skipping the newly-possible
uncompressed/sechalf partial GRF constant writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:16 -07:00
Eric Anholt
91d1a14158 i965/fs: Fix and enable the instruction scheduler for 16-wide.
Most of the work of the scheduler is agnostic to wide dispatch.  It
operates on our virtual GRF file, which means instructions are
generally referring to 8 or 16 wide naturally.  For the MRF file
management we're trying to track the actual hardware MRF file, so we
need to watch if an instruction writes multiple MRFs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:12 -07:00
Eric Anholt
3b20f999bb i965/fs: Add support for 16-wide dispatch with uniforms in use.
This is glued in in a bit of an ugly way -- we rely on the uniforms
having been set up by 8-wide dispatch, and we just reuse them without
the ability to add new uniforms for any reason, since the 8-wide
compile is already completed.  Today, this all works out because our
optimization passes are effectively the same for both and even if they
weren't, we don't reduce the set of uniforms pushed after
optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:05 -07:00
Eric Anholt
b061b5ffb0 hash_table: Add an iterator for doing things like cleanup of the HT.
Without this, consumers often have to keep linked lists of the
entries, at additional malloc cost.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:02 -07:00
Eric Anholt
b943b9b1a6 i965/fs: Add a little whitespace between shader dumping debug.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:59 -07:00
Eric Anholt
9c57780dc0 i965/fs: Add support for compr4 MRF writes.
These reduce an emitted (not decoded) instruction per shader on
g4x/gen5, but may allow for additional register coalescing as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:52 -07:00
Eric Anholt
42ad2f0b9b i965/fs: Add support for 16-wide dispatch on gen5.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:49 -07:00
Eric Anholt
662f1b48bd i965/fs: Add initial support for 16-wide dispatch on gen6.
At this point it doesn't do uniforms, which have to be laid out the
same between 8 and 16.  Other than that, it supports everything but
flow control, which was the thing that forced us to choose 8-wide for
general GLSL support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:46 -07:00
Eric Anholt
76b7a0c1af i965/fs: Add support for discard instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:43 -07:00
Eric Anholt
148a32e622 i965/fs: Add support for math instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:40 -07:00
Eric Anholt
54990673a6 i965/fs: Fix interference calculation of pixel_[xy] in 16-wide.
Fixes glsl-fs-ceil in that mode, which produced the code in the comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:33 -07:00
Eric Anholt
af20328271 i965/fs: Disable some optimization passes under 16-wide for now.
These are fixable for 16, but that can wait until after it's basically
working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:30 -07:00
Eric Anholt
8575d18362 i965/fs: Add support for 16-wide texturing on gen5+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:27 -07:00
Eric Anholt
141b0bb277 i965/fs: Add support for computing pixel_[xy] in 16-wide.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:25 -07:00
Eric Anholt
2ac1cb8b83 i965/fs: Add support for 16-wide dispatch to the register allocator.
Note that the virtual grfs are in increments of the dispatch_width,
not hardware registers -- this makes the 16-wide emit and 8-wide emit
mostly the same.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:21 -07:00
Eric Anholt
7c647a2fe9 i965: Move the destination reg setup for 8/16 wide to the emit code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:05 -07:00
Kristian Høgsberg
5dfba09d49 intel: Use tiling for dri2AllocateBuffer implementation 2011-04-26 13:26:34 -04:00
Kristian Høgsberg
7363088f9f intel: Set gen in intelInitScreen, just copy value in intelInitContext 2011-04-26 13:26:31 -04:00
Kristian Høgsberg
63325a0586 intel: Use X tiling for DRM EGL Images 2011-04-26 13:26:28 -04:00
Ian Romanick
cd354b4eb8 mesa: Remove SWcontext::_FogMode, use gl_context::gl_fog_attrib::Mode everywhere
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-25 18:27:17 -07:00
Kristian Høgsberg
f274dfaca4 egl: Use the right extension name in #ifdef 2011-04-25 15:34:04 -04:00
Kristian Høgsberg
b6ed837ffe wayland: Fix prototypes for EGL_WL_bind_wayland_display extension 2011-04-25 15:07:15 -04:00
Nicolas Kaiser
4dfbb81891 main: remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-25 11:03:01 -06:00
Benjamin Franzke
6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke
d72e7f0dd9 st/egl: Add wayland shm softpipe support 2011-04-25 10:45:57 -04:00
Benjamin Franzke
34fd282b27 st/egl: Generalize wayland backend a bit 2011-04-25 10:45:56 -04:00
Benjamin Franzke
aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Henri Verbeet
b2a98c3531 r600g: Unify comment style somewhat.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:22 +02:00
Henri Verbeet
d7577ae3a6 r600g: Cleanup the big endian support a bit.
In particular, make sure the code is at least compiled on little endian
systems.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Henri Verbeet
32001c2244 r600g: Use EG constants in EG r600_colorformat_endian_swap().
This would actually fail to compile when PIPE_ARCH_BIG_ENDIAN is defined.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Marek Olšák
0fecb928f5 configure.ac: require LLVM for r300g on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
a86fc719d6 configure.ac: enable LLVM by default on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
9e59ed59c1 mesa: add stricter checks for float formats in the texstore memcpy path
E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
2011-04-25 13:45:05 +02:00
Marek Olšák
628544421d mesa: implement generate-mipmap fallback for RGB10_A2
I hit this when testing RV350, which lacks RGB10_A2 render target
support. It had been missed when implementing the format and probably
unused by anything else too.

Not applicable to 7.10.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-25 13:45:05 +02:00
Vinson Lee
077b1a6144 r600g: Remove r600_helper.c from SConscript.
This is a follow-up to commit d737857ed2.
2011-04-24 23:58:39 -07:00
Marek Olšák
774c165d76 docs: update GL3 status 2011-04-25 01:54:12 +02:00
Marek Olšák
71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák
512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Marek Olšák
def6a91a62 r600g: trivially implement LATC/3DC
Passes fbo-generatemipmap-formats.
2011-04-25 01:20:40 +02:00
Dave Airlie
d737857ed2 r600g: drop r600_helper.c no point in it
move the one function into state common

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 09:06:14 +10:00
Dave Airlie
de48199693 r600g: enable EXT_draw_buffers2
Doesn't cause any piglit regression and passes the fbo-draw-buffers-blend
test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 06:55:09 +10:00
Dave Airlie
863eecd0d8 st/mesa: fix regression since a22aba4eae
"st/mesa: check image size before copy_image_data_to_texture()" caused
a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Level 0 for NPOT textures will not match minified values, so don't do this
check for level 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 05:59:47 +10:00
Dave Airlie
0a9cec3475 r600g: fix glean clipflat test.
the provoking vertex doesn't apply to quad/strip/polygon.

This fixes clipFlat on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 20:35:06 +10:00
Marek Olšák
0b3122cfcb r300g: reorder caps 2011-04-24 12:00:00 +02:00
Marek Olšák
0c71da18ee r300g: fix exposing caps on r300-r400
Broken with 72239d16cd.
2011-04-24 12:00:00 +02:00
Bryan Cain
f18a086326 glsl: Fix typos in comments. 2011-04-23 21:33:47 -07:00
Dave Airlie
6372660d12 r600g: fix glsl-fs-abs-neg
the hw does neg after abs, so don't neg the source in the ABS instruction case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 11:04:46 +10:00
Dave Airlie
77dc4c154c r600g: fix bank swizzle calcs for scalar only operations.
In the initial code if we had nothing in the vector slots r would
never get reset to 0, so we'd fail to compile shaders, after the previous
commit this would happen for the LIT tests. When I fixed that we did a lot
of unnecessary loops through all the vector states when we had no vector
slots filled. So this patch optimises thing for the scalar only state.

This fixes the 3 LIT piglit tests on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:33:19 +10:00
Dave Airlie
22d5a71e4d r600g: PV/PS have cycle restrictions in scalar operations
In the R600 ISA document:
Section 4.7.5 Cycle restrictions for the ALU.trans states that
PV/PS have cycle restrictions wrt constants.

This is part of a fix for the LIT tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:30:08 +10:00
Eric Anholt
e4da46e007 mesa: Add some comments about FRAG_RESULT_COLOR vs FRAG_RESULT_DATAn.
This came from reading what swrast does, and 965 now behaves the same
and gallium appears to as well.
2011-04-23 13:21:58 -07:00
Eric Anholt
d7f4c4e1b1 mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.
Fixes a bug in Trine where fragment.color would write
FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write
this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just
the first target).

Fixes piglit ATI_draw_buffers/arbfp-no-index.
2011-04-23 13:21:57 -07:00
Eric Anholt
79bde19ef9 i965: Don't double-emit fragment.color writes for MRT with ARB_fp. 2011-04-23 13:21:57 -07:00
Eric Anholt
bad8da8b00 i965: Fill in the remaining fields of gen5+ sampler default color.
Still doesn't fix texwrap.
2011-04-23 13:21:57 -07:00
Eric Anholt
e1e6545c88 i965: Fix batch decode for the gen5+ sampler default color. 2011-04-23 13:21:57 -07:00
Eric Anholt
1f32c665c8 intel: Add support for ARB_sampler_objects.
This extension support consists of replacing
"gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->".
One instance of referencing the texture's base sampler remains in the
initial miptree allocation, where I'm not sure we have a clear
association with any texture unit.

Tested with piglit ARB_sampler_objects/sampler-objects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
1df72402d9 i965: Add support for NV_conditional_render.
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
332822bd3d swrast: Disable glAccum drawing during conditional rendering. 2011-04-23 13:21:56 -07:00
Eric Anholt
fb60040b69 meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that
conditional rendering applies to, which doesn't include these.

Fixes NV_conditional_render/generatemipmap on swrast.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
4093fdce6d i965: Add support for ARB_texture_compression_rgtc.
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
7d1a2056a8 mesa: Don't assert on the compressed convertformat for GenerateMipmaps.
This assertion doesn't make any sense to me -- the convertFormat is
already something valid (tested above), and the BaseFormat dictated by
convertFormat doesn't matter to the function about to be called (it's
the datatype/comps that were pulled out of convertFormat).

Fixes assertion failure in
GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats

(still has a rendering failure in NPOT like S3TC does).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
bc880b8d40 mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.
We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
José Fonseca
da49de811d mesa/gdi: Address compiler warnings.
In particular the function prototypes.
2011-04-23 20:25:11 +01:00
José Fonseca
5bd545f5aa mesa/gdi: Remove InitCritSections.cpp.
We are now able to declare global critical sections through other
mechanisms so this is useless code.
2011-04-23 18:44:19 +01:00
José Fonseca
336487450e Drop fx windows driver.
Irrelevant now that glide driver was removed.
2011-04-23 18:32:56 +01:00
Jakob Bornecrantz
fed8a07ddb glu: Fix linux build 2011-04-23 17:01:19 +02:00
Jakob Bornecrantz
97efac09b2 glu: Clone the enviroment 2011-04-23 16:58:48 +02:00
José Fonseca
c2c44f2641 docs: Remove MSVS project files.
They were totally broken for several releases.

scons now builds everything the project files built and more, and can be
kept up-to-date with little effort.
2011-04-23 13:18:45 +01:00
José Fonseca
d34ddad9a5 scons: Build glu. 2011-04-23 13:16:03 +01:00
José Fonseca
15eaf8297e scons: Build classic mesa gdi driver.
Build as

  scons platform=windows mesagdi
2011-04-23 12:41:28 +01:00
José Fonseca
4c92f3fa6e osmesa: Fix Mingw build.
Build as

  scons platform=windows osmesa
2011-04-23 12:23:42 +01:00
José Fonseca
8e8a56eaa0 scons: Build osmesa.
Just type

  scons osmesa
2011-04-23 12:22:59 +01:00
José Fonseca
c89cca648d mapi/glapi: Avoid warnings about visibility being unsupported on MinGW. 2011-04-23 12:14:39 +01:00
José Fonseca
abda64efce mesa/vf: Remove.
Unused.  Probably replaced by translate module.
2011-04-23 11:49:41 +01:00
José Fonseca
de29ee0e6d graw: Replace dead symlinks to delete python statetracker shaders with their contents. 2011-04-23 11:07:27 +01:00
Brian Paul
931432fea6 draw: fix point/line/tri flushing bug in vbuf code
Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-04-22 13:39:50 -06:00
Marek Olšák
72239d16cd r300g: do not advertise color_buffer_float on r300 and r400
It seems they can't do unclamped vertex colors. Tested on RV350.
2011-04-22 20:25:24 +02:00
Marek Olšák
9d07ff63fc r300/compiler: fix up error message 2011-04-22 20:25:24 +02:00
Benjamin Franzke
01b036adea egl/wayland: Follow buffer.attach removal 2011-04-22 12:21:46 -04:00
Benjamin Franzke
b1a9172277 egl/wayland: Update to buffer.damage addition 2011-04-22 12:21:37 -04:00
Marek Olšák
5b2ff543ab configure.ac: fix up the help text for --enable-gallium-r300 2011-04-22 16:56:31 +02:00
Marek Olšák
673cec467a r300g: disallow A16F,L16F,LA16F,I16F texture formats on DRM<2.8.0 2011-04-22 16:19:41 +02:00
Benjamin Franzke
400a99a679 st/egl: Update to wayland protocol,egl changes 2011-04-22 08:56:36 -04:00
Benjamin Franzke
f09c66b3cc egl_dri2: Create wl_buffers for pixmap surfaces
Needed since wayland-egl doesnt do this anymore.
2011-04-22 08:56:33 -04:00
Benjamin Franzke
1617b268ef egl/wayland: Add new version parameter for post_drm 2011-04-22 08:56:30 -04:00
Benjamin Franzke
2225397d1c egl/wayland: Fix prefixes for interface names 2011-04-22 08:56:27 -04:00
Marek Olšák
1faf079a69 swrast: fix readpix clamping
Broken with e5c6a92a12. (ARB_color_buffer_float)

Clamping should occur if type != float, otherwise the MSBs of the resulting
pixels are killed off. For example, reading back LUMINANCE = R+G+B can be
greater than 0xff, but the result is naturally masked by 0xff
for UNSIGNED_BYTE, leading to bogus results.

The following bug report seems to want clamping to occur if type == half_float
too. Not sure what's correct.

Bug: [bisected pineview] oglc case pxconv-read failed
https://bugs.freedesktop.org/show_bug.cgi?id=35852

Tested by: Fang Xun <xunx.fang@intel.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-22 06:35:36 +02:00
Kristian Høgsberg
7142a67473 WL_bind_wayland_display: clarify that context must be NULL 2011-04-21 23:47:59 -04:00
Ian Romanick
d439491a77 i915: Gut all remaining bits of hardware fog
None of this ever gets used.  Fog is always calculated by a fragment
program.  Even though the fixed-function fog unit is never used, state
updates are still sent to the hardware.  Removing those spurious state
updates can't hurt performance.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:41 -07:00
Ian Romanick
499f7c0114 i915: i915_context::vertex_fog is always I915_FOG_NONE, so kill it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:38 -07:00
Ian Romanick
c41cb17037 i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function.
Because of this, there's no reason to handle cases where there is no
fragment program for fog.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:35 -07:00
Ian Romanick
8fc5ed18bc i915: Delete disabled try_pixel_fog paths
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:32 -07:00
Ian Romanick
4d203a01e2 mesa: Kill gl_fragment_program::FogOption with fire
All drivers expect this to always be GL_NONE.  Don't let there be any
opportunity for a bad value to leak out and infect some unsuspecting
driver.  If any driver for hardware that had fixed-function
per-fragment fog (i915 and perhaps some r300-ish) was ever going to
add support, it would have done it by now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:29 -07:00
Ian Romanick
df7555e763 i915: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:26 -07:00
Ian Romanick
8780c38983 i965: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:24 -07:00
Ian Romanick
f0188d4b08 mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:21 -07:00
Ian Romanick
3aa21f93dc mesa: Fix bugs in ff fragment shader fog handling
This patch fixes two bugs related to fog in the fixed-function
fragment shader generation code.

Fog was only lowered to instructions if MRTs were used.  The fragment
shader assembler always lowers "fog option" code to instructions, and
many drivers (e.g., r300) expect this.

When fog lowering did happen, it was after the instruction count was
checked against implementation limits.  Since fog lowering may add up
to 5 instructions, a program that was below the limits before lowering
may exceed the limits after lowering.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:18 -07:00
Brian Paul
a22aba4eae st/mesa: check image size before copy_image_data_to_texture()
We should only copy images into the dest texture if the size is correct.
This fixes a failed assertion when finalizing a texture with mis-defined
mipmap levels such as:
level 0: 32x32
level 1: 8x8

Also, fix incorrect mipmap level used in assertion at the top of
copy_image_data_to_texture().

NOTE: This is a candidate for the 7.10 branch.
2011-04-21 13:02:02 -06:00
Marek Olšák
4ad63659c0 galahad,util: warn on resource target mismatch in copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
f9dafcb8f2 st/mesa: implement CopyBufferSubData using resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
883d8a0b44 gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4 util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Kenneth Graunke
08ba9778db glsl/ast_to_hir: Only use the local 'type' variable as a temporary.
Lots of code (deleted by this patch) tried to make type == result->type,
but not all cases did.  Don't pretend; just use result->type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 16:46:17 -07:00
Kenneth Graunke
dfaaf7c5e8 i965: Remove dead vertex buffer structs.
We do this OUT_BATCH-style in brw_draw_upload.c.
2011-04-20 16:43:52 -07:00
Kristian Høgsberg
c0f8c9911c wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display 2011-04-20 17:47:20 -04:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
2ea0aa4cd9 docs: Mention that GLSL 1.30 is started.
Things definitely remaining todo: switch statements, clip distances.
On 965, we also need real integers in the VS, and implementations of
some things like isinf/isnan.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
6e13cbcb74 docs: Update for Intel ARB_texture_float and ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
d22e2ebe35 intel: Add support for ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
99fa449bb9 meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().
Tested with piglit arb_color_buffer_float-clear.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b249197259 meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.
Tested with piglit arb_color_buffer_float-drawpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
87478cd6e3 intel: Add support for ARB_texture_float.
For 1 and 2-channel formats the hardware only supports rendering to R
and RG.  To do I and L render targets we just call them R and
everything works out.  For A, we would need to rewrite the CC to do
the alpha channel's blending on color instead, and send the fragment
alpha down the red channel.  For LA, there doesn't seem to be any
hope, because we can't do independent color/alpha blending while
treating the LA surface as RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
0bbbeba2db intel: Add support for blit copies of >32bpp formats.
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
f7c26109c2 mesa: Add ChooseTexFormat fallbacks for floating point textures.
This covers X_FLOAT16 -> X_FLOAT32, and X -> RGBA_FLOAT32.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
a45b757f78 swrast: Add LUMINANCE, INTENSITY, LUMINANCE_ALPHA to span asserts.
Fixes ARB_texture_float/fbo-alphatest-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Alex Deucher
abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund
6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Brian Paul
8b7f760f83 translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths.  This is temporary until we have the
correct per-array max_index information.
2011-04-19 16:13:47 -06:00
Alex Deucher
08d1c91e6c r600g: add evergreen+ big endian support
Based on Cédric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:35:19 -04:00
Cédric Cano
843dfe3206 r600g: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:02:14 -04:00
Alex Deucher
b545b2987a r600c: add evergreen big endian support
Based on Cedric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Cédric Cano
3c3a259603 r600c: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Brian Paul
7a6061d7a6 Makefile: add missing Scons files 2011-04-19 09:07:44 -06:00
Thierry Vignaud
494b333b03 Makefile: add missing .cpp, .ll, .yy files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-19 08:34:06 -06:00
Dave Airlie
66866d642f r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 20:44:13 +10:00
Marek Olšák
5722286be2 configure.ac: rename --enable-gallium-radeon to --enable-gallium-r300
Also fix up the help string for both r300 and r600.
2011-04-19 12:28:51 +02:00
Marek Olšák
ab13ebf7c1 r200: enable some extensions
Such as:
- GL_ARB_half_float_pixel
- GL_ARB_vertex_array_object
- GL_APPLE_vertex_array_object
- GL_EXT_gpu_program_parameters
2011-04-19 12:23:41 +02:00
Dave Airlie
c98fa6be4b r600g: fix warnings with piglit texture-rg test.
Fill in the swaps for the formats to fix warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 18:45:58 +10:00
Dave Airlie
723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Tom Stellard
ffc1d166d2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060
2011-04-18 21:27:03 -07:00
Bryan Cain
f41e1db327 glsl: fix conversions from uint to bool and from float/bool to uint
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-18 17:09:47 -07:00
Dave Airlie
f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen
02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie
c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Ian Romanick
edf2e4f79d glsl: 80-column wrapping and whitespace fixes 2011-04-18 17:06:08 -07:00
Kenneth Graunke
ff5dd55e26 i965: Convert 3DPRIMITIVE command from struct-style to OUT_BATCH style.
Most of the newer portions of the code use OUT_BATCH style.  I prefer
this style because it offers a clear distinction between a) hardware
messages/structures with a mandatory format, and b) data structures for
our own internal use that we can format however we want.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Kenneth Graunke
42a8057000 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Ian Romanick
3d5cfcfed1 glsl: Emit a warning when the left-hand operand of a comma has no effect
The expression

    x = y, 5, 3;

will generate

    0:7(9): warning: left-hand operand of comma expression has no effect

The warning is only emitted for the left-hand operands, becuase the
right-most operand is the result of the expression.  This could be
used in an assignment, etc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-18 14:43:48 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Brian Paul
9418d05914 mesa: fix wrong parameter type in set_sampler_max_lod() 2011-04-18 12:43:42 -06:00
Brian Paul
1249e54f8b nvfx: comment-out unused var 2011-04-18 12:34:29 -06:00
Eric Anholt
dad95c112f intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
bc57df0356 Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
73f0700481 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
2b624634dd swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
348ea34d03 mesa: Repack single-byte fields in gl_renderbuffer.
Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
641dd899bd swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Marek Olšák
699ecec58c r300g: remove non-existing include path from SConscript 2011-04-18 03:07:46 +02:00
Marek Olšák
d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Thierry Vignaud
f79717d27a Fix mesa tarball creation again
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-18 01:26:47 +02:00
Marek Olšák
fc8e30edbc r600g: disable ARB_draw_instanced
The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.
2011-04-18 00:44:17 +02:00
Marek Olšák
3f32efa2b8 r300g: disable ARB_draw_instanced on SWTCL chipsets.
This fixes Unigine Heaven.
2011-04-18 00:44:17 +02:00
Eric Anholt
4673f9433f i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.
2011-04-17 10:26:09 -07:00
Eric Anholt
59c6b775a6 i965/fs: Add gen6 register spilling support.
Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.
2011-04-17 10:26:09 -07:00
Eric Anholt
14eedf3028 mesa: Fix _mesa_unpack_dudv_span_byte assertion.
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-17 10:26:09 -07:00
Carl Worth
9dacbe2226 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-17 01:02:24 -07:00
Dave Airlie
93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie
70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Marcin Slusarz
b5dfc38eea gallium: include u_format.h for util_format_is_supported
Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...
2011-04-17 01:15:52 +02:00
Christoph Bumiller
25a7f66214 nvc0: work around what looks like a code prefetch bug
Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.
2011-04-17 00:17:14 +02:00
Christoph Bumiller
f4ad25fefb nv50,nvc0: add new texture and render target formats 2011-04-17 00:17:14 +02:00
Christoph Bumiller
b4c7cd3fd6 nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries 2011-04-17 00:17:14 +02:00
Christoph Bumiller
a582b859f7 nvc0: fix viewport rectangle calculation 2011-04-17 00:17:14 +02:00
Tom Stellard
97535699ee prog_optimize: Add simplify CMP optimization pass
This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.
2011-04-16 13:55:55 -07:00
Tom Stellard
257cc48de2 prog_optimize: get_src_arg_mask() respect writemask for more opcodes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-16 13:55:54 -07:00
Tom Stellard
0fa81d6d05 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-16 13:55:54 -07:00
Carl-Philip Haensch
d5a5893adc mesa: provide more info for glCompressedTexImage() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-16 08:13:47 -06:00
Brian Paul
af0e2ef8cc mesa: move error check code in compressedteximage()
This was mistakenly inside the #if FEATURE_ES block.
2011-04-16 08:05:14 -06:00
José Fonseca
77db34b50d docs: Reapply some of Marek's typo fixes.
There were some typos too.
2011-04-16 11:15:29 +01:00
José Fonseca
bb78f6ad78 gallium/docs: Improve min_index/max_index description. 2011-04-16 10:18:20 +01:00
José Fonseca
4ee40c37a0 docs: Undo Marek typo fixes to original text.
Not really typos.
2011-04-16 09:41:00 +01:00
Brian Paul
41b38bd21c translate: s/varient/variant/ 2011-04-15 10:16:53 -06:00
Brian Paul
0630593c5f vbo: init prim[] array with memset()
This fixes a Coverity warning about uninitialized data.
2011-04-15 08:33:20 -06:00
Brian Paul
1b800c10e4 vega: move ureg_destroy(ureg) after last use of ureg var 2011-04-15 08:33:20 -06:00
Brian Paul
2c57caa893 st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
2011-04-15 08:33:20 -06:00
Pierre-Eric Pelloux-Prayer
6e9c7c4c11 st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-15 08:30:10 -06:00
Marek Olšák
d2afae33f8 Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
This reverts commit cd2857fae1.

It breaks Unigine Heaven.
2011-04-15 05:08:00 +02:00
Marek Olšák
9305922563 docs: update relnotes-7.11
I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.
2011-04-15 05:08:00 +02:00
Marek Olšák
397e478683 docs: update GL3 status 2011-04-15 05:08:00 +02:00
Marek Olšák
75fa5c99a8 gallium: add and use generic function for querying patented format support (v2)
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Marek Olšák
848f7d368d configure.ac: add an enable switch for float textures (v2)
So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.
2011-04-15 05:08:00 +02:00
Marek Olšák
2d12dbb28d docs: add patents.txt
Thanks to José Fonseca for writing this.
2011-04-15 05:08:00 +02:00
Marek Olšák
faba01d171 r300g: enable A/L/LA/I float render targets 2011-04-15 05:08:00 +02:00
Marek Olšák
8e28d842d1 st/mesa: convert Mesa float formats to Gallium
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0 gallium: add A/L/LA/I floating point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Marek Olšák
0ecbb0ab74 mesa: add R/RG floating-point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
19648fcf01 mesa: fix L16F and L32F format properties 2011-04-15 05:08:00 +02:00
Carl Worth
3d78f83cde Add expected file for 095-recursive-define test case.
It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.
2011-04-14 16:20:49 -07:00
Carl Worth
02d293c08e glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
2011-04-14 15:35:41 -07:00
Carl Worth
0b80f2d4c9 glcpp: Add --valgrind option to the glcpp-test utility
The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.
2011-04-14 14:55:52 -07:00
Carl Worth
6affa4806a Add an expected file for 084-unbalanced-parentheses
The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.
2011-04-14 14:43:11 -07:00
Carl Worth
d3c6ed382d Add an expected file for 094-divide-by-zero-short-circuit
The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
2011-04-14 14:42:52 -07:00
Carl Worth
ea3b2560b1 Add an expected file for 093-divide-by-zero
This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.
2011-04-14 14:29:34 -07:00
José Fonseca
6881cfc7f7 mesa/st: Avoid spurious transfers when creating fbo textures without image data.
We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-14 19:51:45 +01:00
pepp
78e90bf247 st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-14 07:55:02 -06:00
Eric Anholt
a9a02c8a39 mesa: Expose ATI_draw_buffers.
This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:32 -07:00
Eric Anholt
fb6e39737a mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:01 -07:00
Eric Anholt
28cec9e832 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:05:44 -07:00
Eric Anholt
4847f802c2 i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:53 -07:00
Eric Anholt
811c147220 i965/fs: Constant-fold immediates in src0 of CMP instructions.
This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:46 -07:00
Eric Anholt
756c262756 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:43 -07:00
Eric Anholt
175829f1a8 glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
9e04b190b5 glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
7ec0c97896 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:25 -07:00
Eric Anholt
01822706ec glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:02 -07:00
1056 changed files with 82388 additions and 99936 deletions

View File

@@ -183,7 +183,7 @@ ultrix-gcc:
# Rules for making release tarballs # Rules for making release tarballs
VERSION=7.11-devel VERSION=7.11.2
DIRECTORY = Mesa-$(VERSION) DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION) LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION) GLUT_NAME = MesaGLUT-$(VERSION)
@@ -200,6 +200,9 @@ MAIN_FILES = \
$(DIRECTORY)/configure.ac \ $(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \ $(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \ $(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \ $(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \ $(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \ $(DIRECTORY)/bin/extract_git_sha1 \
@@ -227,30 +230,37 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/vms_x_fix.h \ $(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \ $(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \ $(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \ $(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \ $(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \ $(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \ $(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \ $(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \ $(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \ $(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \ $(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \ $(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \ $(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \ $(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \ $(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \ $(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \ $(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \ $(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \ $(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \ $(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \ $(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \ $(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \ $(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \ $(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \ $(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/Makefile \
$(DIRECTORY)/src/mesa/program/descrip.mms \ $(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \ $(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \ $(DIRECTORY)/src/mesa/swrast/descrip.mms \
@@ -309,7 +319,10 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \ $(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \ $(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \ $(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \ $(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \ $(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in $(DIRECTORY)/src/mapi/vgapi/vg.pc.in
@@ -322,9 +335,22 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \ $(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \ $(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \ $(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \ $(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def $(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \ GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \ $(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \ $(DIRECTORY)/src/gallium/Makefile \
@@ -346,14 +372,17 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \ $(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py $(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \ DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \ $(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \ $(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \ $(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \ $(DIRECTORY)/src/glx/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \ $(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \ $(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \ $(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \ $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
@@ -361,6 +390,7 @@ DRI_FILES = \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \ $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \ $(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/SConscript \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \ SGI_GLU_FILES = \
@@ -390,14 +420,13 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \ $(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \ $(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \ $(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \ $(DIRECTORY)/src/glw/glw.pc.in
$(DIRECTORY)/src/glw/depend
GLUT_FILES = \ GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \ $(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \ $(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \ $(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \ $(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/glut.pc.in \ $(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \ $(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \ $(DIRECTORY)/src/glut/glx/*.[ch] \
@@ -405,19 +434,13 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/beos/*.cpp \ $(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile $(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \ LIB_FILES = \
$(MAIN_FILES) \ $(MAIN_FILES) \
$(MAPI_FILES) \ $(MAPI_FILES) \
$(ES_FILES) \ $(ES_FILES) \
$(EGL_FILES) \ $(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \ $(GALLIUM_FILES) \
$(DRI_FILES) \ $(DRI_FILES) \
$(SGI_GLU_FILES) \ $(SGI_GLU_FILES) \
@@ -428,7 +451,7 @@ parsers: configure
-@touch $(TOP)/configs/current -@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release: # Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \ ARCHIVES = $(LIB_NAME).tar.gz \
@@ -448,27 +471,21 @@ AUTOCONF = autoconf
AC_FLAGS = AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4 aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS) $(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4 configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS) $(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config: parsers rm_config: parsers
rm -f configs/current rm -f configs/current
rm -f configs/autoconf rm -f configs/autoconf
$(LIB_NAME).tar: rm_config $(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES) cd .. ; tar --dereference -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar $(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(GLUT_NAME).tar: rm_depend $(GLUT_NAME).tar:
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES) cd .. ; tar --dereference -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar $(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
@@ -499,4 +516,4 @@ md5: $(ARCHIVES)
@-md5sum $(GLUT_NAME).tar.bz2 @-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip @-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5 .PHONY: tarballs rm_config md5

View File

@@ -40,6 +40,8 @@ env = Environment(
ENV = os.environ, ENV = os.environ,
) )
opts.Save('config.py', env)
# Backwards compatability with old target configuration variable # Backwards compatability with old target configuration variable
try: try:
targets = ARGUMENTS['targets'] targets = ARGUMENTS['targets']
@@ -80,44 +82,6 @@ env.Append(CPPPATH = [
if env['msvc']: if env['msvc']:
env.Append(CPPPATH = ['#include/c99']) env.Append(CPPPATH = ['#include/c99'])
# Embedded
if env['platform'] == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# Posix
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if env['gcc']:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if env['platform'] == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# for debugging # for debugging
#print env.Dump() #print env.Dump()
@@ -130,7 +94,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
# #
# Create host environent # Create host environent
if env['crosscompile'] and env['platform'] != 'embedded': if env['crosscompile'] and not env['embedded']:
host_env = Environment( host_env = Environment(
options = opts, options = opts,
# no tool used # no tool used
@@ -179,3 +143,18 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
) )
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = default_ans.keys()
aliases.sort()
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)

View File

@@ -1,10 +1,20 @@
#!/bin/sh #!/bin/sh
touch src/mesa/main/git_sha1.h if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert # Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in # it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string. # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\ git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h > src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi fi

View File

@@ -767,9 +767,8 @@ case $ARCH in
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}" OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}" LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
# examine first object to determine ABI # examine first object to determine ABI
set ${OBJECTS} set ${OBJECTS}
@@ -782,9 +781,6 @@ case $ARCH in
OPTS=${ALTOPTS} OPTS=${ALTOPTS}
fi fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
# determine linker # determine linker
if [ $CPLUSPLUS = 1 ] ; then if [ $CPLUSPLUS = 1 ] ; then
LINK="g++" LINK="g++"
@@ -796,8 +792,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME} ln -s ${LIBNAME} ${LINKNAME}
ln -s ${LIBNAME} ${LINKNAME2} FINAL_LIBS="${LIBNAME} ${LINKNAME}"
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
fi fi
;; ;;

View File

@@ -79,14 +79,17 @@ def AddOptions(opts):
from SCons.Options.EnumOption import EnumOption from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug', opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release'))) allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes')) opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform, opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8'))) allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain) opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no')) opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes')) opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no')) opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) opts.Add(BoolOption('quiet', 'DEPRECATED: quiet command lines', 'yes'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -26,6 +26,8 @@ LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@ EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@ RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@ RADEON_LDFLAGS = @RADEON_LDFLAGS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@ INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@ INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@ X11_LIBS = @X11_LIBS@
@@ -58,6 +60,10 @@ INSTALL = @INSTALL@
PYTHON2 = @PYTHON2@ PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name) # Library names (base name)
GL_LIB = GL GL_LIB = GL
GLU_LIB = GLU GLU_LIB = GLU
@@ -69,6 +75,7 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG VG_LIB = OpenVG
GLAPI_LIB = glapi GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names) # Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@ GL_LIB_NAME = @GL_LIB_NAME@
@@ -82,6 +89,7 @@ GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@ VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@ GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@ WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks # Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@ GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -95,6 +103,7 @@ GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@ VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@ GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@ WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build # Directories to build
LIB_DIR = @LIB_DIR@ LIB_DIR = @LIB_DIR@
@@ -102,6 +111,7 @@ SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@ GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@ DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@ EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@ GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@ GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@ GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -141,7 +151,8 @@ GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@ VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@ GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@ WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies # DRI dependencies
MESA_MODULES = @MESA_MODULES@ MESA_MODULES = @MESA_MODULES@
@@ -200,6 +211,9 @@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@ WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@ WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@ WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@ XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@ XCB_DRI2_LIBS = @XCB_DRI2_LIBS@

View File

@@ -25,27 +25,29 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
ARCH_FLAGS += $(RC_CFLAGS) ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \ CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \ CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names) # Library names (actual file names)
GL_LIB_NAME = libGL.dylib GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = libGLU.dylib GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = libglut.dylib GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = libGLw.dylib GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = libOSMesa.dylib OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks # globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = libGLU.*dylib GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = libglut.*dylib GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = libGLw.*dylib GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
@@ -57,3 +59,5 @@ GLU_DIRS = sgi
DRIVER_DIRS = osmesa DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri #DRIVER_DIRS = dri
DRI_DIRS = swrast DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -38,6 +38,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend MKDEP = makedepend
MKDEP_OPTIONS = -fdepend MKDEP_OPTIONS = -fdepend
MAKE = make MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else # Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -61,7 +63,7 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG VG_LIB = OpenVG
GLAPI_LIB = glapi GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names) # Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so GL_LIB_NAME = lib$(GL_LIB).so
@@ -75,6 +77,7 @@ GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks # globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)* GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -88,6 +91,7 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)* VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)* GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)* WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS) DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS) DRI_CXXFLAGS = $(CXXFLAGS)
@@ -111,6 +115,9 @@ DRIVER_DIRS = x11 osmesa
# EGL drivers to build # EGL drivers to build
EGL_DRIVERS_DIRS = glx EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and # Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -138,6 +145,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles # Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm APP_LIB_DEPS = -lm
@@ -157,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory # EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker) # Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -189,3 +200,6 @@ VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV = WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV = WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS = WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =

View File

@@ -63,11 +63,16 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS = GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel` INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = `pkg-config --cflags libdrm_intel` INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
RADEON_LIBS = `pkg-config --libs libdrm_radeon` NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon` NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -17,10 +17,15 @@ AC_INIT([Mesa],[mesa_version],
AC_CONFIG_AUX_DIR([bin]) AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST AC_CANONICAL_HOST
dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
USER_CFLAGS="$CFLAGS"
USER_CXXFLAGS="$CXXFLAGS"
dnl Versions for external dependencies dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24 LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.24 LIBDRM_RADEON_REQUIRED=2.4.24
LIBDRM_INTEL_REQUIRED=2.4.24 LIBDRM_INTEL_REQUIRED=2.4.24
LIBDRM_NOUVEAU_REQUIRED=0.6
DRI2PROTO_REQUIRED=2.1 DRI2PROTO_REQUIRED=2.1
GLPROTO_REQUIRED=1.4.11 GLPROTO_REQUIRED=1.4.11
LIBDRM_XORG_REQUIRED=2.4.24 LIBDRM_XORG_REQUIRED=2.4.24
@@ -39,6 +44,12 @@ if test "x$MKDEP" = "x"; then
AC_MSG_ERROR([makedepend is required to build Mesa]) AC_MSG_ERROR([makedepend is required to build Mesa])
fi fi
AC_PATH_PROG([FLEX], [flex])
test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
AC_PATH_PROG([BISON], [bison])
test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
dnl Our fallback install-sh is a symlink to minstall. Use the existing dnl Our fallback install-sh is a symlink to minstall. Use the existing
dnl configuration in that case. dnl configuration in that case.
AC_PROG_INSTALL AC_PROG_INSTALL
@@ -64,13 +75,13 @@ AC_COMPILE_IFELSE(
not clang not clang
#endif #endif
]])], ]])],
[CLANG=yes], [CLANG=no]) [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
AC_MSG_RESULT([$CLANG]) AC_MSG_RESULT([$acv_mesa_CLANG])
dnl If we're using GCC, make sure that it is at least version 3.3.0. Older dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
dnl versions are explictly not supported. dnl versions are explictly not supported.
if test "x$GCC" = xyes -a "x$CLANG" = xno; then if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
AC_MSG_CHECKING([whether gcc version is sufficient]) AC_MSG_CHECKING([whether gcc version is sufficient])
major=0 major=0
minor=0 minor=0
@@ -78,7 +89,7 @@ if test "x$GCC" = xyes -a "x$CLANG" = xno; then
GCC_VERSION=`$CC -dumpversion` GCC_VERSION=`$CC -dumpversion`
if test $? -eq 0; then if test $? -eq 0; then
major=`echo $GCC_VERSION | cut -d. -f1` major=`echo $GCC_VERSION | cut -d. -f1`
minor=`echo $GCC_VERSION | cut -d. -f1` minor=`echo $GCC_VERSION | cut -d. -f2`
fi fi
if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
@@ -319,6 +330,21 @@ else
esac esac
fi fi
dnl
dnl potentially-infringing-but-nobody-knows-for-sure stuff
dnl
AC_ARG_ENABLE([texture-float],
[AS_HELP_STRING([--enable-texture-float],
[enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
[enable_texture_float="$enableval"],
[enable_texture_float=no]
)
if test "x$enable_texture_float" = xyes; then
AC_MSG_WARN([Floating-point textures enabled.])
AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
fi
GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION} GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION} GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION} GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
@@ -330,6 +356,7 @@ GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION} VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION} GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION} WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -343,6 +370,7 @@ GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LI
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME]) AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME]) AC_SUBST([GLU_LIB_NAME])
@@ -355,6 +383,7 @@ AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME]) AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME]) AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([WAYLAND_EGL_LIB_NAME]) AC_SUBST([WAYLAND_EGL_LIB_NAME])
AC_SUBST([GBM_LIB_NAME])
AC_SUBST([GL_LIB_GLOB]) AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB]) AC_SUBST([GLU_LIB_GLOB])
@@ -367,6 +396,7 @@ AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB]) AC_SUBST([VG_LIB_GLOB])
AC_SUBST([GLAPI_LIB_GLOB]) AC_SUBST([GLAPI_LIB_GLOB])
AC_SUBST([WAYLAND_EGL_LIB_GLOB]) AC_SUBST([WAYLAND_EGL_LIB_GLOB])
AC_SUBST([GBM_LIB_GLOB])
dnl dnl
dnl Arch/platform-specific settings dnl Arch/platform-specific settings
@@ -485,7 +515,7 @@ if test "x$enable_selinux" = "xyes"; then
DEFINES="$DEFINES -DMESA_SELINUX" DEFINES="$DEFINES -DMESA_SELINUX"
fi fi
dnl Determine which APIs to support dnl Options for APIs
AC_ARG_ENABLE([opengl], AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl], [AS_HELP_STRING([--disable-opengl],
[disable support for standard OpenGL API @<:@default=no@:>@])], [disable support for standard OpenGL API @<:@default=no@:>@])],
@@ -501,32 +531,70 @@ AC_ARG_ENABLE([gles2],
[enable support for OpenGL ES 2.x API @<:@default=no@:>@])], [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
[enable_gles2="$enableval"], [enable_gles2="$enableval"],
[enable_gles2=no]) [enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[DEPRECATED. Same as --enable-gles1 and --enable-gles2])],
[enable_gles1="$enableval"; enable_gles2="$enableval"],
[])
AC_ARG_ENABLE([openvg], AC_ARG_ENABLE([openvg],
[AS_HELP_STRING([--enable-openvg], [AS_HELP_STRING([--enable-openvg],
[enable support for OpenVG API @<:@default=no@:>@])], [enable support for OpenVG API @<:@default=no@:>@])],
[enable_openvg="$enableval"], [enable_openvg="$enableval"],
[enable_openvg=no]) [enable_openvg=no])
AC_ARG_ENABLE([xorg],
[AS_HELP_STRING([--enable-xorg],
[enable support for X.Org DDX API @<:@default=no@:>@])],
[enable_xorg="$enableval"],
[enable_xorg=no])
AC_ARG_ENABLE([d3d1x],
[AS_HELP_STRING([--enable-d3d1x],
[enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
[enable_d3d1x="$enableval"],
[enable_d3d1x=no])
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
AC_ARG_ENABLE([gbm],
[AS_HELP_STRING([--enable-gbm],
[enable gbm library @<:@default=auto@:>@])],
[enable_gbm="$enableval"],
[enable_gbm=auto])
AC_ARG_ENABLE([gallium_egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable optional EGL state tracker (not required
for EGL support in Gallium with OpenGL and OpenGL ES)
@<:@default=disable@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=no])
AC_ARG_ENABLE([gallium_gbm],
[AS_HELP_STRING([--enable-gallium-gbm],
[enable optional gbm state tracker (not required for
gbm support in Gallium)
@<:@default=auto@:>@])],
[enable_gallium_gbm="$enableval"],
[enable_gallium_gbm=auto])
dnl smooth the transition; should be removed eventually # Option for Gallium drivers
if test "x$enable_openvg" = xno; then GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
case "x$with_state_trackers" in
x*vega*) AC_ARG_WITH([gallium-drivers],
AC_MSG_WARN([vega state tracker is enabled without --enable-openvg]) [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
enable_openvg=yes [comma delimited Gallium drivers list, e.g.
;; "i915,i965,nouveau,r300,r600,svga,swrast"
esac @<:@default=r300,r600,swrast@:>@])],
fi [with_gallium_drivers="$withval"],
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
# here so that the script doesn't choke on an unknown driver name later.
case "$with_gallium_drivers" in
yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
no) with_gallium_drivers='' ;;
esac
if test "x$enable_opengl" = xno -a \ if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \ "x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \ "x$enable_gles2" = xno -a \
"x$enable_openvg" = xno; then "x$enable_openvg" = xno -a \
"x$enable_xorg" = xno -a \
"x$enable_d3d1x" = xno; then
AC_MSG_ERROR([at least one API should be enabled]) AC_MSG_ERROR([at least one API should be enabled])
fi fi
@@ -635,11 +703,6 @@ if test "x$enable_gles2" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es2api" CORE_DIRS="$CORE_DIRS mapi/es2api"
fi fi
# build vgapi if OpenVG is enabled
if test "x$enable_openvg" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/vgapi"
fi
# build glsl and mesa if OpenGL or OpenGL ES is enabled # build glsl and mesa if OpenGL or OpenGL ES is enabled
case "x$enable_opengl$enable_gles1$enable_gles2" in case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*) x*yes*)
@@ -652,11 +715,14 @@ xlib)
DRIVER_DIRS="x11" DRIVER_DIRS="x11"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
;; ;;
dri) dri)
SRC_DIRS="$SRC_DIRS glx" SRC_DIRS="$SRC_DIRS glx"
DRIVER_DIRS="dri" DRIVER_DIRS="dri"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri" GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_DRI="yes"
;; ;;
osmesa) osmesa)
DRIVER_DIRS="osmesa" DRIVER_DIRS="osmesa"
@@ -767,7 +833,7 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS" GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES" GL_PC_CFLAGS="$X11_INCLUDES"
fi fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs # if static, move the external libraries to the programs
@@ -893,11 +959,6 @@ AC_SUBST([MESA_MODULES])
AC_SUBST([HAVE_XF86VIDMODE]) AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
dnl dnl
dnl More X11 setup dnl More X11 setup
dnl dnl
@@ -983,8 +1044,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# the new interface. i810 are missing because there is no # the new interface. i810 are missing because there is no
# x86-64 system where they could *ever* be used. # x86-64 system where they could *ever* be used.
if test "x$DRI_DIRS" = "xyes"; then if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \ DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
savage tdfx unichrome swrast" radeon savage tdfx unichrome swrast"
fi fi
;; ;;
powerpc*) powerpc*)
@@ -1011,8 +1072,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
fi fi
if test "x$DRI_DIRS" = "xyes"; then if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
unichrome savage sis swrast" radeon tdfx unichrome savage sis swrast"
fi fi
;; ;;
gnu*) gnu*)
@@ -1040,7 +1101,7 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# default drivers # default drivers
if test "x$DRI_DIRS" = "xyes"; then if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast" savage sis tdfx unichrome swrast"
fi fi
@@ -1076,8 +1137,19 @@ case $DRI_DIRS in
;; ;;
esac esac
case $DRI_DIRS in
*nouveau*)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
;;
esac
case $DRI_DIRS in case $DRI_DIRS in
*radeon*|*r200*|*r300*|*r600*) *radeon*|*r200*|*r300*|*r600*)
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
if test "x$HAVE_LIBDRM_RADEON" = xyes; then if test "x$HAVE_LIBDRM_RADEON" = xyes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS" RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
@@ -1153,45 +1225,75 @@ AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ]) AC_SUBST([OSMESA_PC_REQ])
AC_SUBST([OSMESA_PC_LIB_PRIV]) AC_SUBST([OSMESA_PC_LIB_PRIV])
dnl
dnl gbm configuration
dnl
if test "x$enable_gbm" = xauto; then
case "$with_egl_platforms" in
*drm*)
enable_gbm=yes ;;
*)
enable_gbm=no ;;
esac
fi
if test "x$enable_gbm" = xyes; then
SRC_DIRS="$SRC_DIRS gbm"
GBM_BACKEND_DIRS=""
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
AC_MSG_ERROR([gbm needs udev]))
GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
if test "$mesa_driver" = dri; then
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
if test "$SHARED_GLAPI" -eq 0; then
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
fi
fi
fi
AC_SUBST([GBM_LIB_DEPS])
AC_SUBST([GBM_BACKEND_DIRS])
GBM_PC_REQ_PRIV="libudev"
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
GBM_PC_CFLAGS=
AC_SUBST([GBM_PC_REQ_PRIV])
AC_SUBST([GBM_PC_LIB_PRIV])
AC_SUBST([GBM_PC_CFLAGS])
dnl dnl
dnl EGL configuration dnl EGL configuration
dnl dnl
AC_ARG_ENABLE([egl], EGL_CLIENT_APIS=""
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
if test "x$enable_egl" = xno; then if test "x$enable_egl" = xno; then
if test "x$mesa_driver" = xno; then if test "x$mesa_driver" = xno; then
AC_MSG_ERROR([cannot disable EGL when there is no mesa driver]) AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
fi fi
if test "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
fi fi
if test "x$enable_egl" = xyes; then if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl" SRC_DIRS="$SRC_DIRS egl"
EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread" EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
EGL_DRIVERS_DIRS="" EGL_DRIVERS_DIRS=""
if test "$enable_static" != yes; then if test "$enable_static" != yes; then
# build egl_glx when libGL is built # build egl_glx when libGL is built
if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
EGL_DRIVERS_DIRS="glx" EGL_DRIVERS_DIRS="glx"
fi fi
PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
[have_libudev=yes],[have_libudev=no])
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
if test "$mesa_driver" = dri; then if test "$mesa_driver" = dri; then
# build egl_dri2 when xcb-dri2 is available # build egl_dri2 when xcb-dri2 is available
PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
[have_xcb_dri2=yes],[have_xcb_dri2=no]) [have_xcb_dri2=yes],[have_xcb_dri2=no])
PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
[have_libudev=yes],[have_libudev=no])
if test "$have_xcb_dri2" = yes; then if test "$have_xcb_dri2" = yes; then
EGL_DRIVER_DRI2=dri2 EGL_DRIVER_DRI2=dri2
DEFINES="$DEFINES -DHAVE_XCB_DRI2" DEFINES="$DEFINES -DHAVE_XCB_DRI2"
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
# workaround a bug in xcb-dri2 generated by xcb-proto 1.6 # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [], AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
[DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"]) [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
@@ -1204,6 +1306,96 @@ fi
AC_SUBST([EGL_LIB_DEPS]) AC_SUBST([EGL_LIB_DEPS])
AC_SUBST([EGL_DRIVERS_DIRS]) AC_SUBST([EGL_DRIVERS_DIRS])
dnl
dnl EGL Gallium configuration
dnl
if test "x$enable_gallium_egl" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
fi
if test "x$enable_egl" = xno; then
AC_MSG_ERROR([cannot enable egl_gallium without EGL])
fi
GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
HAVE_ST_EGL="yes"
fi
dnl
dnl gbm Gallium configuration
dnl
if test "x$enable_gallium_gbm" = xauto; then
case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
yesyes*drm*)
enable_gallium_gbm=yes ;;
*)
enable_gallium_gbm=no ;;
esac
fi
if test "x$enable_gallium_gbm" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
fi
if test "x$enable_gbm" = xno; then
AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
fi
GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
HAVE_ST_GBM="yes"
fi
dnl
dnl X.Org DDX configuration
dnl
if test "x$enable_xorg" = xyes; then
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_XORG=yes
fi
dnl
dnl OpenVG configuration
dnl
VG_LIB_DEPS=""
if test "x$enable_openvg" = xyes; then
if test "x$enable_egl" = xno; then
AC_MSG_ERROR([cannot enable OpenVG without EGL])
fi
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium_egl" = xno; then
AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
fi
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
CORE_DIRS="$CORE_DIRS mapi/vgapi"
GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_VEGA=yes
fi
dnl
dnl D3D1X configuration
dnl
if test "x$enable_d3d1x" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable D3D1X without Gallium])
fi
GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_D3D1X=yes
fi
dnl dnl
dnl GLU configuration dnl GLU configuration
dnl dnl
@@ -1420,17 +1612,8 @@ AC_SUBST([PROGRAM_DIRS])
dnl dnl
dnl Gallium configuration dnl Gallium configuration
dnl dnl
AC_ARG_ENABLE([gallium], if test "x$with_gallium_drivers" != x; then
[AS_HELP_STRING([--disable-gallium],
[build gallium @<:@default=enabled@:>@])],
[enable_gallium="$enableval"],
[enable_gallium=yes])
if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
fi
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets" SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
fi fi
AC_SUBST([LLVM_CFLAGS]) AC_SUBST([LLVM_CFLAGS])
@@ -1438,160 +1621,23 @@ AC_SUBST([LLVM_LIBS])
AC_SUBST([LLVM_LDFLAGS]) AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_VERSION]) AC_SUBST([LLVM_VERSION])
dnl
dnl Gallium state trackers configuration
dnl
AC_ARG_ENABLE([gallium-egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable gallium EGL state tracker @<:@default=auto@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=auto])
if test "x$enable_gallium_egl" = xauto; then
case "$mesa_driver" in
dri|no)
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=$enable_openvg
;;
esac
fi
case "x$enable_egl$enable_gallium_egl" in
xnoyes)
AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
esac
AC_ARG_WITH([state-trackers],
[AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
[comma delimited state_trackers list, e.g.
"egl,glx" @<:@default=auto@:>@])],
[with_state_trackers="$withval"],
[with_state_trackers=yes])
case "$with_state_trackers" in
no)
GALLIUM_STATE_TRACKERS_DIRS=""
;;
yes)
# look at what else is built
case "$mesa_driver" in
xlib)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
GALLIUM_STATE_TRACKERS_DIRS="dri"
HAVE_ST_DRI="yes"
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_ST_XORG="no")
;;
esac
if test "x$enable_egl" = xyes; then
if test "$enable_openvg" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
st_egl="yes"
fi
if test "$enable_gallium_egl" = yes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
HAVE_ST_EGL="yes"
fi
fi
;;
*)
# verify the requested state tracker exist
state_trackers=""
_state_trackers=`IFS=', '; echo $with_state_trackers`
for tracker in $_state_trackers; do
case "$tracker" in
dri)
if test "x$mesa_driver" != xdri; then
AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
fi
HAVE_ST_DRI="yes"
;;
egl)
if test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
HAVE_ST_EGL="yes"
;;
xorg)
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
HAVE_ST_XORG="yes"
;;
vega)
if test "x$enable_openvg" != xyes; then
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
fi
have_st_vega="yes"
;;
esac
if test -n "$tracker"; then
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
if test -n "$state_trackers"; then
state_trackers="$state_trackers $tracker"
else
state_trackers="$tracker"
fi
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
# append --enable-openvg/--enable-gallium-egl to --with-state-trackers
if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
fi
if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
fi
;;
esac
EGL_CLIENT_APIS=""
VG_LIB_DEPS=""
case "x$enable_opengl$enable_gles1$enable_gles2" in case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*) x*yes*)
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)' EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
;; ;;
esac esac
if test "x$enable_openvg" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
fi
AC_SUBST([VG_LIB_DEPS]) AC_SUBST([VG_LIB_DEPS])
AC_SUBST([EGL_CLIENT_APIS]) AC_SUBST([EGL_CLIENT_APIS])
if test "x$HAVE_ST_EGL" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
fi
if test "x$HAVE_ST_XORG" = xyes; then
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
fi
AC_ARG_WITH([egl-platforms], AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g. [comma delimited native platforms libEGL supports, e.g.
"x11,drm" @<:@default=auto@:>@])], "x11,drm" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"], [with_egl_platforms="$withval"],
[with_egl_platforms=yes]) [with_egl_platforms=yes])
AC_ARG_WITH([egl-displays],
[AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
[DEPRECATED. Use --with-egl-platforms instead])],
[with_egl_platforms="$withval"])
EGL_PLATFORMS="" EGL_PLATFORMS=""
WAYLAND_EGL_LIB_DEPS="" WAYLAND_EGL_LIB_DEPS=""
@@ -1600,9 +1646,6 @@ case "$with_egl_platforms" in
yes) yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
EGL_PLATFORMS="x11" EGL_PLATFORMS="x11"
if test "$mesa_driver" = dri; then
EGL_PLATFORMS="$EGL_PLATFORMS drm"
fi
fi fi
;; ;;
*) *)
@@ -1621,7 +1664,15 @@ yes)
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \ PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])]) [AC_MSG_ERROR([cannot find libwayland-client])])
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS" WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
fi fi
if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
AC_MSG_ERROR([EGL platform drm needs gbm])
fi
case "$plat$have_libudev" in
waylandno|drmno)
AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
esac
done done
EGL_PLATFORMS="$egl_platforms" EGL_PLATFORMS="$egl_platforms"
;; ;;
@@ -1672,10 +1723,20 @@ dnl Gallium LLVM
dnl dnl
AC_ARG_ENABLE([gallium-llvm], AC_ARG_ENABLE([gallium-llvm],
[AS_HELP_STRING([--enable-gallium-llvm], [AS_HELP_STRING([--enable-gallium-llvm],
[build gallium LLVM support @<:@default=disabled@:>@])], [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
[enable_gallium_llvm="$enableval"], [enable_gallium_llvm="$enableval"],
[enable_gallium_llvm=auto]) [enable_gallium_llvm=auto])
if test "x$with_gallium_drivers" = x; then
enable_gallium_llvm=no
fi
if test "x$enable_gallium_llvm" = xauto; then
case "$host_cpu" in
i*86|x86_64) enable_gallium_llvm=yes;;
esac
fi
if test "x$enable_gallium_llvm" = xyes; then if test "x$enable_gallium_llvm" = xyes; then
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
if test "x$LLVM_CONFIG" != xno; then if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version` LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags` LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
@@ -1707,109 +1768,62 @@ gallium_check_st() {
fi fi
} }
gallium_require_llvm() {
dnl if test "x$MESA_LLVM" = x0; then
dnl Gallium SVGA configuration case "$host_cpu" in
dnl i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
AC_ARG_ENABLE([gallium-svga], esac
[AS_HELP_STRING([--enable-gallium-svga],
[build gallium SVGA @<:@default=disabled@:>@])],
[enable_gallium_svga="$enableval"],
[enable_gallium_svga=auto])
if test "x$enable_gallium_svga" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
elif test "x$enable_gallium_svga" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
fi
dnl
dnl Gallium i915 configuration
dnl
AC_ARG_ENABLE([gallium-i915],
[AS_HELP_STRING([--enable-gallium-i915],
[build gallium i915 @<:@default=disabled@:>@])],
[enable_gallium_i915="$enableval"],
[enable_gallium_i915=auto])
if test "x$enable_gallium_i915" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
elif test "x$enable_gallium_i915" = xauto; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl
dnl Gallium i965 configuration
dnl
AC_ARG_ENABLE([gallium-i965],
[AS_HELP_STRING([--enable-gallium-i965],
[build gallium i965 @<:@default=disabled@:>@])],
[enable_gallium_i965="$enableval"],
[enable_gallium_i965=auto])
if test "x$enable_gallium_i965" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
elif test "x$enable_gallium_i965" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
fi
dnl
dnl Gallium Radeon r300g configuration
dnl
AC_ARG_ENABLE([gallium-radeon],
[AS_HELP_STRING([--enable-gallium-radeon],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
fi
if test "x$enable_gallium_radeon" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
fi
dnl
dnl Gallium Radeon r600g configuration
dnl
AC_ARG_ENABLE([gallium-r600],
[AS_HELP_STRING([--enable-gallium-r600],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
fi
dnl
dnl Gallium Nouveau configuration
dnl
AC_ARG_ENABLE([gallium-nouveau],
[AS_HELP_STRING([--enable-gallium-nouveau],
[build gallium nouveau @<:@default=disabled@:>@])],
[enable_gallium_nouveau="$enableval"],
[enable_gallium_nouveau=no])
if test "x$enable_gallium_nouveau" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
fi
dnl
dnl Gallium swrast configuration
dnl
AC_ARG_ENABLE([gallium-swrast],
[AS_HELP_STRING([--enable-gallium-swrast],
[build gallium swrast @<:@default=auto@:>@])],
[enable_gallium_swrast="$enableval"],
[enable_gallium_swrast=auto])
if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
fi fi
}
dnl Gallium drivers
if test "x$with_gallium_drivers" != x; then
# This is for compile-testing
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965 r300 svga"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
for driver in $gallium_drivers; do
case "x$driver" in
xsvga)
gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
;;
xi915)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
;;
xi965)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
;;
xr300)
gallium_require_llvm "Gallium R300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-r300"
;;
xr600)
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
;;
xnouveau)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
;;
xswrast)
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
if test "x$MESA_LLVM" = x1; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
fi
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
fi
;;
*)
AC_MSG_ERROR([Unknown Gallium driver: $driver])
;;
esac
done
fi fi
dnl prepend CORE_DIRS to SRC_DIRS dnl prepend CORE_DIRS to SRC_DIRS
@@ -1819,6 +1833,10 @@ dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS" LDFLAGS="$_SAVE_LDFLAGS"
CPPFLAGS="$_SAVE_CPPFLAGS" CPPFLAGS="$_SAVE_CPPFLAGS"
dnl Add user CFLAGS and CXXFLAGS
CFLAGS="$CFLAGS $USER_CFLAGS"
CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
dnl Substitute the config dnl Substitute the config
AC_CONFIG_FILES([configs/autoconf]) AC_CONFIG_FILES([configs/autoconf])
@@ -1884,7 +1902,7 @@ if test "$enable_egl" = yes; then
egl_drivers="$egl_drivers builtin:egl_$d" egl_drivers="$egl_drivers builtin:egl_$d"
done done
if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then if test "x$HAVE_ST_EGL" = xyes; then
echo " EGL drivers: ${egl_drivers} egl_gallium" echo " EGL drivers: ${egl_drivers} egl_gallium"
echo " EGL Gallium STs:$EGL_CLIENT_APIS" echo " EGL Gallium STs:$EGL_CLIENT_APIS"
else else

View File

@@ -12,13 +12,13 @@ Feature Status
GL 3.0: GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe) Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
Map buffer subranges (GL_ARB_map_buffer_range) DONE Map buffer subranges (GL_ARB_map_buffer_range) DONE
Clamping controls (GL_ARB_color_buffer_float) DONE Clamping controls (GL_ARB_color_buffer_float) DONE
Float textures, renderbuffers (GL_ARB_texture_float) BRANCH ~mareko/mesa floating2 Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
GL_EXT_packed_float not started GL_EXT_packed_float DONE (gallium r600)
GL_EXT_texture_shared_exponent not started GL_EXT_texture_shared_exponent DONE (gallium, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) not started Float depth buffers (GL_ARB_depth_buffer_float) not started
Framebuffer objects (GL_EXT_framebuffer_object) DONE Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float DONE Half-float DONE
@@ -45,7 +45,7 @@ Depth format cube textures 0% done
GL 3.1: GL 3.1:
GLSL 1.30 and 1.40 not started GLSL 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast) Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) DONE (gallium) Primitive restart (GL_NV_primitive_restart) DONE (gallium)
@@ -65,7 +65,7 @@ BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium) Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
Provoking vertex (GL_ARB_provoking_vertex) DONE Provoking vertex (GL_ARB_provoking_vertex) DONE
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly? Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
Multisample textures (GL_ARB_texture_multisample) not started Multisample textures (GL_ARB_texture_multisample) not started
Frag depth clamp (GL_ARB_depth_clamp) DONE Frag depth clamp (GL_ARB_depth_clamp) DONE
Fence objects (GL_ARB_sync) DONE Fence objects (GL_ARB_sync) DONE
@@ -80,7 +80,7 @@ GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects DONE (gallium) GL_ARB_sampler_objects DONE (gallium)
GL_ARB_texture_rgb10_a2ui not started GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version) GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query DONE (only Xlib sw driver) GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (gallium) GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_vertex_type_2_10_10_10_rev not started GL_ARB_vertex_type_2_10_10_10_rev not started
@@ -105,7 +105,7 @@ GL_ARB_transform_feedback3 not started
GL 4.1: GL 4.1:
GLSL 4.1 not started GLSL 4.1 not started
GL_ARB_ES2_compatibility not started GL_ARB_ES2_compatibility DONE (i965)
GL_ARB_get_program_binary not started GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started GL_ARB_shader_precision not started

View File

@@ -66,6 +66,7 @@ New Tokens
EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001 EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002 EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
Accepted in the <target> parameter of eglCreateImageKHR: Accepted in the <target> parameter of eglCreateImageKHR:
@@ -89,13 +90,16 @@ Additions to the EGL 1.4 Specification:
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits, is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
then red, then green, then blue. The bit values accepted by then red, then green, then blue. The bit values accepted by
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA and EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_DRM_BUFFER_USE_SHARE_MESA. EGL_DRM_BUFFER_USE_SCANOUT_MESA EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
requests that the created EGLImage should be usable as a scanout EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
buffer with the DRM kernel modesetting API. The should be usable as a scanout buffer with the DRM kernel
EGL_DRM_BUFFER_USE_SHARE_MESA bit requests that the EGLImage can modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
be shared with other processes by passing the underlying DRM EGLImage can be shared with other processes by passing the
buffer name. underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
requests that the image must be usable as a cursor with KMS. When
EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
be 64.
To create a process local handle or a global DRM name for a To create a process local handle or a global DRM name for a
buffer, call buffer, call

View File

@@ -1,114 +1,33 @@
File: docs/README.WIN32 File: docs/README.WIN32
Last updated: Apr 25, 2007 Last updated: 23 April 2011
NOTE: This information only applies to Mesa 7.8 and older. Nowadays
it's probably better to use Scons to build for Windows.
Quick Start Quick Start
----- ----- ----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same Windows drivers are build with SCons. Makefiles or Visual Studio projects are
directory. The libs and demos build separately, so if you do not care no longer shipped or supported.
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
The Windows build system uses Microsoft Visual Studio. Project files Run
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 8 files
are in windows/VC8.
Support has been dropped for versions of Visual Studio prior to 8. The scons osmesa mesagdi
main reason is because Microsoft now provides a free compiler and
developer environment. Visual Studio Express can be found at
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx to build classic mesa Windows GDI drivers; or
You'll also need the Platform SDK. Instructions for obtaining and scons libgl-gdi
using the SDK with Visual Studio Express can be found at
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ to build gallium based GDI driver.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
Windows Drivers Windows Drivers
------- ------- ------- -------
At this time, only the GDI driver is known to work. Most of the demos At this time, only the gallium GDI driver is known to work.
in progs/demos should work with this driver.
Source code also exists in the tree for other drivers in Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown. src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC8/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC8/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC8
---
No notes.
General General
------- -------
@@ -128,11 +47,5 @@ the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code. mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, please post If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list. to the mesa-dev or mesa-users list.

View File

@@ -82,7 +82,7 @@ Additions to the EGL 1.4 Specification:
Import a wl_buffer by calling eglCreateImageKHR with Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
and an empty attribute_list. NULL context and an empty attribute_list.
Issues Issues

View File

@@ -29,12 +29,14 @@ directly dispatched to the drivers.</p>
the driver for your hardware. For example</p> the driver for your hardware. For example</p>
<pre> <pre>
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau $ ./configure --enable-gles1 --enable-gles2 \
--with-dri-drivers=... \
--with-gallium-drivers=...
</pre> </pre>
<p>The main library and OpenGL is enabled by default. The first option above <p>The main library and OpenGL is enabled by default. The first two options
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables above enables <a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The last two
<a href="openvg.html">OpenVG</a>.</p> options enables the listed classic and and Gallium drivers respectively.</p>
</li> </li>
@@ -42,8 +44,8 @@ enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
</ol> </ol>
<p>In the given example, it will build and install <code>libEGL</code>, <p>In the given example, it will build and install <code>libEGL</code>,
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, <code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, and one
<code>libOpenVG</code>, and one or more EGL drivers.</p> or more EGL drivers.</p>
<h3>Configure Options</h3> <h3>Configure Options</h3>
@@ -65,6 +67,12 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</li> </li>
<li><code>--enable-gallium-egl</code>
<p>Enable the optional <code>egl_gallium</code> driver.</p>
</li>
<li><code>--with-egl-platforms</code> <li><code>--with-egl-platforms</code>
<p>List the platforms (window systems) to support. Its argument is a comma <p>List the platforms (window systems) to support. Its argument is a comma
@@ -88,15 +96,17 @@ internal library that supports multiple APIs.</p>
</li> </li>
<li><code>--enable-openvg</code> <li><code>--enable-shared-glapi</code>
<p>OpenVG must be explicitly enabled by this option.</p> <p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
This options makes <code>libGL</code> use the shared <code>libglapi</code>. This
is required if applications mix OpenGL and OpenGL ES.</p>
</li> </li>
<li><code>--enable-gallium-egl</code> <li><code>--enable-openvg</code>
<p>Explicitly enable or disable <code>egl_gallium</code>.</p> <p>OpenVG must be explicitly enabled by this option.</p>
</li> </li>
@@ -220,8 +230,7 @@ distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code> <p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code> before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
may either be disabled with <code>--disable-gallium-egl</code> or packaged is disabled by default.</p>
separately.</p>
<h2>Developers</h2> <h2>Developers</h2>
@@ -307,17 +316,5 @@ not be called with the sample display at the same time. If a driver has access
to an <code>EGLDisplay</code> without going through the EGL APIs, the driver to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
should as well lock the display before using it. should as well lock the display before using it.
<h3>TODOs</h3>
<ul>
<li>Pass the conformance tests</li>
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
<code>libGLESv2.so</code> should an application link to? Bad things may happen
when, say, an application is linked to <code>libGLESv2.so</code> and
<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
</ul>
</body> </body>
</html> </html>

View File

@@ -274,7 +274,6 @@ For example, compiling and linking a GLUT application can be done with:
<p> <p>
Please see the <a href="#scons">instructions on building with SCons</a>. Please see the <a href="#scons">instructions on building with SCons</a>.
Alternatively see <a href="README.WIN32">README.WIN32</a> file.
</p> </p>

View File

@@ -22,21 +22,20 @@ It's the fastest software rasterizer for Mesa.
<h1>Requirements</h1> <h1>Requirements</h1>
<dl> <ul>
<dt>An x86 or amd64 processor. 64-bit mode is preferred.</dt> <li>
<dd> <p>An x86 or amd64 processor; 64-bit mode recommended.</p
<p> <p>
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will Support for SSE2 is strongly encouraged. Support for SSSE3, and SSE4.1 will
yield the most efficient code. The less features the CPU has the more yield the most efficient code. The less features the CPU has the more
likely is that you ran into underperforming, buggy, or incomplete code. likely is that you ran into underperforming, buggy, or incomplete code.
</p> </p>
<p> <p>
See /proc/cpuinfo to know what your CPU supports. See /proc/cpuinfo to know what your CPU supports.
</p> </p>
</dd> </li>
<dt>LLVM. Version 2.8 recommended. 2.6 or later required.</dt> <li>
<dd> <p>LLVM: version 2.9 recommended; 2.6 or later required.</p>
<p>
<b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the <b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9. fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
@@ -54,26 +53,25 @@ It's the fastest software rasterizer for Mesa.
</pre> </pre>
<p> <p>
For Windows download pre-built MSVC 9.0 or MinGW binaries from For Windows you will need to build LLVM from source with MSVC or MINGW
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment (either natively or through cross compilers) and CMake, and set the LLVM
variable to the extracted path. environment variable to the directory you installed it to.
</p>
<p> LLVM will be statically linked, so when building on MSVC it needs to be
For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and built with a matching CRT as Mesa, and you'll need to pass
llvm-x.x-msvc32mtd.7z . -DLLVM_USE_CRT_RELEASE=MTd for debug and checked builds,
</p> -DLLVM_USE_CRT_RELEASE=MTd for profile and release builds.
<p> You can build only the x86 target by passing -DLLVM_TARGETS_TO_BUILD=X86
You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing to cmake.
debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with
debug=no. This is necessary as LLVM builds as static library so the chosen
MS CRT must match.
</p> </p>
</dd> </li>
<li>
<p>scons (optional)</p>
</li>
</ul>
<dt>scons (optional)</dt>
</dl>
@@ -93,7 +91,7 @@ Alternatively, you can build it with GNU make, if you prefer, by invoking it as
but the rest of these instructions assume that scons is used. but the rest of these instructions assume that scons is used.
For windows is everything the except except the winsys: For Windows the procedure is similar except the target:
<pre> <pre>
scons build=debug libgl-gdi scons build=debug libgl-gdi

View File

@@ -11,11 +11,42 @@
<H1>News</H1> <H1>News</H1>
<h2>November 27, 2011</h2>
<p>
<a href="relnotes-7.11.2.html">Mesa 7.11.2</a> is released.
This release was made primarily to fix build problems with 7.11.1 on
Mandriva and to fix problems related to glCopyTexImage to
luminance-alpha textures. That later was believed to have been fixed
in 7.11.1 but was not.
</p>
<h2>November 17, 2011</h2>
<p>
<a href="relnotes-7.11.1.html">Mesa 7.11.1</a> is released. This is a bug fix
release.
</p>
<h2>July 31, 2011</h2>
<p>
<a href="relnotes-7.11.html">Mesa 7.11</a> is released. This is a new
release with many new features.
</p>
<h2>June 13, 2011</h2>
<p>
<a href="relnotes-7.10.3.html">Mesa 7.10.3</a> is released. This is a bug
fix release.
</p>
<h2>April 6, 2011</h2> <h2>April 6, 2011</h2>
<p> <p>
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug <a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
fix release release. fix release.
</p> </p>
<h2>March 2, 2011</h2> <h2>March 2, 2011</h2>

View File

@@ -34,27 +34,10 @@ EGL drivers for your hardware.</p>
<h2>Run the Demos</h2> <h2>Run the Demos</h2>
<p>There are some demos in <code>progs/egl/</code>. You can use them to test <p>There are some demos in <code>mesa/demos</code> repository.</p>
your build. For example,</p>
<pre>
$ cd progs/egl/eglut
$ make
$ cd ../opengles1
$ make
$ ./torus_x11
</pre>
<h2>Developers</h2> <h2>Developers</h2>
<h3>Internal Libraries</h3>
<table border="1" style="text-align: center;">
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
</table>
<h3>Dispatch Table</h3> <h3>Dispatch Table</h3>
<p>OpenGL ES has an additional indirection when dispatching fucntions</p> <p>OpenGL ES has an additional indirection when dispatching fucntions</p>

View File

@@ -11,7 +11,7 @@
<H1>OpenVG State Tracker</H1> <H1>OpenVG State Tracker</H1>
<p> <p>
The current version of the OpenVG state tracker implements OpenVG 1.0. The current version of the OpenVG state tracker implements OpenVG 1.1.
</p> </p>
<p> <p>
More informations about OpenVG can be found at More informations about OpenVG can be found at
@@ -26,9 +26,9 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
<h2>Building the library</h2> <h2>Building the library</h2>
<ol> <ol>
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do <li>Run <code>configure</code> with <code>--enable-openvg</code> and
not need OpenGL, you can add <code>--disable-opengl</code> to save the <code>--enable-gallium-egl</code>. If you do not need OpenGL, you can add
compilation time.</li> <code>--disable-opengl</code> to save the compilation time.</li>
<li>Build and install Mesa as usual.</li> <li>Build and install Mesa as usual.</li>
</ol> </ol>
@@ -36,7 +36,7 @@ compilation time.</li>
<h3>Sample build</h3> <h3>Sample build</h3>
A sample build looks as follows: A sample build looks as follows:
<pre> <pre>
$ ./configure --disable-opengl --enable-openvg $ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
$ make $ make
$ make install $ make install
</pre> </pre>

31
docs/patents.txt Normal file
View File

@@ -0,0 +1,31 @@
ARB_texture_float:
Silicon Graphics, Inc. owns US Patent #6,650,327, issued November 18,
2003 [1].
SGI believes this patent contains necessary IP for graphics systems
implementing floating point rasterization and floating point
framebuffer capabilities described in ARB_texture_float extension, and
will discuss licensing on RAND terms, on an individual basis with
companies wishing to use this IP in the context of conformant OpenGL
implementations [2].
The source code to implement ARB_texture_float extension is included
and can be toggled on at compile time, for those who purchased a
license from SGI, or are in a country where the patent does not apply,
etc.
The software is provided "as is", without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
You should contact a lawyer or SGI's legal department if you want to
enable this extension.
[1] http://www.google.com/patents/about?id=mIIOAAAAEBAJ&dq=6650327
[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt

303
docs/relnotes-7.10.3.html Normal file
View File

@@ -0,0 +1,303 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.3 Release Notes / June 13, 2011</H1>
<p>
Mesa 7.10.3 is a bug fix release which fixes bugs found since the 7.10.2 release.
</p>
<p>
Mesa 7.10.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
8c38fe8266be8e1ed1d84076ba5a703b MesaLib-7.10.3.tar.bz2
614d063ecd170940d9ae7b355d365d59 MesaLib-7.10.3.zip
8768fd562ede7ed763d92b2d22232d7a MesaGLUT-7.10.3.tar.gz
1496415b89da9549f0f3b34d9622e2e2 MesaGLUT-7.10.3.tar.bz2
1f29d0e7398fd3bf9f36f5db02941198 MesaGLUT-7.10.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31590">Bug 31590</a> - Black space between colors on mole hill example</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32395">Bug 32395</a> - [glsl] Incorrect code generation for shadow2DProj() with bias</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32564">Bug 32564</a> - [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32835">Bug 32835</a> - [glsl] recursive #define results in infinite stack recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33303">Bug 33303</a> - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33314">Bug 33314</a> - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33512">Bug 33512</a> - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34280">Bug 34280</a> - r200 mesa-7.10 font distortion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34321">Bug 34321</a> - The ARB_fragment_program subset of ARB_draw_buffers not implemented</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35603">Bug 35603</a> - GLSL compiler freezes compiling shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36173">Bug 36173</a> - struct renderbuffer's 'format' field never set when using FBO</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36238">Bug 36238</a> - Mesa release files don't contain scons control files</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36410">Bug 36410</a> - [SNB] Rendering errors in 3DMMES subtest taiji</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36527">Bug 36527</a> - [wine] Wolfenstein: Failed to translate rgb instruction.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36651">Bug 36651</a> - mesa requires bison and flex to build but configure does not check for them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36738">Bug 36738</a> - Openarena crash with r300g, swrastg + llvm &gt; 2.8</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37648">Bug 37648</a> - Logic error in mesa/main/teximage.c:texsubimage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37739">Bug 37739</a> - Color clear of FBO without color buffer crashes</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10.2..mesa-7.10.3
</pre>
<p>Alan Hourihane (1):
<ul>
<li>Check for out of memory when creating fence</li>
</ul></p>
<p>Alex Buell (1):
<ul>
<li>configure: bump LIBDRM_REQUIRED to 2.4.24</li>
</ul></p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new pci ids</li>
<li>r600g: add new pci ids</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>docs: add link to 7.10.2 release notes</li>
<li>scons: remove dangling reference to state_trackers/python/SConscript</li>
<li>Makefile: add missing Scons files</li>
<li>llvmpipe: document issue with LLVM 2.8 and earlier with AVX</li>
<li>docs: replace llvmpipe/README with docs/llvmpipe.html</li>
<li>glsl: add static qualifier to silence warning</li>
<li>glsl: add cast to silence signed/unsigned comparison warning</li>
<li>mesa: s/height/depth/ in texsubimage()</li>
<li>mesa: fix void pointer arithmetic warnings</li>
<li>mesa: add some missing GLAPIENTRY keywords</li>
<li>mesa: check that flex/bison are installed</li>
<li>st/mesa: fix incorrect texture level/face/slice accesses</li>
<li>draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)</li>
<li>vbo: check array indexes to prevent negative indexing</li>
<li>vbo: remove node-&gt;count &gt; 0 test in vbo_save_playback_vertex_list()</li>
<li>st/mesa: fix software accum buffer format bug</li>
<li>mesa: add include/c99/inttypes.h include/c99/stdbool.h include/c99/stdint.h files to tarballs</li>
<li>docs: 7.10.3 release notes skeleton file, links</li>
<li>mesa: bump version to 7.10.3</li>
</ul></p>
<p>Carl Worth (2):
<ul>
<li>glcpp: Simplify calling convention of parser's active_list functions</li>
<li>glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>st/mesa: fix compressed mipmap generation.</li>
</ul></p>
<p>Eric Anholt (19):
<ul>
<li>i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.</li>
<li>glsl: Avoid cascading errors when looking for a scalar boolean and failing.</li>
<li>glsl: Semantically check the RHS of `&amp;&amp;' even when short-circuiting.</li>
<li>glsl: Semantically check the RHS of `||' even when short-circuiting.</li>
<li>glsl: When we've emitted a semantic error for ==, return a bool constant.</li>
<li>glsl: Perform type checking on "^^" operands.</li>
<li>intel: Use _mesa_base_tex_format for FBO texture attachments.</li>
<li>swrast: Don't assert against glReadPixels of GL_RED and GL_RG.</li>
<li>mesa: Add a gl_renderbuffer.RowStride field like textures have.</li>
<li>mesa: Add a function to set up the default renderbuffer accessors.</li>
<li>intel: Use Mesa core's renderbuffer accessors for depth.</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*</li>
<li>mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.</li>
<li>swrast: Don't try to adjust_colors for &lt8bpc when handling R16, RG1616.</li>
<li>intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.</li>
<li>Revert "intel: Add spans code for the ARB_texture_rg support."</li>
<li>mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.</li>
<li>mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.</li>
</ul></p>
<p>Hans de Goede (1):
<ul>
<li>texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616</li>
</ul></p>
<p>Henri Verbeet (3):
<ul>
<li>mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.</li>
<li>glx: Destroy dri2Hash on DRI2 display destruction.</li>
<li>glx: Only remove the glx_display from the list after it's destroyed.</li>
</ul></p>
<p>Ian Romanick (9):
<ul>
<li>docs: Add 7.10.2 md5sums</li>
<li>glsl: Fix off-by-one error setting max_array_access for non-constant indexing</li>
<li>ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly</li>
<li>intel: Fix ROUND_DOWN_TO macro</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>i965: Remove hint_gs_always and resulting dead code</li>
<li>mesa: Don't try to clear a NULL renderbuffer</li>
<li>mesa: Ignore blits to/from missing buffers</li>
<li>docs: Add list of bugs fixed in 7.10.3 release</li>
</ul></p>
<p>Jeremy Huddleston (18):
<ul>
<li>apple: Update GL specs</li>
<li>apple: Rename glcontextmodes.[ch] to glxconfig.[ch]</li>
<li>apple: Rename __GLcontextModes to struct glx_config</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Re-add driContext and do_destroy</li>
<li>apple: Rename _gl_context_modes_find_visual to glx_config_find_visual</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Change from XExtDisplayInfo to struct glx_display</li>
<li>apple: ifdef out come glapi-foo on darwin</li>
<li>glx: Dead code removal</li>
<li>apple: Build darwin using applegl rather than indirect</li>
<li>apple: Fix build failures in applegl_glx.c</li>
<li>darwin: Define GALLIUM_DRIVERS_DIRS in darwin config</li>
<li>apple: Package applegl source into MesaLib tarball</li>
<li>darwin: Set VG_LIB_{NAME,GLOB} to fix make install</li>
<li>darwin: Don't link against libGL when building libOSMesa</li>
<li>darwin: Fix VG_LIB_GLOB to also match the unversioned symlink</li>
<li>osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.</li>
</ul></p>
<p>José Fonseca (13):
<ul>
<li>llvmpipe: Update readme.</li>
<li>mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean.</li>
<li>mesa: Fix GetVertexAttrib* inside display lists.</li>
<li>draw: Fix draw_variant_output::format's type.</li>
<li>gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.</li>
<li>gallivm: Fix for dynamically linked LLVM 2.8 library.</li>
<li>st/wgl: Adjust the pbuffer invisible window size.</li>
<li>st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().</li>
<li>st/wgl: Prevent spurious framebuffer sizes when the window is minimized.</li>
<li>st/wgl: Cope with zero width/height windows.</li>
<li>st/wgl: Allow to create pbuffers bigger than the desktop.</li>
<li>st/wgl: Remove buggy assertion.</li>
<li>wgl: Don't hold on to user supplied HDC.</li>
</ul></p>
<p>Kenneth Graunke (10):
<ul>
<li>i965/fs: Switch W and 1/W in Sandybridge interpolation setup.</li>
<li>i965: Refactor Sandybridge implied move handling.</li>
<li>i965: Resolve implied moves in brw_dp_READ_4_vs_relative.</li>
<li>intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.</li>
<li>i965: Allocate the whole URB to the VS and fix calculations for Gen6.</li>
<li>intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.</li>
<li>glsl: Fix memory error when creating the supported version string.</li>
<li>glsl: Regenerate autogenerated file builtin_function.cpp.</li>
<li>i965: Rename various gen6 #defines to match the documentation.</li>
<li>i965: Never enable the GS on Gen6.</li>
</ul></p>
<p>Kostas Georgiou (1):
<ul>
<li>r600c/g: Add pci id for FirePro 2270</li>
</ul></p>
<p>Marek Olšák (18):
<ul>
<li>tgsi/ureg: bump the limit of immediates</li>
<li>st/mesa: fix changing internal format via RenderbufferStorage</li>
<li>st/mesa: GenerateMipmap should not be killed by conditional rendering</li>
<li>swrast: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering</li>
<li>st/mesa: conditional rendering should not kill texture decompression via blit</li>
<li>mesa: forbid UseProgram to be called inside Begin/End</li>
<li>mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End</li>
<li>mesa: queries of non-existent FBO attachments should return INVALID_OPERATION</li>
<li>r300g: fix draw_vbo splitting on r3xx-r4xx</li>
<li>r300g: fix texturing with non-3D textures and wrap R mode set to sample border</li>
<li>r300g: fix occlusion queries when depth test is disabled or zbuffer is missing</li>
<li>r300g: clear can be killed by render condition</li>
<li>st/mesa: remove asserts in st_texture_image_copy</li>
<li>mesa: fix up assertion in _mesa_source_buffer_exists</li>
<li>mesa: invalidate framebuffer if internal format of renderbuffer is changed</li>
<li>mesa: return after invalidating renderbuffer</li>
</ul></p>
<p>Matt Turner (1):
<ul>
<li>r300/compiler: align memory allocations to 8-bytes</li>
</ul></p>
<p>Tom Stellard (3):
<ul>
<li>r300/compiler: Fix incorrect presubtract conversion</li>
<li>r300/compiler: Fix dataflow analysis bug with ELSE blocks</li>
<li>r300/compiler: Limit instructions to 3 source selects</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>gallivm: Disable MMX-disabling code on llvm-2.9.</li>
</ul></p>
<p>Zou Nan hai (1):
<ul>
<li>i965: Align interleaved URB write length to 2</li>
</ul></p>
<p>pepp (1):
<ul>
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
</ul></p>
</body>
</html>

391
docs/relnotes-7.11.1.html Normal file
View File

@@ -0,0 +1,391 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11.1 Release Notes / November 17, 2011</H1>
<p>
Mesa 7.11.1 is a bug fix release which fixes bugs found since the 7.11 release.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
ac0181a4076770fb657c1169af43aa09 MesaLib-7.11.1.tar.gz
a77307102cee844ff6544ffa8fafeac1 MesaLib-7.11.1.tar.bz2
dfcb11516c1730f3981b55a65a835623 MesaLib-7.11.1.zip
2cb2b9ecb4fb7d1a6be69346ee886952 MesaGLUT-7.11.1.tar.gz
3f54e314290d4dacbab089839197080b MesaGLUT-7.11.1.tar.bz2
5d66c7ee8c5cc2f27e1ffb037ad4172c MesaGLUT-7.11.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=3165">Bug 3165</a> - texImage.IsCompressed and texImage.CompressedSize issues</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23525">Bug 23525</a> - Software rendering on QEMU guests badly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28125">Bug 28125</a> - DRI2 prevents indirect glx</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34628">Bug 34628</a> - [ilk] skybox errors in quake4</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36371">Bug 36371</a> - r200: piglit readPixSanity failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36669">Bug 36669</a> - EmitNoMainReturn set to 1 doesn't make the GLSL compiler lower all the RET opcodes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36939">Bug 36939</a> - multitexturing is messed up in quake wars (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37907">Bug 37907</a> - [swrast] SIGSEGV swrast/s_depth.c:569</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38163">Bug 38163</a> - Gnome Shell Display Bug</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38625">Bug 38625</a> - ast_to_hir.cpp:1761: const glsl_type* process_array_type(YYLTYPE*, const glsl_type*, ast_node*, _mesa_glsl_parse_state*): Assertion `dummy_instructions.is_empty()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38729">Bug 38729</a> - [softpipe] sp_quad_depth_test.c:215:convert_quad_stencil: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38863">Bug 38863</a> - [IVB]GPU hang when running 3D games like openarena</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39193">Bug 39193</a> - [llvmpipe and r600g] glCheckFramebufferStatusEXT segfaults in Gallium when checking status on a framebuffer bound to a texture that's bound to a pixmap</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39651">Bug 39651</a> - [glsl] Assertion failure when implicitly converting out parameters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39991">Bug 39991</a> - [regression]GL_PALETTE8_RGBA8_OES format of glCompressedTexImage2D will cause err GL_INVALID_ENUM with GLES1.x</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40022">Bug 40022</a> - [i915] out-of-bounds write src/mesa/drivers/dri/i915/i915_fragprog.c:321</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40062">Bug 40062</a> - in etqw the strogg radar is black (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40324">Bug 40324</a> - [SNB] gpu hang in mesa 7.11</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40533">Bug 40533</a> - i915: piglit glean/readPixSanity: DRI2SwapBuffers: BadDrawable (invalid Pixmap or Window parameter)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41096">Bug 41096</a> - [sandybridge-m-gt2+] GPU lockup render.IPEHR: 0x7a000002</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41969">Bug 41969</a> - The Mesa meta save/restore code doesn't always save the active program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=42175">Bug 42175</a> - RV730: Display errors in glxgears &amp; WebGL</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=42268">Bug 42268</a> - [bisected] oglc pbo(negative.invalidOffsetValue) aborts on 7.11 branch</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.11..mesa-7.11.1
</pre>
<p>Adam Jackson (2):
<ul>
<li>drisw: Remove cargo culting that breaks GLX 1.3 ctors</li>
<li>glx: Don't enable INTEL_swap_event unconditionally</li>
</ul></p>
<p>Alex Deucher (1):
<ul>
<li>r600g: fix up vs export handling</li>
</ul></p>
<p>Ben Widawsky (1):
<ul>
<li>intel: GetBuffer fix</li>
</ul></p>
<p>Brian Paul (15):
<ul>
<li>docs: add 7.11 md5 sums</li>
<li>docs: news item for 7.11 release</li>
<li>st/mesa: Convert size assertions to conditionals in st_texture_image_copy.</li>
<li>softpipe: add missing stencil format case in convert_quad_stencil()</li>
<li>mesa: fix texstore addressing bugs for depth/stencil formats</li>
<li>mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries</li>
<li>swrast: don't try to do depth testing if there's no depth buffer</li>
<li>meta: fix/add checks for GL_EXT_framebuffer_sRGB</li>
<li>mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros</li>
<li>meta: fix broken sRGB mipmap generation</li>
<li>mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()</li>
<li>mesa: fix error handling for dlist image unpacking</li>
<li>mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End</li>
<li>mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()</li>
<li>mesa: fix format/type check in unpack_image() for bitmaps</li>
</ul></p>
<p>Carl Simonson (1):
<ul>
<li>i830: Add missing vtable entry for i830 from the hiz work.</li>
</ul></p>
<p>Carl Worth (5):
<ul>
<li>glcpp: Fix two (or more) successive applications of token pasting</li>
<li>glcpp: Test a non-function-like macro using the token paste operator</li>
<li>glcpp: Implement token pasting for non-function-like macros</li>
<li>glcpp: Raise error if defining any macro containing two consecutive underscores</li>
<li>glcpp: Add a test for #elif with an undefined macro.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Add method glsl_type::can_implicitly_convert_to()</li>
<li>glsl: Fix implicit conversions in non-constructor function calls</li>
<li>glsl: Remove ir_function.cpp:type_compare()</li>
<li>glsl: Fix conversions in array constructors</li>
<li>x86-64: Fix compile error with clang</li>
</ul></p>
<p>Chia-I Wu (3):
<ul>
<li>glsl: empty declarations should be valid</li>
<li>intel: rename intel_extensions_es2.c to intel_extensions_es.c</li>
<li>intel: fix GLESv1 support</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>i915: out-of-bounds write in calc_live_regs()</li>
</ul></p>
<p>Christopher James Halse Rogers (1):
<ul>
<li>glx/dri2: Paper over errors in DRI2Connect when indirect</li>
</ul></p>
<p>David Reveman (1):
<ul>
<li>i915g: Fix off-by-one in scissors.</li>
</ul></p>
<p>Eric Anholt (16):
<ul>
<li>mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.</li>
<li>mesa: Fix glGetUniform() type conversions.</li>
<li>mesa: Add support for Begin/EndConditionalRender in display lists.</li>
<li>mesa: Throw an error instead of asserting for condrender with query == 0.</li>
<li>mesa: Throw an error when starting conditional render on an active query.</li>
<li>mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.</li>
<li>glsl: Allow ir_assignment() constructor to not specify condition.</li>
<li>glsl: Clarify error message about whole-array assignment in GLSL 1.10.</li>
<li>glsl: When assigning to a whole array, mark the array as accessed.</li>
<li>glsl: When assiging from a whole array, mark it as used.</li>
<li>i965/fs: Respect ARB_color_buffer_float clamping.</li>
<li>i965: Add missing _NEW_POLYGON flag to polygon stipple upload.</li>
<li>i965: Fix polygon stipple offset state flagging.</li>
<li>intel: Mark MESA_FORMAT_X8_Z24 as always supported.</li>
<li>mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)</li>
<li>glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.</li>
</ul></p>
<p>Henri Verbeet (6):
<ul>
<li>mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().</li>
<li>r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.</li>
<li>mesa: Check the texture against all units in unbind_texobj_from_texunits().</li>
<li>mesa: Allow sampling from units &gt;= MAX_TEXTURE_UNITS in shaders.</li>
<li>mesa: Use the Elements macro for the sampler index assert in validate_samplers().</li>
<li>mesa: Fix a couple of TexEnv unit limits.</li>
</ul></p>
<p>Ian Romanick (17):
<ul>
<li>mesa: Add utility function to get base format from a GL compressed format</li>
<li>mesa: Return the correct internal fmt when a generic compressed fmt was used</li>
<li>mesa: Make _mesa_get_compressed_formats match the texture compression specs</li>
<li>linker: Make linker_error set LinkStatus to false</li>
<li>linker: Make linker_{error,warning} generally available</li>
<li>mesa: Ensure that gl_shader_program::InfoLog is never NULL</li>
<li>ir_to_mesa: Use Add linker_error instead of fail_link</li>
<li>ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered</li>
<li>i915: Fail without crashing if a Mesa IR program uses too many registers</li>
<li>i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks</li>
<li>mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format</li>
<li>mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format</li>
<li>mesa: Refactor expected texture size check in cpal_get_info</li>
<li>mesa: Add _mesa_cpal_compressed_format_type</li>
<li>mesa: Refactor compressed texture error checks to work with paletted textures</li>
<li>mesa: Remove redundant compressed paletted texture error checks</li>
<li>mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x</li>
</ul></p>
<p>Jeremy Huddleston (3):
<ul>
<li>apple: Silence some debug spew</li>
<li>apple: Use the correct (OpenGL.framework) glViewport and glScissor during init</li>
<li>apple: Implement applegl_unbind_context</li>
</ul></p>
<p>José Fonseca (1):
<ul>
<li>docs: Update llvmpipe docs.</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.</li>
<li>mesa: In validate_program(), initialize errMsg for safety.</li>
<li>i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.</li>
<li>i965: Use proper texture alignment units for cubemaps on Gen5+.</li>
<li>i965: Fix incorrect maximum PS thread count shift on Ivybridge.</li>
<li>i965: Emit depth stalls and flushes before changing depth state on Gen6+.</li>
<li>i965/fs: Allow SIMD16 with control flow on Ivybridge.</li>
<li>i965: Allow SIMD16 color writes on Ivybridge.</li>
<li>i965: Fix inconsistent indentation in brw_eu_emit.c.</li>
<li>intel: Depth format fixes</li>
<li>i965: Apply post-sync non-zero workaround to homebrew workaround.</li>
<li>mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>glx: Don't flush twice if we fallback to dri2CopySubBuffer</li>
</ul></p>
<p>Marc Pignat (1):
<ul>
<li>drisw: Fix 24bpp software rendering, take 2</li>
</ul></p>
<p>Marcin Baczyński (2):
<ul>
<li>configure: fix gcc version check</li>
<li>configure: allow C{,XX}FLAGS override</li>
</ul></p>
<p>Marcin Slusarz (3):
<ul>
<li>nouveau: fix nouveau_fence leak</li>
<li>nouveau: fix crash during fence emission</li>
<li>nouveau: fix fence hang</li>
</ul></p>
<p>Marek Olšák (19):
<ul>
<li>vbo: do not call _mesa_max_buffer_index in debug builds</li>
<li>winsys/radeon: fix space checking</li>
<li>r300/compiler: fix a warning that a variable may be uninitialized</li>
<li>r300/compiler: remove an unused-but-set variable and simplify the code</li>
<li>u_vbuf_mgr: cleanup original vs real vertex buffer arrays</li>
<li>u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index</li>
<li>u_vbuf_mgr: fix max_index computation for large src_offset</li>
<li>u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_</li>
<li>u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED</li>
<li>u_vbuf_mgr: rework user buffer uploads</li>
<li>u_vbuf_mgr: fix uploading with a non-zero index bias</li>
<li>configure.ac: fix xlib-based softpipe build</li>
<li>r600g: add index_bias to index buffer bounds</li>
<li>r300g: fix rendering with a non-zero index bias in draw_elements_immediate</li>
<li>Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"</li>
<li>pb_bufmgr_cache: flush cache when create_buffer fails and try again</li>
<li>r300g: don't return NULL in resource_from_handle if the resource is too small</li>
<li>r600g: set correct tiling flags in depth info</li>
<li>r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo</li>
</ul></p>
<p>Michel Dänzer (4):
<ul>
<li>st/mesa: Finalize texture on render-to-texture.</li>
<li>glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.</li>
<li>gallium/util: Add macros for converting from little endian to CPU byte order.</li>
<li>r300g: Fix queries on big endian hosts.</li>
</ul></p>
<p>Neil Roberts (1):
<ul>
<li>meta: Fix saving the active program</li>
</ul></p>
<p>Paul Berry (18):
<ul>
<li>glsl: Lower unconditional return statements.</li>
<li>glsl: Refactor logic for determining whether to lower return statements.</li>
<li>glsl: lower unconditional returns and continues in loops.</li>
<li>glsl: Use foreach_list in lower_jumps.cpp</li>
<li>glsl: In lower_jumps.cpp, lower both branches of a conditional.</li>
<li>glsl: Lower break instructions when necessary at the end of a loop.</li>
<li>glsl: improve the accuracy of the radians() builtin function</li>
<li>glsl: improve the accuracy of the atan(x,y) builtin function.</li>
<li>Revert "glsl: Skip processing the first function's body in do_dead_functions()."</li>
<li>glsl: Emit function signatures at toplevel, even for built-ins.</li>
<li>glsl: Constant-fold built-in functions before outputting IR</li>
<li>glsl: Check array size is const before asserting that no IR was generated.</li>
<li>glsl: Perform implicit type conversions on function call out parameters.</li>
<li>glsl: Fix type error when lowering integer divisions</li>
<li>glsl: Rework oversize array check for gl_TexCoord.</li>
<li>glsl: Remove field array_lvalue from ir_variable.</li>
<li>glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.</li>
<li>glsl: improve the accuracy of the asin() builtin function.</li>
</ul></p>
<p>Tobias Droste (1):
<ul>
<li>r300/compiler: simplify code in peephole_add_presub_add</li>
</ul></p>
<p>Tom Fogal (1):
<ul>
<li>Only use gcc visibility support with gcc4+.</li>
</ul></p>
<p>Tom Stellard (1):
<ul>
<li>r300/compiler: Fix regalloc for values with multiple writers</li>
</ul></p>
<p>Vadim Girlin (5):
<ul>
<li>st/mesa: flush bitmap cache on query and conditional render boundaries</li>
<li>r600g: use backend mask for occlusion queries</li>
<li>r600g: take into account force_add_cf in pops</li>
<li>r600g: fix check_and_set_bank_swizzle</li>
<li>r600g: fix replace_gpr_with_pv_ps</li>
</ul></p>
<p>Yuanhan Liu (17):
<ul>
<li>i965: fix the constant interp bitmask for flat mode</li>
<li>mesa: fix error handling for glEvalMesh1/2D</li>
<li>mesa: fix error handling for some glGet* functions</li>
<li>mesa: fix error handling for glTexEnv</li>
<li>mesa: fix error handling for glIsEnabled</li>
<li>mesa: fix error handling for glPixelZoom</li>
<li>mesa: fix error handling for glSelectBuffer</li>
<li>mesa: fix error handling for glMapBufferRange</li>
<li>mesa: fix error handling for glMaterial*</li>
<li>intel: fix the wrong code to detect null texture.</li>
<li>mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image</li>
<li>i965: setup address rounding enable bits</li>
<li>mesa: generate error if pbo offset is not aligned with the size of specified type</li>
<li>mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB</li>
<li>mesa: handle the pbo case for save_Bitmap</li>
<li>mesa: handle PBO access error in display list mode</li>
<li>intel: don't call unmap pbo if pbo is not mapped</li>
</ul></p>
</body>
</html>

85
docs/relnotes-7.11.2.html Normal file
View File

@@ -0,0 +1,85 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11.2 Release Notes / November 27, 2011</H1>
<p>
Mesa 7.11.2 is a bug fix release which fixes bugs found since the 7.11 release.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
b9e84efee3931c0acbccd1bb5a860554 MesaLib-7.11.2.tar.gz
0837c52698fe3252369c3fdb5195afcc MesaLib-7.11.2.tar.bz2
141273c274d12e0d2bafb497fe937da3 MesaLib-7.11.2.zip
39ae9926794794503815ffdc069521eb MesaGLUT-7.11.2.tar.gz
35ca3a0b54cb6f9d2e0e4eae8f6bb95e MesaGLUT-7.11.2.tar.bz2
f8705fcff2510b6c39cd27b575c05dba MesaGLUT-7.11.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=43143">Bug 43143</a> - Mesa 7.11.1 fails to build at main/dlist.c:4532 with error message: "format not a string literal and no format arguments"</li>
<li>Incorrect handling of CopyTexImage from RGBA window to LA texture.</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.11.1..mesa-7.11.2
</pre>
<p>Brian Paul (4):
<ul>
<li>mesa: stop using ctx-&gt;Driver.CopyTexImage1D/2D() hooks</li>
<li>mesa: fix format selection for meta CopyTexSubImage()</li>
<li>docs: update news.html and relnotes.html for 7.11.1 release</li>
<li>mesa: use format string in _mesa_error() call to silence warning</li>
</ul></p>
<p>Chad Versace (3):
<ul>
<li>intel: Simplify stencil detiling arithmetic</li>
<li>intel: Fix region dimensions for stencil buffers received from DDX</li>
<li>intel: Fix separate stencil in builtin DRI2 backend</li>
</ul></p>
<p>Ian Romanick (3):
<ul>
<li>docs: Add 7.11.1 release md5sums</li>
<li>mesa: set version string to 7.11.2-devel</li>
<li>mesa: Bump version to 7.11.2 (final)</li>
</ul></p>
</body>
</html>

View File

@@ -10,7 +10,7 @@
<body bgcolor="#eeeeee"> <body bgcolor="#eeeeee">
<H1>Mesa 7.11 Release Notes / (release date TBD)</H1> <H1>Mesa 7.11 Release Notes / July 31, 2011</H1>
<p> <p>
Mesa 7.11 is a new development release. Mesa 7.11 is a new development release.
@@ -30,34 +30,319 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2> <h2>MD5 checksums</h2>
<pre> <pre>
tbd fa2c7068503133fb2453244cda11cb2a MesaLib-7.11.tar.gz
ff03aca82d0560009a076a87c888cf13 MesaLib-7.11.tar.bz2
ede1ac0976f6f05df586093fc17d63ed MesaLib-7.11.zip
b4fb81a47c5caedaefad49af7702c23d MesaGLUT-7.11.tar.gz
77a9a0bbd7f8bca882aa5709b88cb071 MesaGLUT-7.11.tar.bz2
c19ef0c6eb61188c96ed4ccedd70717c MesaGLUT-7.11.zip
</pre> </pre>
<h2>New features</h2> <h2>New features</h2>
<ul> <ul>
<li>GL_ARB_ES2_compatibility (gallium drivers)
<li>GL_ARB_color_buffer_float (gallium drivers, i965)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_ARB_draw_instanced extension (gallium drivers, swrast) <li>GL_ARB_draw_instanced extension (gallium drivers, swrast)
<li>GL_ARB_instanced_arrays extension (gallium drivers) <li>GL_ARB_instanced_arrays extension (gallium drivers)
<li>GL_ARB_texture_compression_rgtc (gallium r600, swrast) <li>GL_ARB_occlusion_query2 (gallium drivers, swrast)
<li>GL_ARB_draw_buffers_blend (gallium) <li>GL_ARB_robustness (all drivers)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_ARB_sampler_objects (gallium drivers) <li>GL_ARB_sampler_objects (gallium drivers)
<li>GL_ARB_seamless_cube_map (gallium r600)
<li>GL_ARB_shader_texture_lod (gallium drivers, i965)
<li>GL_ARB_sync (gallium drivers only, intel support was in 7.6)
<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_ARB_texture_float (gallium, i965)
<li>GL_EXT_packed_float (gallium r600)
<li>GL_EXT_texture_compression_latc (gallium drivers, swrast)
<li>GL_EXT_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_EXT_texture_filter_anisotropic (swrast)
<li>GL_EXT_texture_shared_exponent (gallium drivers, swrast)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_EXT_texture_snorm (gallium drivers)
<li>GL_AMD_draw_buffers_blend (alias of the ARB variant)
<li>GL_AMD_seamless_cubemap_per_texture (gallium r600)
<li>GL_AMD_shader_stencil_export (alias of the ARB variant)
<li>GL_ATI_draw_buffers (all drivers)
<li>GL_ATI_texture_compression_3dc (gallium drivers, swrast)
<li>GL_ATI_texture_float (gallium, i965)
<li>GL_NV_conditional_render (i965)
<li>GL_NV_texture_barrier (gallium drivers)
<li>Enable 16-wide fragment shader execution in i965 driver. This should improve performance in many applications.
<li>Initial alpha-level support for Intel "Ivybridge" chipsets in the i965 driver.
</ul> </ul>
<h2>Bug fixes</h2> <h2>Bug fixes</h2>
<p>This list is likely incomplete. This list only includes bug fixes not
included in the previous release (7.10.3). Many of these are regressions that
did not exist in the 7.10 release series at all.</p>
<ul> <ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25871">Bug 25871</a> - nearest neighbour samples wrong texel (precision/rounding problem)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30080">Bug 30080</a> - [i915] piglit nodepth-test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30217">Bug 30217</a> - Possible sources of memory leaks reported by valgrind</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30266">Bug 30266</a> - Regression, segfault in libdrm_intel when calling glBitmap</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31561">Bug 31561</a> - [i915] intel_regions.c:289: intel_region_release: Assertion `region-&gt;map_refcount == 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31744">Bug 31744</a> - [GLSL] overriding built-in function impacts another shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32308">Bug 32308</a> - [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_init.c:319:gallivm_register_garbage_collector_callback: Assertion `NumCallbacks &lt; 32' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32309">Bug 32309</a> - [softpipe] SIGSEGV sp_state_derived.c:204</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32459">Bug 32459</a> - [softpipe] glean depthStencil regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32460">Bug 32460</a> - [softpipe] piglit texwrap 1D regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32534">Bug 32534</a> - [arrandale/sandybridge] Mesa swallowing GEM ioctl failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32560">Bug 32560</a> - To fix: 64-bit-portabilty-issue state_tracker/st_program.c:427</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32634">Bug 32634</a> - [r300g, bisected] Massive corruption in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32768">Bug 32768</a> - VBO rendering using glDrawArrays causes program termination and "cs IB too big" message</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32804">Bug 32804</a> - [swrast] glean pixelFormats regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32814">Bug 32814</a> - Build error in osmesa.c due to change in _mesa_update_framebuffer_visual() signature</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32859">Bug 32859</a> - Mesa doesn't compile under NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32912">Bug 32912</a> - [bisected, r300g] Unigine Sanctuary: r300_emit.c:902:r300_emit_vertex_arrays: Assertion `&amp;buf-&gt;b.b' failed with RADEON_HYPERZ=1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32945">Bug 32945</a> - [RADEON:KMS:R300G] HiZ: Weird behavior with 3 pipes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33046">Bug 33046</a> - [bisected]glean/pixelFormats and 3 oglc cases segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33185">Bug 33185</a> - [RADEON:KMS:R300G] X crashes when kwin effects are turned on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33215">Bug 33215</a> - [llvmpipe] piglit fbo-drawbuffers2-blend regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33247">Bug 33247</a> - [swrast] tnl/t_draw.c:471: _tnl_draw_prims: Assertion `prim[i].num_instances &gt; 0' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33284">Bug 33284</a> - [llvmpipe] piglit fbo-drawbuffers-fragcolor fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - [glsl] GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33353">Bug 33353</a> - [softpipe] piglit fbo-srgb looks incorrect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33360">Bug 33360</a> - inclusion of $(TALLOC_LIBS) in src/mesa/drivers/osmesa/Makefile causes a build failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33374">Bug 33374</a> - [bisect] FTBFS on commit 9767d3b5 (glapi: Fix OpenGL ES 1.1 and 2.0 interop)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33555">Bug 33555</a> - [softpipe] tgsi/tgsi_sse2.c:1527:emit_tex: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33885">Bug 33885</a> - [glsl] GLSL compiler allows recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33823">Bug 33823</a> - [glsl] ralloc.c:78: get_header: Assertion `info-&gt;canary == 0x5A1106' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33934">Bug 33934</a> - 3D blitting is orders of magnitude slower than equivalent 2D blitting.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33946">Bug 33946</a> - Crash: Mesa checks for invalid pointer, then uses it anyway.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34008">Bug 34008</a> - r600g: piglit failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34009">Bug 34009</a> - Automatic Mipmap Generation produces very blurry image.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34042">Bug 34042</a> - Surfaceless eglMakeCurrent() fails if the supplied EGLContext is not a dummy context</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34049">Bug 34049</a> - r600g: assertion failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34119">Bug 34119</a> - [glsl] piglit glsl-texcoord-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34323">Bug 34323</a> - [i915 GLSL gles2] gl_FragCoord.w not correct</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34346">Bug 34346</a> - src/glsl relies on $PWD which can be unset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34378">Bug 34378</a> - st/mesa: 2a904fd6a0cb80eec6dec2bae07fd8778b04caf3 breaks sauerbraten</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34419">Bug 34419</a> - Kwin crashes screensaver exits</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34463">Bug 34463</a> - state_tracker/st_texture.c:370:st_texture_image_copy: Assertion `u_minify(src-&gt;width0, srcLevel) == width' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34468">Bug 34468</a> - src/glsl/Makefile fix</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34541">Bug 34541</a> - [ilk, wine] massive render corruption after recent patchset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34589">Bug 34589</a> - [pineview bisected]many cases regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34595">Bug 34595</a> - [bisected piketon]oglc half_float_vertex(misc.fillmode.wireframe) regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34597">Bug 34597</a> - [bisected piketon]oglc blend-constcolor and 7 draw-buffers2 subcases regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34603">Bug 34603</a> - [bisected piketon]oglc vbo subcase basic.bufferdata regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34604">Bug 34604</a> - [bisected piketon]piglit fbo/fbo-depth-sample-compare regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34646">Bug 34646</a> - [bisected piketon]ogles2conform GL2Tests/GL/gl_FragCoord/gl_FragCoord_w_frag.test</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34656">Bug 34656</a> - i965: Crash when running WebGL Conformance Test in firefox-4 nightly build</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34691">Bug 34691</a> - [GLSL] matrix array member assignment with a complex subscript fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34906">Bug 34906</a> - [Pineview] Some WebGL conformance tests will crash firefox</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34968">Bug 34968</a> - Bad fps in Lightsmark benchmark</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35025">Bug 35025</a> - [Patch] Serious compiler warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35312">Bug 35312</a> - r600g: Automatic mipmap generation doesn't work properly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35373">Bug 35373</a> - [[GM45] OpenGL] GL_EXT_texture_sRGB_decode broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35434">Bug 35434</a> - [RADEON:KMS:R600G] etqw: broken ground textures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35441">Bug 35441</a> - [PATCH] Mesa does not find nouveau include files with --enable-shared-dricore</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35614">Bug 35614</a> - [SNB] random hang on piglit case shaders/glsl-max-varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35820">Bug 35820</a> - [bisected SNB] System hangs when Gnome with compiz start up</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35822">Bug 35822</a> - [bisected pineview] many cases related to depth and stencil failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35849">Bug 35849</a> - when sampling textures from both fragment and vertex shaders the vertex texture has the incorrect texture bound</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35852">Bug 35852</a> - [bisected pineview] oglc case pxconv-read failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35961">Bug 35961</a> - src/gallium/auxiliary/util/u_draw.c:77:util_draw_max_index: Assertion `buffer_size - format_size &lt;= buffer_size' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36032">Bug 36032</a> - piglit fdo9833 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36033">Bug 36033</a> - main/shaderapi.c:1044: validate_samplers: Assertion `(sizeof(targetName)/sizeof(*(targetName))) == NUM_TEXTURE_TARGETS' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36086">Bug 36086</a> - [wine] Segfault r300_resource_copy_region with some wine apps and RADEON_HYPERZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36182">Bug 36182</a> - Game Trine from http://www.humblebundle.com/ needs ATI_draw_buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36268">Bug 36268</a> - [r300g, bisected] minor flickering in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36282">Bug 36282</a> - 34a5d3b9f4740601708c82093e2114356d749e65: glxgears segfaults when compiled with shared glapi</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36333">Bug 36333</a> - can't build demos if mesa build with --enable-selinux</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36473">Bug 36473</a> - [bisected] piglit bugs/fdo23670-depth_test failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36572">Bug 36572</a> - [bisected]oglc case texenv segfaults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36609">Bug 36609</a> - 45920d2ecb38b14fdda5253fecce996570c22863 breaks sauerbraten on r300g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36648">Bug 36648</a> - [bisected SNB]piglit fbo/fbo-alphatest-nocolor failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36649">Bug 36649</a> - [bisected SNB]oglc draw-buffers2 failed with 16-wide</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36753">Bug 36753</a> - Some textures now rendered as completely black after register allocator rewrite.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36821">Bug 36821</a> - [bisected SNB]oglc api-texcoord causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36914">Bug 36914</a> - r600g: add rv670 flushing workaround. Causes games and some mesa demos to segfault.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36917">Bug 36917</a> - Rendering glitches in ETQW</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36939">Bug 36939</a> - multitexturing is messed up in quake wars (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36987">Bug 36987</a> - Intel GMA 4500 ARB_shader_texture_lod support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37028">Bug 37028</a> - Amnesia/HPL2 Demo: Strange graphical bugs on r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37150">Bug 37150</a> - sRGB textures are too bright in Starcraft 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37154">Bug 37154</a> - main/texstore.c:4187: _mesa_texstore_rgb9_e5: Assertion `baseInternalFormat == 0x1907' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37157">Bug 37157</a> - [bisected] KDE KWin crashes on start with delayed BO mapping</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37168">Bug 37168</a> - Regression: Severe memory leak when running Second Life</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37366">Bug 37366</a> - [i965 bisected ILK] Fragment shader discard tests occasionally fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37383">Bug 37383</a> - incorrect GLSL optimization</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37476">Bug 37476</a> - [wine] Devil May Cry 4: TXD tgsi opcode unsupported / translation from TGSI failed / missing vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37743">Bug 37743</a> - [bisected i965]oglc GLSLlinker subcase negative.varying.beyondMaxVaryingFloats aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37766">Bug 37766</a> - Crash in dri2InvalidateBuffers when resizing Java window with OpenGL pipeline enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37839">Bug 37839</a> - main/teximage.c:2393: _mesa_choose_texture_format: Assertion `f != MESA_FORMAT_NONE' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37934">Bug 37934</a> - Corruption with topogun trace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38015">Bug 38015</a> - Some extensions enabled even when not supported by the underlying driver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38134">Bug 38134</a> - [bisected i965]piglit fbo/fbo-blit-d24s8 crashed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38145">Bug 38145</a> - r600g/evergreen: Incorrect rendering of some effects in doom3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38440">Bug 38440</a> - ETQW: Model in team select rendering too bright</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38566">Bug 38566</a> - [regression] ETQW crashes with 21972c85ea734dbfcf69629c6b0b940efb42d4ba</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38584">Bug 38584</a> - MESA_GLSL=dump causes SEGV in ir_print_visitor::unique_name</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38599">Bug 38599</a> - THe value of WGL_PBUFFER_HEIGHT_ARB is returned as width in wglQueryPbufferARB</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38602">Bug 38602</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38624">Bug 38624</a> - program/ir_to_mesa.cpp:1440: virtual void ir_to_mesa_visitor::visit(ir_dereference_variable*): Assertion `var-&gt;location != -1' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38626">Bug 38626</a> - vbo: Don't discount stride breaks piglit on softpipe/r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38649">Bug 38649</a> - piglit fbo-copyteximage regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38762">Bug 38762</a> - [IVB bisected]3D demos like glxgears abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38771">Bug 38771</a> - [[GM45] DRI] GPU hangs with current Mesa GIT when running certain OpenGL applications</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38842">Bug 38842</a> - Various valid GLX attributes are rejected by MESA glxChooseFBConfig</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38971">Bug 38971</a> - [bisected]oglc glsl-autointconv subcase negative.function.ambiguousMatch failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38987">Bug 38987</a> - sampler allowed as non-uniform / non-function parameters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39024">Bug 39024</a> - [Pineview webgl] many webgl conformance cases crash the browser</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39083">Bug 39083</a> - [regression, bisected, r600g] Wrong rendering of Bubbles3D screensaver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39119">Bug 39119</a> - setting SQ_LDS_RESOURCE_MGMT register to zero in other applications muddles up font rendering permanently</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39209">Bug 39209</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit - part2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39219">Bug 39219</a> - libgl conflict with xbmc causes lock up on xbmc exit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39257">Bug 39257</a> - [bisected SNB]Mesa demos engine causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39487">Bug 39487</a> - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw-&gt>has_surface_tile_offset || (tile_x == 0 &amp;&amp; tile_y == 0)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39515">Bug 39515</a> - FTBFS: libEGL depends on libgbm, but libEGL builds first</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39572">Bug 39572</a> - Cogs: GPU hang</li>
</ul> </ul>
<h2>Changes</h2> <h2>Changes</h2>
<ul> <ul>
<li>The Windows MSVC project files have been removed. They haven't been maintained <li>The Windows MSVC project files have been removed.
in quite a while. Building with SCons is an alterantive. They haven't been maintained in quite a while.
Building with SCons is an alternative.
<li>Removed GL_SGI_texture_color_table support from swrast driver - the only <li>Removed GL_SGI_texture_color_table support from swrast driver - the only
driver that implemented it. driver that implemented it.
</ul> </ul>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10..mesa-7.11
</pre>
</body> </body>
</html> </html>

View File

@@ -13,7 +13,10 @@ The release notes summarize what's new or changed in each Mesa release.
</p> </p>
<UL> <UL>
<LI><A HREF="relnotes-7.11.2.html">7.11.2 release notes</A>
<LI><A HREF="relnotes-7.11.1.html">7.11.1 release notes</A>
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A> <LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
<LI><A HREF="relnotes-7.10.3.html">7.10.3 release notes</A>
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A> <LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A> <LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A> <LI><A HREF="relnotes-7.10.html">7.10 release notes</A>

View File

@@ -131,6 +131,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
/* EGL_DRM_BUFFER_USE_MESA bits */ /* EGL_DRM_BUFFER_USE_MESA bits */
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001 #define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002 #define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */ #define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */ #define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */
@@ -151,10 +152,9 @@ struct wl_display;
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
#else
typedef EGLBoolean (EGLAPIENTRY PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRY PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif #endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif #endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ #if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */

View File

@@ -80,10 +80,16 @@ typedef void *EGLNativePixmapType;
#elif defined(WL_EGL_PLATFORM) #elif defined(WL_EGL_PLATFORM)
typedef struct wl_egl_display *EGLNativeDisplayType; typedef struct wl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType; typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType; typedef struct wl_egl_window *EGLNativeWindowType;
#elif defined(__GBM__)
typedef struct gbm_device *EGLNativeDisplayType;
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
#elif defined(__unix__) || defined(__unix) #elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS #ifdef MESA_EGL_NO_X11_HEADERS

View File

@@ -67,7 +67,7 @@
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern # define GLAPI extern
# define GLAPIENTRY __stdcall # define GLAPIENTRY __stdcall
#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) #elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define GLAPI __attribute__((visibility("default"))) # define GLAPI __attribute__((visibility("default")))
# define GLAPIENTRY # define GLAPIENTRY
#endif /* WIN32 && !CYGWIN */ #endif /* WIN32 && !CYGWIN */

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif #endif
/* /*
** Copyright (c) 2007-2010 The Khronos Group Inc. ** Copyright (c) 2007-2011 The Khronos Group Inc.
** **
** Permission is hereby granted, free of charge, to any person obtaining a ** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the ** copy of this software and/or associated documentation files (the
@@ -29,9 +29,9 @@ extern "C" {
*/ */
/* Header file version number, required by OpenGL ABI for Linux */ /* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-12-09 02:15:08 -0800 (Thu, 09 Dec 2010) $ */ /* glext.h last updated $Date: 2011-07-06 02:49:14 -0700 (Wed, 06 Jul 2011) $ */
/* Current version at http://www.opengl.org/registry/ */ /* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 67 #define GL_GLEXT_VERSION 71
/* Function declaration macros - to move into glplatform.h */ /* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -5032,6 +5032,32 @@ extern "C" {
#define GL_SKIP_DECODE_EXT 0x8A4A #define GL_SKIP_DECODE_EXT 0x8A4A
#endif #endif
#ifndef GL_NV_texture_multisample
#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_FACTOR_MIN_AMD 0x901C
#define GL_FACTOR_MAX_AMD 0x901D
#endif
#ifndef GL_AMD_sample_positions
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_SYNC_X11_FENCE_EXT 0x90E1
#endif
#ifndef GL_AMD_multi_draw_indirect
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
#endif
/*************************************************************/ /*************************************************************/
@@ -11041,6 +11067,58 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_EXT_texture_sRGB_decode 1 #define GL_EXT_texture_sRGB_decode 1
#endif #endif
#ifndef GL_NV_texture_multisample
#define GL_NV_texture_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_AMD_blend_minmax_factor 1
#endif
#ifndef GL_AMD_sample_positions
#define GL_AMD_sample_positions 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif
#ifndef GL_AMD_multi_draw_indirect
#define GL_AMD_multi_draw_indirect 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_EXT_framebuffer_multisample_blit_scaled 1
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -284,7 +284,7 @@ typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150 #define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */ /* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)(); typedef void (GLAPIENTRYP _GLUfuncptr)(void);
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);

View File

@@ -692,6 +692,7 @@ struct __DRIswrastExtensionRec {
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7 #define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8 #define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */ #define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
#define __DRI_BUFFER_HIZ 10
struct __DRIbufferRec { struct __DRIbufferRec {
unsigned int attachment; unsigned int attachment;
@@ -816,6 +817,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_USE_SHARE 0x0001 #define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002 #define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004
/** /**
* queryImage attributes * queryImage attributes
@@ -847,6 +849,11 @@ struct __DRIimageExtensionRec {
void *loaderPrivate); void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value); GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
/**
* The new __DRIimage will share the content with the old one, see dup(2).
*/
__DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
}; };

View File

@@ -0,0 +1,4 @@
CHIPSET(0x7121, I810, i8xx)
CHIPSET(0x7123, I810_DC100, i8xx)
CHIPSET(0x7125, I810_E, i8xx)
CHIPSET(0x1132, I815, i8xx)

View File

@@ -0,0 +1,15 @@
CHIPSET(0x3577, I830_M, i8xx)
CHIPSET(0x2562, 845_G, i8xx)
CHIPSET(0x3582, I855_GM, i8xx)
CHIPSET(0x2572, I865_G, i8xx)
CHIPSET(0x2582, I915_G, i915)
CHIPSET(0x258A, E7221_G, i915)
CHIPSET(0x2592, I915_GM, i915)
CHIPSET(0x2772, I945_G, i945)
CHIPSET(0x27A2, I945_GM, i945)
CHIPSET(0x27AE, I945_GME, i945)
CHIPSET(0x29B2, Q35_G, i945)
CHIPSET(0x29C2, G33_G, i945)
CHIPSET(0x29D2, Q33_G, i945)
CHIPSET(0xA011, IGD_GM, i945)
CHIPSET(0xA001, IGD_G, i945)

View File

@@ -0,0 +1,27 @@
CHIPSET(0x29A2, I965_G, i965)
CHIPSET(0x2992, I965_Q, i965)
CHIPSET(0x2982, I965_G_1, i965)
CHIPSET(0x2972, I946_GZ, i965)
CHIPSET(0x2A02, I965_GM, i965)
CHIPSET(0x2A12, I965_GME, i965)
CHIPSET(0x2A42, GM45_GM, g4x)
CHIPSET(0x2E02, IGD_E_G, g4x)
CHIPSET(0x2E12, Q45_G, g4x)
CHIPSET(0x2E22, G45_G, g4x)
CHIPSET(0x2E32, G41_G, g4x)
CHIPSET(0x2E42, B43_G, g4x)
CHIPSET(0x2E92, B43_G1, g4x)
CHIPSET(0x0042, ILD_G, ilk)
CHIPSET(0x0046, ILM_G, ilk)
CHIPSET(0x0102, SANDYBRIDGE_GT1, snb_gt1)
CHIPSET(0x0112, SANDYBRIDGE_GT2, snb_gt2)
CHIPSET(0x0122, SANDYBRIDGE_GT2_PLUS, snb_gt2)
CHIPSET(0x0106, SANDYBRIDGE_M_GT1, snb_gt1)
CHIPSET(0x0116, SANDYBRIDGE_M_GT2, snb_gt2)
CHIPSET(0x0126, SANDYBRIDGE_M_GT2_PLUS, snb_gt2)
CHIPSET(0x010A, SANDYBRIDGE_S, snb_gt1)
CHIPSET(0x0152, IVYBRIDGE_GT1, ivb_gt1)
CHIPSET(0x0162, IVYBRIDGE_GT2, ivb_gt2)
CHIPSET(0x0156, IVYBRIDGE_M_GT1, ivb_gt1)
CHIPSET(0x0166, IVYBRIDGE_M_GT2, ivb_gt2)
CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)

View File

@@ -0,0 +1,77 @@
#ifndef _PCI_ID_DRIVER_MAP_H_
#define _PCI_ID_DRIVER_MAP_H_
#include <stddef.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
static const int i810_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i810_pci_ids.h"
#undef CHIPSET
};
#endif
static const int i915_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i915_pci_ids.h"
#undef CHIPSET
};
static const int i965_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i965_pci_ids.h"
#undef CHIPSET
};
#ifndef DRIVER_MAP_GALLIUM_ONLY
static const int r100_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/radeon_pci_ids.h"
#undef CHIPSET
};
static const int r200_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r200_pci_ids.h"
#undef CHIPSET
};
#endif
static const int r300_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r300_pci_ids.h"
#undef CHIPSET
};
static const int r600_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r600_pci_ids.h"
#undef CHIPSET
};
static const struct {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
} driver_map[] = {
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
{ 0x8086, "i810", i810_chip_ids, ARRAY_SIZE(i810_chip_ids) },
#endif
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
#ifndef DRIVER_MAP_GALLIUM_ONLY
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
#endif
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
{ 0x0000, NULL, NULL, 0 },
};
#endif /* _PCI_ID_DRIVER_MAP_H_ */

View File

@@ -0,0 +1,22 @@
CHIPSET(0x5148, R200_QH, R200)
CHIPSET(0x514C, R200_QL, R200)
CHIPSET(0x514D, R200_QM, R200)
CHIPSET(0x4242, R200_BB, R200)
CHIPSET(0x4966, RV250_If, RV250)
CHIPSET(0x4967, RV250_Ig, RV250)
CHIPSET(0x4C64, RV250_Ld, RV250)
CHIPSET(0x4C66, RV250_Lf, RV250)
CHIPSET(0x4C67, RV250_Lg, RV250)
CHIPSET(0x5960, RV280_5960, RV280)
CHIPSET(0x5961, RV280_5961, RV280)
CHIPSET(0x5962, RV280_5962, RV280)
CHIPSET(0x5964, RV280_5964, RV280)
CHIPSET(0x5965, RV280_5965, RV280)
CHIPSET(0x5C61, RV280_5C61, RV280)
CHIPSET(0x5C63, RV280_5C63, RV280)
CHIPSET(0x5834, RS300_5834, RS300)
CHIPSET(0x5835, RS300_5835, RS300)
CHIPSET(0x7834, RS350_7834, RS300)
CHIPSET(0x7835, RS350_7835, RS300)

View File

@@ -0,0 +1,226 @@
CHIPSET(0x4144, R300_AD, R300)
CHIPSET(0x4145, R300_AE, R300)
CHIPSET(0x4146, R300_AF, R300)
CHIPSET(0x4147, R300_AG, R300)
CHIPSET(0x4E44, R300_ND, R300)
CHIPSET(0x4E45, R300_NE, R300)
CHIPSET(0x4E46, R300_NF, R300)
CHIPSET(0x4E47, R300_NG, R300)
CHIPSET(0x4E48, R350_NH, R350)
CHIPSET(0x4E49, R350_NI, R350)
CHIPSET(0x4E4B, R350_NK, R350)
CHIPSET(0x4148, R350_AH, R350)
CHIPSET(0x4149, R350_AI, R350)
CHIPSET(0x414A, R350_AJ, R350)
CHIPSET(0x414B, R350_AK, R350)
CHIPSET(0x4E4A, R360_NJ, R350)
CHIPSET(0x4150, RV350_AP, RV350)
CHIPSET(0x4151, RV350_AQ, RV350)
CHIPSET(0x4152, RV350_AR, RV350)
CHIPSET(0x4153, RV350_AS, RV350)
CHIPSET(0x4154, RV350_AT, RV350)
CHIPSET(0x4155, RV350_AU, RV350)
CHIPSET(0x4156, RV350_AV, RV350)
CHIPSET(0x4E50, RV350_NP, RV350)
CHIPSET(0x4E51, RV350_NQ, RV350)
CHIPSET(0x4E52, RV350_NR, RV350)
CHIPSET(0x4E53, RV350_NS, RV350)
CHIPSET(0x4E54, RV350_NT, RV350)
CHIPSET(0x4E56, RV350_NV, RV350)
CHIPSET(0x5460, RV370_5460, RV370)
CHIPSET(0x5462, RV370_5462, RV370)
CHIPSET(0x5464, RV370_5464, RV370)
CHIPSET(0x5B60, RV370_5B60, RV370)
CHIPSET(0x5B62, RV370_5B62, RV370)
CHIPSET(0x5B63, RV370_5B63, RV370)
CHIPSET(0x5B64, RV370_5B64, RV370)
CHIPSET(0x5B65, RV370_5B65, RV370)
CHIPSET(0x3150, RV380_3150, RV380)
CHIPSET(0x3152, RV380_3152, RV380)
CHIPSET(0x3154, RV380_3154, RV380)
CHIPSET(0x3155, RV380_3155, RV380)
CHIPSET(0x3E50, RV380_3E50, RV380)
CHIPSET(0x3E54, RV380_3E54, RV380)
CHIPSET(0x4A48, R420_JH, R420)
CHIPSET(0x4A49, R420_JI, R420)
CHIPSET(0x4A4A, R420_JJ, R420)
CHIPSET(0x4A4B, R420_JK, R420)
CHIPSET(0x4A4C, R420_JL, R420)
CHIPSET(0x4A4D, R420_JM, R420)
CHIPSET(0x4A4E, R420_JN, R420)
CHIPSET(0x4A4F, R420_JO, R420)
CHIPSET(0x4A50, R420_JP, R420)
CHIPSET(0x4A54, R420_JT, R420)
CHIPSET(0x5548, R423_UH, R423)
CHIPSET(0x5549, R423_UI, R423)
CHIPSET(0x554A, R423_UJ, R423)
CHIPSET(0x554B, R423_UK, R423)
CHIPSET(0x5550, R423_5550, R423)
CHIPSET(0x5551, R423_UQ, R423)
CHIPSET(0x5552, R423_UR, R423)
CHIPSET(0x5554, R423_UT, R423)
CHIPSET(0x5D57, R423_5D57, R423)
CHIPSET(0x554C, R430_554C, R430)
CHIPSET(0x554D, R430_554D, R430)
CHIPSET(0x554E, R430_554E, R430)
CHIPSET(0x554F, R430_554F, R430)
CHIPSET(0x5D48, R430_5D48, R430)
CHIPSET(0x5D49, R430_5D49, R430)
CHIPSET(0x5D4A, R430_5D4A, R430)
CHIPSET(0x5D4C, R480_5D4C, R480)
CHIPSET(0x5D4D, R480_5D4D, R480)
CHIPSET(0x5D4E, R480_5D4E, R480)
CHIPSET(0x5D4F, R480_5D4F, R480)
CHIPSET(0x5D50, R480_5D50, R480)
CHIPSET(0x5D52, R480_5D52, R480)
CHIPSET(0x4B48, R481_4B48, R481)
CHIPSET(0x4B49, R481_4B49, R481)
CHIPSET(0x4B4A, R481_4B4A, R481)
CHIPSET(0x4B4B, R481_4B4B, R481)
CHIPSET(0x4B4C, R481_4B4C, R481)
CHIPSET(0x564A, RV410_564A, RV410)
CHIPSET(0x564B, RV410_564B, RV410)
CHIPSET(0x564F, RV410_564F, RV410)
CHIPSET(0x5652, RV410_5652, RV410)
CHIPSET(0x5653, RV410_5653, RV410)
CHIPSET(0x5657, RV410_5657, RV410)
CHIPSET(0x5E48, RV410_5E48, RV410)
CHIPSET(0x5E4A, RV410_5E4A, RV410)
CHIPSET(0x5E4B, RV410_5E4B, RV410)
CHIPSET(0x5E4C, RV410_5E4C, RV410)
CHIPSET(0x5E4D, RV410_5E4D, RV410)
CHIPSET(0x5E4F, RV410_5E4F, RV410)
CHIPSET(0x5A41, RS400_5A41, RS400)
CHIPSET(0x5A42, RS400_5A42, RS400)
CHIPSET(0x5A61, RC410_5A61, RC410)
CHIPSET(0x5A62, RC410_5A62, RC410)
CHIPSET(0x5954, RS480_5954, RS480)
CHIPSET(0x5955, RS480_5955, RS480)
CHIPSET(0x5974, RS482_5974, RS480)
CHIPSET(0x5975, RS482_5975, RS480)
CHIPSET(0x7100, R520_7100, R520)
CHIPSET(0x7101, R520_7101, R520)
CHIPSET(0x7102, R520_7102, R520)
CHIPSET(0x7103, R520_7103, R520)
CHIPSET(0x7104, R520_7104, R520)
CHIPSET(0x7105, R520_7105, R520)
CHIPSET(0x7106, R520_7106, R520)
CHIPSET(0x7108, R520_7108, R520)
CHIPSET(0x7109, R520_7109, R520)
CHIPSET(0x710A, R520_710A, R520)
CHIPSET(0x710B, R520_710B, R520)
CHIPSET(0x710C, R520_710C, R520)
CHIPSET(0x710E, R520_710E, R520)
CHIPSET(0x710F, R520_710F, R520)
CHIPSET(0x7140, RV515_7140, RV515)
CHIPSET(0x7141, RV515_7141, RV515)
CHIPSET(0x7142, RV515_7142, RV515)
CHIPSET(0x7143, RV515_7143, RV515)
CHIPSET(0x7144, RV515_7144, RV515)
CHIPSET(0x7145, RV515_7145, RV515)
CHIPSET(0x7146, RV515_7146, RV515)
CHIPSET(0x7147, RV515_7147, RV515)
CHIPSET(0x7149, RV515_7149, RV515)
CHIPSET(0x714A, RV515_714A, RV515)
CHIPSET(0x714B, RV515_714B, RV515)
CHIPSET(0x714C, RV515_714C, RV515)
CHIPSET(0x714D, RV515_714D, RV515)
CHIPSET(0x714E, RV515_714E, RV515)
CHIPSET(0x714F, RV515_714F, RV515)
CHIPSET(0x7151, RV515_7151, RV515)
CHIPSET(0x7152, RV515_7152, RV515)
CHIPSET(0x7153, RV515_7153, RV515)
CHIPSET(0x715E, RV515_715E, RV515)
CHIPSET(0x715F, RV515_715F, RV515)
CHIPSET(0x7180, RV515_7180, RV515)
CHIPSET(0x7181, RV515_7181, RV515)
CHIPSET(0x7183, RV515_7183, RV515)
CHIPSET(0x7186, RV515_7186, RV515)
CHIPSET(0x7187, RV515_7187, RV515)
CHIPSET(0x7188, RV515_7188, RV515)
CHIPSET(0x718A, RV515_718A, RV515)
CHIPSET(0x718B, RV515_718B, RV515)
CHIPSET(0x718C, RV515_718C, RV515)
CHIPSET(0x718D, RV515_718D, RV515)
CHIPSET(0x718F, RV515_718F, RV515)
CHIPSET(0x7193, RV515_7193, RV515)
CHIPSET(0x7196, RV515_7196, RV515)
CHIPSET(0x719B, RV515_719B, RV515)
CHIPSET(0x719F, RV515_719F, RV515)
CHIPSET(0x7200, RV515_7200, RV515)
CHIPSET(0x7210, RV515_7210, RV515)
CHIPSET(0x7211, RV515_7211, RV515)
CHIPSET(0x71C0, RV530_71C0, RV530)
CHIPSET(0x71C1, RV530_71C1, RV530)
CHIPSET(0x71C2, RV530_71C2, RV530)
CHIPSET(0x71C3, RV530_71C3, RV530)
CHIPSET(0x71C4, RV530_71C4, RV530)
CHIPSET(0x71C5, RV530_71C5, RV530)
CHIPSET(0x71C6, RV530_71C6, RV530)
CHIPSET(0x71C7, RV530_71C7, RV530)
CHIPSET(0x71CD, RV530_71CD, RV530)
CHIPSET(0x71CE, RV530_71CE, RV530)
CHIPSET(0x71D2, RV530_71D2, RV530)
CHIPSET(0x71D4, RV530_71D4, RV530)
CHIPSET(0x71D5, RV530_71D5, RV530)
CHIPSET(0x71D6, RV530_71D6, RV530)
CHIPSET(0x71DA, RV530_71DA, RV530)
CHIPSET(0x71DE, RV530_71DE, RV530)
CHIPSET(0x7281, RV560_7281, RV560)
CHIPSET(0x7283, RV560_7283, RV560)
CHIPSET(0x7287, RV560_7287, RV560)
CHIPSET(0x7290, RV560_7290, RV560)
CHIPSET(0x7291, RV560_7291, RV560)
CHIPSET(0x7293, RV560_7293, RV560)
CHIPSET(0x7297, RV560_7297, RV560)
CHIPSET(0x7280, RV570_7280, RV570)
CHIPSET(0x7288, RV570_7288, RV570)
CHIPSET(0x7289, RV570_7289, RV570)
CHIPSET(0x728B, RV570_728B, RV570)
CHIPSET(0x728C, RV570_728C, RV570)
CHIPSET(0x7240, R580_7240, R580)
CHIPSET(0x7243, R580_7243, R580)
CHIPSET(0x7244, R580_7244, R580)
CHIPSET(0x7245, R580_7245, R580)
CHIPSET(0x7246, R580_7246, R580)
CHIPSET(0x7247, R580_7247, R580)
CHIPSET(0x7248, R580_7248, R580)
CHIPSET(0x7249, R580_7249, R580)
CHIPSET(0x724A, R580_724A, R580)
CHIPSET(0x724B, R580_724B, R580)
CHIPSET(0x724C, R580_724C, R580)
CHIPSET(0x724D, R580_724D, R580)
CHIPSET(0x724E, R580_724E, R580)
CHIPSET(0x724F, R580_724F, R580)
CHIPSET(0x7284, R580_7284, R580)
CHIPSET(0x793F, RS600_793F, RS600)
CHIPSET(0x7941, RS600_7941, RS600)
CHIPSET(0x7942, RS600_7942, RS600)
CHIPSET(0x791E, RS690_791E, RS690)
CHIPSET(0x791F, RS690_791F, RS690)
CHIPSET(0x796C, RS740_796C, RS740)
CHIPSET(0x796D, RS740_796D, RS740)
CHIPSET(0x796E, RS740_796E, RS740)
CHIPSET(0x796F, RS740_796F, RS740)

View File

@@ -0,0 +1,265 @@
CHIPSET(0x9400, R600_9400, R600)
CHIPSET(0x9401, R600_9401, R600)
CHIPSET(0x9402, R600_9402, R600)
CHIPSET(0x9403, R600_9403, R600)
CHIPSET(0x9405, R600_9405, R600)
CHIPSET(0x940A, R600_940A, R600)
CHIPSET(0x940B, R600_940B, R600)
CHIPSET(0x940F, R600_940F, R600)
CHIPSET(0x94C0, RV610_94C0, RV610)
CHIPSET(0x94C1, RV610_94C1, RV610)
CHIPSET(0x94C3, RV610_94C3, RV610)
CHIPSET(0x94C4, RV610_94C4, RV610)
CHIPSET(0x94C5, RV610_94C5, RV610)
CHIPSET(0x94C6, RV610_94C6, RV610)
CHIPSET(0x94C7, RV610_94C7, RV610)
CHIPSET(0x94C8, RV610_94C8, RV610)
CHIPSET(0x94C9, RV610_94C9, RV610)
CHIPSET(0x94CB, RV610_94CB, RV610)
CHIPSET(0x94CC, RV610_94CC, RV610)
CHIPSET(0x94CD, RV610_94CD, RV610)
CHIPSET(0x9580, RV630_9580, RV630)
CHIPSET(0x9581, RV630_9581, RV630)
CHIPSET(0x9583, RV630_9583, RV630)
CHIPSET(0x9586, RV630_9586, RV630)
CHIPSET(0x9587, RV630_9587, RV630)
CHIPSET(0x9588, RV630_9588, RV630)
CHIPSET(0x9589, RV630_9589, RV630)
CHIPSET(0x958A, RV630_958A, RV630)
CHIPSET(0x958B, RV630_958B, RV630)
CHIPSET(0x958C, RV630_958C, RV630)
CHIPSET(0x958D, RV630_958D, RV630)
CHIPSET(0x958E, RV630_958E, RV630)
CHIPSET(0x958F, RV630_958F, RV630)
CHIPSET(0x9500, RV670_9500, RV670)
CHIPSET(0x9501, RV670_9501, RV670)
CHIPSET(0x9504, RV670_9504, RV670)
CHIPSET(0x9505, RV670_9505, RV670)
CHIPSET(0x9506, RV670_9506, RV670)
CHIPSET(0x9507, RV670_9507, RV670)
CHIPSET(0x9508, RV670_9508, RV670)
CHIPSET(0x9509, RV670_9509, RV670)
CHIPSET(0x950F, RV670_950F, RV670)
CHIPSET(0x9511, RV670_9511, RV670)
CHIPSET(0x9515, RV670_9515, RV670)
CHIPSET(0x9517, RV670_9517, RV670)
CHIPSET(0x9519, RV670_9519, RV670)
CHIPSET(0x95C0, RV620_95C0, RV620)
CHIPSET(0x95C2, RV620_95C2, RV620)
CHIPSET(0x95C4, RV620_95C4, RV620)
CHIPSET(0x95C5, RV620_95C5, RV620)
CHIPSET(0x95C6, RV620_95C6, RV620)
CHIPSET(0x95C7, RV620_95C7, RV620)
CHIPSET(0x95C9, RV620_95C9, RV620)
CHIPSET(0x95CC, RV620_95CC, RV620)
CHIPSET(0x95CD, RV620_95CD, RV620)
CHIPSET(0x95CE, RV620_95CE, RV620)
CHIPSET(0x95CF, RV620_95CF, RV620)
CHIPSET(0x9590, RV635_9590, RV635)
CHIPSET(0x9591, RV635_9591, RV635)
CHIPSET(0x9593, RV635_9593, RV635)
CHIPSET(0x9595, RV635_9595, RV635)
CHIPSET(0x9596, RV635_9596, RV635)
CHIPSET(0x9597, RV635_9597, RV635)
CHIPSET(0x9598, RV635_9598, RV635)
CHIPSET(0x9599, RV635_9599, RV635)
CHIPSET(0x959B, RV635_959B, RV635)
CHIPSET(0x9610, RS780_9610, RS780)
CHIPSET(0x9611, RS780_9611, RS780)
CHIPSET(0x9612, RS780_9612, RS780)
CHIPSET(0x9613, RS780_9613, RS780)
CHIPSET(0x9614, RS780_9614, RS780)
CHIPSET(0x9615, RS780_9615, RS780)
CHIPSET(0x9616, RS780_9616, RS780)
CHIPSET(0x9710, RS880_9710, RS880)
CHIPSET(0x9711, RS880_9711, RS880)
CHIPSET(0x9712, RS880_9712, RS880)
CHIPSET(0x9713, RS880_9713, RS880)
CHIPSET(0x9714, RS880_9714, RS880)
CHIPSET(0x9715, RS880_9715, RS880)
CHIPSET(0x9440, RV770_9440, RV770)
CHIPSET(0x9441, RV770_9441, RV770)
CHIPSET(0x9442, RV770_9442, RV770)
CHIPSET(0x9443, RV770_9443, RV770)
CHIPSET(0x9444, RV770_9444, RV770)
CHIPSET(0x9446, RV770_9446, RV770)
CHIPSET(0x944A, RV770_944A, RV770)
CHIPSET(0x944B, RV770_944B, RV770)
CHIPSET(0x944C, RV770_944C, RV770)
CHIPSET(0x944E, RV770_944E, RV770)
CHIPSET(0x9450, RV770_9450, RV770)
CHIPSET(0x9452, RV770_9452, RV770)
CHIPSET(0x9456, RV770_9456, RV770)
CHIPSET(0x945A, RV770_945A, RV770)
CHIPSET(0x945B, RV770_945B, RV770)
CHIPSET(0x945E, RV770_945E, RV770)
CHIPSET(0x9460, RV790_9460, RV770)
CHIPSET(0x9462, RV790_9462, RV770)
CHIPSET(0x946A, RV770_946A, RV770)
CHIPSET(0x946B, RV770_946B, RV770)
CHIPSET(0x947A, RV770_947A, RV770)
CHIPSET(0x947B, RV770_947B, RV770)
CHIPSET(0x9480, RV730_9480, RV730)
CHIPSET(0x9487, RV730_9487, RV730)
CHIPSET(0x9488, RV730_9488, RV730)
CHIPSET(0x9489, RV730_9489, RV730)
CHIPSET(0x948A, RV730_948A, RV730)
CHIPSET(0x948F, RV730_948F, RV730)
CHIPSET(0x9490, RV730_9490, RV730)
CHIPSET(0x9491, RV730_9491, RV730)
CHIPSET(0x9495, RV730_9495, RV730)
CHIPSET(0x9498, RV730_9498, RV730)
CHIPSET(0x949C, RV730_949C, RV730)
CHIPSET(0x949E, RV730_949E, RV730)
CHIPSET(0x949F, RV730_949F, RV730)
CHIPSET(0x9540, RV710_9540, RV710)
CHIPSET(0x9541, RV710_9541, RV710)
CHIPSET(0x9542, RV710_9542, RV710)
CHIPSET(0x954E, RV710_954E, RV710)
CHIPSET(0x954F, RV710_954F, RV710)
CHIPSET(0x9552, RV710_9552, RV710)
CHIPSET(0x9553, RV710_9553, RV710)
CHIPSET(0x9555, RV710_9555, RV710)
CHIPSET(0x9557, RV710_9557, RV710)
CHIPSET(0x955F, RV710_955F, RV710)
CHIPSET(0x94A0, RV740_94A0, RV740)
CHIPSET(0x94A1, RV740_94A1, RV740)
CHIPSET(0x94A3, RV740_94A3, RV740)
CHIPSET(0x94B1, RV740_94B1, RV740)
CHIPSET(0x94B3, RV740_94B3, RV740)
CHIPSET(0x94B4, RV740_94B4, RV740)
CHIPSET(0x94B5, RV740_94B5, RV740)
CHIPSET(0x94B9, RV740_94B9, RV740)
CHIPSET(0x68E0, CEDAR_68E0, CEDAR)
CHIPSET(0x68E1, CEDAR_68E1, CEDAR)
CHIPSET(0x68E4, CEDAR_68E4, CEDAR)
CHIPSET(0x68E5, CEDAR_68E5, CEDAR)
CHIPSET(0x68E8, CEDAR_68E8, CEDAR)
CHIPSET(0x68E9, CEDAR_68E9, CEDAR)
CHIPSET(0x68F1, CEDAR_68F1, CEDAR)
CHIPSET(0x68F2, CEDAR_68F2, CEDAR)
CHIPSET(0x68F8, CEDAR_68F8, CEDAR)
CHIPSET(0x68F9, CEDAR_68F9, CEDAR)
CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
CHIPSET(0x68D9, REDWOOD_68D9, REDWOOD)
CHIPSET(0x68DA, REDWOOD_68DA, REDWOOD)
CHIPSET(0x68DE, REDWOOD_68DE, REDWOOD)
CHIPSET(0x68A0, JUNIPER_68A0, JUNIPER)
CHIPSET(0x68A1, JUNIPER_68A1, JUNIPER)
CHIPSET(0x68A8, JUNIPER_68A8, JUNIPER)
CHIPSET(0x68A9, JUNIPER_68A9, JUNIPER)
CHIPSET(0x68B0, JUNIPER_68B0, JUNIPER)
CHIPSET(0x68B8, JUNIPER_68B8, JUNIPER)
CHIPSET(0x68B9, JUNIPER_68B9, JUNIPER)
CHIPSET(0x68BA, JUNIPER_68BA, JUNIPER)
CHIPSET(0x68BE, JUNIPER_68BE, JUNIPER)
CHIPSET(0x68BF, JUNIPER_68BF, JUNIPER)
CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)
CHIPSET(0x689E, CYPRESS_689E, CYPRESS)
CHIPSET(0x689C, HEMLOCK_689C, HEMLOCK)
CHIPSET(0x689D, HEMLOCK_689D, HEMLOCK)
CHIPSET(0x9802, PALM_9802, PALM)
CHIPSET(0x9803, PALM_9803, PALM)
CHIPSET(0x9804, PALM_9804, PALM)
CHIPSET(0x9805, PALM_9805, PALM)
CHIPSET(0x9806, PALM_9806, PALM)
CHIPSET(0x9807, PALM_9807, PALM)
CHIPSET(0x9640, SUMO_9640, SUMO)
CHIPSET(0x9641, SUMO_9641, SUMO)
CHIPSET(0x9642, SUMO2_9642, SUMO2)
CHIPSET(0x9643, SUMO2_9643, SUMO2)
CHIPSET(0x9644, SUMO2_9644, SUMO2)
CHIPSET(0x9645, SUMO2_9645, SUMO2)
CHIPSET(0x9647, SUMO_9647, SUMO)
CHIPSET(0x9648, SUMO_9648, SUMO)
CHIPSET(0x964a, SUMO_964A, SUMO)
CHIPSET(0x964e, SUMO_964E, SUMO)
CHIPSET(0x964f, SUMO_964F, SUMO)
#ifndef RADEON_CLASSIC
CHIPSET(0x6700, CAYMAN_6700, CAYMAN)
CHIPSET(0x6701, CAYMAN_6701, CAYMAN)
CHIPSET(0x6702, CAYMAN_6702, CAYMAN)
CHIPSET(0x6703, CAYMAN_6703, CAYMAN)
CHIPSET(0x6704, CAYMAN_6704, CAYMAN)
CHIPSET(0x6705, CAYMAN_6705, CAYMAN)
CHIPSET(0x6706, CAYMAN_6706, CAYMAN)
CHIPSET(0x6707, CAYMAN_6707, CAYMAN)
CHIPSET(0x6708, CAYMAN_6708, CAYMAN)
CHIPSET(0x6709, CAYMAN_6709, CAYMAN)
CHIPSET(0x6718, CAYMAN_6718, CAYMAN)
CHIPSET(0x6719, CAYMAN_6719, CAYMAN)
CHIPSET(0x671C, CAYMAN_671C, CAYMAN)
CHIPSET(0x671D, CAYMAN_671D, CAYMAN)
CHIPSET(0x671F, CAYMAN_671F, CAYMAN)
#endif
CHIPSET(0x6720, BARTS_6720, BARTS)
CHIPSET(0x6721, BARTS_6721, BARTS)
CHIPSET(0x6722, BARTS_6722, BARTS)
CHIPSET(0x6723, BARTS_6723, BARTS)
CHIPSET(0x6724, BARTS_6724, BARTS)
CHIPSET(0x6725, BARTS_6725, BARTS)
CHIPSET(0x6726, BARTS_6726, BARTS)
CHIPSET(0x6727, BARTS_6727, BARTS)
CHIPSET(0x6728, BARTS_6728, BARTS)
CHIPSET(0x6729, BARTS_6729, BARTS)
CHIPSET(0x6738, BARTS_6738, BARTS)
CHIPSET(0x6739, BARTS_6739, BARTS)
CHIPSET(0x673E, BARTS_673E, BARTS)
CHIPSET(0x6740, TURKS_6740, TURKS)
CHIPSET(0x6741, TURKS_6741, TURKS)
CHIPSET(0x6742, TURKS_6742, TURKS)
CHIPSET(0x6743, TURKS_6743, TURKS)
CHIPSET(0x6744, TURKS_6744, TURKS)
CHIPSET(0x6745, TURKS_6745, TURKS)
CHIPSET(0x6746, TURKS_6746, TURKS)
CHIPSET(0x6747, TURKS_6747, TURKS)
CHIPSET(0x6748, TURKS_6748, TURKS)
CHIPSET(0x6749, TURKS_6749, TURKS)
CHIPSET(0x6750, TURKS_6750, TURKS)
CHIPSET(0x6758, TURKS_6758, TURKS)
CHIPSET(0x6759, TURKS_6759, TURKS)
CHIPSET(0x675F, TURKS_675F, TURKS)
CHIPSET(0x6760, CAICOS_6760, CAICOS)
CHIPSET(0x6761, CAICOS_6761, CAICOS)
CHIPSET(0x6762, CAICOS_6762, CAICOS)
CHIPSET(0x6763, CAICOS_6763, CAICOS)
CHIPSET(0x6764, CAICOS_6764, CAICOS)
CHIPSET(0x6765, CAICOS_6765, CAICOS)
CHIPSET(0x6766, CAICOS_6766, CAICOS)
CHIPSET(0x6767, CAICOS_6767, CAICOS)
CHIPSET(0x6768, CAICOS_6768, CAICOS)
CHIPSET(0x6770, CAICOS_6770, CAICOS)
CHIPSET(0x6778, CAICOS_6778, CAICOS)
CHIPSET(0x6779, CAICOS_6779, CAICOS)

View File

@@ -0,0 +1,23 @@
CHIPSET(0x4C57, RADEON_LW, RV200)
CHIPSET(0x4C58, RADEON_LX, RV200)
CHIPSET(0x4C59, RADEON_LY, RV100)
CHIPSET(0x4C5A, RADEON_LZ, RV100)
CHIPSET(0x5144, RADEON_QD, R100)
CHIPSET(0x5145, RADEON_QE, R100)
CHIPSET(0x5146, RADEON_QF, R100)
CHIPSET(0x5147, RADEON_QG, R100)
CHIPSET(0x5159, RADEON_QY, RV100)
CHIPSET(0x515A, RADEON_QZ, RV100)
CHIPSET(0x5157, RV200_QW, RV200)
CHIPSET(0x5158, RV200_QX, RV200)
CHIPSET(0x515E, RN50_515E, UNKNOWN)
CHIPSET(0x5969, RN50_5969, UNKNOWN)
CHIPSET(0x4136, RS100_4136, RS100)
CHIPSET(0x4336, RS100_4336, RS100)
CHIPSET(0x4137, RS200_4137, RS200)
CHIPSET(0x4337, RS200_4337, RS200)
CHIPSET(0x4237, RS250_4237, RS200)
CHIPSET(0x4437, RS250_4437, RS200)

View File

@@ -59,6 +59,7 @@ def quietCommandLines(env):
env['LEXCOMSTR'] = " Generating $TARGET ..." env['LEXCOMSTR'] = " Generating $TARGET ..."
env['YACCCOMSTR'] = " Generating $TARGET ..." env['YACCCOMSTR'] = " Generating $TARGET ..."
env['CODEGENCOMSTR'] = " Generating $TARGET ..." env['CODEGENCOMSTR'] = " Generating $TARGET ..."
env['INSTALLSTR'] = " Installing $TARGET ..."
def createConvenienceLibBuilder(env): def createConvenienceLibBuilder(env):
@@ -156,7 +157,8 @@ def createCodeGenerateMethod(env):
def generate(env): def generate(env):
"""Common environment generation code""" """Common environment generation code"""
if env.get('quiet', True): verbose = env.get('verbose', False) or not env.get('quiet', True)
if not verbose:
quietCommandLines(env) quietCommandLines(env)
# Custom builders and methods # Custom builders and methods

View File

@@ -74,7 +74,7 @@ def install_shared_library(env, sources, version = ()):
while len(version): while len(version):
version = version[:-1] version = version[:-1]
target_name = '.'.join((str(source),) + version) target_name = '.'.join((str(source),) + version)
action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE") action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
last = env.Command(os.path.join(target_dir, target_name), last, action) last = env.Command(os.path.join(target_dir, target_name), last, action)
targets += last targets += last
return targets return targets
@@ -247,6 +247,8 @@ def generate(env):
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir = 'build' build_topdir = 'build'
build_subdir = env['platform'] build_subdir = env['platform']
if env['embedded']:
build_subdir = 'embedded-' + build_subdir
if env['machine'] != 'generic': if env['machine'] != 'generic':
build_subdir += '-' + env['machine'] build_subdir += '-' + env['machine']
if env['build'] != 'release': if env['build'] != 'release':
@@ -277,6 +279,18 @@ def generate(env):
cppdefines += ['NDEBUG'] cppdefines += ['NDEBUG']
if env['build'] == 'profile': if env['build'] == 'profile':
cppdefines += ['PROFILE'] cppdefines += ['PROFILE']
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
cppdefines += [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
]
if env['platform'] == 'darwin':
cppdefines += ['_DARWIN_C_SOURCE']
if platform == 'windows': if platform == 'windows':
cppdefines += [ cppdefines += [
'WIN32', 'WIN32',
@@ -349,8 +363,8 @@ def generate(env):
if platform == 'wince': if platform == 'wince':
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE'] cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL'] cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
if platform == 'embedded': if env['embedded']:
cppdefines += ['PIPE_OS_EMBEDDED'] cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
env.Append(CPPDEFINES = cppdefines) env.Append(CPPDEFINES = cppdefines)
# C compiler options # C compiler options
@@ -403,6 +417,8 @@ def generate(env):
ccflags += ['-m64'] ccflags += ['-m64']
if platform == 'darwin': if platform == 'darwin':
ccflags += ['-fno-common'] ccflags += ['-fno-common']
if env['platform'] != 'windows':
ccflags += ['-fvisibility=hidden']
# See also: # See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
ccflags += [ ccflags += [
@@ -595,7 +611,10 @@ def generate(env):
env['LINK'] = env['CXX'] env['LINK'] = env['CXX']
# Default libs # Default libs
env.Append(LIBS = []) libs = []
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
# Load tools # Load tools
env.Tool('lex') env.Tool('lex')

View File

@@ -23,6 +23,7 @@ SConscript('mapi/vgapi/SConscript')
if env['platform'] != 'embedded': if env['platform'] != 'embedded':
SConscript('egl/main/SConscript') SConscript('egl/main/SConscript')
SConscript('glu/sgi/SConscript')
SConscript('glut/glx/SConscript') SConscript('glut/glx/SConscript')
if env['gles']: if env['gles']:

View File

@@ -4,18 +4,19 @@ TOP = ../../../..
include $(TOP)/configs/current include $(TOP)/configs/current
EGL_DRIVER = egl_dri2 EGL_DRIVER = egl_dri2
EGL_SOURCES = egl_dri2.c platform_x11.c platform_drm.c EGL_SOURCES = egl_dri2.c common.c
EGL_INCLUDES = \ EGL_INCLUDES = \
-I$(TOP)/include \ -I$(TOP)/include \
-I$(TOP)/src/egl/main \ -I$(TOP)/src/egl/main \
-I$(TOP)/src/mapi \ -I$(TOP)/src/mapi \
-I$(TOP)/src/gbm/main \
-I$(TOP)/src/gbm/backends/dri \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
$(XCB_DRI2_CFLAGS) \
$(LIBUDEV_CFLAGS) \ $(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS) $(LIBDRM_CFLAGS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) EGL_LIBS = $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2 EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true EGL_BUILTIN = true
@@ -24,6 +25,17 @@ ifeq ($(SHARED_GLAPI),1)
EGL_CFLAGS += -DHAVE_SHARED_GLAPI EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif endif
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_x11.c
EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
EGL_LIBS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_drm.c
EGL_INCLUDES += -DHAVE_DRM_PLATFORM
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \ EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \

View File

@@ -0,0 +1,144 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
#define DRIVER_MAP_DRI2_ONLY
#include "pci_ids/pci_id_driver_map.h"
#include <libudev.h>
static struct udev_device *
dri2_udev_device_new_from_fd(struct udev *udev, int fd)
{
struct udev_device *device;
struct stat buf;
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
return NULL;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
return NULL;
}
return device;
}
char *
dri2_get_device_name_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device;
const char *const_device_name;
char *device_name = NULL;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
const_device_name = udev_device_get_devnode(device);
if (!const_device_name)
goto out;
device_name = strdup(const_device_name);
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
}
char *
dri2_get_driver_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device, *parent;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL ||
sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; driver_map[i].driver; i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
#endif /* HAVE_LIBUDEV */

View File

@@ -97,6 +97,18 @@ EGLint dri2_to_egl_attribute_map[] = {
0, /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */ 0, /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */
}; };
static EGLBoolean
dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
{
if (_eglCompareConfigs(conf, criteria, NULL, EGL_FALSE) != 0)
return EGL_FALSE;
if (!_eglMatchConfig(conf, criteria))
return EGL_FALSE;
return EGL_TRUE;
}
struct dri2_egl_config * struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list) int depth, EGLint surface_type, const EGLint *attr_list)
@@ -190,7 +202,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
base.ConfigID = EGL_DONT_CARE; base.ConfigID = EGL_DONT_CARE;
base.SurfaceType = EGL_DONT_CARE; base.SurfaceType = EGL_DONT_CARE;
num_configs = _eglFilterArray(disp->Configs, (void **) &matching_config, 1, num_configs = _eglFilterArray(disp->Configs, (void **) &matching_config, 1,
(_EGLArrayForEach) _eglMatchConfig, &base); (_EGLArrayForEach) dri2_match_config, &base);
if (num_configs == 1) { if (num_configs == 1) {
conf = (struct dri2_egl_config *) matching_config; conf = (struct dri2_egl_config *) matching_config;
@@ -200,13 +212,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
else if (!double_buffer && !conf->dri_single_config) else if (!double_buffer && !conf->dri_single_config)
conf->dri_single_config = dri_config; conf->dri_single_config = dri_config;
else else
/* a similar config type is already added /* a similar config type is already added (unlikely) => discard */
* => attach it as new config return NULL;
*/
num_configs = 0;
} }
else if (num_configs == 0) {
if (num_configs == 0) {
conf = malloc(sizeof *conf); conf = malloc(sizeof *conf);
if (conf == NULL) if (conf == NULL)
return NULL; return NULL;
@@ -224,6 +233,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
_eglLinkConfig(&conf->base); _eglLinkConfig(&conf->base);
} }
else {
assert(0);
return NULL;
}
conf->base.SurfaceType |= surface_type & (!double_buffer ? EGL_PIXMAP_BIT: conf->base.SurfaceType |= surface_type & (!double_buffer ? EGL_PIXMAP_BIT:
(EGL_WINDOW_BIT | EGL_PBUFFER_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT)); (EGL_WINDOW_BIT | EGL_PBUFFER_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT));
@@ -231,7 +244,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
return conf; return conf;
} }
static __DRIimage * __DRIimage *
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data) dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
{ {
_EGLDisplay *disp = data; _EGLDisplay *disp = data;
@@ -321,8 +334,8 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
return ret; return ret;
} }
EGLBoolean static const __DRIextension **
dri2_load_driver(_EGLDisplay *disp) dri2_open_driver(_EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy = disp->DriverData; struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions; const __DRIextension **extensions;
@@ -361,9 +374,9 @@ dri2_load_driver(_EGLDisplay *disp)
if (dri2_dpy->driver == NULL) { if (dri2_dpy->driver == NULL) {
_eglLog(_EGL_WARNING, _eglLog(_EGL_WARNING,
"DRI2: failed to open any driver (search paths %s)", "DRI2: failed to open %s (search paths %s)",
search_paths); dri2_dpy->driver_name, search_paths);
return EGL_FALSE; return NULL;
} }
_eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path); _eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path);
@@ -372,59 +385,59 @@ dri2_load_driver(_EGLDisplay *disp)
_eglLog(_EGL_WARNING, _eglLog(_EGL_WARNING,
"DRI2: driver exports no extensions (%s)", dlerror()); "DRI2: driver exports no extensions (%s)", dlerror());
dlclose(dri2_dpy->driver); dlclose(dri2_dpy->driver);
return EGL_FALSE;
} }
if (strcmp(dri2_dpy->driver_name, "swrast") == 0) { return extensions;
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) { }
dlclose(dri2_dpy->driver);
return EGL_FALSE; EGLBoolean
} dri2_load_driver(_EGLDisplay *disp)
} else { {
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) { struct dri2_egl_display *dri2_dpy = disp->DriverData;
dlclose(dri2_dpy->driver); const __DRIextension **extensions;
return EGL_FALSE;
} extensions = dri2_open_driver(disp);
} if (!extensions)
return EGL_FALSE;
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
return EGL_TRUE; return EGL_TRUE;
} }
EGLBoolean EGLBoolean
dri2_create_screen(_EGLDisplay *disp) dri2_load_driver_swrast(_EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions; const __DRIextension **extensions;
struct dri2_egl_display *dri2_dpy;
unsigned int api_mask;
dri2_dpy = disp->DriverData; dri2_dpy->driver_name = "swrast";
extensions = dri2_open_driver(disp);
if (dri2_dpy->dri2) { if (!extensions) {
dri2_dpy->dri_screen = /* try again with swrastg */
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, dri2_dpy->driver_name = "swrastg";
&dri2_dpy->driver_configs, disp); extensions = dri2_open_driver(disp);
} else {
assert(dri2_dpy->swrast);
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
} }
if (dri2_dpy->dri_screen == NULL) { if (!extensions)
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen"); return EGL_FALSE;
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) {
dlclose(dri2_dpy->driver);
return EGL_FALSE; return EGL_FALSE;
} }
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen); return EGL_TRUE;
}
if (dri2_dpy->dri2) {
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions)) void
goto cleanup_dri_screen; dri2_setup_screen(_EGLDisplay *disp)
} else { {
assert(dri2_dpy->swrast); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions)) unsigned int api_mask;
goto cleanup_dri_screen;
}
if (dri2_dpy->dri2) { if (dri2_dpy->dri2) {
if (dri2_dpy->dri2->base.version >= 2) if (dri2_dpy->dri2->base.version >= 2)
@@ -467,6 +480,46 @@ dri2_create_screen(_EGLDisplay *disp)
disp->Extensions.KHR_image_base = EGL_TRUE; disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE; disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
} }
}
EGLBoolean
dri2_create_screen(_EGLDisplay *disp)
{
const __DRIextension **extensions;
struct dri2_egl_display *dri2_dpy;
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
} else {
assert(dri2_dpy->swrast);
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
}
if (dri2_dpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
return EGL_FALSE;
}
dri2_dpy->own_dri_screen = 1;
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
goto cleanup_dri_screen;
} else {
assert(dri2_dpy->swrast);
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
goto cleanup_dri_screen;
}
dri2_setup_screen(disp);
return EGL_TRUE; return EGL_TRUE;
@@ -487,16 +540,20 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_FALSE; return EGL_FALSE;
switch (disp->Platform) { switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11: case _EGL_PLATFORM_X11:
if (disp->Options.TestOnly) if (disp->Options.TestOnly)
return EGL_TRUE; return EGL_TRUE;
return dri2_initialize_x11(drv, disp); return dri2_initialize_x11(drv, disp);
#endif
#ifdef HAVE_LIBUDEV #ifdef HAVE_LIBUDEV
#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM: case _EGL_PLATFORM_DRM:
if (disp->Options.TestOnly) if (disp->Options.TestOnly)
return EGL_TRUE; return EGL_TRUE;
return dri2_initialize_drm(drv, disp); return dri2_initialize_drm(drv, disp);
#endif
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND: case _EGL_PLATFORM_WAYLAND:
if (disp->Options.TestOnly) if (disp->Options.TestOnly)
@@ -521,12 +578,30 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
_eglReleaseDisplayResources(drv, disp); _eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp); _eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); if (dri2_dpy->own_dri_screen)
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->fd) if (dri2_dpy->fd)
close(dri2_dpy->fd); close(dri2_dpy->fd);
dlclose(dri2_dpy->driver); if (dri2_dpy->driver)
if (disp->PlatformDisplay == NULL) dlclose(dri2_dpy->driver);
xcb_disconnect(dri2_dpy->conn);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
xcb_disconnect(dri2_dpy->conn);
break;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
wl_display_destroy(dri2_dpy->wl_dpy);
break;
#endif
default:
break;
}
}
free(dri2_dpy); free(dri2_dpy);
disp->DriverData = NULL; disp->DriverData = NULL;
@@ -835,7 +910,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_image *dri2_img; struct dri2_egl_image *dri2_img;
GLuint renderbuffer = (GLuint) buffer; GLuint renderbuffer = (GLuint) (uintptr_t) buffer;
if (renderbuffer == 0) { if (renderbuffer == 0) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr"); _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
@@ -870,7 +945,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
(void) ctx; (void) ctx;
name = (EGLint) buffer; name = (EGLint) (uintptr_t) buffer;
err = _eglParseImageAttribList(&attrs, disp, attr_list); err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS) if (err != EGL_SUCCESS)
@@ -922,14 +997,12 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
return &dri2_img->base; return &dri2_img->base;
} }
static EGLBoolean #ifdef HAVE_WAYLAND_PLATFORM
dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
EGLint *name, EGLint *handle, EGLint *stride);
static _EGLImage * static _EGLImage *
dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx, dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
_EGLImage *image, EGLint width, EGLint height) __DRIimage *dri_image, EGLint width, EGLint height)
{ {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
EGLint attr_list[] = { EGLint attr_list[] = {
EGL_WIDTH, 0, EGL_WIDTH, 0,
EGL_HEIGHT, 0, EGL_HEIGHT, 0,
@@ -939,8 +1012,8 @@ dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
}; };
EGLint name, stride; EGLint name, stride;
dri2_export_drm_image_mesa(disp->Driver, disp, image, dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_NAME, &name);
&name, NULL, &stride); dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
attr_list[1] = width; attr_list[1] = width;
attr_list[3] = height; attr_list[3] = height;
@@ -951,19 +1024,21 @@ dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
attr_list); attr_list);
} }
#ifdef HAVE_WAYLAND_PLATFORM
static _EGLImage * static _EGLImage *
dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx, dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, EGLClientBuffer _buffer,
const EGLint *attr_list) const EGLint *attr_list)
{ {
struct wl_drm_buffer *wl_drm_buffer = (struct wl_drm_buffer *) buffer; struct wl_buffer *buffer = (struct wl_buffer *) _buffer;
(void) attr_list;
(void) attr_list; if (!wayland_buffer_is_drm(buffer))
return NULL;
return dri2_reference_drm_image(disp, ctx, wl_drm_buffer->image, return dri2_reference_drm_image(disp, ctx,
wl_drm_buffer->buffer.width, wayland_drm_buffer_get_buffer(buffer),
wl_drm_buffer->buffer.height); buffer->width,
buffer->height);
} }
#endif #endif
@@ -1054,7 +1129,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
valid_mask = valid_mask =
EGL_DRM_BUFFER_USE_SCANOUT_MESA | EGL_DRM_BUFFER_USE_SCANOUT_MESA |
EGL_DRM_BUFFER_USE_SHARE_MESA; EGL_DRM_BUFFER_USE_SHARE_MESA |
EGL_DRM_BUFFER_USE_CURSOR_MESA;
if (attrs.DRMBufferUseMESA & ~valid_mask) { if (attrs.DRMBufferUseMESA & ~valid_mask) {
_eglLog(_EGL_WARNING, "bad image use bit 0x%04x", _eglLog(_EGL_WARNING, "bad image use bit 0x%04x",
attrs.DRMBufferUseMESA & ~valid_mask); attrs.DRMBufferUseMESA & ~valid_mask);
@@ -1066,6 +1142,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
dri_use |= __DRI_IMAGE_USE_SHARE; dri_use |= __DRI_IMAGE_USE_SHARE;
if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SCANOUT_MESA) if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SCANOUT_MESA)
dri_use |= __DRI_IMAGE_USE_SCANOUT; dri_use |= __DRI_IMAGE_USE_SCANOUT;
if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_CURSOR_MESA)
dri_use |= __DRI_IMAGE_USE_CURSOR;
dri2_img->dri_image = dri2_img->dri_image =
dri2_dpy->image->createImage(dri2_dpy->dri_screen, dri2_dpy->image->createImage(dri2_dpy->dri_screen,
@@ -1112,6 +1190,41 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
} }
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
static void *
dri2_wl_reference_buffer(void *user_data, uint32_t name,
int32_t width, int32_t height,
uint32_t stride, struct wl_visual *visual)
{
_EGLDisplay *disp = user_data;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
__DRIimage *image;
image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
width, height,
__DRI_IMAGE_FORMAT_ARGB8888,
name, stride / 4,
NULL);
return image;
}
static void
dri2_wl_release_buffer(void *user_data, void *buffer)
{
_EGLDisplay *disp = user_data;
__DRIimage *image = buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->image->destroyImage(image);
}
static struct wayland_drm_callbacks wl_drm_callbacks = {
.authenticate = NULL,
.reference_buffer = dri2_wl_reference_buffer,
.release_buffer = dri2_wl_release_buffer
};
static EGLBoolean static EGLBoolean
dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_display *wl_dpy) struct wl_display *wl_dpy)
@@ -1123,10 +1236,12 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (dri2_dpy->wl_server_drm) if (dri2_dpy->wl_server_drm)
return EGL_FALSE; return EGL_FALSE;
wl_drm_callbacks.authenticate =
(int(*)(void *, uint32_t)) dri2_dpy->authenticate;
dri2_dpy->wl_server_drm = dri2_dpy->wl_server_drm =
wayland_drm_init(wl_dpy, disp, wayland_drm_init(wl_dpy, dri2_dpy->device_name,
dri2_dpy->authenticate, &wl_drm_callbacks, disp);
dri2_dpy->device_name);
if (!dri2_dpy->wl_server_drm) if (!dri2_dpy->wl_server_drm)
return EGL_FALSE; return EGL_FALSE;
@@ -1145,7 +1260,7 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (!dri2_dpy->wl_server_drm) if (!dri2_dpy->wl_server_drm)
return EGL_FALSE; return EGL_FALSE;
wayland_drm_destroy(dri2_dpy->wl_server_drm); wayland_drm_uninit(dri2_dpy->wl_server_drm);
dri2_dpy->wl_server_drm = NULL; dri2_dpy->wl_server_drm = NULL;
return EGL_TRUE; return EGL_TRUE;

View File

@@ -28,10 +28,12 @@
#ifndef EGL_DRI2_INCLUDED #ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED #define EGL_DRI2_INCLUDED
#ifdef HAVE_X11_PLATFORM
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/dri2.h> #include <xcb/dri2.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h> #include <X11/Xlib-xcb.h>
#endif
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h> #include <wayland-client.h>
@@ -42,6 +44,10 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/internal/dri_interface.h> #include <GL/internal/dri_interface.h>
#ifdef HAVE_DRM_PLATFORM
#include <gbm_driint.h>
#endif
#include "eglconfig.h" #include "eglconfig.h"
#include "eglcontext.h" #include "eglcontext.h"
#include "egldisplay.h" #include "egldisplay.h"
@@ -64,10 +70,10 @@ struct dri2_egl_driver
struct dri2_egl_display struct dri2_egl_display
{ {
xcb_connection_t *conn;
int dri2_major; int dri2_major;
int dri2_minor; int dri2_minor;
__DRIscreen *dri_screen; __DRIscreen *dri_screen;
int own_dri_screen;
const __DRIconfig **driver_configs; const __DRIconfig **driver_configs;
void *driver; void *driver;
__DRIcoreExtension *core; __DRIcoreExtension *core;
@@ -78,15 +84,26 @@ struct dri2_egl_display
__DRIimageExtension *image; __DRIimageExtension *image;
int fd; int fd;
#ifdef HAVE_DRM_PLATFORM
struct gbm_dri_device *gbm_dri;
#endif
char *device_name; char *device_name;
char *driver_name; char *driver_name;
__DRIdri2LoaderExtension dri2_loader_extension; __DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension; __DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[3]; const __DRIextension *extensions[4];
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
#endif
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_display *wl_dpy; struct wl_display *wl_dpy;
struct wl_drm *wl_server_drm; struct wl_drm *wl_server_drm;
struct wl_drm *wl_drm;
int authenticated;
#endif #endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id); int (*authenticate) (_EGLDisplay *disp, uint32_t id);
@@ -102,6 +119,7 @@ struct dri2_egl_context
enum wayland_buffer_type { enum wayland_buffer_type {
WL_BUFFER_FRONT, WL_BUFFER_FRONT,
WL_BUFFER_BACK, WL_BUFFER_BACK,
WL_BUFFER_THIRD,
WL_BUFFER_COUNT WL_BUFFER_COUNT
}; };
@@ -118,26 +136,30 @@ struct dri2_egl_surface
{ {
_EGLSurface base; _EGLSurface base;
__DRIdrawable *dri_drawable; __DRIdrawable *dri_drawable;
xcb_drawable_t drawable;
__DRIbuffer buffers[5]; __DRIbuffer buffers[5];
int buffer_count; int buffer_count;
xcb_xfixes_region_t region;
int have_fake_front; int have_fake_front;
int swap_interval; int swap_interval;
#ifdef HAVE_X11_PLATFORM
xcb_drawable_t drawable;
xcb_xfixes_region_t region;
int depth; int depth;
int bytes_per_pixel; int bytes_per_pixel;
xcb_gcontext_t gc; xcb_gcontext_t gc;
xcb_gcontext_t swapgc; xcb_gcontext_t swapgc;
#endif
enum dri2_surface_type type; enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_window *wl_win; struct wl_egl_window *wl_win;
struct wl_egl_pixmap *wl_pix; struct wl_egl_pixmap *wl_pix;
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT]; struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
int wl_buffer_lock[WL_BUFFER_COUNT];
int dx; int dx;
int dy; int dy;
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT]; __DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *third_buffer;
__DRIbuffer *pending_buffer; __DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers; EGLBoolean block_swap_buffers;
#endif #endif
@@ -172,9 +194,19 @@ extern const __DRIuseInvalidateExtension use_invalidate;
EGLBoolean EGLBoolean
dri2_load_driver(_EGLDisplay *disp); dri2_load_driver(_EGLDisplay *disp);
/* Helper for platforms not using dri2_create_screen */
void
dri2_setup_screen(_EGLDisplay *disp);
EGLBoolean
dri2_load_driver_swrast(_EGLDisplay *disp);
EGLBoolean EGLBoolean
dri2_create_screen(_EGLDisplay *disp); dri2_create_screen(_EGLDisplay *disp);
__DRIimage *
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
struct dri2_egl_config * struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list); int depth, EGLint surface_type, const EGLint *attr_list);
@@ -195,5 +227,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
char * char *
dri2_get_driver_for_fd(int fd); dri2_get_driver_for_fd(int fd);
char *
dri2_get_device_name_for_fd(int fd);
#endif /* EGL_DRI2_INCLUDED */ #endif /* EGL_DRI2_INCLUDED */

View File

@@ -26,640 +26,55 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <string.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <xf86drm.h> #include <xf86drm.h>
#include <sys/types.h> #include <dlfcn.h>
#include <sys/stat.h>
#ifdef HAVE_LIBUDEV
#include <libudev.h>
#endif
#include "egl_dri2.h" #include "egl_dri2.h"
static _EGLImage *
#ifdef HAVE_LIBUDEV dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
struct dri2_driver_map {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
};
const int i915_chip_ids[] = {
0x3577, /* PCI_CHIP_I830_M */
0x2562, /* PCI_CHIP_845_G */
0x3582, /* PCI_CHIP_I855_GM */
0x2572, /* PCI_CHIP_I865_G */
0x2582, /* PCI_CHIP_I915_G */
0x258a, /* PCI_CHIP_E7221_G */
0x2592, /* PCI_CHIP_I915_GM */
0x2772, /* PCI_CHIP_I945_G */
0x27a2, /* PCI_CHIP_I945_GM */
0x27ae, /* PCI_CHIP_I945_GME */
0x29b2, /* PCI_CHIP_Q35_G */
0x29c2, /* PCI_CHIP_G33_G */
0x29d2, /* PCI_CHIP_Q33_G */
0xa001, /* PCI_CHIP_IGD_G */
0xa011, /* Pineview */
};
const int i965_chip_ids[] = {
0x0042, /* PCI_CHIP_ILD_G */
0x0046, /* PCI_CHIP_ILM_G */
0x0102, /* PCI_CHIP_SANDYBRIDGE_GT1 */
0x0106, /* PCI_CHIP_SANDYBRIDGE_M_GT1 */
0x010a, /* PCI_CHIP_SANDYBRIDGE_S */
0x0112, /* PCI_CHIP_SANDYBRIDGE_GT2 */
0x0116, /* PCI_CHIP_SANDYBRIDGE_M_GT2 */
0x0122, /* PCI_CHIP_SANDYBRIDGE_GT2_PLUS */
0x0126, /* PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS */
0x29a2, /* PCI_CHIP_I965_G */
0x2992, /* PCI_CHIP_I965_Q */
0x2982, /* PCI_CHIP_I965_G_1 */
0x2972, /* PCI_CHIP_I946_GZ */
0x2a02, /* PCI_CHIP_I965_GM */
0x2a12, /* PCI_CHIP_I965_GME */
0x2a42, /* PCI_CHIP_GM45_GM */
0x2e02, /* PCI_CHIP_IGD_E_G */
0x2e12, /* PCI_CHIP_Q45_G */
0x2e22, /* PCI_CHIP_G45_G */
0x2e32, /* PCI_CHIP_G41_G */
0x2e42, /* PCI_CHIP_B43_G */
0x2e92, /* PCI_CHIP_B43_G1 */
};
const int r100_chip_ids[] = {
0x4C57, /* PCI_CHIP_RADEON_LW */
0x4C58, /* PCI_CHIP_RADEON_LX */
0x4C59, /* PCI_CHIP_RADEON_LY */
0x4C5A, /* PCI_CHIP_RADEON_LZ */
0x5144, /* PCI_CHIP_RADEON_QD */
0x5145, /* PCI_CHIP_RADEON_QE */
0x5146, /* PCI_CHIP_RADEON_QF */
0x5147, /* PCI_CHIP_RADEON_QG */
0x5159, /* PCI_CHIP_RADEON_QY */
0x515A, /* PCI_CHIP_RADEON_QZ */
0x5157, /* PCI_CHIP_RV200_QW */
0x5158, /* PCI_CHIP_RV200_QX */
0x515E, /* PCI_CHIP_RN50_515E */
0x5969, /* PCI_CHIP_RN50_5969 */
0x4136, /* PCI_CHIP_RS100_4136 */
0x4336, /* PCI_CHIP_RS100_4336 */
0x4137, /* PCI_CHIP_RS200_4137 */
0x4337, /* PCI_CHIP_RS200_4337 */
0x4237, /* PCI_CHIP_RS250_4237 */
0x4437, /* PCI_CHIP_RS250_4437 */
};
const int r200_chip_ids[] = {
0x5148, /* PCI_CHIP_R200_QH */
0x514C, /* PCI_CHIP_R200_QL */
0x514D, /* PCI_CHIP_R200_QM */
0x4242, /* PCI_CHIP_R200_BB */
0x4966, /* PCI_CHIP_RV250_If */
0x4967, /* PCI_CHIP_RV250_Ig */
0x4C64, /* PCI_CHIP_RV250_Ld */
0x4C66, /* PCI_CHIP_RV250_Lf */
0x4C67, /* PCI_CHIP_RV250_Lg */
0x5960, /* PCI_CHIP_RV280_5960 */
0x5961, /* PCI_CHIP_RV280_5961 */
0x5962, /* PCI_CHIP_RV280_5962 */
0x5964, /* PCI_CHIP_RV280_5964 */
0x5965, /* PCI_CHIP_RV280_5965 */
0x5C61, /* PCI_CHIP_RV280_5C61 */
0x5C63, /* PCI_CHIP_RV280_5C63 */
0x5834, /* PCI_CHIP_RS300_5834 */
0x5835, /* PCI_CHIP_RS300_5835 */
0x7834, /* PCI_CHIP_RS350_7834 */
0x7835, /* PCI_CHIP_RS350_7835 */
};
const int r300_chip_ids[] = {
0x4144, /* PCI_CHIP_R300_AD */
0x4145, /* PCI_CHIP_R300_AE */
0x4146, /* PCI_CHIP_R300_AF */
0x4147, /* PCI_CHIP_R300_AG */
0x4E44, /* PCI_CHIP_R300_ND */
0x4E45, /* PCI_CHIP_R300_NE */
0x4E46, /* PCI_CHIP_R300_NF */
0x4E47, /* PCI_CHIP_R300_NG */
0x4E48, /* PCI_CHIP_R350_NH */
0x4E49, /* PCI_CHIP_R350_NI */
0x4E4B, /* PCI_CHIP_R350_NK */
0x4148, /* PCI_CHIP_R350_AH */
0x4149, /* PCI_CHIP_R350_AI */
0x414A, /* PCI_CHIP_R350_AJ */
0x414B, /* PCI_CHIP_R350_AK */
0x4E4A, /* PCI_CHIP_R360_NJ */
0x4150, /* PCI_CHIP_RV350_AP */
0x4151, /* PCI_CHIP_RV350_AQ */
0x4152, /* PCI_CHIP_RV350_AR */
0x4153, /* PCI_CHIP_RV350_AS */
0x4154, /* PCI_CHIP_RV350_AT */
0x4155, /* PCI_CHIP_RV350_AU */
0x4156, /* PCI_CHIP_RV350_AV */
0x4E50, /* PCI_CHIP_RV350_NP */
0x4E51, /* PCI_CHIP_RV350_NQ */
0x4E52, /* PCI_CHIP_RV350_NR */
0x4E53, /* PCI_CHIP_RV350_NS */
0x4E54, /* PCI_CHIP_RV350_NT */
0x4E56, /* PCI_CHIP_RV350_NV */
0x5460, /* PCI_CHIP_RV370_5460 */
0x5462, /* PCI_CHIP_RV370_5462 */
0x5464, /* PCI_CHIP_RV370_5464 */
0x5B60, /* PCI_CHIP_RV370_5B60 */
0x5B62, /* PCI_CHIP_RV370_5B62 */
0x5B63, /* PCI_CHIP_RV370_5B63 */
0x5B64, /* PCI_CHIP_RV370_5B64 */
0x5B65, /* PCI_CHIP_RV370_5B65 */
0x3150, /* PCI_CHIP_RV380_3150 */
0x3152, /* PCI_CHIP_RV380_3152 */
0x3154, /* PCI_CHIP_RV380_3154 */
0x3155, /* PCI_CHIP_RV380_3155 */
0x3E50, /* PCI_CHIP_RV380_3E50 */
0x3E54, /* PCI_CHIP_RV380_3E54 */
0x4A48, /* PCI_CHIP_R420_JH */
0x4A49, /* PCI_CHIP_R420_JI */
0x4A4A, /* PCI_CHIP_R420_JJ */
0x4A4B, /* PCI_CHIP_R420_JK */
0x4A4C, /* PCI_CHIP_R420_JL */
0x4A4D, /* PCI_CHIP_R420_JM */
0x4A4E, /* PCI_CHIP_R420_JN */
0x4A4F, /* PCI_CHIP_R420_JO */
0x4A50, /* PCI_CHIP_R420_JP */
0x4A54, /* PCI_CHIP_R420_JT */
0x5548, /* PCI_CHIP_R423_UH */
0x5549, /* PCI_CHIP_R423_UI */
0x554A, /* PCI_CHIP_R423_UJ */
0x554B, /* PCI_CHIP_R423_UK */
0x5550, /* PCI_CHIP_R423_5550 */
0x5551, /* PCI_CHIP_R423_UQ */
0x5552, /* PCI_CHIP_R423_UR */
0x5554, /* PCI_CHIP_R423_UT */
0x5D57, /* PCI_CHIP_R423_5D57 */
0x554C, /* PCI_CHIP_R430_554C */
0x554D, /* PCI_CHIP_R430_554D */
0x554E, /* PCI_CHIP_R430_554E */
0x554F, /* PCI_CHIP_R430_554F */
0x5D48, /* PCI_CHIP_R430_5D48 */
0x5D49, /* PCI_CHIP_R430_5D49 */
0x5D4A, /* PCI_CHIP_R430_5D4A */
0x5D4C, /* PCI_CHIP_R480_5D4C */
0x5D4D, /* PCI_CHIP_R480_5D4D */
0x5D4E, /* PCI_CHIP_R480_5D4E */
0x5D4F, /* PCI_CHIP_R480_5D4F */
0x5D50, /* PCI_CHIP_R480_5D50 */
0x5D52, /* PCI_CHIP_R480_5D52 */
0x4B49, /* PCI_CHIP_R481_4B49 */
0x4B4A, /* PCI_CHIP_R481_4B4A */
0x4B4B, /* PCI_CHIP_R481_4B4B */
0x4B4C, /* PCI_CHIP_R481_4B4C */
0x564A, /* PCI_CHIP_RV410_564A */
0x564B, /* PCI_CHIP_RV410_564B */
0x564F, /* PCI_CHIP_RV410_564F */
0x5652, /* PCI_CHIP_RV410_5652 */
0x5653, /* PCI_CHIP_RV410_5653 */
0x5657, /* PCI_CHIP_RV410_5657 */
0x5E48, /* PCI_CHIP_RV410_5E48 */
0x5E4A, /* PCI_CHIP_RV410_5E4A */
0x5E4B, /* PCI_CHIP_RV410_5E4B */
0x5E4C, /* PCI_CHIP_RV410_5E4C */
0x5E4D, /* PCI_CHIP_RV410_5E4D */
0x5E4F, /* PCI_CHIP_RV410_5E4F */
0x5A41, /* PCI_CHIP_RS400_5A41 */
0x5A42, /* PCI_CHIP_RS400_5A42 */
0x5A61, /* PCI_CHIP_RC410_5A61 */
0x5A62, /* PCI_CHIP_RC410_5A62 */
0x5954, /* PCI_CHIP_RS480_5954 */
0x5955, /* PCI_CHIP_RS480_5955 */
0x5974, /* PCI_CHIP_RS482_5974 */
0x5975, /* PCI_CHIP_RS482_5975 */
0x7100, /* PCI_CHIP_R520_7100 */
0x7101, /* PCI_CHIP_R520_7101 */
0x7102, /* PCI_CHIP_R520_7102 */
0x7103, /* PCI_CHIP_R520_7103 */
0x7104, /* PCI_CHIP_R520_7104 */
0x7105, /* PCI_CHIP_R520_7105 */
0x7106, /* PCI_CHIP_R520_7106 */
0x7108, /* PCI_CHIP_R520_7108 */
0x7109, /* PCI_CHIP_R520_7109 */
0x710A, /* PCI_CHIP_R520_710A */
0x710B, /* PCI_CHIP_R520_710B */
0x710C, /* PCI_CHIP_R520_710C */
0x710E, /* PCI_CHIP_R520_710E */
0x710F, /* PCI_CHIP_R520_710F */
0x7140, /* PCI_CHIP_RV515_7140 */
0x7141, /* PCI_CHIP_RV515_7141 */
0x7142, /* PCI_CHIP_RV515_7142 */
0x7143, /* PCI_CHIP_RV515_7143 */
0x7144, /* PCI_CHIP_RV515_7144 */
0x7145, /* PCI_CHIP_RV515_7145 */
0x7146, /* PCI_CHIP_RV515_7146 */
0x7147, /* PCI_CHIP_RV515_7147 */
0x7149, /* PCI_CHIP_RV515_7149 */
0x714A, /* PCI_CHIP_RV515_714A */
0x714B, /* PCI_CHIP_RV515_714B */
0x714C, /* PCI_CHIP_RV515_714C */
0x714D, /* PCI_CHIP_RV515_714D */
0x714E, /* PCI_CHIP_RV515_714E */
0x714F, /* PCI_CHIP_RV515_714F */
0x7151, /* PCI_CHIP_RV515_7151 */
0x7152, /* PCI_CHIP_RV515_7152 */
0x7153, /* PCI_CHIP_RV515_7153 */
0x715E, /* PCI_CHIP_RV515_715E */
0x715F, /* PCI_CHIP_RV515_715F */
0x7180, /* PCI_CHIP_RV515_7180 */
0x7181, /* PCI_CHIP_RV515_7181 */
0x7183, /* PCI_CHIP_RV515_7183 */
0x7186, /* PCI_CHIP_RV515_7186 */
0x7187, /* PCI_CHIP_RV515_7187 */
0x7188, /* PCI_CHIP_RV515_7188 */
0x718A, /* PCI_CHIP_RV515_718A */
0x718B, /* PCI_CHIP_RV515_718B */
0x718C, /* PCI_CHIP_RV515_718C */
0x718D, /* PCI_CHIP_RV515_718D */
0x718F, /* PCI_CHIP_RV515_718F */
0x7193, /* PCI_CHIP_RV515_7193 */
0x7196, /* PCI_CHIP_RV515_7196 */
0x719B, /* PCI_CHIP_RV515_719B */
0x719F, /* PCI_CHIP_RV515_719F */
0x7200, /* PCI_CHIP_RV515_7200 */
0x7210, /* PCI_CHIP_RV515_7210 */
0x7211, /* PCI_CHIP_RV515_7211 */
0x71C0, /* PCI_CHIP_RV530_71C0 */
0x71C1, /* PCI_CHIP_RV530_71C1 */
0x71C2, /* PCI_CHIP_RV530_71C2 */
0x71C3, /* PCI_CHIP_RV530_71C3 */
0x71C4, /* PCI_CHIP_RV530_71C4 */
0x71C5, /* PCI_CHIP_RV530_71C5 */
0x71C6, /* PCI_CHIP_RV530_71C6 */
0x71C7, /* PCI_CHIP_RV530_71C7 */
0x71CD, /* PCI_CHIP_RV530_71CD */
0x71CE, /* PCI_CHIP_RV530_71CE */
0x71D2, /* PCI_CHIP_RV530_71D2 */
0x71D4, /* PCI_CHIP_RV530_71D4 */
0x71D5, /* PCI_CHIP_RV530_71D5 */
0x71D6, /* PCI_CHIP_RV530_71D6 */
0x71DA, /* PCI_CHIP_RV530_71DA */
0x71DE, /* PCI_CHIP_RV530_71DE */
0x7281, /* PCI_CHIP_RV560_7281 */
0x7283, /* PCI_CHIP_RV560_7283 */
0x7287, /* PCI_CHIP_RV560_7287 */
0x7290, /* PCI_CHIP_RV560_7290 */
0x7291, /* PCI_CHIP_RV560_7291 */
0x7293, /* PCI_CHIP_RV560_7293 */
0x7297, /* PCI_CHIP_RV560_7297 */
0x7280, /* PCI_CHIP_RV570_7280 */
0x7288, /* PCI_CHIP_RV570_7288 */
0x7289, /* PCI_CHIP_RV570_7289 */
0x728B, /* PCI_CHIP_RV570_728B */
0x728C, /* PCI_CHIP_RV570_728C */
0x7240, /* PCI_CHIP_R580_7240 */
0x7243, /* PCI_CHIP_R580_7243 */
0x7244, /* PCI_CHIP_R580_7244 */
0x7245, /* PCI_CHIP_R580_7245 */
0x7246, /* PCI_CHIP_R580_7246 */
0x7247, /* PCI_CHIP_R580_7247 */
0x7248, /* PCI_CHIP_R580_7248 */
0x7249, /* PCI_CHIP_R580_7249 */
0x724A, /* PCI_CHIP_R580_724A */
0x724B, /* PCI_CHIP_R580_724B */
0x724C, /* PCI_CHIP_R580_724C */
0x724D, /* PCI_CHIP_R580_724D */
0x724E, /* PCI_CHIP_R580_724E */
0x724F, /* PCI_CHIP_R580_724F */
0x7284, /* PCI_CHIP_R580_7284 */
0x793F, /* PCI_CHIP_RS600_793F */
0x7941, /* PCI_CHIP_RS600_7941 */
0x7942, /* PCI_CHIP_RS600_7942 */
0x791E, /* PCI_CHIP_RS690_791E */
0x791F, /* PCI_CHIP_RS690_791F */
0x796C, /* PCI_CHIP_RS740_796C */
0x796D, /* PCI_CHIP_RS740_796D */
0x796E, /* PCI_CHIP_RS740_796E */
0x796F, /* PCI_CHIP_RS740_796F */
};
const int r600_chip_ids[] = {
0x9400, /* PCI_CHIP_R600_9400 */
0x9401, /* PCI_CHIP_R600_9401 */
0x9402, /* PCI_CHIP_R600_9402 */
0x9403, /* PCI_CHIP_R600_9403 */
0x9405, /* PCI_CHIP_R600_9405 */
0x940A, /* PCI_CHIP_R600_940A */
0x940B, /* PCI_CHIP_R600_940B */
0x940F, /* PCI_CHIP_R600_940F */
0x94C0, /* PCI_CHIP_RV610_94C0 */
0x94C1, /* PCI_CHIP_RV610_94C1 */
0x94C3, /* PCI_CHIP_RV610_94C3 */
0x94C4, /* PCI_CHIP_RV610_94C4 */
0x94C5, /* PCI_CHIP_RV610_94C5 */
0x94C6, /* PCI_CHIP_RV610_94C6 */
0x94C7, /* PCI_CHIP_RV610_94C7 */
0x94C8, /* PCI_CHIP_RV610_94C8 */
0x94C9, /* PCI_CHIP_RV610_94C9 */
0x94CB, /* PCI_CHIP_RV610_94CB */
0x94CC, /* PCI_CHIP_RV610_94CC */
0x94CD, /* PCI_CHIP_RV610_94CD */
0x9580, /* PCI_CHIP_RV630_9580 */
0x9581, /* PCI_CHIP_RV630_9581 */
0x9583, /* PCI_CHIP_RV630_9583 */
0x9586, /* PCI_CHIP_RV630_9586 */
0x9587, /* PCI_CHIP_RV630_9587 */
0x9588, /* PCI_CHIP_RV630_9588 */
0x9589, /* PCI_CHIP_RV630_9589 */
0x958A, /* PCI_CHIP_RV630_958A */
0x958B, /* PCI_CHIP_RV630_958B */
0x958C, /* PCI_CHIP_RV630_958C */
0x958D, /* PCI_CHIP_RV630_958D */
0x958E, /* PCI_CHIP_RV630_958E */
0x958F, /* PCI_CHIP_RV630_958F */
0x9500, /* PCI_CHIP_RV670_9500 */
0x9501, /* PCI_CHIP_RV670_9501 */
0x9504, /* PCI_CHIP_RV670_9504 */
0x9505, /* PCI_CHIP_RV670_9505 */
0x9506, /* PCI_CHIP_RV670_9506 */
0x9507, /* PCI_CHIP_RV670_9507 */
0x9508, /* PCI_CHIP_RV670_9508 */
0x9509, /* PCI_CHIP_RV670_9509 */
0x950F, /* PCI_CHIP_RV670_950F */
0x9511, /* PCI_CHIP_RV670_9511 */
0x9515, /* PCI_CHIP_RV670_9515 */
0x9517, /* PCI_CHIP_RV670_9517 */
0x9519, /* PCI_CHIP_RV670_9519 */
0x95C0, /* PCI_CHIP_RV620_95C0 */
0x95C2, /* PCI_CHIP_RV620_95C2 */
0x95C4, /* PCI_CHIP_RV620_95C4 */
0x95C5, /* PCI_CHIP_RV620_95C5 */
0x95C6, /* PCI_CHIP_RV620_95C6 */
0x95C7, /* PCI_CHIP_RV620_95C7 */
0x95C9, /* PCI_CHIP_RV620_95C9 */
0x95CC, /* PCI_CHIP_RV620_95CC */
0x95CD, /* PCI_CHIP_RV620_95CD */
0x95CE, /* PCI_CHIP_RV620_95CE */
0x95CF, /* PCI_CHIP_RV620_95CF */
0x9590, /* PCI_CHIP_RV635_9590 */
0x9591, /* PCI_CHIP_RV635_9591 */
0x9593, /* PCI_CHIP_RV635_9593 */
0x9595, /* PCI_CHIP_RV635_9595 */
0x9596, /* PCI_CHIP_RV635_9596 */
0x9597, /* PCI_CHIP_RV635_9597 */
0x9598, /* PCI_CHIP_RV635_9598 */
0x9599, /* PCI_CHIP_RV635_9599 */
0x959B, /* PCI_CHIP_RV635_959B */
0x9610, /* PCI_CHIP_RS780_9610 */
0x9611, /* PCI_CHIP_RS780_9611 */
0x9612, /* PCI_CHIP_RS780_9612 */
0x9613, /* PCI_CHIP_RS780_9613 */
0x9614, /* PCI_CHIP_RS780_9614 */
0x9615, /* PCI_CHIP_RS780_9615 */
0x9616, /* PCI_CHIP_RS780_9616 */
0x9710, /* PCI_CHIP_RS880_9710 */
0x9711, /* PCI_CHIP_RS880_9711 */
0x9712, /* PCI_CHIP_RS880_9712 */
0x9713, /* PCI_CHIP_RS880_9713 */
0x9714, /* PCI_CHIP_RS880_9714 */
0x9715, /* PCI_CHIP_RS880_9715 */
0x9440, /* PCI_CHIP_RV770_9440 */
0x9441, /* PCI_CHIP_RV770_9441 */
0x9442, /* PCI_CHIP_RV770_9442 */
0x9443, /* PCI_CHIP_RV770_9443 */
0x9444, /* PCI_CHIP_RV770_9444 */
0x9446, /* PCI_CHIP_RV770_9446 */
0x944A, /* PCI_CHIP_RV770_944A */
0x944B, /* PCI_CHIP_RV770_944B */
0x944C, /* PCI_CHIP_RV770_944C */
0x944E, /* PCI_CHIP_RV770_944E */
0x9450, /* PCI_CHIP_RV770_9450 */
0x9452, /* PCI_CHIP_RV770_9452 */
0x9456, /* PCI_CHIP_RV770_9456 */
0x945A, /* PCI_CHIP_RV770_945A */
0x945B, /* PCI_CHIP_RV770_945B */
0x945E, /* PCI_CHIP_RV770_945E */
0x9460, /* PCI_CHIP_RV790_9460 */
0x9462, /* PCI_CHIP_RV790_9462 */
0x946A, /* PCI_CHIP_RV770_946A */
0x946B, /* PCI_CHIP_RV770_946B */
0x947A, /* PCI_CHIP_RV770_947A */
0x947B, /* PCI_CHIP_RV770_947B */
0x9480, /* PCI_CHIP_RV730_9480 */
0x9487, /* PCI_CHIP_RV730_9487 */
0x9488, /* PCI_CHIP_RV730_9488 */
0x9489, /* PCI_CHIP_RV730_9489 */
0x948A, /* PCI_CHIP_RV730_948A */
0x948F, /* PCI_CHIP_RV730_948F */
0x9490, /* PCI_CHIP_RV730_9490 */
0x9491, /* PCI_CHIP_RV730_9491 */
0x9495, /* PCI_CHIP_RV730_9495 */
0x9498, /* PCI_CHIP_RV730_9498 */
0x949C, /* PCI_CHIP_RV730_949C */
0x949E, /* PCI_CHIP_RV730_949E */
0x949F, /* PCI_CHIP_RV730_949F */
0x9540, /* PCI_CHIP_RV710_9540 */
0x9541, /* PCI_CHIP_RV710_9541 */
0x9542, /* PCI_CHIP_RV710_9542 */
0x954E, /* PCI_CHIP_RV710_954E */
0x954F, /* PCI_CHIP_RV710_954F */
0x9552, /* PCI_CHIP_RV710_9552 */
0x9553, /* PCI_CHIP_RV710_9553 */
0x9555, /* PCI_CHIP_RV710_9555 */
0x9557, /* PCI_CHIP_RV710_9557 */
0x955F, /* PCI_CHIP_RV710_955F */
0x94A0, /* PCI_CHIP_RV740_94A0 */
0x94A1, /* PCI_CHIP_RV740_94A1 */
0x94A3, /* PCI_CHIP_RV740_94A3 */
0x94B1, /* PCI_CHIP_RV740_94B1 */
0x94B3, /* PCI_CHIP_RV740_94B3 */
0x94B4, /* PCI_CHIP_RV740_94B4 */
0x94B5, /* PCI_CHIP_RV740_94B5 */
0x94B9, /* PCI_CHIP_RV740_94B9 */
0x68E0, /* PCI_CHIP_CEDAR_68E0 */
0x68E1, /* PCI_CHIP_CEDAR_68E1 */
0x68E4, /* PCI_CHIP_CEDAR_68E4 */
0x68E5, /* PCI_CHIP_CEDAR_68E5 */
0x68E8, /* PCI_CHIP_CEDAR_68E8 */
0x68E9, /* PCI_CHIP_CEDAR_68E9 */
0x68F1, /* PCI_CHIP_CEDAR_68F1 */
0x68F8, /* PCI_CHIP_CEDAR_68F8 */
0x68F9, /* PCI_CHIP_CEDAR_68F9 */
0x68FE, /* PCI_CHIP_CEDAR_68FE */
0x68C0, /* PCI_CHIP_REDWOOD_68C0 */
0x68C1, /* PCI_CHIP_REDWOOD_68C1 */
0x68C8, /* PCI_CHIP_REDWOOD_68C8 */
0x68C9, /* PCI_CHIP_REDWOOD_68C9 */
0x68D8, /* PCI_CHIP_REDWOOD_68D8 */
0x68D9, /* PCI_CHIP_REDWOOD_68D9 */
0x68DA, /* PCI_CHIP_REDWOOD_68DA */
0x68DE, /* PCI_CHIP_REDWOOD_68DE */
0x68A0, /* PCI_CHIP_JUNIPER_68A0 */
0x68A1, /* PCI_CHIP_JUNIPER_68A1 */
0x68A8, /* PCI_CHIP_JUNIPER_68A8 */
0x68A9, /* PCI_CHIP_JUNIPER_68A9 */
0x68B0, /* PCI_CHIP_JUNIPER_68B0 */
0x68B8, /* PCI_CHIP_JUNIPER_68B8 */
0x68B9, /* PCI_CHIP_JUNIPER_68B9 */
0x68BE, /* PCI_CHIP_JUNIPER_68BE */
0x6880, /* PCI_CHIP_CYPRESS_6880 */
0x6888, /* PCI_CHIP_CYPRESS_6888 */
0x6889, /* PCI_CHIP_CYPRESS_6889 */
0x688A, /* PCI_CHIP_CYPRESS_688A */
0x6898, /* PCI_CHIP_CYPRESS_6898 */
0x6899, /* PCI_CHIP_CYPRESS_6899 */
0x689E, /* PCI_CHIP_CYPRESS_689E */
0x689C, /* PCI_CHIP_HEMLOCK_689C */
0x689D, /* PCI_CHIP_HEMLOCK_689D */
0x9802, /* PCI_CHIP_PALM_9802 */
0x9803, /* PCI_CHIP_PALM_9803 */
0x9804, /* PCI_CHIP_PALM_9804 */
0x9805, /* PCI_CHIP_PALM_9805 */
0x6720, /* PCI_CHIP_BARTS_6720 */
0x6721, /* PCI_CHIP_BARTS_6721 */
0x6722, /* PCI_CHIP_BARTS_6722 */
0x6723, /* PCI_CHIP_BARTS_6723 */
0x6724, /* PCI_CHIP_BARTS_6724 */
0x6725, /* PCI_CHIP_BARTS_6725 */
0x6726, /* PCI_CHIP_BARTS_6726 */
0x6727, /* PCI_CHIP_BARTS_6727 */
0x6728, /* PCI_CHIP_BARTS_6728 */
0x6729, /* PCI_CHIP_BARTS_6729 */
0x6738, /* PCI_CHIP_BARTS_6738 */
0x6739, /* PCI_CHIP_BARTS_6738 */
0x6740, /* PCI_CHIP_TURKS_6740 */
0x6741, /* PCI_CHIP_TURKS_6741 */
0x6742, /* PCI_CHIP_TURKS_6742 */
0x6743, /* PCI_CHIP_TURKS_6743 */
0x6744, /* PCI_CHIP_TURKS_6744 */
0x6745, /* PCI_CHIP_TURKS_6745 */
0x6746, /* PCI_CHIP_TURKS_6746 */
0x6747, /* PCI_CHIP_TURKS_6747 */
0x6748, /* PCI_CHIP_TURKS_6748 */
0x6749, /* PCI_CHIP_TURKS_6749 */
0x6750, /* PCI_CHIP_TURKS_6750 */
0x6758, /* PCI_CHIP_TURKS_6758 */
0x6759, /* PCI_CHIP_TURKS_6759 */
0x6760, /* PCI_CHIP_CAICOS_6760 */
0x6761, /* PCI_CHIP_CAICOS_6761 */
0x6762, /* PCI_CHIP_CAICOS_6762 */
0x6763, /* PCI_CHIP_CAICOS_6763 */
0x6764, /* PCI_CHIP_CAICOS_6764 */
0x6765, /* PCI_CHIP_CAICOS_6765 */
0x6766, /* PCI_CHIP_CAICOS_6766 */
0x6767, /* PCI_CHIP_CAICOS_6767 */
0x6768, /* PCI_CHIP_CAICOS_6768 */
0x6770, /* PCI_CHIP_CAICOS_6770 */
0x6779, /* PCI_CHIP_CAICOS_6779 */
};
const struct dri2_driver_map driver_map[] = {
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
};
static char *
dri2_get_device_name(int fd)
{ {
struct udev *udev; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct udev_device *device; struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
struct stat buf; struct dri2_egl_image *dri2_img;
char *device_name;
udev = udev_new(); dri2_img = malloc(sizeof *dri2_img);
if (fstat(fd, &buf) < 0) { if (!dri2_img) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd); _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
goto out; return NULL;
} }
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev); if (!_eglInitImage(&dri2_img->base, disp)) {
if (device == NULL) { free(dri2_img);
_eglLog(_EGL_WARNING, return NULL;
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
} }
device_name = udev_device_get_devnode(device); dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
if (!device_name) if (dri2_img->dri_image == NULL) {
goto out; free(dri2_img);
device_name = strdup(device_name); _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
out: return &dri2_img->base;
udev_device_unref(device);
udev_unref(udev);
return device_name;
} }
char * static _EGLImage *
dri2_get_driver_for_fd(int fd) dri2_drm_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{ {
struct udev *udev; (void) drv;
struct udev_device *device, *parent;
struct stat buf;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new(); switch (target) {
if (fstat(fd, &buf) < 0) { case EGL_NATIVE_PIXMAP_KHR:
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd); return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
goto out; default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
} }
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL || sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; i < ARRAY_SIZE(driver_map); i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
} }
static int static int
@@ -674,59 +89,58 @@ EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy; struct dri2_egl_display *dri2_dpy;
struct gbm_device *gbm;
int i; int i;
dri2_dpy = malloc(sizeof *dri2_dpy); dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy) if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize"); return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy); memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy; disp->DriverData = (void *) dri2_dpy;
dri2_dpy->fd = (int) disp->PlatformDisplay;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd); gbm = (struct gbm_device *) disp->PlatformDisplay;
if (dri2_dpy->driver_name == NULL) if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name"); free(dri2_dpy);
return EGL_FALSE;
dri2_dpy->device_name = dri2_get_device_name(dri2_dpy->fd);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
} }
if (!dri2_load_driver(disp)) dri2_dpy->gbm_dri = gbm_dri_device(gbm);
goto cleanup_device_name; if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
free(dri2_dpy);
return EGL_FALSE;
}
dri2_dpy->extensions[0] = &image_lookup_extension.base; dri2_dpy->fd = gbm_device_get_fd(gbm);
dri2_dpy->extensions[1] = &use_invalidate.base; dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->extensions[2] = NULL; dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
if (!dri2_create_screen(disp)) dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
goto cleanup_driver; dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
dri2_dpy->image = dri2_dpy->gbm_dri->image;
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
dri2_dpy->gbm_dri->lookup_user_data = disp;
dri2_setup_screen(disp);
for (i = 0; dri2_dpy->driver_configs[i]; i++) for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL); dri2_add_config(disp, dri2_dpy->driver_configs[i],
i + 1, 0, 0, NULL);
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
#ifdef HAVE_WAYLAND_PLATFORM #ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE; disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif #endif
dri2_dpy->authenticate = dri2_drm_authenticate; dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */ /* we're supporting EGL 1.4 */
disp->VersionMajor = 1; disp->VersionMajor = 1;
disp->VersionMinor = 4; disp->VersionMinor = 4;
return EGL_TRUE; return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
return EGL_FALSE;
} }
#endif

View File

@@ -32,6 +32,8 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
#include <xf86drm.h>
#include "egl_dri2.h" #include "egl_dri2.h"
@@ -57,6 +59,29 @@ force_roundtrip(struct wl_display *display)
wl_display_iterate(display, WL_DISPLAY_READABLE); wl_display_iterate(display, WL_DISPLAY_READABLE);
} }
static void
wl_buffer_release(void *data, struct wl_buffer *buffer)
{
struct dri2_egl_surface *dri2_surf = data;
int i;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i] == buffer)
break;
assert(i <= WL_BUFFER_COUNT);
/* not found? */
if (i == WL_BUFFER_COUNT)
return;
dri2_surf->wl_buffer_lock[i] = 0;
}
static struct wl_buffer_listener wl_buffer_listener = {
wl_buffer_release
};
/** /**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface(). * Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
@@ -83,13 +108,16 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list)) if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf; goto cleanup_surf;
for (i = 0; i < WL_BUFFER_COUNT; ++i) for (i = 0; i < WL_BUFFER_COUNT; ++i) {
dri2_surf->wl_drm_buffer[i] = NULL; dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
dri2_surf->dri_buffers[i] = NULL; dri2_surf->dri_buffers[i] = NULL;
dri2_surf->pending_buffer = NULL; dri2_surf->pending_buffer = NULL;
dri2_surf->third_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE; dri2_surf->block_swap_buffers = EGL_FALSE;
switch (type) { switch (type) {
@@ -107,7 +135,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->base.Width = dri2_surf->wl_pix->width; dri2_surf->base.Width = dri2_surf->wl_pix->width;
dri2_surf->base.Height = dri2_surf->wl_pix->height; dri2_surf->base.Height = dri2_surf->wl_pix->height;
if (dri2_surf->wl_pix->name > 0) { if (dri2_surf->wl_pix->driver_private) {
dri2_buf = dri2_surf->wl_pix->driver_private; dri2_buf = dri2_surf->wl_pix->driver_private;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer; dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
} }
@@ -185,6 +213,11 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen, dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]); dri2_surf->dri_buffers[i]);
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
}
free(surf); free(surf);
return EGL_TRUE; return EGL_TRUE;
@@ -204,7 +237,23 @@ dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
egl_pixmap->driver_private = NULL; egl_pixmap->driver_private = NULL;
egl_pixmap->destroy = NULL; egl_pixmap->destroy = NULL;
egl_pixmap->name = 0; }
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
__DRIbuffer *buffer,
struct wl_visual *visual)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct wl_buffer *buf;
buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, visual);
wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
return buf;
} }
static void static void
@@ -218,6 +267,8 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
switch (dri2_surf->type) { switch (dri2_surf->type) {
case DRI2_WINDOW_SURFACE: case DRI2_WINDOW_SURFACE:
/* allocate a front buffer for our double-buffered window*/ /* allocate a front buffer for our double-buffered window*/
if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
break;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen, dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, format, __DRI_BUFFER_FRONT_LEFT, format,
@@ -244,8 +295,6 @@ dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]; dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
dri2_buf->dri2_dpy = dri2_dpy; dri2_buf->dri2_dpy = dri2_dpy;
dri2_surf->wl_pix->name = dri2_buf->dri_buffer->name;
dri2_surf->wl_pix->stride = dri2_buf->dri_buffer->pitch;
dri2_surf->wl_pix->driver_private = dri2_buf; dri2_surf->wl_pix->driver_private = dri2_buf;
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy; dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
break; break;
@@ -277,14 +326,20 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
dri2_egl_display(dri2_surf->base.Resource.Display); dri2_egl_display(dri2_surf->base.Resource.Display);
int i; int i;
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) { for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
if (dri2_surf->dri_buffers[i]) { if (dri2_surf->dri_buffers[i]) {
switch (i) { switch (i) {
case __DRI_BUFFER_FRONT_LEFT: case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer) if (dri2_surf->pending_buffer)
force_roundtrip(dri2_dpy->wl_dpy->display); force_roundtrip(dri2_dpy->wl_dpy);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i]; dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
wl_display_sync_callback(dri2_dpy->wl_dpy->display, wl_display_sync_callback(dri2_dpy->wl_dpy,
dri2_release_pending_buffer, dri2_surf); dri2_release_pending_buffer, dri2_surf);
break; break;
default: default:
@@ -297,6 +352,76 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
} }
} }
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
static void
destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
if (dri2_surf->third_buffer == NULL)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
}
static void
swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
enum wayland_buffer_type a, enum wayland_buffer_type b)
{
int tmp;
tmp = dri2_surf->wl_buffer_lock[a];
dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
dri2_surf->wl_buffer_lock[b] = tmp;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
(const void **) &dri2_surf->wl_drm_buffer[b]);
}
static void
swap_back_and_third(struct dri2_egl_surface *dri2_surf)
{
if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
destroy_third_buffer(dri2_surf);
pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
(const void **) &dri2_surf->third_buffer);
swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
}
static void
dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
unsigned int type)
{
switch (type) {
case __DRI_BUFFER_BACK_LEFT:
if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
swap_back_and_third(dri2_surf);
else if (dri2_surf->third_buffer)
destroy_third_buffer(dri2_surf);
break;
default:
break;
}
}
static __DRIbuffer * static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable, dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height, int *width, int *height,
@@ -323,6 +448,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
if (dri2_surf->wl_drm_buffer[i]) if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]); wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
dri2_surf->wl_drm_buffer[i] = NULL; dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
} }
} }
@@ -331,6 +457,8 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
assert(attachments[i] < __DRI_BUFFER_COUNT); assert(attachments[i] < __DRI_BUFFER_COUNT);
assert(dri2_surf->buffer_count < 5); assert(dri2_surf->buffer_count < 5);
dri2_prior_buffer_creation(dri2_surf, attachments[i]);
if (dri2_surf->dri_buffers[attachments[i]] == NULL) { if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
dri2_surf->dri_buffers[attachments[i]] = dri2_surf->dri_buffers[attachments[i]] =
@@ -357,6 +485,12 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
assert(dri2_surf->type == DRI2_PIXMAP_SURFACE || assert(dri2_surf->type == DRI2_PIXMAP_SURFACE ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]); dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
if (dri2_surf->type == DRI2_PIXMAP_SURFACE && !dri2_surf->wl_pix->buffer)
dri2_surf->wl_pix->buffer =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_pix->visual);
*out_count = dri2_surf->buffer_count; *out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0) if (dri2_surf->buffer_count == 0)
return NULL; return NULL;
@@ -417,17 +551,6 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
#endif #endif
} }
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
return wl_drm_create_buffer(dri2_dpy->wl_dpy->drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, dri2_surf->wl_win->visual);
}
static void static void
wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time) wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
{ {
@@ -436,14 +559,6 @@ wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
dri2_surf->block_swap_buffers = EGL_FALSE; dri2_surf->block_swap_buffers = EGL_FALSE;
} }
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
/** /**
* Called via eglSwapBuffers(), drv->API.SwapBuffers(). * Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/ */
@@ -455,12 +570,12 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv); struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
while (dri2_surf->block_swap_buffers) while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy->display, WL_DISPLAY_READABLE); wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
dri2_surf->block_swap_buffers = EGL_TRUE; dri2_surf->block_swap_buffers = EGL_TRUE;
wl_display_frame_callback(dri2_dpy->wl_dpy->display, wl_display_frame_callback(dri2_dpy->wl_dpy,
dri2_surf->wl_win->surface, dri2_surf->wl_win->surface,
wayland_frame_callback, dri2_surf); wayland_frame_callback, dri2_surf);
if (dri2_surf->type == DRI2_WINDOW_SURFACE) { if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
pointer_swap( pointer_swap(
@@ -472,17 +587,20 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment = dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
__DRI_BUFFER_BACK_LEFT; __DRI_BUFFER_BACK_LEFT;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT], swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
(const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT]) if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] = dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
wayland_create_buffer(dri2_surf, wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]); dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_win->visual);
wl_buffer_damage(dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT], 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
wl_surface_attach(dri2_surf->wl_win->surface, wl_surface_attach(dri2_surf->wl_win->surface,
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT], dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
dri2_surf->dx, dri2_surf->dy); dri2_surf->dx, dri2_surf->dy);
dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
dri2_surf->wl_win->attached_width = dri2_surf->base.Width; dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
dri2_surf->wl_win->attached_height = dri2_surf->base.Height; dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
@@ -536,18 +654,23 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
wl_egl_pixmap->width, wl_egl_pixmap->width,
wl_egl_pixmap->height); wl_egl_pixmap->height);
wl_egl_pixmap->name = dri2_buf->dri_buffer->name;
wl_egl_pixmap->stride = dri2_buf->dri_buffer->pitch;
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy; wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
wl_egl_pixmap->driver_private = dri2_buf; wl_egl_pixmap->driver_private = dri2_buf;
wl_egl_pixmap->buffer =
wl_drm_create_buffer(dri2_dpy->wl_drm,
dri2_buf->dri_buffer->name,
wl_egl_pixmap->width,
wl_egl_pixmap->height,
dri2_buf->dri_buffer->pitch,
wl_egl_pixmap->visual);
wl_attr_list[1] = wl_egl_pixmap->width; wl_attr_list[1] = wl_egl_pixmap->width;
wl_attr_list[3] = wl_egl_pixmap->height; wl_attr_list[3] = wl_egl_pixmap->height;
wl_attr_list[5] = wl_egl_pixmap->stride / 4; wl_attr_list[5] = dri2_buf->dri_buffer->pitch / 4;
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA, return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
(EGLClientBuffer)(intptr_t) wl_egl_pixmap->name, wl_attr_list); (EGLClientBuffer)(intptr_t) dri2_buf->dri_buffer->name, wl_attr_list);
} }
static _EGLImage * static _EGLImage *
@@ -571,16 +694,16 @@ dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0; int ret = 0;
dri2_dpy->wl_dpy->authenticated = false; dri2_dpy->authenticated = 0;
wl_drm_authenticate(dri2_dpy->wl_dpy->drm, id); wl_drm_authenticate(dri2_dpy->wl_drm, id);
force_roundtrip(dri2_dpy->wl_dpy->display); force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->wl_dpy->authenticated) if (!dri2_dpy->authenticated)
ret = -1; ret = -1;
/* reset authenticated */ /* reset authenticated */
dri2_dpy->wl_dpy->authenticated = true; dri2_dpy->authenticated = 1;
return ret; return ret;
} }
@@ -606,10 +729,45 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_TRUE; return EGL_TRUE;
} }
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct dri2_egl_display *dri2_dpy = data;
drm_magic_t magic;
dri2_dpy->device_name = strdup(device);
if (!dri2_dpy->device_name)
return;
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
if (dri2_dpy->fd == -1) {
_eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
dri2_dpy->device_name, strerror(errno));
return;
}
drmGetMagic(dri2_dpy->fd, &magic);
wl_drm_authenticate(dri2_dpy->wl_drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct dri2_egl_display *dri2_dpy = data;
dri2_dpy->authenticated = 1;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
EGLBoolean EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy; struct dri2_egl_display *dri2_dpy;
uint32_t id;
int i; int i;
drv->API.CreateWindowSurface = dri2_create_window_surface; drv->API.CreateWindowSurface = dri2_create_window_surface;
@@ -626,23 +784,31 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
memset(dri2_dpy, 0, sizeof *dri2_dpy); memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy; disp->DriverData = (void *) dri2_dpy;
dri2_dpy->wl_dpy = disp->PlatformDisplay; if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);
if (dri2_dpy->wl_dpy->fd == -1) if (dri2_dpy->wl_dpy == NULL)
force_roundtrip(dri2_dpy->wl_dpy->display); goto cleanup_dpy;
if (dri2_dpy->wl_dpy->fd == -1) } else {
goto cleanup_dpy; dri2_dpy->wl_dpy = disp->PlatformDisplay;
dri2_dpy->fd = dup(dri2_dpy->wl_dpy->fd);
if (dri2_dpy->fd < 0) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to dup fd");
goto cleanup_dpy;
} }
if (!dri2_dpy->wl_dpy->authenticated) id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
force_roundtrip(dri2_dpy->wl_dpy->display); if (id == 0)
if (!dri2_dpy->wl_dpy->authenticated) force_roundtrip(dri2_dpy->wl_dpy);
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
goto cleanup_dpy; goto cleanup_dpy;
dri2_dpy->wl_drm = wl_drm_create(dri2_dpy->wl_dpy, id, 1);
if (!dri2_dpy->wl_drm)
goto cleanup_dpy;
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
force_roundtrip(dri2_dpy->wl_dpy);
if (dri2_dpy->fd == -1)
goto cleanup_drm;
force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->authenticated)
goto cleanup_fd;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd); dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL) { if (dri2_dpy->driver_name == NULL) {
@@ -650,14 +816,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_fd; goto cleanup_fd;
} }
dri2_dpy->device_name = strdup(dri2_dpy->wl_dpy->device_name);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp)) if (!dri2_load_driver(disp))
goto cleanup_device_name; goto cleanup_driver_name;
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER; dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3; dri2_dpy->dri2_loader_extension.base.version = 3;
@@ -668,7 +828,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base; dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base; dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = NULL; dri2_dpy->extensions[2] = &use_invalidate.base;
dri2_dpy->extensions[3] = NULL;
if (!dri2_create_screen(disp)) if (!dri2_create_screen(disp))
goto cleanup_driver; goto cleanup_driver;
@@ -691,12 +852,13 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_driver: cleanup_driver:
dlclose(dri2_dpy->driver); dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name: cleanup_driver_name:
free(dri2_dpy->driver_name); free(dri2_dpy->driver_name);
cleanup_fd: cleanup_fd:
close(dri2_dpy->fd); close(dri2_dpy->fd);
cleanup_drm:
free(dri2_dpy->device_name);
wl_drm_destroy(dri2_dpy->wl_drm);
cleanup_dpy: cleanup_dpy:
free(dri2_dpy); free(dri2_dpy);

View File

@@ -479,10 +479,19 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
xcb_generic_error_t *error; xcb_generic_error_t *error;
xcb_screen_iterator_t s; xcb_screen_iterator_t s;
char *driver_name, *device_name; char *driver_name, *device_name;
const xcb_query_extension_reply_t *extension;
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id); xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id); xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
if (!(extension && extension->present))
return EGL_FALSE;
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
if (!(extension && extension->present))
return EGL_FALSE;
xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn, xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MAJOR_VERSION,
XCB_XFIXES_MINOR_VERSION); XCB_XFIXES_MINOR_VERSION);
@@ -784,7 +793,7 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
(void) ctx; (void) ctx;
drawable = (xcb_drawable_t) buffer; drawable = (xcb_drawable_t) (uintptr_t) buffer;
xcb_dri2_create_drawable (dri2_dpy->conn, drawable); xcb_dri2_create_drawable (dri2_dpy->conn, drawable);
attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT; attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT;
buffers_cookie = buffers_cookie =
@@ -906,9 +915,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_dpy; goto cleanup_dpy;
} }
dri2_dpy->driver_name = dri2_strndup("swrast", strlen("swrast")); if (!dri2_load_driver_swrast(disp))
if (!dri2_load_driver(disp))
goto cleanup_conn; goto cleanup_conn;
dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER; dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;

View File

@@ -1,8 +1,10 @@
/************************************************************************** /**************************************************************************
* *
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved. * All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to * distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice (including the * The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions * next paragraph) shall be included in all copies or substantial portions
* of the Software. * of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
**************************************************************************/ **************************************************************************/

View File

@@ -58,11 +58,20 @@ LOCAL_LIBS =
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2) ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += -lgbm
endif
EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif endif
EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx) ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* Public EGL API entrypoints * Public EGL API entrypoints
* *
@@ -914,7 +944,7 @@ eglGetProcAddress(const char *procname)
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA }, { "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA }, { "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif #endif
#ifdef EGL_WL_bind_display #ifdef EGL_WL_bind_wayland_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL }, { "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL }, { "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif #endif
@@ -1168,7 +1198,7 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
EGLDisplay EGLAPIENTRY EGLDisplay EGLAPIENTRY
eglGetDRMDisplayMESA(int fd) eglGetDRMDisplayMESA(int fd)
{ {
_EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) fd); _EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) (intptr_t) fd);
return _eglGetDisplayHandle(dpy); return _eglGetDisplayHandle(dpy);
} }

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLAPI_INCLUDED #ifndef EGLAPI_INCLUDED
#define EGLAPI_INCLUDED #define EGLAPI_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLARRAY_INCLUDED #ifndef EGLARRAY_INCLUDED
#define EGLARRAY_INCLUDED #define EGLARRAY_INCLUDED

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCOMPILER_INCLUDED #ifndef EGLCOMPILER_INCLUDED
#define EGLCOMPILER_INCLUDED #define EGLCOMPILER_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* EGL Configuration (pixel format) functions. * EGL Configuration (pixel format) functions.
*/ */
@@ -456,8 +486,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
return EGL_FALSE; return EGL_FALSE;
switch (attr) { switch (attr) {
case EGL_MATCH_NATIVE_PIXMAP:
return EGL_FALSE;
case EGL_Y_INVERTED_NOK: case EGL_Y_INVERTED_NOK:
return conf->Display->Extensions.NOK_texture_from_pixmap; return conf->Display->Extensions.NOK_texture_from_pixmap;
default: default:
@@ -739,6 +767,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
{ {
if (!_eglIsConfigAttribValid(conf, attribute)) if (!_eglIsConfigAttribValid(conf, attribute))
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib"); return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
/* nonqueryable attributes */
switch (attribute) {
case EGL_MATCH_NATIVE_PIXMAP:
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
break;
default:
break;
}
if (!value) if (!value)
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib"); return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONFIG_INCLUDED #ifndef EGLCONFIG_INCLUDED
#define EGLCONFIG_INCLUDED #define EGLCONFIG_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONTEXT_INCLUDED #ifndef EGLCONTEXT_INCLUDED
#define EGLCONTEXT_INCLUDED #define EGLCONTEXT_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "egllog.h" #include "egllog.h"

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCURRENT_INCLUDED #ifndef EGLCURRENT_INCLUDED
#define EGLCURRENT_INCLUDED #define EGLCURRENT_INCLUDED

View File

@@ -1,8 +1,8 @@
/************************************************************************** /**************************************************************************
* *
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved. * All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@@ -10,23 +10,22 @@
* distribute, sub license, and/or sell copies of the Software, and to * distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice (including the * The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions * next paragraph) shall be included in all copies or substantial portions
* of the Software. * of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
**************************************************************************/ **************************************************************************/
/** /**
* Internal EGL defines * Internal EGL defines
*/ */

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* Functions related to EGLDisplay. * Functions related to EGLDisplay.
*/ */

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLDISPLAY_INCLUDED #ifndef EGLDISPLAY_INCLUDED
#define EGLDISPLAY_INCLUDED #define EGLDISPLAY_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* Functions for choosing and opening/loading device drivers. * Functions for choosing and opening/loading device drivers.
*/ */

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLDRIVER_INCLUDED #ifndef EGLDRIVER_INCLUDED
#define EGLDRIVER_INCLUDED #define EGLDRIVER_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <string.h> #include <string.h>
#include "egltypedefs.h" #include "egltypedefs.h"
#include "egldriver.h" #include "egldriver.h"

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include "eglglobals.h" #include "eglglobals.h"

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLGLOBALS_INCLUDED #ifndef EGLGLOBALS_INCLUDED
#define EGLGLOBALS_INCLUDED #define EGLGLOBALS_INCLUDED

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLIMAGE_INCLUDED #ifndef EGLIMAGE_INCLUDED
#define EGLIMAGE_INCLUDED #define EGLIMAGE_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* Logging facility for debug/info messages. * Logging facility for debug/info messages.
* _EGL_FATAL messages are printed to stderr * _EGL_FATAL messages are printed to stderr

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLLOG_INCLUDED #ifndef EGLLOG_INCLUDED
#define EGLLOG_INCLUDED #define EGLLOG_INCLUDED

View File

@@ -1,8 +1,10 @@
/************************************************************************** /**************************************************************************
* *
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved. * All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to * distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice (including the * The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions * next paragraph) shall be included in all copies or substantial portions
* of the Software. * of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
**************************************************************************/ **************************************************************************/

View File

@@ -1,8 +1,10 @@
/************************************************************************** /**************************************************************************
* *
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved. * All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to * distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice (including the * The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions * next paragraph) shall be included in all copies or substantial portions
* of the Software. * of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
**************************************************************************/ **************************************************************************/

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLMODE_INCLUDED #ifndef EGLMODE_INCLUDED
#define EGLMODE_INCLUDED #define EGLMODE_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLMUTEX_INCLUDED #ifndef EGLMUTEX_INCLUDED
#define EGLMUTEX_INCLUDED #define EGLMUTEX_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/* /*
* Ideas for screen management extension to EGL. * Ideas for screen management extension to EGL.
* *

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSCREEN_INCLUDED #ifndef EGLSCREEN_INCLUDED
#define EGLSCREEN_INCLUDED #define EGLSCREEN_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* String utils. * String utils.
*/ */

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSTRING_INCLUDED #ifndef EGLSTRING_INCLUDED
#define EGLSTRING_INCLUDED #define EGLSTRING_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/** /**
* Surface-related functions. * Surface-related functions.
*/ */

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSURFACE_INCLUDED #ifndef EGLSURFACE_INCLUDED
#define EGLSURFACE_INCLUDED #define EGLSURFACE_INCLUDED

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <string.h> #include <string.h>
#include "eglsync.h" #include "eglsync.h"

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLSYNC_INCLUDED #ifndef EGLSYNC_INCLUDED
#define EGLSYNC_INCLUDED #define EGLSYNC_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLTYPEDEFS_INCLUDED #ifndef EGLTYPEDEFS_INCLUDED
#define EGLTYPEDEFS_INCLUDED #define EGLTYPEDEFS_INCLUDED

View File

@@ -34,6 +34,7 @@ depend:
clean: clean:
rm -rf libwayland-drm.a $(wayland_drm_OBJECTS) \ rm -rf libwayland-drm.a $(wayland_drm_OBJECTS) \
$(GEN_SOURCES) $(GEN_HEADERS) $(GEN_SOURCES) $(GEN_HEADERS)
rm -f depend depend.bak
install: install:
@echo -n "" @echo -n ""

View File

@@ -1,8 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<protocol name="drm"> <protocol name="drm">
<copyright>
Copyright © 2008-2011 Kristian Høgsberg
Copyright © 2010-2011 Intel Corporation
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that\n the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>
<!-- drm support. This object is created by the server and published <!-- drm support. This object is created by the server and published
using the display's global event. --> using the display's global event. -->
<interface name="drm" version="1"> <interface name="wl_drm" version="1">
<enum name="error">
<entry name="authenticate_fail" value="0"/>
<entry name="invalid_visual" value="1"/>
<entry name="invalid_name" value="2"/>
</enum>
<!-- Call this request with the magic received from drmGetMagic(). <!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be DRIAuthConnection() call. This authentication must be
@@ -14,12 +47,12 @@
<!-- Create a wayland buffer for the named DRM buffer. The DRM <!-- Create a wayland buffer for the named DRM buffer. The DRM
surface must have a name using the flink ioctl --> surface must have a name using the flink ioctl -->
<request name="create_buffer"> <request name="create_buffer">
<arg name="id" type="new_id" interface="buffer"/> <arg name="id" type="new_id" interface="wl_buffer"/>
<arg name="name" type="uint"/> <arg name="name" type="uint"/>
<arg name="width" type="int"/> <arg name="width" type="int"/>
<arg name="height" type="int"/> <arg name="height" type="int"/>
<arg name="stride" type="uint"/> <arg name="stride" type="uint"/>
<arg name="visual" type="object" interface="visual"/> <arg name="visual" type="object" interface="wl_visual"/>
</request> </request>
<!-- Notification of the path of the drm device which is used by <!-- Notification of the path of the drm device which is used by

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright © 2011 Kristian Høgsberg * Copyright © 2011 Kristian Høgsberg
* Copyright © 2011 Benjamin Franzke
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@@ -35,25 +36,26 @@
#include "wayland-drm.h" #include "wayland-drm.h"
#include "wayland-drm-server-protocol.h" #include "wayland-drm-server-protocol.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglimage.h"
#include "egltypedefs.h"
struct wl_drm { struct wl_drm {
struct wl_object object; struct wl_object object;
struct wl_display *display; struct wl_display *display;
_EGLDisplay *edisp; void *user_data;
char *device_name; char *device_name;
authenticate_t authenticate;
struct wayland_drm_callbacks *callbacks;
};
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
void *driver_buffer;
}; };
static void static void
drm_buffer_damage(struct wl_buffer *buffer_base, buffer_damage(struct wl_client *client, struct wl_buffer *buffer,
struct wl_surface *surface, int32_t x, int32_t y, int32_t width, int32_t height)
int32_t x, int32_t y, int32_t width, int32_t height)
{ {
} }
@@ -61,19 +63,21 @@ static void
destroy_buffer(struct wl_resource *resource, struct wl_client *client) destroy_buffer(struct wl_resource *resource, struct wl_client *client)
{ {
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) resource; struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) resource;
_EGLDriver *drv = buffer->drm->edisp->Driver; struct wl_drm *drm = buffer->drm;
drv->API.DestroyImageKHR(drv, buffer->drm->edisp, buffer->image); drm->callbacks->release_buffer(drm->user_data,
buffer->driver_buffer);
free(buffer); free(buffer);
} }
static void static void
buffer_destroy(struct wl_client *client, struct wl_buffer *buffer) buffer_destroy(struct wl_client *client, struct wl_buffer *buffer)
{ {
wl_resource_destroy(&buffer->resource, client); wl_resource_destroy(&buffer->resource, client, 0);
} }
const static struct wl_buffer_interface buffer_interface = { const static struct wl_buffer_interface drm_buffer_interface = {
buffer_damage,
buffer_destroy buffer_destroy
}; };
@@ -83,62 +87,42 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
uint32_t stride, struct wl_visual *visual) uint32_t stride, struct wl_visual *visual)
{ {
struct wl_drm_buffer *buffer; struct wl_drm_buffer *buffer;
EGLint attribs[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
_EGLDriver *drv = drm->edisp->Driver;
buffer = malloc(sizeof *buffer); buffer = calloc(1, sizeof *buffer);
if (buffer == NULL) { if (buffer == NULL) {
wl_client_post_no_memory(client); wl_client_post_no_memory(client);
return; return;
} }
buffer->drm = drm; buffer->drm = drm;
buffer->buffer.compositor = NULL;
buffer->buffer.width = width; buffer->buffer.width = width;
buffer->buffer.height = height; buffer->buffer.height = height;
buffer->buffer.visual = visual; buffer->buffer.visual = visual;
buffer->buffer.attach = NULL; buffer->buffer.client = client;
buffer->buffer.damage = drm_buffer_damage;
if (visual->object.interface != &wl_visual_interface) { if (!visual || visual->object.interface != &wl_visual_interface) {
/* FIXME: Define a real exception event instead of wl_client_post_error(client, &drm->object,
* abusing this one */ WL_DRM_ERROR_INVALID_VISUAL,
wl_client_post_event(client, "invalid visual");
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "invalid visual in create_buffer\n");
return; return;
} }
attribs[1] = width; buffer->driver_buffer =
attribs[3] = height; drm->callbacks->reference_buffer(drm->user_data, name,
attribs[5] = stride / 4; width, height,
buffer->image = drv->API.CreateImageKHR(drv, drm->edisp, stride, visual);
EGL_NO_CONTEXT,
EGL_DRM_BUFFER_MESA,
(EGLClientBuffer) (intptr_t) name,
attribs);
if (buffer->image == NULL) { if (buffer->driver_buffer == NULL) {
/* FIXME: Define a real exception event instead of wl_client_post_error(client, &drm->object,
* abusing this one */ WL_DRM_ERROR_INVALID_NAME,
wl_client_post_event(client, "invalid name");
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "failed to create image for name %d\n", name);
return; return;
} }
buffer->buffer.resource.object.id = id; buffer->buffer.resource.object.id = id;
buffer->buffer.resource.object.interface = &wl_buffer_interface; buffer->buffer.resource.object.interface = &wl_buffer_interface;
buffer->buffer.resource.object.implementation = (void (**)(void)) buffer->buffer.resource.object.implementation = (void (**)(void))
&buffer_interface; &drm_buffer_interface;
buffer->buffer.resource.destroy = destroy_buffer; buffer->buffer.resource.destroy = destroy_buffer;
@@ -149,10 +133,10 @@ static void
drm_authenticate(struct wl_client *client, drm_authenticate(struct wl_client *client,
struct wl_drm *drm, uint32_t id) struct wl_drm *drm, uint32_t id)
{ {
if (drm->authenticate(drm->edisp, id) < 0) if (drm->callbacks->authenticate(drm->user_data, id) < 0)
wl_client_post_event(client, wl_client_post_error(client, &drm->object,
(struct wl_object *) drm->display, WL_DRM_ERROR_AUTHENTICATE_FAIL,
WL_DISPLAY_INVALID_OBJECT, 0); "authenicate failed");
else else
wl_client_post_event(client, &drm->object, wl_client_post_event(client, &drm->object,
WL_DRM_AUTHENTICATED); WL_DRM_AUTHENTICATED);
@@ -164,7 +148,8 @@ const static struct wl_drm_interface drm_interface = {
}; };
static void static void
post_drm_device(struct wl_client *client, struct wl_object *global) post_drm_device(struct wl_client *client,
struct wl_object *global, uint32_t version)
{ {
struct wl_drm *drm = (struct wl_drm *) global; struct wl_drm *drm = (struct wl_drm *) global;
@@ -172,17 +157,17 @@ post_drm_device(struct wl_client *client, struct wl_object *global)
} }
struct wl_drm * struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp, wayland_drm_init(struct wl_display *display, char *device_name,
authenticate_t authenticate, char *device_name) struct wayland_drm_callbacks *callbacks, void *user_data)
{ {
struct wl_drm *drm; struct wl_drm *drm;
drm = malloc(sizeof *drm); drm = malloc(sizeof *drm);
drm->display = display; drm->display = display;
drm->edisp = disp;
drm->authenticate = authenticate;
drm->device_name = strdup(device_name); drm->device_name = strdup(device_name);
drm->callbacks = callbacks;
drm->user_data = user_data;
drm->object.interface = &wl_drm_interface; drm->object.interface = &wl_drm_interface;
drm->object.implementation = (void (**)(void)) &drm_interface; drm->object.implementation = (void (**)(void)) &drm_interface;
@@ -193,7 +178,7 @@ wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
} }
void void
wayland_drm_destroy(struct wl_drm *drm) wayland_drm_uninit(struct wl_drm *drm)
{ {
free(drm->device_name); free(drm->device_name);
@@ -201,3 +186,18 @@ wayland_drm_destroy(struct wl_drm *drm)
free(drm); free(drm);
} }
int
wayland_buffer_is_drm(struct wl_buffer *buffer)
{
return buffer->resource.object.implementation ==
(void (**)(void)) &drm_buffer_interface;
}
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer_base)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;
return buffer->driver_buffer;
}

View File

@@ -8,19 +8,27 @@
struct wl_drm; struct wl_drm;
typedef int (*authenticate_t) (_EGLDisplay *disp, uint32_t id); struct wayland_drm_callbacks {
int (*authenticate)(void *user_data, uint32_t id);
struct wl_drm_buffer { void *(*reference_buffer)(void *user_data, uint32_t name,
struct wl_buffer buffer; int32_t width, int32_t height,
struct wl_drm *drm; uint32_t stride, struct wl_visual *visual);
_EGLImage *image;
void (*release_buffer)(void *user_data, void *buffer);
}; };
struct wl_drm * struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp, wayland_drm_init(struct wl_display *display, char *device_name,
authenticate_t authenticate, char *device_name); struct wayland_drm_callbacks *callbacks, void *user_data);
void void
wayland_drm_destroy(struct wl_drm *drm); wayland_drm_uninit(struct wl_drm *drm);
int
wayland_buffer_is_drm(struct wl_buffer *buffer);
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer);
#endif #endif

View File

@@ -12,20 +12,8 @@ extern "C" {
#define WL_EGL_EXPORT #define WL_EGL_EXPORT
#endif #endif
#include <stdbool.h>
#include <wayland-client.h> #include <wayland-client.h>
struct wl_egl_display {
struct wl_display *display;
struct wl_drm *drm;
int fd;
char *device_name;
bool authenticated;
void (*glFlush)(void);
};
struct wl_egl_window { struct wl_egl_window {
struct wl_surface *surface; struct wl_surface *surface;
struct wl_visual *visual; struct wl_visual *visual;
@@ -40,13 +28,11 @@ struct wl_egl_window {
}; };
struct wl_egl_pixmap { struct wl_egl_pixmap {
struct wl_egl_display *display; struct wl_visual *visual;
struct wl_visual *visual; struct wl_buffer *buffer;
int name;
int width; int width;
int height; int height;
int stride;
void (*destroy) (struct wl_egl_pixmap *egl_pixmap); void (*destroy) (struct wl_egl_pixmap *egl_pixmap);

View File

@@ -1,130 +1,8 @@
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
#include <wayland-client.h> #include <wayland-client.h>
#include "wayland-egl.h" #include "wayland-egl.h"
#include "wayland-egl-priv.h" #include "wayland-egl-priv.h"
#include "wayland-drm-client-protocol.h"
#include <xf86drm.h>
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct wl_egl_display *egl_display = data;
drm_magic_t magic;
egl_display->device_name = strdup(device);
egl_display->fd = open(egl_display->device_name, O_RDWR);
if (egl_display->fd == -1) {
fprintf(stderr, "wayland-egl: could not open %s (%s)",
egl_display->device_name, strerror(errno));
return;
}
drmGetMagic(egl_display->fd, &magic);
wl_drm_authenticate(egl_display->drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct wl_egl_display *egl_display = data;
egl_display->authenticated = true;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
static void
wl_display_handle_global(struct wl_display *display, uint32_t id,
const char *interface, uint32_t version, void *data)
{
struct wl_egl_display *egl_display = data;
if (strcmp(interface, "drm") == 0) {
egl_display->drm = wl_drm_create(display, id);
wl_drm_add_listener(egl_display->drm, &drm_listener,
egl_display);
}
}
/* stolen from egl_dri2:dri2_load() */
static void *
get_flush_address() {
void *handle;
void *(*get_proc_address)(const char *procname);
handle = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);
if (handle) {
get_proc_address = (void* (*)(const char *))
dlsym(handle, "_glapi_get_proc_address");
/* no need to keep a reference */
dlclose(handle);
}
/*
* If glapi is not available, loading DRI drivers will fail. Ideally, we
* should load one of libGL, libGLESv1_CM, or libGLESv2 and go on. But if
* the app has loaded another one of them with RTLD_LOCAL, there may be
* unexpected behaviors later because there will be two copies of glapi
* (with global variables of the same names!) in the memory.
*/
if (!get_proc_address) {
fprintf(stderr, "failed to find _glapi_get_proc_address");
return NULL;
}
return get_proc_address("glFlush");
}
WL_EGL_EXPORT struct wl_egl_display *
wl_egl_display_create(struct wl_display *display)
{
struct wl_egl_display *egl_display;
egl_display = malloc(sizeof *egl_display);
if (!egl_display)
return NULL;
egl_display->display = display;
egl_display->drm = NULL;
egl_display->fd = -1;
egl_display->device_name = NULL;
egl_display->authenticated = false;
egl_display->glFlush = (void (*)(void)) get_flush_address();
wl_display_add_global_listener(display, wl_display_handle_global,
egl_display);
return egl_display;
}
WL_EGL_EXPORT void
wl_egl_display_destroy(struct wl_egl_display *egl_display)
{
free(egl_display->device_name);
close(egl_display->fd);
wl_drm_destroy(egl_display->drm);
free(egl_display);
}
WL_EGL_EXPORT void WL_EGL_EXPORT void
wl_egl_window_resize(struct wl_egl_window *egl_window, wl_egl_window_resize(struct wl_egl_window *egl_window,
@@ -138,8 +16,7 @@ wl_egl_window_resize(struct wl_egl_window *egl_window,
} }
WL_EGL_EXPORT struct wl_egl_window * WL_EGL_EXPORT struct wl_egl_window *
wl_egl_window_create(struct wl_egl_display *egl_display, wl_egl_window_create(struct wl_surface *surface,
struct wl_surface *surface,
int width, int height, int width, int height,
struct wl_visual *visual) struct wl_visual *visual)
{ {
@@ -175,8 +52,7 @@ wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
} }
WL_EGL_EXPORT struct wl_egl_pixmap * WL_EGL_EXPORT struct wl_egl_pixmap *
wl_egl_pixmap_create(struct wl_egl_display *egl_display, wl_egl_pixmap_create(int width, int height,
int width, int height,
struct wl_visual *visual, uint32_t flags) struct wl_visual *visual, uint32_t flags)
{ {
struct wl_egl_pixmap *egl_pixmap; struct wl_egl_pixmap *egl_pixmap;
@@ -185,14 +61,13 @@ wl_egl_pixmap_create(struct wl_egl_display *egl_display,
if (egl_pixmap == NULL) if (egl_pixmap == NULL)
return NULL; return NULL;
egl_pixmap->display = egl_display;
egl_pixmap->width = width; egl_pixmap->width = width;
egl_pixmap->height = height; egl_pixmap->height = height;
egl_pixmap->visual = visual; egl_pixmap->visual = visual;
egl_pixmap->name = 0;
egl_pixmap->stride = 0;
egl_pixmap->destroy = NULL; egl_pixmap->destroy = NULL;
egl_pixmap->buffer = NULL;
egl_pixmap->driver_private = NULL;
return egl_pixmap; return egl_pixmap;
} }
@@ -206,21 +81,7 @@ wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
} }
WL_EGL_EXPORT struct wl_buffer * WL_EGL_EXPORT struct wl_buffer *
wl_egl_pixmap_create_buffer(struct wl_egl_display *egl_display, wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
struct wl_egl_pixmap *egl_pixmap)
{ {
if (egl_pixmap->name == 0) return egl_pixmap->buffer;
return NULL;
return wl_drm_create_buffer(egl_display->drm, egl_pixmap->name,
egl_pixmap->width, egl_pixmap->height,
egl_pixmap->stride, egl_pixmap->visual);
}
WL_EGL_EXPORT void
wl_egl_pixmap_flush(struct wl_egl_display *egl_display,
struct wl_egl_pixmap *egl_pixmap)
{
if (egl_display->glFlush)
egl_display->glFlush();
} }

View File

@@ -53,7 +53,7 @@ if env['drm']:
# Needed by some state trackers # Needed by some state trackers
SConscript('winsys/sw/null/SConscript') SConscript('winsys/sw/null/SConscript')
if env['platform'] != 'embedded': if not env['embedded']:
SConscript('state_trackers/vega/SConscript') SConscript('state_trackers/vega/SConscript')
SConscript('state_trackers/egl/SConscript') SConscript('state_trackers/egl/SConscript')
@@ -66,8 +66,8 @@ if env['platform'] != 'embedded':
if env['dri'] and env['xorg']: if env['dri'] and env['xorg']:
SConscript('state_trackers/xorg/SConscript') SConscript('state_trackers/xorg/SConscript')
if env['platform'] == 'windows': if env['platform'] == 'windows':
SConscript('state_trackers/wgl/SConscript') SConscript('state_trackers/wgl/SConscript')
# #
# Winsys # Winsys
@@ -83,55 +83,55 @@ SConscript([
'targets/graw-null/SConscript', 'targets/graw-null/SConscript',
]) ])
if env['platform'] != 'embedded': if not env['embedded']:
SConscript([ SConscript([
'targets/egl-static/SConscript' 'targets/egl-static/SConscript'
]) ])
if env['x11']: if env['x11']:
SConscript([
'targets/graw-xlib/SConscript',
'targets/libgl-xlib/SConscript',
])
if env['platform'] == 'windows':
SConscript([
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
])
if env['dri']:
SConscript([
'targets/SConscript.dri',
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
#'targets/dri-nouveau/SConscript',
])
if env['drm_intel']:
SConscript([ SConscript([
'targets/dri-i915/SConscript', 'targets/graw-xlib/SConscript',
'targets/dri-i965/SConscript', 'targets/libgl-xlib/SConscript',
])
if env['drm_radeon']:
SConscript([
'targets/dri-r300/SConscript',
'targets/dri-r600/SConscript',
]) ])
if env['xorg'] and env['drm']: if env['platform'] == 'windows':
SConscript([ SConscript([
#'targets/xorg-i915/SConscript', 'targets/graw-gdi/SConscript',
#'targets/xorg-i965/SConscript', 'targets/libgl-gdi/SConscript',
#'targets/xorg-nouveau/SConscript', ])
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript', if env['dri']:
]) SConscript([
'targets/SConscript.dri',
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
#'targets/dri-nouveau/SConscript',
])
if env['drm_intel']:
SConscript([
'targets/dri-i915/SConscript',
'targets/dri-i965/SConscript',
])
if env['drm_radeon']:
SConscript([
'targets/dri-r300/SConscript',
'targets/dri-r600/SConscript',
])
if env['xorg'] and env['drm']:
SConscript([
#'targets/xorg-i915/SConscript',
#'targets/xorg-i965/SConscript',
#'targets/xorg-nouveau/SConscript',
#'targets/xorg-radeon/SConscript',
'targets/xorg-vmwgfx/SConscript',
])
# #
# Unit tests & tools # Unit tests & tools
# #
if env['platform'] != 'embedded': if not env['embedded']:
SConscript('tests/unit/SConscript') SConscript('tests/unit/SConscript')
SConscript('tests/graw/SConscript') SConscript('tests/graw/SConscript')

View File

@@ -44,7 +44,7 @@ C_SOURCES = \
draw/draw_vs_exec.c \ draw/draw_vs_exec.c \
draw/draw_vs_ppc.c \ draw/draw_vs_ppc.c \
draw/draw_vs_sse.c \ draw/draw_vs_sse.c \
draw/draw_vs_varient.c \ draw/draw_vs_variant.c \
indices/u_indices_gen.c \ indices/u_indices_gen.c \
indices/u_unfilled_gen.c \ indices/u_unfilled_gen.c \
os/os_misc.c \ os/os_misc.c \

View File

@@ -88,7 +88,7 @@ source = [
'draw/draw_vs_exec.c', 'draw/draw_vs_exec.c',
'draw/draw_vs_ppc.c', 'draw/draw_vs_ppc.c',
'draw/draw_vs_sse.c', 'draw/draw_vs_sse.c',
'draw/draw_vs_varient.c', 'draw/draw_vs_variant.c',
#'indices/u_indices.c', #'indices/u_indices.c',
#'indices/u_unfilled_indices.c', #'indices/u_unfilled_indices.c',
'indices/u_indices_gen.c', 'indices/u_indices_gen.c',

View File

@@ -37,13 +37,7 @@
struct cso_cache { struct cso_cache {
struct cso_hash *blend_hash; struct cso_hash *hashes[CSO_CACHE_MAX];
struct cso_hash *depth_stencil_hash;
struct cso_hash *fs_hash;
struct cso_hash *vs_hash;
struct cso_hash *rasterizer_hash;
struct cso_hash *sampler_hash;
struct cso_hash *velements_hash;
int max_size; int max_size;
cso_sanitize_callback sanitize_cb; cso_sanitize_callback sanitize_cb;
@@ -86,34 +80,10 @@ unsigned cso_construct_key(void *item, int item_size)
return hash_key((item), item_size); return hash_key((item), item_size);
} }
static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type) static INLINE struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
{ {
struct cso_hash *hash = 0; struct cso_hash *hash;
hash = sc->hashes[type];
switch(type) {
case CSO_BLEND:
hash = sc->blend_hash;
break;
case CSO_SAMPLER:
hash = sc->sampler_hash;
break;
case CSO_DEPTH_STENCIL_ALPHA:
hash = sc->depth_stencil_hash;
break;
case CSO_RASTERIZER:
hash = sc->rasterizer_hash;
break;
case CSO_FRAGMENT_SHADER:
hash = sc->fs_hash;
break;
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
case CSO_VELEMENTS:
hash = sc->velements_hash;
break;
}
return hash; return hash;
} }
@@ -298,17 +268,14 @@ void * cso_take_state(struct cso_cache *sc,
struct cso_cache *cso_cache_create(void) struct cso_cache *cso_cache_create(void)
{ {
struct cso_cache *sc = MALLOC_STRUCT(cso_cache); struct cso_cache *sc = MALLOC_STRUCT(cso_cache);
int i;
if (sc == NULL) if (sc == NULL)
return NULL; return NULL;
sc->max_size = 4096; sc->max_size = 4096;
sc->blend_hash = cso_hash_create(); for (i = 0; i < CSO_CACHE_MAX; i++)
sc->sampler_hash = cso_hash_create(); sc->hashes[i] = cso_hash_create();
sc->depth_stencil_hash = cso_hash_create();
sc->rasterizer_hash = cso_hash_create();
sc->fs_hash = cso_hash_create();
sc->vs_hash = cso_hash_create();
sc->velements_hash = cso_hash_create();
sc->sanitize_cb = sanitize_cb; sc->sanitize_cb = sanitize_cb;
sc->sanitize_data = 0; sc->sanitize_data = 0;
@@ -318,33 +285,9 @@ struct cso_cache *cso_cache_create(void)
void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type, void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
cso_state_callback func, void *user_data) cso_state_callback func, void *user_data)
{ {
struct cso_hash *hash = 0; struct cso_hash *hash = _cso_hash_for_type(sc, type);
struct cso_hash_iter iter; struct cso_hash_iter iter;
switch (type) {
case CSO_BLEND:
hash = sc->blend_hash;
break;
case CSO_SAMPLER:
hash = sc->sampler_hash;
break;
case CSO_DEPTH_STENCIL_ALPHA:
hash = sc->depth_stencil_hash;
break;
case CSO_RASTERIZER:
hash = sc->rasterizer_hash;
break;
case CSO_FRAGMENT_SHADER:
hash = sc->fs_hash;
break;
case CSO_VERTEX_SHADER:
hash = sc->vs_hash;
break;
case CSO_VELEMENTS:
hash = sc->velements_hash;
break;
}
iter = cso_hash_first_node(hash); iter = cso_hash_first_node(hash);
while (!cso_hash_iter_is_null(iter)) { while (!cso_hash_iter_is_null(iter)) {
void *state = cso_hash_iter_data(iter); void *state = cso_hash_iter_data(iter);
@@ -357,6 +300,7 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
void cso_cache_delete(struct cso_cache *sc) void cso_cache_delete(struct cso_cache *sc)
{ {
int i;
assert(sc); assert(sc);
if (!sc) if (!sc)
@@ -371,28 +315,20 @@ void cso_cache_delete(struct cso_cache *sc)
cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0); cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0);
cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0); cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0);
cso_hash_delete(sc->blend_hash); for (i = 0; i < CSO_CACHE_MAX; i++)
cso_hash_delete(sc->sampler_hash); cso_hash_delete(sc->hashes[i]);
cso_hash_delete(sc->depth_stencil_hash);
cso_hash_delete(sc->rasterizer_hash);
cso_hash_delete(sc->fs_hash);
cso_hash_delete(sc->vs_hash);
cso_hash_delete(sc->velements_hash);
FREE(sc); FREE(sc);
} }
void cso_set_maximum_cache_size(struct cso_cache *sc, int number) void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
{ {
int i;
sc->max_size = number; sc->max_size = number;
sanitize_hash(sc, sc->blend_hash, CSO_BLEND, sc->max_size); for (i = 0; i < CSO_CACHE_MAX; i++)
sanitize_hash(sc, sc->depth_stencil_hash, CSO_DEPTH_STENCIL_ALPHA, sanitize_hash(sc, sc->hashes[i], i, sc->max_size);
sc->max_size);
sanitize_hash(sc, sc->fs_hash, CSO_FRAGMENT_SHADER, sc->max_size);
sanitize_hash(sc, sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size);
sanitize_hash(sc, sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size);
sanitize_hash(sc, sc->sampler_hash, CSO_SAMPLER, sc->max_size);
sanitize_hash(sc, sc->velements_hash, CSO_VELEMENTS, sc->max_size);
} }
int cso_maximum_cache_size(const struct cso_cache *sc) int cso_maximum_cache_size(const struct cso_cache *sc)

View File

@@ -86,13 +86,14 @@ extern "C" {
#endif #endif
enum cso_cache_type { enum cso_cache_type {
CSO_BLEND,
CSO_SAMPLER,
CSO_DEPTH_STENCIL_ALPHA,
CSO_RASTERIZER, CSO_RASTERIZER,
CSO_BLEND,
CSO_DEPTH_STENCIL_ALPHA,
CSO_FRAGMENT_SHADER, CSO_FRAGMENT_SHADER,
CSO_VERTEX_SHADER, CSO_VERTEX_SHADER,
CSO_VELEMENTS CSO_SAMPLER,
CSO_VELEMENTS,
CSO_CACHE_MAX,
}; };
typedef void (*cso_state_callback)(void *ctx, void *obj); typedef void (*cso_state_callback)(void *ctx, void *obj);

Some files were not shown because too many files have changed in this diff Show More