mesa.git
11 years agoi965: Drop unused simple_list.h includes.
Kenneth Graunke [Tue, 22 Oct 2013 03:56:44 +0000 (20:56 -0700)]
i965: Drop unused simple_list.h includes.

These don't appear to be necessary.  Everything compiles just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agogbm-dri: Support importing RGB565 buffers
Kristian Høgsberg [Fri, 18 Oct 2013 04:21:41 +0000 (21:21 -0700)]
gbm-dri: Support importing RGB565 buffers

11 years agoglsl/linker: Allow mixing of desktop GLSL versions.
Paul Berry [Mon, 14 Oct 2013 01:01:11 +0000 (18:01 -0700)]
glsl/linker: Allow mixing of desktop GLSL versions.

Previously, Mesa followed the linkage rules outlined in the GLSL
1.20-1.40 specs, which (collectively) said that GLSL versions 1.10 and
1.20 could be linked together, but no other versions could be linked.

In GLSL 4.30, the linkage rules were relaxed so that any two desktop
GLSL versions can be linked together.  This change was made because it
reflected the behaviour of nearly all existing implementations (see
Khronos bug 8463).  Mesa was one of the few (perhaps the only)
exceptions to prohibit cross-linking of some GLSL versions.

Since the GLSL linkage rules were deliberately relaxed in order to
match the behaviour of existing implementations, it seems appropriate
to relax the rules in Mesa too (even though Mesa doesn't support GLSL
4.30 yet).

Note that linking ES and desktop shaders is still prohibited, as is
linking ES shaders having different GLSL versions.

Fixes piglit tests "shaders/version-mixing {interstage,intrastage}".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoclover: Improve region and pitch argument handling in memory transfer APIs.
Francisco Jerez [Sat, 19 Oct 2013 01:14:28 +0000 (18:14 -0700)]
clover: Improve region and pitch argument handling in memory transfer APIs.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Add a pixel_size() method to the image class.
Francisco Jerez [Fri, 18 Oct 2013 23:25:36 +0000 (16:25 -0700)]
clover: Add a pixel_size() method to the image class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Implement support for the ICD extension.
Francisco Jerez [Sun, 6 Oct 2013 20:52:02 +0000 (13:52 -0700)]
clover: Implement support for the ICD extension.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Make sure hidden is the default symbol visibility.
Francisco Jerez [Wed, 24 Jul 2013 10:13:40 +0000 (12:13 +0200)]
clover: Make sure hidden is the default symbol visibility.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Prepare the build system for ICD support.
Tom Stellard [Wed, 18 Sep 2013 07:36:55 +0000 (00:36 -0700)]
clover: Prepare the build system for ICD support.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
11 years agoclover: Fix memory leak when initializing a device object fails.
Francisco Jerez [Thu, 19 Sep 2013 03:57:39 +0000 (20:57 -0700)]
clover: Fix memory leak when initializing a device object fails.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Tidy up resource::mapping.
Francisco Jerez [Mon, 16 Sep 2013 06:07:10 +0000 (23:07 -0700)]
clover: Tidy up resource::mapping.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Simplify command_queue::flush().
Francisco Jerez [Mon, 16 Sep 2013 06:04:28 +0000 (23:04 -0700)]
clover: Simplify command_queue::flush().

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Clean up the kernel and program object interface.
Francisco Jerez [Tue, 17 Sep 2013 04:50:40 +0000 (21:50 -0700)]
clover: Clean up the kernel and program object interface.

[ Tom Stellard: Make sure to bind global arguments before retrieving handles. ]
Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Clean up the interface of the context object slightly.
Francisco Jerez [Tue, 17 Sep 2013 04:38:32 +0000 (21:38 -0700)]
clover: Clean up the interface of the context object slightly.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Delete copy constructors and assignment operators in all non-copiable objects.
Francisco Jerez [Tue, 17 Sep 2013 04:44:36 +0000 (21:44 -0700)]
clover: Delete copy constructors and assignment operators in all non-copiable objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Define a few convenience equality operators.
Francisco Jerez [Tue, 17 Sep 2013 04:11:16 +0000 (21:11 -0700)]
clover: Define a few convenience equality operators.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Simplify the platform object by using util/range.
Francisco Jerez [Tue, 17 Sep 2013 04:44:19 +0000 (21:44 -0700)]
clover: Simplify the platform object by using util/range.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Add property list helpers with a syntax consistent with other API objects.
Francisco Jerez [Tue, 17 Sep 2013 04:13:47 +0000 (21:13 -0700)]
clover: Add property list helpers with a syntax consistent with other API objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch samplers to the new model.
Francisco Jerez [Mon, 16 Sep 2013 05:20:43 +0000 (22:20 -0700)]
clover: Switch samplers to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch memory objects to the new model.
Francisco Jerez [Tue, 1 Oct 2013 19:00:51 +0000 (12:00 -0700)]
clover: Switch memory objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch kernel and program objects to the new model.
Francisco Jerez [Wed, 18 Sep 2013 06:20:11 +0000 (23:20 -0700)]
clover: Switch kernel and program objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch command queues to the new model.
Francisco Jerez [Tue, 1 Oct 2013 18:57:32 +0000 (11:57 -0700)]
clover: Switch command queues to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch event objects to the new model.
Francisco Jerez [Tue, 1 Oct 2013 18:54:07 +0000 (11:54 -0700)]
clover: Switch event objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch context objects to the new model.
Francisco Jerez [Mon, 16 Sep 2013 03:50:30 +0000 (20:50 -0700)]
clover: Switch context objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch device objects to the new model.
Francisco Jerez [Mon, 16 Sep 2013 03:06:57 +0000 (20:06 -0700)]
clover: Switch device objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch platform objects to the new model.
Francisco Jerez [Tue, 17 Sep 2013 01:26:04 +0000 (18:26 -0700)]
clover: Switch platform objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Define helper classes for the new object model.
Francisco Jerez [Sun, 6 Oct 2013 20:51:01 +0000 (13:51 -0700)]
clover: Define helper classes for the new object model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Clean up property query functions by using a new property_buffer helper class.
Francisco Jerez [Sun, 6 Oct 2013 20:49:49 +0000 (13:49 -0700)]
clover: Clean up property query functions by using a new property_buffer helper class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Switch to the new utility code.
Francisco Jerez [Sun, 6 Oct 2013 20:49:05 +0000 (13:49 -0700)]
clover: Switch to the new utility code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Name include guards consistently.
Francisco Jerez [Sun, 15 Sep 2013 22:29:34 +0000 (15:29 -0700)]
clover: Name include guards consistently.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Replace a bunch of double underscores with single underscores.
Francisco Jerez [Wed, 18 Sep 2013 06:13:48 +0000 (23:13 -0700)]
clover: Replace a bunch of double underscores with single underscores.

Identifiers with double underscores are reserved, and using them has
undefined behavior according to the C++ spec.  It's unlikely to make
any difference, but...

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Clean up the event profiling code.
Francisco Jerez [Sun, 6 Oct 2013 20:48:23 +0000 (13:48 -0700)]
clover: Clean up the event profiling code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Import new utility library.
Francisco Jerez [Sun, 6 Oct 2013 20:47:19 +0000 (13:47 -0700)]
clover: Import new utility library.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Require GCC 4.7 or higher to build.
Francisco Jerez [Sun, 29 Sep 2013 00:26:50 +0000 (17:26 -0700)]
clover: Require GCC 4.7 or higher to build.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoclover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX
Tom Stellard [Wed, 2 Oct 2013 15:56:20 +0000 (11:56 -0400)]
clover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX

This prevents a build failure on some systems.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
11 years agollvmpipe: enable seamless cube filtering
Roland Scheidegger [Fri, 18 Oct 2013 18:54:01 +0000 (20:54 +0200)]
llvmpipe: enable seamless cube filtering

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallivm: implement seamless cube filtering
Roland Scheidegger [Fri, 18 Oct 2013 18:52:26 +0000 (20:52 +0200)]
gallivm: implement seamless cube filtering

For seamless cube filtering it is necessary to determine new faces and new
coords per sample. The logic for this is _seriously_ complex (what needs
to happen is very "asymmetric" wrt face, x/y under/overflow), further
complicated by the fact that if the 4 samples are in a corner (meaning we
only have actually 3 samples, and all 3 are on different faces) then
falling off the edge is happening _both_ on x and y axis simultaneously.
There was a noticeable performance hit in mesa's cubemap demo when seamless
filtering was forced on (just below 10 percent or so in a debug build, when
disabling all filtering hacks, otherwise it would probably be a bit more) and
when always doing the logic, hence use a branch which it only does it if any
of the pixels in a quad (or in two quads) actually hit this. With that there
was no measurable performance hit in the cubemap demo (neither in a debug nor
release buidl), but this will vary (cubemap demo very rarely hits edges).
Might also be different on other cpus, as this forces SoA sampling path which
potentially can be quite a bit slower.
Note that as for corners, this code gets all the 3 samples which actually
exist right, and the 4th texel will simply be the same as one of the others,
meaning that filter weights will be a bit wrong. This however should be
enough for full OpenGL (but not d3d10) compliance.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agowinsys/radeon: cleanup CS offloading
Christian König [Sat, 12 Oct 2013 16:51:25 +0000 (18:51 +0200)]
winsys/radeon: cleanup CS offloading

Using atomic function for ncs is superfluous since it is
protected by a mutex anyway. Also lock the mutex only once
while retrieving the next CS for submission.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agoradeon: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:59 +0000 (12:39 +0200)]
radeon: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
11 years agor200: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:58 +0000 (12:39 +0200)]
r200: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
11 years agogallium: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:57 +0000 (12:39 +0200)]
gallium: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
11 years agoswrast: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:56 +0000 (12:39 +0200)]
swrast: Enable ARB_texture_mirror_clamp_to_edge.

v2: fix commit message

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
11 years agomesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:55 +0000 (12:39 +0200)]
mesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rico Schüller <kgbricola@web.de>
11 years agoscons: Fix Haiku missing library
Alexander von Gluck IV [Sun, 20 Oct 2013 04:31:50 +0000 (23:31 -0500)]
scons: Fix Haiku missing library

* The softpipe add-on needs libtranslation
  due to the use of BTranslatorRoster

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agodocs: Updating forgotten GL feature completion for r600
Alexandre Demers [Sun, 20 Oct 2013 17:48:05 +0000 (13:48 -0400)]
docs: Updating forgotten GL feature completion for r600

11 years agor300g/compiler: Fix unsigned comparison with less than zero
David Heidelberger [Mon, 7 Oct 2013 16:06:11 +0000 (18:06 +0200)]
r300g/compiler: Fix unsigned comparison with less than zero

rc_find_free_temporary_list() returns signed integer
(in case of lack of free temporary registers returns -1),
so new_index in radeon_rename_regs() should be signed.

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

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
11 years agor600g/sb: Initialize shader::dce_flags.
Vinson Lee [Sat, 19 Oct 2013 02:15:37 +0000 (19:15 -0700)]
r600g/sb: Initialize shader::dce_flags.

Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agoi965: Mark G45 as having surface tile offset support.
Kenneth Graunke [Fri, 18 Oct 2013 23:14:05 +0000 (16:14 -0700)]
i965: Mark G45 as having surface tile offset support.

Fixes a regression since 02b632d8e8f2b14c155740d28c276b5869305c60.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglsl: Initialize per_vertex_accumulator::fields.
Vinson Lee [Sat, 12 Oct 2013 06:14:47 +0000 (23:14 -0700)]
glsl: Initialize per_vertex_accumulator::fields.

Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agomesa: Remove GLXContextID typedef from glx.h.
Vinson Lee [Sat, 19 Oct 2013 00:40:40 +0000 (17:40 -0700)]
mesa: Remove GLXContextID typedef from glx.h.

Fixes this build error.

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
11 years agodocs: Import 9.2.2 release notes, add news item.
Carl Worth [Sat, 19 Oct 2013 00:19:31 +0000 (17:19 -0700)]
docs: Import 9.2.2 release notes, add news item.

11 years agodocs: Note that we support OpenGL 3.3 in the release notes.
Kenneth Graunke [Fri, 18 Oct 2013 06:21:24 +0000 (23:21 -0700)]
docs: Note that we support OpenGL 3.3 in the release notes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965: Enable OpenGL 3.3 and GLSL 3.30.
Kenneth Graunke [Fri, 18 Oct 2013 06:14:23 +0000 (23:14 -0700)]
i965: Enable OpenGL 3.3 and GLSL 3.30.

Everything necessary for these appears to be implemented.  We'll want to
add more tests to guard against bugs, but it should be functionally
complete.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agotranslate_sse: Fix generated code argument handling for msabi on x86_64
Jon TURNEY [Thu, 3 Oct 2013 20:15:11 +0000 (21:15 +0100)]
translate_sse: Fix generated code argument handling for msabi on x86_64

translate_sse.c contains code for msabi on x86_64, but it appears to be
untested.

Currently arguments 1 and 2 passed to the generated code are moved as 32-bit
quantities into the registers used by sysvabi, irrespective of the architecture.
Since these may be pointers, they must be moved as 64-bit quantities to avoid
truncation.

Commit f4dd0991719ef3e2606920c5100b372181c60899 disabled tranlate_sse.c on MinGW
x86_64, I don't know if was due to this issue, or a different one...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agortasm: Cygwin uses the msabi calling convention on x86_64
Jon TURNEY [Thu, 3 Oct 2013 20:11:52 +0000 (21:11 +0100)]
rtasm: Cygwin uses the msabi calling convention on x86_64

Cygwin also uses the msabi calling convention on x86_64, not the sysvabi calling
convention

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
ignored, and an empty message aborts the commit.

11 years agortasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation...
Jon TURNEY [Sat, 21 Sep 2013 16:16:37 +0000 (17:16 +0100)]
rtasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap()

The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation
which uses mmap() to allocate an anonymous page with execute permission, rather
than the one which just uses malloc().

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoscons: Simplified fix of llvm cxxflags for rtti
Alexander von Gluck IV [Thu, 17 Oct 2013 01:24:13 +0000 (20:24 -0500)]
scons: Simplified fix of llvm cxxflags for rtti

* Based on ideas of Jose Fonseca
* A rework of ce8eadb6e8

Tested-by: Vinson Lee <vlee@freedesktop.org>
11 years agoglsl: Fix MSVC build (missing strcasecmp())
Paul Berry [Thu, 17 Oct 2013 20:47:35 +0000 (13:47 -0700)]
glsl: Fix MSVC build (missing strcasecmp())

MSVC doesn't have a strcasecmp() function; it uses _stricmp() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agoi965: Fold brwInitVtbl() into brwCreateContext().
Kenneth Graunke [Tue, 15 Oct 2013 23:17:15 +0000 (16:17 -0700)]
i965: Fold brwInitVtbl() into brwCreateContext().

With most of the virtual functions gone, brwInitVtbl() is now tiny.

Merging it into the caller allows us to delete the entire file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Merge brw_destroy_context() into intelDestroyContext().
Kenneth Graunke [Tue, 15 Oct 2013 23:13:45 +0000 (16:13 -0700)]
i965: Merge brw_destroy_context() into intelDestroyContext().

Now that i915 and i965 have been split, the separation between
intelDestroyContext and brw_destroy_context is kind of arbitrary.

This patch replaces the only brw->vtbl.destroy() call with the body
of brw_destroy_context (the only implementation of that virtual
function).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Replace dri_bo_release with drm_intel_bo_unreference.
Kenneth Graunke [Tue, 15 Oct 2013 23:09:22 +0000 (16:09 -0700)]
i965: Replace dri_bo_release with drm_intel_bo_unreference.

dri_bo_release is a helper function that calls drm_intel_bo_unreference
but then also sets the pointer to NULL.  This is unnecessary, since
brw_destroy_context is called from intelDestroyContext, which also frees
brw completely.

If you're still trying to access them, you've got bigger problems.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Unindent the body of intelDestroyContext.
Kenneth Graunke [Tue, 15 Oct 2013 23:06:59 +0000 (16:06 -0700)]
i965: Unindent the body of intelDestroyContext.

Having almost the entire body of the function indented one level for a
check that should never happen seems silly.  Just early return.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Un-virtualize brw_new_batch().
Kenneth Graunke [Tue, 15 Oct 2013 23:00:16 +0000 (16:00 -0700)]
i965: Un-virtualize brw_new_batch().

Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Un-virtualize brw_finish_batch().
Kenneth Graunke [Tue, 15 Oct 2013 22:55:42 +0000 (15:55 -0700)]
i965: Un-virtualize brw_finish_batch().

Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglsl: In update_max_array_access, fix interface instance check.
Paul Berry [Tue, 15 Oct 2013 16:43:22 +0000 (09:43 -0700)]
glsl: In update_max_array_access, fix interface instance check.

In commit f878d20 (glsl: Update ir_variable::max_ifc_array_access
properly), I accidentally used the wrong kind of check to determine
whether the variable being accessed was an interface instance (I used
var->get_interface_type() != NULL when I should have used
var->is_interface_instance()).  As a result, if an unnamed interface
block contained a struct which contained an array,
update_max_array_access() would mistakenly interpret the struct as a
named interface block and try to dereference a null
var->max_ifc_array_access.

This patch corrects the check, fixing the null dereference.

Fixes piglit test interface-block-struct-nesting.

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

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoglsl: Treat layout-qualifier-id's as case-insensitive in desktop GLSL.
Paul Berry [Wed, 16 Oct 2013 00:25:44 +0000 (17:25 -0700)]
glsl: Treat layout-qualifier-id's as case-insensitive in desktop GLSL.

In desktop GLSL, location qualifiers are case-insensitive.  In GLSL
ES, they are case-sensitive.  This patch handles the difference by
using a new function to match layout qualifiers,
match_layout_qualifier(), which calls either strcmp() or strcasecmp()
as appropriate.

Fixes piglit tests:
- layout-not-case-sensitive-in.geom
- layout-not-case-sensitive-max-vert.geom
- layout-not-case-sensitive-out.geom
- layout-not-case-sensitive.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC typedefs in gl.h
Brian Paul [Thu, 17 Oct 2013 18:10:26 +0000 (12:10 -0600)]
mesa: remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC typedefs in gl.h

Fixes error about duplicated typedefs (also in glext.h) reported on
NetBSD 6.1

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70546
Tested-by: Vinson Lee <vlee@freedesktop.org>
11 years agost/mesa: add a few comments in st_create_context_priv()
Brian Paul [Thu, 17 Oct 2013 15:28:17 +0000 (09:28 -0600)]
st/mesa: add a few comments in st_create_context_priv()

11 years agost/mesa: handle layer and primitive id output and point size input
Dave Airlie [Mon, 14 Oct 2013 07:27:48 +0000 (17:27 +1000)]
st/mesa: handle layer and primitive id output and point size input

This fixes a number of piglit crashes when running on a hacked up llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/mesa: add geometry shader ubo support
Dave Airlie [Mon, 14 Oct 2013 02:18:53 +0000 (12:18 +1000)]
st/mesa: add geometry shader ubo support

This just adds the missing bits so the ubo tests don't crash.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa/st: Allow geometry shaders without gl_Position export.
Fabian Bieler [Wed, 29 May 2013 22:54:55 +0000 (00:54 +0200)]
mesa/st: Allow geometry shaders without gl_Position export.

From the ARB_geometry_shader4 spec (section Geometry Shader outputs):
"The built-in special variable gl_Position is intended to hold the
homogeneous vertex position. Writing gl_Position is optional."

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/mesa, glsl_to_tgsi: add support for geometry shaders
Bryan Cain [Fri, 15 Feb 2013 16:02:18 +0000 (10:02 -0600)]
st/mesa, glsl_to_tgsi: add support for geometry shaders

v2 (Bryan Cain <bryancain3@gmail.com>): fix 2D array indexing order.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().
Bryan Cain [Fri, 15 Feb 2013 14:53:20 +0000 (08:53 -0600)]
mesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().

v2 (Paul Berry <stereotype441@gmail.com>: Split out to separate patch
(previously this was part of "glsl: add builtins for geometry
shaders.")

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoRevert "i965: Create ARGB2101010 DRI configs"
Kristian Høgsberg [Thu, 17 Oct 2013 05:09:47 +0000 (22:09 -0700)]
Revert "i965: Create ARGB2101010 DRI configs"

Exposing 10-bit color configs confuses too many applications that try to
use the chooser to pick an 8 bit config.  The chooser consider an fbconfig
with more bits a better match and will thus give a 10 bit config when an
application asks for a config with GLX_RED_SIZE 1 or 8.

One key example is glxinfo, which does this, and then doesn't specify that
it needs a config where GLX_DRAWABLE_TYPE has the GLX_WINDOW_BIT set.
This way it ends up with a 10 bit config that it can't use to create a
GLX window and fails to log extensions.

This reverts commit f354bcc1770e9df88db51eba5a4543a09ca6d128.

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

11 years agor600g/sb: fix issue with DCE between GVN and GCM (v2)
Vadim Girlin [Mon, 14 Oct 2013 13:19:12 +0000 (17:19 +0400)]
r600g/sb: fix issue with DCE between GVN and GCM (v2)

We can't perform DCE using the liveness pass between GVN and GCM
because it relies on the correct schedule, but GVN doesn't care about
preserving correctness - it's rescheduled later by GCM.

This patch makes dce_cleanup pass perform simple DCE
between GVN and GCM instead of relying on liveness pass.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agoglapi: Add missing XML files to Makefile dependencies.
Matt Turner [Wed, 16 Oct 2013 19:01:04 +0000 (12:01 -0700)]
glapi: Add missing XML files to Makefile dependencies.

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agoglsl: Optimize mul(a, -1) into neg(a).
Matt Turner [Wed, 16 Oct 2013 06:42:19 +0000 (23:42 -0700)]
glsl: Optimize mul(a, -1) into neg(a).

Two extra instructions in some heroesofnewerth shaders, but a win for
everything else.

total instructions in shared programs: 1531352 -> 1530815 (-0.04%)
instructions in affected programs:     121898 -> 121361 (-0.44%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Handle printing HW_REGS in dump_instruction().
Matt Turner [Wed, 9 Oct 2013 06:30:08 +0000 (23:30 -0700)]
i965/fs: Handle printing HW_REGS in dump_instruction().

Scheduling debugging now prints:

Instructions before scheduling (reg_alloc 1)
0: linterp vgrf20, hw_reg2, hw_reg3, hw_reg4,
1: linterp vgrf21, hw_reg2, hw_reg3, hw_reg4+16,

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Print instructions' children during scheduling debugging.
Matt Turner [Wed, 9 Oct 2013 06:03:41 +0000 (23:03 -0700)]
i965: Print instructions' children during scheduling debugging.

Useful for tracking down problems in dependency calculations.

Scheduling debugging now prints:

clock    2, scheduled: linterp vgrf5, hw_reg2, hw_reg3, hw_reg0,
        child 0, 53 parents: fb_write (null), (null), (null), (null),
        child 1, 2 parents: tex vgrf4, vgrf5, (null), (null),
        child 2, 52 parents: placeholder_halt (null), (null), (null), (null),
clock    4, scheduled: linterp vgrf5+1, hw_reg2, hw_reg3, hw_reg0+16,
        child 0, 52 parents: fb_write (null), (null), (null), (null),
        child 1, 1 parents: tex vgrf4, vgrf5, (null), (null),
                now available
        child 2, 51 parents: placeholder_halt (null), (null), (null), (null),

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoRevert "scons: Fix build when rtti is disabled"
José Fonseca [Wed, 16 Oct 2013 22:05:51 +0000 (15:05 -0700)]
Revert "scons: Fix build when rtti is disabled"

This reverts commit 94d05bf87a21bd364e84f699a0064e5fba58a6f9 as it has a
few problems:

- it breaks windows builds becuase env[LLVM_CXXFLAGS] is never set there

- it is merging not only rtti, but the whole cxxflags (defines etc)
  which has proven to be a source of troubles (breaks debugging etc.)

11 years agoradeonsi: Use 'SI' as the LLVM processor for CIK on LLVM <= 3.3
Tom Stellard [Thu, 3 Oct 2013 14:56:35 +0000 (07:56 -0700)]
radeonsi: Use 'SI' as the LLVM processor for CIK on LLVM <= 3.3

LLVM 3.3 does not know about CIK processors, and the codes paths for SI
and CIK are the same.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agor600g/compute Improve debugging output
Tom Stellard [Tue, 17 Sep 2013 22:47:34 +0000 (15:47 -0700)]
r600g/compute Improve debugging output

11 years agoclover: Link libclc before running any optimizations
Tom Stellard [Mon, 16 Sep 2013 17:32:59 +0000 (10:32 -0700)]
clover: Link libclc before running any optimizations

This is required in order for clang to correctly handle the OpenCL C
barrier() builtin which has the following restrictions acording to
the OpenCL 1.1 Specification:

If barrier is inside a conditional statement, then all work-items must
enter the conditional if any work-item enters the conditional statement
and executes the barrier.

If barrier is inside a loop, all work-items must execute the barrier for
each iteration of the loop before any are allowed to continue execution
beyond the barrier.

By linking before otimizations, we can replace calls to barrier() with
calls to a target specific intrinsic which has the noduplicate attribute
This attribute prevents clang from performing optimizations which could
violate the above rules.

This attribute must be applied to the call instruction that invokes
the function, so it is not enough to add this attribute the barrier()
declaration.

As a bonus this will probably speed up compile times since we will no
longer need to run link-time optimizations.

11 years agomesa: change glTexImage[23]DMultisample() internalformat to GLenum
Brian Paul [Wed, 16 Oct 2013 14:43:21 +0000 (08:43 -0600)]
mesa: change glTexImage[23]DMultisample() internalformat to GLenum

To match glext.h and the GL_ARB_texture_multisample extension.
However, the GL 4.0 spec and man page say it's GLint.
An OpenGL spec bug will be filed.

11 years agosvga: minor fix-ups in svga_get_shader_param()
Brian Paul [Wed, 16 Oct 2013 14:26:42 +0000 (08:26 -0600)]
svga: minor fix-ups in svga_get_shader_param()

Fix debug error message.  Add switch case for PIPE_SHADER_COMPUTE.
Trivial.

11 years agocso: fix incorrect sampler view count in cso_restore_sampler_views()
Brian Paul [Tue, 15 Oct 2013 23:09:22 +0000 (17:09 -0600)]
cso: fix incorrect sampler view count in cso_restore_sampler_views()

During the recent bind_sampler_states() interface change in gallium
we changed the CSO single_sampler_done() function so that if we were
decreasing the number of sampler states bound in the driver, we'd
null-out the "extra/old" sampler states to unbind them.  See commit
1e2fbf265.

However, we didn't make the corresponding fix for sampler views.
This caused an assertion to fail in the svga driver which checked
that the number of sampler views matched the number of sampler states.

This patch fixes cso_restore_sampler_views() so that it nulls-out
the extra/old sampler views if the number of new views is less than
the number of current/old views.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: update glxext.h to version 20131008
Brian Paul [Tue, 15 Oct 2013 15:11:30 +0000 (09:11 -0600)]
mesa: update glxext.h to version 20131008

The diff is huge but the actual changes are few:
* Whitespace changes
* Items are reordered
* extern qualifiers dropped

11 years agomesa: update glext.h to version 20131008
Brian Paul [Tue, 15 Oct 2013 15:05:17 +0000 (09:05 -0600)]
mesa: update glext.h to version 20131008

Only two notable changes in this revision:
* GLvoid has been replaced by void.
* Added the GL_NV_blend_equation_advanced extension.

11 years agovbo: access VBO memory more efficiently when building display lists
Brian Paul [Mon, 14 Oct 2013 23:36:06 +0000 (17:36 -0600)]
vbo: access VBO memory more efficiently when building display lists

Use GL_MAP_INVALIDATE_RANGE, UNSYNCHRONIZED and FLUSH_EXPLICIT flags
when mapping VBOs during display list compilation.  This mirrors what
we do for immediate-mode VBO building in vbo_exec_vtx_map().

This improves performance for applications which interleave display
list compilation with execution.  For example:

glNewList(A);
glBegin/End prims;
glEndList();
glCallList(A);
glNewList(B);
glBegin/End prims;
glEndList();
glCallList(B);

Mesa's vbo module tries to combine the vertex data from lists A and B
into the same VBO when there's room.  Before, when we mapped the VBO for
building list B, we did so with GL_MAP_WRITE_BIT only.  Even though we
were writing to an unused part of the buffer, the map would stall until
the preceeding drawing call finished.

Use the extra map flags and FlushMappedBufferRange() to avoid the stall.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agomesa: consolidate cube width=height error checking
Brian Paul [Mon, 14 Oct 2013 16:26:41 +0000 (10:26 -0600)]
mesa: consolidate cube width=height error checking

Instead of checking width==height in four places, just do it in
_mesa_legal_texture_dimensions() where we do the other width, height,
depth checks.  Similarly, move the check that cube map array depth is
a multiple of 6.

This change also fixes some missing cube dimension checks for the
glTexStorage[23]D() functions.

Remove width==height assertion in _mesa_get_tex_max_num_levels() since
that's called before the other size checks for glTexStorage.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agogbm: Add support for gbm bos and surfaces using GBM_FORMAT_ARGB2101010
Kristian Høgsberg [Sun, 15 Sep 2013 06:32:44 +0000 (23:32 -0700)]
gbm: Add support for gbm bos and surfaces using GBM_FORMAT_ARGB2101010

We can now add GBM support for the 10 bit/channel formats which lets us
create a gbm surface that we can use with KMS for display hardware that
support the format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agodri: Add __DRIimage support for the ARGB2101010 format
Kristian Høgsberg [Sun, 15 Sep 2013 06:31:08 +0000 (23:31 -0700)]
dri: Add __DRIimage support for the ARGB2101010 format

We add support for the ARGB2101010 color format to the DRI image extension,
which allows DRI loaders to create a __DRIimage with this color format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoi965: Create ARGB2101010 DRI configs
Kristian Høgsberg [Sun, 15 Sep 2013 06:28:55 +0000 (23:28 -0700)]
i965: Create ARGB2101010 DRI configs

This commit enables ARGB2101010 system framebuffers (that is, DRI drawables)
for the i965 drivers.  This is done by generating DRI configs that advertise
this color format as well as teaching intelCreateBuffer to pick the right
color format when it sees such a DRI config.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agodri/common: Add support for creating ARGB2101010 configs
Kristian Høgsberg [Sun, 15 Sep 2013 06:25:54 +0000 (23:25 -0700)]
dri/common: Add support for creating ARGB2101010 configs

This extends the common dri driver infrastructure with the ability to create
__DRIconfigs for 10 bits/channel + 2 bit alphs formats.  This still has
to be supported and requested by a driver, so this doesn't enable anthing yet.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoegl_dri2: Set NativeVisualID to the matching GBM config for the gbm platform
Kristian Høgsberg [Wed, 25 Sep 2013 21:57:22 +0000 (14:57 -0700)]
egl_dri2: Set NativeVisualID to the matching GBM config for the gbm platform

The EGLConfig doesn't have the rgba masks, only the rgba sizes.  To
make sure a config is usable with a given GBM/KMS format, we need a way
to make sure the formats really match.

11 years agoegl_dri2: Remove depth argument from dri2_add_config()
Kristian Høgsberg [Sun, 15 Sep 2013 06:13:22 +0000 (23:13 -0700)]
egl_dri2: Remove depth argument from dri2_add_config()

All callers now use the more correct rgba mask mechanism for filtering
out mathcing DRI configs.  Even if depth and buffer size match, the
color component layout can be different, or in case or ARGB8888 and
ARGB2101010 the color components can even be different sizes.

Since anything that the depth check would reject is also rejected by
the rgba mask comparison, the depth parameter is redundant and not
specific enough.  We should probably have removed it when the rgba
masks argument was introduced, but better late than never.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoegl_dri2: Match X11 visuals using rgba masks instead of depth
Kristian Høgsberg [Sun, 15 Sep 2013 06:06:36 +0000 (23:06 -0700)]
egl_dri2: Match X11 visuals using rgba masks instead of depth

Matching on visual depth to buffer size makes 8 bpc RGBA look similar to
10 bit RGB with 2 bit alphs - both have buffer size 32.  Instead, build
the rgba masks from the visual data and use that for finding matching
DRI configs.

We need to keep the special case that allows us to match 24 bit visuals
to DRI configs with buffer size 32.  We do that by creating an alpha
mask of "all the non-rgb bits" for 24 bit visuals and matching a second
time with that.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoi965: Add support for RGB565 __DRIimage
Singh, Satyeshwar [Wed, 16 Oct 2013 01:11:02 +0000 (01:11 +0000)]
i965: Add support for RGB565 __DRIimage

Add information for RGB565 to the table of image formats so that we can
create a __DRIimage for that format.  This in turn enables RGB565
wayland clients.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoegl-wayland: Add support for RGB565 pixel format for Wayland clients
Singh, Satyeshwar [Wed, 16 Oct 2013 01:10:12 +0000 (01:10 +0000)]
egl-wayland: Add support for RGB565 pixel format for Wayland clients

With this patch Wayland clients can now ask EGL for RGB 565 format buffers
and attach them to a Wayland compositor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agoscons: Fix build when rtti is disabled
Alexander von Gluck IV [Tue, 15 Oct 2013 17:08:59 +0000 (12:08 -0500)]
scons: Fix build when rtti is disabled

* The rtti fix actually dug up a bug in the scons build scripts.
* Autotools took the LLVM cpp and cxx flags, while scons only took
  the cpp flags.
* This grabs the cxx flags and applies them where needed. We may
  want to make the same change for the llvm cpp flags in scons.
* The only linux platform I can find with LLVM no-rtti is Ubuntu.
* Fixes bug #70471

Tested-by: Vinson Lee <vlee@freedesktop.org>
11 years agollvmpipe: Advertise PIPE_CAP_DEPTH_CLIP_DISABLE.
José Fonseca [Wed, 16 Oct 2013 01:08:26 +0000 (18:08 -0700)]
llvmpipe: Advertise PIPE_CAP_DEPTH_CLIP_DISABLE.

Actually implemented by draw module.

Tested piglit ARB_depth_clamp tests, which pass 100%.

Trivial.