Compare commits

...

487 Commits

Author SHA1 Message Date
Carl Worth
3d3cada9c1 docs: Add md5sums for 9.1.7 release files.
Now that they've been generated, we can do this.
2013-10-04 21:27:12 -07:00
Carl Worth
7d4a1f508b Revert "radeon/winsys: pad IBs to a multiple of 8 DWs"
This reverts commit 4a8d1c5ef2.

This commit causes compilation failures ("'SI' undeclared"), which,
embarrassingly enough, I failed to notice earlier.
2013-10-04 21:19:29 -07:00
Carl Worth
08ffe9c541 doc: Add releases notes for the upcoming 9.1.7 release.
Complete except for the md5sums, (which we cannot have generated yet).
2013-10-04 21:10:59 -07:00
Carl Worth
b91b957208 Bump version to 9.1.7
Even remembering to fix MESA_PATCH this time, (which I had missed in the bump
to 9.1.6).
2013-10-04 20:56:52 -07:00
Ian Romanick
ca2e6012eb mesa: Don't return any data for GL_SHADER_BINARY_FORMATS
We return 0 for GL_NUM_SHADER_BINARY_FORMATS, so
GL_SHADER_BINARY_FORMATS should not write any data to the application
buffer.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0667e2c969)
2013-10-04 14:33:34 -07:00
Torsten Duwe
32b28b0c17 wayland-egl.pc requires wayland-client.pc.
Mesa provides the wayland-egl libs and the pkgconfig file, but the headers
originate from the wayland package. Ensure everything matches, by requiring
application builds to look at the wayland headers as well.

Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Johannes Obermayr <johannesobermayr@gmx.de>
(cherry picked from commit 3bc642cbf6)
2013-10-04 14:22:20 -07:00
Johannes Obermayr
15204c3840 st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.
(cherry picked from commit 87ebbe1270)
2013-10-04 14:22:09 -07:00
Kenneth Graunke
d227751144 meta: Set correct viewport and projection in decompress_texture_image.
_mesa_meta_begin() sets up an orthographic project and initializes the
viewport based on the current drawbuffer's width and height.  This is
likely the window size, since it occurs before the meta operation binds
any temporary buffers.

decompress_texture_image needs the viewport to be the size of the image
it's trying to draw.  Otherwise, it may only draw part of the image.

v2: Actually set the projection properly too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Mak Nazecic-Andrlon <owlberteinstein@gmail.com>
(cherry picked from commit 62411681da)
2013-10-04 14:12:50 -07:00
Carl Worth
8c753e01e4 cherry-ignore: Ignore last two patches in current get-pick-list output
Neither of these are suitable for 9.1 for now. For both patches, the original
authors of the patch have been emailed.
2013-10-04 14:04:37 -07:00
Carl Worth
a6b6ad7d17 Update get-pick-list to look specifically for "9.1" in NOTE
We previously adjusted this script so that the new-style markup, (with CC)
would only trigger if it specifically mentioned "9.1", but the old-style
markup (with "NOTE:") was always triggering. Fix it to look for "9.1" as well.

This removes several patches from the current output.
2013-10-04 13:52:46 -07:00
Rico Schüller
68473d07d4 glx: Initialize OpenGL version to 1.0
The old code in dri2_glx suffered from a typographical error that caused
the default version to be 2.1 instead of 1.2 (minimum required by the
Linux OpenGL ABI).  drisw_glx had a similar error resulting in a default
version of 0.1.

Some driver/card combinations (r200/RV280, i915/915G) don't support
OpenGL 2.1.  These create in some corner cases an indirect context
instead of a direct context when calling glXCreateContextAttribsARB().
This happens because of a bad default value.  To avoid this, just used
the default value specified by the GLX_ARB_create_context specification:

    "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
    GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
    case, implementations will typically return the most recent version
    of OpenGL they support which is backwards compatible with OpenGL 1.0
    (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility
    profile)"

Refactor all the default value setting to dri2_convert_glx_attribs, and
make sure the correct defaults are set in that one place.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>

(cherry picked from commit 8b302e1635)

Conflicts:
	src/glx/dri2_glx.c
	src/glx/dri_common.c
	src/glx/drisw_glx.c
2013-10-03 10:02:33 -07:00
Ian Romanick
5bddd3f392 glsl: Move and refine test for unsized arrays in GLSL ES
GLSL ES does not allow unsized arrays, and GLSL ES 1.00 does not allow
array initializers.  However, GLSL ES 3.00 allows array initializers,
and the initializer can explicitly size the array.  The specification
even includes some examples of this:

    float x[] = float[2] (1.0, 2.0);     // declares an array of size 2
    float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3

    float a[5];
    float b[] = a;

Move the unsized array check to after the initializer has been
processed.  If the array is still unsized, generate the error.  This
should have no effect in GLSL ES 1.00 because, as previously mentioned,
array initializers are not allowed.

Fixes piglit "glsl-es-3.00 compiler array-sized-by-initializer.vert".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 42624b1c81)

Conflicts:
	src/glsl/ast_to_hir.cpp
2013-10-03 09:53:44 -07:00
Ian Romanick
64d3c2b7d5 mesa: Generate a renderbuffer wrapper even if the texture has no image
This prevents a segfault in check_begin_texture_render when an FBO is
rebound while in this state.  This fixes the piglit test
fbo-incomplete-invalid-texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 2f9fe2d80a)

Conflicts:
	src/mesa/main/fbobject.c
2013-10-03 09:53:44 -07:00
Ian Romanick
b10122ac03 mesa: Don't call driver RenderTexture for invalid zoffset
This fixes the segfault in the 'invalid slice of 3D texture' and
'invalid layer of an array texture' subtests of piglit's fbo-incomplete
test.

The 'invalid layer of an array texture' subtest still fails.

v2: Fix off-by-one comparison error noticed by Chris Forbes.  Also,
1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 41485fea7c)
2013-10-03 09:53:43 -07:00
Ian Romanick
398c705c3d mesa: Don't call driver RenderTexture for really broken textures
This fixes the segfault in the '0x0 texture' subtest of piglit's
fbo-incomplete test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit fb49713f8e)

Conflicts:
	src/mesa/main/fbobject.c
2013-10-03 09:53:43 -07:00
Ian Romanick
c6d5d39147 mesa: Remove all traces of GL_OES_matrix_get
I believe this extension was enabled by accident.  As far as I can tell,
there has never been any code in Mesa to actually support it.  Not only
that, this extension is only useful in the common-lite profile, and Mesa
does the common profile.

This "fixes" the piglit test oes_matrix_get-api.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e1fdf3899)
2013-10-02 21:47:31 -07:00
Carl Worth
66f8724ef4 Use -Bsymbolic when linking libEGL.so
For some reason that I don't yet fully understand, Glaze does not work with
libEGL unless libEGL is linked with -Bsymbolic.[*]

Beyond that specific reason, all of the reasons for which libGL.so is linked
with -Bsymbolic, (see the commit history), should also apply here.

[*] The specific behavior I am seeing is that when Glaze calls dlopen for
libEGL.so, ifunc resolvers within Glaze for EGL functions are called before
the dlopen returns. These resolvers cannot succeed, as they need the return
value from dlopen in order to find the functions to resolve to. I don't know
what's causing these resolvers to be called, but I have verified that linking
libEGL with -Bsymbolic causes this problematic behavior to stop.

CC: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 9baf35de5c)
2013-10-02 21:47:31 -07:00
Eric Anholt
ce10cafee0 i965/gen4: Fix fragment program rectangle texture shadow compares.
The rescale_texcoord(), if it does something, will return just the
GLSL-sized coordinate, leaving out the 3rd and 4th components where we
were storing our projected shadow compare and the texture projector.
Deref the shadow compare before using the shared rescale-the-coordinate
code to fix the problem.

Fixes piglit tex-shadow2drect.shader_test and txp-shadow2drect.shader_test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69525
NOTE: This is a candidate for stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 938956ad52)
2013-10-02 21:47:30 -07:00
Alex Deucher
4a8d1c5ef2 radeon/winsys: pad IBs to a multiple of 8 DWs
This aligns the gfx, compute, and dma IBs to 8 DW boundries.
This aligns the the IB to the fetch size of the CP for optimal
performance. Additionally, r6xx hardware requires at least 4
DW alignment to avoid a hw bug.  This also aligns the DMA
IBs to 8 DW which is required for the DMA engine.  This
alignment is already handled in the gallium driver, but that
patch can be removed now that it's done in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a81beee37e)
2013-10-02 21:47:02 -07:00
Joakim Sindholt
5af672491a nvc0: fix blitctx memory leak
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2a7762bdb6)
2013-10-02 21:46:35 -07:00
Tiziano Bacocco
2e8bcfa56d nvc0/ir: fix use after free in texture barrier insertion pass
Fixes crash with Amnesia: The Dark Descent.

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7086636358)
2013-10-02 21:46:35 -07:00
Emil Velikov
fa5554fce7 nouveau: initialise the nouveau_transfer maps
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit dc10251d08)
2013-10-02 21:46:34 -07:00
Chris Forbes
c910c620ef i965/fs: Gen4: Zero out extra coordinates when using shadow compare
Fixes broken rendering if these MRFs contained anything other than zero.

NOTE: This is a candidate for stable branches.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f35dea05b1)
2013-10-02 21:46:34 -07:00
Ian Romanick
895663a24f glsl: Use alignment of container record for its first field
The first field of a record in a UBO has the aligment of the record
itself.

Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
the piglit list that extends the test) layout-std140.

NOTE: The bit of strangeness with the version of visit_field without the
record_type poitner is because that method is pure virtual in the base
class.  The original implementation of the class did this to ensure
derived classes remembered to implement that flavor.  Now they can
implement either flavor but not both.  I don't know a C++ way to enforce
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 574e4843e9)
2013-10-02 21:45:44 -07:00
Ian Romanick
7e32aff8fd glsl: Add new overload of program_resource_visitor::visit_field method
The outer-most record is passed into the visit_field method for
the first field.  In other words, in the following structure:

    struct S1 {
        vec4 v;
        float f;
    };

    struct S {
        S1 s1;
        S1 s2;
    };

    uniform Ubo {
        S s;
    };

s.s1.v would get record_type = S (because s1.v is the first non-record
field in S), and s.s2.v would get record_type = S1.  s.s1.f and s.s2.f
would get record_type = NULL becuase they aren't the first field of
anything.

This new overload isn't used yet, but the next patch will add several
uses.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 5ac884fd9f)
2013-10-02 21:45:44 -07:00
Anuj Phogat
ac93b20390 meta: Fix blitting a framebuffer with renderbuffer attachment
This patch fixes a case of framebuffer blitting with renderbuffer
as color attachment and GL_LINEAR filter. Meta implementation of
glBlitFrambuffer() converts source color buffer to a texture and
uses it to do the scaled blitting in to destination buffer. Using
the exact source rectangle to create the texture does incorrect
linear filtering along the edges. This patch makes the changes to
extend the texture edges by one pixel in x, y directions. This
ensures correct linear filtering.
It fixes failing piglit fbo-attachments-blit-scaled-linear test.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit d944a6144f)
2013-10-02 21:45:43 -07:00
Ilia Mirkin
4cdda60fb8 nv30: remove no-longer-used formats from table
Commit 14ee790df7 removed the formats from the vtxfmt_table but forgot
to also update the info_table.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c1a6f59b20)
2013-10-02 21:45:43 -07:00
Ian Romanick
01419c0f42 mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts
It is only in OpenGL compatibility-style contexts where generic
attribute 0 and GL_VERTEX_ARRAY have a bizzare, aliasing relationship.
Moreover, it is only in OpenGL compatibility-style contexts and OpenGL
ES 1.x where one of these attributes provokes the vertex.  In all other
APIs each implicit call to glArrayElement provokes a vertex regardless
of which attributes are enabled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org>
Cc: "9.0 9.1 9.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66292
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67548
(cherry picked from commit 41eef83cc0)
2013-10-02 21:45:43 -07:00
Ilia Mirkin
1dd4b0e6ad nv30: U8_USCALED only works for size 4
See https://bugs.freedesktop.org/show_bug.cgi?id=61635 for a sample
program. Changing it to use a vec4 makes it work. Remove the unsupported
formats.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 14ee790df7)
2013-10-02 21:44:34 -07:00
Alex Deucher
0437388d59 r600g: disable GPUVM by default
Cayman and trinity systems still seem to suffer from
stability problems with GPUVM.  This also fixes compute
on these asics.  It can still be enabled for testing
by setting env var RADEON_VA=true.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit c88783047e)
2013-10-02 21:43:59 -07:00
Emil Velikov
7b4b012c49 nv50: handle pure integer vertex attributes
And as a side effect fix a crash in the following piglit test:
general/attribs GL3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2 and 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 07c8f7a6f8)
2013-10-02 21:43:58 -07:00
Ian Romanick
7ff9d952f2 mesa: Validate the layer selection of an array texture too
Previously only the slice of a 3D texture was validated in the FBO
completeness check.  This fixes the failure in the 'invalid layer of an
array texture' subtest of piglit's fbo-incomplete test.

v2: 1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

v3: Handle CUBE_MAP_ARRAY textures too.  Noticed by Marek.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 25281fef0f)
2013-10-02 18:15:14 -07:00
Ian Romanick
11611881ca mesa: Remove stray debug printfs in attachment completeness code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 0c3dbd689b)
2013-10-02 18:11:14 -07:00
Maarten Lankhorst
93670a73ff nvc0: restore viewport after blit
Based on calim's original fix in the nine branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ad4dc77231)

Conflicts:
	src/gallium/drivers/nvc0/nvc0_context.h
2013-09-05 12:24:27 +02:00
Andreas Boll
0dbbfa054c mesa: Fix MESA_PATCH version 2013-08-02 09:51:24 +02:00
Andreas Boll
4589a8a0f3 docs: Fix a typo in the 9.1.6 release notes 2013-08-02 09:50:32 +02:00
Carl Worth
ebc926a206 docs: Add 9.1.6 release md5sums 2013-08-01 14:41:17 -07:00
Carl Worth
1ed76d697f docs: Add release notes for 9.1.6 release 2013-08-01 14:21:21 -07:00
Carl Worth
985e25402f Bump version to 9.1.6 2013-08-01 14:15:38 -07:00
Carl Worth
a33ecd8074 get-pick-list: Ignore commits which CC mesa-stable unless they say "9.1"
With the recent creation of the 9.2 branch, we're now seeing a steady flow of
new patches to mesa-stable@ intended for that branch. To avoid wasting effort
trying to apply these to 9.1, we now require developers to specifically
mention "9.1" to target the 9.1 branch.
2013-08-01 13:34:30 -07:00
Chris Forbes
4f26ea5612 i965/vs: Gen4/5: enable front colors if back colors are written
Fixes undefined results if a back color is written, but the
corresponding front color is not, and only backfacing primitives are
drawn. Results are still undefined if a frontfacing primitive is drawn,
but that's OK.

The other reasonable way to fix this would have been to just pick
the one color slot that was populated, but that dilutes the value of
the tests.

On Gen6+, the fixed function clipper and triangle setup already take
care of this.

Fixes 11 piglits:
spec/glsl-1.10/execution/interpolation/interpolation-none-gl_Back*Color-*

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ec66f2fb2)
2013-08-02 05:48:02 +12:00
Carl Worth
4cedc45a1f get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"
We recently proposed a new syntax for stable-patch nominations such as:

	CC: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>

and this has already appeared in the wild.

So we extend the regular expression to pick this up as well.
2013-07-31 16:02:50 -07:00
Chris Forbes
e6cf672b1a i965/vs: Put lod parameter in the correct place for Gen4
This was never visible before due to the bogus sampler state pointer.
Fixes remaining vertex texturing breakage on Gen4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit cace82b0cd)
2013-07-31 16:02:50 -07:00
Chris Forbes
185c1aa1d8 i965/vs: set up sampler state pointer for Gen4/5.
Fixes broken filter and lod selection for vertex texturing.
(txs/txf only worked properly because they ignore the sampler state
completely)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 97676032c2)

Backported-by: Carl Worth <cworth@cworth.org> to compile on 9.1 branch.
2013-07-31 16:02:02 -07:00
Eric Anholt
d37c09c18f egl: Restore "bogus" DRI2 invalidate event code.
I had removed it in commit 1e7776ca2b
because it was obviously wrong -- why do we care whether the server is a
version that emits events, if we're not watching for the server's events,
anyway?  And why would you only invalidate on a server that emits
invalidate events, when the comment said to emit invalidates if the server
*doesn't*?  Only, I missed that we otherwise don't flag that our buffers
might have changed at swap time at all, so the driver was only checking
for new buffers when triggered by the Viewport hack.  Of course you don't
expect Viewport to be called after a swap.

So, this is effectively a revert of the previous commit, except that I
dropped the check for only emitting invalidates on a new server -- we
*always* need to invalidate if we're doing a SwapBuffers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63435
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit eed0a80137)
2013-07-31 15:28:16 -07:00
Brian Paul
868087f137 mesa: improve free() cleanup in generate_mipmap_compressed()
Free all our temporary buffers in one place at the end of the
function.  Fixes memory leak detected by Coverity.

Note: This is a candidate for the 9.x branches
Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit e5f32a0b3a)
2013-07-31 15:27:56 -07:00
Carl Worth
d2700c1a05 get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list
We recently adopted a new convention that patches can be nominated for the
stable branch by including a line in the commit message as follows:

	CC: mesa-stable@lists.freedesktop.org

This is a convenient syntax as "git send-email" will notice this line and
automatically copy the resulting patch email to the mesa-stable mailing list.

Here we extend the regular expression in the get-pick-list.sh script to also
notice this pattern, (as well as the traditional "NOTE: This patch is a
candidate..." form.
2013-07-30 12:57:32 -07:00
Carl Worth
30fc154945 cherry-ignore: Drop 13 patches from the pick list
Each of these have recently been discussed with the original patch authors
(see posts to the mesa-stable@lists.freedesktop.org mailing list).
2013-07-30 12:57:24 -07:00
Kenneth Graunke
9688066bca glsl: Classify "layout" like other identifiers.
When "layout" isn't being lexed as LAYOUT_TOK, we should treat it like
an ordinary identifier.  This means we need to classify it to determine
whether we should return IDENTIFIER, TYPE_IDENTIFIER, or NEW_IDENTIFIER.

Fixes the WebGL conformance test "shader-with-non-reserved-words."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c178ec0d7e)
2013-07-30 12:45:36 -07:00
Chris Forbes
f437513bed i965/vs: Fix flaky texture swizzling
If any component used the ZERO or ONE swizzle, its corresponding member
in the `swizzle` array would never be initialized. We *mostly* got away
with this, except when that memory happened to contain a value that
clobbered another channel when combined using BRW_SWIZZLE4().

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 124f567f1d)
2013-07-30 12:45:36 -07:00
Dave Airlie
6b6f29eb20 gallium/vl: add prime support
This fixes the dri2 opening to check if DRI_PRIME is set,
and picks the correct drm device path to open, this along
with a change to libvdpau allows vdpauinfo to work at least,

Martin Peres tested with nouveau, and there seems to be a
further issue with final displaying, it only works sometimes,
but this patch is at least necessary to help debug further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67283
Tested-by: Armin K. <krejzi@email.com>
(cherry picked from commit 19338157c9)
2013-07-30 12:45:36 -07:00
Paul Berry
0f05066fea glsl: Handle empty if statement encountered during loop analysis.
The is_loop_terminator() function was asserting that the following
kind of if statement could never occur:

    if (...) { } else { }

(presumably based on the assumption that such an if statement would be
eliminated by previous optimization stages).  But that isn't the
case--it's possible that previous optimization stages might simplify
more complex code down to this empty if statement, in which case it
won't be eliminated until the next time through the optimization loop.

So is_loop_terminator() needs to handle it.  Fortunately it's easy to
handle--it's not a loop terminator because it does nothing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64330
CC: mesa-stable@lists.freedesktop.org

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a5eecb246d)
2013-07-30 12:45:36 -07:00
Brian Paul
aa4938f046 mesa: implement mipmap generation for compressed 2D array textures
We weren't looping over all the slices in the array.  The updated
code should also correctly handle 3D compressed textures too, whenever
we have that feature.

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

NOTE: This is a candidate for the 9.x branches
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8a9df7a370)
2013-07-30 12:45:36 -07:00
Brian Paul
c94e507616 meta: handle 2D texture arrays in decompress_texture_image()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 484fa87984)
2013-07-30 12:45:36 -07:00
Brian Paul
81f0b980d0 mesa: handle 2D texture arrays in get_tex_rgba_compressed()
If we call glGetTexImage() for a compressed 2D texture array we need
to loop over all the slices.

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

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 2931bcb0d2)
2013-07-30 12:45:36 -07:00
Marek Olšák
ebd1f4e069 r600g: increase array size for shader inputs and outputs
and add assertions to prevent buffer overflow. This fixes corruption
of the r600_shader struct.

NOTE: This is a candidate for the stable branches.
(backported from commit da33f9b919)

Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2013-07-30 12:45:36 -07:00
Marek Olšák
b5477f1b3f Revert "r300g: allow HiZ with a 16-bit zbuffer"
This reverts commit 631c631cbf.

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

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit a882067d74)
2013-07-30 12:45:36 -07:00
Marek Olšák
2772ba41e0 r300g/swtcl: fix a lockup in MSAA resolve
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 7969b567bd)
2013-07-30 12:45:35 -07:00
Marek Olšák
4fb5c6f77b r300g/swtcl: fix geometry corruption by uploading indices to a buffer
The splitting of a draw call into several draw commands was broken, because
the split sometimes took place in the middle of a primitive. The splitting
was supposed to be dealing with the case when there are more indices than
the maximum size of a CS.

This commit throws that code away and uses a real index buffer instead.

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

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 22427640b2)
2013-07-30 12:45:35 -07:00
Chris Forbes
01b38d489c i965/Gen4: Zero extra coordinates for ir_tex
We always emit U,V,R coordinates for this message, but the sampler gets
very angry if we pass garbage in the R coordinate for at least some
texture formats.

Fill the remaining coordinates with zero instead.

Fixes broken rendering on GM45 in Source games, and in VDrift.

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

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 121ea0b38b)
2013-07-30 12:45:35 -07:00
Maarten Lankhorst
07c3e87550 nvc0: force use of correct firmware file
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit e847b5ae06)
2013-07-28 12:07:07 +02:00
Christoph Bumiller
5f420477f0 nv50,nvc0: s/uint16/uint32 for constant buffer offset
Looks like a thinko, "Hey, constant buffers can be at most 64 KiB
in size, offset can't be larger." But it can, of course.

I think piglit lacks a test for UBO and BindBufferRange that
tests if it actually works.
2013-07-25 15:53:43 +02:00
Jeremy Huddleston Sequoia
226ea340d9 Apple: glFlush() is not needed with CGLFlushDrawable()
<rdar://problem/14496373>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit fa5ed99d8e)
2013-07-20 11:48:55 -07:00
Andreas Boll
9a287a0768 configure.ac: Require llvm-3.2 for r600g/radeonsi llvm backends
v2: Update the error message too.

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

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Marc Dietrich <marvin24@gmx.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-07-19 11:34:49 +02:00
Kristian Høgsberg
e47f8b432d egl-wayland: Fix left-over wl_display_roundtrip() usage
We have to use the EGL wayland event queue for roundtrip, so use the
wayland_roundtrip() helper, which does just that.

(cherry picked from commit 6dbe94c12c)

This commit also merges the subsequent fix (by Philipp Brüschweiler
<blei42@gmail.com> ) for the segmentation fault introduced in the above
commit:

wayland: fix segfault when using software rendering

wayland_roundtrip() was given an incorrect parameter.

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

Note: This is a candidate for the stable branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c07c18081e)
2013-07-18 14:04:49 -07:00
Matt Turner
f7c7686955 i965/vs: Print error if vertex shader fails to compile.
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 195a6cca3c)
2013-07-18 11:37:21 -07:00
Matt Turner
5aa8baea86 i965: NULL check prog on shader compilation failure.
Also change if (shader) to if (prog) for consistency.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 32a8e87766)
2013-07-18 11:37:07 -07:00
Carl Worth
29c4175be6 Merge 'origin/9.1' into stable 2013-07-17 19:57:59 -07:00
Carl Worth
12d703b050 docs: Add 9.1.5 release md5sums 2013-07-17 19:53:09 -07:00
Carl Worth
42146f777b docs: Add release notes for 9.1.5 release 2013-07-17 16:37:59 -07:00
Carl Worth
4c4535988b mesa: Bump version to 9.1.5 2013-07-17 16:28:16 -07:00
Maarten Lankhorst
e790e24895 osmesa: link against static libglapi library too to get the gl exports
This should fix missing symbols in a osmesa built against shared glapi
osmesa build. All opengl exports were missing that are defined in the
static glapi, so link against both to fix this.

This is a candidate for the stable series.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47824
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit b20b2b6dc8)
2013-07-16 10:21:24 +02:00
Paul Berry
e292c4656a glsl ES: Fix magnitude of gl_MaxVertexUniformVectors.
Previously, we set it equal to MaxVertexUniformComponents.  It should
be MaxVertexUniformComponents / 4.

NOTE: This is a candidate for the stable branches.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 8f51d68f8c)
2013-07-15 13:37:19 -07:00
Carl Worth
8bb40f7b2b cherry-ignore: Drop two patches which we've decided not to include
Matt agreed that his patch isn't a valid candidate, (since it is possible it
could cause a previously-working program to stop working).

Martin attempted a backport of his patch, (which didn't trivially
cherry-pick), and found that it failed to fix the expected piglit failure.
2013-07-15 11:38:00 -07:00
Carl Worth
083f5f0848 cherry-ignore: Ignore previously backported patch
Chad was diligent and already applied this patch to the stable branch, (but
without the "cherry-picked from" since he did a backport to a different file,
not a cherry-pick, so get-pick-list.sh wasn't clever enough to notice).
2013-07-15 11:35:28 -07:00
Christoph Bumiller
f4cf23e350 r600g: x/y coordinates must be divided by block dim in dma blit
Note: this is a candidate for the 9.1 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9974593dfb)
2013-07-15 11:35:28 -07:00
Chris Forbes
6a2df5a030 i965: fix alpha test for MRT
Include src0 alpha in the RT write message when using MRT, so it is used
for the alpha test instead of the normal per-RT alpha value.

Fixes broken rendering in Dota2 under Wine [FDO #62647].

No Piglit regressions on Ivybridge.

V2: reuse (and simplify) existing sample_alpha_to_coverage flag in
the FS key, rather than adding another redundant one.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewd-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62647
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 1415a1884c)

Conflicts (resolved by Carl Worth <cworth@cworth.org>):
	src/mesa/drivers/dri/i965/brw_wm.c
2013-07-15 11:35:28 -07:00
Kenneth Graunke
330203c267 glsl/builtins: Fix ARB_texture_cube_map_array built-in availability.
This patch adds texture() for isamplerCubeArray and usamplerCubeArray,
which were entirely missing.

It also makes texture() with a LOD bias fragment shader specific.  The
main GLSL specification explicitly says that texturing with LOD bias
should not be allowed for vertex shaders.

Affects Piglit's ARB_texture_cube_map_array/compiler/tex_bias-01.vert.
which tries to use bias in a vertex shader.  Currently, it expects this
to pass (so this patch regresses the test), but I've sent a patch to
reverse the expected behavior (so this patch would fix the updated test):
http://lists.freedesktop.org/archives/piglit/2013-June/006123.html

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 15ca0ca1b6)
2013-07-15 11:35:28 -07:00
Anuj Phogat
cc01cfe073 mesa: Return ZeroVec/dummyReg instead of NULL pointer
Assertions are not sufficient to check for null pointers as they don't
show up in release builds. So, return ZeroVec/dummyReg instead of NULL
pointer in get_{src,dst}_register_pointer(). This should calm down the
warnings from static analysis tool.

Note: This is a candidate for the 9.1 branch.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ee723ffabb)
2013-07-15 11:35:28 -07:00
Ian Romanick
e8af0576a5 glsl: Move all var decls to the front of the IR list in reverse order
This has the (intended!) side effect that vertex shader inputs and
fragment shader outputs will appear in the IR in the same order that
they appeared in the shader code.  This results in the locations being
assigned in the declared order.  Many (arguably buggy) applications
depend on this behavior, and it matches what nearly all other drivers
do.

Fixes the (new) piglit test attrib-assignments.

NOTE: This is a candidate for stable release branches (and requires the
previous commit to prevent a regression in OpenGL ES 2.0 conformance
test stencil_plane_operation).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit c170c901d0)
2013-07-15 11:35:28 -07:00
Ian Romanick
ba1d24f06a i965: Be more careful with the interleaved user array upload optimization
The checks to determine when the data can be uploaded in an interleaved
fashion can be tricked by certain data layouts.  For example,

    float data[...];

    glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 16, &data[0]);
    glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 16, &data[4]);
    glDrawArrays(GL_POINTS, 0, 1);

will hit the interleaved path with an incorrect size (16 bytes instead
of 32 bytes).  As a result, the data for attribute 1 never gets
uploaded.  The single element draw case is the only sensible case I can
think of for non-interleaved-that-looks-like-interleaved data, but there
may be others as well.

To fix this, make sure that the end of the element in the array being
checked is within the stride "window."  Previously the code would check
that the begining of the element was within the window.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 329cd6a9b1)
2013-07-15 11:35:27 -07:00
Eric Anholt
d3ab091433 ra: Fix register spilling.
Commit 551c991606 tried to avoid spilling
registers that were trivially colorable.  But since we do optimistic
coloring, the top of the stack also contains nodes that are not trivially
colorable, so we need to consider them for spilling (since they are some
of our best candidates).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58384
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63674
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit da00782ed8)
2013-07-15 11:35:27 -07:00
Matt Turner
ff4f5c340f register_allocate: Fix the type of best_benefit.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2e177bc8a5)
2013-07-15 11:35:27 -07:00
Brian Paul
26f802d063 svga: check for NaN shader immediates
The svga device doesn't handle them.  Replace with zeros.
Fixes several piglit tests, such as "glsl-const-builtin-inversesqrt".

Reviewed-by: Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 3cb4915344)
2013-07-09 13:39:13 -06:00
Richard Sandiford
cda92f5191 st/dri/sw: Fix pitch calculation in drisw_update_tex_buffer
swrastGetImage rounds the pitch up to 4 bytes for compatibility reasons
that are explained in drisw_glx.c:bytes_per_line, so drisw_update_tex_buffer
must do the same.

Fixes window skew seen while running firefox over vnc on a 16-bit screen.

NOTE: This is a candidate for the stable branches.

[ajax: fixed typo in comment]

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
(cherry picked from commit 5a0556f061)
2013-07-03 12:30:08 -07:00
Kristian Høgsberg
5412ae63dc wayland: Handle global_remove event as well
We need to set up a handler for the global_remove event that gets sent
out when a global gets removed.  Without the handler we end up calling
a NULL pointer.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 712269d674)
2013-07-03 12:29:56 -07:00
Richard Sandiford
8ed60f7f7f st/xlib: Fix XImage stride calculation
Fixes window skew seen while running gnome on a 16-bit screen over vnc.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
(cherry picked from commit c132c2978b)
2013-07-03 12:29:33 -07:00
Richard Sandiford
2cfc0072a8 st/xlib Fix XIMage bytes-per-pixel calculation
Fixes a crash seen while running gnome on a 16-bit screen over vnc.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
(cherry picked from commit 876fefe2ff)
2013-07-03 12:29:25 -07:00
Ian Romanick
307a703c75 glsl: Generate smaller values for uniform locations
Previously we would generate uniform locations as (slot << 16) +
array_index.  We do this to handle applications that assume the location
of a[2] will be +1 from the location of a[1].  This resulted in every
uniform location being at least 0x10000.  The OpenGL 4.3 spec was
amended to require this behavior, but previous versions did not require
locations of array (or structure) members be sequential.

We've now encountered two applications that assume uniform values will
be "small."  As far as we can tell, these applications store the GLint
returned by glGetUniformLocation in a int16_t or possibly an int8_t.

THIS BEHAVIOR IS NOT GUARANTEED OR IMPLIED BY ANY VERSION OF OpenGL.

Other implementations happen to have both these behaviors (sequential
array elements and small values) since OpenGL 2.0, so let's just match
their behavior.

Fixes "3D Bowling" on Android.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit cfa3c5ad82)
2013-07-03 12:25:46 -07:00
Ian Romanick
4d12a9c67c glsl: Add gl_shader_program::UniformLocationBaseScale
This is used by _mesa_uniform_merge_location_offset and
_mesa_uniform_split_location_offset to determine how the base and offset
are packed.  Previously, this value was hard coded as (1U<<16) in those
functions via the shift and mask contained therein.  The value is still
(1U<<16), but it can be changed in the future.

The next patch dynamically generates this value.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 26d86d26f9)
2013-07-03 12:24:41 -07:00
Ian Romanick
ab159327a7 glsl: Add a gl_shader_program parameter to _mesa_uniform_{merge,split}_location_offset
This will be used in the next commit.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 5097f35841)
2013-07-03 12:23:45 -07:00
Vinson Lee
e94a89de4d swrast: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 985e710c0d)
2013-07-03 12:22:45 -07:00
Ian Romanick
6194644a49 docs: Add 9.1.4 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-01 14:31:03 -07:00
Ian Romanick
e64febb4b7 docs: 9.1.4 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-01 14:05:00 -07:00
Ian Romanick
c39591457b mesa: Bump version to 9.1.4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-01 13:58:56 -07:00
Maarten Lankhorst
9975e7c223 nvc0: allow frame dropping in h264
The only reason the checks existed were paranoia, when I first
wrote the code I wasn't sure it was correct. Now that I am,
the asserts triggered when XBMC was dropping frames, so remove it.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit bf95ca7de0)
2013-07-01 08:49:08 +02:00
Tom Stellard
38677efa39 r300g/compiler: Prevent regalloc from swizzling texture operands v2
https://bugs.freedesktop.org/show_bug.cgi?id=63520

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 24fa43675f)
2013-06-30 21:41:57 -07:00
Matt Turner
18a04f50de i965: NULL check depth_mt to quiet static analysis.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit adf8afa168)
2013-06-29 15:21:29 -07:00
Chad Versace
bf8053a2db intel: Return early if miptree allocation fails
If allocation fails in intel_miptree_create_internl(), don't proceed to
dereference the miptree. Return an early NULL.

Fixes static analysis error reported by Klocwork.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(backport of commit 6b676e6634)
2013-06-27 13:17:20 -07:00
Sven Joachim
94bc9acac5 mesa: Fix ieee fp on Alpha
Commit 1f82bf12ed inadvertently broke it, checking for __IEEE_FLOAT on all
Alpha machines instead of only on VMS as before.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Sven Joachim <svenjoac@gmx.de>
(cherry picked from commit 0829b893a9)
2013-06-26 23:46:18 +02:00
Anuj Phogat
8b6aa864ea intel: Add a null pointer check before dereferencing the pointer
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 484b89ace9)
2013-06-26 14:21:47 -07:00
Eric Anholt
bd5ccbd4eb i965: Shut up the last release build warning.
I don't see a sensible value to use in this path, but we shouldn't ever
hit this outside of developer new-texture-target enabling.

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 1658efc42c)
2013-06-26 11:08:39 -07:00
Alex Deucher
1ea2331e7a winsys/radeon: add env var to disable VM on Cayman/Trinity
Set env var RADEON_VA=0 to disable VM on Cayman/Trinity.
Useful for debugging.

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 761320b197)
2013-06-26 10:58:23 -07:00
Kenneth Graunke
2385fe475e glsl: Bail on parsing if the #version directive is bogus.
If we didn't successfully parse the #version line, there's no point in
continuing with parsing and compiling: it's already failed.

Furthermore, it can actually be harmful: right after handling #version,
we call _mesa_glsl_initialize_types(), which checks state->es_shader and
language_version.  If it isn't valid, it hits an assertion failure.

Fixes Piglit's "invalid-version-es."  When processing "#version 110 es",
our code set state->es_shader and state->language_version = 110.  It
then properly determined that this was invalid and flagged an error.
Since we continued anyway, we hit the assertion mentioned above.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f730b1f72a)
2013-06-26 10:58:23 -07:00
José Fonseca
886cf1e732 scons: Fix implicit python dependency discovery on Windows.
Probably due to CRLF endings, the discovery of python import statements
was not working on Windows builds, causing incremental builds to often
fail unless one wiped out the build directory.

NOTE: This is a candidate for stable branches.
(cherry picked from commit 0aca2c6b60)
2013-06-26 10:58:23 -07:00
Stéphane Marchesin
6c210d949b st/xlib: Flush the front buffer before doing CopySubBuffer
We flush pending rendering before running CopySubBuffer, which
ensures that the right bits get to the screen.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4f905d4900)
2013-06-26 10:58:23 -07:00
Stéphane Marchesin
520586ac3c st/xlib: Fix upside down coordinates for CopySubBuffer
The coordinates need to be inverted between glX and gallium.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4e5416b0e2)
2013-06-26 10:58:23 -07:00
Dave Airlie
039cf3aaf2 i965: fix problem with constant out of bounds access (v3)
Okay I now understand why Frank would want to run away, this is
my attempt at fixing the CVE out of bounds access to constants
outside the range. This attempt converts any illegal constants
to constant 0 as per the GL spec, and is undefined behaviour.

A future patch should add some debug for users to find this out,
but this needs to be backported to stable branches.

CVE-2013-1872

v2: drop the last hunk which was a separate fix (now in master).
hopefully fix the indentations.

v3: don't fail piglit, the whole 8/16 dispatch stuff was over
my head, and I spent a while figuring it out, but this one is
definitely safe, one piglit pass extra on my Ironlake.

NOTE: This is a candidate for stable branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0677ea063c)
2013-06-26 10:58:22 -07:00
Chad Versace
1b4dafc00f i965: Fix glColorPointer(GL_FIXED)
When a gl_client_array is created with glColorPointer,
gl_client_array::Normalized is true. This caused the translation from the
gl_client_array's type to a BRW_SURFACEFORMAT to assertion fail.

Fixes the spinning cube's color in Android 4.2's ApiDemos.apk,
"Graphics > OpenGL ES".

Fixes assertion failure in mesa-demos/src/egl/opengles1/tri_x11 on Haswell
and Ivybridge:
  brw_draw_upload.c:287: get_surface_type: Assertion `0' failed.

No Piglit regressions on Haswell.

Note: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42182
Issue: AXIA-2954
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 7a9f4d3e71)
2013-06-26 10:58:22 -07:00
Brian Paul
8d9372bdbe mesa: handle missing read buffer in _mesa_get_color_read_format/type()
We were crashing when GL_READ_BUFFER == GL_NONE.  Check for NULL
pointers and reorganize the code.  The spec doesn't say which error
to generate in this situation, but NVIDIA raises GL_INVALID_OPERATION.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65173
NOTE: This is a candidate for the stable branches.

Tested-by: Vedran Rodic <vrodic@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit e20a2df401)
2013-06-26 10:58:22 -07:00
Brian Paul
9577327e32 meta: move vertex array enables for mipmap generation
Before, on the second call to GenerateMipmap we were enabling two
vertex arrays for the current vertex array object, rather than
the private generate-mipmap vertex array object.  This caused
things to blow up elsewhere.

This patch moves the array enables into the block where the
generate-mipmap vertex array object is created, as we do in
the setup_ff_generate_mipmap() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60518
NOTE: This is a candidate for the stable branches.

Tested-by: core13@gmx.net
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit dcc5b6bfb7)
2013-06-26 10:58:22 -07:00
Roland Scheidegger
6a89456a74 gallivm: fix out-of-bounds access with mirror_clamp_to_edge address mode
Surprising this bug survived so long, we were missing a clamp (in the
linear filtering version).
(Valgrind complained a lot about invalid reads with piglit texwrap,
I've also seen spurios failures in this test which might have
happened due to this. Valgrind probably didn't complain before the
alignment reduction in llvmpipe to 4x4 since the test is using tiny
textures so the reads were still always well within allocated area.)
While here, also do an effective clamp (after half subtraction)
of [0,length-0.5] instead of [0, length-1] which saves an instruction
(the filtering weight could be different due to this, but only if
both texels point to the same max texel so it doesn't matter).
(Both changes are borrowed from PIPE_TEX_CLAMP_TO_EDGE case.)

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 458a9a0f85)
2013-06-26 10:58:22 -07:00
Eric Anholt
3f51e2f5ec intel: Fix format handling of blit glBitmap()
Any 32-bit format got ARGB8888 handling (including, say, GL_RG1616), and
anything else got 16-bit (including, say, GL_R8), which could potentially
hang the GPU by writing out of bounds.

NOTE: This is a candidate for the stable branches.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 0a39cb88de)
2013-06-26 10:58:22 -07:00
Eric Anholt
54691913f9 intel: Fix MRT handling of glBitmap().
We'd only hit color buffer 0 even if multiple draw buffers were bound.

NOTE: This is a candidate for the stable branches.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 1cb8de6fff)
2013-06-26 10:58:22 -07:00
Maarten Lankhorst
2c54e79579 nvc0: set rsvd_kick correctly
This prevents trampling beyond the end of the command stream during flushes.

NOTE: This is a candidate for the stable branches.

Reported-by: Christoph Bumiller <christoph.bumiller@speed.at>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit e72cc26518)
2013-06-26 16:51:41 +02:00
Naohiro Aota
3a96680fb5 xmlpool/build: Make sure to set mo properly
Some shells does not set variables sequentially in a statement i.e. "a=X
b=${a}" won't set "b" to "X" but empty value.

This patch introduce ";" to make sure "mo" is set properly before "lang"
assignment.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=471302
(cherry picked from commit 95e145aaee)
2013-06-25 21:28:09 -07:00
Marek Olšák
7c719e867d mesa: declare UniformBufferBindings as an array with a static size
Some Gallium drivers were crashing, because the array was not large enough.

v2: clamp the per-shader maximum in st/mesa, then sum them all up

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 15a4b6db21)
2013-06-25 14:24:56 -07:00
Brian Paul
1b350311be xlib: add null ctx check in glXDestroyContext()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64934
NOTE: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit fd9fe4470b)
2013-06-25 14:24:56 -07:00
Brian Paul
5053bcbee6 st/glx: add null ctx check in glXDestroyContext()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64934
NOTE: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit fd29e4acda)
2013-06-25 14:24:56 -07:00
Brian Paul
8c4ba7a921 xlib: check for null ctx pointer in glXIsDirect()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64745
Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 9772284df2)
2013-06-25 14:24:56 -07:00
Brian Paul
9156b4f541 st/glx/xlib: check for null ctx pointer in glXIsDirect()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64745
Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 1e9875acbe)
2013-06-25 14:24:56 -07:00
Chris Forbes
de09d451a4 mesa: Use accessor for stencil reference values in glGet
NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 96a1bf1ba3)
2013-06-25 14:24:56 -07:00
Marek Olšák
65b251f4b0 st/mesa: fix a couple of issues in st_bind_ubos
- don't reference a buffer for a local variable
  (that's never useful unless it can be the only reference to the buffer)
- check if the buffer is not NULL
- set buffer_size as specified with BindBufferRange

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a17e87d4eb)
2013-06-25 14:24:56 -07:00
Marek Olšák
03c3e082dc st/mesa: initialize Const.MaxColorAttachments
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6a2ad679e6)
2013-06-25 14:24:55 -07:00
Marek Olšák
6d95bd1604 st/mesa: initialize all program constants and UBO limits
Also simplify UBO support checking.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 614ee25077)
2013-06-25 14:24:55 -07:00
Armin K
7b988cf2de gallivm: Fix build with LLVM 3.3
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 4742f9b00b)
2013-06-25 14:24:55 -07:00
Tom Stellard
122c67e7e1 gallivm: Fix build with LLVM >= r180063
(cherry picked from commit ead4db420e)
2013-06-25 14:24:55 -07:00
Maarten Lankhorst
5c0f99fa98 nvc0: kill assert in ppp code
It's no longer always true, and the video tilign aligment should
ensure the alignment is handled correctly regardless.

(cherry picked from commit f1cccd6ca0)
2013-06-19 13:10:22 +02:00
Eric Anholt
060f7b00f9 intel: Avoid making tiled miptrees we won't be able to blit.
Doing so was breaking miptree mapping, which we really need to be able to
handle.  With this change, intel_miptree_map_direct() falls through to
doing a CPU mapping on the buffer like we need.

With the previous 2 patches, all of these should be fixed:
piglit max-texture-size (all 3 patches required!)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37871
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44958
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53494

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ca9a7d975a)
2013-06-19 01:10:12 -07:00
Eric Anholt
a9c794323c intel: Do temporary CPU maps of textures that are too big to GTT map.
This still fails, since 8192*4bpp == 32768, which is too big to use the
blitter on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit dfed115090)
2013-06-19 00:59:06 -07:00
Eric Anholt
b148db56eb intel: Add support for writing to our linear-temporary-CPU-map case.
This will be used for handling updates of large textures.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>.
(cherry picked from commit b3a3cb9611)
2013-06-19 00:59:03 -07:00
Chia-I Wu
dfb163165a u_vbuf: fix index buffer leak
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 97d641eb22)
2013-06-13 23:57:20 +08:00
Chí-Thanh Christopher Nguyễn
cffc012630 targets/dri-i915: Force c++ linker in all cases
NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=461696
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 121c2c8983)
2013-06-11 17:35:17 +02:00
Lauri Kasanen
2a802bc435 r600g: Correctly initialize the shader key, v2
Assigning a struct only copies the members - any padding is left as is.

Thus this code:

struct foo_t foo;
foo = bar;

leaves the padding of foo intact, ie uninitialized random garbage.

This patch fixes constant shader recompiles by initializing the struct
to zero. For completeness, memcpy is used to copy the key to the shader
struct.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit e495d88453)
2013-06-11 17:34:11 +02:00
Maarten Lankhorst
f653339348 nvc0: fix up video buffer alignment requirements
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-06-08 20:11:53 +02:00
Mike Stroyan
4ed7e38434 configure.ac: Build dricommon for gallium swrast
When building dri-swrast, use gallium_check_st to set HAVE_COMMON_DRI.
Commit 07f2dee7 added setting of HAVE_COMMON_DRI in gallium_check_st.
But the dri-swrast case did not use gallium_check_st.
So dri/common was still not built.

v2: set HAVE_COMMON_DRI=yes instead of using gallium_check_st

NOTE: This is a candidate for the 9.1 branch.
      (Depends on 7de78ce5 and 07f2dee)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61821
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 962204961d)
2013-06-06 09:07:57 +02:00
Matt Turner
6047292558 configure.ac: Build dricommon for DRI gallium drivers
Commit 67ef7559 added an || test "x$enable_dri" check in an attempt to
get the DRI common bits built in some necessary cases. That change was
inappropriate as it made these common DRI pieces be built
unconditionally, so some builds were broken.

Subsequently, commit 998d975e3 change the "|| test" to a "-a"
conjunction within the existing test invocation. This made the '-a
"x$enable_dri" = xyes' clause have no effect, (as it was inside an
enclosing test for the same condition). So the new breakage from
commit 67ef7559 was addressed, but the original problems were
regressed.

The immediately preceding commit removed the redundant condition.

Now, finally this commit fixes the original problem as described in
the commit message of 67ef7559: this code should be compiled when
using the DRI state tracker. In order to do so, the HAVE_*_DRI
conditionals must be moved after the last assignment of HAVE_COMMON_DRI.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61821
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit 07f2dee731)
2013-06-06 09:07:33 +02:00
Matt Turner
5afd7ab702 configure.ac: Remove redundant checks of enable_dri.
The whole block is enclosed inside if test "x$enable_dri" = xyes.
(cherry picked from commit 7de78ce5e5)
2013-06-06 09:07:33 +02:00
Andreas Boll
ab8d668a9c glapi: Add some missing static_dispatch="false" annotations to es_EXT.xml
This fixes the following build errors on powerpc:

  CC     glapi_dispatch.lo
  In file included from glapi_dispatch.c:90:0:
  ../../../../../src/mapi/glapi/glapitemp.h:1640:1: error: no previous
  prototype for 'glReadBufferNV' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:4198:1: error: no previous
  prototype for 'glDrawBuffersNV' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6377:1: error: no previous
  prototype for 'glFlushMappedBufferRangeEXT'
  [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6389:1: error: no previous
  prototype for 'glMapBufferRangeEXT' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6401:1: error: no previous
  prototype for 'glBindVertexArrayOES' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6413:1: error: no previous
  prototype for 'glDeleteVertexArraysOES' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6433:1: error: no previous
  prototype for 'glGenVertexArraysOES' [-Werror=missing-prototypes]
  ../../../../../src/mapi/glapi/glapitemp.h:6445:1: error: no previous
  prototype for 'glIsVertexArrayOES' [-Werror=missing-prototypes]

NOTE: This is a candidate for the 9.0 and 9.1 branches.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5ea43e6549)
2013-06-06 09:07:33 +02:00
Brian Paul
6dca30544e mesa: fix error checking of DXT sRGB formats in _mesa_base_tex_format()
For formats such as GL_COMPRESSED_SRGB_S3TC_DXT1_EXT we need to
have both the GL_EXT_texture_sRGB and GL_EXT_texture_compression_s3tc
extensions.  This patch adds the missing check for the later.

Found when checking out https://bugs.freedesktop.org/show_bug.cgi?id=65173

NOTE: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 51498a3e71)
2013-06-05 11:10:23 -07:00
Frank Henigman
fc5725d5c8 intel: initialize fs_visitor::params_remap in constructor
Set fs_visitor::params_remap to NULL in the constructor.
This variable was potentially tested in fs_visitor::remove_dead_constants()
before being set.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 02fe736cc0)
2013-06-05 11:10:23 -07:00
Kenneth Graunke
fdab71ec97 mesa: Delete the ctx->Array._RestartIndex derived state.
It's incorrect and isn't used any longer.

v2: Actually flush vertices/flag _NEW_TRANSFORM on RestartIndex change.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e6efb900e7)
2013-06-05 11:10:23 -07:00
Kenneth Graunke
5201c6af2b mesa: Ignore fixed-index primitive restart in ArrayElement().
GL_PRIMITIVE_RESTART_FIXED_INDEX is only supposed to apply to
glDrawElements*.  This code is for legacy drawing paths and display
lists, so it shouldn't apply.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 51c0ffacb2)
2013-06-05 11:10:23 -07:00
Kenneth Graunke
b5a8ac7942 st/mesa: Go back to using ctx->Array.RestartIndex, not _RestartIndex.
The derived _RestartIndex field is an attempt to support both
GL_PRIMITIVE_RESTART and GL_PRIMITIVE_RESTART_FIXED_INDEX (part of ES
3.0).  Gallium drivers don't appear to support ES 3.0 yet, so they don't
need to use it.  Plus, it's broken and going to go away soon.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit a41478e3f6)
2013-06-05 11:10:23 -07:00
Kenneth Graunke
e90367d27f i965: Fix can_cut_index_handle_restart_index() for byte/short types.
Pre-Haswell hardware doesn't support an arbitrary restart index, and
instead compares the index buffer value against 0xFF for byte-size
buffers, 0xFFFF for short-size buffers, or 0xFFFFFFFF for unsigned
integer buffers.

OpenGL allows the restart index to be an arbitrary unsigned integer.
When comparing against byte/short types, the index buffer value should
be promoted to a full 32-bit integer before doing the comparison.  The
restart index is /not/ supposed to be masked to byte/short size.

This means that with certain restart indexes, the comparison should
always fail.  For example, a restart index of 0xF000FFFF should never
match any byte/short index buffer values due to the extra high bits.

We must not enable hardware primitive restart in such a case.  For now,
fall back to software primitive restart as it's the simplest fix.  In
the future, we could detect restart indexes that will never match and
skip both hardware and software primitive restart.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 49aba27973)
2013-06-05 11:10:23 -07:00
Kenneth Graunke
588fa81e44 mesa: Cherry-ignore a patch that got picked but squashed.
The original commit introduced a regression which was fixed in this one,
so I just picked both and squashed them together.  Since no patch landed
with this name, it still showed up in the list.
2013-06-05 11:10:23 -07:00
Kenneth Graunke
232f4ca7c1 i965: Use the correct restart index for fixed index mode on Haswell.
The code that updates the ctx->Array._RestartIndex derived state mashed
it to 0xFFFFFFFF when GL_PRIMITIVE_RESTART_FIXED_INDEX was enabled
regardless of the index buffer type.  It's supposed to be 0xFF for byte,
0xFFFF for short, or 0xFFFFFFFF for integer types.

The new _mesa_primitive_restart_index() helper gets this right.

The hardware appears to compare against the full 32-bit value some of
the time, causing primitive restart not to occur when it should.  The
fact that it works some of the time is rather frightening.

Fixes sporadic failures in the ES 3 instanced_arrays_primitive_restart
conformance test when run in combination with other tests.

(cherry picked from commit 7c87a3b5da
 and commit 4405ff4055, squashed together)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-06-05 11:10:22 -07:00
Paul Berry
f1c0c7b3b3 i965/gen7.5: Allow HW primitive restart for all primitive types.
Gen7.5 (Haswell) hardware supports primitive restart for all primitive
types.  It also handles all possible primitive restart indices.
Rather than specialize both can_cut_index_handle_restart_index() and
the switch statement in can_cut_index_handle_prims() for Haswell, just
return early if the hardware is Haswell because we know it can handle
everything.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 34efd9214d)
2013-06-05 11:10:22 -07:00
Kenneth Graunke
0c0d21660e vbo: Use the new primitive restart index helper function.
This gets the correct restart index for unsigned byte/short types when
using GL_PRIMITIVE_RESTART_FIXED_INDEX.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 1569709663)
2013-06-05 11:10:22 -07:00
Kenneth Graunke
10ccd3450d mesa: Add a helper function for determining the restart index.
The derived state approach currently used (_RestartIndex) doesn't work:
in the GL_PRIMITIVE_RESTART_FIXED_INDEX case, the restart index depends
on the index buffer's data type, and that isn't known until draw time.

The existing code also fails to obey the GL 4.3 rules which say that
FIXED_INDEX takes precedence over normal primitive restart.

This helper function correctly determines the restart index, and will
replace the derived state.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 959d076b30)
2013-06-05 11:10:22 -07:00
Kenneth Graunke
21eb628e89 vbo: Ignore PRIMITIVE_RESTART_FIXED_INDEX for glDrawArrays().
The derived _PrimitiveRestart enable flag combines the PrimitiveRestart
and PrimitiveRestartFixedIndex enable flags.  However, DrawArrays is not
supposed to do FixedIndex restart:

From the OpenGL 4.3 Core specification, section 10.3.5 (page 302):
"If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not
 performed for array elements transferred by any drawing command not
 taking a type parameter, including all of the *Draw* commands other
 than *DrawElements*."

The OpenGL ES 3.0 specification agrees by omission:
"When DrawElements, DrawElementsInstanced, or DrawRangeElements
 transfers a set of generic attribute array elements to the GL..."

Notably, DrawArrays is not included in the list of draw calls that
take PRIMITIVE_RESTART_FIXED_INDEX into consideration.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 37f278000c)
2013-06-05 11:10:22 -07:00
Eric Anholt
fa0bd4dd85 i965/vs: Fix implied_mrf_writes() for integer division pre-gen6.
Previously it would assertion fail in debug builds (though the correct
value was returned in a non-debug build).  Marking it as a candidate for
stable even though it has no current consumers in the stable branches, in
case one shows up in a later backport.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64727
NOTE: This is a candidate for stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 6220cc931f)
2013-06-05 11:10:22 -07:00
Kenneth Graunke
96b294aceb mesa: Add a reverted commit to cherry-ignore.
v2 was reverted; v3 is actually in.
2013-06-05 10:55:15 -07:00
Chris Forbes
41c4b21d18 mesa: Stop clamping stencil reference value at specification time
All drivers now clamp this to the appropriate range for the bound
stencil buffer when emitting stencil state.

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 53a5f11f0d)
2013-06-05 10:53:20 -07:00
Chris Forbes
68c8db9db5 swrast: Use accessor for stencil reference values
NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 978f91b829)
2013-06-05 10:53:19 -07:00
Chris Forbes
99540782b4 st: Use accessor for stencil reference values
NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit db8a84de87)
2013-06-05 10:53:19 -07:00
Chris Forbes
624fdd4806 radeon: Use accessor for stencil reference values
V2: Drop spurious mask with 0xff.

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit c411f40cba)
2013-06-05 10:53:19 -07:00
Chris Forbes
c7d9a46737 nouveau: Use accessor for stencil reference values
NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7bbe9b78ae)
2013-06-05 10:53:19 -07:00
Chris Forbes
0fdf9716a4 intel: Use accessor for stencil reference values
NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f819ec46d5)
2013-06-05 10:53:19 -07:00
Chris Forbes
bfb8015386 mesa: add accessor for effective stencil ref
Clamps the stencil reference value to the range representable in the
currently-bound draw framebuffer's stencil attachment.

V2: Add spec quote.

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 38f65162af)
2013-06-05 10:52:30 -07:00
Marek Olšák
e75c4d05fc glsl: fix the value of gl_MaxFragmentUniformVectors
NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d90f04a65b)
2013-06-05 10:52:18 -07:00
Rodrigo Vivi
4d7ec8c4e5 i965: Adding more reserved PCI IDs for Haswell.
At DDX commit Chris mentioned the tendency we have of finding out more
PCI IDs only when users report. So Let's add all new reserved Haswell IDs.

NOTE: This is a candidate for stable branches.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=63701
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ce67fb4715)
2013-06-05 10:50:55 -07:00
Rodrigo Vivi
0911db3ca5 i965: Add missing Haswell GT3 Desktop to IS_HSW_GT3 check.
NOTE: This is a candidate for stable branches.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 888fc7a891)
2013-06-05 10:50:31 -07:00
Paulo Zanoni
bbd44a5eaf i965: make GT3 machines work as GT3 instead of GT2
We were not allowed to say the "GT3" name, but we really needed to
have the PCI IDs because too many people had such machines, so we had
to make the GT3 machines work as GT2.

Let's just say that GT2_PLUS was a short for GT2_PLUS_1 :)

NOTE: This is a candidate for stable branches.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f1d2b37317)
2013-06-05 10:50:08 -07:00
Kenneth Graunke
6e76e5497f i965: Enable the Bay Trail platform.
This patch adds PCI IDs for Bay Trail (sometimes called Valley View).
As far as the 3D driver is concerned, it's very similar to Ivybridge,
so the existing code should work just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e7965598b7)
2013-06-05 10:49:58 -07:00
Kenneth Graunke
ed7fa63bbd i965: Add chipset limits for the Haswell GT3 variant.
NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit d0b82b1add)
2013-06-05 10:48:39 -07:00
Kenneth Graunke
acff9c2bbf i965: Update URB partitioning code for Haswell's GT3 variant.
Haswell's GT3 variant offers 32kB of URB space for push constants, while
GT1 and GT2 match Ivybridge, providing 16kB.  Update the code to reserve
the full 32kB on GT3.

v2: Specify push constant size correctly.  I thought GT3 reinterpreted
    the value as multiples of 2kB, but it doesn't.  You simply have to
    program an even number.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit eca2251f42)
2013-06-05 10:48:20 -07:00
Kenneth Graunke
d4311138e4 i965: Use a variable for the push constant size in kB.
This clarifies that the offset of 2 is actually 16 kB / 8kB units.
It also keys both computations off of a single variable, which should
make it easier to change in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 967514ce68)
2013-06-05 10:48:12 -07:00
Kenneth Graunke
210f2794f5 i965: Turn brw->urb.vs_size and gs_size into local variables.
These variables are only used within a single function, so we may as
well make them local variables.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 8cdb2d32ec)
2013-06-05 10:48:02 -07:00
Alan Coopersmith
6de60ddf9c integer overflow in XF86DRIGetClientDriverName() [CVE-2013-1993 2/2]
clientDriverNameLength is a CARD32 and needs to be bounds checked before
adding one to it to come up with the total size to allocate, to avoid
integer overflow leading to underallocation and writing data from the
network past the end of the allocated buffer.

NOTE: This is a candidate for stable release branches.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 306f630e67)
2013-05-31 11:44:16 -07:00
Alan Coopersmith
80ac3b279e integer overflow in XF86DRIOpenConnection() [CVE-2013-1993 1/2]
busIdStringLength is a CARD32 and needs to be bounds checked before adding
one to it to come up with the total size to allocate, to avoid integer
overflow leading to underallocation and writing data from the network past
the end of the allocated buffer.

NOTE: This is a candidate for stable release branches.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2e5a268f18)
2013-05-31 11:44:12 -07:00
Daniel Martin
ca79663f92 Fix build of swrast only without libdrm
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
(cherry picked from commit 998d975e38)
2013-05-30 11:27:33 +02:00
Eric Anholt
887aaa9b4d i965/fs: Bake regs_written into the IR instead of recomputing it later.
For sampler messages, it depends on the target gen, and on gen4
SIMD16-sampler-on-SIMD8-execution we were returning 4 instead of 8 like we
should.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3cf69b2284)

Conflicts:
(We didn't pick over the varying-index changes, so
 FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7 returns 1 reg, not 4.)
	src/mesa/drivers/dri/i965/brw_fs.cpp
2013-05-29 14:49:22 -07:00
Kenneth Graunke
42061192bf mesa: Add i965 varying index patches to .cherry-ignore.
Ian and I have tried to backport them a few times now and have hit
regressions every time.  They're also performance fixes, not
bug/stability fixes, so we'll skip them for now.

Acked-by: Eric Anholt <eric@anholt.net>
2013-05-29 14:45:20 -07:00
Paul Berry
68d6a84911 glsl: Fix error checking on "flat" keyword to match GLSL ES 3.00, GLSL 1.50.
All of the GLSL specs from GLSL 1.30 (and GLSL ES 3.00) onward contain
language requiring certain integer variables to be declared with the
"flat" keyword, but they differ in exactly *when* the rule is
enforced:

(a) GLSL 1.30 and 1.40 say that vertex shader outputs having integral
type must be declared as "flat".  There is no restriction on fragment
shader inputs.

(b) GLSL 1.50 through 4.30 say that fragment shader inputs having
integral type must be declared as "flat".  There is no restriction on
vertex shader outputs.

(c) GLSL ES 3.00 says that both vertex shader outputs and fragment
shader inputs having integral type must be declared as "flat".

Previously, Mesa's behaviour was consistent with (a).  This patch
makes it consistent with (b) when compiling desktop shaders, and (c)
when compiling ES shaders.

Rationale for desktop shaders: once we add geometry shaders, (b) really
seems like the right choice, because it requires "flat" in just the
situations where it matters.  Since we may want to extend geometry
shader support back before GLSL 1.50 (via ARB_geometry_shader4), it
seems sensible to apply this rule to all GLSL versions.  Also, this
matches the behaviour of the nVidia proprietary driver for Linux, and
the expectations of Intel's oglconform test suite.

Rationale for ES shaders: since the behaviour specified in GLSL ES
3.00 matches neither pre-GLSL-1.50 nor post-GLSL-1.50 behaviour, it
seems likely that this was a deliberate choice on the part of the GLES
folks to be more restrictive.  Also, the argument in favor of (b)
doesn't apply to GLES, since it doesn't support geometry shaders at
all.

Some discussion about this has already happened on the Mesa-dev list.
See:

http://lists.freedesktop.org/archives/mesa-dev/2013-February/034199.html

Fixes piglit tests:
- glsl-1.30/compiler/interpolation-qualifiers/nonflat-*.frag
- glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-0{2,3,4,5}.vert
- glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-{int,uint}.frag

Fixes oglconform tests:
- glsl-q-inperpol negative.fragin.{int,uint,ivec,uvec}

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit dfb57e7d1b)
2013-05-29 13:18:51 -07:00
Eric Anholt
9c610e0185 mesa: Make gl_renderbuffers backed by EGL images use FinishRenderTexture.
This is the opportunity that radeon and intel drivers rely on for flushing
render targets that may get reused as textures.  Before EGL, that only
happened for GL_TEXTURE attachments.

Fixes piglits:
KHR_gl_renderbuffer_image/renderbuffer-texture
OES_EGL_image/renderbuffer-texture

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c810e67c55)
2013-05-29 11:29:13 -07:00
Eric Anholt
4c9185fb5b mesa: Make core Mesa allocate the texture renderbuffer wrapper.
Every driver did the same thing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 749a92786d)
2013-05-29 10:50:05 -07:00
Brian Paul
66ac414c18 st/mesa: generate GL_OUT_OF_MEMORY if we can't create the index buffer
Before, if we failed to allocate the index buffer we'd silently
return from st_draw_vbo() without drawing anything.  We should
raise GL_OUT_OF_MEMORY to give some indication that something went
wrong.

Note: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit e0144019c0)
2013-05-23 11:15:19 -07:00
Fabian Bieler
c2fd5a1985 mesa/program: Don't copy propagate from swizzles.
Do not propagate a copy if source and destination are identical.

Otherwise code like

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].xyzw

is changed to

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].wzyx

This fixes Piglit test shaders/glsl-copy-propagation-self-2 for drivers that
use Mesa IR.

NOTE: This is a candidate for the stable branches.
Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 4e9c7f9c5a)
2013-05-23 11:14:59 -07:00
Fabian Bieler
4a34ac492b mesa/st: Don't copy propagate from swizzles.
Do not propagate a copy if source and destination are identical.

Otherwise code like

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].xyzw

is changed to

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].wzyx

This fixes Piglit test shaders/glsl-copy-propagation-self-2 for gallium drivers.

NOTE: This is a candidate for the stable branches.
Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e1ff753d67)
2013-05-23 11:14:54 -07:00
Chad Versace
740bdc1d91 egl/android: Fix error condition for EGL_ANDROID_image_native_buffer
Emit EGL_BAD_CONTEXT if the user passes a context to
eglCreateImageKHR(type=EGL_ANDROID_image_native_buffer).

From the EGL_ANDROID_image_native_buffer spec:
  * If <target> is EGL_NATIVE_BUFFER_ANDROID and <ctx> is not
    EGL_NO_CONTEXT, the error EGL_BAD_CONTEXT is generated.

Note: This is a candidate for the stable branches.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 2878f4685c)
2013-05-23 11:13:56 -07:00
Bryan Cain
251fa39bd2 nv50: initialize kick_notify callback in nv50_create
Fixes infinite loop on startup in Portal and Left 4 Dead 2.

NOTE: This is a candidate for the 9.0 and 9.1 branches.
(cherry picked from commit 14a0bb81fe)
2013-05-23 11:13:51 -07:00
Marek Olšák
e6755e4a74 vbo: fix possible use-after-free segfault after a VAO is deleted
This like the fifth attempt to fix the issue.

Also with the new "validating" flag, we can set recalculate_inputs to FALSE
earlier in vbo_bind_arrays, because _mesa_update_state won't change it.

NOTE: This is a candidate for the stable branches.

v2: fixed a typo

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8eef6ad2e2)
2013-05-23 11:13:10 -07:00
Brian Paul
da3f29d8ec mesa: fix the compressed TexSubImage size checking code
Before, we'd incorrectly generate an error if we we tried to
replace a non-4x4 block near the edge of a NPOT compressed texture.
For example, if the dest image was 15 texels wide and xoffset=12
and width=3 we'd incorrectly generate GL_INVALID_OPERATION.

Verified with new tests added to piglit s3tc-errors test.

Note: This is a candidate for the stable branches.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 49dda2d92f)
2013-05-23 11:12:38 -07:00
Tapani Pälli
870c357847 mesa: fix type comparison errors in sub-texture error checking code
patch fixes a crash that happens if glTexSubImage2D is called with a
negative xoffset.

NOTE: This is a candidate for stable branches.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 12b0bfa6e9)
2013-05-23 11:12:22 -07:00
Michel Dänzer
6a7e3fa46b mesa: Note that two radeonsi fixes cannot be backported after all 2013-05-23 11:11:24 +02:00
Vinson Lee
3fead93301 radeon: Initialize variables in radeon_llvm_context_init.
'type' was not fully initialized when calling lp_build_context_init.

Fixes "Uninitialized scalar variable" defect reported by Coverity.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 36e2c7cc1a)
2013-05-23 10:32:54 +02:00
Michel Dänzer
fa6f0f16fe radeonsi: Fix user clip planes
4 more little piglits.

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

Conflicts:
	src/gallium/drivers/radeonsi/si_state_draw.c
2013-05-23 10:32:29 +02:00
Michel Dänzer
3db274fbd1 radeonsi: Fix handling of TGSI_SEMANTIC_PSIZE
Two more little piglits.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 4730dea5f5)
2013-05-23 10:20:17 +02:00
Marek Olšák
238dc959d2 radeonsi: increase array size for shader inputs and outputs
and add assertions to prevent buffer overflow. This fixes corruption
of the si_shader struct.

NOTE: This is a candidate for the 9.1 branch.

[ Cherry-pick of r600g commit da33f9b919 ]

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 2eac0aa1d8)
2013-05-23 10:19:34 +02:00
Alex Deucher
f48ed84e03 radeonsi: add Hainan pci ids
Note: this is a candidate for the 9.1 branch

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 29b8d6a1da)
2013-05-23 10:09:58 +02:00
Alex Deucher
2169d7f23d radeonsi: add support for hainan chips
Note: this is a candidate for the 9.1 branch

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 4045c3d060)
2013-05-23 10:09:52 +02:00
Ian Romanick
f00ae9c773 docs: Add 9.1.3 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-05-21 13:04:42 -07:00
Ian Romanick
f32ec82a8c docs: 9.1.3 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-05-21 12:59:17 -07:00
Ian Romanick
e9be1f7ce5 mesa: Bump version to 9.1.3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-05-21 12:49:28 -07:00
Ian Romanick
caeab4d170 mesa: Note that a824692 is already back ported
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-05-21 12:47:32 -07:00
Paul Berry
cbe0e50247 intel: Do a depth resolve before copying images between miptrees.
When intel_finalize_mipmap_tree() calls intel_miptree_copy_teximage()
to reassemble a depth miptree that has been broken apart into pieces
(to deal with misalignment of levels/layers within the miptree), it
just copies the depth data, not the HiZ data.  This is reasonable,
since the alignment restrictions of HiZ are a large part of the reason
why the miptree had to be broken apart in the first place.  However,
in order for the depth copy to be sufficient, we need to do a depth
resolve first, to make sure any deferred depth writes that are in the
HiZ buffer get performed.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=64662 and
https://bugs.freedesktop.org/show_bug.cgi?id=64659.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 46ea804107)
2013-05-16 17:16:36 -07:00
Martin Andersson
c3eb301a3a r600g: Fix UMAD on Cayman
The multiplication part of tgsi_umad did not work on Cayman, because it did
not populate the correct vector slots.

This fixed hardlocks in the EXT_transform_feedback/order tests.

NOTE: This is a candidate for the stable branches.
(might not be easy to cherry-pick though)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Stable backport:
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-05-15 02:14:07 +01:00
Chad Versace
4969960105 intel: Allocate hiz in intel_renderbuffer_move_to_temp()
When moving the renderbuffer to a new miptree, we neglected to allocate
the hiz buffer for the new miptree. Oops.

Fixes all Piglit depthstencil-render-miplevels tests from crash to pass on
Sandybridge.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit aa391976df)
2013-05-14 11:24:49 -07:00
Eric Anholt
22f7bcd44f i965: Disable write masking when setting up texturing m0.
v2/Kayden: Also disable write masking in the vec4 backend.

Fixes 78 oglconform glsl-bif-tex-* subcases.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
(cherry picked from commit 86536a321d)
2013-05-13 09:17:06 -07:00
Chad Versace
3933e65328 egl/dri2: Fix min/max swap interval of configs
The commit below exposed a bug in dri2_add_config.

    commit 3998f8c6b5
    Author: Ralf Jung <post@ralfj.de>
    Date:   Tue Apr 9 14:09:50 2013 +0200

	egl/x11: Fix initialisation of swap_interval

This little code snippet near the bottom of dri2_add_config,

    if (double_buffer) {
       ...
       conf->base.MinSwapInterval = dri2_dpy->min_swap_interval;
       conf->base.MaxSwapInterval = dri2_dpy->max_swap_interval;
    }

it never did what it claimed to do. The assignment never changed the value
of conf->base.MaxSwapInterval, because dri2_dpy->max_swap_interval was,
until the above exposing commit, unitialized here. That is,
conf->base.MaxSwapInterval was 0 before and after assignment. Ditto for
the min swap interval.

Above the troublesome code snippet, the call to _eglFilterArray rejects
the config as unmatching if its swap interval bounds differ from the base
config's.  Before the exposing commit, at the call to _eglFilterArray, the
swap interval bounds were always [0,0], and hence no config was rejected
due to swap interval.

After the exposing commit, _eglFilterArray incorrectly rejected some
configs, which prevented dri2_egl_config::dri_double_config from getting
set for the rejected config, which resulted in a NULL pointer getting
passed into dri2CreateNewDrawable, and then segfault.

The solution: set the swap interval bounds before _eglFilterArray.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63447
Tested-by: Lu Hua <huax.lu@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit d3dfce3276)
2013-05-13 09:14:24 -07:00
Andreas Boll
1e043ebe03 mesa: add usage examples to get-pick-list and shortlog scripts
NOTE: This is a candidate for the stable branches.
(cherry picked from commit b8e41db053)
2013-05-10 16:41:33 -07:00
Andreas Boll
8487315e6e mesa: Add a script to generate the list of fixed bugs
This list appears in the fixed bugs section of the release notes.

v2: Add usage examples

NOTE: This is a candidate for the stable branches.
(cherry picked from commit ca79b72c00)
2013-05-10 16:41:33 -07:00
Eric Anholt
7881aae604 i965: Fix hangs on HSW since the gen6 blorp fix.
The constant packets for gen6 are too small for gen7, and while IVB seems
happy with them HSW blows up.  Fix it by emitting the correct packets on
gen7, for all stages.

v2: Include the packets instead of just skipping them.
NOTE: This is a candidate for the stable branches.
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5d06c9ea0f)
2013-05-10 16:41:33 -07:00
Eric Anholt
23fb93a918 i965: Fix SNB GPU hangs when a blorp batch is the first thing to execute.
The GPU apparently goes looking for constants even though there are no
shader stages enabled, and gets stuck because we haven't told it there are
no constants to collect.  If any other user of the 3D pipeline had run
(even the Render accel of the X server!) since power on, then the in-GPU
constant buffers would have been set up with some contents we didn't use,
and we would succeed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56416
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Dave Airlie <airlied@redhat.com>
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 1dfea559c3)
2013-05-10 16:41:33 -07:00
Kenneth Graunke
49fa2f1135 i965/vs: Fix textureGrad() with shadow samplers on Haswell.
The shadow comparitor needs to be loaded into the Z component of the
last DWord.

Fixes es3conform's shadow_execution_vert and oglconform's
shadow-grad advanced.textureGrad.1D tests on Haswell.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b5b6460c40)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
6907c00059 i965: Lower textureGrad() for samplerCubeShadow.
According to the Ivybridge PRM, Volume 4 Part 1, page 130, in the
section for the sample_d message: "The r coordinate contains the faceid,
and the r gradients are ignored by hardware."

This doesn't match GLSL, which provides gradients for all of the
coordinates.  So we would need to do some math to compute the face ID
before using sample_d.  We currently don't have any code to do that.

However, we do have a lowering pass that converts textureGrad to
textureLod, which solves this problem.  Since textureGrad on three
components is sufficiently obscure, it's not a performance path.

For now, only handle samplerCubeShadow; we need tests for samplerCube
and samplerCubeArray.

Fixes es3conform's shadow_comparison_frag test on Haswell.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e2f887b243)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
79f89b46e1 glsl: Ignore redundant prototypes after a function's been defined.
Consider the following shader:

    vec4 f(vec4 v) { return v; }
    vec4 f(vec4 v);

The prototype exactly matches the signature of the earlier definition,
so there's absolutely no point in it.  However, it doesn't appear to
be illegal.  The GLSL 4.30 specification offers two relevant quotes:

"If a function name is declared twice with the same parameter types,
 then the return types and all qualifiers must also match, and it is the
 same function being declared."

"User-defined functions can have multiple declarations, but only one
 definition."

In this case the same function was declared twice, and there's only one
definition, which fits both pieces of text.  There doesn't appear to be
any text saying late prototypes are illegal, so presumably it's valid.

Unfortunately, it currently triggers an assertion failure:
ir_dereference_variable @ <p1> specifies undeclared variable `v' @ <p2>

When we process the second line, we look for an existing exact match so
we can enforce the one-definition rule.  We then leave sig set to that
existing function, and hit sig->replace_parameters(&hir_parameters),
unfortunately nuking our existing definition's parameters (which have
actual dereferences) with the prototype's bogus unused parameters.

Simply bailing out and ignoring such late prototypes is the safest
thing to do.

Fixes Piglit's late-proto.vert as well as 3DMark/Ice Storm for Android.

NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
(cherry picked from commit 6c5cf8baa1)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39251
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61773
2013-05-10 16:41:32 -07:00
Alex Deucher
3f0ed60f93 radeonsi: add new SI pci ids
Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b5145ca2a8)
2013-05-10 16:41:32 -07:00
Alex Deucher
b517272a5d r600g: add new richland pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b3a856dfa9)
2013-05-10 16:41:32 -07:00
José Fonseca
3fb9f18be9 winsys/sw/xlib: Prevent shared memory segment leakage.
Running piglit with this was causing all sort of weird stuff happening
to my desktop (Chromium webpages become blank, Qt Creator flickered,
etc).  I tracked this down to shared memory segment leakage when GL is
not shutdown properly. The segments can be seen running `ipcs` and
looking for nattch==0.

This changes fixes this by calling shmctl(IPC_RMID) soon after creation
(which does not remove the segment immediately, but simply marks it for
removal when no more processes are attached).

This matches src/mesa/drivers/x11/xm_buffer.c behaviour.

v2:
- move shmctl(IPC_RMID) after XShmAttach() for *BSD, per Chris Wilson
- remove stray debug printfs, spotted by Ian Romanick

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e29525f79f)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
e0e885ab86 mesa: Add unpack functions for A/I/L/LA [U]INT8/16/32 formats.
NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cef31bb290)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
07671a5627 mesa: Add unpack functions for R/RG/RGB [U]INT8/16/32 formats.
NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 995051ee34)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
9f66038b5b mesa: Add an unpack function for ARGB2101010_UINT.
v2: Remove extra parenthesis (suggested by Brian).

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 531be501de)
2013-05-10 16:41:32 -07:00
Kenneth Graunke
d28e375a3e mesa: Fix unpack function for ETC2_SRGB8_PUNCHTHROUGH_ALPHA1.
We accidentally set MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1 twice,
rather than setting the RGB8 and SRGB8 formats.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b1fded54c9)
2013-05-10 16:41:31 -07:00
Marek Olšák
9548c93768 st/mesa: depth-stencil-alpha state also depends on _NEW_BUFFERS
because the code looks at the visual if there is a depth or stencil buffer
before enabling depth or stencil, respectively.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d23c7455ae)
2013-05-10 16:41:31 -07:00
Marek Olšák
54cfc3fd3a r600g: initialize CMASK and HTILE with the GPU using streamout
This fixes a crash when a resource cannot be mapped to the CPU's address space
because it's too big.

This puts a global pipe_context in r600_screen, which is guarded by a mutex,
so that we can use pipe_context when there isn't one around.
Hopefully our multi-context support is solid.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit b692076420)
2013-05-10 16:41:31 -07:00
Marek Olšák
a040faa894 gallium/u_blitter: implement buffer clearing
Although this might be useful for ARB_clear_buffer_object,
I need it for initializating resources in r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: comment cleanups

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 1ba46bbb4c)
2013-05-10 16:41:31 -07:00
Vadim Girlin
2f4134f7b5 gallium: handle drirc disable_glsl_line_continuations option
NOTE: This is a candidate for the 9.1 branch

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f732036f12)
2013-05-10 16:41:31 -07:00
Brian Paul
7088218b9c mesa: enable GL_ARB_texture_float if TEXTURE_FLOAT_ENABLED is defined
Per message on mesa-users list, this wasn't working before.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 877e3c1d42)
2013-05-10 16:41:31 -07:00
Dave Airlie
ed00ea3444 ralloc: don't write to memory in case of alloc fail.
For some reason I made this happen under indirect rendering,
I think we might have a leak, valgrind gave out, so I said I'd
fix the basic problem.

NOTE: This is a candidate for stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 47bd6e46fe)
2013-05-10 16:41:31 -07:00
Ian Romanick
1665f29c29 intel: Don't dereference a NULL pointer of calloc fails
The caller of NewTextureObject does the right thing if NULL is returned,
so this function should do the right thing too.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 505ac6ddc6)
2013-05-10 16:41:31 -07:00
Ian Romanick
9ef8b94e22 mesa/swrast: Move free calls outside the attachment loop
This was originally discovered by Klocwork analysis:

    Possible memory leak. Dynamic memory stored in 'srcBuffer0'
    allocated through function 'malloc' at line 566 can be lost at line
    746

However, I think the problem is actually much worse.  Since the memory
is freed after the first pass through the loop, the released buffer may
be used on the next iteration!

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a27c6e1aea)
2013-05-10 16:41:31 -07:00
Ian Romanick
4a6a33d398 mesa/swrast: Refactor no-memory error checking in blit_linear
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 6758498eb7)
2013-05-10 16:41:30 -07:00
Roland Scheidegger
713e321fcf gallivm: fix small but severe bug in handling multiple lod level strides
Inserting the value for the second quad in the wrong place for the
following shuffle. This meant the row or image stride was undefined which is
quite catastrophic, can lead to bogus texels fetched or just segfault.
This code is only hit for SoA path currently, still surprising it
didn't crash more or caused more visible issues (I think llvm used a
broadcast shuffle for the undefined parts of the vector, hence the undefined
value for the second quad was just the same as that from the first quad,
so as long as both quads hit the same mip level everything was fine, and since
lower mips always have the same large stride it made it less likely to
hit out-of-bound memory in case of differing lods).

Note: this is a candidate for stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 1d6eb23f2d)
2013-05-10 16:41:30 -07:00
Ian Romanick
a61650ab83 mesa: Don't leak gl_context::BeginEnd at context destruction
The other dispatch tables (Exec and Save) are freed, but BeginEnd is
never freed.  This was found by inspection why investigating the leak of
shared state in _mesa_initialize_context.

NOTE: This is a candidate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 1faaa411c7)
2013-05-10 16:41:30 -07:00
Ian Romanick
13f7cd25f3 mesa: Don't leak shared state when context initialization fails
Back up at line 1017 (not shown in patch), we add a reference to the
shared state.  Several places after that may divert to the error
handler, but, as far as I can tell, nothing ever unreferences the shared
state.

Fixes issue identified by Klocwork analysis:

    Resource acquired to 'shared->TexMutex' at line 1012 may be lost
    here. Also there is one similar error on line 1087.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6e06550e4e)
2013-05-10 16:41:30 -07:00
Ian Romanick
e928a3059c egl/dri2: NULL check value returned by dri2_create_surface
dri2_create_surface can fail for a variety of reasons, including bad
input data.  Dereferencing the NULL pointer and crashing is not okay.

Fixes issue identified by Klocwork analysis:

    Pointer 'surf' returned from call to function 'dri2_create_surface'
    at line 285 may be NULL and will be dereferenced at line 291.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f730c210b8)
2013-05-10 16:41:30 -07:00
Ian Romanick
93613693ad mesa: NULL check the pointer before trying to dereference it
Duh.

Fixes issues identified by Klocwork analysis:

    Pointer 'table' returned from call to function 'calloc' at line 115
    may be NULL and will be dereferenced at line 117.

and

    Suspicious dereference of pointer 'table' before NULL check at line
    119.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2cc0b3294a)
2013-05-10 16:41:30 -07:00
Dave Airlie
377213b3ee st/mesa: fix UBO offsets.
Reported and tested by degasus on #radeon.

Note: This is a candidate for the 9.1 branch

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit cb12bf7606)
2013-05-10 16:41:30 -07:00
Ralf Jung
d1b4165fcf egl/x11: Fix initialisation of swap_interval
The EGLConfig attributes EGL_MIN/MAX_SWAP_INTERVAL were incorrectly set to
0 and 0. This prevented clients from setting the swap interval to a
reasonable value, like 1 or 2.

Swap interval worked correctly in Mesa 9.0. The commit below introduced
the bug.

    commit 7e9bd2b2ed
    Author: Eric Anholt <eric@anholt.net>
    Date:   Tue Sep 25 14:05:30 2012 -0700
	egl: Add support for driconf control of swapinterval.

Note: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63078
[chadv: Wrote commit message]
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3998f8c6b5)
2013-05-10 16:41:30 -07:00
Eric Anholt
04d7b718c6 i965/gen6: Reduce updates of transform feedback offsets with HW contexts.
The software-tracked transform feedback offsets (svbi_0_starting_index)
are incorrect in the presence of primitive restart, so we were actually
updating it with a bogus value if the batch wrapped and we emitted the
packet again during a single transform feedback.  By reducing state
emission, we avoid the bug.

Fixes piglit OpenGL 3.1/primitive-restart-xfb flush
Reviewed-by: Paul Berry <stereotype441@gmail.com>
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 007a88ed24)
2013-05-10 16:41:30 -07:00
Eric Anholt
d47e7a76a3 i965/gen7: Skip resetting SOL offsets at batch start with HW contexts.
The software-tracked transform feedback offsets (svbi_0_starting_index)
are incorrect in the presence of primitive restart, so we can't reliably
compute offsets for our buffer pointers after a batch flush.  Thanks to HW
contexts, our transform feedback offsets are now saved, so we can just
keep using the ones from before the batch wrap.

Fixes piglit OpenGL 3.1/primitive-restart-xfb flush
Reviewed-by: Paul Berry <stereotype441@gmail.com>
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 62a18da341)
2013-05-10 16:41:29 -07:00
Marek Olšák
4ae5638864 mesa: fix glGet queries depending on derived framebuffer state (v2)
"ctx->DrawBuffer->Visual" might be invalid if (NewState &_NEW_BUFFERS) != 0.

v2: also fix:
    - RGBA_INTEGER_MODE_EXT
    - RGBA_FLOAT_MODE_ARB (also check API support)
    - FRAMEBUFFER_SRGB_CAPABLE_EXT

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b6475f9437)
2013-05-10 16:41:29 -07:00
Paul Berry
7c6d62a670 glsl/linker: Reduce scope of non-flat integer varying fix.
In the mailing list discussion of "glsl/linker: fix varying packing
for non-flat integer varyings." (commit 7862bde), we concluded that
since the bug only applies to integral variables, it is safer to just
apply the bug fix to integer varyings.  I forgot to make the change
before pushing the patch upstream.  (Note: we aren't aware of any bugs
in commit 7862bde; it just seems wise to be on the safe side).

This patch makes the change.  Assuming commit 7862bde gets
cherry-picked back to 9.1, this commit should be cherry-picked too.

NOTE: This is a candidate for the 9.1 release branch.
(cherry picked from commit 5306af2113)
2013-05-10 16:41:29 -07:00
Paul Berry
6e0960e726 glsl/linker: Adapt flat varying handling in preparation for geometry shaders.
When a varying is consumed by transform feedback, but is not used by
the fragment shader, assign_varying_locations() sets its interpolation
type to "flat" in order to ensure that lower_packed_varyings never has
to deal with non-flat integral varyings (the GLSL spec doesn't require
integral vertex outputs to be flat if they aren't consumed by the
fragment shader).

A similar situation will arise when geometry shader support is added,
since the GLSL spec only requires integral vertex shader outputs to be
flat when they are consumed by the fragment shader.  This patch
modifies the linker to handle this situation too.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 32d2b2aa2c)
2013-05-10 16:41:29 -07:00
Paul Berry
0b2fa0eec6 glsl: Document lower_packed_varyings' "flat" requirement with an assert.
To minimize the variety of type conversions that lower_packed_varyings
needs to perform, it assumes that integral varyings are always
qualified as "flat".  link_varyings.cpp takes care of ensuring that
this is the case (even in the circumstances where GLSL doesn't require
it).

This patch documents the assumption with an assertion, for ease in
future debugging.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 8687c40c2d)
2013-05-10 16:41:29 -07:00
Paul Berry
bd8d257ef3 glsl/linker: fix varying packing for non-flat integer varyings.
Commit dfb57e7 (glsl: Fix error checking on "flat" keyword to match
GLSL ES 3.00, GLSL 1.50) relaxed the rules for integral varyings: they
only need to be declared as "flat" if they are a fragment shader
inputs.  This allowed for the possibility of a vertex shader output
being a non-flat integer, provided that it was not matched to a
fragment shader input.  A non-contrived situation where this might
arise is if a vertex shader generates some integral outputs which are
consumed by tranform feedback, but not by the fragment shader.

Unfortunately, lower_packed_varyings assumes that *all* integral
varyings are flat, regardless of whether they are consumed by the
fragment shader.  As a result, attempting to create a non-flat
integral vertex output of a size that required packing (i.e. a size
other than ivec4 or uvec4) would cause an assertion failure in
lower_packed_varyings.

This patch prevents the assertion failure by forcing vertex shader
outputs to be "flat" whenever they are not consumed by the fragment
shader.  This should have no effect on rendering since the "flat"
keyword only affects the behaviour of fragment shader inputs.

Fixes piglit test "spec/EXT_transform_feedback/nonflat-integral".

NOTE: This is a candidate for the 9.1 release branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 7862bde8af)
2013-05-10 16:41:29 -07:00
Chris Forbes
509054eb25 mesa: don't memcmp() off the end of a cache key.
Reported-by: `per` in #intel-gfx

The size of the cache key varies, so store the actual size as well as
the key blob itself, rather than just assuming it's the same as the size
passed in.

NOTE: This is a candidate for stable branches.

V2: Don't leave silly holes in structure; use unsigned instead of GLuint.
V3: Fix missing case for `last` match.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit c4629ad3f9)
2013-05-10 16:41:29 -07:00
Brian Paul
df4e6650e3 gallium/u_blitter: fix is_blit_generic_supported() stencil checking
Don't check if there's sampler support for stencil if we're not
going to actually blit/copy stencil values.  Fixes the case where
we mistakenly said we can't support a blit of depth values from
S8Z24 to X8Z24.

Also, rename the is_stencil variable to dst_has_stencil to improve
readability.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit de99b6d117)
2013-05-10 16:41:29 -07:00
Alexander Monakov
cc53944c26 Honor GLX_DONT_CARE in MATCH_MASK
NOTE: This is a candidate for stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47478
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62999
Bugzilla: http://bugs.winehq.org/show_bug.cgi?id=26763
(cherry picked from commit 9cda356004)
2013-05-10 16:41:29 -07:00
Kenneth Graunke
acc3561cca i965: Fix stencil write enable flag in 3DSTATE_DEPTH_BUFFER on Gen7+.
ctx->Stencil.WriteMask is a statically sized array of 3 elements.
Checking it against 0 actually is a NULL check, and can never fail,
which meant that we always said stencil writes were enabled.

Use the new core Mesa derived state flag to fix this.

NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 01bd29d681)
2013-05-10 16:41:28 -07:00
Paul Berry
671e4e6b9e i965: Reduce code duplication in handling of depth, stencil, and HiZ.
This patch consolidates duplicate code in the brw_depthbuffer and
gen7_depthbuffer state atoms.  Previously, these state atoms contained
5 chunks of code for emitting the _3DSTATE_DEPTH_BUFFER packet (3 for
Gen4-6 and 2 for Gen7).  Also a lot of logic for determining the
appropriate buffer setup was duplicated between the Gen4-6 and Gen7
functions.

This refactor splits the code into three separate functions:
brw_emit_depthbuffer(), which determines the appropriate buffer setup
in a mostly generation-independent way, brw_emit_depth_stencil_hiz(),
which emits the appropriate state packets for Gen4-6, and
gen7_emit_depth_stencil_hiz(), which emits the appropriate state
packets for Gen7.

Tested using Piglit on Gen5-7 (no regressions).

v2: Re-word some comments.  Fix an assertion that incorrectly
prohibited packed depth/stencil formats on Gen6 (these are allowed
provided that HiZ is disabled).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 41e4bccc75)
2013-05-10 16:41:28 -07:00
Kenneth Graunke
ae79402dba mesa: Add new ctx->Stencil._WriteEnabled derived state flag.
i965 needs to know whether stencil writes are enabled in several places,
and gets the test wrong sometimes.  While we could create a function to
compute this, it seems generally useful enough to warrant a new piece of
derived state.  Also, all the plumbing is already in place.

NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 1e3235d36e)
2013-05-10 16:41:28 -07:00
Marek Olšák
2708dc5e88 radeonsi: add more cases for copying unsupported formats to resource_copy_region
Ported from r600g commit:

8891b2f9c9

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit ff01e0db0e)
2013-05-10 16:41:28 -07:00
Paul Berry
c5a1eabaf2 glsl: Fix array indexing when constant folding built-in functions.
Mesa constant-folds built-in functions by using a miniature GLSL
interpreter (see
ir_function_signature::constant_expression_evaluate_expression_list()).
This interpreter had a bug in its handling of array indexing, which
caused expressions like "m[i][j]" (where m is a matrix) to be handled
incorrectly.  Specifically, it incorrectly treated j as indexing into
the whole matrix (rather than indexing just into the vector m[i]); as
a result the offset computed for m[i] was lost and m[i][j] was treated
as m[j][0].

Fixes piglit tests inverse-mat[234].{vert,frag}.

NOTE: This is a candidate for the 9.1 and 9.0 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57436
(cherry picked from commit 7d4f1e6467)
2013-05-10 16:41:28 -07:00
Michel Dänzer
7c6472410a radeonsi: Handle arbitrary 2-byte formats in resource_copy_region
Fixes mplayer -vo vdpau OSD.

NOTE: This is a candidate for the 9.1 branch.

Reported-by: Igor Vagulin <igor.vagulin@gmail.com>

Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit c6efb4870b)
2013-05-10 16:41:28 -07:00
Maarten Lankhorst
09f5ee9918 nvc0: Fix fd leak in nvc0_create_decoder
NOTE: This is a candidate for the 9.0 and 9.1 branches.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit 6d20c646d6)
2013-05-10 16:41:28 -07:00
Aras Pranckevicius
46ac963a23 GLSL: fix lower_jumps to report progress properly
A fix for lower_jumps progress reporting, very much like similar in
c1e591eed.

NOTE: This is a candidate for stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b2eee0869f)
2013-05-10 16:41:28 -07:00
Eric Anholt
ee561e0927 i965/fs: Clean up the setup of gen4 simd16 message destinations.
I think this makes it much more obvious what's going on here.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8edc7cbe64)
2013-05-10 16:41:28 -07:00
Eric Anholt
724269bb32 i965/fs: Do CSE on gen7's varying-index pull constant loads.
This is our first CSE on a regs_written() > 1 instruction, so it takes a
bit of extra fixup.  Reduces the number of loads on kwin's Lanczos shader
from 12 to 2.

v2: Fix compiler warning (false positive on possibly-uninitialized variable)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61554
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 9f43b84928)
2013-05-10 16:41:27 -07:00
Eric Anholt
f523c0fb21 i965/fs: Avoid inappropriate optimization with regs_written > 1.
Right now we don't have anything with regs_written() > 1 and !inst->mlen,
but that's about to change.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bc0e1591f6)
2013-05-10 15:40:28 -07:00
Eric Anholt
52bf09d52c i965: Make the constant surface interface take a normal byte size.
This puts the rounding-up logic into the function itself instead of all
the callers having to manage it.  Also drop an "unused" comment in gen4,
as the stride *is* used for texbos (and will be for uniforms soon).

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2f41a60145)
2013-05-10 13:43:11 -07:00
Eric Anholt
7f2a65d896 i965/fs: Move varying uniform offset compuation into the helper func.
I'm going to want to change the math for gen7 using sampler LD
instructions in a way that gets CSE to occur like we'd hope.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8c694dfe64)
2013-05-10 13:43:11 -07:00
Eric Anholt
d61b1fdad6 i965/fs: Remove creation of a MOV instruction that's never used.
We weren't inserting it into the list, so it did nothing.  This line was
replaced by the MOV/MUL block above.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 59e858861c)
2013-05-10 13:43:11 -07:00
Haixia Shi
627e2669ab ACTIVE_UNIFORM_MAX_LENGTH should include 3 extra characters for arrays.
If the active uniform is an array, then the length of the uniform name should
include the three extra characters for the "[0]" suffix, which is required by
the GL 4.2 spec to be appended to the uniform name in glGetActiveUniform().

This avoids the situation where the output buffer does not have enough space
to hold the "[0]" suffix, resulting in an incomplete array specification like
"foobar[0".

NOTE: This is a candidate for the 9.1 branch.

Change-Id: I41e87ba347a7169eec8c575596cc3416adbe0728
Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit bc0cc2944f)
2013-05-10 13:43:11 -07:00
Brian Paul
44d35d70e3 mesa: remove platform checks around __builtin_ffs, __builtin_ffsll
Use the __builtin_ffs, __builtin_ffsll functions whenever we have GCC,
not just for specific platforms.  Fixes Solaris build.

Note: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62868
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 95df2b2883)
2013-05-10 13:43:11 -07:00
Ian Romanick
f5887e4d3f mesa: Note that patch 0967c36 shouldn't actually get picked to the 9.1 branch
The code didn't apply cleanly due to a number of refactors, so a
different solution was needed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-05-10 13:43:11 -07:00
Chris Forbes
34a4fc5989 i965/fs: Don't try to use bogus interpolation modes pre-Gen6.
Interpolation modes other than perspective-barycentric-pixel-center (and
their associated coefficients in the WM payload) only exist in Gen6 and
later.

Unfortunately, if a varying was declared as `centroid`, we would blindly
read the nonexistant values, and so produce all manner of bad behavior
-- texture swimming, snow, etc.

Fixes rendering in Counter-Strike Source and Team Fortress 2 on
Ironlake.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 79f786f936)
2013-05-08 15:39:25 -07:00
Ian Romanick
f81eea3f1f docs: Add 9.1.2 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-30 15:25:57 -07:00
Ian Romanick
8c2981b8e0 docs: 9.1.2 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-30 15:18:53 -07:00
Ian Romanick
f9abbcacaa mesa: Bump version to 9.1.2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-30 15:17:47 -07:00
Chris Forbes
251c87d884 i965/vs: Fix Gen4/5 VUE map inconsistency with gl_ClipVertex
This is roughly a backport of Eric's commit 0967c362.

We avoided assigning a slot in the VUE map for gl_ClipVertex, but left
the bit set in outputs_written, producing horrible confusion further
down the pipe.

Mostly fixes rendering in source games, and probably in Freespace 2 SCP.

No Piglit regressions on Ironlake.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>

V2: Mask out the bit, not its index. Strangely, the game still worked
with that wrong, but rendering of pretty much anything else was
completely trashed.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-04-30 07:16:02 +12:00
Adam Jackson
3cff41c7e4 linux: Don't emit a .note.ABI-tag section anymore (#26663)
We don't support pre-2.6 kernels anyway - the install docs say 2.6.28
for DRI - and apparently this confuses ld.so's sorting when multiple
libGLs are installed.  Just remove it.

Note: this is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 904b03824b)
2013-04-27 17:22:51 +10:00
Alex Deucher
e78b553195 r600g: disable hyperz by default on 9.1
There are too many cases were we end up with lockups.
Once we sort out the remaining issues on master, they
can be backported and hyperz can be re-enabled on 9.1

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-22 12:16:51 -04:00
Tom Stellard
f0440493c2 r300g: Fix bug in OMOD optimization
https://bugs.freedesktop.org/show_bug.cgi?id=60503

NOTE: This is a candidate for the stable branches.
(cherry picked from commit c6a86fb563)
2013-04-12 09:35:00 -07:00
Carl Worth
4f44146226 i965: Avoid segfault in gen6_upload_state
This fixes a bug introduced in commit 258453716f and
triggered whenever "rb" is NULL.

Fixes at least one cause bug #59445:

	[SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault
	https://bugs.freedesktop.org/show_bug.cgi?id=59445

(Though segfaults are still possible in that test case, but they have been
present since before commit 258453716f which is what's being fixed here.)

Reviewed-by: Eric Anholt <eric@anholt.net>
[jordan.l.justen@intel.com: fixes Anomaly Warzone Earth crash at title screen]
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-10 19:48:56 -07:00
Ian Romanick
39bb794aba mesa: Note that patch dbf94d1 should't actually get picked to the 9.1 branch
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-08 15:01:07 -07:00
Ian Romanick
c18d48da41 glsl: Add missing bool case in glsl_type::get_scalar_type
Since the case was missing bec4->get_scalar_type() would return bvec4,
but vec4->get_scalar_type() would return float.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit c770faea0a)
2013-04-08 14:49:58 -07:00
Martin Andersson
830bc1cbe6 r600g: Use virtual address for PIPE_QUERY_SO* in r600_emit_query_end
Virtual address is used for PIPE_QUERY_SO* queries in
r600_emit_query_begin, but not in r600_emit_query_end.

This will trigger a GPU fault when one of those queries is
made and virtual address is enabled.

Note: this is a candidate for the 9.1 branch

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 92855bcc95)
2013-04-08 14:49:53 -07:00
Eric Anholt
c589071fb2 mesa: Disable validate_ir_tree() on release builds.
Since half of ir_validate uses asserts() (the other using printf() then
abort()), there's not much use to calling it in a release build.  Cuts
6.3% of the startup time of TF2.

NOTE: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 712bac1f41)
2013-04-08 14:49:48 -07:00
Marek Olšák
80092d8869 mesa: handle HALF_FLOAT like FLOAT in get_tex_rgba
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b2a4573c14)
2013-04-08 14:49:44 -07:00
Matt Turner
c7720a24be mesa: Implement TEXTURE_IMMUTABLE_LEVELS for ES 3.0.
NOTE: This is a candidate for the 9.1 branch.
Fixes piglit's texture-immutable-levels test.
Reported-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 12dc4be8a6)
2013-04-05 19:01:10 -07:00
Adam Jackson
82ac970d37 glx: Build with VISIBILITY_CFLAGS in automake
Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 38aa8ec937)
2013-04-05 19:01:09 -07:00
Michel Dänzer
e0af764882 radeonsi: Emit pixel shader state even when only the vertex shader changed
Fixes random failures with piglit glsl-max-varyings.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 032e5548b3)
2013-04-05 19:01:09 -07:00
Kenneth Graunke
0c5fa7ae0e i965: Don't use texture swizzling to force alpha to 1.0 if unnecessary.
Commit 33599433c7 began setting the texture swizzle mode to XYZ1 for
RED, RG, and RGB textures in order to force alpha to 1.0 in case we
actually stored the texture as RGBA.

This had a unforseen performance implication: the shader precompile
assumes that the texture swizzle mode will be XYZW for non-shadow
sampler types.  By setting it to XYZ1, this means every shader used with
a RED, RG, or RGB texture has to be recompiled.  This is a very common
case.

Unfortunately, there's no way to improve the precompile, since RGBA
textures still need XYZW, and there's no way to know by looking at
the shader source what texture formats might be used.

However, we only need to smash alpha to 1.0 if the texture's memory
format actually has alpha bits.  If not, the sampler already returns 1.0
for us without any special swizzling.  XRGB8888, for example, is a very
common case where this occurs.

This partially fixes a performance regression since commit 33599433c7.
More work is required to fully fix it in all cases.  This at least helps
Warsow.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d86efc075e)
2013-04-05 19:01:09 -07:00
Maarten Lankhorst
725c671d61 radeon/llvm: Do not link against libgallium when building statically.
NOTE: This is a candidate for the 9.1 branch.

Tested-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit 7c3d8301af)
2013-04-05 19:01:09 -07:00
Andreas Boll
4205bd4b9b gallium/egl: fix out-of-tree build
Taken from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/15-fix-oot-build.diff;h=7040999a22d3937d0578cfd85ee2c71d7dc614bb;hb=refs/heads/ubuntu%2B1

NOTE: This is a candidate for the 9.1 branch.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 182895c4e6)
2013-04-05 19:01:09 -07:00
Andreas Boll
6e8f8a959b osmesa: fix out-of-tree build
Taken from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/14-fix-osmesa-build.diff;h=00581d0e1833c5492d9050e1bf3d5e658cad782e;hb=refs/heads/ubuntu%2B1

v2: Move the added line immediately after -I$(top_srcdir)/src/mapi

NOTE: This is a candidate for the 9.1 and 9.0 branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 92e6260c19)
2013-04-05 19:01:09 -07:00
Andreas Boll
0c0e72f756 build: Enable x86 assembler on Hurd.
Taken from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/10-hurd-configure-tweaks.diff;h=984e17df1b8afdf8e4b36bee96aa5ab6a5691021;hb=refs/heads/ubuntu%2B1

Thanks to Pino Toscano.

v2: Don't bother with x86_64. AFAICT GNU/Hurd doesn't support it so far.

NOTE: This is a candidate for stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Acked-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 06fff296e9)
2013-04-05 19:01:09 -07:00
Andreas Boll
60e5696de3 mesa: use ieee fp on s390 and m68k
Taken from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch;h=d3d6c1d7fec3c72ecf320706167deb61c52636c3;hb=refs/heads/ubuntu%2B1

Fixes Debian bug #349437.

Patch written by David Nusinow.

NOTE: This is a candidate for stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 7962f28c43)
2013-04-05 19:01:09 -07:00
Roland Scheidegger
7067d65e56 gallivm: fix return opcode handling in main function of a shader
If we're in some conditional or loop we must not return, or the code
after the condition is never executed.
(v2): And, we also can't just continue as nothing happened, since the
mask update code would later check if we actually have a mask, so we
need to remember that there was a return in main where we didn't exit
(to illustrate this, a ret in a if clause would cause a mask update
which is still ok as we're in a conditional, but after the endif the
mask update code would drop the mask hence bringing execution back to
pixels which should have their execution mask set to zero by the ret).
Thanks to Christoph Bumiller for figuring this out.

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

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5af7b45986)
2013-04-05 19:01:09 -07:00
Andreas Boll
4999f0a84e radeon/llvm: Link against libgallium.la to fix an undefined symbol
Ported from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/119-libllvmradeon-link.patch;h=ee47f8a07dbf33c32f8b57faed923680ed6648fb;hb=refs/heads/ubuntu%2B1

Fixes a regression introduced with
f70c385351

NOTE: This is a candidate for the 9.1 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62434
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit 36320bfa54)
2013-04-05 19:01:08 -07:00
Maarten Lankhorst
70f7138754 gallium/build: Fix visibility CFLAGS in automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Fix formatting - use one CFLAG per line

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59238
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit f70c385351)
2013-04-05 19:01:08 -07:00
Paul Berry
0756ab9c85 i965: Apply depthstencil alignment workaround when doing fast clears.
Fast depth clears have the same depth/stencil alignment requirements
as other drawing operations.  Therefore, we need to call
brw_workaround_depthstencil_alignment() from both the clear and
drawing paths.

Without this fix, we get image corruption if the following conditions
hold: (a) the first ever drawing operation to a depth miplevel (or the
first drawing operation after having used the texture for sampling) is
a clear, (b) the depth miplevel has a size that is eligible for fast
depth clears, and (c) the depth miplevel has an offset within the
miptree that isn't 8x8 aligned.

Fixes piglit "depthstencil-render-miplevels" tests with size 273.

NOTE: This is a candidate for stable branches

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c5d5827951)
2013-04-05 19:01:08 -07:00
Kenneth Graunke
6e6dcd451e i965: Make INTEL_DEBUG=shader_time use the RAW surface format.
Untyped Atomic Operation messages are illegal for non-RAW formats.  The
IVB hardware proceeds happily (after all, who cares what the format of the
surface is if you're doing untyped ops on it?), but later hardware
apparently doesn't.  The simulator for gen7 does complain, though.

v2: Rebase against updates to previous patches. (by anholt)

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 91df4d746b)
2013-04-05 19:01:08 -07:00
Kenneth Graunke
0d9f849ddf i965: Specialize SURFACE_STATE creation for shader time.
This is basically a copy and paste of gen7_create_constant_surface, but
with the parameters filled in to offer a simpler interface.

It will diverge shortly.

I didn't bother adding it to the vtable for now since shader time is only
exposed on Gen7+.

v2: Replace tabs in the new code (by anholt)
    Add back dropped memset() and add a comment about HSW channel selects.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 125b34cffb)
2013-04-05 19:01:08 -07:00
Kenneth Graunke
f32e776efb i965: Fix INTEL_DEBUG=shader_time for Haswell.
Haswell's "Data Cache" data port is a single unit, but split into two
SFIDs to allow for more message types without adding more bits in the
message descriptor.

Untyped Atomic Operations are now message 0010 in the second data cache
data port, rather than 6 in the first.

v2: Use the #defines from the previous commit. (by anholt)

NOTE: This is a candidate for the 9.1 branch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
(cherry picked from commit f27a220cad)
2013-04-05 19:01:08 -07:00
Eric Anholt
74e8838179 i965: Add definitions for gen7+ data cache messages.
We were sparsely using some of these message types, but I'll just fill
them all in now.  It will be used for fixing shader_time on HSW.

v2: Add missing MEDIA_BLOCK_READ.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a2d08f170a)
2013-04-05 19:01:08 -07:00
Anuj Phogat
02a8f04de1 mesa: Fix FB blitting in case of zero size src or dst rect
Framebuffer blitting operation should be skipped if any of the
dimensions (width/height) of src/dst rect is zero.

V2: Move the dimension check after error checking in _mesa_BlitFramebuffer.

Fixes: fbblit(negative.nullblit.zeroSize) in Intel oglconform
https://bugs.freedesktop.org/show_bug.cgi?id=59495

Note: Candidate for all the stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit d78dcdf103)
2013-04-05 19:01:08 -07:00
José Fonseca
038a29b5c5 include: Fix build with VS 11 (i.e, 2012).
NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 57cd1d1454)
2013-04-05 19:01:08 -07:00
Ian Romanick
4626e6e270 mesa: Add previously picked commit to .cherry-ignore
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-05 19:01:07 -07:00
José Fonseca
fe72a61382 mesa,gallium,egl,mapi: One definition of C99 inline/__func__ to rule them all.
This is a squash-commit of the two commits listed below.  The first
introduced a 'make check' failure, and the second fixed it.

    mesa,gallium,egl,mapi: One definition of C99 inline/__func__ to rule them all.

    We were in four already...

    NOTE: Candidate for the stable branches.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 70fe7c6d3e)

And:

    tests: Add $(top_srcdir)/include to AM_CPPFLAGS.

    Fixes this build error with make check.

      CC     collision.o
    In file included from ../../../../../src/mesa/main/hash_table.h:34:0,
                     from collision.c:31:
    ../../../../../src/mesa/main/compiler.h:51:53: fatal error: c99_compat.h: No such file or directory

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    (cherry picked from commit a6bb7a9495)
2013-04-05 19:01:07 -07:00
José Fonseca
e2695d53c7 autotools: Add missing top-level include dir.
Fixes autotools build failure.  Not sure if there are more, as I have
difficulties in building the full tree.
(cherry picked from commit 7bff1cc3f6)
2013-04-05 19:01:07 -07:00
Christoph Bumiller
923bb2d8ed nvc0: fix for 2d engine R source formats writing RRR1 and not R001 2013-04-04 13:03:52 +02:00
Christoph Bumiller
ac4be46279 nv50,nvc0: fix 3d blits, restore viewport after blit
Conflicts:
	src/gallium/drivers/nvc0/nvc0_surface.c
2013-04-04 13:03:42 +02:00
Christoph Bumiller
5ba62ee201 nv50,nvc0: disable DEPTH_RANGE_NEAR/FAR clipping during blit
We send position.z == 0, DEPTH_RANGE may be some arbitrary range
not including 0 (for exmaple in piglit's hiz tests).
2013-04-04 12:54:41 +02:00
Christoph Bumiller
7410ba1265 nv50: fix 3D render target setup 2013-04-04 12:54:31 +02:00
Marek Olšák
980f84c392 gallium/tgsi: fix valgrind warning
"Conditional jump or move depends on uninitialised value(s)"

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9cec5edea7)
2013-03-26 03:23:59 +01:00
Eric Anholt
ff27e18834 i965/fs: Also do the gen4 SEND dependency workaround against other SENDs.
We were handling the the dependency workaround for the first written reg
of a send preceding the one we're fixing up, but didn't consider the other
regs.  Thus if you had two sampler calls that got allocated to the same
set of regs, one might, rarely, ovewrite the other.  This was occurring in
XBMC's GLSL shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44567
NOTE: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 4dc7e6dcbf)
2013-03-25 14:19:23 -07:00
Eric Anholt
c5bc65bd62 i965/fs: Fix broken rendering in large shaders with UBO loads.
The lowering process creates a new vgrf on gen7 that should be represented
in live interval analysis.  As-is, it was getting a conflicting allocation
with gl_FragDepth in the dolphin emulator, producing broken rendering.

NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1323772543)
2013-03-25 14:19:19 -07:00
Eric Anholt
6dcccf7131 i965/fs: Fix register allocation for uniform pull constants in 16-wide.
We were allowing a compressed instruction to write a register that
contained the last use of a uniform pull constant (either UBO load or push
constant spillover), so it would get half its values smashed.

Since we need to see the actual instruction to decide this, move the
pre-gen6 pixel_x/y logic here, which should improve the performance of
register allocation since virtual_grf_interferes() is called more than
once per instruction.

NOTE: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f10f5e4980)
2013-03-25 14:18:29 -07:00
Marek Olšák
b3c8a250e6 mesa: don't allocate a texture if width or height is 0 in CopyTexImage
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4b69c1a92d)
2013-03-25 14:17:28 -07:00
Jan de Groot
5aacecb08c dri/nouveau: fix crash in nouveau_flush
https://bugs.freedesktop.org/show_bug.cgi?id=61947

Note: this is a candidate for the stable branches
(cherry picked from commit 17f1cb1d99)
2013-03-25 14:17:23 -07:00
Alan Hourihane
d095747749 mesa: fix glGetInteger*(GL_SAMPLER_BINDING).
If the sampler object has been deleted on another context, an
alternative context may reference the old sampler. So ensure the sampler
object still exists.

Note: this is a candidate for the stable branch.

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5984a911f9)
2013-03-25 14:15:59 -07:00
Alan Hourihane
cbbea7cc58 Unreference sampler object when it's currently bound to texture unit.
This change specifically unbinds a sampler object from the texture unit
if it's bound to a unit. The spec calls for default object when deleting
sampler objects which are currently bound.

Note: this is a candidate for the stable branches

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cf0b4a30fc)
2013-03-25 14:15:54 -07:00
Brian Paul
68e25de7d4 llvmpipe: add some scene limit sanity check assertions
Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a51b81558f)
2013-03-25 14:15:48 -07:00
Brian Paul
7ddda67835 llvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE
We advertise a max texture/surfaces size of 8K x 8K but the old values
for these limits didn't actually allow us to handle that surface size.

For 8K x 8K we'll have 16384 bins.  Each bin needs at least one cmd_block
object which was 2192 bytes in size.  Since 16384 * 2192 exceeded
LP_SCENE_MAX_SIZE we'd silently fail in lp_scene_new_data_block() and not
draw the complete scene.

By reducing CMD_BLOCK_MAX to 29 we get nice 512-byte cmd_blocks.  And
by increasing LP_SCENE_MAX_SIZE to 9 MB we can allocate enough command
blocks for 8K x 8K, plus a few regular data blocks.

Fixes the (improved) piglit fbo-maxsize test.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a31ebdffa0)
2013-03-25 14:15:45 -07:00
Marcin Slusarz
efd094d052 dri/nouveau: NV17_3D class is not available for NV1a chipset
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=60510

Note: this is a candidate for the stable branches

Acked-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit f4ebcd133b)
2013-03-25 14:15:38 -07:00
Matt Turner
7f0014f64a configure.ac: Remove stale comment about --x-* arguments.
Should have been removed with e273ed37.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 523b07e320)
2013-03-25 14:15:33 -07:00
Matt Turner
8d43e33ab2 configure.ac: Don't check for X11 unconditionally.
X11 is already checked conditionally below.

Fixes OSMesa-only configurations to not require X11.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 35189d768b)
2013-03-25 14:15:29 -07:00
Alan Hourihane
7f44f9ddc3 Add missing GL_TEXTURE_CUBE_MAP entry in _mesa_legal_texture_dimensions
This was hit on the glTexStorage2D() path.

Note: this is a candidate for the stable branches

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 196443f3f5)
2013-03-25 14:15:21 -07:00
Tapani Pälli
a31c9c3fa9 intel: Fix regression in intel_create_image_from_name stride handling
Strangely, the DRIimage interface we have passes the pitch in pixels
instead of bytes, which anholt missed in the change to using bytes for
region pitch.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61197
(cherry picked from commit e062a4187d)
2013-03-25 14:07:41 -07:00
Brian Paul
e6616948b7 vbo: fix crash found with shared display lists
This fixes a crash when a display list is created in one context
but executed from a second one.  The vbo_save_context::vertex_store
memeber will be NULL if we never created a display list with the
context.  Just check for that before dereferencing the pointer.

Fixes http://bugzilla.redhat.com/show_bug.cgi?id=918661

Note: This is a candidate for the stable branches.
(cherry picked from commit c2665aacdd)
2013-03-20 08:24:55 -06:00
Brian Paul
55cb78f082 mesa: flush current state when querying GL_EDGE_FLAG
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61395

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit b1390c7992)
2013-03-20 08:24:55 -06:00
Ian Romanick
3fe900840e docs: Add 9.1.1 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-03-19 17:26:24 -07:00
Ian Romanick
1e5e805fd0 mesa: Bump version to 9.1.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-03-19 17:14:38 -07:00
Ian Romanick
9e36e41034 docs: 9.1.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-03-19 17:11:41 -07:00
Alex Deucher
d0ccb5b911 r600g: Use blitter rather than DMA for 128bpp on cayman (v3)
On cayman, 128bpp surfaces require non_disp ordering for hw
access to both linear and tiled surfaces.  When we use the 3D
engine we can set the non_disp ordering on both the tiled and
linear sides (via CB or texture), but when we use the DMA
engine, we can only set the non_disp ordering on the tiled
side, so after a L2T operation with the DMA engine, the data
ends up in the wrong order on the tiled side.

v2: cayman/TN only

v3: fix comments

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

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4409758a04)
2013-03-18 09:39:28 -04:00
Alex Deucher
61e7c043ea r600g: add Richland APU pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 03eef7f8ef)
2013-03-18 09:38:59 -04:00
José Fonseca
231247df02 scons: Warn when using MSVS versions prior to 2012.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-15 19:55:26 +00:00
José Fonseca
5d66947d66 scons: Define _ALLOW_KEYWORD_MACROS on MSVC builds.
scons/llvm.py defines inline globally to workaround issues with LLVM C
binding headers, so the only way to is to avoid
aggravating xkeycheck.h errors is to set _ALLOW_KEYWORD_MACROS.

This fixes MSVC 2012 build with LLVM.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-15 19:55:26 +00:00
José Fonseca
0acc79322b scons: Allows choosing VS 10 or 11.
NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-15 19:55:26 +00:00
Michel Dänzer
5ccaa67204 radeonsi: Fix off-by-one for maximum vertex element index in some cases
In cases where the vertex element size is smaller than the vertex buffer
stride, the previous calculation could end up 1 too low. This would result
in the GPU using index 0 instead of the maximum index for those elements,
which would be visible as intermittent distorted triangles.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4dca602521)
2013-03-15 19:00:41 +01:00
Frank Henigman
ed29a987fd i965: Link i965_dri.so with C++ linker.
Force C++ linking of i965_dri.so by adding a dummy C++ source file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-03-08 21:25:25 -08:00
Matt Turner
e3f1b34fbe mesa: Allow ETC2/EAC formats with ARB_ES3_compatibility.
Fixes piglit's oes_compressed_etc2_texture-miptree tests on Desktop GL.
Reported-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-03-08 21:25:14 -08:00
Marek Olšák
09199c6862 r600g: pad the DMA CS to a multiple of 8 dwords
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit c77917d35f)
2013-03-05 18:43:11 -05:00
Vincent Lejeune
1dc162d52f r600g: Check comp_mask before merging export instructions
Fixes a llvm uncovered (rare) bug where consecutive exports were
merged even if they have incompatible mask.
(cherry picked from commit 83e7d111af)
2013-03-05 18:32:53 -05:00
Vadim Girlin
9a5f513773 r600g: fix check_and_set_bank_swizzle for cayman
Tested-by: Vincent Lejeune <vljn at ovi.com>
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
(cherry picked from commit 138b5b9a12)
2013-03-05 18:32:28 -05:00
Kenneth Graunke
26e827b309 i965: Fix Crystal Well PCI IDs.
The second digit was off by one, which meant we accidentally treated
GTn as GT(n-1).  This also meant no support for GT1 at all.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b88f74d63d)
2013-03-05 14:58:04 -08:00
Brian Paul
44a5b5d161 svga: always link with C++
Even when we don't have LLVM since there's other C++ code
in the resulting DRI driver object.

Note: This is a candidate for the stable branches.

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit a99eb5c83f)
2013-03-05 14:58:04 -08:00
Marek Olšák
f6765c6d20 r600g: always map uninitialized buffer range as unsynchronized
Any driver can implement this simple and efficient optimization.
Team Fortress 2 hits it always. The DISCARD_RANGE codepath is not even used
with TF2 anymore, so we avoid a ton of useless buffer copies.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 89e2898e9e)
2013-03-05 14:58:04 -08:00
Marek Olšák
2c3efd2ee4 gallium/util: add helper code for 1D integer range
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: cosmetic changes based on Brian's review

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>

NOTE: This is a candidate for the 9.1 branch. (the next patch depends on it)
(cherry picked from commit 44f37261fc)
2013-03-05 14:58:04 -08:00
Marek Olšák
f5b22eb09f r600g: flush and invalidate htile cache when appropriate
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit e5a250fdf9)
2013-03-05 14:58:04 -08:00
Marek Olšák
391e7ed51e r600g: use async DMA with a non-zero src offset
probably a typo

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 9dd18f43a4)
2013-03-05 14:58:04 -08:00
Jordan Justen
db5492cae3 attrib: push/pop FRAGMENT_PROGRAM_ARB state
This requirement was added by ARB_fragment_program

When the Steam overlay is enabled, this fixes:
* Menu corruption with the Puddle game
* The screen going black on Rochard when
  the Steam overlay is accessed

NOTE: This is a candidate for the 9.0 and 9.1 branches.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6f1538f8b4)
2013-03-05 14:57:10 -08:00
Keith Kriewall
65baaa070c scons: Fix Windows build with LLVM 3.2
Fixes fdo bug 61299

NOTE: This is a candidate for the stable branches.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit efd8311a54)
2013-03-05 14:57:10 -08:00
Adam Sampson
9d0df82076 autotools: oprofilejit should be included in the list of LLVM components required
NOTE: This is a candidate for the stable branch.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 2506b03503)
2013-03-05 14:57:09 -08:00
Ian Romanick
049f343e8a egl: Allow 24-bit visuals for 32-bit RGBA8888 configs
Previously only the 32-bit X visual would match the 32-bit RGBA8888
configs.  This resulted in every config with alpha getting the "magic"
visual whose alpha is used by the compositor.  This also resulted in no
multisample visuals being advertised.  How many ways could we lose?

This patch inverts the problem... now you can't get the visual with
alpha used by the compositor even if you want it.  I think we need to
invent a new value for EGL_TRANSPARENT_TYPE that apps can use to get
this.  I'm surprised that there isn't already a choice for
EGL_TRANSPARENT_ALPHA.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tian Ye <yex.tian@intel.com>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59783
(cherry picked from commit 68a147e9a9)
2013-03-05 14:57:09 -08:00
Eric Anholt
0b494917b1 i965: Fix the W value of deprecated pointcoords on pre-gen6.
When you didn't have a texcoord array bound (or a non-1 current w
attrib), we were telling the fragment shader that it could just use "1"
instead of doing expensive pre-gen6 math to invert it.  If you drew the
point with a non-1 W value, then you'd get the right size (since all the
vertex computations worked), but we'd mis-interpolate the coordinate
across the face.

Fixes the mesa pointsprite demo on GM45.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30232
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Note: This is a candidate for the stable branches.
(cherry picked from commit 50a5d5dea0)
2013-03-05 14:57:09 -08:00
Tapani Pälli
fa23151f43 mesa/es: NULL check in EGLImageTargetTexture2DOES
check that pointer passed is valid and return error if not.

Note: This is a candidate for the stable branches.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 3cdb548bfb)
2013-03-05 14:57:09 -08:00
Tapani Pälli
b1b2443ade mesa: add missing case in _mesa_GetTexParameterfv()
missing case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is required
by OES_EGL_image_external extension.

Note: This is a candidate for the stable branches.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 331967c773)
2013-03-05 14:57:09 -08:00
John Kåre Alsaker
2b8a431d39 llvmpipe: Fix creation of shared and scanout textures.
NOTE: This is a candidate for the stable branches.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 65aa1a194d)
2013-03-05 14:57:09 -08:00
Brian Paul
ab883bb8a4 llvmpipe: add missing checks for polygon offset point/line modes
The llvm pipeline handles regular filled triangle offsets, but it
doesn't handle offsets for triangles drawn in point or line mode.

Fixes failures found with new piglit polygon-mode-offset test.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit f93c580063)
2013-03-05 14:57:09 -08:00
Brian Paul
2ac679bc87 draw: fix broken polygon offset stage
There were several issues.  We weren't handling different front/back
polygon fill modes.  We weren't checking whether the offset applied to
fill mode vs. line mode vs. point mode.

Fixes problems found with the Visualization Toolkit (VTK) test suite.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit d6b8b116ee)
2013-03-05 14:57:09 -08:00
Brian Paul
f64664de7f st/mesa: fix polygon offset state translation logic
The old logic was kind of twisted, but seemed to work in practice.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a2c105e31e)
2013-03-05 14:57:09 -08:00
Brian Paul
1505ce833a st/mesa: check for dummy programs in destroy_program_variants()
When we destroy an ARB vp/fp whose ID was gen'd but not otherwise used we
get a pointer to the dummy/placeholder program.  We can't destroy that one
so just skip it.  This only failed during context tear-down because
glDeleteProgramsARB() was already aware of dummy programs.

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

Note: This is a candidate for the stable branches.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 8bb291b0f5)
2013-03-05 14:57:09 -08:00
Brian Paul
6bc298a5b0 st/mesa: fix trimming of GL_QUAD_STRIP
We sometimes convert GL_QUAD_STRIP prims into GL_TRIANGLE_STRIP, but
that changes the results of the u_trim_pipe_prim() call.  We need to
pass the original primitive type to the trim function.

Note that OpenGL's GL_x prim type values match Gallium's PIPE_PRIM_x values.

Fixes a failure in the new piglit degenerate-prims test.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8589cc41b3)
2013-03-05 14:57:09 -08:00
Anuj Phogat
b382f1dbeb meta: Allocate texture before initializing texture coordinates
tex->Sright and tex->Ttop are initialized during texture allocation.
This fixes depth buffer blitting failures in khronos conformance tests
when run on desktop GL 3.0.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59495

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit cff862f90d)
2013-03-05 14:57:09 -08:00
Eric Anholt
2893cd2843 mesa: Fix setup of ctx->Point.PointSprite for GLES2.
The recent change for GL core broke the older setup, which broke
gl_PointCoord on pre-gen6 (where gl_PointCoord is undefined if point
sprites are disabled).  Fixes the new piglit GLES-2.0/glsl-fs-pointcoord
test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32429
Note: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 92a204b493)
2013-03-05 14:57:09 -08:00
Eric Anholt
a11201fd2f i965/fs: Fix broken math on values loaded from uniform buffers on gen6.
In a debug build this led to assertion failures, but on a non-debug
build the hardware would just reference the whole vec8 instead of the
same channel 8 times.

Fixes the new piglit glsl-1.40/uniform-buffer/fs-exp2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57121
Note: This is a candidate for the stable branches
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 7b0731d940)
2013-03-05 14:57:09 -08:00
Michel Dänzer
ba4f4cead4 r600g/Cayman: Fix blending using destination alpha factor but non-alpha dest
Only compile tested, but should fix at least some piglit fbo-blending tests.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 73bf626713)
2013-03-05 14:57:09 -08:00
Eric Anholt
6d60f8cfc4 i965/fs: Only do CSE when the dst types match.
We could potentially do some CSE even when the dst types aren't the same
on gen6 where there is no implicit dst type conversion iirc, or in the
case of uniform pull constant loads where the dst type doesn't impact
what's stored.  But it's not worth worrying about.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit c2a6e529c3)
2013-03-05 14:57:09 -08:00
Eric Anholt
808e01236b i965/fs: Delay setup of uniform loads until after pre-regalloc scheduling.
This should fix the register allocation explosion on the GLES 3.0 test
on gen6.  It also gives us an instruction that will fit our CSE handling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit aebd3f46e3)
2013-03-05 14:57:09 -08:00
Eric Anholt
c5f63bedac i965/fs: Fix copy propagation with smearing.
We were correctly relaying the smear from MOV's src, but if the MOV
didn't do a smear, we don't want to smash the smear value from the
instruction being propagated into.  Prevents a regression in the
upcoming UBO change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 49bdebad38)
2013-03-05 14:57:08 -08:00
Brian Paul
952ca6a795 st/xlib: initialize the drawable size in create_xmesa_buffer()
Otherwise, the PBuffer's size was never set.  This also initializes
the buffer size for windows, pixmaps, etc.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61012

Note: This is a candidate for the stable branches.
(cherry picked from commit e2091f64cb)
2013-03-05 14:57:08 -08:00
Brian Paul
5c76f85a92 st/mesa: implement glBitmap unpacking from a PBO, for the cache path
We weren't mapping the PBO when using the bitmap cache (but we had
the PBO code for the non-cache path.)

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026

Note: This is a candidate for the stable branches.
(cherry picked from commit 63c30d7e4f)
2013-03-05 14:57:08 -08:00
Brian Paul
475548f6c9 draw: fix non-perspective interpolation in interp()
This fixes a regression from ab74fee5e1.
When we use the clip coordinate to compute the screen-space interpolation
factor, we need to first apply the divide-by-W step to the clip
coordinate.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60938

Note: This is a candidate for the 9.1 branch.
(cherry picked from commit 5da967aff5)
2013-03-05 14:57:08 -08:00
Vincent Lejeune
9071c094e8 r600g/llvm: Add support for UBO
NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
(cherry picked from commit ef8fde6acb)
2013-03-05 14:57:08 -08:00
Eric Anholt
597d98bb2c i965/fs: Do a general SEND dependency workaround for the original 965.
We'd been ad-hoc inserting instructions in some SEND messages with no
knowledge of when it was required (so extra instructions), but not all SENDs
(so not often enough).  This should do much better than that, though it's
still flow-control-ignorant.

v2: Use BRW_MAX_MRF instead of magic numbers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58960
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: Candidate for the stable branches.
(cherry picked from commit c37992c54d)
2013-03-05 14:57:08 -08:00
Ian Romanick
783f76e3d5 mesa: Modify candidate search string
Several commits on master for the 9.1 branch had "NOTE" messages in a
slightly different format.

NOTE: This is a candidate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 674f9239b9)
2013-03-05 14:55:02 -08:00
Ian Romanick
465ce417cf mesa: Add previously picked commit to .cherry-ignore
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-03-05 14:54:47 -08:00
Michel Dänzer
a5c79b7426 radeonsi: Fix up and enable flat shading.
Requires corresponding LLVM R600 backend fix to work correctly, but even
without that it doesn't hang anymore.

13 more little piglits.

Depends on LLVM: r175193, r175733

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 18272c9b1b)
2013-03-04 18:50:31 +01:00
Jakub Bogusz
4aa2b5120a vdpau-softpipe: Build correct source file - vl_winsys_xsp.c
Copy-and-paste problem introduced by commit 7f24483e.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-03-03 22:57:04 -08:00
Martin Andersson
cd77c77bb9 winsys/radeon: Only add bo to hash table when creating flink
The problem is that we mix bo handles and flinked names in the hash
table. Because kms type handles are not flinked they should not be
added to the hash table. If we do that we will sooner or later
get a situation where we will overwrite a correct entry because
the bo handle was the same as a flinked name.

Note: this is a candidate for the stable branches.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d96d8ed910)
2013-03-01 17:53:59 -05:00
Jerome Glisse
b199a6414d r600g: workaround hyperz lockup on evergreen
This work around disable hyperz if write to zbuffer is disabled. Somehow
using hyperz when not writting to the zbuffer trigger GPU lockup. See :

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

Candidate for 9.1

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 6bc7605745)
2013-02-28 09:49:12 -05:00
Daniel van Vugt
012329e83b gbm: Remember to init format on gbm_dri_bo_create.
https://bugs.freedesktop.org/show_bug.cgi?id=60143
(cherry picked from commit 6e226ab5ac)
2013-02-27 10:35:21 +01:00
Brian Paul
7a1612a54b docs: insert links to the 9.0.3 release 2013-02-25 08:10:35 -07:00
Andreas Boll
7024ee6b20 docs: add news item for 9.1 release 2013-02-25 10:42:21 +01:00
Andreas Boll
e0e59ceb3c docs: Add 9.1 release md5sums 2013-02-25 10:39:11 +01:00
Brian Paul
5b19631f7c docs: remove stray 'date' text 2013-02-23 06:33:16 -07:00
Ian Romanick
17493b8848 docs: Update relelase notes 2013-02-22 17:46:24 -08:00
Ian Romanick
3ea699ff3c mesa: Bump version to 9.1 (final)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-22 17:46:23 -08:00
Ian Romanick
ea38e7e2e3 i965: Enable OpenGL ES 3.0 on Sandy Bridge
Regardless of what we put in the screen structure, all of the extensions
that compute_version_es2 checks are present and 3.0 will be exposed
anyway.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7ae6864f0d)
2013-02-22 17:46:23 -08:00
Alex Deucher
4212dbae1c r600g: fixup PS_PARTIAL_FLUSH flag handling for cayman
So we don't emit it twice if we ever use the flag on
cayman.

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8b5acad0e9)
2013-02-22 18:45:40 -05:00
Alex Deucher
a650092fd6 r600g: r6xx deadlock workaround (v6)
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50655
https://bugs.freedesktop.org/show_bug.cgi?id=47116

v2: flush along with workaround.
v3: just need a flush
v4: try WAIT_UNTIL
v5: switch to PS partial flush
v6: rework patch

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8442b67f5f)
2013-02-22 18:27:37 -05:00
Alex Deucher
11d9f75f01 r600g: add PS_PARTIAL_FLUSH flag
PS_PARTIAL flushes seems to be required in certain
cases to prevent hangs, especially on r6xx.

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7ebf83f109)
2013-02-22 18:27:24 -05:00
Lauri Kasanen
6427e1609e configure: Fix build with automake < 1.11
Commit 86d30dea3c broke building with older
automake versions with this error:

Makefile:769: *** Recursive variable am__v_YACC_ references itself (eventually).  Stop.

This patch fixes it. Fix stolen from xorg-macros.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
(cherry picked from commit 0a82828ad5)
2013-02-22 13:15:40 -08:00
Michel Dänzer
47f7f803ae radeonsi: Fix PIPE_FORMAT_X32_S8X24_UINT sampler hardware format
4 more little piglits.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 9c1107b3e1)
2013-02-22 20:24:33 +01:00
Michel Dänzer
cb8bacd87a radeonsi: Use stencil surface level information for stencil texturing
7 more little dwarves^W piglits.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 8356962853)
2013-02-22 20:24:24 +01:00
Michel Dänzer
0d08abd461 radeonsi: properly implement S8Z24 depth-stencil format
Based on r600g commit 2b9659c9e6 .

Fixes crashes with 4 piglit tests which are now hitting these formats.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit f9adf79876)
2013-02-22 20:24:17 +01:00
Michel Dänzer
5baa8ec737 radeonsi: Fix w component of TGSI_SEMANTIC_POSITION fragment shader inputs.
It's the reciprocal of the register value.

Fixes piglit fragcoord_w and glsl-fs-fragcoord-zw-perspective.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 954bc4ac34)
2013-02-22 20:15:17 +01:00
Michel Dänzer
0c3b96a6c6 radeonsi: Fix blending using destination alpha factor but non-alpha destination
11 more little piglits.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 95bced5929)
2013-02-22 20:13:45 +01:00
Marek Olšák
24e8ad6204 radeonsi: implement 3D transfers
That means we can map and read multiple slices with one transfer_map call.

[ Cherry-picked from r600g commit 1aebb6911e ]

11 more little piglits on master, 1 more on the 9.1 branch (Marek's
glTex(Sub)Image improvements on master broke the other 10).

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 72f4490b55)
2013-02-22 20:13:27 +01:00
Marek Olšák
8013101c2d radeonsi: add assertions to prevent creation of invalid surfaces
[ Cherry-picked from r600g commit ef11ed61a0 ]

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a84c4edeed)
2013-02-22 20:13:18 +01:00
Marek Olšák
6894c127d9 radeonsi: use u_box_origin_2d helper function
[ Cherry-picked from r600g commit b278aba423 ]

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c4faab63c4)
2013-02-22 20:13:04 +01:00
Marek Olšák
f0f3ebb777 st/mesa: don't do sRGB conversion in CopyTexSubImage
Assuming I understand EXT_texture_sRGB correctly.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6520a86c67)
2013-02-22 13:20:10 +01:00
Marek Olšák
deeb4b056f r600g: fix random corruption with CP DMA in TF2
NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit aac8138744)
2013-02-22 12:50:27 +01:00
Andreas Boll
8818d01d33 llvmpipe/build: add DLOPEN_LIBS and PTHREAD_LIBS to the lp_test_* targets
Fixes undefined symbols.

NOTE: This is a candidate for the 9.1 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61052
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit c1f2c3a80f)
2013-02-22 10:24:53 +01:00
Andreas Boll
ea51f870f6 targets/xa-vmwgfx: Force c++ linker to fix undefined symbols
NOTE: This is a candidate for the 9.1 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61200
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c1eb585f3d)
2013-02-22 10:24:47 +01:00
Tom Stellard
dfc35a4fc5 r300g/compiler: Fix bug in OMOD folding
The OMOD value was only being folded to one instruction in cases where
the MUL instruction was reading a value written by more than one
instruction.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 10bcc843f8)
2013-02-21 22:09:51 -05:00
Tom Stellard
c7fdb6a861 r300g/tests: Add helper functions for creating a full program
Now you can convert assembly strings into a full struct radeon_compiler
object and use it to test individual compiler pases.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 5e1321ddf4)
2013-02-21 22:09:42 -05:00
Tom Stellard
74790900ca r300g/tests: Exit test runner with a valid status code
This way make check can report whether or not the tests pass.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit bcf2e157ca)
2013-02-21 22:09:33 -05:00
Tom Stellard
42cfb1ef47 r300g/complier: Make r300_vertprog_swizzle_caps visible in other files
This will be used by the test suite in later commits.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 5355fc1e87)
2013-02-21 22:09:22 -05:00
Tom Stellard
754447d81f r300g/compiler: Add missing license headers
These are all files that I authored, but forgot to add the license
headers.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 27d140b960)
2013-02-21 22:09:11 -05:00
Alex Deucher
e41bdc223e r600g: don't enable ReZ mode on evergreen
Can cause lockups in certain cases when
zfunc/zenable/zwrite change without a flush
in between.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=60969
and lockups on Civ4 with wine.

This is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 2e4ef989a2)
2013-02-21 12:02:15 -05:00
Ian Romanick
6ff7080a4c mesa: Don't install glEvalMesh in the beginend dispatch table
NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59740
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8b586322e7)
2013-02-20 15:25:55 -08:00
Zack Rusin
bdffccf91e DRI2: Don't disable GLX_INTEL_swap_event unconditionally
GLX_INTEL_swap_event is broken on the server side, where it's
currently unconditionally enabled. This completely breaks
systems running on drivers which don't support that extension.
There's no way to test for its presence on this side, so instead
of disabling it uncondtionally, just disable it for drivers
which are known to not support it. It makes sense because
most drivers do support it right now.
We'll be able to remove this once Xserver properly advertises
GLX_INTEL_swap_event.

Note: This is a candidate for stable branch branches.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60052
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 076403c30d)
2013-02-19 12:50:55 -08:00
Stefan Brüns
c41ba5bda9 glx: fix glGetTexLevelParameteriv for indirect rendering
A single element in a GLX reply is contained in the header itself.
The number of elements is denoted in the "n" field of the reply.
If "n" is 1, the length of additional data is 0.
The XXX_data_length() function of xcb does not return the length of
the (optional, n>1) data but the number of elements.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=59876

Note: This is a candidate for the stable branches.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 5876a5dbc0)
2013-02-19 12:17:26 -08:00
Ian Romanick
456cdb6d01 mesa: Bump version to 9.1-rc2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-17 14:49:02 -08:00
Eric Anholt
aaee862305 i965/fs: Use a helper function for checking for flow control instructions.
In 2 of our checks, we were missing BREAK and CONTINUE.

NOTE: Candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bf91f0b039)
2013-02-17 14:20:39 -08:00
bma
b84d9aa0c6 shaderapi: Fix AttachShader error
Detect a duplicate Shader type as and error instead of silently allowing
it, restrict to ES2 API.

v2: Tapani Pälli <tapani.palli@intel.com>
    - make the check run time instead of compile time

v3: chadv
    - Quote spec on which error to generate.

Signed-off-by: bma <Bo.Ma@windriver.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit ce3dfa19ab)
2013-02-17 14:20:34 -08:00
Eric Anholt
bb4b1494e3 i965: Re-enable the -RHW workaround for original gen4 chips.
Fixes broken clipping in supertuxkart and presumably many other applications.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51471
NOTE: Candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit cb4616d32d)
2013-02-17 14:20:27 -08:00
Eric Anholt
321abaaa8d i965/gen4: Work around missing sRGB RGB DXT1 support.
The hardware just doesn't support it.  I suspect this was a regression from
the move to fixed MESA_FORMATs for compressed textures and that previously we
were storing uncompressed for this or something.

Fixes GPU hangs in piglit "texwrap GL_EXT_texture_sRGB-s3tc bordercolor
swizzled" on my GM965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ddc2b453d0)
2013-02-17 14:20:22 -08:00
Ian Romanick
95f1203a7c mesa: Add .cherry-ignore for 9.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-17 14:16:22 -08:00
Christopher James Halse Rogers
96fb4d61fb i965: Fix leak in blorp CopyTexSubImage2D
_mesa_delete_renderbuffer does not call the driver-specific
renderbuffer delete function, so the blorp code was leaking the
Intel-specific bits, including some GEM objects.

Call the renderbuffer's ->Delete() method instead, which does the
right thing.

Fixes Unity rapidly sending the machine into the arms of the OOM-killer

Note: This is a candidate for the 9.1 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit dd599188d2)
2013-02-17 14:13:27 -08:00
Brian Paul
d8a0439c65 st/mesa: fix format query for GL_ARB_texture_rg
The GL_ARB_texture_rg spec says that we need to support both texturing
and rendering for the GL_RED and GL_RG formats.  So move the format
check up into the rendertarget_mapping[] list.  Also, add
PIPE_FORMAT_R8_UNORM to the list of formats required.

Note: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 4be5a06752)
2013-02-17 14:13:13 -08:00
Eric Anholt
c785315f3d i965/gen7: Set up all samplers even if samplers are sparsely used.
In GLSL, sampler indices are allocated contiguously from 0.  But in the
case of ARB_fragment_program (and possibly fixed function), an app that
uses texture 0 and 2 will use sampler indices 0 and 2, so we were only
allocating space for samplers 0 and 1 and setting up sampler 0.  We
would read garbage for sampler 2, resulting in flickering textures and
an angry simulator.

Fixes bad rendering in 0 A.D. and ETQW.  This was fixed for pre-gen7 by
28f4be9eb9

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25201
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58680
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable branches.
(cherry picked from commit 5bb05c6e6d)
2013-02-17 14:12:47 -08:00
Kenneth Graunke
0e3c755ca3 i965: Use derived state for Haswell's 3DSTATE_VF packet.
Otherwise, we fail to correctly handle GL_PRIMITIVE_RESTART_FIXED_INDEX.

Fixes gles3conform's primitive_restart_mode test.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8cabe26f5d)
2013-02-17 14:12:10 -08:00
Brian Paul
4d11454e90 util: fix incorrect Z bit masking in util_clear_depth_stencil()
For PIPE_FORMAT_Z24_UNORM_S8_UINT, the Z bits are in the 24
least significant bits.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60527
and http://bugs.freedesktop.org/show_bug.cgi?id=60524
and http://bugs.freedesktop.org/show_bug.cgi?id=60047

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4bfdef87e6)
2013-02-17 14:10:55 -08:00
Marek Olšák
9838215f3c mesa: fix GetTexImage if mesa format and internal format don't match
Tested with softpipe only exposing RGBA formats.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cb6470775c)
2013-02-17 14:10:40 -08:00
Marek Olšák
2e4473d9e3 mesa: don't use memcpy fast path for GetTexImage if base format is different
The Mesa format can be RGBA8888_REV, the format/type can be
GL_RGBA/GL_UNSIGNED_BYTE, but the actual texture internal format can be
LUMINANCE_ALPHA, INTENSITY, etc. Therefore we should look at the base
internal format as well.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c8379204ab)
2013-02-17 14:10:28 -08:00
Marek Olšák
11eb644cc9 mesa: don't use _mesa_base_tex_format for format parameter of GetTexImage
_mesa_base_tex_format doesn't accept GL_BGR and GL_ABGR_EXT, etc.

v2: add a (now hopefully complete) helper function to deal with this

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 09a99867ab)
2013-02-17 14:09:55 -08:00
Ian Romanick
60bad0ddc3 intel: Do not expose OES_compressed_ETC1_RGB8_texture or ARB_texture_rgb10_a2ui pre-GEN4
Older hardware cannot do ARB_texture_rgb10_a2ui, and the translation
code for OES_compressed_ETC1_RGB8_texture was never implemented in the
i915 driver.

NOTE: This is a candidate for all stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0e2f26d5ea)
2013-02-17 14:09:09 -08:00
Roland Scheidegger
d41e9b4d14 softpipe: fix using optimized filter function
This optimized filter (when using repeat wrap modes,
linear min/mag/mip filters, pot textures) only applies to 2d textures,
but nothing prevented it from being used for other textures (likely
leading to very bogus sample results).

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 66b6d51214)
2013-02-17 14:09:01 -08:00
Kristian Høgsberg
60f05f0eef egl-wayland: Make sure we allocate a back buffer even if nothing was rendered
At eglSwapBuffer time, we blindly assume we have a back buffer, but the
back buffer only gets allocated when somebody tries to render something.

NOTE: This is a candidate for the 9.0 and 9.1 branches.

https://bugs.freedesktop.org/show_bug.cgi?id=60086
(cherry picked from commit 1fe007399c)
2013-02-17 14:08:41 -08:00
Brian Paul
714d8b3f8c svga: fix sRGB rendering
We weren't emitting the SVGA_RS_OUTPUTGAMMA state so sRGB rendering
didn't work properly.

Fixes piglit's framebuffer-srgb test.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit ff60509157)
2013-02-17 14:08:22 -08:00
Brian Paul
ac22dffaf6 st/mesa: don't choose DXT formats if we can't do DXT compression
If we call gl[Copy]TexImage2D() with a generic compression format
(e.g. intFormat=GL_COMPRESSED_RGBA) we can't choose a DXT format if
we don't have the external DXT compression library.

We weren't actually enforcing this before since the
pipe_screen::is_format_supported(DXT) query has no dependency on
the DXT compression library.

Now if we're given a generic compressed format and we can't do DXT
compression we'll fall back to a non-compressed format.

v2: use util_format_is_s3tc() function and add more comments about
the allow_dxt parameter.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4df42890c5)
2013-02-17 14:08:16 -08:00
Brian Paul
4ec3843a54 mesa: don't use format chooser code for glCompressedTexImage
When glCompressedTexImage is called the internalFormat is a specific
format for the incoming image and the the hardware format should be
the same (since we never do format transcoding).  So use the simpler
_mesa_glenum_to_compressed_format() function.  This change is also
needed for the next patch.

Note: This is a candidate for the stable branches.
(cherry picked from commit 478056b81a)
2013-02-17 14:07:37 -08:00
Michel Dänzer
30ae2f97c5 configure.ac: GLX cannot work without OpenGL
GLX uses mapi/glapi/libglapi.la, which is only built for OpenGL.

If the user specified --enable-xlib-glx --disable-opengl, error out, as these
cannot be both observed at the same time. If the user just specified
--disable-opengl but not --disable-glx, print a warning and disable GLX as
well.

NOTE: This is a candidate for the stable branches.

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

Tested-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 3b888f534c)
2013-02-17 14:07:22 -08:00
Stéphane Marchesin
b289e639e4 glx: Check that swap_buffers_reply is non-NULL before using it
Check that the return value from xcb_dri2_swap_buffers_reply is
non-NULL before accessing the struct members.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 67e7263e45)
2013-02-17 14:02:29 -08:00
Brian Paul
c7e5e9ddce st/mesa: only enable GL_EXT_framebuffer_multisample if GL_MAX_SAMPLES >= 2
We never really have multisampling with one sample per pixel.
See also http://bugs.freedesktop.org/show_bug.cgi?id=59873

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

(cherry picked from commit c80bacba2e)
2013-02-17 14:01:37 -08:00
Brian Paul
7b9e99f45b mesa: don't enable GL_EXT_framebuffer_multisample for software drivers
Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8f3c81d018)
2013-02-17 14:00:11 -08:00
Brian Paul
9cea40321c osmesa: use _mesa_generate_mipmap() for mipmap generation, not meta
See previous commit for more info.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 2180f32972)
2013-02-17 13:59:52 -08:00
Brian Paul
29e63455aa xlib: use _mesa_generate_mipmap() for mipmap generation, not meta
The swrast fragment program interpreter has trouble computing the
right texture LOD because it doesn't have easy access to input
derivatives.  This causes the GLSL-based meta generate mipmap code
to fetch texels from the wrong mipmap level.

One possible fix would be to set the GL_TEXTURE_MIN/MAX_LOD parameters
to limit sampling from the right level.  But let's just use the
_mesa_generate_mipmap() fallback since it's a lot faster than using
the fragment shader interpreter.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=54240

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 89551ae04f)
2013-02-17 13:59:43 -08:00
Paul Berry
632a5a3a5b glsl: don't allow non-flat integral types in varying structs/arrays.
In the GLSL 1.30 spec, section 4.3.6 ("Outputs") says:

    "If a vertex output is a signed or unsigned integer or integer
    vector, then it must be qualified with the interpolation qualifier
    flat."

The GLSL ES 3.00 spec further clarifies, in section 4.3.6 ("Output
Variables"):

    "Vertex shader outputs that are, *or contain*, signed or unsigned
    integers or integer vectors must be qualified with the
    interpolation qualifier flat."

(Emphasis mine.)

The language in the GLSL ES 3.00 spec is clearly correct and should be
applied to all shading language versions, since varyings that contain
ints can't be interpolated, regardless of which shading language
version is in use.

(Note that in GLSL 1.50 the restriction is changed to apply to
fragment shader inputs rather than vertex shader outputs, to
accommodate the fact that in the presence of geometry shaders, vertex
shader outputs are not necessarily interpolated.  That will be
addressed by a future patch).

NOTE: This is a candidate for stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 93c913485e)
2013-02-15 13:28:01 -08:00
Paul Berry
2cd4824fbc glsl: Allow default precision qualifiers to be set for sampler types.
From GLSL ES 3.00 section 4.5.4 ("Default Precision Qualifiers"):

    "The precision statement

        precision precision-qualifier type;

    can be used to establish a default precision qualifier. The type
    field can be either int or float or any of the sampler types, and
    the precision-qualifier can be lowp, mediump, or highp."

GLSL ES 1.00 has similar language.  GLSL 1.30 doesn't allow precision
qualifiers on sampler types, but this seems like an oversight (since
the intention of including these in GLSL 1.30 is to allow
compatibility with ES shaders).

Previously, Mesa followed GLSL 1.30 and only allowed default precision
qualifiers to be set for float and int.  This patch makes it follow
GLSL ES rules in all cases.

Fixes Piglit tests default-precision-sampler.{vert,frag}.

Partially addresses https://bugs.freedesktop.org/show_bug.cgi?id=60737.

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d5948f2f5e)
2013-02-15 13:27:48 -08:00
Michel Dänzer
05de84442b radeonsi: Handle TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
8 more little piglits.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit c840270ebe)
2013-02-15 18:47:28 +01:00
Michel Dänzer
14372a70ec radeonsi: Fix array indices for detecting integer vertex formats
(cherry picked from commit f34ad85765)
2013-02-15 18:47:21 +01:00
Christian König
baa9070346 radeonsi: remove constant index limitation v3
With the llvm patches, fixing 14 piglit tests in total.

v2: increase the const limit
v3: document the const limit

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 8c80894fb3)
2013-02-15 18:46:32 +01:00
Christian König
f50e4e21f4 radeonsi: support constants as TEX coordinates
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 8514f5ac01)
2013-02-15 18:45:29 +01:00
Tom Stellard
38e728498b configure.ac: Add components to LLVM_COMPONENTS when using llvm shared libs
This is required when LLVM is built with CMake, which creates one
shared library for each component.
(cherry picked from commit 0898047e7b)
2013-02-13 17:02:12 -05:00
Matt Turner
fb2eb65126 Revert "mesa: Return INVALID_OPERATION when type is known but not allowed"
This reverts commit 2906e2034c.

Fixes a regression in the glean depthStencil test.

Reverting this does not affect any tests in es3conform, so a more recent
patch must have also fixed the failure this one was intended to fix.

Reported-by: lu hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59494
(cherry picked from commit a527b2192e)
2013-02-13 15:31:50 -05:00
Tom Stellard
741a249cbf r600g: Handle SET*_DX10 instructions in r600_bytecode_get_num_operands() 2013-02-13 15:31:34 -05:00
Jerome Glisse
3ae8678f81 r600g: fix lockup when hyperz & alpha test are enabled together. v3
Seems that alpha test being enabled confuse the GPU on the order in
which it should perform the Z testing. So force the order programmed
throught db shader control.

v2: Only force z order when alpha test is enabled
v3: Update db shader when binding new dsa + spelling fix

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 974b482aca)
2013-02-12 17:06:36 -05:00
Jordan Justen
85604f3d48 CopyTexImage: Don't check sRGB vs LINEAR for desktop GL
In OpenGL 4.3, new language was added that would require
this check. But, if this check results in broken applications
then perhaps it will be reversed.

For now, remove this check and re-evaluate when
desktop GL 4.3 is closer.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-02-12 11:25:15 -08:00
Quentin Glidic
9119b4e8ee configure.ac: Fix --with-llvm-shared-libs
The third argument of AC_ARG_WITH is evaluated for any provided value,
not only on --with-, so it must not force-enable the feature
Also, setting $with_llvm_shared_libs in the opencl check was overriding
the user switch

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

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
(cherry picked from commit 1e857130f0)
2013-02-12 15:58:22 +00:00
Tom Stellard
f4f306b8ba r600g/llvm: Select the correct GPU type for RV670
RV670 belongs in the R600 chip class

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

NOTE: This is a candidate for the 9.1 branch
(cherry picked from commit 257006e2a4)
2013-02-12 15:58:04 +00:00
Jerome Glisse
99adec8a88 r600g: make sure async blit is done 8 * pitch at a time v2
The blit must be aligned on 8 horizontal block.

v2: no need to align the reminder

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 323a448825)
2013-02-11 18:44:55 -05:00
Martin Andersson
3b609f12f6 winsys/radeon: fix bo with virtual address referencing mismatch
If the same context try to flink and open the object, use the
same bo struct instead of opening a new gem handle for the object.
This way we avoid avoid having 2 different handle pointing to the
same kernel object which can latter lead to trouble with virtual
address.

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

Signed-off-by: Martin Andersson <g02maran@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit a37835c8ed)
2013-02-11 18:41:28 -05:00
Andreas Boll
ecd310bd67 docs: document removal of makedepend build dependency
Build dependency removed with
424f200881

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 44a5d7371c)
2013-02-11 18:12:30 +01:00
Matt Turner
2a7affc1d5 builtin_compiler/build: Don't use *_FOR_BUILD when not cross compiling
Previously we were relying on CFLAGS_FOR_BUILD to be the same as CFLAGS
when not cross compiling, but this assumption didn't take into
consideration 32-bit builds on 64-bit systems. More generally, not
honoring CFLAGS is bad.

Automake is evidently too stupid to accept

if CROSS_COMPILING
CC = @CC_FOR_BUILD@
...
else
CC = @CC@
endif

without warning that CC has been already defined. The warnings are
harmless, but I'd prefer to avoid future reports about them, so define
proxy variables, which are assigned inside the conditional and then
unconditionally assigned to CC et al.

NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59737
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60038
(cherry picked from commit 2db1f73849)
2013-02-11 12:28:06 +01:00
Quentin Glidic
c684e3b53e gallium/egl: Fix include dirs for VPATH build
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
(cherry picked from commit 11bd1b0f58)
2013-02-11 11:48:54 +01:00
Andreas Boll
b94eeffe60 mesa: Bump version to 9.1-rc1 2013-02-11 09:21:54 +01:00
Jerome Glisse
a0528269a3 winsys/radeon: improve debuging printing
Make sure one can identify virtual address failure from allocation
failure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 9a47684564)
2013-02-08 20:33:22 -05:00
Jerome Glisse
18ef6b1265 xorg: fix exa finish access
The exa core will already set the pointer to NULL prior calling
the callback function. So don't bail out in the callback if it's
already NULL.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 3310acdf47)
2013-02-08 19:01:51 -05:00
Paul Berry
0419b7a3a1 glsl: Support transform feedback of varying structs.
Since transform feedback needs to be able to access individual fields
of varying structs, we can no longer match up the arguments to
glTransformFeedbackVaryings() with variables in the vertex shader.

Instead, we build up a hashtable which records information about each
possible name that is a candidate for transform feedback, and then
match up the arguments to glTransformFeedbackVaryings() with the
contents of that hashtable.

Populating the hashtable uses the program_resource_visitor
infrastructure, so the logic is shared with how we handle uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 99b78337e3)
2013-02-08 11:17:33 -08:00
Paul Berry
5be2e14393 glsl: Use parse_program_resource_name to parse transform feedback varyings.
Previously, transform feedback varyings were parsed in an ad-hoc
fashion that wasn't compatible with structs (or array of structs).
This patch makes it use parse_program_resource_name(), which correctly
handles both.

Note that parse_program_resource_name()'s technique for handling
mal-formed input strings is to simply let them through and rely on the
fact that a future name lookup will fail.  Because of this,
tfeedback_decl::init() no longer needs to return a boolean error
code--it always succeeds, and if the input was mal-formed the error
will be detected later.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 53febac02c)
2013-02-08 11:17:28 -08:00
Paul Berry
11e4347bff glsl: Rename uniform_field_visitor to program_resource_visitor.
There's actually nothing uniform-specific in uniform_field_visitor.
It is potentially useful for all kinds of program resources (in
particular, future patches will use it for transform feedback
varyings).

This patch renames it to program_resource_visitor, and clarifies
several comments, to reflect the fact that it is useful for more than
just uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b4db34cc4c)
2013-02-08 11:17:23 -08:00
Paul Berry
49a5f829f7 mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.
The parsing logic is moved to a new function in the GLSL module,
parse_program_resource_name().  This name was chosen because it should
eventually be useful for handling everything that OpenGL 4.3 calls
"program resources" (e.g. uniforms, vertex inputs, fragment outputs,
and transform feedback varyings).

Future patches will make use of this function for linking transform
feedback varyings.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b92900d26a)
2013-02-08 11:17:17 -08:00
Kenneth Graunke
5265c42e52 i965/blorp: Support blits between ARGB and XRGB formats.
Now that we have support for overriding alpha to 1.0, we can handle
blitting between these formats in either direction.

For now, we only support two XRGB formats: MESA_FORMAT_XRGB8888 and
MESA_FORMAT_RGBX8888_REV.  Most places only appear to worry about the
former, so ignore the latter for now.  We can always add it later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
(cherry picked from commit 7d467f3c15)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
3114f5acd3 i965/blorp: Support overriding destination alpha to 1.0.
Currently, Blorp requires the source and destination formats to be
equal.  However, we'd really like to be able to blit between XRGB and
ARGB formats; our BLT engine paths have supported this for a long time.

For ARGB -> XRGB, nothing needs to occur: the missing alpha is already
interpreted as 1.0.  For XRGB -> ARGB, we need to smash the alpha
channel to 1.0 when writing the destination colors.  This is fairly
straightforward with blending.

For now, this code is never used, as the source and destination formats
still must be equal.  The next patch will relax that restriction.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
(cherry picked from commit c0554141a9)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
332c50b666 i965: Implement CopyTexSubImage2D via BLORP (and use it by default).
The BLT engine has many limitations.  Currently, it can only blit
X-tiled buffers (since we don't have a kernel API to whack the BLT
tiling mode register), which means all depth/stencil operations get
punted to meta code, which can be very CPU-intensive.

Even if we used the BLT engine, it can't blit between buffers with
different tiling modes, such as an X-tiled non-MSAA ARGB8888 texture
and a Y-tiled CMS ARGB8888 renderbuffer.  This is a fundamental
limitation, and the only way around that is to use BLORP.

Previously, BLORP only handled BlitFramebuffer.  This patch adds an
additional frontend for doing CopyTexSubImage.  It also makes it the
default.  This is partly to increase testing and avoid hiding bugs,
and partly because the BLORP path can already handle more cases.  With
trivial extensions, it should be able to handle everything the BLT can.

This helps PlaneShift massively, which tries to CopyTexSubImage2D
between depth buffers whenever a player casts a spell.  Since these
are Y-tiled, we hit meta and software ReadPixels paths, eating 99% CPU
while delivering ~1 FPS.  This is particularly bad in an MMO setting
because people cast spells all the time.

It also helps Xonotic in 4X MSAA mode.  At default power management
settings, I measured a 6.35138% +/- 0.672548% performance boost (n=5).
(This data is from v1 of the patch.)

No Piglit regressions on Ivybridge (v3) or Sandybridge (v2).

v2: Create a fake intel_renderbuffer to wrap the destination texture
    image and then reuse do_blorp_blit rather than reimplementing most
    of it.  Remove unnecessary clipping code and conditional rendering
    check.

v3: Reuse formats_match() to centralize checks; delete temporary
    renderbuffers.  Reorganize the code.

v4: Actually copy stencil when dealing with separate stencil buffers but
    packed depth/stencil formats.  Tested by a new Piglit test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v4]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v3]
Reviewed-and-tested-by: Carl Worth <cworth@cworth.org> [v2]
Tested-by: Martin Steigerwald <martin@lichtvoll.de> [v3]
(cherry picked from commit 0b3bebbaac)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
55e3f79d55 mesa: Put extern "C" guards in renderbuffer.h.
I need to use this from C++ code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 29aef6cce8)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
1d2ef43032 i965: Fix the SF Vertex URB Read Length calculation for Gen7 platforms.
Ivybridge doesn't appear to have the same errata as Sandybridge; no
corruption was observed by setting it to more than the minimal correct
value.  It's possible that we were simply lucky, since the URB entries
are 1024-bit on Ivybridge vs. 512-bit Sandybridge.  Or perhaps the
underlying hardware issue is fixed.

Either way, we may as well program the minimum value since it's now
readily available, likely to be more efficient, and possibly more
correct.

v2: Use GEN7_SBE_* defines rather than GEN6_SF_*.  (A copy and paste
    mistake.)  They're the same, but using the right names is better.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 44aa2e15f6)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
3acd5ed75b i965: Fix the SF Vertex URB Read Length calculation for Sandybridge.
(This commit message was primarily written by Paul Berry, who explained
 what's going on far better than I would have.)

Previous to this patch, we thought that the only restrictions on
3DSTATE_SF's URB read length were (a) it needs to be large enough to
read all the VUE data that the SF needs, and (b) it can't be so large
that it tries to read VUE data that doesn't exist.  Since the VUE map
already tells us how much VUE data exists, we didn't bother worrying
about restriction (a); we just did the easy thing and programmed the
read length to satisfy restriction (b).

However, we didn't notice this erratum in the hardware docs: "[errata]
Corruption/Hang possible if length programmed larger than recommended".
Judging by the context surrounding this erratum, it's pretty clear that
it means "URB read length must be exactly the size necessary to read all
the VUE data that the SF needs, and no larger".  Which means that we
can't program the read length based on restriction (b)--we have to
program it based on restriction (a).

The URB read size needs to precisely match the amount of data that the
SF consumes; it doesn't work to simply base it on the size of the VUE.

Thankfully, the PRM contains the precise formula the hardware expects.

Fixes random UI corruption in Steam's "Big Picture Mode", random terrain
corruption in PlaneShift, and Piglit's fbo-5-varyings test.

NOTE: This is a candidate for all stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56920
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60172
Tested-by: Jordan Justen <jordan.l.justen@intel.com> (v1/Piglit)
Tested-by: Martin Steigerwald <martin@lichtvoll.de> (PlaneShift)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 09fbc29828)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
697f8e56dc i965: Compute the maximum SF source attribute.
The maximum SF source attribute is necessary to compute the Vertex URB
read length properly, which will be done in the next commit.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5e9bc7bd12)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
45ae093e5c i965: Refactor Gen6+ SF attribute override code.
The next patch will benefit from easy access to the source attribute
number and whether or not we're swizzling.  It doesn't want the final
attr_override DWord form, however.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b3efc5bea8)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
535e95299a i965: Add chipset limits for Haswell GT1/GT2.
The maximum number of URB entries come from the 3DSTATE_URB_VS and
3DSTATE_URB_GS state packet documentation; the thread count information
comes from the 3DSTATE_VS and 3DSTATE_PS state packet documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 9add4e8038)
2013-02-07 22:31:28 -08:00
Vinson Lee
a7e2c615f1 i965: Fix assignment instead of comparison in asserts.
Fixes side effect in assertion defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 1559994cba)
2013-02-07 22:31:28 -08:00
Paul Berry
5611a5a387 mesa: Don't check (offset + size <= bufObj->Size) in BindBufferRange.
In the documentation for BindBufferRange, OpenGL specs from 3.0
through 4.1 contain this language:

    "The error INVALID_VALUE is generated if size is less than or
    equal to zero or if offset + size is greater than the value of
    BUFFER_SIZE."

This text was dropped from OpenGL 4.2, and it does not appear in the
GLES 3.0 spec.

Presumably the reason for the change is because come clients change
the size of the buffer after calling BindBufferRange.  We don't want
to generate an error at the time of the BindBufferRange call just
because the old size of the buffer was too small, when the buffer is
about to be resized.

Since this is a deliberate relaxation of error conditions in order to
allow clients to work, it seems sensible to apply it to all versions
of GL, not just GL 4.2 and above.

(Note that there is no danger of this change allowing a client to
access data beyond the end of a buffer.  We already have code to
ensure that that doesn't happen in the case where the client shrinks
the buffer after calling BindBufferRange).

Eliminates a spurious error message in the gles3 conformance test
"transform_feedback_offset_size".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 04f0d6cc22)
2013-02-07 21:20:32 -08:00
Ian Romanick
a48e5526c2 i965: Set UniformBufferOffsetAlignment to sizeof(vec4)
This matches the behavior of the Windows driver, but a bspec reference
should would be nice.

NOTE: This is a candidate for the 9.0 and 9.1 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f29ab4ece5)
2013-02-07 21:20:16 -08:00
Matt Turner
c59808c700 mesa: Allow glGet* queries of MAX_VARYING_COMPONENTS in ES 3
Should have been done in d9948e49 but I missed it because
MAX_VARYING_FLOATS doesn't appear in the ES 3 spec, but is the same
value as MAX_VARYING_COMPONENTS.

NOTE: Candidate for the 9.1 branch
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-07 17:54:16 -08:00
Michel Dänzer
ad62f424b3 radeonsi: Handle scaled and integer formats for samplers and vertex elements.
Also, add assertions to stress that render targets don't support scaled
formats.

20 more little piglits.
(cherry picked from commit 46dd16bca8b4526e46badc9cb1d7c058a8e6173e)
2013-02-07 19:11:30 +01:00
Michel Dänzer
fc04455533 radeonsi: Don't advertise PIPE_FORMAT_L8A8_SRGB support.
The hardware can't do it.
(cherry picked from commit f6e9430da2d3510f84baefa0fdf26ec5c457f146)
2013-02-07 19:11:19 +01:00
Michel Dänzer
6799bddf6b radeonsi: Remove incorrect (and dead) assignment in tex_fetch_args().
The proper return type is assigned at the end of the function.
(cherry picked from commit 180db2bcb28e94bb1ce18d76b2b3a5818d76262c)
2013-02-07 19:11:09 +01:00
Michel Dänzer
93f61addb5 radeonsi: Use unique names for referring to texture sampling intrinsics.
Append the overloaded vector type used for passing in the addressing
parameters.

Without this, LLVM uses the same function signature for all those types,
which cannot work.

Fixes problems e.g. with FlightGear and Red Eclipse.
(cherry picked from commit 1b3afea30de757815555d9eb1d6e72e2586d6a0c)
2013-02-07 19:10:17 +01:00
Jerome Glisse
d04b50b4de r600g: fix slice tile max for compressed texture and async dma
Was using the pixel size instead of the number of block for the slice
tile max computation which resulted in dma writing at wrong address.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-02-07 10:43:37 -05:00
Marek Olšák
f1c46c8418 r300g: fix blending with blend color and RGBA formats
NOTE: This is a candidate for the stable branches.
(cherry picked from commit f40a7fc34a)
2013-02-06 22:24:04 +01:00
Michel Dänzer
4bc85f9aac Require libdrm_radeon 2.4.42 for radeonsi.
It has new PCI IDs and an important tiled surface layout fix.
(cherry picked from commit 02a423b239)
2013-02-05 15:15:49 +01:00
Alex Deucher
e1d798a901 radeonsi: add Oland pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
(cherry picked from commit 4161d70bba)
2013-02-04 17:20:22 -05:00
Alex Deucher
6b0fa537a9 radeonsi: default PA_SC_RASTER_CONFIG to 0
That should work in all cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
(cherry picked from commit af0af75881)
2013-02-04 17:20:03 -05:00
Alex Deucher
0cc0097bb0 radeonsi: add support for Oland chips
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch
(cherry picked from commit 83e4407f44)
2013-02-04 17:19:43 -05:00
Michel Dänzer
7f90de5414 radeonsi: Fix draws using user index buffer.
Was broken since commit bf469f4edc
('gallium: add void *user_buffer in pipe_index_buffer').

Fixes 11 piglit tests and lots of missing geometry e.g. in TORCS.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit a8a5055f2d)
2013-02-04 17:54:03 +01:00
Michel Dänzer
8cd237bcbe radeonsi: Remove spurious traces of R16G16B16 support.
The hardware can't do it, and these were causing warnings in some piglit tests.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 6455d40b7e)
2013-02-04 17:28:18 +01:00
Michel Dänzer
5ca77c27a6 radeonsi: Enable texture arrays.
28/30 piglit tests pass.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 6bcb823844)
2013-02-04 17:28:14 +01:00
Michel Dänzer
b104d151f1 radeonsi: Improve packing of texture address parameters.
In particular, the LOD bias and depth comparison values are packed before the
'normal' texture coordinates, and the array slice and LOD values are appended.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 120efeef8b)
2013-02-04 17:27:43 +01:00
Michel Dänzer
5f9f3f381f radeonsi: Adapt to sample intrinsics changes.
Fix up intrinsic names, and bitcast texture address parameters to integers.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit e5fb7347a7)
2013-02-04 17:27:34 +01:00
Marek Olšák
b127ad3489 mesa: don't expose IBM_rasterpos_clip in a core context
glRasterPos doesn't exist in the core profile.

NOTE: This is a candidate for the stable branches (9.0 and 9.1).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit cc5fdaf2dc)
2013-02-01 16:35:24 +01:00
Marek Olšák
1003652a7f r300g: always put MSAA resources in VRAM
This along with the latest drm-fixes branch should help with bad performance
of MSAA. Remember: Nx MSAA can't be more than N times slower (where N=2,4,6).

Anyway, I recommend at least 512 MB of VRAM for Full HD 6x MSAA.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit a06f03d795)
2013-02-01 16:35:18 +01:00
Jerome Glisse
9d8a866db3 r600g: add cs memory usage accounting and limit it v3
We are now seing cs that can go over the vram+gtt size to avoid
failing flush early cs that goes over 70% (gtt+vram) usage. 70%
is use to allow some fragmentation.

The idea is to compute a gross estimate of memory requirement of
each draw call. After each draw call, memory will be precisely
accounted. So the uncertainty is only on the current draw call.
In practice this gave very good estimate (+/- 10% of the target
memory limit).

v2: Remove left over from testing version, remove useless NULL
    checking. Improve commit message.
v3: Add comment to code on memory accounting precision

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-31 14:25:30 -05:00
Marek Olšák
3b8d4f941f r600g: fix htile buffer leak
NOTE: This is a candidate for the 9.1 branch.
2013-01-31 14:25:10 -05:00
Matt Turner
ff515c4e7c build: Add missing comma in AS_IF
Reported-by: Lauri Kasanen<curaga@operamail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47248#c15
2013-01-29 15:06:47 -08:00
Marek Olšák
d7ca04a7c3 docs/relnotes-9.1: document new features in radeon drivers
(cherry picked from commit 845130951f)
2013-01-29 17:38:14 +01:00
Matt Turner
48af880f81 docs: List new extensions added in Mesa 9.1
I did not list the *_get_program_binary extensions since they're not
useful to anyone with their current implementation (that supports 0
binary formats).
2013-01-28 16:49:24 -08:00
Jerome Glisse
af2d8f8072 r600g: use uint64_t instead of unsigned long for proper 32bits cpu support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 19:10:29 -05:00
Jerome Glisse
d8d17441e2 r600g: real fix for non 3.8 kernel
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 17:44:49 -05:00
336 changed files with 8395 additions and 2362 deletions

View File

@@ -36,7 +36,7 @@ check-local:
# Rules for making release tarballs
PACKAGE_VERSION=9.1-devel
PACKAGE_VERSION=9.1.7
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)

72
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,72 @@
d60da27273d2cdb68bc32cae2ca66718dab15f27 st/mesa: set ctx->Const.MaxSamples = 0, not 1
5c86a728d4f688c0fe7fbf9f4b8f88060b65c4ee r600g: fix htile buffer leak
496928a442cec980b534bc5da2523b3632b21b61 CopyTexImage: Don't check sRGB vs LINEAR for desktop GL
3ee602314fc22054f69ee476f2e1037653d269bc mesa: Allow glGet* queries of MAX_VARYING_COMPONENTS in ES 3
# Already cherry picked without -x
96b3ca89b153f358de74059151d2b0e8bd884dfa scons: Allows choosing VS 10 or 11.
# This patch is superceded by 7d4f1e6
dbf94d105a48b7aafb2c8cf64d8b4392d87efea1 glsl: Replace constant-index vector array accesses with swizzles
# This patch is superceded by 34a4fc5
0967c362bf378b7415c30ca6d9523d3b2a3a7f5d i965: Fix an inconsistency inb the VUE map with gl_ClipVertex on gen4/5.
# This patch was backported as c3eb301
a8246927e35a49097f70cffb7fa8dd05ec1365e1 r600g: Fix UMAD on Cayman
# These patches cannot be backported without other, too invasive changes
eb19163a4dd3d7bfeed63229820c926f99ed00d9 radeonsi: Initial support for multiple constant buffers
e3befbca5ed9f22effcdc91c5886c86b644bc190 radeonsi: Handle TGSI_SEMANTIC_CLIPVERTEX
# These patches are performance improvements that are difficult to backport and cause regressions
740350c982bd2735b9eb9063c2b91856b6f1ad31 i965: Make the fragment shader pull constants index by dwords, not vec4s.
dca5fc14358a8b267b3854c39c976a822885898f i965/fs: Improve performance of varying-index uniform loads on IVB.
70b27e0e4b5d15e575ea477d63c0f6cb19d645c2 i965/fs: Use LD messages for pre-gen7 varying-index uniform loads
62501c3af85089b423218a41a2e2433ac849c2d3 i965/fs: Allow CSE on pre-gen7 varying-index uniform loads
# Reverted in master
98dfd59a0445666060c97b0dccaf0e9f030b547a i965: fix problem with constant out of bounds access (v2)
# Already cherry-picked, but squashed with the commit that broke what this fixed
4405ff4055685841c9d9545da52c7edc8708b14b i965: Fix haswell_upload_cut_index when there's no index buffer.
# Already cherry-picked as commit bf8053a2dbac1500586d6d387cd88c30aad63a60
6b676e66343356d5096260c2bc1601014c808cb0 i965,i915: Return early if miptree allocation fails
# Has potential to break previously-working (though technically incorrect) programs
fcaa48d9cc8937e0ceb59dfd22ef5b6e6fd1a273 glsl: Disallow return with a void argument from void functions.
# Rejected at author's request (attempted backport did not fix piglit test)
4c3ed795662974a1c2ad2326fc74bef608a34f31 r600g: Workaround for a harware bug with nested loops on Cayman
# These do not apply and the author has confirmed they should be dropped.
49c1fc7044eaaa5c2dca05ff4a709be8e3636871 r600g: don't emit SQ_DYN_GPR_RESOURCE_LIMIT_1 on cayman
4539f8e20af286d1f521eb016c89c6d9af0b801c r600g: don't emit surface_sync after FLUSH_AND_INV_EVENT
# Backported as commit ca2df146429fba22ea8df3e8f9b76d84d391cf5f
da33f9b919039442e9ab51f9b1d1c83a73607133 r600g: increase array size for shader inputs and outputs
# Has potential to break previously-working (though technically incorrect) programs
17856726c94000bf16156f7f9acea77a271a6005 glsl: Disallow auxiliary storage qualifiers on FS outputs.
# Doesn't cherry-pick cleanly, and doesn't change the implementation (just cleans up compiler warning spam)
803f755edeabd1b0af3d8f4ebf2005333e152ad4 glsl: Less const for glsl_type convenience accessors
# Not needed for 9.1 (restores code never deleted from this branch)
0e9549e2bd57168086421468cbf1db0821c36730 Revert "i965: Delete pre-DRI2.3 viewport hacks."
# These are all intended for 9.2, not 9.1
4e90bc9a12bea93c6b5522abe8151a8cfe1d6d1d gallium: Add PIPE_CAP_ENDIANNESS
8c9d3c62f60a2819948bdfb005600cdc10aa2547 clover: Return correct value for CL_DEVICE_ENDIAN_LITTLE
a3dcab43c6b6fed2f35aa0e802be6398985f100c clover: Pass corresponding module::argument to kernel::argument::bind().
2265b40e377cc2c9d1091498df2aede5df2ff684 clover: Add kernel argument fields to allow differing host/target data types.
829caf410e2c2c6f79902199da5a7900abc16129 clover: Byte-swap kernel arguments when host and device endianness differ.
f64c0ca692d3e8c78dd9ae1f015f58f1dfc1c760 clover: Extend kernel arguments for differing host and device data types.
df530829f757a8968389427eb26f45a0d46623fa clover: Respect kernel argument alignment restrictions.
# Memory leak being fixed doesn't exist in 9.1 (as far as I can tell)
035bf2198368d3fa69387788a63039d71319f0bf i915,i965: Fix memory leak in try_pbo_upload (v2)
# This commit depends on other, unspecified commits (does not compile alone)
d38765f3c8fbd473b949177cc9698b2cd459902c mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3

52
bin/bugzilla_mesa.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# This script is used to generate the list of fixed bugs that
# appears in the release notes files, with HTML formatting.
#
# Note: This script could take a while until all details have
# been fetched from bugzilla.
#
# Usage examples:
#
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 > bugfixes
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee bugfixes
# $ DRYRUN=yes bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ DRYRUN=yes bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | wc -l
# regex pattern: trim before url
trim_before='s/.*\(http\)/\1/'
# regex pattern: trim after url
trim_after='s/\(show_bug.cgi?id=[0-9]*\).*/\1/'
# regex pattern: always use https
use_https='s/http:/https:/'
# extract fdo urls from commit log
urls=$(git log $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before -e $trim_after -e $use_https | sort | uniq)
# if DRYRUN is set to "yes", simply print the URLs and don't fetch the
# details from fdo bugzilla.
#DRYRUN=yes
if [ "x$DRYRUN" = xyes ]; then
for i in $urls
do
echo $i
done
else
echo "<ul>"
echo ""
for i in $urls
do
id=$(echo $i | cut -d'=' -f2)
summary=$(wget --quiet -O - $i | grep -e '<title>.*</title>' | sed -e 's/ *<title>Bug [0-9]\+ &ndash; \(.*\)<\/title>/\1/')
echo "<li><a href=\"$i\">Bug $id</a> - $summary</li>"
echo ""
done
echo "</ul>"
fi

View File

@@ -1,6 +1,12 @@
#!/bin/sh
# Script for generating a list of candidates for cherry-picking to a stable branch
#
# Usage examples:
#
# $ bin/get-pick-list.sh
# $ bin/get-pick-list.sh > picklist
# $ bin/get-pick-list.sh | tee picklist
# Grep for commits with "cherry picked from commit" in the commit message.
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
@@ -8,7 +14,7 @@ git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate.*9\.1\|CC:.*9\.1.*mesa-stable\)' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.

View File

@@ -2,6 +2,12 @@
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
#
# Usage examples:
#
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 > changes
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee changes
typeset -i in_log=0

View File

@@ -100,4 +100,4 @@ def AddOptions(opts):
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0')))

View File

@@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output
m4_divert_once([HELP_END], [
See docs/autoconf.html for more details on the options for Mesa.])
AC_INIT([Mesa], [9.1.0],
AC_INIT([Mesa], [9.1.7],
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
@@ -20,7 +20,8 @@ echo \#buildapi-variable-no-builddir >/dev/null
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
@@ -30,7 +31,7 @@ AC_SUBST([OSMESA_VERSION])
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.40
LIBDRM_RADEON_REQUIRED=2.4.42
LIBDRM_INTEL_REQUIRED=2.4.38
LIBDRM_NVVIEUX_REQUIRED=2.4.33
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
@@ -57,10 +58,10 @@ LT_PREREQ([2.2])
LT_INIT([disable-static])
AX_PROG_BISON([],
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"]
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
[AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
AX_PROG_FLEX([],
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"]
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
[AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
AC_PATH_PROG([PERL], [perl])
@@ -451,6 +452,9 @@ if test "x$enable_asm" = xyes; then
linux* | *freebsd* | dragonfly* | *netbsd*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
gnu*)
asm_arch=x86
;;
esac
;;
x86_64)
@@ -611,7 +615,7 @@ AC_ARG_ENABLE([opencl],
[enable OpenCL library NOTE: Enabling this option will also enable
--with-llvm-shared-libs
@<:@default=no@:>@])],
[enable_opencl="$enableval" with_llvm_shared_libs="$enableval"],
[],
[enable_opencl=no])
AC_ARG_ENABLE([xlib_glx],
[AS_HELP_STRING([--enable-xlib-glx],
@@ -701,6 +705,16 @@ if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
fi
if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
fi
# Disable GLX if OpenGL is not enabled
if test "x$enable_glx$enable_opengl" = xyesno; then
AC_MSG_WARN([OpenGL not enabled, disabling GLX])
enable_glx=no
fi
# Disable GLX if DRI and Xlib-GLX are not enabled
if test "x$enable_glx" = xyes -a \
"x$enable_dri" = xno -a \
@@ -815,20 +829,6 @@ if test "x$enable_dri" = xyes; then
fi
fi
dnl Find out if X is available.
PKG_CHECK_MODULES([X11], [x11], [no_x=no], [no_x=yes])
dnl Try to tell the user that the --x-* options are only used when
dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
m4_divert_once([HELP_BEGIN],
[These options are only used when the X libraries cannot be found by the
pkg-config utility.])
dnl We need X for xlib and dri, so bomb now if it's not found
if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
AC_MSG_ERROR([X11 development libraries needed for GLX])
fi
dnl Direct rendering or just indirect rendering
case "$host_os" in
gnu*)
@@ -1059,26 +1059,24 @@ if test "x$enable_dri" = xyes; then
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
# Check for expat
if test "x$enable_dri" = xyes; then
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
save_LIBS="$LIBS"
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
LIBS="$save_LIBS"
fi
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
save_LIBS="$LIBS"
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
LIBS="$save_LIBS"
# if we are building any dri driver other than swrast or using the dri state tracker ...
if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast || test "x$enable_dri" = xyes; then
# If we are building any DRI driver other than swrast.
if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
# ... libdrm is required
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
@@ -1146,14 +1144,6 @@ case $DRI_DIRS in
;;
esac
AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
dnl
dnl OSMesa configuration
dnl
@@ -1619,8 +1609,13 @@ AC_ARG_ENABLE([gallium-llvm],
AC_ARG_WITH([llvm-shared-libs],
[AS_HELP_STRING([--with-llvm-shared-libs],
[link with LLVM shared libraries @<:@default=disabled@:>@])],
[with_llvm_shared_libs=yes],
[],
[with_llvm_shared_libs=no])
AS_IF([test x$enable_opencl = xyes],
[
AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
with_llvm_shared_libs=yes
])
AC_ARG_WITH([llvm-prefix],
[AS_HELP_STRING([--with-llvm-prefix],
@@ -1662,16 +1657,17 @@ if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
if test "x$with_llvm_shared_libs" != xyes; then
LLVM_COMPONENTS="engine bitwriter"
if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
fi
LLVM_COMPONENTS="engine bitwriter"
if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
fi
if $LLVM_CONFIG --components | grep -q '\<oprofilejit\>'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} oprofilejit"
fi
if test "x$enable_opencl" = xyes; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
fi
fi
if test "x$enable_opencl" = xyes; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
fi
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
LLVM_BINDIR=`$LLVM_CONFIG --bindir`
LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
@@ -1746,6 +1742,7 @@ gallium_check_st() {
fi
if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
HAVE_COMMON_DRI=yes
fi
if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
@@ -1783,8 +1780,8 @@ gallium_require_drm_loader() {
radeon_llvm_check() {
LLVM_REQUIRED_VERSION_MAJOR="3"
LLVM_REQUIRED_VERSION_MINOR="2"
if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer with R600 target enabled is required.
if test "$LLVM_VERSION_INT" -ne "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR with R600 target enabled is required.
To use the r600/radeonsi LLVM backend, you need to fetch the LLVM source from:
git://people.freedesktop.org/~tstellar/llvm master
and build with --enable-experimental-targets=R600])
@@ -1840,6 +1837,9 @@ if test "x$with_gallium_drivers" != x; then
if test "x$enable_r600_llvm" = xyes; then
USE_R600_LLVM_COMPILER=yes;
fi
if test "x$enable_opencl" = xyes; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
fi
gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
;;
xradeonsi)
@@ -1868,6 +1868,7 @@ if test "x$with_gallium_drivers" != x; then
if test "x$HAVE_ST_DRI" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
HAVE_COMMON_DRI=yes
fi
if test "x$HAVE_ST_VDPAU" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
@@ -1984,6 +1985,14 @@ for driver in $GALLIUM_DRIVERS_DIRS; do
esac
done
AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)

View File

@@ -16,6 +16,23 @@
<h1>News</h1>
<h2>February 22, 2013</h2>
<p>
<a href="relnotes-9.1.html">Mesa 9.1</a> is released.
This is a new development release.
See the release notes for more information about the release.
</p>
<h2>February 21, 2013</h2>
<p>
<a href="relnotes-9.0.3.html">Mesa 9.0.3</a> is released.
This is a bug fix release.
</p>
<h2>January 22, 2013</h2>
<p>

235
docs/relnotes-9.1.1.html Normal file
View File

@@ -0,0 +1,235 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.1 Release Notes / March 19th, 2013</h1>
<p>
Mesa 9.1.1 is a bug fix release which fixes bugs found since the 9.1 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
6508d9882d8dce7106717f365632700c MesaLib-9.1.1.tar.gz
6ea2bdc3b7ecfb4257b39814b4182580 MesaLib-9.1.1.tar.bz2
3434c0eb47849a08c53cd32833d10d13 MesaLib-9.1.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=30232">Bug 30232</a> - [GM45] mesa demos spriteblast render incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32429">Bug 32429</a> - [gles2] Ironlake: gl_PointCoord takes no effect for point sprites</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38086">Bug 38086</a> - Mesa 7.11-devel implementation error: Unexpected program target in destroy_program_variants_cb()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57121">Bug 57121</a> - [snb] corrupted GLSL built-in function results when using Uniform Buffer contents as arguments</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58042">Bug 58042</a> - [bisected] Garbled UI in Team Fortress 2 and Counter-Strike: Source</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58960">Bug 58960</a> - Texture flicker with fragment shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59495">Bug 59495</a> - [i965 Bisected]Oglc fbblit(advanced.blitFb-3d-cube.mirror.both) fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59783">Bug 59783</a> - [IVB bisected] 3DMMES2.0 Taiji performance reduced by ~13% with gnome-session enable compositing</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60121">Bug 60121</a> - build - libvdpau_softpipe fails at runtime.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60143">Bug 60143</a> - gbm_dri_bo_create fails to initialize bo-&gt;base.base.format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60802">Bug 60802</a> - Corruption with DMA ring on cayman</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60848">Bug 60848</a> - [bisected] r600g: add htile support cause gpu lockup in Dishonored wine.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60938">Bug 60938</a> - [softpipe] piglit interpolation-noperspective-gl_BackColor-flat-fixed regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61012">Bug 61012</a> - alloc_layout_array tx * ty assertion failure when making pbuffer current</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61026">Bug 61026</a> - Segfault in glBitmap when called with PBO source</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-9.1..mesa-9.1.1
</pre>
<p>Adam Sampson (1):</p>
<ul>
<li>autotools: oprofilejit should be included in the list of LLVM components required</li>
</ul>
<p>Alex Deucher (2):</p>
<ul>
<li>r600g: add Richland APU pci ids</li>
<li>r600g: Use blitter rather than DMA for 128bpp on cayman (v3)</li>
</ul>
<p>Andreas Boll (2):</p>
<ul>
<li>docs: Add 9.1 release md5sums</li>
<li>docs: add news item for 9.1 release</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>meta: Allocate texture before initializing texture coordinates</li>
</ul>
<p>Brian Paul (11):</p>
<ul>
<li>docs: remove stray 'date' text</li>
<li>docs: insert links to the 9.0.3 release</li>
<li>draw: fix non-perspective interpolation in interp()</li>
<li>st/mesa: implement glBitmap unpacking from a PBO, for the cache path</li>
<li>st/xlib: initialize the drawable size in create_xmesa_buffer()</li>
<li>st/mesa: fix trimming of GL_QUAD_STRIP</li>
<li>st/mesa: check for dummy programs in destroy_program_variants()</li>
<li>st/mesa: fix polygon offset state translation logic</li>
<li>draw: fix broken polygon offset stage</li>
<li>llvmpipe: add missing checks for polygon offset point/line modes</li>
<li>svga: always link with C++</li>
</ul>
<p>Daniel van Vugt (1):</p>
<ul>
<li>gbm: Remember to init format on gbm_dri_bo_create.</li>
</ul>
<p>Eric Anholt (7):</p>
<ul>
<li>i965/fs: Do a general SEND dependency workaround for the original 965.</li>
<li>i965/fs: Fix copy propagation with smearing.</li>
<li>i965/fs: Delay setup of uniform loads until after pre-regalloc scheduling.</li>
<li>i965/fs: Only do CSE when the dst types match.</li>
<li>i965/fs: Fix broken math on values loaded from uniform buffers on gen6.</li>
<li>mesa: Fix setup of ctx-&gt;Point.PointSprite for GLES2.</li>
<li>i965: Fix the W value of deprecated pointcoords on pre-gen6.</li>
</ul>
<p>Frank Henigman (1):</p>
<ul>
<li>i965: Link i965_dri.so with C++ linker.</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>mesa: Add previously picked commit to .cherry-ignore</li>
<li>mesa: Modify candidate search string</li>
<li>egl: Allow 24-bit visuals for 32-bit RGBA8888 configs</li>
</ul>
<p>Jakub Bogusz (1):</p>
<ul>
<li>vdpau-softpipe: Build correct source file - vl_winsys_xsp.c</li>
</ul>
<p>Jerome Glisse (1):</p>
<ul>
<li>r600g: workaround hyperz lockup on evergreen</li>
</ul>
<p>John Kåre Alsaker (1):</p>
<ul>
<li>llvmpipe: Fix creation of shared and scanout textures.</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>attrib: push/pop FRAGMENT_PROGRAM_ARB state</li>
</ul>
<p>José Fonseca (3):</p>
<ul>
<li>scons: Allows choosing VS 10 or 11.</li>
<li>scons: Define _ALLOW_KEYWORD_MACROS on MSVC builds.</li>
<li>scons: Warn when using MSVS versions prior to 2012.</li>
</ul>
<p>Keith Kriewall (1):</p>
<ul>
<li>scons: Fix Windows build with LLVM 3.2</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>i965: Fix Crystal Well PCI IDs.</li>
</ul>
<p>Marek Olšák (5):</p>
<ul>
<li>r600g: use async DMA with a non-zero src offset</li>
<li>r600g: flush and invalidate htile cache when appropriate</li>
<li>gallium/util: add helper code for 1D integer range</li>
<li>r600g: always map uninitialized buffer range as unsynchronized</li>
<li>r600g: pad the DMA CS to a multiple of 8 dwords</li>
</ul>
<p>Martin Andersson (1):</p>
<ul>
<li>winsys/radeon: Only add bo to hash table when creating flink</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>mesa: Allow ETC2/EAC formats with ARB_ES3_compatibility.</li>
</ul>
<p>Michel Dänzer (3):</p>
<ul>
<li>radeonsi: Fix up and enable flat shading.</li>
<li>r600g/Cayman: Fix blending using destination alpha factor but non-alpha dest</li>
<li>radeonsi: Fix off-by-one for maximum vertex element index in some cases</li>
</ul>
<p>Tapani Pälli (2):</p>
<ul>
<li>mesa: add missing case in _mesa_GetTexParameterfv()</li>
<li>mesa/es: NULL check in EGLImageTargetTexture2DOES</li>
</ul>
<p>Vadim Girlin (1):</p>
<ul>
<li>r600g: fix check_and_set_bank_swizzle for cayman</li>
</ul>
<p>Vincent Lejeune (2):</p>
<ul>
<li>r600g/llvm: Add support for UBO</li>
<li>r600g: Check comp_mask before merging export instructions</li>
</ul>
</div>
</body>
</html>

237
docs/relnotes-9.1.2.html Normal file
View File

@@ -0,0 +1,237 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.2 Release Notes / April 30th, 2013</h1>
<p>
Mesa 9.1.2 is a bug fix release which fixes bugs found since the 9.1.1 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
df2aab86ff4a510ce5b0d074caa0a59f MesaLib-9.1.2.tar.bz2
415c2bc3a9eb571aafbfa474ebf5a2e0 MesaLib-9.1.2.tar.gz
b1ae5a4d9255953980bc9254f5323420 MesaLib-9.1.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=44567">Bug 44567</a> - [965gm] green artifacts when using GLSL in XBMC</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59238">Bug 59238</a> - many new symbols in libxatracker after recent automake work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59445">Bug 59445</a> - [SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59495">Bug 59495</a> - [i965 Bisected]Oglc fbblit(advanced.blitFb-3d-cube.mirror.both) fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60503">Bug 60503</a> - [r300g] Unigine Heaven 3.0: all objects are black</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60510">Bug 60510</a> - Firefox 18.0.2 Crash On Nvidia GeForce2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61197">Bug 61197</a> - [SNB Bisected] kwin_gles screen corruption</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61317">Bug 61317</a> - [IVB] corrupt rendering with UBOs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61395">Bug 61395</a> - glEdgeFlag can't be set to false</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61947">Bug 61947</a> - nullpointer dereference causes xorg-server segfault when nouveau DRI driver is loaded</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62357">Bug 62357</a> - llvmpipe: Fragment Shader with &quot;return&quot; in main causes back output</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62434">Bug 62434</a> - [bisected] 3284.073] (EE) AIGLX error: dlopen of /usr/lib/xorg/modules/dri/r600_dri.so failed (/usr/lib/libllvmradeon9.2.0.so: undefined symbol: lp_build_tgsi_intrinsic)</li>
<li><a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349437">Debian bug #349437</a> - mesa - FTBFS: error: 'IEEE_ONE' undeclared</li>
<li><a href="http://bugzilla.redhat.com/show_bug.cgi?id=918661">Redhat bug #918661</a> - crash in routine Avogadro UI manipulation</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-9.1.1..mesa-9.1.2
</pre>
<p>Adam Jackson (2):</p>
<ul>
<li>glx: Build with VISIBILITY_CFLAGS in automake</li>
<li>linux: Don't emit a .note.ABI-tag section anymore (#26663)</li>
</ul>
<p>Alan Hourihane (3):</p>
<ul>
<li>Add missing GL_TEXTURE_CUBE_MAP entry in _mesa_legal_texture_dimensions</li>
<li>Unreference sampler object when it's currently bound to texture unit.</li>
<li>mesa: fix glGetInteger*(GL_SAMPLER_BINDING).</li>
</ul>
<p>Alex Deucher (1):</p>
<ul>
<li>r600g: disable hyperz by default on 9.1</li>
</ul>
<p>Andreas Boll (5):</p>
<ul>
<li>radeon/llvm: Link against libgallium.la to fix an undefined symbol</li>
<li>mesa: use ieee fp on s390 and m68k</li>
<li>build: Enable x86 assembler on Hurd.</li>
<li>osmesa: fix out-of-tree build</li>
<li>gallium/egl: fix out-of-tree build</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>mesa: Fix FB blitting in case of zero size src or dst rect</li>
</ul>
<p>Brian Paul (4):</p>
<ul>
<li>mesa: flush current state when querying GL_EDGE_FLAG</li>
<li>vbo: fix crash found with shared display lists</li>
<li>llvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE</li>
<li>llvmpipe: add some scene limit sanity check assertions</li>
</ul>
<p>Carl Worth (1):</p>
<ul>
<li>i965: Avoid segfault in gen6_upload_state</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965/vs: Fix Gen4/5 VUE map inconsistency with gl_ClipVertex</li>
</ul>
<p>Christoph Bumiller (4):</p>
<ul>
<li>nv50: fix 3D render target setup</li>
<li>nv50,nvc0: disable DEPTH_RANGE_NEAR/FAR clipping during blit</li>
<li>nv50,nvc0: fix 3d blits, restore viewport after blit</li>
<li>nvc0: fix for 2d engine R source formats writing RRR1 and not R001</li>
</ul>
<p>Eric Anholt (5):</p>
<ul>
<li>i965/fs: Fix register allocation for uniform pull constants in 16-wide.</li>
<li>i965/fs: Fix broken rendering in large shaders with UBO loads.</li>
<li>i965/fs: Also do the gen4 SEND dependency workaround against other SENDs.</li>
<li>i965: Add definitions for gen7+ data cache messages.</li>
<li>mesa: Disable validate_ir_tree() on release builds.</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>docs: Add 9.1.1 release md5sums</li>
<li>mesa: Add previously picked commit to .cherry-ignore</li>
<li>glsl: Add missing bool case in glsl_type::get_scalar_type</li>
<li>mesa: Note that patch dbf94d1 should't actually get picked to the 9.1 branch</li>
<li>mesa: Bump version to 9.1.2</li>
</ul>
<p>Jan de Groot (1):</p>
<ul>
<li>dri/nouveau: fix crash in nouveau_flush</li>
</ul>
<p>José Fonseca (3):</p>
<ul>
<li>autotools: Add missing top-level include dir.</li>
<li>mesa,gallium,egl,mapi: One definition of C99 inline/__func__ to rule them all.</li>
<li>include: Fix build with VS 11 (i.e, 2012).</li>
</ul>
<p>Kenneth Graunke (4):</p>
<ul>
<li>i965: Fix INTEL_DEBUG=shader_time for Haswell.</li>
<li>i965: Specialize SURFACE_STATE creation for shader time.</li>
<li>i965: Make INTEL_DEBUG=shader_time use the RAW surface format.</li>
<li>i965: Don't use texture swizzling to force alpha to 1.0 if unnecessary.</li>
</ul>
<p>Maarten Lankhorst (2):</p>
<ul>
<li>gallium/build: Fix visibility CFLAGS in automake</li>
<li>radeon/llvm: Do not link against libgallium when building statically.</li>
</ul>
<p>Marcin Slusarz (1):</p>
<ul>
<li>dri/nouveau: NV17_3D class is not available for NV1a chipset</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>mesa: don't allocate a texture if width or height is 0 in CopyTexImage</li>
<li>gallium/tgsi: fix valgrind warning</li>
<li>mesa: handle HALF_FLOAT like FLOAT in get_tex_rgba</li>
</ul>
<p>Martin Andersson (1):</p>
<ul>
<li>r600g: Use virtual address for PIPE_QUERY_SO* in r600_emit_query_end</li>
</ul>
<p>Matt Turner (3):</p>
<ul>
<li>configure.ac: Don't check for X11 unconditionally.</li>
<li>configure.ac: Remove stale comment about --x-* arguments.</li>
<li>mesa: Implement TEXTURE_IMMUTABLE_LEVELS for ES 3.0.</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Emit pixel shader state even when only the vertex shader changed</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965: Apply depthstencil alignment workaround when doing fast clears.</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix return opcode handling in main function of a shader</li>
</ul>
<p>Tapani Pälli (1):</p>
<ul>
<li>intel: Fix regression in intel_create_image_from_name stride handling</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>r300g: Fix bug in OMOD optimization</li>
</ul>
</div>
</body>
</html>

230
docs/relnotes-9.1.3.html Normal file
View File

@@ -0,0 +1,230 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.3 Release Notes / May 21st, 2013</h1>
<p>
Mesa 9.1.3 is a bug fix release which fixes bugs found since the 9.1.1 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
952ccd03547ed72333b64e1746cf8ada MesaLib-9.1.3.tar.bz2
26d2f1aa8e9db388d51fcbd163c61fb7 MesaLib-9.1.3.tar.gz
7017b7bdf0ebfd39a5c46cee7cf6b567 MesaLib-9.1.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=39251">Bug 39251</a> - Second Life viewers from release 2.7.4.235167 to the last 3.4.0.264911 crash on start.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47478">Bug 47478</a> - [wine] GLX_DONT_CARE does not work for GLX_DRAWABLE_TYPE or GLX_RENDER_TYPE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56416">Bug 56416</a> - [SNB bisected] SNB hang with rc6 and hiz on glxgears (and other GL apps) immediately after xinit.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57436">Bug 57436</a> - [GLSL1.40 IVB/HSW]Piglit spec/glsl-1.40/compiler_built-in-functions/inverse-mat2.frag fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61554">Bug 61554</a> - [ivb] Mesa 9.1 performance regression on KWin's Lanczos shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61773">Bug 61773</a> - abort is an incredibly not-smart way to handle IR validation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62868">Bug 62868</a> - solaris build broken with missing ffsll</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62999">Bug 62999</a> - glXChooseFBConfig with GLX_DRAWABLE_TYPE, GLX_DONT_CARE fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63078">Bug 63078</a> - EGL X11 Regression: Maximum swap interval is 0 (worked with 9.0)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63447">Bug 63447</a> - [i965 Bisected]Ogles1conform/Ogles2conform/Ogles3conform cases segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64662">Bug 64662</a> - [SNB 9.1 Bisected]Ogles2conform GL2ExtensionTests/depth_texture_cube_map/depth_texture_cube_map.test fail</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-9.1.2..mesa-9.1.3
</pre>
<p>Alex Deucher (2):</p>
<ul>
<li>r600g: add new richland pci ids</li>
<li>radeonsi: add new SI pci ids</li>
</ul>
<p>Alexander Monakov (1):</p>
<ul>
<li>Honor GLX_DONT_CARE in MATCH_MASK</li>
</ul>
<p>Andreas Boll (2):</p>
<ul>
<li>mesa: Add a script to generate the list of fixed bugs</li>
<li>mesa: add usage examples to get-pick-list and shortlog scripts</li>
</ul>
<p>Aras Pranckevicius (1):</p>
<ul>
<li>GLSL: fix lower_jumps to report progress properly</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: remove platform checks around __builtin_ffs, __builtin_ffsll</li>
<li>gallium/u_blitter: fix is_blit_generic_supported() stencil checking</li>
<li>mesa: enable GL_ARB_texture_float if TEXTURE_FLOAT_ENABLED is defined</li>
</ul>
<p>Chad Versace (2):</p>
<ul>
<li>egl/dri2: Fix min/max swap interval of configs</li>
<li>intel: Allocate hiz in intel_renderbuffer_move_to_temp()</li>
</ul>
<p>Chris Forbes (2):</p>
<ul>
<li>i965/fs: Don't try to use bogus interpolation modes pre-Gen6.</li>
<li>mesa: don't memcmp() off the end of a cache key.</li>
</ul>
<p>Dave Airlie (2):</p>
<ul>
<li>st/mesa: fix UBO offsets.</li>
<li>ralloc: don't write to memory in case of alloc fail.</li>
</ul>
<p>Eric Anholt (11):</p>
<ul>
<li>i965/fs: Remove creation of a MOV instruction that's never used.</li>
<li>i965/fs: Move varying uniform offset compuation into the helper func.</li>
<li>i965: Make the constant surface interface take a normal byte size.</li>
<li>i965/fs: Avoid inappropriate optimization with regs_written &gt; 1.</li>
<li>i965/fs: Do CSE on gen7's varying-index pull constant loads.</li>
<li>i965/fs: Clean up the setup of gen4 simd16 message destinations.</li>
<li>i965/gen7: Skip resetting SOL offsets at batch start with HW contexts.</li>
<li>i965/gen6: Reduce updates of transform feedback offsets with HW contexts.</li>
<li>i965: Fix SNB GPU hangs when a blorp batch is the first thing to execute.</li>
<li>i965: Fix hangs on HSW since the gen6 blorp fix.</li>
<li>i965: Disable write masking when setting up texturing m0.</li>
</ul>
<p>Haixia Shi (1):</p>
<ul>
<li>ACTIVE_UNIFORM_MAX_LENGTH should include 3 extra characters for arrays.</li>
</ul>
<p>Ian Romanick (11):</p>
<ul>
<li>docs: Add 9.1.2 release md5sums</li>
<li>mesa: Note that patch 0967c36 shouldn't actually get picked to the 9.1 branch</li>
<li>mesa: NULL check the pointer before trying to dereference it</li>
<li>egl/dri2: NULL check value returned by dri2_create_surface</li>
<li>mesa: Don't leak shared state when context initialization fails</li>
<li>mesa: Don't leak gl_context::BeginEnd at context destruction</li>
<li>mesa/swrast: Refactor no-memory error checking in blit_linear</li>
<li>mesa/swrast: Move free calls outside the attachment loop</li>
<li>intel: Don't dereference a NULL pointer of calloc fails</li>
<li>mesa: Note that a824692 is already back ported</li>
<li>mesa: Bump version to 9.1.3</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>winsys/sw/xlib: Prevent shared memory segment leakage.</li>
</ul>
<p>Kenneth Graunke (9):</p>
<ul>
<li>mesa: Add new ctx-&gt;Stencil._WriteEnabled derived state flag.</li>
<li>i965: Fix stencil write enable flag in 3DSTATE_DEPTH_BUFFER on Gen7+.</li>
<li>mesa: Fix unpack function for ETC2_SRGB8_PUNCHTHROUGH_ALPHA1.</li>
<li>mesa: Add an unpack function for ARGB2101010_UINT.</li>
<li>mesa: Add unpack functions for R/RG/RGB [U]INT8/16/32 formats.</li>
<li>mesa: Add unpack functions for A/I/L/LA [U]INT8/16/32 formats.</li>
<li>glsl: Ignore redundant prototypes after a function's been defined.</li>
<li>i965: Lower textureGrad() for samplerCubeShadow.</li>
<li>i965/vs: Fix textureGrad() with shadow samplers on Haswell.</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>nvc0: Fix fd leak in nvc0_create_decoder</li>
</ul>
<p>Marek Olšák (5):</p>
<ul>
<li>radeonsi: add more cases for copying unsupported formats to resource_copy_region</li>
<li>mesa: fix glGet queries depending on derived framebuffer state (v2)</li>
<li>gallium/u_blitter: implement buffer clearing</li>
<li>r600g: initialize CMASK and HTILE with the GPU using streamout</li>
<li>st/mesa: depth-stencil-alpha state also depends on _NEW_BUFFERS</li>
</ul>
<p>Martin Andersson (1):</p>
<ul>
<li>r600g: Fix UMAD on Cayman</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Handle arbitrary 2-byte formats in resource_copy_region</li>
</ul>
<p>Paul Berry (7):</p>
<ul>
<li>glsl: Fix array indexing when constant folding built-in functions.</li>
<li>i965: Reduce code duplication in handling of depth, stencil, and HiZ.</li>
<li>glsl/linker: fix varying packing for non-flat integer varyings.</li>
<li>glsl: Document lower_packed_varyings' "flat" requirement with an assert.</li>
<li>glsl/linker: Adapt flat varying handling in preparation for geometry shaders.</li>
<li>glsl/linker: Reduce scope of non-flat integer varying fix.</li>
<li>intel: Do a depth resolve before copying images between miptrees.</li>
</ul>
<p>Ralf Jung (1):</p>
<ul>
<li>egl/x11: Fix initialisation of swap_interval</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix small but severe bug in handling multiple lod level strides</li>
</ul>
<p>Vadim Girlin (1):</p>
<ul>
<li>gallium: handle drirc disable_glsl_line_continuations option</li>
</ul>
</div>
</body>
</html>

321
docs/relnotes-9.1.4.html Normal file
View File

@@ -0,0 +1,321 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.4 Release Notes / July 1st, 2013</h1>
<p>
Mesa 9.1.4 is a bug fix release which fixes bugs found since the 9.1.3 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
a2c4e25d0e27918bc67f61bae04d0cb8 MesaLib-9.1.4.tar.bz2
8c7e9ce5b05cb2223f0587396dd9dc08 MesaLib-9.1.4.tar.gz
020459c5793d4279bdcb2daa1f7dd9f6 MesaLib-9.1.4.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=37871">Bug 37871</a> - [bisected i965] Bus error (core dumped) on oglc texdecaltile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=42182">Bug 42182</a> - egl/opengles1/tri_x11 renders wrong</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44958">Bug 44958</a> - [SNB IVB HSW] mesa demo test texleak bus error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53494">Bug 53494</a> - [snb] crash in texsubimage to a large atlas in clutter</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60518">Bug 60518</a> - glDrawElements segfault when compiled into display list</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61821">Bug 61821</a> - src/mesa/drivers/dri/common/xmlpool.h:96:29: fatal error: xmlpool/options.h</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63520">Bug 63520</a> - r300g regression (RV380): Strange rendering of light sources in Penumbra (bisected)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63701">Bug 63701</a> - [HSW] support new haswell graphics [8086:0a2e]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64727">Bug 64727</a> - [gm45, bisected] some piglit glsl 1.10 built-in-functions tests crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64745">Bug 64745</a> - [llvmpipe] SIGSEGV src/gallium/state_trackers/glx/xlib/glx_api.c:1374</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64934">Bug 64934</a> - [llvmpipe] SIGSEGV src/gallium/state_trackers/glx/xlib/glx_api.c:1363</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65173">Bug 65173</a> - segfault in _mesa_get_format_datatype and _mesa_get_color_read_type when state dumping with glretrace</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-9.1.3..mesa-9.1.4
</pre>
<p>Alan Coopersmith (2):</p>
<ul>
<li>integer overflow in XF86DRIOpenConnection() [CVE-2013-1993 1/2]</li>
<li>integer overflow in XF86DRIGetClientDriverName() [CVE-2013-1993 2/2]</li>
</ul>
<p>Alex Deucher (3):</p>
<ul>
<li>radeonsi: add support for hainan chips</li>
<li>radeonsi: add Hainan pci ids</li>
<li>winsys/radeon: add env var to disable VM on Cayman/Trinity</li>
</ul>
pp
<p>Andreas Boll (1):</p>
<ul>
<li>glapi: Add some missing static_dispatch="false" annotations to es_EXT.xml</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>intel: Add a null pointer check before dereferencing the pointer</li>
</ul>
<p>Armin K (1):</p>
<ul>
<li>gallivm: Fix build with LLVM 3.3</li>
</ul>
<p>Brian Paul (9):</p>
<ul>
<li>mesa: fix the compressed TexSubImage size checking code</li>
<li>st/mesa: generate GL_OUT_OF_MEMORY if we can't create the index buffer</li>
<li>mesa: fix error checking of DXT sRGB formats in _mesa_base_tex_format()</li>
<li>st/glx/xlib: check for null ctx pointer in glXIsDirect()</li>
<li>xlib: check for null ctx pointer in glXIsDirect()</li>
<li>st/glx: add null ctx check in glXDestroyContext()</li>
<li>xlib: add null ctx check in glXDestroyContext()</li>
<li>meta: move vertex array enables for mipmap generation</li>
<li>mesa: handle missing read buffer in _mesa_get_color_read_format/type()</li>
</ul>
<p>Bryan Cain (1):</p>
<ul>
<li>nv50: initialize kick_notify callback in nv50_create</li>
</ul>
<p>Chad Versace (3):</p>
<ul>
<li>egl/android: Fix error condition for EGL_ANDROID_image_native_buffer</li>
<li>i965: Fix glColorPointer(GL_FIXED)</li>
<li>intel: Return early if miptree allocation fails</li>
</ul>
<p>Chia-I Wu (1):</p>
<ul>
<li>u_vbuf: fix index buffer leak</li>
</ul>
<p>Chris Forbes (8):</p>
<ul>
<li>mesa: add accessor for effective stencil ref</li>
<li>intel: Use accessor for stencil reference values</li>
<li>nouveau: Use accessor for stencil reference values</li>
<li>radeon: Use accessor for stencil reference values</li>
<li>st: Use accessor for stencil reference values</li>
<li>swrast: Use accessor for stencil reference values</li>
<li>mesa: Stop clamping stencil reference value at specification time</li>
<li>mesa: Use accessor for stencil reference values in glGet</li>
</ul>
<p>Chí-Thanh Christopher Nguyễn (1):</p>
<ul>
<li>targets/dri-i915: Force c++ linker in all cases</li>
</ul>
<p>Daniel Martin (1):</p>
<ul>
<li>Fix build of swrast only without libdrm</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>i965: fix problem with constant out of bounds access (v3)</li>
</ul>
<p>Eric Anholt (10):</p>
<ul>
<li>mesa: Make core Mesa allocate the texture renderbuffer wrapper.</li>
<li>mesa: Make gl_renderbuffers backed by EGL images use FinishRenderTexture.</li>
<li>i965/fs: Bake regs_written into the IR instead of recomputing it later.</li>
<li>i965/vs: Fix implied_mrf_writes() for integer division pre-gen6.</li>
<li>intel: Add support for writing to our linear-temporary-CPU-map case.</li>
<li>intel: Do temporary CPU maps of textures that are too big to GTT map.</li>
<li>intel: Avoid making tiled miptrees we won't be able to blit.</li>
<li>intel: Fix MRT handling of glBitmap().</li>
<li>intel: Fix format handling of blit glBitmap()</li>
<li>i965: Shut up the last release build warning.</li>
</ul>
<p>Fabian Bieler (2):</p>
<ul>
<li>mesa/st: Don't copy propagate from swizzles.</li>
<li>mesa/program: Don't copy propagate from swizzles.</li>
</ul>
<p>Frank Henigman (1):</p>
<ul>
<li>intel: initialize fs_visitor::params_remap in constructor</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>docs: Add 9.1.3 release md5sums</li>
<li>mesa: Bump version to 9.1.4</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>scons: Fix implicit python dependency discovery on Windows.</li>
</ul>
<p>Kenneth Graunke (17):</p>
<ul>
<li>mesa: Add i965 varying index patches to .cherry-ignore.</li>
<li>i965: Turn brw-&gt;urb.vs_size and gs_size into local variables.</li>
<li>i965: Use a variable for the push constant size in kB.</li>
<li>i965: Update URB partitioning code for Haswell's GT3 variant.</li>
<li>i965: Add chipset limits for the Haswell GT3 variant.</li>
<li>i965: Enable the Bay Trail platform.</li>
<li>mesa: Add a reverted commit to cherry-ignore.</li>
<li>vbo: Ignore PRIMITIVE_RESTART_FIXED_INDEX for glDrawArrays().</li>
<li>mesa: Add a helper function for determining the restart index.</li>
<li>vbo: Use the new primitive restart index helper function.</li>
<li>i965: Use the correct restart index for fixed index mode on Haswell.</li>
<li>mesa: Cherry-ignore a patch that got picked but squashed.</li>
<li>i965: Fix can_cut_index_handle_restart_index() for byte/short types.</li>
<li>st/mesa: Go back to using ctx-&gt;Array.RestartIndex, not _RestartIndex.</li>
<li>mesa: Ignore fixed-index primitive restart in ArrayElement().</li>
<li>mesa: Delete the ctx-&gt;Array._RestartIndex derived state.</li>
<li>glsl: Bail on parsing if the #version directive is bogus.</li>
</ul>
<p>Lauri Kasanen (1):</p>
<ul>
<li>r600g: Correctly initialize the shader key, v2</li>
</ul>
<p>Maarten Lankhorst (4):</p>
<ul>
<li>nvc0: fix up video buffer alignment requirements</li>
<li>nvc0: kill assert in ppp code</li>
<li>nvc0: set rsvd_kick correctly</li>
<li>nvc0: allow frame dropping in h264</li>
</ul>
<p>Marek Olšák (7):</p>
<ul>
<li>radeonsi: increase array size for shader inputs and outputs</li>
<li>vbo: fix possible use-after-free segfault after a VAO is deleted</li>
<li>glsl: fix the value of gl_MaxFragmentUniformVectors</li>
<li>st/mesa: initialize all program constants and UBO limits</li>
<li>st/mesa: initialize Const.MaxColorAttachments</li>
<li>st/mesa: fix a couple of issues in st_bind_ubos</li>
<li>mesa: declare UniformBufferBindings as an array with a static size</li>
</ul>
<p>Matt Turner (3):</p>
<ul>
<li>configure.ac: Remove redundant checks of enable_dri.</li>
<li>configure.ac: Build dricommon for DRI gallium drivers</li>
<li>i965: NULL check depth_mt to quiet static analysis.</li>
</ul>
<p>Michel Dänzer (3):</p>
<ul>
<li>radeonsi: Fix handling of TGSI_SEMANTIC_PSIZE</li>
<li>radeonsi: Fix user clip planes</li>
<li>mesa: Note that two radeonsi fixes cannot be backported after all</li>
</ul>
<p>Mike Stroyan (1):</p>
<ul>
<li>configure.ac: Build dricommon for gallium swrast</li>
</ul>
<p>Naohiro Aota (1):</p>
<ul>
<li>xmlpool/build: Make sure to set mo properly</li>
</ul>
<p>Paul Berry (2):</p>
<ul>
<li>glsl: Fix error checking on "flat" keyword to match GLSL ES 3.00, GLSL 1.50.</li>
<li>i965/gen7.5: Allow HW primitive restart for all primitive types.</li>
</ul>
<p>Paulo Zanoni (1):</p>
<ul>
<li>i965: make GT3 machines work as GT3 instead of GT2</li>
</ul>
<p>Rodrigo Vivi (2):</p>
<ul>
<li>i965: Add missing Haswell GT3 Desktop to IS_HSW_GT3 check.</li>
<li>i965: Adding more reserved PCI IDs for Haswell.</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix out-of-bounds access with mirror_clamp_to_edge address mode</li>
</ul>
<p>Stéphane Marchesin (2):</p>
<ul>
<li>st/xlib: Fix upside down coordinates for CopySubBuffer</li>
<li>st/xlib: Flush the front buffer before doing CopySubBuffer</li>
</ul>
<p>Sven Joachim (1):</p>
<ul>
<li>mesa: Fix ieee fp on Alpha</li>
</ul>
<p>Tapani Pälli (1):</p>
<ul>
<li>mesa: fix type comparison errors in sub-texture error checking code</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>gallivm: Fix build with LLVM &gt;= r180063</li>
<li>r300g/compiler: Prevent regalloc from swizzling texture operands v2</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>radeon: Initialize variables in radeon_llvm_context_init.</li>
</ul>
</div>
</body>
</html>

140
docs/relnotes-9.1.5.html Normal file
View File

@@ -0,0 +1,140 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.5 Release Notes / July 17, 2013</h1>
<p>
Mesa 9.1.5 is a bug fix release which fixes bugs found since the 9.1.4 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
4ed2af5943141a85a21869053a2fc2eb MesaLib-9.1.5.tar.bz2
47181066acf3231d74e027b2033f9455 MesaLib-9.1.5.tar.gz
4c9c6615bd99215325250f87ed34058f MesaLib-9.1.5.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=58384">Bug 58384</a> - [i965 Bisected]Oglc max_values(advanced.fragmentProgram.GL_MAX_PROGRAM_ENV_PARAMETERS_ARB) segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62647">Bug 62647</a> - Wrong rendering of Dota 2 on Wine (apitrace attached) - Intel IVB HD4000</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63674">Bug 63674</a> - [IVB]frozen at the first frame when run Unigine-heaven 4.0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65910">Bug 65910</a> - Killing weston-launch causes segv in desktop-shell</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-9.1.4..mesa-9.1.5
</pre>
<p>Anuj Phogat (1):</p>
<ul>
<li>mesa: Return ZeroVec/dummyReg instead of NULL pointer</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>svga: check for NaN shader immediates</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>cherry-ignore: Ignore previously backported patch</li>
<li>cherry-ignore: Drop two patches which we've decided not to include</li>
<li>mesa: Bump version to 9.1.5</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965: fix alpha test for MRT</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>r600g: x/y coordinates must be divided by block dim in dma blit</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>ra: Fix register spilling.</li>
</ul>
<p>Ian Romanick (6):</p>
<ul>
<li>docs: Add 9.1.4 release md5sums</li>
<li>glsl: Add a gl_shader_program parameter to _mesa_uniform_{merge,split}_location_offset</li>
<li>glsl: Add gl_shader_program::UniformLocationBaseScale</li>
<li>glsl: Generate smaller values for uniform locations</li>
<li>i965: Be more careful with the interleaved user array upload optimization</li>
<li>glsl: Move all var decls to the front of the IR list in reverse order</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>glsl/builtins: Fix ARB_texture_cube_map_array built-in availability.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>wayland: Handle global_remove event as well</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>register_allocate: Fix the type of best_benefit.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>glsl ES: Fix magnitude of gl_MaxVertexUniformVectors.</li>
</ul>
<p>Richard Sandiford (3):</p>
<ul>
<li>st/xlib Fix XIMage bytes-per-pixel calculation</li>
<li>st/xlib: Fix XImage stride calculation</li>
<li>st/dri/sw: Fix pitch calculation in drisw_update_tex_buffer</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>swrast: Fix memory leak.</li>
</ul>
</div>
</body>
</html>

168
docs/relnotes-9.1.6.html Normal file
View File

@@ -0,0 +1,168 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.6 Release Notes / August 1, 2013</h1>
<p>
Mesa 9.1.6 is a bug fix release which fixes bugs found since the 9.1.5 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
443a2a352667294b53d56cb1a74114e9 MesaLib-9.1.6.tar.bz2
08d3069cccd6821e5f33e0840bca0718 MesaLib-9.1.6.tar.gz
90aa7a6d9878cdbfcb055312f356d6b9 MesaLib-9.1.6.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=47824">Bug 47824</a> - osmesa using --enable-shared-glapi depends on libgl</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62362">Bug 62362</a> - Crash when using Wayland EGL platform</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63435">Bug 63435</a> - [Regression since 9.0] Flickering in EGL OpenGL full-screen window with swap interval 1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64087">Bug 64087</a> - Webgl conformance shader-with-non-reserved-words crash when mesa is compiled without --enable-debug</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64330">Bug 64330</a> - WebGL snake demo crash in loop_analysis.cpp:506: bool is_loop_terminator(ir_if*): assertion „inst != __null“ failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65236">Bug 65236</a> - [i965] Rendering artifacts in VDrift/GL2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66558">Bug 66558</a> - RS690: 3D artifacts when playing SuperTuxKart</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66847">Bug 66847</a> - compilation broken with llvm 3.3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66850">Bug 66850</a> - glGenerateMipmap crashes when using GL_TEXTURE_2D_ARRAY with compressed internal format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66921">Bug 66921</a> - [r300g] Heroes of Newerth: HiZ related corruption</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67283">Bug 67283</a> - VDPAU doesn't work on hybrid laptop through DRI_PRIME</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-9.1.5..mesa-9.1.6
</pre>
<p>Andreas Boll (1):</p>
<ul>
<li>configure.ac: Require llvm-3.2 for r600g/radeonsi llvm backends</li>
</ul>
<p>Brian Paul (4):</p>
<ul>
<li>mesa: handle 2D texture arrays in get_tex_rgba_compressed()</li>
<li>meta: handle 2D texture arrays in decompress_texture_image()</li>
<li>mesa: implement mipmap generation for compressed 2D array textures</li>
<li>mesa: improve free() cleanup in generate_mipmap_compressed()</li>
</ul>
<p>Carl Worth (7):</p>
<ul>
<li>docs: Add 9.1.5 release md5sums</li>
<li>Merge 'origin/9.1' into stable</li>
<li>cherry-ignore: Drop 13 patches from the pick list</li>
<li>get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list</li>
<li>get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"</li>
<li>get-pick-list: Ignore commits which CC mesa-stable unless they say "9.1"</li>
<li>Bump version to 9.1.6</li>
</ul>
<p>Chris Forbes (5):</p>
<ul>
<li>i965/Gen4: Zero extra coordinates for ir_tex</li>
<li>i965/vs: Fix flaky texture swizzling</li>
<li>i965/vs: set up sampler state pointer for Gen4/5.</li>
<li>i965/vs: Put lod parameter in the correct place for Gen4</li>
<li>i965/vs: Gen4/5: enable front colors if back colors are written</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>nv50,nvc0: s/uint16/uint32 for constant buffer offset</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>gallium/vl: add prime support</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>egl: Restore "bogus" DRI2 invalidate event code.</li>
</ul>
<p>Jeremy Huddleston Sequoia (1):</p>
<ul>
<li>Apple: glFlush() is not needed with CGLFlushDrawable()</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>glsl: Classify "layout" like other identifiers.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>egl-wayland: Fix left-over wl_display_roundtrip() usage</li>
</ul>
<p>Maarten Lankhorst (2):</p>
<ul>
<li>osmesa: link against static libglapi library too to get the gl exports</li>
<li>nvc0: force use of correct firmware file</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>r300g/swtcl: fix geometry corruption by uploading indices to a buffer</li>
<li>r300g/swtcl: fix a lockup in MSAA resolve</li>
<li>Revert "r300g: allow HiZ with a 16-bit zbuffer"</li>
<li>r600g: increase array size for shader inputs and outputs</li>
</ul>
<p>Matt Turner (2):</p>
<ul>
<li>i965: NULL check prog on shader compilation failure.</li>
<li>i965/vs: Print error if vertex shader fails to compile.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>glsl: Handle empty if statement encountered during loop analysis.</li>
</ul>
</div>
</body>
</html>

168
docs/relnotes-9.1.7.html Normal file
View File

@@ -0,0 +1,168 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.7 Release Notes / October 4, 2013</h1>
<p>
Mesa 9.1.7 is a bug fix release which fixes bugs found since the 9.1.6 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
9e4abf7b7a6db762012c3c9917a8e8c7 MesaLib-9.1.7.tar.bz2
f1d4d479d6ce12b9566fdb379960a912 MesaLib-9.1.7.tar.gz
abd612bfc5dd478d04fcc630dd7672f2 MesaLib-9.1.7.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=55503">Bug 55503</a> - Constant vertex attributes broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61635">Bug 61635</a> - glVertexAttribPointer(id, GL_UNSIGNED_BYTE, GL_FALSE,...) does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65958">Bug 65958</a> - GPU Lockup on Trinity 7500G</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66292">Bug 66292</a> - [SNB/IVB/HSW Bisected]Ogles3conform GL3Tests_depth24_depth24_basic.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67548">Bug 67548</a> - glGetAttribLocation seems to be broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68195">Bug 68195</a> - piglit tests vs-struct-pad and fs-struct-pad both fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68250">Bug 68250</a> - Automatic mipmap generation with texture compression produces borders that fade to black</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69525">Bug 69525</a> - [GM45, bisected] Piglit tex-shadow2drect fails</li>
</ul>
<h2>Changes</h2>
<p>Alex Deucher (2):</p>
<ul>
<li>r600g: disable GPUVM by default</li>
<li>radeon/winsys: pad IBs to a multiple of 8 DWs</li>
</ul>
<p>Andreas Boll (2):</p>
<ul>
<li>docs: Fix a typo in the 9.1.6 release notes</li>
<li>mesa: Fix MESA_PATCH version</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>meta: Fix blitting a framebuffer with renderbuffer attachment</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>docs: Add 9.1.6 release md5sums</li>
<li>Use -Bsymbolic when linking libEGL.so</li>
<li>Update get-pick-list to look specifically for "9.1" in NOTE</li>
<li>cherry-ignore: Ignore last two patches in current get-pick-list output</li>
<li>Bump version to 9.1.7</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965/fs: Gen4: Zero out extra coordinates when using shadow compare</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>nv50: handle pure integer vertex attributes</li>
<li>nouveau: initialise the nouveau_transfer maps</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/gen4: Fix fragment program rectangle texture shadow compares.</li>
</ul>
<p>Ian Romanick (11):</p>
<ul>
<li>mesa: Remove stray debug printfs in attachment completeness code</li>
<li>mesa: Validate the layer selection of an array texture too</li>
<li>mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts</li>
<li>glsl: Add new overload of program_resource_visitor::visit_field method</li>
<li>glsl: Use alignment of container record for its first field</li>
<li>mesa: Remove all traces of GL_OES_matrix_get</li>
<li>mesa: Don't call driver RenderTexture for really broken textures</li>
<li>mesa: Don't call driver RenderTexture for invalid zoffset</li>
<li>mesa: Generate a renderbuffer wrapper even if the texture has no image</li>
<li>glsl: Move and refine test for unsized arrays in GLSL ES</li>
<li>mesa: Don't return any data for GL_SHADER_BINARY_FORMATS</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv30: U8_USCALED only works for size 4</li>
<li>nv30: remove no-longer-used formats from table</li>
</ul>
<p>Joakim Sindholt (1):</p>
<ul>
<li>nvc0: fix blitctx memory leak</li>
</ul>
<p>Johannes Obermayr (1):</p>
<ul>
<li>st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>meta: Set correct viewport and projection in decompress_texture_image.</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>nvc0: restore viewport after blit</li>
</ul>
<p>Rico Schüller (1):</p>
<ul>
<li>glx: Initialize OpenGL version to 1.0</li>
</ul>
<p>Tiziano Bacocco (1):</p>
<ul>
<li>nvc0/ir: fix use after free in texture barrier insertion pass</li>
</ul>
<p>Torsten Duwe (1):</p>
<ul>
<li>wayland-egl.pc requires wayland-client.pc.</li>
</ul>
</div>
</body>
</html>

View File

@@ -14,7 +14,7 @@
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1 Release Notes / date TBD</h1>
<h1>Mesa 9.1 Release Notes / February 22, 2013</h1>
<p>
Mesa 9.1 is a new development release.
@@ -33,7 +33,9 @@ because GL_ARB_compatibility is not supported.
<h2>MD5 checksums</h2>
<pre>
tbd
86d40f3056f89949368764bf84aff55e MesaLib-9.1.tar.gz
d3891e02215422e120271d976ff1947e MesaLib-9.1.tar.bz2
01645f28f53351c23b0beb6c688911d8 MesaLib-9.1.zip
</pre>
@@ -44,9 +46,19 @@ Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ANGLE_texture_compression_dxt3</li>
<li>GL_ANGLE_texture_compression_dxt5</li>
<li>GL_ARB_ES3_compatibility</li>
<li>GL_ARB_internalformat_query</li>
<li>GL_ARB_map_buffer_alignment</li>
<li>GL_ARB_texture_cube_map_array</li>
<li>GL_ARB_shading_language_packing</li>
<li>GL_ARB_texture_buffer_object_rgb32</li>
<li>GL_ARB_texture_cube_map_array</li>
<li>GL_EXT_color_buffer_float</li>
<li>GL_OES_depth_texture_cube_map</li>
<li>OpenGL 3.1 core profile support on Radeon HD2000 up to HD6000 series </li>
<li>Multisample anti-aliasing support on Radeon X1000 series</li>
<li>OpenGL ES 3.0 support on Intel HD Graphics 2000, 2500, 3000, and 4000</li>
</ul>
@@ -63,6 +75,7 @@ Note: some of the new features are only available with certain drivers.
<li>Removed swrast support for GL_NV_vertex_program</li>
<li>Removed swrast support for GL_NV_fragment_program</li>
<li>Removed OpenVMS support (unmaintained and broken)</li>
<li>Removed makedepend build dependency</li>
</ul>
</div>

View File

@@ -22,6 +22,7 @@ The release notes summarize what's new or changed in each Mesa release.
<ul>
<li><a href="relnotes-9.1.html">9.1 release notes</a>
<li><a href="relnotes-9.0.3.html">9.0.3 release notes</a>
<li><a href="relnotes-9.0.2.html">9.0.2 release notes</a>
<li><a href="relnotes-9.0.1.html">9.0.1 release notes</a>
<li><a href="relnotes-9.0.html">9.0 release notes</a>

147
include/c99_compat.h Normal file
View File

@@ -0,0 +1,147 @@
/**************************************************************************
*
* Copyright 2007-2013 VMware, 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 _C99_COMPAT_H_
#define _C99_COMPAT_H_
/*
* MSVC hacks.
*/
#if defined(_MSC_VER)
/*
* Visual Studio 2012 will complain if we define the `inline` keyword, but
* actually it only supports the keyword on C++.
*
* We could skip this check by defining _ALLOW_KEYWORD_MACROS, but there is
* probably value in checking this for other keywords. So simply include
* the checking before we define it below.
*/
# if _MSC_VER >= 1700
# include <xkeycheck.h>
# endif
/*
* XXX: MSVC has a `__restrict` keyword, but it also has a
* `__declspec(restrict)` modifier, so it is impossible to define a
* `restrict` macro without interfering with the latter. Furthermore the
* MSVC standard library uses __declspec(restrict) under the _CRTRESTRICT
* macro. For now resolve this issue by redefining _CRTRESTRICT, but going
* forward we should probably should stop using restrict, especially
* considering that our code does not obbey strict aliasing rules any way.
*/
# include <crtdefs.h>
# undef _CRTRESTRICT
# define _CRTRESTRICT
#endif
/*
* C99 inline keyword
*/
#ifndef inline
# ifdef __cplusplus
/* C++ supports inline keyword */
# elif defined(__GNUC__)
# define inline __inline__
# elif defined(_MSC_VER)
# define inline __inline
# elif defined(__ICL)
# define inline __inline
# elif defined(__INTEL_COMPILER)
/* Intel compiler supports inline keyword */
# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
# define inline __inline
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
/* C99 supports inline keyword */
# elif (__STDC_VERSION__ >= 199901L)
/* C99 supports inline keyword */
# else
# define inline
# endif
#endif
/*
* C99 restrict keyword
*
* See also:
* - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
*/
#ifndef restrict
# if (__STDC_VERSION__ >= 199901L)
/* C99 */
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
/* C99 */
# elif defined(__GNUC__)
# define restrict __restrict__
# elif defined(_MSC_VER)
# define restrict __restrict
# else
# define restrict /* */
# endif
#endif
/*
* C99 __func__ macro
*/
#ifndef __func__
# if (__STDC_VERSION__ >= 199901L)
/* C99 */
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
/* C99 */
# elif defined(__GNUC__)
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
# else
# define __func__ "<unknown>"
# endif
# elif defined(_MSC_VER)
# if _MSC_VER >= 1300
# define __func__ __FUNCTION__
# else
# define __func__ "<unknown>"
# endif
# else
# define __func__ "<unknown>"
# endif
#endif
/* Simple test case for debugging */
#if 0
static inline const char *
test_c99_compat_h(const void * restrict a,
const void * restrict b)
{
return __func__;
}
#endif
#endif /* _C99_COMPAT_H_ */

View File

@@ -28,37 +28,66 @@ CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)
CHIPSET(0x016a, IVYBRIDGE_S_GT2, ivb_gt2)
CHIPSET(0x0402, HASWELL_GT1, hsw_gt1)
CHIPSET(0x0412, HASWELL_GT2, hsw_gt2)
CHIPSET(0x0422, HASWELL_GT2_PLUS, hsw_gt2)
CHIPSET(0x0422, HASWELL_GT3, hsw_gt3)
CHIPSET(0x0406, HASWELL_M_GT1, hsw_gt1)
CHIPSET(0x0416, HASWELL_M_GT2, hsw_gt2)
CHIPSET(0x0426, HASWELL_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0426, HASWELL_M_GT3, hsw_gt3)
CHIPSET(0x040A, HASWELL_S_GT1, hsw_gt1)
CHIPSET(0x041A, HASWELL_S_GT2, hsw_gt2)
CHIPSET(0x042A, HASWELL_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x042A, HASWELL_S_GT3, hsw_gt3)
CHIPSET(0x040B, HASWELL_B_GT1, hsw_gt1)
CHIPSET(0x041B, HASWELL_B_GT2, hsw_gt2)
CHIPSET(0x042B, HASWELL_B_GT3, hsw_gt3)
CHIPSET(0x040E, HASWELL_E_GT1, hsw_gt1)
CHIPSET(0x041E, HASWELL_E_GT2, hsw_gt2)
CHIPSET(0x042E, HASWELL_E_GT3, hsw_gt3)
CHIPSET(0x0C02, HASWELL_SDV_GT1, hsw_gt1)
CHIPSET(0x0C12, HASWELL_SDV_GT2, hsw_gt2)
CHIPSET(0x0C22, HASWELL_SDV_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C22, HASWELL_SDV_GT3, hsw_gt3)
CHIPSET(0x0C06, HASWELL_SDV_M_GT1, hsw_gt1)
CHIPSET(0x0C16, HASWELL_SDV_M_GT2, hsw_gt2)
CHIPSET(0x0C26, HASWELL_SDV_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C26, HASWELL_SDV_M_GT3, hsw_gt3)
CHIPSET(0x0C0A, HASWELL_SDV_S_GT1, hsw_gt1)
CHIPSET(0x0C1A, HASWELL_SDV_S_GT2, hsw_gt2)
CHIPSET(0x0C2A, HASWELL_SDV_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C2A, HASWELL_SDV_S_GT3, hsw_gt3)
CHIPSET(0x0C0B, HASWELL_SDV_B_GT1, hsw_gt1)
CHIPSET(0x0C1B, HASWELL_SDV_B_GT2, hsw_gt2)
CHIPSET(0x0C2B, HASWELL_SDV_B_GT3, hsw_gt3)
CHIPSET(0x0C0E, HASWELL_SDV_E_GT1, hsw_gt1)
CHIPSET(0x0C1E, HASWELL_SDV_E_GT2, hsw_gt2)
CHIPSET(0x0C2E, HASWELL_SDV_E_GT3, hsw_gt3)
CHIPSET(0x0A02, HASWELL_ULT_GT1, hsw_gt1)
CHIPSET(0x0A12, HASWELL_ULT_GT2, hsw_gt2)
CHIPSET(0x0A22, HASWELL_ULT_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A22, HASWELL_ULT_GT3, hsw_gt3)
CHIPSET(0x0A06, HASWELL_ULT_M_GT1, hsw_gt1)
CHIPSET(0x0A16, HASWELL_ULT_M_GT2, hsw_gt2)
CHIPSET(0x0A26, HASWELL_ULT_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A26, HASWELL_ULT_M_GT3, hsw_gt3)
CHIPSET(0x0A0A, HASWELL_ULT_S_GT1, hsw_gt1)
CHIPSET(0x0A1A, HASWELL_ULT_S_GT2, hsw_gt2)
CHIPSET(0x0A2A, HASWELL_ULT_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D12, HASWELL_CRW_GT1, hsw_gt1)
CHIPSET(0x0D22, HASWELL_CRW_GT2, hsw_gt2)
CHIPSET(0x0D32, HASWELL_CRW_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D16, HASWELL_CRW_M_GT1, hsw_gt1)
CHIPSET(0x0D26, HASWELL_CRW_M_GT2, hsw_gt2)
CHIPSET(0x0D36, HASWELL_CRW_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D1A, HASWELL_CRW_S_GT1, hsw_gt1)
CHIPSET(0x0D2A, HASWELL_CRW_S_GT2, hsw_gt2)
CHIPSET(0x0D3A, HASWELL_CRW_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A2A, HASWELL_ULT_S_GT3, hsw_gt3)
CHIPSET(0x0A0B, HASWELL_ULT_B_GT1, hsw_gt1)
CHIPSET(0x0A1B, HASWELL_ULT_B_GT2, hsw_gt2)
CHIPSET(0x0A2B, HASWELL_ULT_B_GT3, hsw_gt3)
CHIPSET(0x0A0E, HASWELL_ULT_E_GT1, hsw_gt1)
CHIPSET(0x0A1E, HASWELL_ULT_E_GT2, hsw_gt2)
CHIPSET(0x0A2E, HASWELL_ULT_E_GT3, hsw_gt3)
CHIPSET(0x0D02, HASWELL_CRW_GT1, hsw_gt1)
CHIPSET(0x0D12, HASWELL_CRW_GT2, hsw_gt2)
CHIPSET(0x0D22, HASWELL_CRW_GT3, hsw_gt3)
CHIPSET(0x0D06, HASWELL_CRW_M_GT1, hsw_gt1)
CHIPSET(0x0D16, HASWELL_CRW_M_GT2, hsw_gt2)
CHIPSET(0x0D26, HASWELL_CRW_M_GT3, hsw_gt3)
CHIPSET(0x0D0A, HASWELL_CRW_S_GT1, hsw_gt1)
CHIPSET(0x0D1A, HASWELL_CRW_S_GT2, hsw_gt2)
CHIPSET(0x0D2A, HASWELL_CRW_S_GT3, hsw_gt3)
CHIPSET(0x0D0B, HASWELL_CRW_B_GT1, hsw_gt1)
CHIPSET(0x0D1B, HASWELL_CRW_B_GT2, hsw_gt2)
CHIPSET(0x0D2B, HASWELL_CRW_B_GT3, hsw_gt3)
CHIPSET(0x0D0E, HASWELL_CRW_E_GT1, hsw_gt1)
CHIPSET(0x0D1E, HASWELL_CRW_E_GT2, hsw_gt2)
CHIPSET(0x0D2E, HASWELL_CRW_E_GT3, hsw_gt3)
CHIPSET(0x0F31, BAYTRAIL_M_1, byt)
CHIPSET(0x0F32, BAYTRAIL_M_2, byt)
CHIPSET(0x0F33, BAYTRAIL_M_3, byt)
CHIPSET(0x0157, BAYTRAIL_M_4, byt)
CHIPSET(0x0155, BAYTRAIL_D, byt)

View File

@@ -298,6 +298,10 @@ CHIPSET(0x9907, ARUBA_9907, ARUBA)
CHIPSET(0x9908, ARUBA_9908, ARUBA)
CHIPSET(0x9909, ARUBA_9909, ARUBA)
CHIPSET(0x990A, ARUBA_990A, ARUBA)
CHIPSET(0x990B, ARUBA_990B, ARUBA)
CHIPSET(0x990C, ARUBA_990C, ARUBA)
CHIPSET(0x990D, ARUBA_990D, ARUBA)
CHIPSET(0x990E, ARUBA_990E, ARUBA)
CHIPSET(0x990F, ARUBA_990F, ARUBA)
CHIPSET(0x9910, ARUBA_9910, ARUBA)
CHIPSET(0x9913, ARUBA_9913, ARUBA)
@@ -309,6 +313,15 @@ CHIPSET(0x9991, ARUBA_9991, ARUBA)
CHIPSET(0x9992, ARUBA_9992, ARUBA)
CHIPSET(0x9993, ARUBA_9993, ARUBA)
CHIPSET(0x9994, ARUBA_9994, ARUBA)
CHIPSET(0x9995, ARUBA_9995, ARUBA)
CHIPSET(0x9996, ARUBA_9996, ARUBA)
CHIPSET(0x9997, ARUBA_9997, ARUBA)
CHIPSET(0x9998, ARUBA_9998, ARUBA)
CHIPSET(0x9999, ARUBA_9999, ARUBA)
CHIPSET(0x999A, ARUBA_999A, ARUBA)
CHIPSET(0x999B, ARUBA_999B, ARUBA)
CHIPSET(0x999C, ARUBA_999C, ARUBA)
CHIPSET(0x999D, ARUBA_999D, ARUBA)
CHIPSET(0x99A0, ARUBA_99A0, ARUBA)
CHIPSET(0x99A2, ARUBA_99A2, ARUBA)
CHIPSET(0x99A4, ARUBA_99A4, ARUBA)

View File

@@ -28,6 +28,7 @@ CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN)
CHIPSET(0x6820, VERDE_6820, VERDE)
CHIPSET(0x6821, VERDE_6821, VERDE)
CHIPSET(0x6822, VERDE_6822, VERDE)
CHIPSET(0x6823, VERDE_6823, VERDE)
CHIPSET(0x6824, VERDE_6824, VERDE)
CHIPSET(0x6825, VERDE_6825, VERDE)
@@ -35,14 +36,37 @@ CHIPSET(0x6826, VERDE_6826, VERDE)
CHIPSET(0x6827, VERDE_6827, VERDE)
CHIPSET(0x6828, VERDE_6828, VERDE)
CHIPSET(0x6829, VERDE_6829, VERDE)
CHIPSET(0x682A, VERDE_682A, VERDE)
CHIPSET(0x682B, VERDE_682B, VERDE)
CHIPSET(0x682D, VERDE_682D, VERDE)
CHIPSET(0x682F, VERDE_682F, VERDE)
CHIPSET(0x6830, VERDE_6830, VERDE)
CHIPSET(0x6831, VERDE_6831, VERDE)
CHIPSET(0x6835, VERDE_6835, VERDE)
CHIPSET(0x6837, VERDE_6837, VERDE)
CHIPSET(0x6838, VERDE_6838, VERDE)
CHIPSET(0x6839, VERDE_6839, VERDE)
CHIPSET(0x683B, VERDE_683B, VERDE)
CHIPSET(0x683D, VERDE_683D, VERDE)
CHIPSET(0x683F, VERDE_683F, VERDE)
CHIPSET(0x6600, OLAND_6600, OLAND)
CHIPSET(0x6601, OLAND_6601, OLAND)
CHIPSET(0x6602, OLAND_6602, OLAND)
CHIPSET(0x6603, OLAND_6603, OLAND)
CHIPSET(0x6606, OLAND_6606, OLAND)
CHIPSET(0x6607, OLAND_6607, OLAND)
CHIPSET(0x6610, OLAND_6610, OLAND)
CHIPSET(0x6611, OLAND_6611, OLAND)
CHIPSET(0x6613, OLAND_6613, OLAND)
CHIPSET(0x6620, OLAND_6620, OLAND)
CHIPSET(0x6621, OLAND_6621, OLAND)
CHIPSET(0x6623, OLAND_6623, OLAND)
CHIPSET(0x6631, OLAND_6631, OLAND)
CHIPSET(0x6660, HAINAN_6660, HAINAN)
CHIPSET(0x6663, HAINAN_6663, HAINAN)
CHIPSET(0x6664, HAINAN_6664, HAINAN)
CHIPSET(0x6665, HAINAN_6665, HAINAN)
CHIPSET(0x6667, HAINAN_6667, HAINAN)
CHIPSET(0x666F, HAINAN_666F, HAINAN)

View File

@@ -95,7 +95,7 @@ def createConvenienceLibBuilder(env):
# TODO: handle import statements with multiple modules
# TODO: handle from import statements
import_re = re.compile(r'^import\s+(\S+)$', re.M)
import_re = re.compile(r'^\s*import\s+(\S+)\s*$', re.M)
def python_scan(node, env, path):
# http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
@@ -113,6 +113,7 @@ def python_scan(node, env, path):
if os.path.exists(file):
results.append(env.File(file))
break
#print node, map(str, results)
return results
python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])

View File

@@ -289,6 +289,7 @@ def generate(env):
'_CRT_SECURE_NO_DEPRECATE',
'_SCL_SECURE_NO_WARNINGS',
'_SCL_SECURE_NO_DEPRECATE',
'_ALLOW_KEYWORD_MACROS',
]
if env['build'] in ('debug', 'checked'):
cppdefines += ['_DEBUG']
@@ -401,6 +402,8 @@ def generate(env):
'/Oi', # enable intrinsic functions
]
else:
if distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('11.0'):
print 'scons: warning: Visual Studio versions prior to 2012 are known to produce incorrect code when optimizations are enabled ( https://bugs.freedesktop.org/show_bug.cgi?id=58718 )'
ccflags += [
'/O2', # optimize for speed
]
@@ -530,7 +533,7 @@ def generate(env):
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
env.PkgCheckModules('DRM', ['libdrm >= 2.4.24'])
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.30'])
env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon >= 2.4.40'])
env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon >= 2.4.42'])
env.PkgCheckModules('XORG', ['xorg-server >= 1.6.0'])
env.PkgCheckModules('KMS', ['libkms >= 2.4.24'])
env.PkgCheckModules('UDEV', ['libudev > 150'])

View File

@@ -92,7 +92,19 @@ def generate(env):
'HAVE_STDINT_H',
])
env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
if llvm_version >= distutils.version.LooseVersion('3.0'):
if llvm_version >= distutils.version.LooseVersion('3.2'):
# 3.2
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMJIT',
'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject'
])
elif llvm_version >= distutils.version.LooseVersion('3.0'):
# 3.0
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',

View File

@@ -195,7 +195,14 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
for (i = 0; attr_list[i] != EGL_NONE; i += 2)
_eglSetConfigKey(&base, attr_list[i], attr_list[i+1]);
if (depth > 0 && depth != base.BufferSize)
/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig. Otherwise
* it will only match a 32-bit RGBA visual. On a composited window manager
* on X11, this will make all of the EGLConfigs with destination alpha get
* blended by the compositor. This is probably not what the application
* wants... especially on drivers that only have 32-bit RGBA EGLConfigs!
*/
if (depth > 0 && depth != base.BufferSize
&& !(depth == 24 && base.BufferSize == 32))
return NULL;
if (rgba_masks && memcmp(rgba_masks, dri_masks, sizeof(dri_masks)))
@@ -214,6 +221,9 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
base.RenderableType = disp->ClientAPIs;
base.Conformant = disp->ClientAPIs;
base.MinSwapInterval = dri2_dpy->min_swap_interval;
base.MaxSwapInterval = dri2_dpy->max_swap_interval;
if (!_eglValidateConfig(&base, EGL_FALSE)) {
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
return NULL;
@@ -261,9 +271,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
if (double_buffer) {
surface_type &= ~EGL_PIXMAP_BIT;
conf->base.MinSwapInterval = dri2_dpy->min_swap_interval;
conf->base.MaxSwapInterval = dri2_dpy->max_swap_interval;
}
conf->base.SurfaceType |= surface_type;

View File

@@ -338,7 +338,7 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
}
static _EGLImage *
dri2_create_image_android_native_buffer(_EGLDisplay *disp,
dri2_create_image_android_native_buffer(_EGLDisplay *disp, _EGLContext *ctx,
struct ANativeWindowBuffer *buf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -346,6 +346,18 @@ dri2_create_image_android_native_buffer(_EGLDisplay *disp,
int name;
EGLint format;
if (ctx != NULL) {
/* From the EGL_ANDROID_image_native_buffer spec:
*
* * If <target> is EGL_NATIVE_BUFFER_ANDROID and <ctx> is not
* EGL_NO_CONTEXT, the error EGL_BAD_CONTEXT is generated.
*/
_eglError(EGL_BAD_CONTEXT, "eglCreateEGLImageKHR: for "
"EGL_NATIVE_BUFFER_ANDROID, the context must be "
"EGL_NO_CONTEXT");
return NULL;
}
if (!buf || buf->common.magic != ANDROID_NATIVE_BUFFER_MAGIC ||
buf->common.version != sizeof(*buf)) {
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
@@ -417,7 +429,7 @@ droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
{
switch (target) {
case EGL_NATIVE_BUFFER_ANDROID:
return dri2_create_image_android_native_buffer(disp,
return dri2_create_image_android_native_buffer(disp, ctx,
(struct ANativeWindowBuffer *) buffer);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);

View File

@@ -446,6 +446,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
__DRIbuffer buffer;
int i, ret = 0;
while (dri2_surf->frame_callback && ret != -1)
@@ -463,6 +464,13 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
/* Make sure we have a back buffer in case we're swapping without ever
* rendering. */
if (get_back_bo(dri2_surf, &buffer) < 0) {
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
return EGL_FALSE;
}
dri2_surf->back->age = 1;
dri2_surf->current = dri2_surf->back;
dri2_surf->back = NULL;
@@ -635,8 +643,15 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
}
}
static void
registry_handle_global_remove(void *data, struct wl_registry *registry,
uint32_t name)
{
}
static const struct wl_registry_listener registry_listener = {
registry_handle_global
registry_handle_global,
registry_handle_global_remove
};
EGLBoolean

View File

@@ -284,14 +284,15 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
if (surf != NULL) {
/* When we first create the DRI2 drawable, its swap interval on the
* server side is 1.
*/
surf->SwapInterval = 1;
/* When we first create the DRI2 drawable, its swap interval on the server
* side is 1.
*/
surf->SwapInterval = 1;
/* Override that with a driconf-set value. */
drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
/* Override that with a driconf-set value. */
drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
}
return surf;
}
@@ -742,6 +743,20 @@ dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
free(reply);
}
/* Since we aren't watching for the server's invalidate events like we're
* supposed to (due to XCB providing no mechanism for filtering the events
* the way xlib does), and SwapBuffers is a common cause of invalidate
* events, just shove one down to the driver, even though we haven't told
* the driver that we're the kind of loader that provides reliable
* invalidate events. This causes the driver to request buffers again at
* its next draw, so that we get the correct buffers if a pageflip
* happened. The driver should still be using the viewport hack to catch
* window resizes.
*/
if (dri2_dpy->flush &&
dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return swap_count;
}
@@ -1162,6 +1177,8 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_fd;
dri2_setup_swap_interval(dri2_dpy);
if (dri2_dpy->conn) {
if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
@@ -1181,8 +1198,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
disp->VersionMajor = 1;
disp->VersionMinor = 4;
dri2_setup_swap_interval(dri2_dpy);
return EGL_TRUE;
cleanup_configs:

View File

@@ -74,7 +74,7 @@ libEGL_la_SOURCES = \
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
libEGL_la_LDFLAGS = -version-number 1:0 -no-undefined
libEGL_la_LDFLAGS = -Wl,-Bsymbolic -version-number 1:0 -no-undefined
if HAVE_EGL_PLATFORM_X11
AM_CFLAGS += -DHAVE_X11_PLATFORM

View File

@@ -31,6 +31,9 @@
#define EGLCOMPILER_INCLUDED
#include "c99_compat.h" /* inline, __func__, etc. */
/**
* Get standard integer types
*/
@@ -62,30 +65,7 @@
#endif
/**
* Function inlining
*/
#ifndef inline
# ifdef __cplusplus
/* C++ supports inline keyword */
# elif defined(__GNUC__)
# define inline __inline__
# elif defined(_MSC_VER)
# define inline __inline
# elif defined(__ICL)
# define inline __inline
# elif defined(__INTEL_COMPILER)
/* Intel compiler supports inline keyword */
# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
# define inline __inline
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
/* C99 supports inline keyword */
# elif (__STDC_VERSION__ >= 199901L)
/* C99 supports inline keyword */
# else
# define inline
# endif
#endif
/* XXX: Use standard `inline` keyword instead */
#ifndef INLINE
# define INLINE inline
#endif
@@ -104,21 +84,9 @@
# endif
#endif
/**
* The __FUNCTION__ gcc variable is generally only used for debugging.
* If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
* Don't define it if using a newer Windows compiler.
*/
/* XXX: Use standard `__func__` instead */
#ifndef __FUNCTION__
# if (!defined __GNUC__) && (!defined __xlC__) && \
(!defined(_MSC_VER) || _MSC_VER < 1300)
# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
(defined(__SUNPRO_C) && defined(__C99FEATURES__))
# define __FUNCTION__ __func__
# else
# define __FUNCTION__ "<unknown>"
# endif
# endif
# define __FUNCTION__ __func__
#endif
#endif /* EGLCOMPILER_INCLUDED */

View File

@@ -6,5 +6,6 @@ includedir=@includedir@
Name: wayland-egl
Description: Mesa wayland-egl library
Version: @VERSION@
Requires: wayland-client
Libs: -L${libdir} -lwayland-egl
Cflags: -I${includedir}

View File

@@ -7,7 +7,10 @@ noinst_LTLIBRARIES = libgallium.la
AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/auxiliary/util \
$(GALLIUM_CFLAGS)
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
libgallium_la_SOURCES = \
$(C_SOURCES) \
@@ -18,7 +21,7 @@ if HAVE_MESA_LLVM
AM_CFLAGS += \
$(LLVM_CFLAGS)
AM_CXXFLAGS = \
AM_CXXFLAGS += \
$(GALLIUM_CFLAGS) \
$(LLVM_CXXFLAGS)

View File

@@ -167,12 +167,17 @@ static void interp( const struct clip_stage *clip,
{
int k;
t_nopersp = t;
for (k = 0; k < 2; k++)
/* find either in.x != out.x or in.y != out.y */
for (k = 0; k < 2; k++) {
if (in->clip[k] != out->clip[k]) {
t_nopersp = (dst->clip[k] - out->clip[k]) /
(in->clip[k] - out->clip[k]);
/* do divide by W, then compute linear interpolation factor */
float in_coord = in->clip[k] / in->clip[3];
float out_coord = out->clip[k] / out->clip[3];
float dst_coord = dst->clip[k] / dst->clip[3];
t_nopersp = (dst_coord - out_coord) / (in_coord - out_coord);
break;
}
}
}
/* Other attributes

View File

@@ -127,10 +127,44 @@ static void offset_first_tri( struct draw_stage *stage,
struct prim_header *header )
{
struct offset_stage *offset = offset_stage(stage);
const struct pipe_rasterizer_state *rast = stage->draw->rasterizer;
unsigned fill_mode = rast->fill_front;
boolean do_offset;
if (rast->fill_back != rast->fill_front) {
/* Need to check for back-facing triangle */
boolean ccw = header->det < 0.0f;
if (ccw != rast->front_ccw)
fill_mode = rast->fill_back;
}
/* Now determine if we need to do offsetting for the point/line/fill mode */
switch (fill_mode) {
case PIPE_POLYGON_MODE_FILL:
do_offset = rast->offset_tri;
break;
case PIPE_POLYGON_MODE_LINE:
do_offset = rast->offset_line;
break;
case PIPE_POLYGON_MODE_POINT:
do_offset = rast->offset_point;
break;
default:
assert(!"invalid fill_mode in offset_first_tri()");
do_offset = rast->offset_tri;
}
if (do_offset) {
offset->scale = rast->offset_scale;
offset->clamp = rast->offset_clamp;
offset->units = (float) (rast->offset_units * stage->draw->mrd);
}
else {
offset->scale = 0.0f;
offset->clamp = 0.0f;
offset->units = 0.0f;
}
offset->units = (float) (stage->draw->rasterizer->offset_units * stage->draw->mrd);
offset->scale = stage->draw->rasterizer->offset_scale;
offset->clamp = stage->draw->rasterizer->offset_clamp;
stage->tri = offset_tri;
stage->tri( stage, header );

View File

@@ -55,6 +55,10 @@
#include <llvm/MC/MCRegisterInfo.h>
#endif /* HAVE_LLVM >= 0x0301 */
#if HAVE_LLVM >= 0x0303
#include <llvm/ADT/OwningPtr.h>
#endif
#include "util/u_math.h"
#include "util/u_debug.h"

View File

@@ -60,6 +60,12 @@
#include <llvm/Target/TargetSelect.h>
#endif /* HAVE_LLVM < 0x0300 */
#if HAVE_LLVM >= 0x0303
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
#include <llvm/Support/CBindingWrapping.h>
#endif
#include "pipe/p_config.h"
#include "util/u_debug.h"
#include "util/u_cpu_detect.h"

View File

@@ -867,7 +867,7 @@ lp_build_get_level_stride_vec(struct lp_build_sample_context *bld,
stride = bld->int_coord_bld.undef;
for (i = 0; i < bld->num_lods; i++) {
LLVMValueRef indexi = lp_build_const_int32(bld->gallivm, i);
LLVMValueRef indexo = lp_build_const_int32(bld->gallivm, i);
LLVMValueRef indexo = lp_build_const_int32(bld->gallivm, 4 * i);
indexes[1] = LLVMBuildExtractElement(builder, level, indexi, "");
stride1 = LLVMBuildGEP(builder, stride_array, indexes, 2, "");
stride1 = LLVMBuildLoad(builder, stride1, "");

View File

@@ -406,7 +406,6 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
{
LLVMValueRef min, max;
struct lp_build_context abs_coord_bld = bld->coord_bld;
abs_coord_bld.type.sign = FALSE;
coord = lp_build_abs(coord_bld, coord);
@@ -416,16 +415,18 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
coord = lp_build_mul(coord_bld, coord, length_f);
}
/* clamp to [0.5, length - 0.5] */
min = half;
max = lp_build_sub(coord_bld, length_f, min);
coord = lp_build_clamp(coord_bld, coord, min, max);
/* clamp to length max */
coord = lp_build_min(coord_bld, coord, length_f);
/* subtract 0.5 */
coord = lp_build_sub(coord_bld, coord, half);
/* clamp to [0, length - 0.5] */
coord = lp_build_max(coord_bld, coord, coord_bld->zero);
/* convert to int, compute lerp weight */
lp_build_ifloor_fract(&abs_coord_bld, coord, &coord0, &weight);
coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one);
/* coord1 = min(coord1, length-1) */
coord1 = lp_build_min(int_coord_bld, coord1, length_minus_one);
}
break;

View File

@@ -240,6 +240,7 @@ struct lp_exec_mask {
struct lp_build_context *bld;
boolean has_mask;
boolean ret_in_main;
LLVMTypeRef int_vec_type;

View File

@@ -73,6 +73,7 @@ static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context
mask->bld = bld;
mask->has_mask = FALSE;
mask->ret_in_main = FALSE;
mask->cond_stack_size = 0;
mask->loop_stack_size = 0;
mask->call_stack_size = 0;
@@ -108,7 +109,7 @@ static void lp_exec_mask_update(struct lp_exec_mask *mask)
} else
mask->exec_mask = mask->cond_mask;
if (mask->call_stack_size) {
if (mask->call_stack_size || mask->ret_in_main) {
mask->exec_mask = LLVMBuildAnd(builder,
mask->exec_mask,
mask->ret_mask,
@@ -117,7 +118,8 @@ static void lp_exec_mask_update(struct lp_exec_mask *mask)
mask->has_mask = (mask->cond_stack_size > 0 ||
mask->loop_stack_size > 0 ||
mask->call_stack_size > 0);
mask->call_stack_size > 0 ||
mask->ret_in_main);
}
static void lp_exec_mask_cond_push(struct lp_exec_mask *mask,
@@ -348,11 +350,23 @@ static void lp_exec_mask_ret(struct lp_exec_mask *mask, int *pc)
LLVMBuilderRef builder = mask->bld->gallivm->builder;
LLVMValueRef exec_mask;
if (mask->call_stack_size == 0) {
if (mask->cond_stack_size == 0 &&
mask->loop_stack_size == 0 &&
mask->call_stack_size == 0) {
/* returning from main() */
*pc = -1;
return;
}
if (mask->call_stack_size == 0) {
/*
* This requires special handling since we need to ensure
* we don't drop the mask even if we have no call stack
* (e.g. after a ret in a if clause after the endif)
*/
mask->ret_in_main = TRUE;
}
exec_mask = LLVMBuildNot(builder,
mask->exec_mask,
"ret");

View File

@@ -1569,7 +1569,7 @@ tgsi_text_translate(
struct tgsi_token *tokens,
uint num_tokens )
{
struct translate_ctx ctx;
struct translate_ctx ctx = {0};
ctx.text = text;
ctx.cur = text;

View File

@@ -100,7 +100,7 @@ struct blitter_context_priv
void *velem_state;
void *velem_uint_state;
void *velem_sint_state;
void *velem_state_readbuf;
void *velem_state_readbuf[4]; /**< X, XY, XYZ, XYZW */
/* Sampler state. */
void *sampler_state, *sampler_state_linear;
@@ -277,9 +277,19 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
}
if (ctx->has_stream_out) {
velem[0].src_format = PIPE_FORMAT_R32_UINT;
velem[0].vertex_buffer_index = ctx->base.vb_slot;
ctx->velem_state_readbuf = pipe->create_vertex_elements_state(pipe, 1, &velem[0]);
static enum pipe_format formats[4] = {
PIPE_FORMAT_R32_UINT,
PIPE_FORMAT_R32G32_UINT,
PIPE_FORMAT_R32G32B32_UINT,
PIPE_FORMAT_R32G32B32A32_UINT
};
for (i = 0; i < 4; i++) {
velem[0].src_format = formats[i];
velem[0].vertex_buffer_index = ctx->base.vb_slot;
ctx->velem_state_readbuf[i] =
pipe->create_vertex_elements_state(pipe, 1, &velem[0]);
}
}
/* fragment shaders are created on-demand */
@@ -344,8 +354,11 @@ void util_blitter_destroy(struct blitter_context *blitter)
pipe->delete_vertex_elements_state(pipe, ctx->velem_sint_state);
pipe->delete_vertex_elements_state(pipe, ctx->velem_uint_state);
}
if (ctx->velem_state_readbuf)
pipe->delete_vertex_elements_state(pipe, ctx->velem_state_readbuf);
for (i = 0; i < 4; i++) {
if (ctx->velem_state_readbuf[i]) {
pipe->delete_vertex_elements_state(pipe, ctx->velem_state_readbuf[i]);
}
}
for (i = 0; i < PIPE_MAX_TEXTURE_TYPES; i++) {
if (ctx->fs_texfetch_col[i])
@@ -1120,18 +1133,17 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter,
if (dst) {
unsigned bind;
boolean is_stencil;
const struct util_format_description *desc =
util_format_description(dst_format);
is_stencil = util_format_has_stencil(desc);
boolean dst_has_stencil = util_format_has_stencil(desc);
/* Stencil export must be supported for stencil copy. */
if ((mask & PIPE_MASK_S) && is_stencil && !ctx->has_stencil_export) {
if ((mask & PIPE_MASK_S) && dst_has_stencil &&
!ctx->has_stencil_export) {
return FALSE;
}
if (is_stencil || util_format_has_depth(desc))
if (dst_has_stencil || util_format_has_depth(desc))
bind = PIPE_BIND_DEPTH_STENCIL;
else
bind = PIPE_BIND_RENDER_TARGET;
@@ -1153,15 +1165,18 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter,
}
/* Check stencil sampler support for stencil copy. */
if (util_format_has_stencil(util_format_description(src_format))) {
enum pipe_format stencil_format =
if (mask & PIPE_MASK_S) {
if (util_format_has_stencil(util_format_description(src_format))) {
enum pipe_format stencil_format =
util_format_stencil_only(src_format);
assert(stencil_format != PIPE_FORMAT_NONE);
assert(stencil_format != PIPE_FORMAT_NONE);
if (stencil_format != src_format &&
!screen->is_format_supported(screen, stencil_format, src->target,
src->nr_samples, PIPE_BIND_SAMPLER_VIEW)) {
return FALSE;
if (stencil_format != src_format &&
!screen->is_format_supported(screen, stencil_format,
src->target, src->nr_samples,
PIPE_BIND_SAMPLER_VIEW)) {
return FALSE;
}
}
}
}
@@ -1714,7 +1729,7 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
vb.stride = 4;
pipe->set_vertex_buffers(pipe, ctx->base.vb_slot, 1, &vb);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state_readbuf);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state_readbuf[0]);
pipe->bind_vs_state(pipe, ctx->vs_pos_only);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
@@ -1731,6 +1746,66 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
pipe_so_target_reference(&so_target, NULL);
}
void util_blitter_clear_buffer(struct blitter_context *blitter,
struct pipe_resource *dst,
unsigned offset, unsigned size,
unsigned num_channels,
const union pipe_color_union *clear_value)
{
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
struct pipe_context *pipe = ctx->base.pipe;
struct pipe_vertex_buffer vb = {0};
struct pipe_stream_output_target *so_target;
assert(num_channels >= 1);
assert(num_channels <= 4);
/* IMPORTANT: DON'T DO ANY BOUNDS CHECKING HERE!
*
* R600 uses this to initialize texture resources, so width0 might not be
* what you think it is.
*/
/* Streamout is required. */
if (!ctx->has_stream_out) {
assert(!"Streamout unsupported in util_blitter_clear_buffer()");
return;
}
/* Some alignment is required. */
if (offset % 4 != 0 || size % 4 != 0) {
assert(!"Bad alignment in util_blitter_clear_buffer()");
return;
}
u_upload_data(ctx->upload, 0, num_channels*4, clear_value,
&vb.buffer_offset, &vb.buffer);
vb.stride = 0;
blitter_set_running_flag(ctx);
blitter_check_saved_vertex_states(ctx);
blitter_disable_render_cond(ctx);
pipe->set_vertex_buffers(pipe, ctx->base.vb_slot, 1, &vb);
pipe->bind_vertex_elements_state(pipe,
ctx->velem_state_readbuf[num_channels-1]);
pipe->bind_vs_state(pipe, ctx->vs_pos_only);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
pipe->bind_rasterizer_state(pipe, ctx->rs_discard_state);
so_target = pipe->create_stream_output_target(pipe, dst, offset, size);
pipe->set_stream_output_targets(pipe, 1, &so_target, 0);
util_draw_arrays(pipe, PIPE_PRIM_POINTS, 0, size / 4);
blitter_restore_vertex_states(ctx);
blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
pipe_so_target_reference(&so_target, NULL);
pipe_resource_reference(&vb.buffer, NULL);
}
/* probably radeon specific */
void util_blitter_custom_resolve_color(struct blitter_context *blitter,
struct pipe_resource *dst,

View File

@@ -276,7 +276,7 @@ void util_blitter_default_src_texture(struct pipe_sampler_view *src_templ,
/**
* Copy data from one buffer to another using the Stream Output functionality.
* Some alignment is required, otherwise software fallback is used.
* 4-byte alignment is required, otherwise software fallback is used.
*/
void util_blitter_copy_buffer(struct blitter_context *blitter,
struct pipe_resource *dst,
@@ -285,6 +285,22 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
unsigned srcx,
unsigned size);
/**
* Clear the contents of a buffer using the Stream Output functionality.
* 4-byte alignment is required.
*
* "num_channels" can be 1, 2, 3, or 4, and specifies if the clear value is
* R, RG, RGB, or RGBA.
*
* For each element, only "num_channels" components of "clear_value" are
* copied to the buffer, then the offset is incremented by num_channels*4.
*/
void util_blitter_clear_buffer(struct blitter_context *blitter,
struct pipe_resource *dst,
unsigned offset, unsigned size,
unsigned num_channels,
const union pipe_color_union *clear_value);
/**
* Clear a region of a (color) surface to a constant value.
*

View File

@@ -0,0 +1,89 @@
/*
* Copyright 2013 Marek Olšák <maraeo@gmail.com>
*
* 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
* on 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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. */
/**
* @file
* 1D integer range, capable of the union and intersection operations.
*
* It only maintains a single interval which is extended when the union is
* done. This implementation is partially thread-safe (readers are not
* protected by a lock).
*
* @author Marek Olšák
*/
#ifndef U_RANGE_H
#define U_RANGE_H
#include "os/os_thread.h"
struct util_range {
unsigned start; /* inclusive */
unsigned end; /* exclusive */
/* for the range to be consistent with multiple contexts: */
pipe_mutex write_mutex;
};
static INLINE void
util_range_set_empty(struct util_range *range)
{
range->start = ~0;
range->end = 0;
}
/* This is like a union of two sets. */
static INLINE void
util_range_add(struct util_range *range, unsigned start, unsigned end)
{
if (start < range->start || end > range->end) {
pipe_mutex_lock(range->write_mutex);
range->start = MIN2(start, range->start);
range->end = MAX2(end, range->end);
pipe_mutex_unlock(range->write_mutex);
}
}
static INLINE boolean
util_ranges_intersect(struct util_range *range, unsigned start, unsigned end)
{
return MAX2(start, range->start) < MIN2(end, range->end);
}
/* Init/deinit */
static INLINE void
util_range_init(struct util_range *range)
{
pipe_mutex_init(range->write_mutex);
util_range_set_empty(range);
}
static INLINE void
util_range_destroy(struct util_range *range)
{
pipe_mutex_destroy(range->write_mutex);
}
#endif

View File

@@ -421,10 +421,10 @@ util_clear_depth_stencil(struct pipe_context *pipe,
else {
uint32_t dst_mask;
if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT)
dst_mask = 0xffffff00;
dst_mask = 0x00ffffff;
else {
assert(format == PIPE_FORMAT_S8_UINT_Z24_UNORM);
dst_mask = 0xffffff;
dst_mask = 0xffffff00;
}
if (clear_flags & PIPE_CLEAR_DEPTH)
dst_mask = ~dst_mask;

View File

@@ -307,6 +307,9 @@ void u_vbuf_destroy(struct u_vbuf *mgr)
unsigned num_vb = screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_MAX_INPUTS);
mgr->pipe->set_index_buffer(mgr->pipe, NULL);
pipe_resource_reference(&mgr->index_buffer.buffer, NULL);
mgr->pipe->set_vertex_buffers(mgr->pipe, 0, num_vb, NULL);
for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {

View File

@@ -32,8 +32,10 @@
#include <fcntl.h>
#include <X11/Xlib-xcb.h>
#include <X11/extensions/dri2tokens.h>
#include <xcb/dri2.h>
#include <xf86drm.h>
#include <errno.h>
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
@@ -305,6 +307,7 @@ vl_screen_create(Display *display, int screen)
xcb_generic_error_t *error = NULL;
char *device_name;
int fd, device_name_length;
unsigned int driverType;
drm_magic_t magic;
@@ -332,7 +335,22 @@ vl_screen_create(Display *display, int screen)
s = xcb_setup_roots_iterator(xcb_get_setup(scrn->conn));
while (screen--)
xcb_screen_next(&s);
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, XCB_DRI2_DRIVER_TYPE_DRI);
driverType = XCB_DRI2_DRIVER_TYPE_DRI;
#ifdef DRI2DriverPrimeShift
{
char *prime = getenv("DRI_PRIME");
if (prime) {
unsigned int primeid;
errno = 0;
primeid = strtoul(prime, NULL, 0);
if (errno == 0)
driverType |=
((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
}
}
#endif
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, driverType);
connect = xcb_dri2_connect_reply(scrn->conn, connect_cookie, NULL);
if (connect == NULL || connect->driver_name_length + connect->device_name_length == 0)
goto free_screen;

View File

@@ -1,6 +1,7 @@
AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \

View File

@@ -85,23 +85,30 @@ check_PROGRAMS = \
lp_test_printf
TESTS = $(check_PROGRAMS)
TEST_LIBS = \
libllvmpipe.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(LLVM_LIBS) \
$(DLOPEN_LIBS) \
$(PTHREAD_LIBS)
lp_test_format_SOURCES = lp_test_format.c lp_test_main.c
lp_test_format_LDADD = libllvmpipe.la ../../auxiliary/libgallium.la $(LLVM_LIBS)
lp_test_format_LDADD = $(TEST_LIBS)
nodist_EXTRA_lp_test_format_SOURCES = dummy.cpp
lp_test_arit_SOURCES = lp_test_arit.c lp_test_main.c
lp_test_arit_LDADD = libllvmpipe.la ../../auxiliary/libgallium.la $(LLVM_LIBS)
lp_test_arit_LDADD = $(TEST_LIBS)
nodist_EXTRA_lp_test_arit_SOURCES = dummy.cpp
lp_test_blend_SOURCES = lp_test_blend.c lp_test_main.c
lp_test_blend_LDADD = libllvmpipe.la ../../auxiliary/libgallium.la $(LLVM_LIBS)
lp_test_blend_LDADD = $(TEST_LIBS)
nodist_EXTRA_lp_test_blend_SOURCES = dummy.cpp
lp_test_conv_SOURCES = lp_test_conv.c lp_test_main.c
lp_test_conv_LDADD = libllvmpipe.la ../../auxiliary/libgallium.la $(LLVM_LIBS)
lp_test_conv_LDADD = $(TEST_LIBS)
nodist_EXTRA_lp_test_conv_SOURCES = dummy.cpp
lp_test_printf_SOURCES = lp_test_printf.c lp_test_main.c
lp_test_printf_LDADD = libllvmpipe.la ../../auxiliary/libgallium.la $(LLVM_LIBS)
lp_test_printf_LDADD = $(TEST_LIBS)
nodist_EXTRA_lp_test_printf_SOURCES = dummy.cpp

View File

@@ -64,6 +64,28 @@ lp_scene_create( struct pipe_context *pipe )
pipe_mutex_init(scene->mutex);
#ifdef DEBUG
/* Do some scene limit sanity checks here */
{
size_t maxBins = TILES_X * TILES_Y;
size_t maxCommandBytes = sizeof(struct cmd_block) * maxBins;
size_t maxCommandPlusData = maxCommandBytes + DATA_BLOCK_SIZE;
/* We'll need at least one command block per bin. Make sure that's
* less than the max allowed scene size.
*/
assert(maxCommandBytes < LP_SCENE_MAX_SIZE);
/* We'll also need space for at least one other data block */
assert(maxCommandPlusData <= LP_SCENE_MAX_SIZE);
/* Ideally, the size of a cmd_block object will be a power of two
* in order to avoid wasting space when we allocation them from
* data blocks (which are power of two also).
*/
assert(sizeof(struct cmd_block) ==
util_next_power_of_two(sizeof(struct cmd_block)));
}
#endif
return scene;
}

View File

@@ -49,12 +49,18 @@ struct lp_rast_state;
#define TILES_Y (LP_MAX_HEIGHT / TILE_SIZE)
#define CMD_BLOCK_MAX 128
/* Commands per command block (ideally so sizeof(cmd_block) is a power of
* two in size.)
*/
#define CMD_BLOCK_MAX 29
/* Bytes per data block.
*/
#define DATA_BLOCK_SIZE (64 * 1024)
/* Scene temporary storage is clamped to this size:
*/
#define LP_SCENE_MAX_SIZE (4*1024*1024)
#define LP_SCENE_MAX_SIZE (9*1024*1024)
/* The maximum amount of texture storage referenced by a scene is
* clamped ot this size:

View File

@@ -46,6 +46,10 @@ clear_flags(struct pipe_rasterizer_state *rast)
{
rast->light_twoside = 0;
rast->offset_tri = 0;
rast->offset_line = 0;
rast->offset_point = 0;
rast->offset_units = 0.0f;
rast->offset_scale = 0.0f;
}
@@ -74,6 +78,8 @@ llvmpipe_create_rasterizer_state(struct pipe_context *pipe,
*/
need_pipeline = (rast->fill_front != PIPE_POLYGON_MODE_FILL ||
rast->fill_back != PIPE_POLYGON_MODE_FILL ||
rast->offset_point ||
rast->offset_line ||
rast->point_smooth ||
rast->line_smooth ||
rast->line_stipple_enable ||

View File

@@ -295,7 +295,9 @@ llvmpipe_resource_create(struct pipe_screen *_screen,
/* assert(lpr->base.bind); */
if (resource_is_texture(&lpr->base)) {
if (lpr->base.bind & PIPE_BIND_DISPLAY_TARGET) {
if (lpr->base.bind & (PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT |
PIPE_BIND_SHARED)) {
/* displayable surface */
if (!llvmpipe_displaytarget_layout(screen, lpr))
goto fail;

View File

@@ -266,6 +266,7 @@ nouveau_buffer_cache(struct nouveau_context *nv, struct nv04_resource *buf)
tx.base.box.x = 0;
tx.base.box.width = buf->base.width0;
tx.bo = NULL;
tx.map = NULL;
if (!buf->data)
if (!nouveau_buffer_malloc(buf))
@@ -624,6 +625,7 @@ nouveau_buffer_migrate(struct nouveau_context *nv,
tx.base.box.x = 0;
tx.base.box.width = buf->base.width0;
tx.bo = NULL;
tx.map = NULL;
if (!nouveau_transfer_staging(nv, &tx, FALSE))
return FALSE;
nouveau_transfer_write(nv, &tx, 0, tx.base.box.width);

View File

@@ -111,9 +111,6 @@ nv30_format_info_table[PIPE_FORMAT_COUNT] = {
_(R16G16_SNORM , __V_),
_(R16G16B16_SNORM , __V_),
_(R16G16B16A16_SNORM , __V_),
_(R8_USCALED , __V_),
_(R8G8_USCALED , __V_),
_(R8G8B8_USCALED , __V_),
_(R8G8B8A8_USCALED , __V_),
_(R16_FLOAT , __V_),
_(R16G16_FLOAT , __V_), //S_V_),
@@ -160,9 +157,6 @@ nv30_vtxfmt_table[PIPE_FORMAT_COUNT] = {
_(R8G8_UNORM , U8_UNORM , 2),
_(R8G8B8_UNORM , U8_UNORM , 3),
_(R8G8B8A8_UNORM , U8_UNORM , 4),
_(R8_USCALED , U8_USCALED , 1),
_(R8G8_USCALED , U8_USCALED , 2),
_(R8G8B8_USCALED , U8_USCALED , 3),
_(R8G8B8A8_USCALED , U8_USCALED , 4),
_(R16_SNORM , V16_SNORM , 1),
_(R16G16_SNORM , V16_SNORM , 2),

View File

@@ -40,13 +40,15 @@ nv30_emit_vtxattr(struct nv30_context *nv30, struct pipe_vertex_buffer *vb,
const unsigned nc = util_format_get_nr_components(ve->src_format);
struct nouveau_pushbuf *push = nv30->base.pushbuf;
struct nv04_resource *res = nv04_resource(vb->buffer);
const struct util_format_description *desc =
util_format_description(ve->src_format);
const void *data;
float v[4];
data = nouveau_resource_map_offset(&nv30->base, res, vb->buffer_offset +
ve->src_offset, NOUVEAU_BO_RD);
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
switch (nc) {
case 4:

View File

@@ -180,4 +180,44 @@ nv50_blit_eng2d_get_mask(const struct pipe_blit_info *info)
return mask;
}
#if NOUVEAU_DRIVER == 0xc0
# define nv50_format_table nvc0_format_table
#endif
/* return TRUE for formats that can be converted among each other by NVC0_2D */
static INLINE boolean
nv50_2d_dst_format_faithful(enum pipe_format format)
{
const uint64_t mask =
NV50_ENG2D_SUPPORTED_FORMATS &
~NV50_ENG2D_NOCONVERT_FORMATS;
uint8_t id = nv50_format_table[format].rt;
return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0)));
}
static INLINE boolean
nv50_2d_src_format_faithful(enum pipe_format format)
{
const uint64_t mask =
NV50_ENG2D_SUPPORTED_FORMATS &
~(NV50_ENG2D_LUMINANCE_FORMATS | NV50_ENG2D_INTENSITY_FORMATS);
uint8_t id = nv50_format_table[format].rt;
return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0)));
}
static INLINE boolean
nv50_2d_format_supported(enum pipe_format format)
{
uint8_t id = nv50_format_table[format].rt;
return (id >= 0xc0) &&
(NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0)));
}
static INLINE boolean
nv50_2d_dst_format_ops_supported(enum pipe_format format)
{
uint8_t id = nv50_format_table[format].rt;
return (id >= 0xc0) &&
(NV50_ENG2D_OPERATION_FORMATS & (1ULL << (id - 0xc0)));
}
#endif /* __NV50_BLIT_H__ */

View File

@@ -242,6 +242,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
screen->cur_ctx = nv50;
nouveau_pushbuf_bufctx(screen->base.pushbuf, nv50->bufctx);
}
nv50->base.pushbuf->kick_notify = nv50_default_kick_notify;
nv50_init_query_functions(nv50);
nv50_init_surface_functions(nv50);

View File

@@ -9,6 +9,7 @@ nv50_validate_fb(struct nv50_context *nv50)
struct pipe_framebuffer_state *fb = &nv50->framebuffer;
unsigned i;
unsigned ms_mode = NV50_3D_MULTISAMPLE_MODE_MS1;
uint32_t array_size = 0xffff, array_mode = 0;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB);
@@ -23,6 +24,13 @@ nv50_validate_fb(struct nv50_context *nv50)
struct nv50_surface *sf = nv50_surface(fb->cbufs[i]);
struct nouveau_bo *bo = mt->base.bo;
array_size = MIN2(array_size, sf->depth);
if (mt->layout_3d)
array_mode = NV50_3D_RT_ARRAY_MODE_MODE_3D; /* 1 << 16 */
/* can't mix 3D with ARRAY or have RTs of different depth/array_size */
assert(mt->layout_3d || !array_mode || array_size == 1);
BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(i)), 5);
PUSH_DATAh(push, bo->offset + sf->offset);
PUSH_DATA (push, bo->offset + sf->offset);
@@ -34,7 +42,7 @@ nv50_validate_fb(struct nv50_context *nv50)
PUSH_DATA (push, sf->width);
PUSH_DATA (push, sf->height);
BEGIN_NV04(push, NV50_3D(RT_ARRAY_MODE), 1);
PUSH_DATA (push, sf->depth);
PUSH_DATA (push, array_mode | array_size);
} else {
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
@@ -63,7 +71,7 @@ nv50_validate_fb(struct nv50_context *nv50)
struct nv50_miptree *mt = nv50_miptree(fb->zsbuf->texture);
struct nv50_surface *sf = nv50_surface(fb->zsbuf);
struct nouveau_bo *bo = mt->base.bo;
int unk = mt->base.base.target == PIPE_TEXTURE_2D;
int unk = mt->base.base.target == PIPE_TEXTURE_3D || sf->depth == 1;
BEGIN_NV04(push, NV50_3D(ZETA_ADDRESS_HIGH), 5);
PUSH_DATAh(push, bo->offset + sf->offset);

View File

@@ -40,7 +40,7 @@ struct nv50_constbuf {
const uint8_t *data;
} u;
uint32_t size; /* max 65536 */
uint16_t offset;
uint32_t offset;
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
};

View File

@@ -35,25 +35,22 @@
#include "nv50_context.h"
#include "nv50_resource.h"
#include "nv50_blit.h"
#include "nv50_defs.xml.h"
#include "nv50_texture.xml.h"
/* these are used in nv50_blit.h */
#define NV50_ENG2D_SUPPORTED_FORMATS 0xff0843e080608409ULL
#define NV50_ENG2D_NOCONVERT_FORMATS 0x0008402000000000ULL
#define NV50_ENG2D_LUMINANCE_FORMATS 0x0008402000000000ULL
#define NV50_ENG2D_INTENSITY_FORMATS 0x0000000000000000ULL
#define NV50_ENG2D_OPERATION_FORMATS 0x060001c000608000ULL
/* return TRUE for formats that can be converted among each other by NV50_2D */
static INLINE boolean
nv50_2d_format_faithful(enum pipe_format format)
{
uint8_t id = nv50_format_table[format].rt;
return (id >= 0xc0) &&
(NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0)));
}
#define NOUVEAU_DRIVER 0x50
#include "nv50_blit.h"
static INLINE uint8_t
nv50_2d_format(enum pipe_format format)
nv50_2d_format(enum pipe_format format, boolean dst, boolean dst_src_equal)
{
uint8_t id = nv50_format_table[format].rt;
@@ -62,6 +59,7 @@ nv50_2d_format(enum pipe_format format)
*/
if ((id >= 0xc0) && (NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0))))
return id;
assert(dst_src_equal);
switch (util_format_get_blocksize(format)) {
case 1:
@@ -78,7 +76,7 @@ nv50_2d_format(enum pipe_format format)
static int
nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst,
struct nv50_miptree *mt, unsigned level, unsigned layer,
enum pipe_format pformat)
enum pipe_format pformat, boolean dst_src_pformat_equal)
{
struct nouveau_bo *bo = mt->base.bo;
uint32_t width, height, depth;
@@ -86,7 +84,7 @@ nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst,
uint32_t mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT;
uint32_t offset = mt->level[level].offset;
format = nv50_2d_format(pformat);
format = nv50_2d_format(pformat, dst, dst_src_pformat_equal);
if (!format) {
NOUVEAU_ERR("invalid/unsupported surface format: %s\n",
util_format_name(pformat));
@@ -155,15 +153,16 @@ nv50_2d_texture_do_copy(struct nouveau_pushbuf *push,
const enum pipe_format dfmt = dst->base.base.format;
const enum pipe_format sfmt = src->base.base.format;
int ret;
boolean eqfmt = dfmt == sfmt;
if (!PUSH_SPACE(push, 2 * 16 + 32))
return PIPE_ERROR;
ret = nv50_2d_texture_set(push, 1, dst, dst_level, dz, dfmt);
ret = nv50_2d_texture_set(push, 1, dst, dst_level, dz, dfmt, eqfmt);
if (ret)
return ret;
ret = nv50_2d_texture_set(push, 0, src, src_level, sz, sfmt);
ret = nv50_2d_texture_set(push, 0, src, src_level, sz, sfmt, eqfmt);
if (ret)
return ret;
@@ -243,8 +242,8 @@ nv50_resource_copy_region(struct pipe_context *pipe,
}
assert((src->format == dst->format) ||
(nv50_2d_format_faithful(src->format) &&
nv50_2d_format_faithful(dst->format)));
(nv50_2d_src_format_faithful(src->format) &&
nv50_2d_dst_format_faithful(dst->format)));
BCTX_REFN(nv50->bufctx, 2D, nv04_resource(src), RD);
BCTX_REFN(nv50->bufctx, 2D, nv04_resource(dst), WR);
@@ -936,7 +935,7 @@ nv50_blit_3d(struct nv50_context *nv50, const struct pipe_blit_info *info)
nv50_blit_select_fp(blit, info);
nv50_blitctx_pre_blit(blit);
nv50_blit_set_dst(blit, dst, info->dst.level, 0, info->dst.format);
nv50_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format);
nv50_blit_set_src(blit, src, info->src.level, -1, info->src.format,
blit->filter);
@@ -977,6 +976,8 @@ nv50_blit_3d(struct nv50_context *nv50, const struct pipe_blit_info *info)
BEGIN_NV04(push, NV50_3D(VIEWPORT_TRANSFORM_EN), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(VIEW_VOLUME_CLIP_CTRL), 1);
PUSH_DATA (push, 0x1);
/* Draw a large triangle in screen coordinates covering the whole
* render target, with scissors defining the destination region.
@@ -1059,7 +1060,8 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
int64_t du_dx, dv_dy;
int i;
uint32_t mode;
const uint32_t mask = nv50_blit_eng2d_get_mask(info);
uint32_t mask = nv50_blit_eng2d_get_mask(info);
boolean b;
mode = nv50_blit_get_filter(info) ?
NV50_2D_BLIT_CONTROL_FILTER_BILINEAR :
@@ -1070,8 +1072,9 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
du_dx = ((int64_t)info->src.box.width << 32) / info->dst.box.width;
dv_dy = ((int64_t)info->src.box.height << 32) / info->dst.box.height;
nv50_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format);
nv50_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format);
b = info->dst.format == info->src.format;
nv50_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format, b);
nv50_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format, b);
if (info->scissor_enable) {
BEGIN_NV04(push, NV50_2D(CLIP_X), 5);
@@ -1094,6 +1097,17 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
PUSH_DATA (push, 0xffffffff);
BEGIN_NV04(push, NV50_2D(OPERATION), 1);
PUSH_DATA (push, NV50_2D_OPERATION_ROP);
} else
if (info->src.format != info->dst.format) {
if (info->src.format == PIPE_FORMAT_R8_UNORM ||
info->src.format == PIPE_FORMAT_R16_UNORM ||
info->src.format == PIPE_FORMAT_R16_FLOAT ||
info->src.format == PIPE_FORMAT_R32_FLOAT) {
mask = 0xffff0000; /* also makes condition for OPERATION reset true */
BEGIN_NV04(push, NV50_2D(BETA4), 2);
PUSH_DATA (push, mask);
PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY_PREMULT);
}
}
if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) {
@@ -1224,10 +1238,25 @@ nv50_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
debug_printf("blit: cannot filter array or cube textures in z direction");
}
if (!eng3d && info->dst.format != info->src.format)
if (!nv50_2d_format_faithful(info->dst.format) ||
!nv50_2d_format_faithful(info->src.format))
if (!eng3d && info->dst.format != info->src.format) {
if (!nv50_2d_dst_format_faithful(info->dst.format) ||
!nv50_2d_src_format_faithful(info->src.format)) {
eng3d = TRUE;
} else
if (!nv50_2d_src_format_faithful(info->src.format)) {
if (!util_format_is_luminance(info->src.format)) {
if (util_format_is_intensity(info->src.format))
eng3d = TRUE;
else
if (!nv50_2d_dst_format_ops_supported(info->dst.format))
eng3d = TRUE;
else
eng3d = !nv50_2d_format_supported(info->src.format);
}
} else
if (util_format_is_luminance_alpha(info->src.format))
eng3d = TRUE;
}
if (info->src.resource->nr_samples == 8 &&
info->dst.resource->nr_samples <= 1)

View File

@@ -139,10 +139,20 @@ nv50_emit_vtxattr(struct nv50_context *nv50, struct pipe_vertex_buffer *vb,
const void *data = (const uint8_t *)vb->user_buffer + ve->src_offset;
float v[4];
const unsigned nc = util_format_get_nr_components(ve->src_format);
const struct util_format_description *desc =
util_format_description(ve->src_format);
assert(vb->user_buffer);
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
if (desc->channel[0].pure_integer) {
if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
desc->unpack_rgba_sint((int32_t *)v, 0, data, 0, 1, 1);
} else {
desc->unpack_rgba_uint((uint32_t *)v, 0, data, 0, 1, 1);
}
} else {
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
}
switch (nc) {
case 4:

View File

@@ -441,6 +441,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn)
if (i->op == OP_TEXBAR) {
if (i->subOp >= max) {
delete_Instruction(prog, i);
i = NULL;
} else {
max = i->subOp;
if (prev && prev->op == OP_TEXBAR && prev->subOp >= max) {
@@ -452,7 +453,7 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn)
if (isTextureOp(i->op)) {
max++;
}
if (!i->isNop())
if (i && !i->isNop())
prev = i;
}
}

View File

@@ -1041,7 +1041,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_VIEWPORT_TRANSFORM_EN 0x0000192c
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL 0x0000193c
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK0 0x00000001
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_RANGE_0_1 0x00000001
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1__MASK 0x00000006
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1__SHIFT 1
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1_UNK0 0x00000000

View File

@@ -97,6 +97,7 @@ nvc0_destroy(struct pipe_context *pipe)
nouveau_pushbuf_kick(nvc0->base.pushbuf, nvc0->base.pushbuf->channel);
nvc0_context_unreference_resources(nvc0);
nvc0_blitctx_destroy(nvc0);
#ifdef NVC0_WITH_DRAW_MODULE
draw_destroy(nvc0->draw);

View File

@@ -75,6 +75,7 @@
struct nvc0_blitctx;
boolean nvc0_blitctx_create(struct nvc0_context *);
void nvc0_blitctx_destroy(struct nvc0_context *);
struct nvc0_context {
struct nouveau_context base;
@@ -169,6 +170,8 @@ struct nvc0_context {
struct nvc0_blitctx *blit;
uint32_t vport_int[2];
#ifdef NVC0_WITH_DRAW_MODULE
struct draw_context *draw;
#endif

View File

@@ -445,6 +445,7 @@ nvc0_screen_create(struct nouveau_device *dev)
chan = screen->base.channel;
push = screen->base.pushbuf;
push->user_priv = screen;
push->rsvd_kick = 5;
screen->base.vidmem_bindings |= PIPE_BIND_CONSTANT_BUFFER |
PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER;

View File

@@ -243,9 +243,11 @@ nvc0_validate_viewport(struct nvc0_context *nvc0)
zmin = vp->translate[2] - fabsf(vp->scale[2]);
zmax = vp->translate[2] + fabsf(vp->scale[2]);
nvc0->vport_int[0] = (w << 16) | x;
nvc0->vport_int[1] = (h << 16) | y;
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, (w << 16) | x);
PUSH_DATA (push, (h << 16) | y);
PUSH_DATA (push, nvc0->vport_int[0]);
PUSH_DATA (push, nvc0->vport_int[1]);
BEGIN_NVC0(push, NVC0_3D(DEPTH_RANGE_NEAR(0)), 2);
PUSH_DATAf(push, zmin);
PUSH_DATAf(push, zmax);

View File

@@ -38,7 +38,7 @@ struct nvc0_constbuf {
const void *data;
} u;
uint32_t size;
uint16_t offset;
uint32_t offset;
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
};

View File

@@ -36,29 +36,32 @@
#include "nv50/nv50_defs.xml.h"
#include "nv50/nv50_texture.xml.h"
/* these are used in nv50_blit.h */
#define NV50_ENG2D_SUPPORTED_FORMATS 0xff9ccfe1cce3ccc9ULL
#define NV50_ENG2D_NOCONVERT_FORMATS 0x009cc02000000000ULL
#define NV50_ENG2D_LUMINANCE_FORMATS 0x001cc02000000000ULL
#define NV50_ENG2D_INTENSITY_FORMATS 0x0080000000000000ULL
#define NV50_ENG2D_OPERATION_FORMATS 0x060001c000638000ULL
#define NOUVEAU_DRIVER 0xc0
#include "nv50/nv50_blit.h"
#define NVC0_ENG2D_SUPPORTED_FORMATS 0xff9ccfe1cce3ccc9ULL
/* return TRUE for formats that can be converted among each other by NVC0_2D */
static INLINE boolean
nvc0_2d_format_faithful(enum pipe_format format)
{
uint8_t id = nvc0_format_table[format].rt;
return (id >= 0xc0) && (NVC0_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0)));
}
static INLINE uint8_t
nvc0_2d_format(enum pipe_format format)
nvc0_2d_format(enum pipe_format format, boolean dst, boolean dst_src_equal)
{
uint8_t id = nvc0_format_table[format].rt;
/* A8_UNORM is treated as I8_UNORM as far as the 2D engine is concerned. */
if (!dst && unlikely(format == PIPE_FORMAT_I8_UNORM) && !dst_src_equal)
return NV50_SURFACE_FORMAT_A8_UNORM;
/* Hardware values for color formats range from 0xc0 to 0xff,
* but the 2D engine doesn't support all of them.
*/
if (nvc0_2d_format_faithful(format))
if (nv50_2d_format_supported(format))
return id;
assert(dst_src_equal);
switch (util_format_get_blocksize(format)) {
case 1:
@@ -72,6 +75,7 @@ nvc0_2d_format(enum pipe_format format)
case 16:
return NV50_SURFACE_FORMAT_RGBA32_FLOAT;
default:
assert(0);
return 0;
}
}
@@ -79,7 +83,7 @@ nvc0_2d_format(enum pipe_format format)
static int
nvc0_2d_texture_set(struct nouveau_pushbuf *push, boolean dst,
struct nv50_miptree *mt, unsigned level, unsigned layer,
enum pipe_format pformat)
enum pipe_format pformat, boolean dst_src_pformat_equal)
{
struct nouveau_bo *bo = mt->base.bo;
uint32_t width, height, depth;
@@ -87,7 +91,7 @@ nvc0_2d_texture_set(struct nouveau_pushbuf *push, boolean dst,
uint32_t mthd = dst ? NVC0_2D_DST_FORMAT : NVC0_2D_SRC_FORMAT;
uint32_t offset = mt->level[level].offset;
format = nvc0_2d_format(pformat);
format = nvc0_2d_format(pformat, dst, dst_src_pformat_equal);
if (!format) {
NOUVEAU_ERR("invalid/unsupported surface format: %s\n",
util_format_name(pformat));
@@ -157,15 +161,16 @@ nvc0_2d_texture_do_copy(struct nouveau_pushbuf *push,
const enum pipe_format dfmt = dst->base.base.format;
const enum pipe_format sfmt = src->base.base.format;
int ret;
boolean eqfmt = dfmt == sfmt;
if (!PUSH_SPACE(push, 2 * 16 + 32))
return PIPE_ERROR;
ret = nvc0_2d_texture_set(push, TRUE, dst, dst_level, dz, dfmt);
ret = nvc0_2d_texture_set(push, TRUE, dst, dst_level, dz, dfmt, eqfmt);
if (ret)
return ret;
ret = nvc0_2d_texture_set(push, FALSE, src, src_level, sz, sfmt);
ret = nvc0_2d_texture_set(push, FALSE, src, src_level, sz, sfmt, eqfmt);
if (ret)
return ret;
@@ -243,8 +248,8 @@ nvc0_resource_copy_region(struct pipe_context *pipe,
return;
}
assert(nvc0_2d_format_faithful(src->format));
assert(nvc0_2d_format_faithful(dst->format));
assert(nv50_2d_dst_format_faithful(dst->format));
assert(nv50_2d_src_format_faithful(src->format));
BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(src), RD);
BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(dst), WR);
@@ -490,19 +495,19 @@ nvc0_blitter_make_vp(struct nvc0_blitter *blit)
{
static const uint32_t code_nvc0[] =
{
0xfff01c66, 0x06000080, /* vfetch b128 { $r0 $r1 $r2 $r3 } a[0x80] */
0xfff11c26, 0x06000090, /* vfetch b96 { $r4 $r5 $r6 } a[0x90]*/
0x03f01c66, 0x0a7e0070, /* export b128 o[0x70] { $r0 $r1 $r2 $r3 } */
0x13f01c26, 0x0a7e0080, /* export b96 o[0x80] { $r4 $r5 $r6 } */
0xfff11c26, 0x06000080, /* vfetch b64 $r4:$r5 a[0x80] */
0xfff01c46, 0x06000090, /* vfetch b96 $r0:$r1:$r2 a[0x90] */
0x13f01c26, 0x0a7e0070, /* export b64 o[0x70] $r4:$r5 */
0x03f01c46, 0x0a7e0080, /* export b96 o[0x80] $r0:$r1:$r2 */
0x00001de7, 0x80000000, /* exit */
};
static const uint32_t code_nve4[] =
{
0x00000007, 0x20000000, /* sched */
0xfff01c66, 0x06000080, /* vfetch b128 { $r0 $r1 $r2 $r3 } a[0x80] */
0xfff11c46, 0x06000090, /* vfetch b96 { $r4 $r5 $r6 } a[0x90]*/
0x03f01c66, 0x0a7e0070, /* export b128 o[0x70] { $r0 $r1 $r2 $r3 } */
0x13f01c46, 0x0a7e0080, /* export b96 o[0x80] { $r4 $r5 $r6 } */
0xfff11c26, 0x06000080, /* vfetch b64 $r4:$r5 a[0x80] */
0xfff01c46, 0x06000090, /* vfetch b96 $r0:$r1:$r2 a[0x90] */
0x13f01c26, 0x0a7e0070, /* export b64 o[0x70] $r4:$r5 */
0x03f01c46, 0x0a7e0080, /* export b96 o[0x80] $r0:$r1:$r2 */
0x00001de7, 0x80000000, /* exit */
};
@@ -515,13 +520,13 @@ nvc0_blitter_make_vp(struct nvc0_blitter *blit)
blit->vp.code = (uint32_t *)code_nvc0; /* const_cast */
blit->vp.code_size = sizeof(code_nvc0);
}
blit->vp.max_gpr = 7;
blit->vp.max_gpr = 6;
blit->vp.vp.edgeflag = PIPE_MAX_ATTRIBS;
blit->vp.hdr[0] = 0x00020461; /* vertprog magic */
blit->vp.hdr[4] = 0x000ff000; /* no outputs read */
blit->vp.hdr[6] = 0x0000003f; /* a[0x80], a[0x90] */
blit->vp.hdr[13] = 0x0003f000; /* o[0x70], o[0x80] */
blit->vp.hdr[6] = 0x00000073; /* a[0x80].xy, a[0x90].xyz */
blit->vp.hdr[13] = 0x00073000; /* o[0x70].xy, o[0x80].xyz */
}
static void
@@ -820,7 +825,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
nvc0_blit_select_fp(blit, info);
nvc0_blitctx_pre_blit(blit);
nvc0_blit_set_dst(blit, dst, info->dst.level, 0, info->dst.format);
nvc0_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format);
nvc0_blit_set_src(blit, src, info->src.level, -1, info->src.format,
blit->filter);
@@ -859,6 +864,8 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
z += 0.5f * dz;
IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 0);
IMMED_NVC0(push, NVC0_3D(VIEW_VOLUME_CLIP_CTRL), 0x2 |
NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_RANGE_0_1);
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, nvc0->framebuffer.width << 16);
PUSH_DATA (push, nvc0->framebuffer.height << 16);
@@ -925,11 +932,14 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
if (info->dst.box.z + info->dst.box.depth - 1)
IMMED_NVC0(push, NVC0_3D(LAYER), 0);
/* re-enable normally constant state */
IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1);
nvc0_blitctx_post_blit(blit);
/* restore viewport */
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, nvc0->vport_int[0]);
PUSH_DATA (push, nvc0->vport_int[1]);
IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1);
}
static void
@@ -948,7 +958,8 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
int64_t du_dx, dv_dy;
int i;
uint32_t mode;
const uint32_t mask = nv50_blit_eng2d_get_mask(info);
uint32_t mask = nv50_blit_eng2d_get_mask(info);
boolean b;
mode = nv50_blit_get_filter(info) ?
NVC0_2D_BLIT_CONTROL_FILTER_BILINEAR :
@@ -959,8 +970,9 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
du_dx = ((int64_t)info->src.box.width << 32) / info->dst.box.width;
dv_dy = ((int64_t)info->src.box.height << 32) / info->dst.box.height;
nvc0_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format);
nvc0_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format);
b = info->dst.format == info->src.format;
nvc0_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format, b);
nvc0_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format, b);
if (info->scissor_enable) {
BEGIN_NVC0(push, NVC0_2D(CLIP_X), 5);
@@ -981,6 +993,25 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
PUSH_DATA (push, 0xffffffff);
PUSH_DATA (push, 0xffffffff);
IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_ROP);
} else
if (info->src.format != info->dst.format) {
if (info->src.format == PIPE_FORMAT_R8_UNORM ||
info->src.format == PIPE_FORMAT_R8_SNORM ||
info->src.format == PIPE_FORMAT_R16_UNORM ||
info->src.format == PIPE_FORMAT_R16_SNORM ||
info->src.format == PIPE_FORMAT_R16_FLOAT ||
info->src.format == PIPE_FORMAT_R32_FLOAT) {
mask = 0xffff0000; /* also makes condition for OPERATION reset true */
BEGIN_NVC0(push, NVC0_2D(BETA4), 2);
PUSH_DATA (push, mask);
PUSH_DATA (push, NVC0_2D_OPERATION_SRCCOPY_PREMULT);
} else
if (info->src.format == PIPE_FORMAT_A8_UNORM) {
mask = 0xff000000;
BEGIN_NVC0(push, NVC0_2D(BETA4), 2);
PUSH_DATA (push, mask);
PUSH_DATA (push, NVC0_2D_OPERATION_SRCCOPY_PREMULT);
}
}
if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) {
@@ -1106,10 +1137,24 @@ nvc0_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
debug_printf("blit: cannot filter array or cube textures in z direction");
}
if (!eng3d && info->dst.format != info->src.format)
if (!nvc0_2d_format_faithful(info->dst.format) ||
!nvc0_2d_format_faithful(info->src.format))
if (!eng3d && info->dst.format != info->src.format) {
if (!nv50_2d_dst_format_faithful(info->dst.format)) {
eng3d = TRUE;
} else
if (!nv50_2d_src_format_faithful(info->src.format)) {
if (!util_format_is_luminance(info->src.format)) {
if (util_format_is_intensity(info->src.format))
eng3d = info->src.format != PIPE_FORMAT_I8_UNORM;
else
if (!nv50_2d_dst_format_ops_supported(info->dst.format))
eng3d = TRUE;
else
eng3d = !nv50_2d_format_supported(info->src.format);
}
} else
if (util_format_is_luminance_alpha(info->src.format))
eng3d = TRUE;
}
if (info->src.resource->nr_samples == 8 &&
info->dst.resource->nr_samples <= 1)
@@ -1185,6 +1230,13 @@ nvc0_blitctx_create(struct nvc0_context *nvc0)
return TRUE;
}
void
nvc0_blitctx_destroy(struct nvc0_context *nvc0)
{
if (nvc0->blit)
FREE(nvc0->blit);
}
void
nvc0_init_surface_functions(struct nvc0_context *nvc0)
{

View File

@@ -153,7 +153,7 @@ static void nvc0_video_getpath(enum pipe_video_profile profile, char *path)
break;
}
case PIPE_VIDEO_CODEC_VC1: {
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-%u", profile - PIPE_VIDEO_PROFILE_VC1_SIMPLE);
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-0");
break;
}
case PIPE_VIDEO_CODEC_MPEG4_AVC: {
@@ -356,19 +356,19 @@ nvc0_create_decoder(struct pipe_context *context,
goto fw_fail;
}
r = read(fd, dec->fw_bo->map, 0x4000);
close(fd);
if (r < 0) {
fprintf(stderr, "reading firmware file %s failed: %m\n", path);
goto fw_fail;
}
if (r == 0x4000) {
close(fd);
fprintf(stderr, "firmware file %s too large!\n", path);
goto fw_fail;
}
if (r & 0xff) {
close(fd);
fprintf(stderr, "firmware file %s wrong size!\n", path);
goto fw_fail;
}
@@ -558,8 +558,6 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
buffer = CALLOC_STRUCT(nvc0_video_buffer);
if (!buffer)
return NULL;
assert(!(templat->height % 4));
assert(!(templat->width % 2));
buffer->base.buffer_format = templat->buffer_format;
buffer->base.context = pipe;
@@ -578,7 +576,7 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
templ.format = PIPE_FORMAT_R8_UNORM;
templ.width0 = buffer->base.width;
templ.height0 = buffer->base.height/2;
templ.height0 = (buffer->base.height + 1)/2;
templ.flags = NVC0_RESOURCE_FLAG_VIDEO;
templ.last_level = 0;
templ.array_size = 1;
@@ -589,8 +587,8 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
templ.format = PIPE_FORMAT_R8G8_UNORM;
buffer->num_planes = 2;
templ.width0 /= 2;
templ.height0 /= 2;
templ.width0 = (templ.width0 + 1) / 2;
templ.height0 = (templ.height0 + 1) / 2;
for (i = 1; i < buffer->num_planes; ++i) {
buffer->resources[i] = pipe->screen->resource_create(pipe->screen, &templ);
if (!buffer->resources[i])

View File

@@ -62,8 +62,6 @@ nvc0_decoder_setup_ppp(struct nvc0_decoder *dec, struct nvc0_video_buffer *targe
PUSH_DATA (push, in_addr + y2); // 70c
PUSH_DATA (push, in_addr + cbcr); // 710
PUSH_DATA (push, in_addr + cbcr2); // 714
assert(target->resources[0]->width0 >= 16 * dec_w);
assert(target->resources[0]->height0 >= dec->base.height/2);
for (i = 0; i < 2; ++i) {
struct nv50_miptree *mt = (struct nv50_miptree *)target->resources[i];

View File

@@ -185,8 +185,6 @@ nvc0_decoder_handle_references(struct nvc0_decoder *dec, struct nvc0_video_buffe
(!dec->refs[idx].decoded_bottom || !dec->refs[idx].decoded_top)));
if (target == refs[i])
empty_spot = 0;
assert(!h264 ||
dec->refs[idx].last_used == seq - 1);
if (dec->refs[idx].vidbuf != refs[i]) {
debug_printf("%p is not a real ref\n", refs[i]);
@@ -338,7 +336,6 @@ nvc0_decoder_fill_picparm_h264_vp(struct nvc0_decoder *dec,
unsigned ring, i, j = 0;
assert(offsetof(struct h264_picparm_vp, u224) == 0x224);
*is_ref = d->is_reference;
assert(!d->frame_num || dec->last_frame_num + 1 == d->frame_num || dec->last_frame_num == d->frame_num);
dec->last_frame_num = d->frame_num;
h->width = mb(dec->base.width);

View File

@@ -22,6 +22,7 @@ r300_compiler_tests_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/r300/compiler
r300_compiler_tests_SOURCES = \
$(testdir)/r300_compiler_tests.c \
$(testdir)/radeon_compiler_optimize_tests.c \
$(testdir)/radeon_compiler_util_tests.c \
$(testdir)/rc_test_helpers.c \
$(testdir)/unit_test.c

View File

@@ -854,7 +854,7 @@ static void rc_emulate_negative_addressing(struct radeon_compiler *compiler, voi
transform_negative_addressing(c, lastARL, inst, min_offset);
}
static struct rc_swizzle_caps r300_vertprog_swizzle_caps = {
struct rc_swizzle_caps r300_vertprog_swizzle_caps = {
.IsNative = &swizzle_is_native,
.Split = 0 /* should never be called */
};

View File

@@ -1,3 +1,30 @@
/*
* Copyright 2010 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 "radeon_program_constants.h"
#ifndef RADEON_PROGRAM_UTIL_H

View File

@@ -1,4 +1,29 @@
/*
* Copyright 2010 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_EMULATE_LOOPS_H
#define RADEON_EMULATE_LOOPS_H

View File

@@ -1,3 +1,27 @@
/*
* Copyright 2012 Advanced Micro Devices, Inc.
*
* 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
* on 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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.
*
* Author: Tom Stellard <thomas.stellard@amd.com>
*/
#include "radeon_compiler.h"
#include "radeon_compiler_util.h"

View File

@@ -708,6 +708,7 @@ static int peephole_mul_omod(
struct rc_list * writer_list;
struct rc_variable * var;
struct peephole_mul_cb_data cb_data;
unsigned writemask_sum;
for (i = 0; i < 2; i++) {
unsigned int j;
@@ -815,10 +816,11 @@ static int peephole_mul_omod(
}
/* Rewrite the instructions */
writemask_sum = rc_variable_writemask_sum(writer_list->Item);
for (var = writer_list->Item; var; var = var->Friend) {
struct rc_variable * writer = writer_list->Item;
struct rc_variable * writer = var;
unsigned conversion_swizzle = rc_make_conversion_swizzle(
writer->Inst->U.I.DstReg.WriteMask,
writemask_sum,
inst_mul->U.I.DstReg.WriteMask);
writer->Inst->U.I.Omod = omod_op;
writer->Inst->U.I.DstReg.File = inst_mul->U.I.DstReg.File;

View File

@@ -1,3 +1,29 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 "radeon_compiler.h"
#include "radeon_compiler_util.h"

View File

@@ -383,6 +383,14 @@ static enum rc_reg_class variable_get_class(
RC_INSTRUCTION_PAIR ) {
old_swizzle = r.U.P.Arg->Swizzle;
} else {
/* Source operands of TEX
* instructions can't be
* swizzle on r300/r400 GPUs.
*/
if (!variable->C->is_r500) {
can_change_writemask = 0;
break;
}
old_swizzle = r.U.I.Src->Swizzle;
}
new_swizzle = rc_adjust_channels(

View File

@@ -1,3 +1,29 @@
/*
* Copyright 2010 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_RENAME_REGS_H
#define RADEON_RENAME_REGS_H

View File

@@ -54,4 +54,6 @@ struct rc_swizzle_caps {
void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split * split);
};
extern struct rc_swizzle_caps r300_vertprog_swizzle_caps;
#endif /* RADEON_SWIZZLE_H */

View File

@@ -1,3 +1,27 @@
/*
* Copyright 2012 Advanced Micro Devices, Inc.
*
* 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
* on 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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.
*
* Author: Tom Stellard <thomas.stellard@amd.com>
*/
#include "radeon_compiler.h"
#include "radeon_compiler_util.h"

View File

@@ -1,6 +1,43 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 "r300_compiler_tests.h"
#include <stdlib.h>
int main(int argc, char ** argv)
{
radeon_compiler_util_run_tests();
unsigned pass = 1;
pass &= radeon_compiler_optimize_run_tests();
pass &= radeon_compiler_util_run_tests();
if (pass) {
return EXIT_SUCCESS;
} else {
return EXIT_FAILURE;
}
}

View File

@@ -1,2 +1,29 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
*
*/
void radeon_compiler_util_run_tests(void);
unsigned radeon_compiler_optimize_run_tests(void);
unsigned radeon_compiler_util_run_tests(void);

View File

@@ -0,0 +1,75 @@
/*
* Copyright 2013 Advanced Micro Devices, Inc.
*
* 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
* on 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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.
*
* Author: Tom Stellard <thomas.stellard@amd.com>
*/
#include "radeon_compiler.h"
#include "radeon_dataflow.h"
#include "r300_compiler_tests.h"
#include "rc_test_helpers.h"
#include "unit_test.h"
static void test_runner_rc_optimize(struct test_result * result)
{
struct radeon_compiler c;
struct rc_instruction *inst;
struct rc_instruction *inst_list[3];
unsigned inst_count = 0;
float const0[4] = {2.0f, 0.0f, 0.0f, 0.0f};
unsigned pass = 1;
test_begin(result);
init_compiler(&c, RC_FRAGMENT_PROGRAM, 1, 0);
rc_constants_add_immediate_vec4(&c.Program.Constants, const0);
add_instruction(&c, "RCP temp[0].x, const[1].x___;");
add_instruction(&c, "RCP temp[0].y, const[1]._y__;");
add_instruction(&c, "MUL temp[1].xy, const[0].xx__, temp[0].xy__;");
add_instruction(&c, "MOV output[0].xy, temp[1].xy;" );
rc_optimize(&c, NULL);
for(inst = c.Program.Instructions.Next;
inst != &c.Program.Instructions;
inst = inst->Next, inst_count++) {
inst_list[inst_count] = inst;
}
if (inst_list[0]->U.I.Omod != RC_OMOD_MUL_2 ||
inst_list[1]->U.I.Omod != RC_OMOD_MUL_2 ||
inst_list[2]->U.I.Opcode != RC_OPCODE_MOV) {
pass = 0;
}
test_check(result, pass);
}
unsigned radeon_compiler_optimize_run_tests()
{
struct test tests[] = {
{"rc_optimize() => peephole_mul_omod()", test_runner_rc_optimize},
{NULL, NULL}
};
return run_tests(tests);
}

View File

@@ -1,3 +1,30 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 <string.h>
#include <sys/types.h>
@@ -67,11 +94,11 @@ static void test_runner_rc_inst_can_use_presub(struct test_result * result)
"MAD temp[0].xyz, temp[2].xyz_, -temp[3].xxx_, input[5].xyz_;");
}
void radeon_compiler_util_run_tests()
unsigned radeon_compiler_util_run_tests()
{
struct test tests[] = {
{"rc_inst_can_use_presub()", test_runner_rc_inst_can_use_presub},
{NULL, NULL}
};
run_tests(tests);
return run_tests(tests);
}

View File

@@ -1,3 +1,32 @@
/*
* Copyright 2011 Tom Stellard <tstellar@gmail.com>
* Copyright 2013 Advanced Micro Devices, 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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
*
* Author: Tom Stellard <thomas.stellard@amd.com>
*/
#include <errno.h>
#include <regex.h>
#include <stdlib.h>
@@ -5,9 +34,14 @@
#include <string.h>
#include <sys/types.h>
#include "../radeon_compiler_util.h"
#include "../radeon_opcodes.h"
#include "../radeon_program.h"
#include "r500_fragprog.h"
#include "r300_fragprog_swizzle.h"
#include "radeon_compiler.h"
#include "radeon_compiler_util.h"
#include "radeon_opcodes.h"
#include "radeon_program.h"
#include "radeon_regalloc.h"
#include "radeon_swizzle.h"
#include "rc_test_helpers.h"
@@ -259,6 +293,7 @@ int init_rc_normal_dst(
if (tokens.WriteMask.Length == 0) {
inst->U.I.DstReg.WriteMask = RC_MASK_XYZW;
} else {
inst->U.I.DstReg.WriteMask = 0;
/* The first character should be '.' */
if (tokens.WriteMask.String[0] != '.') {
fprintf(stderr, "1st char of writemask is not valid.\n");
@@ -311,7 +346,8 @@ struct inst_tokens {
* this string is the same that is output by rc_program_print.
* @return 1 On success, 0 on failure
*/
int init_rc_normal_instruction(
int parse_rc_normal_instruction(
struct rc_instruction * inst,
const char * inst_str)
{
@@ -320,10 +356,6 @@ int init_rc_normal_instruction(
regmatch_t matches[REGEX_INST_MATCHES];
struct inst_tokens tokens;
/* Initialize inst */
memset(inst, 0, sizeof(struct rc_instruction));
inst->Type = RC_INSTRUCTION_NORMAL;
/* Execute the regex */
if (!regex_helper(regex_str, inst_str, matches, REGEX_INST_MATCHES)) {
return 0;
@@ -340,6 +372,8 @@ int init_rc_normal_instruction(
/* Fill out the rest of the instruction. */
inst->Type = RC_INSTRUCTION_NORMAL;
for (i = 0; i < MAX_RC_OPCODE; i++) {
const struct rc_opcode_info * info = rc_get_opcode_info(i);
unsigned int first_src = 3;
@@ -378,3 +412,47 @@ int init_rc_normal_instruction(
}
return 1;
}
int init_rc_normal_instruction(
struct rc_instruction * inst,
const char * inst_str)
{
/* Initialize inst */
memset(inst, 0, sizeof(struct rc_instruction));
return parse_rc_normal_instruction(inst, inst_str);
}
void add_instruction(struct radeon_compiler *c, const char * inst_string)
{
struct rc_instruction * new_inst =
rc_insert_new_instruction(c, c->Program.Instructions.Prev);
parse_rc_normal_instruction(new_inst, inst_string);
}
void init_compiler(
struct radeon_compiler *c,
enum rc_program_type program_type,
unsigned is_r500,
unsigned is_r400)
{
struct rc_regalloc_state *rs = malloc(sizeof(struct rc_regalloc_state));
rc_init(c, rs);
c->is_r500 = is_r500;
c->max_temp_regs = is_r500 ? 128 : (is_r400 ? 64 : 32);
c->max_constants = is_r500 ? 256 : 32;
c->max_alu_insts = (is_r500 || is_r400) ? 512 : 64;
c->max_tex_insts = (is_r500 || is_r400) ? 512 : 32;
if (program_type == RC_FRAGMENT_PROGRAM) {
c->has_half_swizzles = 1;
c->has_presub = 1;
c->has_omod = 1;
c->SwizzleCaps =
is_r500 ? &r500_swizzle_caps : &r300_swizzle_caps;
} else {
c->SwizzleCaps = &r300_vertprog_swizzle_caps;
}
}

View File

@@ -1,3 +1,33 @@
/*
* Copyright 2011 Tom Stellard <tstellar@gmail.com>
* Copyright 2013 Advanced Micro Devices, 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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
*
* Author: Tom Stellard <thomas.stellard@amd.com>
*/
#include "radeon_compiler.h"
int init_rc_normal_src(
struct rc_instruction * inst,
@@ -8,6 +38,18 @@ int init_rc_normal_dst(
struct rc_instruction * inst,
const char * dst_str);
int parse_rc_normal_instruction(
struct rc_instruction * inst,
const char * inst_str);
int init_rc_normal_instruction(
struct rc_instruction * inst,
const char * inst_str);
void add_instruction(struct radeon_compiler *c, const char * inst_string);
void init_compiler(
struct radeon_compiler *c,
enum rc_program_type program_type,
unsigned is_r500,
unsigned is_r400);

View File

@@ -1,19 +1,51 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 <stdio.h>
#include <string.h>
#include "unit_test.h"
void run_tests(struct test tests[])
unsigned run_tests(struct test tests[])
{
int i;
unsigned pass = 1;
for (i = 0; tests[i].name; i++) {
printf("Test %s\n", tests[i].name);
memset(&tests[i].result, 0, sizeof(tests[i].result));
tests[i].test_func(&tests[i].result);
printf("Test %s (%d/%d) pass\n", tests[i].name,
tests[i].result.pass, tests[i].result.test_count);
if (tests[i].result.pass != tests[i].result.test_count) {
pass = 0;
}
}
return pass;
}
void test_begin(struct test_result * result)

View File

@@ -1,3 +1,29 @@
/*
* Copyright 2011 Tom Stellard <tstellar@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, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
*
*/
struct test_result {
unsigned int test_count;
@@ -11,7 +37,7 @@ struct test {
struct test_result result;
};
void run_tests(struct test tests[]);
unsigned run_tests(struct test tests[]);
void test_begin(struct test_result * result);
void test_check(struct test_result * result, int cond);

View File

@@ -412,10 +412,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300->context.create_video_decoder = vl_create_decoder;
r300->context.create_video_buffer = vl_video_buffer_create;
if (r300screen->caps.has_tcl) {
r300->uploader = u_upload_create(&r300->context, 256 * 1024, 4,
PIPE_BIND_INDEX_BUFFER);
}
r300->uploader = u_upload_create(&r300->context, 256 * 1024, 4,
PIPE_BIND_CUSTOM);
r300->blitter = util_blitter_create(&r300->context);
if (r300->blitter == NULL)

View File

@@ -1005,60 +1005,45 @@ static void r300_render_draw_elements(struct vbuf_render* render,
{
struct r300_render* r300render = r300_render(render);
struct r300_context* r300 = r300render->r300;
struct radeon_winsys_cs *cs = r300->cs;
unsigned end_cs_dwords;
unsigned max_index = (r300->vbo->size - r300->draw_vbo_offset) /
(r300render->r300->vertex_info.size * 4) - 1;
unsigned short_count;
unsigned free_dwords;
struct pipe_resource *index_buffer = NULL;
unsigned index_buffer_offset;
CS_LOCALS(r300);
DBG(r300, DBG_DRAW, "r300: render_draw_elements (count: %d)\n", count);
if (!r300_prepare_for_rendering(r300,
PREP_EMIT_STATES |
PREP_EMIT_VARRAYS_SWTCL | PREP_INDEXED,
NULL, 256, 0, 0, -1)) {
u_upload_data(r300->uploader, 0, count * 2, indices,
&index_buffer_offset, &index_buffer);
if (!index_buffer) {
return;
}
/* Below we manage the CS space manually because there may be more
* indices than it can fit in CS. */
end_cs_dwords = r300_get_num_cs_end_dwords(r300);
while (count) {
free_dwords =
RADEON_MAX_CMDBUF_DWORDS - r300->cs->cdw - end_cs_dwords - 6;
short_count = MIN2(count, free_dwords * 2);
BEGIN_CS(6);
OUT_CS_REG(R300_GA_COLOR_CONTROL,
r300_provoking_vertex_fixes(r300, r300render->prim));
OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, max_index);
OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, (short_count+1)/2);
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (short_count << 16) |
r300render->hwprim);
END_CS;
memcpy(cs->buf+cs->cdw, indices, short_count * 2);
cs->cdw += (short_count + 1) / 2;
/* OK now subtract the emitted indices and see if we need to emit
* another draw packet. */
indices += short_count;
count -= short_count;
if (count) {
if (!r300_prepare_for_rendering(r300,
PREP_EMIT_VARRAYS_SWTCL | PREP_INDEXED,
NULL, 256, 0, 0, -1))
return;
end_cs_dwords = r300_get_num_cs_end_dwords(r300);
}
if (!r300_prepare_for_rendering(r300,
PREP_EMIT_STATES |
PREP_EMIT_VARRAYS_SWTCL | PREP_INDEXED,
index_buffer, 12, 0, 0, -1)) {
pipe_resource_reference(&index_buffer, NULL);
return;
}
BEGIN_CS(12);
OUT_CS_REG(R300_GA_COLOR_CONTROL,
r300_provoking_vertex_fixes(r300, r300render->prim));
OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, max_index);
OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, 0);
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) |
r300render->hwprim);
OUT_CS_PKT3(R300_PACKET3_INDX_BUFFER, 2);
OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2));
OUT_CS(index_buffer_offset);
OUT_CS((count + 1) / 2);
OUT_CS_RELOC(r300_resource(index_buffer));
END_CS;
pipe_resource_reference(&index_buffer, NULL);
}
static void r300_render_destroy(struct vbuf_render* render)
@@ -1137,6 +1122,13 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
static const union pipe_color_union zeros;
CS_LOCALS(r300);
/* XXX workaround for a lockup in MSAA resolve on SWTCL chipsets, this
* function most probably doesn't handle type=NONE correctly */
if (!r300->screen->caps.has_tcl && type == UTIL_BLITTER_ATTRIB_NONE) {
util_blitter_draw_rectangle(blitter, x1, y1, x2, y2, depth, type, attrib);
return;
}
if (r300->skip_rendering)
return;

View File

@@ -172,9 +172,12 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
rbuf->buf = NULL;
rbuf->malloced_buffer = NULL;
/* Alloc constant buffers and SWTCL buffers in RAM. */
/* Allocate constant buffers and SWTCL vertex and index buffers in RAM.
* Note that uploaded index buffers use the flag PIPE_BIND_CUSTOM, so that
* we can distinguish them from user-created buffers.
*/
if (templ->bind & PIPE_BIND_CONSTANT_BUFFER ||
!r300screen->caps.has_tcl) {
(!r300screen->caps.has_tcl && !(templ->bind & PIPE_BIND_CUSTOM))) {
rbuf->malloced_buffer = align_malloc(templ->width0, 64);
return &rbuf->b.b;
}

View File

@@ -487,6 +487,7 @@ static void r300_set_blend_color(struct pipe_context* pipe,
(struct r300_blend_color_state*)r300->blend_color_state.state;
struct pipe_blend_color c;
enum pipe_format format = fb->nr_cbufs ? fb->cbufs[0]->format : 0;
float tmp;
CB_LOCALS;
state->state = *color; /* Save it, so that we can reuse it in set_fb_state */
@@ -513,6 +514,13 @@ static void r300_set_blend_color(struct pipe_context* pipe,
c.color[2] = c.color[3];
break;
case PIPE_FORMAT_R8G8B8A8_UNORM:
case PIPE_FORMAT_R8G8B8X8_UNORM:
tmp = c.color[0];
c.color[0] = c.color[2];
c.color[2] = tmp;
break;
default:;
}
}
@@ -919,6 +927,9 @@ r300_set_framebuffer_state(struct pipe_context* pipe,
/* Need to reset clamping or colormask. */
r300_mark_atom_dirty(r300, &r300->blend_state);
/* Re-swizzle the blend color. */
r300_set_blend_color(pipe, &((struct r300_blend_color_state*)r300->blend_color_state.state)->state);
/* If zsbuf is set from NULL to non-NULL or vice versa.. */
if (!!old_state->zsbuf != !!state->zsbuf) {
r300_mark_atom_dirty(r300, &r300->dsa_state);

View File

@@ -978,9 +978,9 @@ r300_texture_create_object(struct r300_screen *rscreen,
tex->tex.microtile = microtile;
tex->tex.macrotile[0] = macrotile;
tex->tex.stride_in_bytes_override = stride_in_bytes_override;
tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ?
RADEON_DOMAIN_GTT :
RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT;
tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? RADEON_DOMAIN_GTT :
base->nr_samples > 1 ? RADEON_DOMAIN_VRAM :
RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT;
tex->buf = buffer;
r300_texture_desc_init(rscreen, tex, base);

View File

@@ -349,6 +349,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
static unsigned hiz_align_y[4] = {8, 8, 8, 32};
if (util_format_is_depth_or_stencil(tex->b.b.format) &&
util_format_get_blocksizebits(tex->b.b.format) == 32 &&
tex->tex.microtile) {
unsigned i, pipes;

View File

@@ -243,9 +243,9 @@ void evergreen_set_streamout_enable(struct r600_context *ctx, unsigned buffer_en
void evergreen_dma_copy(struct r600_context *rctx,
struct pipe_resource *dst,
struct pipe_resource *src,
unsigned long dst_offset,
unsigned long src_offset,
unsigned long size)
uint64_t dst_offset,
uint64_t src_offset,
uint64_t size)
{
struct radeon_winsys_cs *cs = rctx->rings.dma.cs;
unsigned i, ncopy, csize, sub_cmd, shift;
@@ -283,4 +283,7 @@ void evergreen_dma_copy(struct r600_context *rctx,
src_offset += csize << shift;
size -= csize;
}
util_range_add(&rdst->valid_buffer_range, dst_offset,
dst_offset + size);
}

View File

@@ -808,6 +808,7 @@ static void *evergreen_create_dsa_state(struct pipe_context *ctx,
dsa->valuemask[1] = state->stencil[1].valuemask;
dsa->writemask[0] = state->stencil[0].writemask;
dsa->writemask[1] = state->stencil[1].writemask;
dsa->zwritemask = state->depth.writemask;
db_depth_control = S_028800_Z_ENABLE(state->depth.enabled) |
S_028800_Z_WRITE_ENABLE(state->depth.writemask) |
@@ -1321,6 +1322,10 @@ void evergreen_init_color_surface_rat(struct r600_context *rctx,
* elements. */
surf->cb_color_dim = pipe_buffer->width0;
/* Set the buffer range the GPU will have access to: */
util_range_add(&r600_resource(pipe_buffer)->valid_buffer_range,
0, pipe_buffer->width0);
surf->cb_color_cmask = surf->cb_color_base;
surf->cb_color_cmask_slice = 0;
surf->cb_color_fmask = surf->cb_color_base;
@@ -1405,10 +1410,15 @@ void evergreen_init_color_surface(struct r600_context *rctx,
S_028C74_NON_DISP_TILING_ORDER(non_disp_tiling) |
S_028C74_FMASK_BANK_HEIGHT(fmask_bankh);
if (rctx->chip_class == CAYMAN && rtex->resource.b.b.nr_samples > 1) {
unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples);
color_attrib |= S_028C74_NUM_SAMPLES(log_samples) |
S_028C74_NUM_FRAGMENTS(log_samples);
if (rctx->chip_class == CAYMAN) {
color_attrib |= S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] ==
UTIL_FORMAT_SWIZZLE_1);
if (rtex->resource.b.b.nr_samples > 1) {
unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples);
color_attrib |= S_028C74_NUM_SAMPLES(log_samples) |
S_028C74_NUM_FRAGMENTS(log_samples);
}
}
ntype = V_028C70_NUMBER_UNORM;
@@ -1647,6 +1657,11 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
}
if (rctx->framebuffer.state.zsbuf) {
rctx->flags |= R600_CONTEXT_WAIT_3D_IDLE | R600_CONTEXT_FLUSH_AND_INV;
rtex = (struct r600_texture*)rctx->framebuffer.state.zsbuf->texture;
if (rtex->htile) {
rctx->flags |= R600_CONTEXT_FLUSH_AND_INV_DB_META;
}
}
util_copy_framebuffer_state(&rctx->framebuffer.state, state);
@@ -1668,6 +1683,8 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
surf = (struct r600_surface*)state->cbufs[i];
rtex = (struct r600_texture*)surf->base.texture;
r600_context_add_resource_size(ctx, state->cbufs[i]->texture);
if (!surf->color_initialized) {
evergreen_init_color_surface(rctx, surf);
}
@@ -1699,6 +1716,8 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
if (state->zsbuf) {
surf = (struct r600_surface*)state->zsbuf;
r600_context_add_resource_size(ctx, state->zsbuf->texture);
if (!surf->depth_initialized) {
evergreen_init_depth_surface(rctx, surf);
}
@@ -2218,9 +2237,23 @@ static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_
}
db_render_override |= S_02800C_NOOP_CULL_DISABLE(1);
}
if (rctx->db_state.rsurf && rctx->db_state.rsurf->htile_enabled) {
/* FIXME we should be able to use hyperz even if we are not writing to
* zbuffer but somehow this trigger GPU lockup. See :
*
* https://bugs.freedesktop.org/show_bug.cgi?id=60848
*
* Disable hyperz for now if not writing to zbuffer.
*/
if (rctx->db_state.rsurf && rctx->db_state.rsurf->htile_enabled && rctx->zwritemask) {
/* FORCE_OFF means HiZ/HiS are determined by DB_SHADER_CONTROL */
db_render_override |= S_02800C_FORCE_HIZ_ENABLE(V_02800C_FORCE_OFF);
/* This is to fix a lockup when hyperz and alpha test are enabled at
* the same time somehow GPU get confuse on which order to pick for
* z test
*/
if (rctx->alphatest_state.sx_alpha_test_control) {
db_render_override |= S_02800C_FORCE_SHADER_Z_ORDER(1);
}
} else {
db_render_override |= S_02800C_FORCE_HIZ_ENABLE(V_02800C_FORCE_DISABLE);
}
@@ -3210,7 +3243,7 @@ void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader
struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &shader->rstate;
struct r600_shader *rshader = &shader->shader;
unsigned i, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z, spi_ps_in_control_1, db_shader_control;
unsigned i, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z, spi_ps_in_control_1, db_shader_control = 0;
int pos_index = -1, face_index = -1;
int ninterp = 0;
boolean have_linear = FALSE, have_centroid = FALSE, have_perspective = FALSE;
@@ -3220,7 +3253,6 @@ void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader
rstate->nregs = 0;
db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
for (i = 0; i < rshader->ninput; i++) {
/* evergreen NUM_INTERP only contains values interpolated into the LDS,
POSITION goes via GPRs from the SC so isn't counted */
@@ -3454,6 +3486,24 @@ void evergreen_update_db_shader_control(struct r600_context * rctx)
V_02880C_EXPORT_DB_FULL) |
S_02880C_ALPHA_TO_MASK_DISABLE(rctx->framebuffer.cb0_is_integer);
/* When alpha test is enabled we can't trust the hw to make the proper
* decision on the order in which ztest should be run related to fragment
* shader execution.
*
* If alpha test is enabled perform early z rejection (RE_Z) but don't early
* write to the zbuffer. Write to zbuffer is delayed after fragment shader
* execution and thus after alpha test so if discarded by the alpha test
* the z value is not written.
* If ReZ is enabled, and the zfunc/zenable/zwrite values change you can
* get a hang unless you flush the DB in between. For now just use
* LATE_Z.
*/
if (rctx->alphatest_state.sx_alpha_test_control) {
db_shader_control |= S_02880C_Z_ORDER(V_02880C_LATE_Z);
} else {
db_shader_control |= S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
}
if (db_shader_control != rctx->db_misc_state.db_shader_control) {
rctx->db_misc_state.db_shader_control = db_shader_control;
rctx->db_misc_state.atom.dirty = true;
@@ -3481,7 +3531,7 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx,
unsigned array_mode, lbpp, pitch_tile_max, slice_tile_max, size;
unsigned ncopy, height, cheight, detile, i, x, y, z, src_mode, dst_mode;
unsigned sub_cmd, bank_h, bank_w, mt_aspect, nbanks, tile_split;
unsigned long base, addr;
uint64_t base, addr;
/* make sure that the dma ring is only one active */
rctx->rings.gfx.flush(rctx, RADEON_FLUSH_ASYNC);
@@ -3502,7 +3552,8 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx,
if (dst_mode == RADEON_SURF_MODE_LINEAR) {
/* T2L */
array_mode = evergreen_array_mode(src_mode);
slice_tile_max = (((pitch * rsrc->surface.level[src_level].npix_y) >> 6) / bpp) - 1;
slice_tile_max = (rsrc->surface.level[src_level].nblk_x * rsrc->surface.level[src_level].nblk_y) >> 6;
slice_tile_max = slice_tile_max ? slice_tile_max - 1 : 0;
/* linear height must be the same as the slice tile max height, it's ok even
* if the linear destination/source have smaller heigh as the size of the
* dma packet will be using the copy_height which is always smaller or equal
@@ -3526,7 +3577,8 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx,
} else {
/* L2T */
array_mode = evergreen_array_mode(dst_mode);
slice_tile_max = (((pitch * rdst->surface.level[dst_level].npix_y) >> 6) / bpp) - 1;
slice_tile_max = (rdst->surface.level[dst_level].nblk_x * rdst->surface.level[dst_level].nblk_y) >> 6;
slice_tile_max = slice_tile_max ? slice_tile_max - 1 : 0;
/* linear height must be the same as the slice tile max height, it's ok even
* if the linear destination/source have smaller heigh as the size of the
* dma packet will be using the copy_height which is always smaller or equal
@@ -3592,6 +3644,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
struct r600_texture *rdst = (struct r600_texture*)dst;
unsigned dst_pitch, src_pitch, bpp, dst_mode, src_mode, copy_height;
unsigned src_w, dst_w;
unsigned src_x, src_y;
if (rctx->rings.dma.cs == NULL) {
return FALSE;
@@ -3600,6 +3653,11 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
return FALSE;
}
src_x = util_format_get_nblocksx(src->format, src_box->x);
dst_x = util_format_get_nblocksx(src->format, dst_x);
src_y = util_format_get_nblocksy(src->format, src_box->y);
dst_y = util_format_get_nblocksy(src->format, dst_y);
bpp = rdst->surface.bpe;
dst_pitch = rdst->surface.level[dst_level].pitch_bytes;
src_pitch = rsrc->surface.level[src_level].pitch_bytes;
@@ -3624,8 +3682,19 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
return FALSE;
}
/* 128 bpp surfaces require non_disp_tiling for both
* tiled and linear buffers on cayman. However, async
* DMA only supports it on the tiled side. As such
* the tile order is backwards after a L2T/T2L packet.
*/
if ((rctx->chip_class == CAYMAN) &&
(src_mode != dst_mode) &&
(util_format_get_blocksize(src->format) >= 16)) {
return FALSE;
}
if (src_mode == dst_mode) {
unsigned long dst_offset, src_offset;
uint64_t dst_offset, src_offset;
/* simple dma blit would do NOTE code here assume :
* src_box.x/y == 0
* dst_x/y == 0
@@ -3633,7 +3702,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
*/
src_offset= rsrc->surface.level[src_level].offset;
src_offset += rsrc->surface.level[src_level].slice_size * src_box->z;
src_offset += src_box->y * src_pitch + src_box->x * bpp;
src_offset += src_y * src_pitch + src_x * bpp;
dst_offset = rdst->surface.level[dst_level].offset;
dst_offset += rdst->surface.level[dst_level].slice_size * dst_z;
dst_offset += dst_y * dst_pitch + dst_x * bpp;
@@ -3641,7 +3710,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx,
src_box->height * src_pitch);
} else {
evergreen_dma_copy_tile(rctx, dst, dst_level, dst_x, dst_y, dst_z,
src, src_level, src_box->x, src_box->y, src_box->z,
src, src_level, src_x, src_y, src_box->z,
copy_height, dst_pitch, bpp);
}
return TRUE;

Some files were not shown because too many files have changed in this diff Show More