Commit Graph

59229 Commits

Author SHA1 Message Date
Jon TURNEY 87e84acbfd 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>
2013-10-18 14:16:27 +01:00
Alexander von Gluck IV 9aad1ba70f 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>
2013-10-17 20:33:05 -05:00
Paul Berry b08195faec glsl: Fix MSVC build (missing strcasecmp())
MSVC doesn't have a strcasecmp() function; it uses _stricmp() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-17 18:11:22 -07:00
Kenneth Graunke b3360d23ac 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>
2013-10-17 14:27:03 -07:00
Kenneth Graunke f8fef8ee92 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>
2013-10-17 14:27:03 -07:00
Kenneth Graunke 7601ba649f 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>
2013-10-17 14:27:03 -07:00
Kenneth Graunke 5f76bc37ab 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>
2013-10-17 14:27:03 -07:00
Kenneth Graunke 80a9c42e9e 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>
2013-10-17 14:27:03 -07:00
Kenneth Graunke 6613f346ac 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>
2013-10-17 14:27:03 -07:00
Paul Berry e2d1eaa32a 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>
2013-10-17 11:51:06 -07:00
Paul Berry 79e835a712 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>
2013-10-17 11:51:01 -07:00
Brian Paul a36f7e651e 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>
2013-10-17 12:10:39 -06:00
Brian Paul 282bb87366 st/mesa: add a few comments in st_create_context_priv() 2013-10-17 09:28:17 -06:00
Dave Airlie 530afc82a1 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>
2013-10-17 08:35:42 +01:00
Dave Airlie 038a9aab33 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>
2013-10-17 08:35:42 +01:00
Fabian Bieler 20cad7fd6f 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>
2013-10-17 08:35:42 +01:00
Bryan Cain 9bfa475684 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>
2013-10-17 08:35:42 +01:00
Bryan Cain 6b0df34ae5 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>
2013-10-17 08:35:42 +01:00
Kristian Høgsberg 4ef1c8fb4c 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 f354bcc177.

https://bugs.freedesktop.org/show_bug.cgi?id=70557
2013-10-16 22:22:45 -07:00
Vadim Girlin 62c8149472 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>
2013-10-17 07:57:49 +04:00
Matt Turner 38fe3bd5f2 glapi: Add missing XML files to Makefile dependencies.
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-16 20:49:43 -07:00
Matt Turner a360ca7476 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>
2013-10-16 20:49:43 -07:00
Matt Turner 197f3a33fb 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>
2013-10-16 20:49:43 -07:00
Matt Turner 7d0519c082 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>
2013-10-16 20:49:43 -07:00
José Fonseca 40ddd8b659 Revert "scons: Fix build when rtti is disabled"
This reverts commit 94d05bf87a 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.)
2013-10-16 15:05:51 -07:00
Tom Stellard 9da4021626 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>
2013-10-16 12:55:30 -04:00
Tom Stellard 13ac38b4ef r600g/compute Improve debugging output 2013-10-16 09:39:31 -07:00
Tom Stellard de1de88dfc 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.
2013-10-16 09:39:15 -07:00
Brian Paul 2273b04c61 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.
2013-10-16 08:43:23 -06:00
Brian Paul 4f08cdefda svga: minor fix-ups in svga_get_shader_param()
Fix debug error message.  Add switch case for PIPE_SHADER_COMPUTE.
Trivial.
2013-10-16 08:26:45 -06:00
Brian Paul e96c55ff49 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>
2013-10-16 08:13:47 -06:00
Brian Paul 0d1011638b 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
2013-10-16 08:13:46 -06:00
Brian Paul 4d9e61c046 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.
2013-10-16 08:13:45 -06:00
Brian Paul 3c074e4d4d 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>
2013-10-16 08:13:45 -06:00
Brian Paul fa9c702164 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>
2013-10-16 08:13:45 -06:00
Kristian Høgsberg 6e444a72c1 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>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg 3160ec353e 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>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg f354bcc177 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>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg afda76cc0d 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>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg df479cffcc 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.
2013-10-15 22:07:52 -07:00
Kristian Høgsberg 44e584a73a 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>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg e3d0a0eac7 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>
2013-10-15 22:06:46 -07:00
Singh, Satyeshwar e2620c1a74 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>
2013-10-15 21:30:49 -07:00
Singh, Satyeshwar 2efc97d513 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>
2013-10-15 21:26:56 -07:00
Alexander von Gluck IV 94d05bf87a 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>
2013-10-15 22:12:18 -05:00
José Fonseca 85d7f6779f llvmpipe: Advertise PIPE_CAP_DEPTH_CLIP_DISABLE.
Actually implemented by draw module.

Tested piglit ARB_depth_clamp tests, which pass 100%.

Trivial.
2013-10-15 18:22:57 -07:00
José Fonseca 3b3591cd15 draw: make vs_slot signed.
Otherwise (vs_slot < 0) will never be true.

Trivial.
2013-10-15 18:22:57 -07:00
Emil Velikov b1e7cd037e configure.ac: drop obsolete variable HAVE_COMMON_DRI
The original intent of the variable was to prevent adding
libdrm dependency for non drm drivers (swrast). This is
already handled with __NOT_HAVE_DRM_H, and with the recent
merge of the dri_util and drisw_util code this variable has
started causing build issues.

Eg. the following will fail
$ ./autogen.sh --with-dri-drivers=swrast --with-gallium-drivers=
$ make

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-15 21:54:20 +02:00
Emil Velikov cd3fa176a8 swrast: add correct include for out-of-tree builds
The xmlpool/options.h file was not accessible when building
out-of-tree leading to failure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70378
Reported-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-15 21:50:09 +02:00
Bryan Cain 467e3aa3de mesa: fix transform feedback when a geometry shader is active.
When a geometry shader is active, the transform feedback primitive
type ("mode") needs to be validated against the geometry shader output
primitive type, not the primitive type passed to the glDraw*()
function.

Fixes the following piglit tests:
- glsl-1.50-geometry-primitive-types GL_LINES
- glsl-1.50-geometry-primitive-types GL_LINES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLES
- glsl-1.50-geometry-primitive-types GL_TRIANGLES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLE_FAN

Exposes previously hidden failures in the following piglit tests:
- glsl-1.50-geometry-primitive-id-restart GL_LINES other
- glsl-1.50-geometry-primitive-id-restart GL_LINES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP ffs
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN ffs
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP_ADJACENCY other

(These failures were previously hidden due to a flaw in the test: it
doesn't check for GL errors.  I'll fix the test shortly).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-15 11:40:43 -07:00