OSDN Git Service

android-x86/external-mesa.git
8 years agoandroid: add support for LLVM 3.7.0 for marshmallow
Mauro Rossi [Tue, 22 Dec 2015 12:26:51 +0000 (13:26 +0100)]
android: add support for LLVM 3.7.0 for marshmallow

The changes add support for LLVM 3.7.0 for marshmallow,
while keeping support for LLVM 3.5.0 with lollipop.

MESA_LLVM_VERSION_PATCH=0 is compatible with radeonsi build in lollipop-x86,
since mesa 11.0 and newer do not check anymore for LLVM 3.5.2

This changes, combined with specific R600 patches for external/llvm,
enable building gallium radeonsi driver in marshmallow-x86.

The patch is applicable to 11.2.0devel, 11.1 and 11.0 branches.

8 years agoandroid: build with c++11 on android lollipop
Mauro Rossi [Sat, 22 Aug 2015 09:07:34 +0000 (11:07 +0200)]
android: build with c++11 on android lollipop

lollipop-x86 needs -std=c++11 (build with libcxx),
while kitkat-x86 cannot use -std=c++11

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: a workaround for GL_INVALID_OPERATION (0x502) error
Chih-Wei Huang [Fri, 23 Jan 2015 19:53:48 +0000 (03:53 +0800)]
android: a workaround for GL_INVALID_OPERATION (0x502) error

Inspired by the nice work of Paulo Sergio (pstglia):

"Bypass a check for external target enabled only for images
created with EGL_EXT_image_dma_buf_import - this makes
Android graphical components receive a GL_INVALID_OPERATION (0x502)."

8 years agoi915: Support Android RGBX8888 format for EGL generated images
Sean V Kelley [Mon, 10 Sep 2012 18:52:35 +0000 (11:52 -0700)]
i915: Support Android RGBX8888 format for EGL generated images

Enabled MESA_FORMAT_R8G8B8X8_UNORM (formerly MESA_FORMAT_RGBX8888_REV)
for RGBX with i915.  Android software requires RGBX8888 format to be
supported for software rendering.

Previously had done so for i965 but have requests for i915 support.

Change-Id: I87c3a8e3f206d75d58b63182ed94851749740762
Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
8 years agoi915: enable GL_APPLE_texture_2D_limited_npot in mesa 11.1
Mauro Rossi [Mon, 4 Jan 2016 16:40:44 +0000 (17:40 +0100)]
i915: enable GL_APPLE_texture_2D_limited_npot in mesa 11.1

This is the port of Chia-I Wu commit 79ac0e to mesa 11.1 branch,
where the extensions went to a dedicated file extensions_table.h

Original commit message:

"Enable GL_ARB_texture_non_power_of_two for GLESv1 to advertise
GL_APPLE_texture_2D_limited_npo. The former is actually a superset of
the latter, but we really want to enable NPOT support in some way."

8 years agoandroid: advertise GL_ARB_texture_non_power_of_two in mesa 11.1
Mauro Rossi [Mon, 4 Jan 2016 16:37:39 +0000 (17:37 +0100)]
android: advertise GL_ARB_texture_non_power_of_two in mesa 11.1

This is the port of Chia-I Wu commit 62873a to mesa 11.1 branch,
where the extensions went to a dedicated file extensions_table.h

Original commit message:

"It maps to DisplayHardware::NPOT_EXTENSION in SurfaceFlinger. Does not
seem to matter when EGL_ANDROID_image_native_buffer is available."

8 years agodocs: add sha256 checksums for 13.0.0
Emil Velikov [Tue, 1 Nov 2016 16:05:32 +0000 (16:05 +0000)]
docs: add sha256 checksums for 13.0.0

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodocs: Update 13.0.0 release notes
Emil Velikov [Tue, 1 Nov 2016 15:55:24 +0000 (15:55 +0000)]
docs: Update 13.0.0 release notes

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoUpdate version to 13.0.0(final)
Emil Velikov [Tue, 1 Nov 2016 15:47:33 +0000 (15:47 +0000)]
Update version to 13.0.0(final)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoutil: Include string.h in bitscan.h.
Vinson Lee [Thu, 20 Oct 2016 01:03:12 +0000 (18:03 -0700)]
util: Include string.h in bitscan.h.

Fix build error with clang.

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
           ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
                 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97952
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 889ee4da05400687a6c5296a7632dc26f1d61924)

8 years agost/omx/dec: disable tunnel for size different case
Leo Liu [Mon, 24 Oct 2016 18:03:11 +0000 (14:03 -0400)]
st/omx/dec: disable tunnel for size different case

When the video coded size is different from frame size, we need the result
buffers are same as coded size, which are not size compatible with encode
required size, so that simply use no tunnel for this case instead of frame
by frame converting.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 06e3cd6a45ae2ad19f77e0f283c46d5f85112847)

8 years agost/omx/dec: result buffers size should match codec decoder size
Leo Liu [Mon, 24 Oct 2016 18:03:10 +0000 (14:03 -0400)]
st/omx/dec: result buffers size should match codec decoder size

Otherwise fails the check of matching between decoder size and buffers
size in kernel.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d9b2c4048d55011bb04bd9848a3b47af7216389f)

8 years agoi965/fs/generator: Don't use the address immediate for MOV_INDIRECT
Jason Ekstrand [Fri, 28 Oct 2016 21:48:53 +0000 (14:48 -0700)]
i965/fs/generator: Don't use the address immediate for MOV_INDIRECT

The address immediate field is only 9 bits and, since the value is in
bytes, the highest GRF we can point to with it is g15.  This makes it
pretty close to useless for MOV_INDIRECT.  There were already piles of
restrictions preventing us from using it prior to Broadwell, so let's get
rid of the gen8+ code path entirely.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97779
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 2a4a86862c949055c71637429f6d5f2e725d07d8)

8 years agoradeonsi: fix behavior of GLSL findLSB(0)
Marek Olšák [Tue, 25 Oct 2016 23:08:15 +0000 (01:08 +0200)]
radeonsi: fix behavior of GLSL findLSB(0)

12.0 and older need the same fix but elsewhere.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 4bf45a6079b5cc6b0360b637c0c7baa456b8257d)

8 years agoradeonsi: set VGT_GS_ONCHIP_CNTL on CIK and later
Marek Olšák [Tue, 25 Oct 2016 19:47:52 +0000 (21:47 +0200)]
radeonsi: set VGT_GS_ONCHIP_CNTL on CIK and later

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e24dc4316487eeaa6ee8aa5c709546d814e96f03)

8 years agoglsl: Improve accuracy of alpha scaling in advanced blend lowering.
Kenneth Graunke [Fri, 28 Oct 2016 03:12:56 +0000 (20:12 -0700)]
glsl: Improve accuracy of alpha scaling in advanced blend lowering.

When blending with GL_COLORBURN_KHR and these colors:

   dst = <0.372549027, 0.372549027, 0.372549027, 0.372549027>
   src = <0.09375, 0.046875, 0.0, 0.375>

the normalized dst value became 0.99999994 (due to precision problems
in the floating point divide of rgb by alpha).  This caused the color
burn equation to fail the dst >= 1.0 comparison.  The blue channel would
then fall through to the dst < 1.0 && src >= 0 comparison, which was
true, since src.b == 0.  This produced a factor of 0.0 instead of 1.0.

This is an inherent numerical instability in the color burn and dodge
equations - depending on the precision of alpha scaling, the value can
be either 0.0 or 1.0.  Technically, GLSL floating point division doesn't
even guarantee that 0.372549027 / 0.372549027 = 1.0.  So arguably, the
CTS should allow either value.  I've filed a bug at Khronos for further
discussion (linked below).

In the meantime, this patch improves the precision of alpha scaling by
replacing the division with (rgb == alpha ? 1.0 : rgb / alpha).  We may
not need this long term, but for now, it fixes the following CTS tests:

ES31-CTS.blend_equation_advanced.blend_specific.GL_COLORBURN_KHR
ES31-CTS.blend_equation_advanced.blend_all.GL_COLORBURN_KHR_all_qualifier

Cc: currojerez@riseup.net
Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16042
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit e6aeeace6953a7007d98082e3f44bff40a44106d)

8 years agointel/blorp: Rework our usage of ralloc when compiling shaders
Jason Ekstrand [Fri, 21 Oct 2016 19:09:38 +0000 (12:09 -0700)]
intel/blorp: Rework our usage of ralloc when compiling shaders

Previously, we were creating the shader with a NULL ralloc context and then
trusting in blorp_compile_fs to clean it up.  The only problem was that
blorp_compile_fs didn't clean up its context properly so we were leaking.
When I went to fix that, I realized that it couldn't because it has to
return the shader binary which is allocated off of that context and used by
the caller.  The solution is to make blorp_compile_fs take a ralloc
context, allocate the nir_shaders directly off that context, and clean it
all up in whatever function creates the shader and calls blorp_compile_fs.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: "12.0, 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 43dadb6edd5e3e3e10b1198184a9f75556edad49)
[Emil Velikov: resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/intel/blorp/blorp_clear.c

8 years agointel/blorp: Rename compile_nir_shader to compile_fs
Jason Ekstrand [Fri, 21 Oct 2016 19:04:25 +0000 (12:04 -0700)]
intel/blorp: Rename compile_nir_shader to compile_fs

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit ab92480272bc34d943d28506cc36759e141b4371)

8 years agointel/blorp: Fix a couple asserts around image copy rectangles
Jason Ekstrand [Wed, 26 Oct 2016 05:47:21 +0000 (22:47 -0700)]
intel/blorp: Fix a couple asserts around image copy rectangles

With dealing with rectangles in compressed images, you can have a width or
height that isn't a multiple of the corresponding compression block
dimension but only if that edge of your rectangle is on the edge of the
image.  When we call convert_to_single_slice, it creates an 2-D image and a
set of tile offsets into that image.  When detecting the right-edge and
bottom-edge cases, we weren't including the tile offsets so the assert
would misfire.  This caused crashes in a few UE4 demos

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reported-by: "Eero Tamminen" <eero.t.tamminen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98431
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Tested-by: "Eero Tamminen" <eero.t.tamminen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 4964a5149b7776ce27aaeab2be0c2ebf41ded740)

8 years agonvc0/ir: fix emission of IMAD with NEG modifiers
Samuel Pitoiset [Wed, 26 Oct 2016 21:10:53 +0000 (23:10 +0200)]
nvc0/ir: fix emission of IMAD with NEG modifiers

The emitter tried to emit sub instead of subr when src0 has
actually a NEG modifier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0 12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 84e946380b2d5ddc62a107b667be39abf1932704)

8 years agoUpdate version to 13.0.0-rc3
Emil Velikov [Mon, 31 Oct 2016 11:53:03 +0000 (11:53 +0000)]
Update version to 13.0.0-rc3

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoglsl: update default precision qualifier when it is set in the shader
Samuel Iglesias Gonsálvez [Fri, 21 Oct 2016 06:23:59 +0000 (08:23 +0200)]
glsl: update default precision qualifier when it is set in the shader

Default precision qualifier for a data type could be set several times
inside a shader. This patch allows to update the default precision
qualifier for the given type that is saved in the symbol table.

If it is not in the symbol table, just add it.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 0e742926c6895dcaf8bdbe43022c8a0bc74fdd96)

8 years agomesa/program: Add _mesa_symbol_table_replace_symbol()
Samuel Iglesias Gonsálvez [Thu, 20 Oct 2016 07:04:59 +0000 (09:04 +0200)]
mesa/program: Add _mesa_symbol_table_replace_symbol()

This function allows to modify an existing symbol.

v2:
- Remove namespace usage now that it was deleted.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit dfbdb2c0b3559c46d93f10d636a88b9541304fc7)
Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoglsl/mesa: remove unused namespace support from the symbol table
Timothy Arceri [Fri, 21 Oct 2016 05:50:52 +0000 (16:50 +1100)]
glsl/mesa: remove unused namespace support from the symbol table

Namespace support seems to have been unused for a very long time.

Previously the hash table entry was never removed and the symbol name
wasn't freed until the symbol table was destroyed.

In theory this could reduced the number of times we need to copy a string
as duplicate names are reused. However in practice there is likely only a
limited number of symbols that are the same and this is likely to cause
other less than optimal behaviour such as the hash_table continuously
growing.

Along with dropping namespace support this change removes entries from
the hash table as they become unused.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
(cherry picked from commit 6dbe8a1b9fd750b4c1bb600a0bb43129d95e6eca)
Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoglsl: Size TCS->TES unsized arrays to gl_MaxPatchVertices for queries.
Kenneth Graunke [Tue, 25 Oct 2016 10:38:54 +0000 (03:38 -0700)]
glsl: Size TCS->TES unsized arrays to gl_MaxPatchVertices for queries.

SSO validation and other program interface queries want to see that
unsized (non-patch) TCS output/TES input arrays are implicitly sized
to gl_MaxPatchVertices.

By the time we create the program resource lists, we've sized the arrays
to their actual size.  (We try to create TCS output arrays to match the
output patch size right away, and at this point, we should have shrunk
TES input arrays.)  One option would be to keep them sized to
gl_MaxPatchVertices, and defer shrinking them.  But that's a big change,
and I don't think it's a good idea.

Instead, this patch introduces a new ir_variable flag which indicates
the variable is implicitly to gl_MaxPatchVertices.  Then, the linker
munges the types when creating the resource list, ignoring the size
in the IR's types.  Basically, lie about it for resource queries.
It's ugly, but I think it ought to work.

We probably could use var->data.implicit_sized_array for this, but
I opted for a separate bit to try and avoid convoluting the existing
SSBO handling.  They're similar in concept, but share none of the
same code...

Fixes:
ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage
and the ES32-CTS and ESEXT-CTS variants.

v2: Add a comment (requested by Timothy, written by me).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 173558445dce26ce641faf260a17696221acf23d)

8 years agoglsl: Pass ctx to program interface query helper functions.
Kenneth Graunke [Tue, 25 Oct 2016 10:46:51 +0000 (03:46 -0700)]
glsl: Pass ctx to program interface query helper functions.

The next commit will use this in add_shader_variable - this just
separates out some of the mechanical changes for easier review.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 34fd2ffed8c7acfe1b19247eb3b98c3e754680b2)

8 years agoegl: set preserved behavior for surface only if config supports it
Tapani Pälli [Wed, 26 Oct 2016 10:54:51 +0000 (13:54 +0300)]
egl: set preserved behavior for surface only if config supports it

Otherwise we can end up with mismatching behavior between config and
surface when client queries surface attributes. As example, configs
for DRI3 do not support preserved behavior but here we were setting
preserved behavior for pixmap and pbuffer.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 2035930966b05a7c4dd1f6559d66b5a3b41e01a5)

8 years agoradv/ac/llvm: trim texture return values
Dave Airlie [Mon, 24 Oct 2016 20:53:03 +0000 (06:53 +1000)]
radv/ac/llvm: trim texture return values

The intrinsic engine asserts in llvm due to this,
as we put a vec4 into a vec1, and the next instruction
isn't expecting it.

So trim the vector at the end before inserting it.

Reported-by: Christoph Haag <haagch+mesadev@frickel.club>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d548fa882b865b8e5052954b872e392312c38ab8)

8 years agonvc0/ir: fix emission of SHLADD with NEG modifiers
Samuel Pitoiset [Fri, 21 Oct 2016 15:43:00 +0000 (17:43 +0200)]
nvc0/ir: fix emission of SHLADD with NEG modifiers

This affects GF100:GK110 chipsets, but not GM107+ where the
logic is a bit different. The emitters tried to emit sub
instead of subr when src0 has a NEG modifier.

This fixes the following piglit tests glsl-fs-loop-nested
and glsl-vs-loop-nested.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1ec7227d44dceae8de7b93f846bbd33d66007909)

8 years agoegl/dri2: swap_buffers_with_damage falls back to swap_buffers
Eric Engestrom [Mon, 24 Oct 2016 22:41:00 +0000 (23:41 +0100)]
egl/dri2: swap_buffers_with_damage falls back to swap_buffers

Since commit 0a606a400fe3 ("egl: add eglSwapBuffersWithDamageKHR"),
Android has been broken because the function eglSwapBuffersWithDamageKHR
is provided regardless of the extension being present. Also, the Android
meta-EGL always advertises the extension regardless of the underlying
EGL implementation. As there doesn't seem to be a simple way
conditionally make the EGL function ptr NULL, just implement a brain
dead version of eglSwapBuffersWithDamage{KHR,EXT}.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
CC: Rob Clark <robdclark@gmail.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Rob Herring <robh@kernel.org>
[Emil Velikov: copy the original commit message from Rob's patch]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 4fa799ae04c02b77176797c854f9d1b9b4290a2e)

8 years agost/mesa: allow multiple concurrent waiters in ClientWaitSync
Marek Olšák [Tue, 25 Oct 2016 11:10:49 +0000 (13:10 +0200)]
st/mesa: allow multiple concurrent waiters in ClientWaitSync

so->fence can be unreferenced by one thread while another thread is
somewhere in ClientWaitSync and expecting so->fence to be non-NULL.

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

Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit b687f766fddb7b39479cd9ee0427984029ea3559)

8 years agost/mesa: unduplicate st_check_sync code
Marek Olšák [Tue, 25 Oct 2016 10:58:03 +0000 (12:58 +0200)]
st/mesa: unduplicate st_check_sync code

It's the same as st_client_wait_sync. Discovered by Michel.
This is needed to make the following fix simpler.

Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit f240ad98bc05281ea7013d91973cb5f932ae9434)

8 years agowinsys/amdgpu: fix radeon_surf::macro_tile_index for imported textures
Marek Olšák [Mon, 24 Oct 2016 17:05:10 +0000 (19:05 +0200)]
winsys/amdgpu: fix radeon_surf::macro_tile_index for imported textures

Maybe this is why SDMA has been broken for many amdgpu users?

SDMA is the only block which is used with imported textures and relies
on this variable. DB also uses it, but it doesn't get imported textures,
so it's unaffected.

I do get SDMA failures on Tonga before this patch if R600_DEBUG=testdma
is changed to use imported textures.

Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6ec3b2a4b1d41b83a4721d06b42c49f55e695cbf)

8 years agogallium/radeon: make sure the address of separate CMASK is aligned properly
Marek Olšák [Mon, 24 Oct 2016 19:16:11 +0000 (21:16 +0200)]
gallium/radeon: make sure the address of separate CMASK is aligned properly

This should fix random GPU hangs on Hawaii and Fiji.

Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit dce05b342355eac9296ee7110385b16d6edb059d)

8 years agogallium/radeon: fix incorrect bpe use in si_set_optimal_micro_tile_mode
Marek Olšák [Sun, 23 Oct 2016 13:29:18 +0000 (15:29 +0200)]
gallium/radeon: fix incorrect bpe use in si_set_optimal_micro_tile_mode

Oh my god, I wonder what catastrophic issues this was causing on SI.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 8a21f52d73936e23a314a288a36782a698c7c1b9)

8 years agovulkan/wsi/wayland: fix ARGB window support
Fredrik Höglund [Fri, 21 Oct 2016 17:07:37 +0000 (19:07 +0200)]
vulkan/wsi/wayland: fix ARGB window support

Use an ARGB format for the DRM buffer when the compositeAlpha field
in VkSwapchainCreateInfoKHR is set to
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 68db0fe0346386c8d231eb81da6340b24b7878b0)

8 years agovulkan/wsi/x11: fix ARGB window support
Fredrik Höglund [Fri, 21 Oct 2016 17:07:36 +0000 (19:07 +0200)]
vulkan/wsi/x11: fix ARGB window support

Pass the correct depth to xcb_dri3_pixmap_from_buffer_checked().
Otherwise xcb_present_pixmap() fails with a BadMatch error.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 972670c2007c1c5a51b4f0876d31476858f79351)

8 years agoradv: mark the fence as submitted and signalled in vkAcquireNextImageKHR
Fredrik Höglund [Tue, 25 Oct 2016 18:31:41 +0000 (20:31 +0200)]
radv: mark the fence as submitted and signalled in vkAcquireNextImageKHR

This stops the debug layers from complaining when fences are used to
throttle image acquisition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0a153f4ee472f8f17575bbfe05f1c96fb5ecf1ea)

8 years agoradv: Replace "abi_versions" with correct "api_version".
Matt Turner [Tue, 25 Oct 2016 18:49:33 +0000 (11:49 -0700)]
radv: Replace "abi_versions" with correct "api_version".

git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 14aac061e92fe57d1ee61843c1ccd1b275d8ca76)

8 years agoanv: Replace "abi_versions" with correct "api_version".
Matt Turner [Tue, 25 Oct 2016 18:44:43 +0000 (11:44 -0700)]
anv: Replace "abi_versions" with correct "api_version".

git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 07755237d36754cb44c32e17e32cf1bc551d2373)

8 years agonvc0: use correct bufctx when invalidating CP textures
Samuel Pitoiset [Tue, 25 Oct 2016 11:24:16 +0000 (13:24 +0200)]
nvc0: use correct bufctx when invalidating CP textures

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7b2712c367891e96384226a1fa94679a814235d0)

8 years agomesa: fix error handling in DrawBuffers
Tapani Pälli [Fri, 7 Oct 2016 07:08:21 +0000 (10:08 +0300)]
mesa: fix error handling in DrawBuffers

Patch rearranges error checking so that enum checking provided via
destmask happens before other checks. It needs to be done in this
order because other error checks do not work properly if there were
invalid enums passed.

Patch also refines one existing check and it's documentation to match
GLES 3.0 spec (also in later specs). This was somewhat mysteriously
referring to desktop GL but had a check for gles3.

Fixes following dEQP tests:

   dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers

no CI regressions observed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit a1652a059edc5a5f0f4b0836ba310a22e094bd85)

8 years agoegl: add check that eglCreateContext gets a valid config
Tapani Pälli [Thu, 20 Oct 2016 11:11:16 +0000 (14:11 +0300)]
egl: add check that eglCreateContext gets a valid config

Fixes following dEQP test:

   dEQP-EGL.functional.negative_api.create_context

v2: don't break EGL_KHR_no_config_context (Eric Engestrom)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5876f3c85a61d73bb4863331bd641152a40a7b0c)

8 years agoRevert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"
Tapani Pälli [Thu, 20 Oct 2016 16:57:01 +0000 (19:57 +0300)]
Revert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"

This reverts commit b1d636aa007c0c354a217024b4befe15cfb5149f, previous
commit sets these values for all egl configs.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 1ef787339774bc7f1cc9c1615722f944005e070c)

8 years agoegl/dri2: set max values for pbuffer width and height
Tapani Pälli [Thu, 20 Oct 2016 07:33:33 +0000 (10:33 +0300)]
egl/dri2: set max values for pbuffer width and height

While these max values were previously fixed for pbuffer creation, this
change makes also eglGetConfigAttrib() return correct values.

Fixes following dEQP tests:

   dEQP-EGL.functional.create_surface.pbuffer.rgb888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgb888_depth_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b91e1e38e87b372d409469dfe00ace76c8febd34)

8 years agoi965: Drop nir_inputs from fs_visitor.
Kenneth Graunke [Mon, 24 Oct 2016 18:25:25 +0000 (11:25 -0700)]
i965: Drop nir_inputs from fs_visitor.

It's unused.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 41034abfe63012784c9e9e36856d878928cecd99)

8 years agoi965: Don't use nir_assign_var_locations for VS/TES/GS outputs.
Kenneth Graunke [Thu, 13 Oct 2016 05:41:09 +0000 (22:41 -0700)]
i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.

Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.

v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 59864e8e02057cc6fa0448a8af067a3cf53389da)

8 years agoi965: Make split_virtual_grfs() call compact_virtual_grfs().
Kenneth Graunke [Sat, 15 Oct 2016 10:18:36 +0000 (03:18 -0700)]
i965: Make split_virtual_grfs() call compact_virtual_grfs().

Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE).  This is
required by the register allocator, as we have to create classes for
each size of VGRF.

We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE,
but we must ensure that they are splittable.  split_virtual_grfs()
asserts that the post-splitting register size is in range.

Unfortunately, these trip for completely dead registers which are too
large - we only set split points for live registers.  So dead ones are
never split, and if they happened to be too large, they'd trip asserts.

To fix this, call compact_virtual_grfs() to eliminate dead registers
before splitting.

v2: Add a comment written by Iago.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 27715c73ff84349466f62df0023863acd477f262)

8 years agoi965: Drop unnecessary switch statement in nir_setup_outputs()
Kenneth Graunke [Thu, 13 Oct 2016 05:30:30 +0000 (22:30 -0700)]
i965: Drop unnecessary switch statement in nir_setup_outputs()

TCS and FS are skipped above.  CS has no output variables.
All remaining cases take the same path.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 3728ee000aecb19793dec56d45aff9d6cfce3e5b)

8 years agost/nine: Fix locking CubeTexture surfaces.
Axel Davy [Sat, 22 Oct 2016 10:00:40 +0000 (12:00 +0200)]
st/nine: Fix locking CubeTexture surfaces.

Only one face of Cubetextures was locked when in DEFAULT Pool.
Fixes:
https://github.com/iXit/Mesa-3D/issues/129

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit eed605a473554575305e1bf10c3641761a85feb9)

8 years agost/nine: Fix mistake in Volume9 UnlockBox
Axel Davy [Sat, 22 Oct 2016 09:59:11 +0000 (11:59 +0200)]
st/nine: Fix mistake in Volume9 UnlockBox

In the format fallback path,
the height was used instead of the depth.

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit fe7bb46134162c9a9a18832f1746991aa78121e8)

8 years agost/nine: Fix leak with integer and boolean constants
Axel Davy [Tue, 18 Oct 2016 21:05:02 +0000 (23:05 +0200)]
st/nine: Fix leak with integer and boolean constants

Leak introduced by:
a83dce01284f220b1bf932774730e13fca6cdd20

The patch also moves the part to
release changed.vs_const_i and changed.vs_const_b
before the if (!cb.buffer_size) check,
to avoid reuploading every draw call if
integer or boolean constants are dirty, but the shaders
use no constants.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
CC: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 25beccb379731b0e6fc728982190779da47aa6fd)

8 years agost/mesa: cleanup and fix primitive restart for indirect draws
Nicolai Hähnle [Thu, 20 Oct 2016 11:02:22 +0000 (13:02 +0200)]
st/mesa: cleanup and fix primitive restart for indirect draws

There are three intended functional changes here:

1. OpenGL 4.5 clarifies that primitive restart should only apply with index
   buffers, so make that change explicit in the indirect draw path.

2. Make PrimitiveRestartFixedIndex work with indirect draws.

3. The change where primitive_restart is only set when the restart index can
   actually have an effect (based on the size of indices) is also applied for
   indirect draws.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 3d6b5dee3a0c9c077d68e5567b95f22b627be07e)

8 years agocherry-ignore: add mapi VISILITY_CFLAGS patch
Emil Velikov [Thu, 27 Oct 2016 09:36:07 +0000 (10:36 +0100)]
cherry-ignore: add mapi VISILITY_CFLAGS patch

Cherry-picked without -x

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoUpdate version to 13.0.0-rc2
Emil Velikov [Mon, 24 Oct 2016 11:09:15 +0000 (12:09 +0100)]
Update version to 13.0.0-rc2

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agomapi: automake: set VISIBILITY_CFLAGS for shared glapi
Jonathan Gray [Sat, 22 Oct 2016 07:19:53 +0000 (18:19 +1100)]
mapi: automake: set VISIBILITY_CFLAGS for shared glapi

shared glapi was previously built without setting CFLAGS for
AM_CFLAGS and VISIBILITY_CFLAGS.

This resulted in symbols being exported that shouldn't be.

The x86 and sparc assembly versions of the dispatch table partially
mitigated this by using .hidden.  Otherwise shared_dispatch_stub_*
were being exported.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "11.2 12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoanv: automake: cleanup the generated json file during make clean
Emil Velikov [Mon, 24 Oct 2016 10:27:44 +0000 (11:27 +0100)]
anv: automake: cleanup the generated json file during make clean

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 8df581520a823564be0ab5af7dbb7d501b1c9670)

Conflicts:
src/intel/vulkan/Makefile.am

8 years agoegl/wayland: add missing destroy_window callback
Stencel, Joanna [Mon, 24 Oct 2016 08:48:11 +0000 (09:48 +0100)]
egl/wayland: add missing destroy_window callback

The original patch by Joanna added the function pointer and callback yet
things got only partially applied - the infra was added, but the
implementation was missing.

Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Fixes: 690ead4a135 ("egl/wayland-egl: Fix for segfault in
dri2_wl_destroy_surface.")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 2e0ab61e29c4b44d349ab433c899b691a9b12f68)

8 years agoautomake: don't forget to pick wglext.h in the tarball
Emil Velikov [Thu, 20 Oct 2016 17:41:22 +0000 (18:41 +0100)]
automake: don't forget to pick wglext.h in the tarball

Earlier commit reworked the header install rules, to ensure that the
correct ones are installed only as needed.

By doing so it dropped a wildcard which was effectively including the
wglext.h header in the tarball.

Add the header to the top-level noinst_HEADERS, since the it is not
meant to be installed (autoconf is not used on Windows plaforms).

Fixes: a89faa2022f ("autoconf: Make header install distinct for various
APIs (v2)")
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Cc: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 3511a86111866f7233a337a24c9c6442b9aa05e6)

8 years agoradv: allow cmask transitions without fast clear
Dave Airlie [Thu, 20 Oct 2016 02:05:44 +0000 (12:05 +1000)]
radv: allow cmask transitions without fast clear

This fixes
dEQP-VK.pipeline.multisample.sampled_image*

These all render to multisampled image, and then
sample from it, so we must transition it correctly,
since we have a cmask and fmask this will cause
the correct transition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit a969548f59342330badf78ec7721a1ead7599a29)

8 years agoanv: Suffix the intel_icd file with the host CPU
Jason Ekstrand [Thu, 20 Oct 2016 22:46:21 +0000 (15:46 -0700)]
anv: Suffix the intel_icd file with the host CPU

Vulkan has a multi-arch problem... The idea behind the Vulkan loader is
that you have a little json file on your disk that tells the loader where
to find drivers.  The loader looks for these json files in standard
locations, and then goes and loads the my_driver.so's that they specify.
This allows you as a driver implementer to put their driver wherever on the
disk they want so long as the ICD points in the right place.

For a multi-arch system, however, you may have multiple libvulkan_intel.so
files installed that the loader needs to pick depending on architecture.
Since the ICD file format does not specify any architecture information,
you can't tell the loader where to find the 32-bit version vs. the 64-bit
version.  The way that packagers have been dealing with this is to place
libvulkan_intel.so in the top level lib directory and provide just a name
(and no path) to the loader.  It will then use the regular system search
paths and find the correct driver.  While this solution works fine for
distro-installed Vulkan drivers, it doesn't work so well for user-installed
drivers because they may put it in /opt or $HOME/.local or some other more
exotic location.  In this case, you can't use an ICD json file with just a
library name because it doesn't know where to find it; you also have to add
that to your library lookup path via LD_LIBRARY_PATH or similar.

This patch handles both use-cases by taking advantage of the fact that the
loader dlopen()s each of the drivers and, if one dlopen() calls fails, it
silently continues on to open other drivers.  By suffixing the icd file, we
can provide two different json files: intel_icd.x86_64.json and
intel_icd.i686.json with different paths.  Since dlopen() will only succeed
on the libvulkan_intel.so of the right arch, the loader will happily ignore
the others and load that one.  This allows us to properly handle multi-arch
while still providing a full path so user installs will work fine.

I tested this on my Fedora 25 machine with 32 and 64-bit builds of our
Vulkan driver installed and 32 and 64-bit builds of crucible.  It seems to
work just fine.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d96345de989c8f9a0328cdc3588bfe186154c8ea)

Squashed with commit:

anv: Always use the full driver path in the intel_icd.*.json

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7ea4ef8849c5cc158adbdff1187b91f591552196)

Squashed with commit:

configure: Get rid of the --disable-vulkan-icd-full-driver-path flag

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3f05fc62f924c051bdb883482452fb37650d5768)

8 years agoRevert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""
Francisco Jerez [Wed, 19 Oct 2016 03:44:10 +0000 (20:44 -0700)]
Revert "Revert "mapi: export all GLES 3.2 functions in libGLESv2.so""

This reverts commit 85e9bbc14d93fa7166c9ae075ee7ae29a8313e3f.  The
previous commit should help with the scons build failure caused by the
original commit.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 811eb7f178b8b85ac299121ac09a3180b9b55da2)

8 years agoglapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 category.
Francisco Jerez [Tue, 18 Oct 2016 21:53:20 +0000 (14:53 -0700)]
glapi: Move PrimitiveBoundingBox and BlendBarrier definitions into ES3.2 category.

These two GLES 3.2 entry points were being defined in the category of
the ARB_ES3_2_compatibility and KHR_blend_equation_advanced extensions
respectively instead of in the ES3.2 category.  Defining them in the
ES3.2 category makes sure that the gl_procs.py generator emits
declarations in the glprocs.h header file for the unsuffixed GLES-only
entry points that PrimitiveBoundingBoxARB and BlendBarrierKHR
respectively alias.  This should avoid a compilation failure during
scons builds in combination with "mapi: export all GLES 3.2 functions
in libGLESv2.so".

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 15a084a03998c5c86206137fdaf6f43b5f98485a)

8 years agonvc0: do not break 3D state by pushing MS coordinates on Fermi
Samuel Pitoiset [Wed, 19 Oct 2016 22:41:00 +0000 (00:41 +0200)]
nvc0: do not break 3D state by pushing MS coordinates on Fermi

Long story short, 3D and CP are aliased on Fermi and initializing
compute after pushing the MS sample coordinate offsets seems to
corrupt 3D state for weird reasons.

I still don't have the faintest clue what is going on, but
this seems to only affect Fermi generation. A possible fix
could be to use two different channels, one for 3D and one
for CP.

This fixes a bunch of regressions pinpointed by piglit.

Fixes: "nvc0: fix up image support for allowing multiple samples"
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 42273edf79c2500957f51690499aa3405cc689db)

8 years agoradeonsi: fix 64-bit loads from LDS
Nicolai Hähnle [Tue, 18 Oct 2016 16:40:38 +0000 (18:40 +0200)]
radeonsi: fix 64-bit loads from LDS

Fixes spec/arb_tessellation_shader/execution/dvec[23]-vs-tcs-tes, among
others.

Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 4a2dbfff05f7be271c2aa72e783e24b31906db51)

8 years agost/mesa: only set primitive_restart when the restart index is in range
Nicolai Hähnle [Wed, 19 Oct 2016 16:14:48 +0000 (18:14 +0200)]
st/mesa: only set primitive_restart when the restart index is in range

Even when enabled, primitive restart has no effect when the restart index
is larger than the representable values in the index buffer.

Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert
for radeonsi VI.

v2: add an explanatory comment

Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
(cherry picked from commit bfa50f88cea2ba9f4dc4b825828d2c8f02866fc3)

8 years agost/glsl_to_tgsi: sort input and output decls by TGSI index
Nicolai Hähnle [Tue, 18 Oct 2016 15:35:45 +0000 (17:35 +0200)]
st/glsl_to_tgsi: sort input and output decls by TGSI index

Fixes a regression introduced by commit 777dcf81b.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98307
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3d9b57e49304f9690c4a2b50afb8cdd4d253a1df)

8 years agost/glsl_to_tgsi: fix block copies of arrays of structs
Nicolai Hähnle [Sun, 16 Oct 2016 15:34:33 +0000 (17:34 +0200)]
st/glsl_to_tgsi: fix block copies of arrays of structs

Use a full writemask in this case. This is relevant e.g. when a function
has an inout argument which is an array of structs.

v2: use C-style comment (Timothy Arceri)

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a1895685f8f341e7facf3c5705bdee99860e3082)

8 years agost/glsl_to_tgsi: fix block copies of arrays of doubles
Nicolai Hähnle [Sun, 16 Oct 2016 15:33:51 +0000 (17:33 +0200)]
st/glsl_to_tgsi: fix block copies of arrays of doubles

Set the type of the left-hand side to the same as the right-hand side,
so that when the base type is double, the writemask of the MOV instruction
is properly fixed up.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ca592af880b71feb8ebbf79f704380d0deb47b33)

8 years agonv50/ir: process texture offset sources as regular sources
Ilia Mirkin [Wed, 19 Oct 2016 05:20:03 +0000 (01:20 -0400)]
nv50/ir: process texture offset sources as regular sources

With ARB_gpu_shader5, texture offsets can be any source, including TEMPs
and IN's. Make sure to process them as regular sources so that we pick
up masks, etc.

This should fix some CTS tests that feed offsets directly to
textureGatherOffset, and we were not picking up the input use, thus not
advertising it in the shader header.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cd45d758ff87305ceecca899fe7325779bb6755b)

8 years agonv50,nvc0: avoid reading out of bounds when getting bogus so info
Ilia Mirkin [Wed, 19 Oct 2016 04:05:26 +0000 (00:05 -0400)]
nv50,nvc0: avoid reading out of bounds when getting bogus so info

The state tracker tries to attach the info to the wrong shader. This is
easy enough to protect against.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 313fba5ee1de9416930e45da8aff63a24763940b)

8 years agowsi/wayland: fix error path
Eric Engestrom [Wed, 19 Oct 2016 23:09:11 +0000 (00:09 +0100)]
wsi/wayland: fix error path

Fixes: 1720bbd353d87412754f ("anv/wsi: split image alloc/free out to separate fns.")
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 8bf7717e1f84d180f42fb665772878d3b6d27459)

8 years agoradv: use emit_icmp for samples_identical
Dave Airlie [Thu, 20 Oct 2016 00:42:22 +0000 (01:42 +0100)]
radv: use emit_icmp for samples_identical

On a debug llvm build we'd assert on the next compare
when the return from samples_identical was i1 instead
of i32.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d842546ad1ebdb4825f0cbca2d68a56139d88e2a)

8 years agoUpdate version to 13.0.0-rc1
Emil Velikov [Wed, 19 Oct 2016 17:40:40 +0000 (18:40 +0100)]
Update version to 13.0.0-rc1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoRevert Use absolute path in intel_icd.json and related patches.
Emil Velikov [Wed, 19 Oct 2016 16:36:17 +0000 (17:36 +0100)]
Revert Use absolute path in intel_icd.json and related patches.

This commit effectively reverts the following commits:

This reverts commit 0b6837a643bbbf3c57c5cc5030279fb4389b23b7.
This reverts commit 05f36435ef117e48f457b44877d04dd6249b3bb7.
This reverts commit a2ae67aa47df6dd41802462105dac7ce5ab676a2.

While the feature introduced is convinient for development it is not as
useful for distributions. Furthermore it even breaks things as one
wishes to have both 32 and 64 bit package installed on the same system.

Keep the functionality in development branch(es) and drop it from
distribution packages to avoid confusion and misuse.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodocs: rename release notes to 13.0.0
Emil Velikov [Wed, 19 Oct 2016 16:33:38 +0000 (17:33 +0100)]
docs: rename release notes to 13.0.0

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoradeonsi: remove cb0_is_integer handling
Marek Olšák [Fri, 16 Sep 2016 20:42:54 +0000 (22:42 +0200)]
radeonsi: remove cb0_is_integer handling

st/mesa does this for us.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agost/mesa: disable alpha-test, alpha-to-coverage, alpha-to-one for integer FBs
Marek Olšák [Fri, 16 Sep 2016 20:39:15 +0000 (22:39 +0200)]
st/mesa: disable alpha-test, alpha-to-coverage, alpha-to-one for integer FBs

v2: rebased

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa: remove gl_shader_compiler_options::EmitNoNoise
Marek Olšák [Sun, 16 Oct 2016 22:54:35 +0000 (00:54 +0200)]
mesa: remove gl_shader_compiler_options::EmitNoNoise

it's always true

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: remove code for fixing up TGSI labels
Marek Olšák [Sun, 16 Oct 2016 22:47:49 +0000 (00:47 +0200)]
glsl_to_tgsi: remove code for fixing up TGSI labels

I don't know what this was supposed to do, but all TGSI labels were
always 0.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: remove subroutine support
Marek Olšák [Sun, 16 Oct 2016 22:38:41 +0000 (00:38 +0200)]
glsl_to_tgsi: remove subroutine support

Never used. The GLSL compiler doesn't even look at EmitNoFunctions.

v2: add back "return" support in "main"

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agomesa_to_tgsi: remove remnants of flow control and subroutine support
Marek Olšák [Sun, 16 Oct 2016 22:11:21 +0000 (00:11 +0200)]
mesa_to_tgsi: remove remnants of flow control and subroutine support

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agomesa_to_tgsi: drop support for instructions that can't occur here
Marek Olšák [Sun, 16 Oct 2016 22:07:01 +0000 (00:07 +0200)]
mesa_to_tgsi: drop support for instructions that can't occur here

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: allocate glsl_to_tgsi_instruction::tex_offsets on demand
Marek Olšák [Sun, 16 Oct 2016 20:08:03 +0000 (22:08 +0200)]
glsl_to_tgsi: allocate glsl_to_tgsi_instruction::tex_offsets on demand

sizeof(glsl_to_tgsi_instruction): 384 -> 264

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: merge buffer and sampler fields in glsl_to_tgsi_instruction
Marek Olšák [Sun, 16 Oct 2016 20:04:02 +0000 (22:04 +0200)]
glsl_to_tgsi: merge buffer and sampler fields in glsl_to_tgsi_instruction

sizeof(glsl_to_tgsi_instruction): 416 -> 384

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: reduce the size of glsl_to_tgsi_instruction using bitfields
Marek Olšák [Sun, 16 Oct 2016 19:58:13 +0000 (21:58 +0200)]
glsl_to_tgsi: reduce the size of glsl_to_tgsi_instruction using bitfields

sizeof(glsl_to_tgsi_instruction): 464 -> 416

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: reduce the size of st_dst_reg and st_src_reg
Marek Olšák [Sun, 16 Oct 2016 19:30:05 +0000 (21:30 +0200)]
glsl_to_tgsi: reduce the size of st_dst_reg and st_src_reg

I noticed that glsl_to_tgsi_instruction is too huge.

sizeof(glsl_to_tgsi_instruction): 752 -> 464 (-38%)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: remove unused st_translate::tex_offsets
Marek Olšák [Sun, 16 Oct 2016 19:28:36 +0000 (21:28 +0200)]
glsl_to_tgsi: remove unused st_translate::tex_offsets

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: remove unused parameters from calc_deref_offsets
Marek Olšák [Sun, 16 Oct 2016 19:22:11 +0000 (21:22 +0200)]
glsl_to_tgsi: remove unused parameters from calc_deref_offsets

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: use array_id for temp arrays instead of hacking high bits
Marek Olšák [Sun, 16 Oct 2016 21:22:55 +0000 (23:22 +0200)]
glsl_to_tgsi: use array_id for temp arrays instead of hacking high bits

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoreviewers: Throw myself on the GLX grenade
Adam Jackson [Thu, 6 Oct 2016 19:37:54 +0000 (15:37 -0400)]
reviewers: Throw myself on the GLX grenade

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoegl: bring back the default glapi.so name
Eric Engestrom [Wed, 19 Oct 2016 14:09:26 +0000 (15:09 +0100)]
egl: bring back the default glapi.so name

Earlier commit replaced the default platform specific libglapi.so name
with an #error.

This may have been overzealous since the name is the correct for the BSD
platforms, at least. Reinstate the hunk - bringing back OpenBSD, et al.
to a successful build state.

Fixes: 7a9c92d071d ("egl/dri2: non-shared glapi cleanups")
[Emil Velikov: format the patch from Eric, add commit message and tag.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoi965: fix subnr overflow in suboffset()
Iago Toral Quiroga [Tue, 27 Sep 2016 10:23:44 +0000 (12:23 +0200)]
i965: fix subnr overflow in suboffset()

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoradv: decompress fmask before reading using texture unit
Dave Airlie [Wed, 19 Oct 2016 07:34:28 +0000 (17:34 +1000)]
radv: decompress fmask before reading using texture unit

Before we can read the fmask using the compute shader, we need
to decompress the fmask in place.

This fixes a bunch of remaining failure and hopefully multisampling
in Talos.

8 years agoradv: fix samples_identical return value.
Dave Airlie [Wed, 19 Oct 2016 05:43:26 +0000 (15:43 +1000)]
radv: fix samples_identical return value.

This was returning an inversion, so not doing as it should have.

We need to compare the fmask value with 0, and return the result
from that.

8 years agoradv: fix wsi porting regression in swapchain destroy.
Dave Airlie [Wed, 19 Oct 2016 03:53:55 +0000 (13:53 +1000)]
radv: fix wsi porting regression in swapchain destroy.

The code in anv is right, there's a pending patch to fix this up
different, but I'll sync the code for now.

8 years agoradv: fix fmask ptr issue
Dave Airlie [Wed, 19 Oct 2016 02:27:04 +0000 (12:27 +1000)]
radv: fix fmask ptr issue

We were using the wrong descriptor in the fmask picking code.

8 years agoradv: simplify fast clear shaders
Dave Airlie [Tue, 18 Oct 2016 03:20:11 +0000 (13:20 +1000)]
radv: simplify fast clear shaders

There is no need for anything but a noop shader here.

8 years agovulkan/wsi: fix out of tree build.
Dave Airlie [Wed, 19 Oct 2016 00:53:51 +0000 (10:53 +1000)]
vulkan/wsi: fix out of tree build.

8 years agoradv: start using defines for the user sgpr offsets
Dave Airlie [Mon, 10 Oct 2016 02:20:36 +0000 (03:20 +0100)]
radv: start using defines for the user sgpr offsets

This adds some comments and adds defines for the user sgprs,
so that we can move them around easier later and not have
to change/revalidate every one of these.

Signed-off-by: Dave Airlie <airlied@redhat.com>