OSDN Git Service

android-x86/external-mesa.git
8 years agoi965/fs: Fix hang on IVB and VLV with image format mismatch.
Francisco Jerez [Wed, 26 Aug 2015 18:59:46 +0000 (21:59 +0300)]
i965/fs: Fix hang on IVB and VLV with image format mismatch.

IVB and VLV hang sporadically when an untyped surface read or write
message is used to access a surface of format other than RAW, as may
happen when there is a mismatch between the format qualifier of the
image uniform and the format of the actual image bound to the
pipeline.  According to the spec this condition gives undefined
results but may not lead to program termination (which is one of the
possible outcomes of the hang).  Fix it by checking at runtime whether
the surface is of the right type.

Fixes the "arb_shader_image_load_store.invalid/format mismatch" piglit
subtest.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91718
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b61292296bd7e1876fdb64725a783a7e96f6c4c1)

8 years agoradeonsi: add scratch buffer to the buffer list when it's re-allocated
Marek Olšák [Thu, 24 Sep 2015 21:50:01 +0000 (23:50 +0200)]
radeonsi: add scratch buffer to the buffer list when it's re-allocated

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 9932142192f848ae9dbc644551653547640346b4)

8 years agoradeon/vce: fix vui time_scale zero error
Leo Liu [Fri, 18 Sep 2015 19:51:26 +0000 (15:51 -0400)]
radeon/vce: fix vui time_scale zero error

if app pass 0 as frame_rate_num, it should not be encoded to the VUI.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1e97b41893a4f53a71ee141a5e8a046fed7b49cd)

8 years agomesa: fix mipmap generation for immutable, compressed textures
Roland Scheidegger [Sat, 19 Sep 2015 23:33:17 +0000 (01:33 +0200)]
mesa: fix mipmap generation for immutable, compressed textures

If the immutable compressed texture didn't have the full mip pyramid,
this didn't work, because it tried to generate mip levels for non-existing
levels. _mesa_prepare_mipmap_level() would correctly handle this by returning
FALSE if the mip level didn't exist, however we actually created the
non-existing mip level right before that because we used _mesa_get_tex_image()
before calling _mesa_prepare_mipmap_level(). It would then proceed to crash
(we allocated the mip level, which is a bad idea on an immutable texture,
but didn't initialize the values, leading to assertion failures or segfaults).
Fix this by using _mesa_select_tex_image() instead and call it after
_mesa_prepare_mipmap_level(), as that function will allocate missing mip levels
for non-immutable textures already.
This fixes a (2 year old) crash with astromenace which was hack-fixed in ubuntu
packages instead: http://bugs.debian.org/718680 (I guess most apps do full mip
chains - I believe this app not doing it is actually unintentional, always one
level less than full mip chain...).

Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 19604d30e1351868f7f54847c91ffec7b3fcd27e)

8 years agogallium/u_blitter: handle allocation failures
Marek Olšák [Thu, 10 Sep 2015 16:48:12 +0000 (18:48 +0200)]
gallium/u_blitter: handle allocation failures

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 7bbce21e458d912279159aa6ac122768c6c06551)

8 years agoradeonsi: handle dummy constant buffer allocation failure
Marek Olšák [Thu, 10 Sep 2015 17:25:14 +0000 (19:25 +0200)]
radeonsi: handle dummy constant buffer allocation failure

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit ae418a7b5640aadb625bb7a7d6e4aa0a98ccb77f)

8 years agoradeonsi: don't forget to update scratch relocations for LS, HS, ES shaders
Marek Olšák [Thu, 10 Sep 2015 16:42:22 +0000 (18:42 +0200)]
radeonsi: don't forget to update scratch relocations for LS, HS, ES shaders

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit b737d9c1dce073aa36b21c33cb30fbae89c38153)

8 years agoradeonsi: skip drawing if updating the scratch buffer fails
Marek Olšák [Thu, 10 Sep 2015 16:40:51 +0000 (18:40 +0200)]
radeonsi: skip drawing if updating the scratch buffer fails

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d556346b3590e8d5601c0831577f08e7b1ccecec)

8 years agoradeonsi: skip drawing if PS fails to compile or upload
Marek Olšák [Thu, 10 Sep 2015 16:33:10 +0000 (18:33 +0200)]
radeonsi: skip drawing if PS fails to compile or upload

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 1f99b0be7e4e300c2b1761437f740a604ab036bc)

8 years agoradeonsi: skip drawing if VS, TCS, TES, GS fail to compile or upload
Marek Olšák [Thu, 10 Sep 2015 16:32:22 +0000 (18:32 +0200)]
radeonsi: skip drawing if VS, TCS, TES, GS fail to compile or upload

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 237d7cccce15b91590afa90020ff71324217fdb9)

8 years agoradeonsi: handle fixed-func TCS shader create failure
Marek Olšák [Thu, 10 Sep 2015 16:31:33 +0000 (18:31 +0200)]
radeonsi: handle fixed-func TCS shader create failure

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 9b6d9dd7d8d2779e2bd08787c26f51512b84f6d2)

8 years agoradeonsi: handle shader precompile failures
Marek Olšák [Thu, 10 Sep 2015 16:30:41 +0000 (18:30 +0200)]
radeonsi: handle shader precompile failures

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 5dbadb02572f875f5d2f22327eab6b93de61337c)

8 years agoradeonsi: skip drawing if GS ring allocations fail
Marek Olšák [Thu, 10 Sep 2015 16:27:53 +0000 (18:27 +0200)]
radeonsi: skip drawing if GS ring allocations fail

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 263f5a2cf97e455e48dbd7728cb0ac10fd699746)
[Emil Velikov: Track gs_rings over gsvs_ring. NULL check/FREE gs_rings.]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/gallium/drivers/radeonsi/si_state_shaders.c

8 years agoradeonsi: skip drawing if the tess factor ring allocation fails
Marek Olšák [Thu, 10 Sep 2015 16:27:53 +0000 (18:27 +0200)]
radeonsi: skip drawing if the tess factor ring allocation fails

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 22d3ccf5a814bfc768e373d0c983a356f4e4efe3)
[Emil Velikov: Track tf_state over tf_ring. NULL check/FREE tf_state.]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/gallium/drivers/radeonsi/si_state_shaders.c

8 years agoradeonsi: add malloc fail paths to si_create_shader_state
Marek Olšák [Thu, 10 Sep 2015 16:16:26 +0000 (18:16 +0200)]
radeonsi: add malloc fail paths to si_create_shader_state

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 5c219ab55239ceef3285262ff68a502e419061e0)

8 years agoradeonsi: report alloc failure from si_shader_binary_read
Marek Olšák [Thu, 10 Sep 2015 16:15:40 +0000 (18:15 +0200)]
radeonsi: report alloc failure from si_shader_binary_read

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 394d67a58f949245e8b3fad400e9efaa5829ec84)

8 years agogallium/radeon: add a fail path for depth MSAA texture readback
Marek Olšák [Thu, 10 Sep 2015 16:14:36 +0000 (18:14 +0200)]
gallium/radeon: add a fail path for depth MSAA texture readback

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit dea834e639715caa9517a695a3fb04d5de9aa069)

8 years agogallium/radeon: handle buffer alloc failures in r600_draw_rectangle
Marek Olšák [Thu, 10 Sep 2015 15:54:41 +0000 (17:54 +0200)]
gallium/radeon: handle buffer alloc failures in r600_draw_rectangle

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit f95e695059c428a21a1e1a27d5cd5ccce2a97b0e)

8 years agogallium/radeon: handle buffer_map staging buffer failures better
Marek Olšák [Thu, 10 Sep 2015 15:53:28 +0000 (17:53 +0200)]
gallium/radeon: handle buffer_map staging buffer failures better

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 282b3780123bace557fc90127bd35b075ea0873e)

8 years agoradeonsi: handle constant buffer alloc failures
Marek Olšák [Thu, 10 Sep 2015 15:42:31 +0000 (17:42 +0200)]
radeonsi: handle constant buffer alloc failures

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit cd27ff6a0f85ca35f0f7f2fa7971692e0028e2ed)

8 years agoradeonsi: handle index buffer alloc failures
Marek Olšák [Thu, 10 Sep 2015 15:42:31 +0000 (17:42 +0200)]
radeonsi: handle index buffer alloc failures

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 29dff6f67656c8e6e09249cc76b6efa0c03353a7)

8 years agost/mesa: fix front buffer regression after dropping st_validate_state in Blit
Marek Olšák [Wed, 23 Sep 2015 00:33:24 +0000 (02:33 +0200)]
st/mesa: fix front buffer regression after dropping st_validate_state in Blit

Broken by: d082c5324914212f76e45be497229c7a0681f706
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92072

Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit f3a081953393c7d40bd8df9ec22a2551d01098f5)

8 years agodocs: add sha256 checksums for 11.0.2
Emil Velikov [Mon, 28 Sep 2015 23:19:36 +0000 (00:19 +0100)]
docs: add sha256 checksums for 11.0.2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodocs: add release notes for 11.0.2
Emil Velikov [Mon, 28 Sep 2015 19:45:37 +0000 (20:45 +0100)]
docs: add release notes for 11.0.2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 11.0.2
Emil Velikov [Mon, 28 Sep 2015 19:41:32 +0000 (20:41 +0100)]
Update version to 11.0.2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agomesa: Use the effective internal format instead for validation
Eduardo Lima Mitev [Thu, 24 Sep 2015 08:57:43 +0000 (10:57 +0200)]
mesa: Use the effective internal format instead for validation

When validating format+type+internalFormat for texture pixel operations
on GLES3, the effective internal format should be used if the one
specified is an unsized internal format. Page 127, section "3.8 Texturing"
of the GLES 3.0.4 spec says:

    "if internalformat is a base internal format, the effective internal
     format is a sized internal format that is derived from the format and
     type for internal use by the GL. Table 3.12 specifies the mapping of
     format and type to effective internal formats. The effective internal
     format is used by the GL for purposes such as texture completeness or
     type checks for CopyTex* commands. In these cases, the GL is required
     to operate as if the effective internal format was used as the
     internalformat when specifying the texture data."

v2: Per the spec, Luminance8Alpha8, Luminance8 and Alpha8 should not be
considered sized internal formats. Return the corresponding unsize format
instead.

v4: * Improved comments in
      _mesa_es3_effective_internal_format_for_format_and_type().
    * Splitted patch to separate chunk about reordering of
      error_check_subtexture_dimensions() error check, which is not directly
      related with this patch.
v5: Dropped the splitted patch because it was actually a work around 3
    dEQP tests that are buggy:

    dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_offset
    dEQP-GLES2.functional.negative_api.texture.texsubimage2d_offset_allowed
    dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_wdt_hgt

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 5edd9961c15a80d557ba42f48c97a471b23d9c5e)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91582

8 years agomesa: Move _mesa_base_tex_format() from teximage to glformats files
Eduardo Lima Mitev [Thu, 24 Sep 2015 08:57:42 +0000 (10:57 +0200)]
mesa: Move _mesa_base_tex_format() from teximage to glformats files

This function will be needed as part of validating the combination of format,
type and internal format of texture pixel operations, which happens in
glformats files. Specifically, we want to be able to obtain the base format
of a resolved effective internal format, to compare it with the original
internal format passed.

Also, since this function deals solely with GL formats, it fits better in
glformats where the rest of similar format functionality rests.

The function is moved as-is, without any modification.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit c6bf1cd1467ea5d5370394ba99366dd8a59a385c)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/mesa/main/teximage.c
src/mesa/main/teximage.h

8 years agomesa: Fix order of format+type and internal format checks for glTexImageXD ops
Eduardo Lima Mitev [Thu, 24 Sep 2015 08:57:41 +0000 (10:57 +0200)]
mesa: Fix order of format+type and internal format checks for glTexImageXD ops

The more specific GLES constrains should be checked after the general
validation performed by _mesa_error_check_format_and_type(). This is also
for consistency with the error checks order of glTexSubImage ops.

v3: The change of order uncovered a bug that regresses a couple of piglit
tests written against OpenGL-ES 1.1 spec, which expects an INVALID_VALUE
instead of the INVALID_ENUM returned by _mesa_error_check_format_and_type()
when an invalid format is passed to glTexImage2D. This version of the patch
accounts for those cases.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.texture.teximage2d

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 15ab968f62dd322ecda6d70b1069f52616fe39bb)

8 years agoglsl: Expose gl_MaxTess{Control,Evaluation}AtomicCounters.
Matt Turner [Thu, 24 Sep 2015 01:06:19 +0000 (18:06 -0700)]
glsl: Expose gl_MaxTess{Control,Evaluation}AtomicCounters.

... with only ARB_shader_atomic_counters.

I expected to see interactions with ARB_tessellation_shader in the
ARB_shader_atomic_counters spec, but they do not exist. It seems that we
should unconditionally expose these variables in the presence of
ARB_shader_atomic_counters:

   gl_MaxTessControlAtomicCounters
   gl_MaxTessEvaluationAtomicCounters

This partially reverts commit da7adb99e8. The commit also affected
gl_MaxTessControlImageUniforms and gl_MaxTessEvaluationImageUniforms
similarly but the ARB_shader_image_load_store spec does list an
interaction with ARB_tessellation_shader.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92095
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d6bb46bbe8e4ef90dedc5a04c7434a8113c10a8b)

8 years agoi965: Respect stride and subreg_offset for ATTR registers
Kristian Høgsberg Kristensen [Wed, 23 Sep 2015 23:57:47 +0000 (16:57 -0700)]
i965: Respect stride and subreg_offset for ATTR registers

When we assign hw regs to attributes, we don't incorporate the stride
and subreg_offset from the fs_reg. It's rarely used, but the integer
multiplication lowering uses unusual stride and subreg_offset
combination breaks when one source is an attribute.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91970
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 2ea16966ae66d4dd5c5dcb996d7996d9c734bbee)

8 years agodocs: add sha256 checksums for 11.0.1
Emil Velikov [Sat, 26 Sep 2015 13:08:52 +0000 (14:08 +0100)]
docs: add sha256 checksums for 11.0.1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodocs: add release notes for 11.0.1
Emil Velikov [Sat, 26 Sep 2015 12:32:07 +0000 (13:32 +0100)]
docs: add release notes for 11.0.1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 11.0.1
Emil Velikov [Sat, 26 Sep 2015 12:22:34 +0000 (13:22 +0100)]
Update version to 11.0.1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agot_dd_dmatmp: Use addition instead of subtraction in loop bounds
Ian Romanick [Mon, 14 Sep 2015 18:59:22 +0000 (11:59 -0700)]
t_dd_dmatmp: Use addition instead of subtraction in loop bounds

This is used everywhere else in this file because it avoids problems
when count is zero (due to trimming).

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38109
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Marius Predut <marius.predut@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 25543d8ec506ef32599af6f5e0dd735e01b39909)

8 years agot_dd_dmatmp: Pull out common 'count -= count & 3' code
Ian Romanick [Mon, 14 Sep 2015 18:56:20 +0000 (11:56 -0700)]
t_dd_dmatmp: Pull out common 'count -= count & 3' code

This was missing in the HAVE_TRIANGLES path, and that could cause
incorrect rendering.

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38109
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Marius Predut <marius.predut@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c0b3b2f7603eab210acdb2e654e5411fe912ca34)

8 years agot_dd_dmatmp: Use '& 3' instead of '% 4' everywhere
Ian Romanick [Mon, 14 Sep 2015 18:50:28 +0000 (11:50 -0700)]
t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0d475ee2b989ac1697720ca391913e9158156bdc)

8 years agot_dd_dmatmp: Clean up improper code formatting from previous patch
Ian Romanick [Mon, 14 Sep 2015 18:46:50 +0000 (11:46 -0700)]
t_dd_dmatmp: Clean up improper code formatting from previous patch

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fad8d54de7e7f908cb0d06f0b54af8440e689928)

8 years agot_dd_dmatmp: Make "count" actually be the count
Ian Romanick [Mon, 14 Sep 2015 18:37:12 +0000 (11:37 -0700)]
t_dd_dmatmp: Make "count" actually be the count

The value passed in count previously was "vertex after the last vertex
to be processed."  Calling that "count" was misleading and kind of mean.
Looking at the code, many functions immediately do "count-start" to get
back the true count.  That's just silly.

If it is better for the loops to be 'for (j = start; j < (start +
count); j++)', GCC will do that transformation.

NOTE: There is some strange formatting left by this patch.  That was
done to make it more obvious that the before and after code is
equivalent.  These will be fixed in the next patch.

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

v2: Fix a remaining (count-start) in render_quad_strip_verts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d7bf7969b90f66ee614f2d2225f3a821d5396a89)

8 years agomesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.
Iago Toral Quiroga [Tue, 24 Feb 2015 18:02:56 +0000 (19:02 +0100)]
mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.

From section 9.2. Binding and Managing Framebuffer Objects:

"Upon successful return from Get*FramebufferAttachmentParameteriv, if
pname is FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then params will contain
one of NONE, FRAMEBUFFER_DEFAULT, TEXTURE, or RENDERBUFFER, identifying
the type of object which contains the attached image."

And then it clarifies further:

"If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
either no framebuffer is bound to target; or the default framebuffer is
bound, attachment is DEPTH or STENCIL, and the number of depth or stencil
bits, respectively, is zero"

Currently, if the default framebuffer is bound, we always return
GL_FRAMEBUFFER_DEFAULT for FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, but
according to the spec, when GL_DEPTH or GL_STENCIL attachments are
the ones being queried, we should return GL_NONE if they don't exist.

Fixes the following dEQP test:
dEQP-GLES3.functional.state_query.fbo.framebuffer_attachment_x_size_initial

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cf439951b791827677e96d29e209b5fc08d07a2e)

8 years agoi965: fix textureGrad for cubemaps
Tapani Pälli [Mon, 7 Sep 2015 12:08:13 +0000 (15:08 +0300)]
i965: fix textureGrad for cubemaps

Fixes bugs exposed by commit
2b1cdb0eddb73f62e4848d4b64840067f1f70865 in:
   ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_frag

No regressions observed in deqp, CTS or Piglit.

v2: address review feedback from Iago Toral:
   - move rho calculation to else branch
   - optimize dx and dy calculation
   - fix documentation inconsistensies

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91114
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7f8815bcb9af9b4b374ad7bd6e7cfa7529a6c980)

8 years agoconfigure.ac: Add support to enable read-only text segment on x86.
Jeremy Huddleston [Sat, 29 Aug 2015 21:51:45 +0000 (14:51 -0700)]
configure.ac: Add support to enable read-only text segment on x86.

Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/240956
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6dfc5e28f7d08094210d8cecd3ed4a5b393dafe9)

8 years agoradeonsi: load fmask ptr relative to the resources array
Ilia Mirkin [Sat, 19 Sep 2015 20:19:26 +0000 (16:19 -0400)]
radeonsi: load fmask ptr relative to the resources array

res_ptr already contains the resource values. fmask_ptr needs to be
looked up relative to the start of the resource params.

Note that this only affects indirect loads of MS sampler arrays.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7d5162bdc0850c80f4b9427a2aac6b42c7dcceaa)

8 years agomesa: fix errors when reading depth with glReadPixels
Tapani Pälli [Tue, 15 Sep 2015 06:17:20 +0000 (09:17 +0300)]
mesa: fix errors when reading depth with glReadPixels

OpenGL ES 3.0 spec 3.7.2 "Transfer of Pixel Rectangles" specifies
DEPTH_COMPONENT, UNSIGNED_INT as a valid couple, validation for
internal format is checked by is_float_depth().

Fix regression caused by 81d2fd91a90e5b2fd9fd74792a7a7c329f0e4d29 in:
   ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels

Test uses GL_DEPTH_COMPONENT, UNSIGNED_INT only when GL_NV_read_depth
extension is present.

v2: change check in _mesa_error_check_format_and_type to be explicit
    for ES 2.0+, desktop OpenGL does not allow this behaviour + uses
    this function for both glReadPixels and glDrawPixels validation.
    (No Piglit regressions seen with v2.)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92009
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit afa1efdc8522d987e3af7c7a6272021caa33eb82)

8 years agonv50,nvc0: flush texture cache in presence of coherent bufs
Ilia Mirkin [Thu, 17 Sep 2015 02:17:18 +0000 (22:17 -0400)]
nv50,nvc0: flush texture cache in presence of coherent bufs

This fixes the newly-added arb_texture_buffer_object-bufferstorage
piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e844e1007d3baac09ff2cc78879d6974be18ecaf)

8 years agonv50,nvc0: detect underlying resource changes and update tic
Ilia Mirkin [Tue, 15 Sep 2015 05:32:40 +0000 (01:32 -0400)]
nv50,nvc0: detect underlying resource changes and update tic

When updating texture buffers, we might end up replacing the whole
buffer. Check that the tic address matches the resource address, and if
not, update the tic and reupload it.

This fixes:
  arb_direct_state_access-texture-buffer
  arb_texture_buffer_object-data-sync

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 323c91250682ac931941047f282a613c74b1ba26)

8 years agomesa: Fix texture compression on big-endian systems
Ulrich Weigand [Tue, 15 Sep 2015 13:23:26 +0000 (15:23 +0200)]
mesa: Fix texture compression on big-endian systems

Various pieces of code to create compressed textures will first
generate an uncompressed RGBA texture into a temporary buffer,
and then read from that buffer while creating the final compressed
texture in the requested format.

The code reading from the temporary buffer assumes the buffer is
formatted as an array of bytes in RGBA order.  However, the buffer
is filled using a _mesa_texstore call with MESA_FORMAT_R8G8B8A8_UNORM
format -- this is defined as an array of *integers* holding the
RGBA values in packed format (least-significant to most-significant).
This means incorrect bytes are accessed on big-endian systems.

This patch fixes this by using the MESA_FORMAT_A8B8G8R8_UNORM format
instead on big-endian systems when filling the buffer.  This fixes
about 100 piglit test case failures on s390x for me.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Tested-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "10.6" "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@gmail.com>
(cherry picked from commit bd016a2601a741799bc76734deae0cb9ebcb2b8f)

8 years agofreedreno/a3xx: fix blending of L8 format
Ilia Mirkin [Mon, 14 Sep 2015 05:59:01 +0000 (01:59 -0400)]
freedreno/a3xx: fix blending of L8 format

Even though luminance formats don't have alpha, we still want the alpha
output to go to the blender. This fixes the luminance blending tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 545a3cbb011e0e7722c2accb330c0994aea5cc38)

8 years agonv50, nvc0: fix max texture buffer size to 128M elements
Ilia Mirkin [Tue, 15 Sep 2015 23:39:25 +0000 (19:39 -0400)]
nv50, nvc0: fix max texture buffer size to 128M elements

This is what the hardware supports, there never was any sort of 64K
limit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7a275fcda8ffa3d69b7be6f356469f4af272a6ad)

8 years agost/mesa: avoid integer overflows with buffers >= 512MB
Ilia Mirkin [Tue, 15 Sep 2015 23:32:10 +0000 (19:32 -0400)]
st/mesa: avoid integer overflows with buffers >= 512MB

This fixes failures with the newly-submitted max-size texture buffer
piglit test for GPUs exposing >= 128M max texels.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
(cherry picked from commit eb081681df248750727a8a76436760d617b4a6a9)

8 years agogbm: convert gbm bo format to fourcc format on dma-buf import
Ray Strode [Fri, 28 Aug 2015 18:50:21 +0000 (14:50 -0400)]
gbm: convert gbm bo format to fourcc format on dma-buf import

At the moment if a gbm buffer is imported and the gbm buffer
has an old-style GBM_BO_FORMAT format, the import will crash,
since it's passed directly to DRI functions that expect
a fourcc format (as provided by the newer GBM_FORMAT
definitions)

This commit addresses the problem in two ways:

1) it prevents invalid formats from leading to a crash by
returning EINVAL if the image couldn't be created

2) it translates GBM_BO_FORMAT formats into the comparable
GBM_FORMAT formats.

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=753531
CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 4bf151e66279da00655cec02aadb52c9c6583213)

8 years agometa: Abort meta pbo path if TexSubImage need signed unsigned conversion
Anuj Phogat [Fri, 24 Jul 2015 22:53:58 +0000 (15:53 -0700)]
meta: Abort meta pbo path if TexSubImage need signed unsigned conversion

See similar fix for Readpixels in mesa commit 0d20790. Jason suggested
we need that for TexSubImage as well.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 64e25167ed284619dacab42fdada0bb0fea71321)

8 years agoi965/vec4_nir: Load constants as integers
Antia Puentes [Mon, 14 Sep 2015 07:50:59 +0000 (09:50 +0200)]
i965/vec4_nir: Load constants as integers

Loads constants using integer as their register type, like it is
done in FS backend.

No shader-db changes in HSW.

Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91716
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit b8d2263c83d29f4626ac0fe0316978aa6262aefb)

8 years agoi965/vec4: Fix saturation errors when coalescing registers
Antia Puentes [Wed, 5 Aug 2015 13:57:33 +0000 (15:57 +0200)]
i965/vec4: Fix saturation errors when coalescing registers

If the register types do not match and the instruction
that contains the final destination is saturated, register
coalescing generated non-equivalent code.

This did not happen when using IR because types usually
matched, but it is visible in nir-vec4.

For example,
   mov      vgrf7:D vgrf2:D
   mov.sat  m4:F vgrf7:F

is coalesced to:
   mov.sat  m4:D vgrf2:D

The patch prevents coalescing in such scenario, unless the
instruction we want to coalesce into is a MOV (without type
conversion implied). In that case, the patch sets the register
types to the type of the final destination.

Shader-db results in HSW (only vec4 instructions shown):

total instructions in shared programs: 1754415 -> 1754416 (0.00%)
instructions in affected programs:     74 -> 75 (1.35%)
helped:                                0
HURT:                                  1
GAINED:                                0
LOST:                                  0

Only one extra instruction in one of the shaders, that comes from
eliminating a saturation error by preventing register coalesce.

Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 79f1a7ae28c37f77e08e550cd077959a2a1f8341)

8 years agoi965/vec4: Don't reswizzle hardware registers
Jason Ekstrand [Thu, 10 Sep 2015 23:19:42 +0000 (16:19 -0700)]
i965/vec4: Don't reswizzle hardware registers

Cc: "11.0 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91719
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1037e0a84f61f4b1815093bcfd548d4b58ca106f)

8 years agonir: Fix a bunch of ralloc parenting errors
Jason Ekstrand [Wed, 9 Sep 2015 20:18:29 +0000 (13:18 -0700)]
nir: Fix a bunch of ralloc parenting errors

As of a10d4937, we would really like things associated with an instruction
to be allocated out of that instruction and not out of the shader.  In
particular, you should be passing the instruction that will ultimately be
holding the source into nir_src_copy rather than an arbitrary memory
context.

We also change the prototypes of nir_dest_copy and nir_alu_src/dest_copy to
explicitly take an instruction so we catch this earlier in the future.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
(cherry picked from commit 8c8fc5f8336c8c79e5890265ae6c03271aa94075)

8 years agodocs: add sha256 checksums for 11.0.0
Emil Velikov [Sat, 12 Sep 2015 12:32:56 +0000 (13:32 +0100)]
docs: add sha256 checksums for 11.0.0

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodocs: Update 11.0.0 release notes
Emil Velikov [Sat, 12 Sep 2015 09:33:49 +0000 (10:33 +0100)]
docs: Update 11.0.0 release notes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 11.0.0(final)
Emil Velikov [Sat, 12 Sep 2015 09:21:51 +0000 (10:21 +0100)]
Update version to 11.0.0(final)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoglsl: Use hash tables for opt_constant_propagation() kill sets.
Kenneth Graunke [Wed, 12 Nov 2014 07:16:13 +0000 (23:16 -0800)]
glsl: Use hash tables for opt_constant_propagation() kill sets.

Cuts compile/link time of the fragment shader in #91857 by 19%
(16.28 -> 13.05).

I didn't bother with the acp sets because they're smaller, but it
might be worth doing as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91857
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 4654439fdd766f79a78fe0d812fd916f5815e7e6)
Nominated-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoi965: Use hash tables for brw_fs_vector_splitting().
Kenneth Graunke [Sat, 5 Sep 2015 07:51:33 +0000 (00:51 -0700)]
i965: Use hash tables for brw_fs_vector_splitting().

Cuts compile/link time of the fragment shader in #91857 by 25%
(21.64 -> 16.28).

v2: Drop unnecessary _mesa_hash_table_destroy call, and use
    refs.ht->entries == 0 rather than ad-hoc checking (suggested by
    Timothy Arceri).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91857
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit e20f30eb5181cddf8286d2247cfaf7e0fac7e417)
Nominated-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoglsl: Use hash tables in opt_constant_variable().
Kenneth Graunke [Sat, 5 Sep 2015 07:22:57 +0000 (00:22 -0700)]
glsl: Use hash tables in opt_constant_variable().

Cuts compile/link time of the fragment shader in bug #91857 by 31%
(31.79 -> 21.64).  It has over 8,000 variables so linked lists are
terrible.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91857
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 2fc0ce293ac58237f02cc5dd2eee4e35abea06b5)
Nominated-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agometa: Always bind the texture
Ian Romanick [Wed, 2 Sep 2015 23:06:58 +0000 (16:06 -0700)]
meta: Always bind the texture

We may have been called from glGenerateTextureMipmap with CurrentUnit
still set to 0, so we don't know when we can skip binding the texture.
Assume that _mesa_BindTexture will be fast if we're rebinding the same
texture.

v2: Remove currentTexUnitSave because it is now unused.  Suggested by
both Neil and Anuj.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91847
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 767c33e88138afa64443417860b264a494eba33d)

8 years agor600g: use pipe_resource::width0 instead pb_buffer::size
Marek Olšák [Sun, 6 Sep 2015 14:40:21 +0000 (16:40 +0200)]
r600g: use pipe_resource::width0 instead pb_buffer::size

pb_buffer::size was aligned by 29aaab2b5f55cc6d9a84f58ce2bb8607e76a9dde,
which broke the CMASK code I think.

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

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 5c6c5b524649997805d0128d4df9dda5e8567cbb)

8 years agoradeonsi: enable VGPR spilling on VI
Marek Olšák [Wed, 2 Sep 2015 17:05:09 +0000 (19:05 +0200)]
radeonsi: enable VGPR spilling on VI

This fixes corruption in Unigine Heaven on VI

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7956eae1c76e298ca1ded46679c1a9bf875ec4ee)

8 years agowinsys/amdgpu: calculate the maximum number of compute units
Marek Olšák [Wed, 2 Sep 2015 17:04:25 +0000 (19:04 +0200)]
winsys/amdgpu: calculate the maximum number of compute units

Required for register spilling.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c6502e880bba00f8a68f004fe6be7a4bc275494a)

8 years agoclover: Avoid using typename to allow compilation of clover by clang
Albert Freeman [Tue, 8 Sep 2015 13:06:40 +0000 (13:06 +0000)]
clover: Avoid using typename to allow compilation of clover by clang

When parsing an variable declaration qualified with the typename
keyword, clang attempted to declare a variable with the type of non
type member "enum type type" of module::argument (within the header
file clover/core/module.hpp) instead of the typed member of
module::argument "enum type".

Replaced "typename" with "enum" to force clang to declare the variable
marg_type with type "enum type" of module::argument.

CC: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Albert Freeman <albertwdfreeman@gmail.com>
(cherry picked from commit 1691ead1b8ae4018a805af58977a43ef90af4203)

8 years agoi965: Advertise 65536 for GL_MAX_UNIFORM_BLOCK_SIZE.
Kenneth Graunke [Tue, 8 Sep 2015 22:41:11 +0000 (15:41 -0700)]
i965: Advertise 65536 for GL_MAX_UNIFORM_BLOCK_SIZE.

Our old value of 16384 is the minimum value.  DirectX apparently
requires 65536 at a minimum; that's also what nVidia and the Intel
Windows driver advertise.  AMD advertises MAX_INT.

Ilia Mirkin noticed that "Shadow Warrior" uses UBOs larger than 16k
on Nouveau, which advertises 65536 bytes for this limit.  Traces
captured on Nouveau don't work on i965 because our lower limit causes
the GLSL linker to reject the captured shaders.  While this isn't
important in and of itself, it does suggest that raising the limit
would be beneficial.

We can read linear buffers up to 2^27 bytes in size, so raising this
should be safe; we could probably even go larger.  For now, matching
nVidia and Intel/Windows seems like a good plan.

We have to reinitialize MaxCombinedUniformComponents as core Mesa will
have set it based on a stale value for MaxUniformBlockSize.

According to Tapani, there's an unreleased game that asserts on this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bf58a2c362d5afdba512f40b3eb300154201c7f0)

8 years agonv50/ir: don't fold immediate into mad if registers are too high
Ilia Mirkin [Thu, 10 Sep 2015 09:02:26 +0000 (05:02 -0400)]
nv50/ir: don't fold immediate into mad if registers are too high

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 74b86b971f3bf9b0482341b07c1cbc2e520fb1d0)

8 years agonv50/ir: fix emission of 8-byte wide interp instruction
Ilia Mirkin [Thu, 10 Sep 2015 07:55:06 +0000 (03:55 -0400)]
nv50/ir: fix emission of 8-byte wide interp instruction

This can come up if the target register number is > 63, which is fairly
rare.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ce28ca713364dbe83cb3c371ca034bc2c2947616)

8 years agonv50/ir: r63 is only 0 if we are using less than 63 registers
Ilia Mirkin [Thu, 10 Sep 2015 07:49:36 +0000 (03:49 -0400)]
nv50/ir: r63 is only 0 if we are using less than 63 registers

It is advantageous to use r63 instead of r127 since r63 can fit into the
shorter encoding. However if we've RA'd over 63 registers, we must use
r127 as the replacement instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 641eda0c792e10c2792730b1833353564479a557)

8 years agonv50/ir: make edge splitting fix up phi node sources
Ilia Mirkin [Thu, 10 Sep 2015 05:54:30 +0000 (01:54 -0400)]
nv50/ir: make edge splitting fix up phi node sources

Unfortunately nv50_ir phi nodes aren't directly connected to the CFG, so
the mapping between source and the actual BB is by inbound edge order.
So when manipulating edges one has to be extremely careful. We were
insufficiently careful when splitting critical edges which resulted in
the phi nodes being confused as to where their sources were coming from.

This primarily manifests itself with the TXL-lowering logic on nv50,
when it is inside of a conditional. I've been unable to trigger the
issue anywhere else so far. This resolves rendering failures
in a number of games like Two Worlds 2, Trine: Enchanted Edition, Trine 2,
XCOM:Enemy Unknown, Stacking. It also improves the situation in
Hearthstone, Sonic Generations, and The Raven: Legacy of a Master Thief.
However more work needs to be done there (splitting a lot more edges
solves it, so it's some other sort of RA-related issue).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90887
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a072ef8748a65d286e9b542bb9ea6e020fdcc7f8)

8 years agonvc0: remove BGRA4 format support
Ilia Mirkin [Thu, 10 Sep 2015 01:50:03 +0000 (21:50 -0400)]
nvc0: remove BGRA4 format support

Something is wrong with the support somewhere. I couldn't get the blob
driver to use it either, although it happily used RGB5_A1.
teximage-colors works, but WoW seems to fail in the menus for drawing
text.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91526
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 342e68dc60eebb20ac1be9f47800ee9e604354f0)

8 years agonvc0: keep track of cb bindings per buffer, use for upload settings
Ilia Mirkin [Wed, 9 Sep 2015 07:17:38 +0000 (03:17 -0400)]
nvc0: keep track of cb bindings per buffer, use for upload settings

CB updates to bound buffers need to go through the CB_DATA endpoints,
otherwise the shader may not notice that the updates happened.
Furthermore, these updates have to go in to the same address as the
bound buffer, otherwise, again, the shader may not notice updates.

So we keep track of all the places where a constbuf is bound, and
iterate over all of them when updating data. If a binding is found that
encompasses the region to be updated, then we use the settings of that
binding for the upload. Otherwise we upload as a regular data update.

This fixes piglit 'arb_uniform_buffer_object-rendering offset' as well
as blurriness in Witcher2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91890
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e50c01d5af305e07110cb4a38d5a655437058f04)

8 years agonv30: Disable msaa unless requested from the env by NV30_MAX_MSAA
Hans de Goede [Wed, 9 Sep 2015 13:52:09 +0000 (15:52 +0200)]
nv30: Disable msaa unless requested from the env by NV30_MAX_MSAA

Some modern apps try to use msaa without keeping in mind the
restrictions on videomem of older cards. Resulting in dmesg saying:

 [ 1197.850642] nouveau E[soffice.bin[3785]] fail ttm_validate
 [ 1197.850648] nouveau E[soffice.bin[3785]] validating bo list
 [ 1197.850654] nouveau E[soffice.bin[3785]] validate: -12

Because we are running out of video memory, after which the program
using the msaa visual freezes, and eventually the entire system freezes.

To work around this we do not allow msaa visauls by default and allow
the user to override this via NV30_MAX_MSAA.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[imirkin: move env var lookup to screen so that it's only done once]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3e9df0e3af7a8a84147ae48f588e9c435bf65b98)

8 years agonv30: Fix color resolving for nv3x cards
Hans de Goede [Wed, 9 Sep 2015 13:52:08 +0000 (15:52 +0200)]
nv30: Fix color resolving for nv3x cards

We do not have a generic blitter on nv3x cards, so we must use the
sifm object for color resolving.

This commit divides the sources and dest surfaces in to tiles which
match the constraints of the sifm object, so that color resolving
will work properly on nv3x cards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ac066bf65cb585a4f6b4a2fb1d055b033f2b94ae)

8 years agoandroid: Always define __STDC_LIMIT_MACROS.
Mauro Rossi [Fri, 21 Aug 2015 21:46:29 +0000 (23:46 +0200)]
android: Always define __STDC_LIMIT_MACROS.

Analogous to commit 02a4fe22b13 (configure.ac: Always define
__STDC_LIMIT_MACROS.)

v2: [Emil Velikov] keep the LLVM specific __STDC_FORMAT_MACROS

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 8056b3ffeb0cdca890cf9cde05dcd5afff4c50fc)

8 years agoandroid: rename LLVM_VERSION_PATCH to MESA_LLVM_VERSION_PATCH
Mauro Rossi [Fri, 21 Aug 2015 21:46:28 +0000 (23:46 +0200)]
android: rename LLVM_VERSION_PATCH to MESA_LLVM_VERSION_PATCH

Fixes: 797f4eacea8(configure.ac: rename LLVM_VERSION_PATCH to avoid
conflict with llvm-config.h)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 5235bfe7b709d5cf0fcd38dff43a97909cfbc38c)

8 years agonouveau: android: add space before PRIx64 macro
Mauro Rossi [Fri, 21 Aug 2015 21:46:27 +0000 (23:46 +0200)]
nouveau: android: add space before PRIx64 macro

Otherwise the android build fails with

   error : unable to find string literal operator ‘operator"" PRIx64’

There are several resources referring to the problem, which is related
to c++11, in our case used when building mesa for lollipop.

http://comments.gmane.org/gmane.comp.graphics.opensg.user/5883

I've not investigated all the semantics, some people even suggested a
bug in the gcc compiler,
I just saw the building error was solved with one little space for
lollipop and no side effect when c+11 not used.

v2: [Emil Velikov] add an alternative commit message from Mauro.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit e838d91b94c3d1d20db62a61bfd9163f675d3139)

8 years agoauxiliary: rework the python generated sources rules
Emil Velikov [Fri, 17 Jul 2015 09:52:35 +0000 (10:52 +0100)]
auxiliary: rework the python generated sources rules

There are a few bits this commit aims to resolve:

One can generalise the mkdir rule to a simple MKDIR_P $(@D) which will
expand appropriately for even if we change the subdir name, and/or add
new rules. We can also drop the explicit $(srcdir) prefix for the
dependency rules, they they are not strictly required, nor used
elsewhere in mesa.

Finally replace $< with explicit filename to be consistent through the
file, and honour PYTHON_FLAGS.

v2: Add comprehensive commit summary/message (Ian, Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 0d39279448bbda6e824bcfd4997b4583bc0481af)

8 years agoglsl: build: remove bogus dependency
Emil Velikov [Wed, 9 Sep 2015 11:40:03 +0000 (12:40 +0100)]
glsl: build: remove bogus dependency

v2: rebase on top of the previous commit - don't touch the LOCAL_PATH
prefix for nir_constant_expressions.h

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c373eaedfc09ff2af7002b64ba0ae8ba71df86a1)

8 years agoglsl: build: use makefile.sources variables when possible
Emil Velikov [Fri, 17 Jul 2015 12:30:51 +0000 (13:30 +0100)]
glsl: build: use makefile.sources variables when possible

Rather than folding one variable within the other only to unwrap them,
just use the ones we need.

v2: bring back LOCAL_PATH prefix for nir_constant_expressions,h

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
(cherry picked from commit a3b05e04921a4fcc05cfc994e415e3ceb39fd184)

8 years agoglsl: automake: reuse $(NIR_GENERATED_FILES) where possible
Emil Velikov [Fri, 17 Jul 2015 12:28:00 +0000 (13:28 +0100)]
glsl: automake: reuse $(NIR_GENERATED_FILES) where possible

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit da5e4559ee3b239d2483645ed54b35aa6628fbaf)

8 years agoglsl: automake: rework the sources generation rules
Emil Velikov [Wed, 9 Sep 2015 11:28:37 +0000 (12:28 +0100)]
glsl: automake: rework the sources generation rules

The glsl equivalent of "mesa: automake: rework the source generation
rules". Plus let's make things consistent and always explicitly provide
the header name.

v2: Rebase on top of reverted "remove custom AM_V_LEX/YACC" (Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9e0594418d8fa47e19bfe57450198d3fa7d087a0)

8 years agomesa: automake: rework the source generation rules
Emil Velikov [Fri, 17 Jul 2015 09:44:30 +0000 (10:44 +0100)]
mesa: automake: rework the source generation rules

Same logic as previous commit applies.

Additionally remove the odd (set -e/mv/INDENT) from the rules.
The last one is the only one we remotely care about, if reading the
generated sources.

Upcoming work from DylanB which will replace the existing python
scripts with ones that produce more readable output anyway.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit fd913f47b7fcc724d8d191f2752f328d037abb20)

8 years agomapi: automake: rework the source generation rules
Emil Velikov [Fri, 17 Jul 2015 09:27:29 +0000 (10:27 +0100)]
mapi: automake: rework the source generation rules

Same logic as previous commit applies. Also fix bogus MESA_MAPI_DIR -
the sources are located in the source dir (duh).

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 96509aa80429db1884a78fae95c169aa40641e84)

8 years agomapi: automake: rework the *api/glapi_mapi_tmp.h rules
Emil Velikov [Wed, 9 Sep 2015 11:14:00 +0000 (12:14 +0100)]
mapi: automake: rework the *api/glapi_mapi_tmp.h rules

Same logic as previous commit applies.

v2: Merge with "inline glapi_gen_mapi define" (Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 449ce5d64f3d0e5840287040755df23e86ce6bb2)

8 years agoutil: automake: rework the format_srgb.c rule
Emil Velikov [Fri, 17 Jul 2015 09:21:06 +0000 (10:21 +0100)]
util: automake: rework the format_srgb.c rule

A handful of changes/cleanups paving the way to bmake support:
 - Remove optional $(srcdir)/ prefix for files in the prereq list.
 - Drop the space after the AM_V_GEN variable.
 - Using $< in a non-suffix rule is a GNU make idiom.
 - Use $(@D) over $(dir $@). The latter is a POSIX standard.

v2: Cosmetic tweaks in the commit summary.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
(cherry picked from commit d65bd7a7be48d7805f68cd45218794f3e4590408)

8 years agoxmlpool: 'promote' LOCALEDIR variable
Emil Velikov [Wed, 15 Jul 2015 09:28:05 +0000 (10:28 +0100)]
xmlpool: 'promote' LOCALEDIR variable

This is the only place in mesa that uses this constuct which seems
to be GNUmake-ism. Attempting to build with POSIX make implementations
(bmake) would fail as below.

--- options.h ---
LOCALEDIR := .
sh: line 2: LOCALEDIR: command not found
*** [options.h] Error code 127

So let's keep things consistent and compatible by making the variable
non target specific.

v2:
 - Bring back LOCALEDIR.
 - Reword the commit message
 - Change mesa-stable tag 10.6 > 11.0

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit c8984a7a4686c2045666d32fbe5733ff5a5c3bd8)

8 years agor600: don't use shader key without verifying shader type (v2)
Dave Airlie [Mon, 7 Sep 2015 22:36:32 +0000 (08:36 +1000)]
r600: don't use shader key without verifying shader type (v2)

Since 7a32652231f96eac14c4bfce02afe77b4132fb77
r600: Turn 'r600_shader_key' struct into union

we were accessing key fields that might be aliased in the union
with other fields, so we should check what shader type we are
compiling for before using key values from it.

v1.1: make it compile
v2: have caffeine, make it work - we don't set type
until later, so don't reference it until we've set it.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 6d2ceb10cd63b89892131a27d238620f00922dfb)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/gallium/drivers/r600/r600_shader.c

8 years agost/mesa: increase viewport bounds limits for GL4 hw
Ilia Mirkin [Tue, 8 Sep 2015 20:58:43 +0000 (16:58 -0400)]
st/mesa: increase viewport bounds limits for GL4 hw

According to the ARB_viewport_array spec, GL4 limit is higher than the
GL3 limit. Also take this opportunity to fix the GL3 limit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 458e55d7c5793b02af8b08ebec90906a829d3f65)

8 years agonvc0: always emit a full shader colormask
Ilia Mirkin [Sun, 6 Sep 2015 08:51:29 +0000 (04:51 -0400)]
nvc0: always emit a full shader colormask

Indications are that if the colormask indicates a single bit set on
fermi, that value will always be read from $r0 instead of a potentially
higher register (if e.g. green is set). Not to upset the counting logic,
always set the header up with a full color mask for each RT. Such a
situation can basically only ever happen with generated blit shaders.

Fixes the following piglit on Fermi (Kepler is unaffected):
  fbo-stencil blit GL_DEPTH32F_STENCIL8

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 39df725f731f75f488c75a4910169beb352213fb)

8 years agonv30: Fix max width / height checks in nv30 sifm code
Hans de Goede [Mon, 7 Sep 2015 19:50:48 +0000 (21:50 +0200)]
nv30: Fix max width / height checks in nv30 sifm code

The sifm object has a limit of 1024x1024 for its input size and 2048x2048
for its output. The code checking this was trying to be clever resulting
in it seeing a surface of e.g 1024x256 being outside of the input size
limit.

This commit fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 87073c69f3e253044bc235f34917aaa89041a63c)

8 years agoi965: Disallow fast blit paths for CopyTexImage with PixelTransfer ops
Chris Wilson [Sat, 5 Sep 2015 18:19:33 +0000 (19:19 +0100)]
i965: Disallow fast blit paths for CopyTexImage with PixelTransfer ops

glCopyTexImage behaves similarly to glReadPixels with respect to the
pixel transfer operations. Therefore if any are set we cannot use the
simple blit-only fast paths.

(Though if would be possible to relax the blorp path to handle
pixel zoom, or we can just enhance meta.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviwewed-by: Iago Toral <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit be519c2d50f4aaa48fdb8b27707114cc5bfd348f)

8 years agost/mesa: don't fall back to 16F when 32F is requested
Ilia Mirkin [Sun, 6 Sep 2015 15:29:00 +0000 (11:29 -0400)]
st/mesa: don't fall back to 16F when 32F is requested

Nothing in the spec allows for the reduced precision, and this also
fixes st_QuerySamplesForFormat for nv50, which does not allow MS8 on
RGBA32F. Now this will be respected instead of reporting MS8 as
supported with an assumption that the format used will be RGBA16F.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit e40f32d5626c87d9e77bbc261df3648cd54bd066)

8 years agoUpdate version to 11.0.0-rc3
Emil Velikov [Sun, 6 Sep 2015 18:30:23 +0000 (19:30 +0100)]
Update version to 11.0.0-rc3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agonouveau: don't mark full range as used on unmap with explicit flush
Ilia Mirkin [Thu, 2 Jul 2015 22:44:18 +0000 (18:44 -0400)]
nouveau: don't mark full range as used on unmap with explicit flush

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit a778831735ea45f789c247c40677cd26adc78e3e)

8 years agonv50: avoid using inline vertex data submit when gl_VertexID is used
Ilia Mirkin [Mon, 24 Aug 2015 15:49:05 +0000 (11:49 -0400)]
nv50: avoid using inline vertex data submit when gl_VertexID is used

The hardware only generates vertexid when vertices come from a VBO. This
fixes:

  vertexid-drawelements
  vertexid-drawarrays

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c830d193db5c90cf0af57ff73606e2aa12aed9a8)

8 years agonv50: don't flush vertex arrays when index buffer changes
Ilia Mirkin [Sat, 4 Jul 2015 00:32:53 +0000 (20:32 -0400)]
nv50: don't flush vertex arrays when index buffer changes

The index buffer is fed in inline over a pushbuf. It's not related to
vertices or any caching that might be done on them.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 4a025c6bc835387a31007fdf30a130e612e54e19)

8 years agonv50: rebind bo to bufctx when invalidating idxbuf storage
Ilia Mirkin [Sat, 4 Jul 2015 00:16:48 +0000 (20:16 -0400)]
nv50: rebind bo to bufctx when invalidating idxbuf storage

There is nothing to be done on a dirty idxbuf, but the bo may have
changed, so we have to rebind it to the bufctx.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 1f62d36ae21043c472fc182fd4b738ec1d54a2d2)

8 years agonv50: clear buffer status on all vertex bufs, not just the first one
Ilia Mirkin [Fri, 3 Jul 2015 23:21:21 +0000 (19:21 -0400)]
nv50: clear buffer status on all vertex bufs, not just the first one

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 114cc18b98b6e016ab1986577aa3df12acc22cca)