mesa.git
7 years agoswr: [rasterizer core] Removed unused clip code.
Bruce Cherniak [Fri, 3 Feb 2017 17:35:59 +0000 (11:35 -0600)]
swr: [rasterizer core] Removed unused clip code.

Removed unused Clip() and FRUSTUM_CLIP_MASK define.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
7 years agoswr: [rasterizer core] Remove dead code Clipper::ClipScalar()
Bruce Cherniak [Thu, 2 Feb 2017 20:15:08 +0000 (14:15 -0600)]
swr: [rasterizer core] Remove dead code Clipper::ClipScalar()

Clipper::ClipScalar() is dead code and should be removed.  It is causing
an error with gcc-7 because it references a now defunct member.

v2: includes bugzilla reference, same code change

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99633
CC: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
7 years agogallium: Remove vc4 simulator hack from loader infrastructure.
Eric Anholt [Fri, 3 Feb 2017 19:04:46 +0000 (11:04 -0800)]
gallium: Remove vc4 simulator hack from loader infrastructure.

Now that there's MESA_LOADER_DRIVER_OVERRIDE for choosing the driver name
we load, we don't need this any more.

v2: Get the junk out of pipe_loader_drm.c, too.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v2)
7 years agoloader: Add an environment variable to override driver name choice.
Eric Anholt [Fri, 3 Feb 2017 19:02:59 +0000 (11:02 -0800)]
loader: Add an environment variable to override driver name choice.

My vc4 simulator has been implemented so far by having an entrypoint
claiming to be i965, which was a bit gross.  The simulator would be a lot
less special if we entered through the vc4 entrypoint like normal, so add
a loader environment variable to allow the i965 fd to probe as vc4.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agotargets: Use a macro to reduce cut and paste in driver setup.
Eric Anholt [Fri, 3 Feb 2017 18:54:12 +0000 (10:54 -0800)]
targets: Use a macro to reduce cut and paste in driver setup.

All the replicated prototypes/function bodies obfuscated the interesting
logic of the file: the mapping from driver enable macros to entrypoints we
expose, and the way that the swrast entrypoints are special compared to
the DRM entrypoints.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeon/ac: move common llvm build functions to a separate file.
Dave Airlie [Fri, 3 Feb 2017 00:05:00 +0000 (10:05 +1000)]
radeon/ac: move common llvm build functions to a separate file.

Suggested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoeglmesaext: add new enums for EGL_MESA_drm_image_formats
Nicolai Hähnle [Tue, 24 Jan 2017 12:57:19 +0000 (13:57 +0100)]
eglmesaext: add new enums for EGL_MESA_drm_image_formats

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agodocs: add EGL_MESA_drm_image_formats extension proposal
Nicolai Hähnle [Tue, 24 Jan 2017 12:10:01 +0000 (13:10 +0100)]
docs: add EGL_MESA_drm_image_formats extension proposal

7 years agodri/common: clear the loaderPrivate pointer in driDestroyDrawable
Nicolai Hähnle [Fri, 27 Jan 2017 10:55:14 +0000 (11:55 +0100)]
dri/common: clear the loaderPrivate pointer in driDestroyDrawable

The GLX specification says about glXDestroyPixmap:

    "The storage for the GLX pixmap will be freed when it is not current
     to any client."

We're not really following this language to the letter: some of the storage
is freed immediately (in particular, the dri3_drawable, which contains both
GLXDRIdrawable and loader_dri3_drawable). So we NULL out the pointers to
that freed storage; the previous patches added the corresponding NULL-pointer
checks.

This fixes memory corruption in piglit
./bin/glx-visuals-depth/stencil -pixmap -auto

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoglx: guard swap-interval functions against destroyed drawables
Nicolai Hähnle [Thu, 2 Feb 2017 17:06:27 +0000 (18:06 +0100)]
glx: guard swap-interval functions against destroyed drawables

The GLX specification says about glXDestroyPixmap:

    "The storage for the GLX pixmap will be freed when it is not current
     to any client."

So arguably, functions like glXSwapIntervalMESA can be called after
glXDestroyPixmap has been called for the currently bound GLXPixmap.
In that case, the GLXDRIDrawable no longer exists, and so we just skip
those calls.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoglx/dri3: guard in_current_context against a disappeared drawable
Nicolai Hähnle [Thu, 2 Feb 2017 17:01:06 +0000 (18:01 +0100)]
glx/dri3: guard in_current_context against a disappeared drawable

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoglx/dri3: handle NULL pointers in loader-to-DRI3 drawable conversion
Nicolai Hähnle [Fri, 27 Jan 2017 10:58:41 +0000 (11:58 +0100)]
glx/dri3: handle NULL pointers in loader-to-DRI3 drawable conversion

With a subsequent patch, we might see NULL loaderPrivates, e.g. when
a DRIdrawable is flushed whose corresponding GLXDRIdrawable was destroyed.
This resulted in a crash, since the loader vs. DRI3 drawable structures
have a non-zero offset.

Fixes glx-visuals-{depth,stencil} -pixmap

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoanv/pipeline: set ThreadDispatchEnable conditionally
Juan A. Suarez Romero [Fri, 3 Feb 2017 11:11:38 +0000 (12:11 +0100)]
anv/pipeline: set ThreadDispatchEnable conditionally

Set 3DSTATE_WM/ThreadDispatchEnable bit on/off based on the same
conditions as used in the GL version.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agomain/fboject: default_framebuffer allowed for GetFramebufferParameter
Alejandro Piñeiro [Fri, 13 Jan 2017 17:53:13 +0000 (15:53 -0200)]
main/fboject: default_framebuffer allowed for GetFramebufferParameter

Before 4.5, the default framebuffer was not allowed for
GetFramebufferParameter, so it should return INVALID_OPERATION for any
call using the default framebuffer.

4.5 included new pnames, and some of them are allowed for the default
framebuffer. For the rest, INVALID_OPERATION. From OpenGL 4.5 spec,
section 9.2.3 "Framebuffer Object Queries:

   "An INVALID_OPERATION error is generated by GetFramebufferParameteriv
    if the default framebuffer is bound to target and pname is not one
    of the accepted values from table 23.73, other than
    SAMPLE_POSITION."

Fixes:
GL45-CTS.direct_state_access.framebuffers_get_parameter_errors

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agomain/fbobject: implement new 4.5 pnames for GetFramebufferParameter
Alejandro Piñeiro [Fri, 13 Jan 2017 18:23:05 +0000 (16:23 -0200)]
main/fbobject: implement new 4.5 pnames for GetFramebufferParameter

4.5 added new pnames allowed for GetFramebufferParameter, and
GetNamedFramebufferParameter.

From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries" (quoting
the paragraph with only the new pnames, not all the supported):

   "pname may also be one of DOUBLEBUFFER,
    IMPLEMENTATION_COLOR_READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE,
    SAMPLES, SAMPLE_BUFFERS, or STEREO, indicating the corresponding
    framebuffer-dependent state from table 23.73. Values of
    framebuffer-dependent state are identical to those that would be
    obtained were the framebuffer object bound and queried using the
    simple state queries in that table. These values may be queried
    from either a framebuffer object or a default framebuffer."

Fixes:
GL45-CTS.direct_state_access.framebuffers_get_parameters

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agomain/framebuffer: refactor _mesa_get_color_read_format/type
Alejandro Piñeiro [Tue, 17 Jan 2017 20:06:36 +0000 (18:06 -0200)]
main/framebuffer: refactor _mesa_get_color_read_format/type

Current implementation returns the value for the currently bound read
framebuffer. GetNamedFramebufferParameteriv allows to get it for any
given framebuffer. GetFramebufferParameteriv would be also interested
on that method

It was refactored by allowing to pass a given framebuffer. If NULL is
passed, it used the currently bound framebuffer.

It also adds a call to _mesa_update_state. When used only by
GetIntegerv, this one was called as part of the extra checks defined
at get_hash. But now that the method is used by more methods, and the
update is needed, it makes sense (and it is safer) just calling it on
the method itself, instead of rely on the caller.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoradv: fix shared memory load/stores.
Dave Airlie [Fri, 3 Feb 2017 03:26:13 +0000 (03:26 +0000)]
radv: fix shared memory load/stores.

If we have an indirect index here we need to scale it by attribute slots
e.g. is this is vec2[256] then we get an indir_index in the 0.255 range
but the vec2 are aligned inside vec4 slots. So scale the indir index,
then extract the channels.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: correctly size shared memory usage.
Dave Airlie [Fri, 3 Feb 2017 01:46:24 +0000 (01:46 +0000)]
radv/ac: correctly size shared memory usage.

We count the number of slots used, but slots are vec4 sized,
so we have to scale by 16 not 4.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: fix compute shared memory stores since 64-bit.
Dave Airlie [Fri, 3 Feb 2017 01:03:13 +0000 (01:03 +0000)]
radv: fix compute shared memory stores since 64-bit.

These regressed and caused doom to stop loading.

Fixes:
03724af26 radv/ac: Implement Float64 load/store var.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodocs: replace URL in features.txt
Brian Paul [Wed, 1 Feb 2017 21:35:03 +0000 (14:35 -0700)]
docs: replace URL in features.txt

Replace unmaintained http://dri.freedesktop.org/wiki/MissingFunctionality
URL with http://mesamatrix.net/

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95460
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agomesa: whitespace fixes in context.c
Brian Paul [Wed, 1 Feb 2017 23:48:31 +0000 (16:48 -0700)]
mesa: whitespace fixes in context.c

Remove trailing whitespace, replace tabs with spaces.  Trivial.

7 years agoanv/blorp: Disable resolves for transparent black clears
Nanley Chery [Sat, 21 Jan 2017 21:35:50 +0000 (13:35 -0800)]
anv/blorp: Disable resolves for transparent black clears

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv/cmd_buffer: Don't temporarily enable CCS_E within a render pass
Nanley Chery [Thu, 19 Jan 2017 18:21:38 +0000 (10:21 -0800)]
anv/cmd_buffer: Don't temporarily enable CCS_E within a render pass

Compressing a render target and decompressing it in the same
single-subpass render pass may waste bandwidth. While this may be
beneficial in some circumstances, it does not help in all. Reclaims
about 1.95% FPS for Dota 2 on some configurations.

v2 (Jason Ekstrand):
- Provide a more thorough comment
- Enable CCS_D for input attachments
v3 (Jason Ekstrand):
- Provide performance numbers

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agomesa: Don't crash when destroying contexts created with no visual.
Kenneth Graunke [Thu, 2 Feb 2017 18:10:30 +0000 (10:10 -0800)]
mesa: Don't crash when destroying contexts created with no visual.

dEQP-EGL.functional.create_context.no_config tries to create a context
with no config, then immediately destroys it.  The drawbuffer is never
set up, so we can't dereference it asking if it's double buffered, or
we'll crash on a null pointer dereference.

Just bail early.

Applications using EGL_KHR_no_config_context could hit this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agowinsys/amdgpu: avoid potential segfault in amdgpu_bo_map()
Samuel Pitoiset [Thu, 2 Feb 2017 17:40:18 +0000 (18:40 +0100)]
winsys/amdgpu: avoid potential segfault in amdgpu_bo_map()

cs can be NULL when it comes from r600_buffer_map_sync_with_rings()
to avoid doing the same checks. It was checked for write mappings
but not for read mappings.

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoandroid: fix droid_create_image_from_prime_fd_yuv for YV12
Tapani Pälli [Thu, 2 Feb 2017 12:05:46 +0000 (14:05 +0200)]
android: fix droid_create_image_from_prime_fd_yuv for YV12

Earlier changes introduced is_ycrcb flag which checks the component
order of u and v components. Condition for setting the flag was
incorrect, with ycrcb we are supposed to have cr before cb.

This patch (together with a fix in our gralloc) fixes corrupted
rendering from 'test-opengl-gl2_yuvtex' native test and corrupted
gallery thumbnail in application switcher on Android-IA.

Fixes: 51727b1cf57e8c4630767eb9ead207b102ffa489
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
7 years agoilo: EOL unmaintained older gallium intel driver
Edward O'Callaghan [Tue, 6 Dec 2016 00:07:13 +0000 (11:07 +1100)]
ilo: EOL unmaintained older gallium intel driver

This is no longer actively maintained and is just
accumulating bitrot.

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
7 years agoilo: EOL drop unmaintained gallium drv from buildsys
Edward O'Callaghan [Wed, 1 Feb 2017 13:56:14 +0000 (00:56 +1100)]
ilo: EOL drop unmaintained gallium drv from buildsys

This is no longer actively maintained and is just
accumulating bitrot.

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
7 years agoilo: EOL unplumb unmaintained gallium drv from winsys
Edward O'Callaghan [Wed, 1 Feb 2017 14:17:07 +0000 (01:17 +1100)]
ilo: EOL unplumb unmaintained gallium drv from winsys

This is no longer actively maintained and is just
accumulating bitrot.

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
7 years agoconfigure: libdrm is a single package
Ilia Mirkin [Thu, 2 Feb 2017 02:29:12 +0000 (21:29 -0500)]
configure: libdrm is a single package

The intent of the libdrm_$driver version limits has always been to not
burden the "other" drivers with updating their libdrm unless really
necessary. Unfortunately the configure script erroneously only checked
the driver-specific bit and not the generic bit of libdrm as well. Fix
this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agost/mesa: MAX_VARYING is the max supported number of patch varyings, not min
Ilia Mirkin [Thu, 26 Jan 2017 03:31:58 +0000 (22:31 -0500)]
st/mesa: MAX_VARYING is the max supported number of patch varyings, not min

This fixes
GL45-CTS.tessellation_shader.tessellation_shader_tessellation.max_in_out_attributes
on nouveau. We only support 30 patch varyings (as 2 vec4 slots end up
being used for tess level settings), but were getting 32 exposed.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agovbo: process buffer binding state changes on draw when recording
Ilia Mirkin [Wed, 1 Feb 2017 21:11:41 +0000 (16:11 -0500)]
vbo: process buffer binding state changes on draw when recording

The VBO module keeps track of any vbo buffers. It updates this list when
receiving an InvalidateState call, however this never happens when
recording draws right now. Make sure that we do all the usual state
updates when recording draws so that the VBO list may be kept up to
date.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99631
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agoradv/ac: move to using shared emit_ddxy code.
Dave Airlie [Wed, 1 Feb 2017 23:55:45 +0000 (09:55 +1000)]
radv/ac: move to using shared emit_ddxy code.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradeonsi/ac: move most of emit_ddxy to shared code.
Dave Airlie [Wed, 1 Feb 2017 23:52:52 +0000 (09:52 +1000)]
radeonsi/ac: move most of emit_ddxy to shared code.

We can reuse this in radv.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: use shared thread id code
Dave Airlie [Wed, 1 Feb 2017 23:39:59 +0000 (09:39 +1000)]
radv/ac: use shared thread id code

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradeonsi/ac: move get thread id to shared code.
Dave Airlie [Wed, 1 Feb 2017 23:35:40 +0000 (09:35 +1000)]
radeonsi/ac: move get thread id to shared code.

radv will use this.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: migrate to using shared code for some load/store stuff.
Dave Airlie [Wed, 1 Feb 2017 23:18:22 +0000 (09:18 +1000)]
radv/ac: migrate to using shared code for some load/store stuff.

This migrates to the code shared with radeonsi.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradeonsi/ac: move tbuffer store and buffer load to shared code.
Dave Airlie [Wed, 1 Feb 2017 23:13:44 +0000 (09:13 +1000)]
radeonsi/ac: move tbuffer store and buffer load to shared code.

These are all reuseable by radv.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradeonsi/ac: move a bunch of load/store related things to common code.
Dave Airlie [Wed, 1 Feb 2017 22:58:57 +0000 (08:58 +1000)]
radeonsi/ac: move a bunch of load/store related things to common code.

These are all shareable with radv, so start migrating them to the
common code.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agotexgetimage: Add check for the effective target to GetTextureSubImage
Eduardo Lima Mitev [Thu, 2 Feb 2017 16:07:24 +0000 (17:07 +0100)]
texgetimage: Add check for the effective target to GetTextureSubImage

OpenGL 4.5 spec, section "8.11.4 Texture Image Queries", page 233 of
the PDF states:

    "An INVALID_OPERATION error is generated if texture is the name of a buffer
     or multisample texture."

This is currently not being checked and e.g a multisample texture image can
be passed down to the driver hook. On i965, it is crashing the driver with an
assertion:

intel_mipmap_tree.c:3125: intel_miptree_map: Assertion `mt->num_samples <= 1' failed.

v2: (Ilia Mirkin) Move the check from gettextimage_error_check() to
    GetTextureSubImage() and use the texObj target.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agoRevert "radeonsi: decrease the number of texture slots to 24"
Marek Olšák [Thu, 2 Feb 2017 18:42:22 +0000 (19:42 +0100)]
Revert "radeonsi: decrease the number of texture slots to 24"

This reverts commit bdd860e3076655519d45bd66936ef7be9b7dda63.

Requested by a game developer.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoconfigure.ac: explicitly require libdrm for dri classic drivers.
Dave Airlie [Thu, 2 Feb 2017 04:27:50 +0000 (14:27 +1000)]
configure.ac: explicitly require libdrm for dri classic drivers.

Although this might come from somewhere else require it explicitly.

Reviewed-by: Chad Versace <chadversary@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agointel/isl: Add a better comment for format_supports_ccs_e
Jason Ekstrand [Thu, 2 Feb 2017 17:51:55 +0000 (09:51 -0800)]
intel/isl: Add a better comment for format_supports_ccs_e

Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoanv: Remove the finishme for CCS_E with storage images
Jason Ekstrand [Wed, 1 Feb 2017 20:05:07 +0000 (12:05 -0800)]
anv: Remove the finishme for CCS_E with storage images

The data port can't handle CCS at all so replace the finishme with
better comments.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agointel/isl: Assert that we don't use CCS for storage images
Jason Ekstrand [Wed, 1 Feb 2017 22:34:27 +0000 (14:34 -0800)]
intel/isl: Assert that we don't use CCS for storage images

I enabled CCS for storage images in the Vulkan driver and ran it through
the CTS.  It didn't result in any hangs but it demonstrated that the data
port cannot handle CCS.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agointel/isl: Add a formats_are_ccs_e_compatible helper
Jason Ekstrand [Wed, 1 Feb 2017 19:46:54 +0000 (11:46 -0800)]
intel/isl: Add a formats_are_ccs_e_compatible helper

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agointel/isl: Add a format_supports_ccs_d helper
Jason Ekstrand [Wed, 1 Feb 2017 19:41:51 +0000 (11:41 -0800)]
intel/isl: Add a format_supports_ccs_d helper

Nothing uses this yet but it serves as a nice bit of documentation
that's relatively easy to find.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agointel/isl: Rename supports_lossless_compression to supports_ccs_e
Jason Ekstrand [Wed, 1 Feb 2017 19:39:26 +0000 (11:39 -0800)]
intel/isl: Rename supports_lossless_compression to supports_ccs_e

The term "lossless compression" could potentially mean multisample
color compression, single-sample color compression or HiZ because they
are all lossless.  The term CCS_E, however, has a very precise meaning;
in ISL and is only used to refer to single-sample color compression.
It's also much shorter which is nice.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
7 years agoanv/pass: Store the depth-stencil attachment's last subpass index
Nanley Chery [Wed, 1 Feb 2017 03:01:18 +0000 (19:01 -0800)]
anv/pass: Store the depth-stencil attachment's last subpass index

Commit 968ffd6c868af7226e8f889573eef709888151cb stored the last subpass
index of all the attachments but that of the depth-stencil attachment.
This could cause depth buffers used in multiple subpasses not to be in
the requested final layout. Fix this error.

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
7 years agogallium: turn PIPE_SHADER_CAP_DOUBLES into a screen capability
Nicolai Hähnle [Fri, 27 Jan 2017 09:35:13 +0000 (10:35 +0100)]
gallium: turn PIPE_SHADER_CAP_DOUBLES into a screen capability

Make the cap consistent with PIPE_CAP_INT64.

Aside from the hypothetical case of using draw for vertex shaders (and
actually caring about doubles...), every implementation supports doubles
either nowhere or everywhere.

Also, st/mesa didn't even check the cap correctly in all supported
shader stages.

While at it, add a missing LLVM version check for 64-bit integers in
radeonsi. This is conservative: judging by the log, LLVM 3.8 might be
sufficient, but there are probably bugs that have been fixed since then.

v2: fix clover (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa: Enable EXT_compressed_ETC1_RGB8_sub_texture
Plamena Manolova [Tue, 24 Jan 2017 12:39:06 +0000 (12:39 +0000)]
mesa: Enable EXT_compressed_ETC1_RGB8_sub_texture

Since we already have the functionality in place and games
like Game of Thrones seem to depend on this extension, I
think it makes sense to enable it by making it part of
the extension string even though it's still a draft:

https://www.khronos.org/registry/gles/extensions/EXT/EXT_compressed_ETC1_RGB8_sub_texture.txt

Note: OES_compressed_ETC1_RGB8_sub_texture seems to be listed
in gl2ext.h, but there's no documentation for it in the KHR
registry

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agoconfigure: Only require libdrm 2.4.75 for intel.
Vinson Lee [Wed, 1 Feb 2017 23:28:31 +0000 (23:28 +0000)]
configure: Only require libdrm 2.4.75 for intel.

Fixes: b8acb6b17981 ("configure: Require libdrm >= 2.4.75")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Dave Airlie <airlied@redhat.com>
7 years agoanv: enable VK_KHR_shader_draw_parameters
Lionel Landwerlin [Sun, 29 Jan 2017 04:14:54 +0000 (04:14 +0000)]
anv: enable VK_KHR_shader_draw_parameters

Enables 10 tests from:

   dEQP-VK.draw.shader_draw_parameters.*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv: emit DrawID if needed
Lionel Landwerlin [Sun, 29 Jan 2017 03:15:03 +0000 (03:15 +0000)]
anv: emit DrawID if needed

v2: use define for buffer ID (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv: always allocate a vertex element with vertexid or instanceid
Lionel Landwerlin [Tue, 31 Jan 2017 12:41:32 +0000 (12:41 +0000)]
anv: always allocate a vertex element with vertexid or instanceid

Up to now on Gen8+ we only allocated a vertex element for
gl_InstanceIndex or gl_VertexIndex when a vertex shader uses
gl_BaseInstanceARB or gl_BaseVertexARB. This is because we would
configure the VF_SGVS packet to make the VF unit write the
gl_InstanceIndex & gl_VertexIndex values right behind the values
computed from the vertex buffers.

In the next commit we will also write the gl_DrawIDARB value. Our
backend expects to pull the gl_DrawIDARB value from the element
following the element containing gl_InstanceIndex, gl_VertexIndex,
gl_BaseInstanceARB and gl_BaseVertexARB (see
vec4_vs_visitor::setup_attributes). Therefore we need to allocate an
element for the SGVS elements as long as at least one of the SGVS
element is read by the shader. Otherwise our shader will use a
gl_DrawIDARB value pulled from the URB one element too far (most
likely garbage).

v2: Fix my english (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv: move BaseVertexID/BaseInstanceID vertex buffer index to 31
Lionel Landwerlin [Sun, 29 Jan 2017 02:46:12 +0000 (02:46 +0000)]
anv: move BaseVertexID/BaseInstanceID vertex buffer index to 31

v2: use define for buffer ID (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv: limit vertex buffers to 31
Lionel Landwerlin [Sun, 29 Jan 2017 02:44:32 +0000 (02:44 +0000)]
anv: limit vertex buffers to 31

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoandroid: fix llvm, elf dependencies for M, N releases
Mauro Rossi [Mon, 30 Jan 2017 19:57:30 +0000 (20:57 +0100)]
android: fix llvm, elf dependencies for M, N releases

These changes set the correct llvm version and elf include path
which differ for Marshmallow and Nougat

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoanv: Don't use bogus alpha swizzles
Jason Ekstrand [Wed, 1 Feb 2017 20:27:59 +0000 (12:27 -0800)]
anv: Don't use bogus alpha swizzles

For RGB formats in Vulkan, we use the corresponding RGBA format with a
swizzle of RGB1.  While this swizzle is exactly what we want for
texturing, it's not allowed for rendering according to the docs.  While
we haven't been getting hangs or anything, we should probably obey the
docs.  This commit just sanitizes all render swizzles so that the alpha
channel maps to ALPHA.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoAdd missing copyright header to wayland-egl-priv.h
Micah Fedke [Thu, 12 Jan 2017 15:38:21 +0000 (10:38 -0500)]
Add missing copyright header to wayland-egl-priv.h

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoradv: handle VK_QUEUE_FAMILY_IGNORED in image transitions (v3)
Dave Airlie [Tue, 31 Jan 2017 05:18:33 +0000 (15:18 +1000)]
radv: handle VK_QUEUE_FAMILY_IGNORED in image transitions (v3)

The CTS tests at least are using this, and we were totally
ignoring it.

This hopefully fixes the bouncing multisample CTS tests.

v2: get family mask in ignored case from command buffer.
v3: only change things in one place, use logic from Bas.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: handle clip/cull distance sizing in geometry shader outputs
Dave Airlie [Wed, 1 Feb 2017 01:10:49 +0000 (11:10 +1000)]
radv/ac: handle clip/cull distance sizing in geometry shader outputs

Otherwise we were writing these as 4 components, and things went bad.

Fixes (the remaining):
dEQP-VK.clipping.user_defined.*.vert_geom.*

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: add const_index to fetch index for gs inputs
Dave Airlie [Wed, 1 Feb 2017 00:43:36 +0000 (10:43 +1000)]
radv/ac: add const_index to fetch index for gs inputs

This fixes clip distance fetches as they are single item loads
with a const_index like float[1].

Fixes:
dEQP-VK.clipping.user_defined.*.vert_geom.[0-6]

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradeonsi/ac: move frag interp emission code to shared llvm code.
Dave Airlie [Wed, 1 Feb 2017 04:47:45 +0000 (14:47 +1000)]
radeonsi/ac: move frag interp emission code to shared llvm code.

This code should be used in radv, so move it to a shared location
in advance of doing that.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agost/mesa: inline get_mesa_program()
Timothy Arceri [Wed, 1 Feb 2017 00:25:05 +0000 (11:25 +1100)]
st/mesa: inline get_mesa_program()

In the past I've gotten this function confused with the one in
ir_to_mesa.cpp of the same name. Now that the affected flag setting
has move into a helper it makes sense just to inline this remaining
code.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agost/mesa: create set_prog_affected_state_flags() helper
Timothy Arceri [Tue, 31 Jan 2017 06:15:09 +0000 (17:15 +1100)]
st/mesa: create set_prog_affected_state_flags() helper

This will be used when restoring tgsi from the on-disk shader
cache.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agost/mesa: st_atom_shader.c C99 tidy up
Timothy Arceri [Mon, 30 Jan 2017 23:34:59 +0000 (10:34 +1100)]
st/mesa: st_atom_shader.c C99 tidy up

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agost/mesa: remove pre C99 statement block for variable declaration
Timothy Arceri [Mon, 30 Jan 2017 23:20:41 +0000 (10:20 +1100)]
st/mesa: remove pre C99 statement block for variable declaration

Acked-by: Marek Olšák <marek.olsak@amd.com>
7 years agoisl: Add assertions for render target swizzle restrictions
Jason Ekstrand [Wed, 1 Feb 2017 00:17:26 +0000 (16:17 -0800)]
isl: Add assertions for render target swizzle restrictions

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agost/va: add h264 constrained baseline profile
Boyuan Zhang [Fri, 16 Dec 2016 21:20:54 +0000 (16:20 -0500)]
st/va: add h264 constrained baseline profile

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/vdpau: add h264 constrained baseline profile
Boyuan Zhang [Fri, 16 Dec 2016 20:24:03 +0000 (15:24 -0500)]
st/vdpau: add h264 constrained baseline profile

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: add h264 constrained baseline support
Boyuan Zhang [Fri, 16 Dec 2016 20:22:13 +0000 (15:22 -0500)]
radeon/uvd: add h264 constrained baseline support

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agovl: add h264 constrained baseline profile
Boyuan Zhang [Fri, 16 Dec 2016 20:19:25 +0000 (15:19 -0500)]
vl: add h264 constrained baseline profile

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradv: Enable VK_KHR_shader_draw_parameters.
Bas Nieuwenhuizen [Tue, 31 Jan 2017 20:37:48 +0000 (21:37 +0100)]
radv: Enable VK_KHR_shader_draw_parameters.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoradv: Pass draw index to shader.
Bas Nieuwenhuizen [Tue, 31 Jan 2017 20:25:41 +0000 (21:25 +0100)]
radv: Pass draw index to shader.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoradv/ac: Add draw index support.
Bas Nieuwenhuizen [Tue, 31 Jan 2017 20:21:47 +0000 (21:21 +0100)]
radv/ac: Add draw index support.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoi965: Prevent coverity warning
Robert Foss [Wed, 1 Feb 2017 16:24:39 +0000 (11:24 -0500)]
i965: Prevent coverity warning

Add assert checking that num_sources is never larger than 3.

This prevents Coverity from concluding that the unhandled
cases of num_sources not being 0-3 are relevant.

Coverity-Id: 1399480-1399489
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agospirv: add SPV_KHR_shader_draw_parameters support
Lionel Landwerlin [Wed, 25 Jan 2017 13:58:14 +0000 (13:58 +0000)]
spirv: add SPV_KHR_shader_draw_parameters support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agocompiler: add missing enums for debug
Lionel Landwerlin [Mon, 30 Jan 2017 17:58:56 +0000 (17:58 +0000)]
compiler: add missing enums for debug

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agodocs: add news item and link release notes for 13.0.4
Emil Velikov [Wed, 1 Feb 2017 11:21:59 +0000 (11:21 +0000)]
docs: add news item and link release notes for 13.0.4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agodocs: add sha256 checksums for 13.0.4
Emil Velikov [Wed, 1 Feb 2017 11:19:37 +0000 (11:19 +0000)]
docs: add sha256 checksums for 13.0.4

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

7 years agodocs: add release notes for 13.0.4
Emil Velikov [Wed, 1 Feb 2017 10:10:38 +0000 (10:10 +0000)]
docs: add release notes for 13.0.4

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

7 years agowinsys/radeon: Allow visible VRAM size > 256MB with kernel driver >= 2.49
Michel Dänzer [Tue, 31 Jan 2017 06:33:19 +0000 (15:33 +0900)]
winsys/radeon: Allow visible VRAM size > 256MB with kernel driver >= 2.49

The kernel driver reports correct values now.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoandroid: add vulkan build for intel
Tapani Pälli [Mon, 30 Jan 2017 11:37:47 +0000 (13:37 +0200)]
android: add vulkan build for intel

fixes to issues spotted by Emil Velikov:

   - set ANV_TIMESTAMP corretly
   - fix typo with VULKAN_GEM_FILES

v2: update to use Makefile.sources under vulkan
    instead of having own

v3: update to changes to generate from vk.xml
    (commit c7fc310)

v4: remove 'hw' relative path
    cleanups, remove unnecessary cruft

    review from Emil Velikov:

    - move to vulkan folder
    - remove timestamp gen, no longer necessary
    - more cleanups

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: use same is_color_attachment trick to discern error cases
Ilia Mirkin [Tue, 24 Jan 2017 05:26:29 +0000 (00:26 -0500)]
mesa: use same is_color_attachment trick to discern error cases

All the other calls to retrieve the attachment have been covered except
this one - return the proper error for attachment points that are valid
enums but out of bound for the driver.

Fixes GL45-CTS.geometry_shader.layered_fbo.fb_texture_invalid_attachment

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoanv: Improve flushing around STATE_BASE_ADDRESS
Jason Ekstrand [Tue, 31 Jan 2017 03:53:17 +0000 (19:53 -0800)]
anv: Improve flushing around STATE_BASE_ADDRESS

It is not clear from the docs exactly how pipelined STATE_BASE_ADDRESS
actually is.  We know from experimentation that we need to flush the
render cache prior to emitting STATE_BASE_ADDRESS and invalidate the
texture cache afterwards.  The only thing the PRM says is that, on gen8+
we're supposed to invalidate the state cache after STATE_BASE_ADDRESS
but experimentation has indicated that doing so does nothing whatsoever.

Since we don't really know, let's do just a bit more flushing in the
hopes that this won't be a problem again.  In particular:

 1) Do a CS stall before we emit STATE_BASE_ADDRESS since we don't
    really know whether or not it's pipelined.

 2) Do a data cache flush in case what runs before STATE_BASE_ADDRESS
    is a compute shader.

 3) Invalidate the state and constant caches after STATE_BASE_ADDRESS
    because the state may be getting cached there (we don't really know).

Reported-by: Mark Janes <mark.a.janes@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agoanv: Flush render cache before STATE_BASE_ADDRESS on gen7
Jason Ekstrand [Tue, 31 Jan 2017 23:06:56 +0000 (15:06 -0800)]
anv: Flush render cache before STATE_BASE_ADDRESS on gen7

We had no good reason for *not* doing this on gen7 before but we didn't
know it was needed.  Recently, when trying update to Vulkan CTS version
1.0.2 in our CI system, Mark discovered GPU hangs on Haswell that appear
to be STATE_BASE_ADDRESS related.  This commit fixes them.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agoisl/formats: Only advertise sampling for A4B4G4R4 on Broadwell
Jason Ekstrand [Fri, 27 Jan 2017 20:31:40 +0000 (12:31 -0800)]
isl/formats: Only advertise sampling for A4B4G4R4 on Broadwell

This causes hangs on Broadwell if you try to render to it.  I have no
idea how we managed to not hit this earlier.

Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agointel/blorp: Handle clearing of A4B4G4R4 on all platforms
Jason Ekstrand [Fri, 27 Jan 2017 20:32:05 +0000 (12:32 -0800)]
intel/blorp: Handle clearing of A4B4G4R4 on all platforms

Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agoradeonsi: Fix build on LLVM < 3.9 v2
Tom Stellard [Wed, 1 Feb 2017 00:18:01 +0000 (00:18 +0000)]
radeonsi: Fix build on LLVM < 3.9 v2

This was broken by: e0cc0a614c96011958bc3a1b84da9168e0e1ccbb

v2:
  - Use preprocessor macro

Tested-by: Mark Janes <mark.a.janes@intel.com>
7 years agoradv: Enable Float64 support.
Bas Nieuwenhuizen [Sun, 29 Jan 2017 22:07:10 +0000 (23:07 +0100)]
radv: Enable Float64 support.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Implement Float64 SSBO loads.
Bas Nieuwenhuizen [Sun, 8 Jan 2017 18:38:28 +0000 (19:38 +0100)]
radv/ac: Implement Float64 SSBO loads.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Implement Float64 UBO loads.
Bas Nieuwenhuizen [Sun, 8 Jan 2017 00:36:30 +0000 (01:36 +0100)]
radv/ac: Implement Float64 UBO loads.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Implement Float64 load/store var.
Bas Nieuwenhuizen [Sun, 8 Jan 2017 00:31:07 +0000 (01:31 +0100)]
radv/ac: Implement Float64 load/store var.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Implement Float64 SSBO stores.
Bas Nieuwenhuizen [Thu, 5 Jan 2017 00:36:26 +0000 (01:36 +0100)]
radv/ac: Implement Float64 SSBO stores.

No f16 support as I'm not quite sure about alignment yet.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Add core Float64 support.
Bas Nieuwenhuizen [Thu, 5 Jan 2017 00:09:12 +0000 (01:09 +0100)]
radv/ac: Add core Float64 support.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agovc4: Enable Neon on arm android builds
Rob Herring [Mon, 30 Jan 2017 22:54:53 +0000 (16:54 -0600)]
vc4: Enable Neon on arm android builds

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agovc4: fix arm64 build with Neon
Rob Herring [Mon, 30 Jan 2017 22:54:52 +0000 (16:54 -0600)]
vc4: fix arm64 build with Neon

The addition of Neon assembly breaks on arm64 builds because the assembly
syntax is different. For now, restrict Neon to ARMv7 builds.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agovc4: Make Neon inline assembly clang compatible
Rob Herring [Mon, 30 Jan 2017 22:54:51 +0000 (16:54 -0600)]
vc4: Make Neon inline assembly clang compatible

clang throws an error on "%r2" and similar. I couldn't find any
documentation on what "%r?" is supposed to mean and I've never seen any
use like that as far as I remember. The parameter is supposed to be
cpu_stride and just %2/%3 should be sufficient.

There's no need for trailing ";" either, so remove those, too.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoradeonsi: Set datalayout on the llvm module
Tom Stellard [Thu, 15 Dec 2016 15:25:49 +0000 (15:25 +0000)]
radeonsi: Set datalayout on the llvm module

This prevents LLVM from using sext instructions for local memory offsets
and allows the backend to fold immediate offsets into the instruction.

This also prevents some incorrect code generation for ptrtoint and
inttoptr instructions.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>