mesa.git
7 years agogallium/docs: document that TXF is used with PIPE_BUFFER resources
Brian Paul [Fri, 30 Jun 2017 15:23:43 +0000 (09:23 -0600)]
gallium/docs: document that TXF is used with PIPE_BUFFER resources

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
7 years agogallium/docs: clarify that samplers are not used with PIPE_BUFFER resources
Brian Paul [Fri, 30 Jun 2017 15:23:17 +0000 (09:23 -0600)]
gallium/docs: clarify that samplers are not used with PIPE_BUFFER resources

Commit 8aba778fa2cd98a0b5a7429d3c5057778a0c808c "st/mesa: don't set
sampler states for TBOs" changed how texture buffer objects are handled.
Document the new convention.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
7 years agovc4: Start using XML unpack functions in CL dump.
Eric Anholt [Fri, 16 Dec 2016 19:00:46 +0000 (11:00 -0800)]
vc4: Start using XML unpack functions in CL dump.

For now this is a no-op on the output, but it makes it clear that we've
had weird things going on with things like
V3D21_CLIPPER_Z_SCALE_AND_OFFSET.

7 years agovc4: Replace a couple of magic numbers with #define usage.
Eric Anholt [Mon, 6 Feb 2017 22:29:30 +0000 (14:29 -0800)]
vc4: Replace a couple of magic numbers with #define usage.

7 years agovc4: Move rasterizer state packing to CSO creation time.
Eric Anholt [Mon, 6 Feb 2017 22:06:12 +0000 (14:06 -0800)]
vc4: Move rasterizer state packing to CSO creation time.

This gets our vc4_emit.c size back down a bit:

before:
   1020       0       0    1020     3fc src/gallium/drivers/vc4/.libs/vc4_emit.o

after:
    968       0       0     968     3c8 src/gallium/drivers/vc4/.libs/vc4_emit.o

7 years agovc4: Convert the driver to emitting the shader record using pack macros.
Eric Anholt [Sat, 10 Dec 2016 23:47:26 +0000 (15:47 -0800)]
vc4: Convert the driver to emitting the shader record using pack macros.

7 years agovc4: Simplify pack header usage
Eric Anholt [Sun, 11 Dec 2016 22:59:17 +0000 (14:59 -0800)]
vc4: Simplify pack header usage

Take the CL pointer in, which will be useful for enabling relocs.
However, our code expands a bit more:

before:
   4449       0       0    4449    1161 src/gallium/drivers/vc4/.libs/vc4_draw.o
    988       0       0     988     3dc src/gallium/drivers/vc4/.libs/vc4_emit.o

after:
   4481       0       0    4481    1181 src/gallium/drivers/vc4/.libs/vc4_draw.o
   1020       0       0    1020     3fc src/gallium/drivers/vc4/.libs/vc4_emit.o

7 years agovc4: Start using the pack header.
Eric Anholt [Wed, 26 Oct 2016 19:46:58 +0000 (12:46 -0700)]
vc4: Start using the pack header.

This slightly inflates the size of the generated code, in exchange for
getting us some convenient tools.

before:
   4389       0       0    4389    1125 src/gallium/drivers/vc4/.libs/vc4_draw.o
    808       0       0     808     328 src/gallium/drivers/vc4/.libs/vc4_emit.o

after:
   4449       0       0    4449    1161 src/gallium/drivers/vc4/.libs/vc4_draw.o
    988       0       0     988     3dc src/gallium/drivers/vc4/.libs/vc4_emit.o

7 years agovc4: Introduce XML-based packet header generation like Intel's.
Eric Anholt [Wed, 26 Oct 2016 17:14:37 +0000 (10:14 -0700)]
vc4: Introduce XML-based packet header generation like Intel's.

I really liked this idea, as it should help with management of packet
parsing tools like the CL dump.  The python script is forked off of theirs
because our packets are byte-based instead of dwords, and the changes to
do so while avoiding performance regressions due to unaligned accesses
were quite invasive.

v2: Fix Android.mk paths, drop shebang for python script, fix overlap
    detection.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Rob Herring <robh@kernel.org>
7 years agoswr: Minor cleanup of variable usage, no functional change.
Bruce Cherniak [Thu, 29 Jun 2017 19:41:31 +0000 (14:41 -0500)]
swr: Minor cleanup of variable usage, no functional change.

In swr_update_derived, for consistency, index buffer validation should
be using the p_draw_info copy "info" rather than referencing
p_draw_info.

No functional change.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
7 years agoswr: use swr_query_result type instead of void
Tim Rowley [Fri, 30 Jun 2017 16:50:22 +0000 (11:50 -0500)]
swr: use swr_query_result type instead of void

Tag pStat field in swr_draw_context structure so gen_llvm_types.py
can deal with the actual structure type instead of using void.

Code cleanup, no functional change.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: increase number of possible draws in flight
Tim Rowley [Wed, 21 Jun 2017 19:57:10 +0000 (14:57 -0500)]
swr/rast: increase number of possible draws in flight

Increases performance of some large workloads on KNL by ~30%.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: move default split size from driver to rasterizer
Tim Rowley [Wed, 21 Jun 2017 19:56:24 +0000 (14:56 -0500)]
swr/rast: move default split size from driver to rasterizer

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Fix missing setup of psContext.pColorBuffer
Tim Rowley [Mon, 19 Jun 2017 17:14:15 +0000 (12:14 -0500)]
swr/rast: Fix missing setup of psContext.pColorBuffer

Fixes render target read access from pixel shaders.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Switch intrinsic usage to SIMDLib
Tim Rowley [Thu, 15 Jun 2017 20:24:07 +0000 (15:24 -0500)]
swr/rast: Switch intrinsic usage to SIMDLib

Switch from a macro-based simd intrinsics layer to a more C++
implementation, which also adds AVX512 optimizations to 128-bit
and 256-bit SIMD.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoscons: allow .inl file extension
Tim Rowley [Tue, 27 Jun 2017 15:47:28 +0000 (10:47 -0500)]
scons: allow .inl file extension

Intended for header files which are not meant to be included directly.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Fix unused variable warnings
Tim Rowley [Wed, 14 Jun 2017 19:40:28 +0000 (14:40 -0500)]
swr/rast: Fix unused variable warnings

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Split rasterizer.cpp to improve compile time
Tim Rowley [Mon, 26 Jun 2017 17:41:38 +0000 (12:41 -0500)]
swr/rast: Split rasterizer.cpp to improve compile time

Hardcode split to four files currently.  Decreases swr build
time on KNL by over 50%.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: gen_backends.py remove extraneous semicolon
Tim Rowley [Mon, 26 Jun 2017 17:40:45 +0000 (12:40 -0500)]
swr/rast: gen_backends.py remove extraneous semicolon

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Support dynamically sized vertex layout
Tim Rowley [Mon, 12 Jun 2017 23:43:49 +0000 (18:43 -0500)]
swr/rast: Support dynamically sized vertex layout

Each shader stage state (VS, TS, GS, SO, BE/CLIP) now has a
vertexAttribOffset to specify the offset to the start of the
general attribute section of the incoming verts for that stage.
It is up to the driver to set this up correctly based on the
active stages. All the shader stages use this value instead of
VERTEX_ATTRIB_START_SLOT to offset to the incoming attributes.

Only the vertex shader stage supports dynamic layout output
currently. The other stages continue to expect the output to be
the fixed layout slots as before. Will be enabling GS next.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: Split backend.cpp to improve compile time
Tim Rowley [Mon, 26 Jun 2017 18:00:27 +0000 (13:00 -0500)]
swr/rast: Split backend.cpp to improve compile time

Hardcode split to four files currently.  Decreases swr build
time on a quad-core by ~10%.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: gen_backends.py removal of commented debug prints
Tim Rowley [Mon, 26 Jun 2017 17:59:28 +0000 (12:59 -0500)]
swr/rast: gen_backends.py removal of commented debug prints

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: gen_backends.py quote cleanup
Tim Rowley [Mon, 26 Jun 2017 17:43:49 +0000 (12:43 -0500)]
swr/rast: gen_backends.py quote cleanup

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agoswr/rast: generators will create target directories
Tim Rowley [Mon, 26 Jun 2017 17:34:24 +0000 (12:34 -0500)]
swr/rast: generators will create target directories

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
7 years agodocs: update calendar, add news item and link release notes for 17.1.4
Andres Gomez [Fri, 30 Jun 2017 17:37:52 +0000 (20:37 +0300)]
docs: update calendar, add news item and link release notes for 17.1.4

Signed-off-by: Andres Gomez <agomez@igalia.com>
7 years agodocs: add sha256 checksums for 17.1.4
Andres Gomez [Fri, 30 Jun 2017 17:31:44 +0000 (20:31 +0300)]
docs: add sha256 checksums for 17.1.4

Signed-off-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 5a24aa8c55c2b7893d50a4a203f14300d4ecab87)

7 years agodocs: add release notes for 17.1.4
Andres Gomez [Fri, 30 Jun 2017 17:11:50 +0000 (20:11 +0300)]
docs: add release notes for 17.1.4

Signed-off-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit e60d010ef41f049df84d683a6465d1e5bf0cbb3d)

7 years agoAndroid: fix typo in symlink for driver loading and 32 bit builds
Mauro Rossi [Fri, 30 Jun 2017 06:54:34 +0000 (08:54 +0200)]
Android: fix typo in symlink for driver loading and 32 bit builds

There is typo in the mkdir command path,
the correct one is $(TARGET_OUT)/$(l)/$(MESA_DRI_MODULE_REL_PATH)

The other issue is in 32bit builds, because lib64 does not exist there,
we can use TARGET_IS_64_BIT to refine the post install command.

Fixes: a3d98ca62f ("Android: use symlinks for driver loading")
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agosvga: update a few surface format names
Brian Paul [Wed, 28 Jun 2017 22:43:52 +0000 (16:43 -0600)]
svga: update a few surface format names

To sync with in-house changes.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
7 years agosvga: whitespace fixes in svga_resource_buffer_upload.c
Brian Paul [Tue, 27 Jun 2017 21:55:10 +0000 (15:55 -0600)]
svga: whitespace fixes in svga_resource_buffer_upload.c

Trivial.

7 years agosvga: add mksstats for surface view emulation
Charmaine Lee [Tue, 27 Jun 2017 16:59:55 +0000 (10:59 -0600)]
svga: add mksstats for surface view emulation

Add mksstats for surface view emulation and also tighten the stat
CreateBackedView for the actual creation of backed view.

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agosvga: change error handling convention for svga_set_stream_output()
Brian Paul [Thu, 22 Jun 2017 20:45:07 +0000 (14:45 -0600)]
svga: change error handling convention for svga_set_stream_output()

In general, the functions which emit commands to the command buffer check
for failure and return a PIPE_ERROR_x code.  It's up to the caller to
flush the buffer and retry the command.

But svga_set_stream_output() did its own flushing and the callers never
checked the return value (though, it would always be PIPE_OK) in practice.

This patch changes svga_set_stream_output() so that it does not call
svga_context_flush() when the buffer is full.  And we update the callers
to check the return value as we do for other functions, like
svga_set_shader().

No Piglit regressions.  Also tested w/ Nature demo.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agosvga: fixed surface size to include array size
Charmaine Lee [Tue, 6 Jun 2017 18:52:50 +0000 (11:52 -0700)]
svga: fixed surface size to include array size

This patch fixes the total surface size in surface cache
to include array size as well.

Tested with MTT glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agosvga: loop over box.depth for ReadBack_image on each slice
Neha Bhende [Thu, 27 Oct 2016 19:35:03 +0000 (12:35 -0700)]
svga: loop over box.depth for ReadBack_image on each slice

piglit test ext_texture_array-gen-mipmap is fixed with this patch.

Tested with mtt piglit, glretrace, viewperf and conform. No regression.

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agosvga: add mksstats for context creation
Charmaine Lee [Tue, 8 Nov 2016 19:54:56 +0000 (11:54 -0800)]
svga: add mksstats for context creation

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agosvga: re-validate sampler view at draw time if needed
Charmaine Lee [Tue, 27 Jun 2017 16:47:01 +0000 (10:47 -0600)]
svga: re-validate sampler view at draw time if needed

This patch validates those sampler views with backing copy
of texture whose original copy has been updated since the
view is last validated.
This is done here at draw time because the texture binding might not
have modified, hence validation is not triggered at state update time,
and yet the texture might have been updated in another context, so
we need to re-validate the sampler view in order to update the backing
copy of the updated texture.

This fixes a rendering flickering issue with Photoshop running in
Linux VM with HWversion 11. The problem is Photoshop renders to texture A
in context X, and then bind texture A to context Y. The first time
when texture A is bound to context Y, cso calls pipe->set_sampler_views().
Validation of sampler views is done, rendering is fine.
But when texture A is rendered to again in context X, and rebound in
context Y, cso skips pipe->set_sampler_views() because texture A is already
bound in context Y. SVGA driver is not given a chance to re-validate
the texture binding, the backing copy of the texture is not updated,
and hence causes black image.

Tested with Photoshop, MTT glretrace, piglit.
Fixes VMware bug 1769103.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agoautomake: include git_sha1_gen.sh into EXTRA_DIST
Juan A. Suarez Romero [Fri, 30 Jun 2017 11:23:57 +0000 (11:23 +0000)]
automake: include git_sha1_gen.sh into EXTRA_DIST

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoUpdate Khronos-supplied headers
Nicolai Hähnle [Sat, 10 Jun 2017 18:46:27 +0000 (20:46 +0200)]
Update Khronos-supplied headers

Taken from commit 676834dd529d620ee25090e738d2607dfde003d8
of https://github.com/KhronosGroup/OpenGL-Registry.git

v2:
- keep the BUILDING_MESA bits (Matt)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoi965/i915: Add UYVY as the supported format
Johnson Lin [Fri, 16 Jun 2017 05:51:34 +0000 (13:51 +0800)]
i965/i915: Add UYVY as the supported format

Trigger the correct sampler options for it. Similar with YUYV

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
7 years agonir: Add a lowering pass for UYVY textures
Johnson Lin [Fri, 16 Jun 2017 05:40:31 +0000 (13:40 +0800)]
nir: Add a lowering pass for UYVY textures

Similar with support for YUYV but with byte order difference in sampler

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
7 years agodri: Add UYVY as available format
Johnson Lin [Fri, 16 Jun 2017 05:34:02 +0000 (13:34 +0800)]
dri: Add UYVY as available format

UYVY is diffrent with YUYV in byte order.
YUYV is already declared in dri_interface.h,
this CL add the difinitions for UYVY.
Drivers can add UYVY as supported format

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
7 years agogbm: add XBGR8888 support for dumb buffers
Rob Herring [Wed, 28 Jun 2017 21:52:29 +0000 (17:52 -0400)]
gbm: add XBGR8888 support for dumb buffers

Add GBM_FORMAT_XBGR8888 format support which is needed for Android.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agogallium: os_process fixes for Android
Rob Herring [Wed, 28 Jun 2017 21:52:28 +0000 (17:52 -0400)]
gallium: os_process fixes for Android

The function getprogname() is available on Android, since it reuses
various BSD solutions C runtime.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoetnaviv: Add unreachable statement to etna_amode to fix compilation warnings
Tomeu Vizoso [Wed, 28 Jun 2017 21:52:27 +0000 (17:52 -0400)]
etnaviv: Add unreachable statement to etna_amode to fix compilation warnings

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoswr: Remove need to allocate vertex buffer scratch space all in one go
Bruce Cherniak [Wed, 28 Jun 2017 18:42:03 +0000 (13:42 -0500)]
swr: Remove need to allocate vertex buffer scratch space all in one go

Deferred deletion (via "fence_work") has obsoleted the need to allocate
all client vertex buffer scratch space in a single chunk.  Scratch
allocations are now valid until the referenced fence is complete.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
7 years agoswr: conditionally validate vertex buffer state
Bruce Cherniak [Tue, 27 Jun 2017 22:49:06 +0000 (17:49 -0500)]
swr: conditionally validate vertex buffer state

Vertex buffer state doesn't need to be validated on every call,
only on dirty _NEW_VERTEX or indexed draws.

Unconditional validation was introduced as part of patch 330d0607ed6,
"remove pipe_index_buffer and set_index_buffer", with the expectation
we'd optimize later.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
7 years agoswr: set dynamic vertex size
Tim Rowley [Wed, 28 Jun 2017 14:54:32 +0000 (09:54 -0500)]
swr: set dynamic vertex size

Reduces the memory footprint of the frontend processing by packing
vertices.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoscons: wait on subprocess' completion
Eric Engestrom [Thu, 29 Jun 2017 16:21:44 +0000 (17:21 +0100)]
scons: wait on subprocess' completion

Windows doesn't allow you to move a file that's opened, and Popen()
doesn't wait on its subprocess' completion before returning, which leads
to broken Windows build.

Fixes: 3fd425aed764fb771f2f "build systems: uniformize git_sha1.h generation"
Suggested-by: Scott D Phillips <scott.d.phillips@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agobuild systems: uniformize git_sha1.h generation
Eric Engestrom [Tue, 27 Jun 2017 11:08:41 +0000 (12:08 +0100)]
build systems: uniformize git_sha1.h generation

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoradeonsi: set COMPUTE_DISPATCH_INITIATOR.ORDER_MODE = 1
Marek Olšák [Tue, 27 Jun 2017 15:33:54 +0000 (17:33 +0200)]
radeonsi: set COMPUTE_DISPATCH_INITIATOR.ORDER_MODE = 1

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: use the DISPATCH packets to force COMPUTE_START_X/Y/Z = 0
Marek Olšák [Tue, 27 Jun 2017 15:25:28 +0000 (17:25 +0200)]
radeonsi: use the DISPATCH packets to force COMPUTE_START_X/Y/Z = 0

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoAndroid: use symlinks for driver loading
Rob Herring [Tue, 23 May 2017 00:04:48 +0000 (19:04 -0500)]
Android: use symlinks for driver loading

Instead of having special driver loading logic for Android, create
symlinks to gallium_dri.so so we can use the standard loading logic.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoAndroid: i965: remove libdrm_intel dependency
Rob Herring [Wed, 28 Jun 2017 22:08:54 +0000 (17:08 -0500)]
Android: i965: remove libdrm_intel dependency

Commit 7dd20bc3ee8f ("anv/i965: drop libdrm_intel dependency completely")
removed the libdrm_intel dependency for automake, but Android builds still
depended on it. Now the build requires a newer version of i915_drm.h and
fails on Android builds:

src/mesa/drivers/dri/i965/brw_performance_query.c:616:9: error: use of undeclared identifier 'I915_OA_FORMAT_A32u40_A4u32_B8_C8'
   case I915_OA_FORMAT_A32u40_A4u32_B8_C8:
        ^
src/mesa/drivers/dri/i965/brw_performance_query.c:1887:18: error: use of undeclared identifier 'I915_PARAM_SLICE_MASK'
      gp.param = I915_PARAM_SLICE_MASK;
                 ^
src/mesa/drivers/dri/i965/brw_performance_query.c:1893:18: error: use of undeclared identifier 'I915_PARAM_SUBSLICE_MASK'
      gp.param = I915_PARAM_SUBSLICE_MASK;
                 ^

Remove the libdrm_intel dependency for Android builds and add the necessary
include paths for the local copy of i915_drm.h.

Fixes: 7dd20bc ("anv/i965: drop libdrm_intel dependency completely")
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoandroid: anv: drop libdrm_intel dependency
Mauro Rossi [Thu, 29 Jun 2017 00:46:38 +0000 (02:46 +0200)]
android: anv: drop libdrm_intel dependency

In addition to Rob Herring "Android: i965: remove libdrm_intel dependency",
we can drop libdrm_intel dependency in anv for Android.

Please check if libdrm has to stay as shared dependency and drop this comment line.

Fixes: 7dd20bc ("anv/i965: drop libdrm_intel dependency completely")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoetnaviv: fix memory leak when BO allocation fails
Lucas Stach [Fri, 9 Jun 2017 16:20:56 +0000 (18:20 +0200)]
etnaviv: fix memory leak when BO allocation fails

The resource struct is already allocated at this point and should be
freed properly.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoetnaviv: fill in layer_stride for imported resources
Lucas Stach [Thu, 22 Jun 2017 14:10:48 +0000 (16:10 +0200)]
etnaviv: fill in layer_stride for imported resources

The layer stride information is used in various parts of the driver,
so it needs to be present regardless if the driver allocated the
buffer itself or merely imported it from an external source.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoanv: use devinfo for number of thread/eu
Lionel Landwerlin [Fri, 23 Jun 2017 14:01:47 +0000 (17:01 +0300)]
anv: use devinfo for number of thread/eu

It turns out Gen9LP has fewer threads per EU (6 vs 7).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
7 years agointel: tools: add intel_aub.h as part of aubinator
Juan A. Suarez Romero [Wed, 28 Jun 2017 14:43:30 +0000 (14:43 +0000)]
intel: tools: add intel_aub.h as part of aubinator

Include intel_aub.h in the Makefile.tools.am

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agointel: automake: include Makefile.drm.am
Juan A. Suarez Romero [Wed, 28 Jun 2017 14:42:47 +0000 (14:42 +0000)]
intel: automake: include Makefile.drm.am

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agomesa: Require mipmap completeness for glCopyImageSubData() at times.
Kenneth Graunke [Thu, 23 Feb 2017 23:04:52 +0000 (15:04 -0800)]
mesa: Require mipmap completeness for glCopyImageSubData() at times.

This patch makes glCopyImageSubData require mipmap completeness when the
texture object's built-in sampler object has a mipmapping MinFilter.
This is apparently the de facto behavior and mandated by Android's CTS.

One exception is that we ignore format based completeness rules
(specifically integer formats with linear filtering), as this is
also the de facto behavior that until recently was mandated by the
OpenGL 4.5 CTS.

This was discussed with both the OpenGL and OpenGL ES working groups,
and while everyone agrees this behavior is unfortunate and complicated,
it is what it is at this point.  There was little appetite for relaxing
restrictions given that all conformant Android drivers followed the
mipmapping rule, and all conformant GL 4.5 implementations ignored the
integer/linear rule.

Fixes (on i965):
dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
7 years agomesa: tidy up white space in pixelstore.c
Timothy Arceri [Thu, 29 Jun 2017 04:14:03 +0000 (14:14 +1000)]
mesa: tidy up white space in pixelstore.c

7 years agomesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targets
Ian Romanick [Wed, 13 Jan 2016 01:09:50 +0000 (17:09 -0800)]
mesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targets

Add a big spec quotation justifying the error generated, which has
changed over the GL versions.

v2: Compact the spec quote based on a Khronos bug and discussion with Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
7 years agoi965: Drop index buffer re-alignment code.
Kenneth Graunke [Thu, 22 Jun 2017 18:16:06 +0000 (11:16 -0700)]
i965: Drop index buffer re-alignment code.

This shouldn't ever happen - GL requires it to be aligned:

   "Clients must align data elements consistent with the requirements
    of the client platform, with an additional base-level requirement
    that an offset within a buffer to a datum comprising N basic
    machine units be a multiple of N."

Mesa should reject unaligned index buffers for us - we shouldn't have
to handle them in the driver.

Note that Gallium already makes this assumption.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agomesa: add KHR_no_error support for glBlendFunc*()
Timothy Arceri [Wed, 28 Jun 2017 05:28:13 +0000 (15:28 +1000)]
mesa: add KHR_no_error support for glBlendFunc*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: create some glBlendFunc*() helper functions
Timothy Arceri [Wed, 28 Jun 2017 05:21:51 +0000 (15:21 +1000)]
mesa: create some glBlendFunc*() helper functions

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glBindFragDataLocation*()
Timothy Arceri [Wed, 28 Jun 2017 04:46:06 +0000 (14:46 +1000)]
mesa: add KHR_no_error support for glBindFragDataLocation*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add bind_frag_data_location() helper
Timothy Arceri [Wed, 28 Jun 2017 04:40:25 +0000 (14:40 +1000)]
mesa: add bind_frag_data_location() helper

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glGetUniformLocation()
Timothy Arceri [Wed, 28 Jun 2017 04:34:14 +0000 (14:34 +1000)]
mesa: add KHR_no_error support for glGetUniformLocation()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: inline _mesa_finish()
Timothy Arceri [Wed, 28 Jun 2017 04:20:48 +0000 (14:20 +1000)]
mesa: inline _mesa_finish()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glDisableVertexA*A*()
Timothy Arceri [Wed, 28 Jun 2017 04:09:22 +0000 (14:09 +1000)]
mesa: add KHR_no_error support for glDisableVertexA*A*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: move error handling into disable_vertex_array_attrib() callers
Timothy Arceri [Wed, 28 Jun 2017 04:03:07 +0000 (14:03 +1000)]
mesa: move error handling into disable_vertex_array_attrib() callers

This will let us just call disable_vertex_array_attrib() for
KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glEnableVertexA*A*()
Timothy Arceri [Wed, 28 Jun 2017 03:57:10 +0000 (13:57 +1000)]
mesa: add KHR_no_error support for glEnableVertexA*A*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glLogicOp()
Timothy Arceri [Wed, 28 Jun 2017 03:47:42 +0000 (13:47 +1000)]
mesa: add KHR_no_error support for glLogicOp()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add logic_op() helper
Timothy Arceri [Wed, 28 Jun 2017 03:40:09 +0000 (13:40 +1000)]
mesa: add logic_op() helper

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add KHR_no_error support for glPixelStore*()
Timothy Arceri [Wed, 28 Jun 2017 03:32:35 +0000 (13:32 +1000)]
mesa: add KHR_no_error support for glPixelStore*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: add pixel_storei() helper
Timothy Arceri [Wed, 28 Jun 2017 03:27:46 +0000 (13:27 +1000)]
mesa: add pixel_storei() helper

Will be used to add KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: remove redundant error check
Timothy Arceri [Tue, 27 Jun 2017 06:46:19 +0000 (16:46 +1000)]
mesa: remove redundant error check

We do the same check in the shared code in the set_tex_parameterf()
call.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on GL_ARB_texture...
Ian Romanick [Wed, 7 Jun 2017 08:35:08 +0000 (01:35 -0700)]
mesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on GL_ARB_texture_border_clamp

On NV20 (and probably also on earlier NV GPUs that lack
GL_ARB_texture_border_clamp) fixes the following piglit tests:

    gl-1.0-beginend-coverage gltexparameter[if]{v,}
    push-pop-texture-state
    texwrap 1d
    texwrap 1d proj
    texwrap 2d proj
    texwrap formats

All told, 49 more tests pass on NV20 (10de:0201).

No changes on Intel CI run or RV250 (1002:4c66).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agogenxml: Silence about a billion unused parameter warnings
Ian Romanick [Thu, 15 Jun 2017 01:59:09 +0000 (18:59 -0700)]
genxml: Silence about a billion unused parameter warnings

v2: Use textwrap.dedent to make the source line a lot shorter.
Shortening (?) the line was requested by Jason.

v3: Simplify the texwrap.dedent usage.  Suggested by Dylan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
7 years agomesa: Fix Android build
Chad Versace [Wed, 28 Jun 2017 21:36:29 +0000 (14:36 -0700)]
mesa: Fix Android build

The format_fallback.py script wants two arguments: 'csv-file' and
'out-file'.

Fixes: 20c99eaece "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"
Reported-by: Rob Herring <robh@kernel.org>
7 years agoi965: Fix anisotropic filtering for mag filter
Eero Tamminen [Tue, 27 Jun 2017 17:37:16 +0000 (10:37 -0700)]
i965: Fix anisotropic filtering for mag filter

Commit f8d69beed49c64f883bb8ffb28d4960306baf575 moving sampler
handling to genxml messed up change done by commit
6a7c5257cac23cd9767aa4bc8fdab68925b11157.

This broke rendering in SynMark CSDof and TexFilterAniso tests.

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

Thanks to Kevin, who spotted the actual typo!
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoetnaviv: fix shader miscompilation with more than 16 labels
Lucas Stach [Mon, 26 Jun 2017 16:24:31 +0000 (18:24 +0200)]
etnaviv: fix shader miscompilation with more than 16 labels

The labels array may change its virtual address on a reallocation, so
it is invalid to cache pointers into the array. Rather than using the
pointer directly, remember the array index.

Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs.

Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoac/nir: remove last remnants of v16i8
Dave Airlie [Wed, 28 Jun 2017 19:14:58 +0000 (20:14 +0100)]
ac/nir: remove last remnants of v16i8

llvm doesn't need this workaround anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoac/nir: Use correct LLVM intrinsics for atomic ops on imageBuffers
Alex Smith [Mon, 26 Jun 2017 16:17:32 +0000 (17:17 +0100)]
ac/nir: Use correct LLVM intrinsics for atomic ops on imageBuffers

The buffer intrinsics should be used instead of the image ones.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoac/nir: assert printfs will fit
James Legg [Fri, 23 Jun 2017 10:18:57 +0000 (11:18 +0100)]
ac/nir: assert printfs will fit

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoac/nir: Make intrinsic_name buffer long enough
James Legg [Fri, 23 Jun 2017 10:18:56 +0000 (11:18 +0100)]
ac/nir: Make intrinsic_name buffer long enough

When using cmpswap on an image, it was being trunctated to
lvm.amdgcn.image.atomic.cmpswa, with the coords type missing entirely.

v2: Add stable CC

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoi965/dri: Support R8G8B8A8 and R8G8B8X8 configs
Chad Versace [Sat, 27 May 2017 02:08:47 +0000 (19:08 -0700)]
i965/dri: Support R8G8B8A8 and R8G8B8X8 configs

The Android framework requires support for EGLConfigs with
HAL_PIXEL_FORMAT_RGBX_8888 and HAL_PIXEL_FORMAT_RGBA_8888.

Even though all RGBX formats are disabled on gen9 by
brw_surface_formats.c, the new configs work correctly on Broxton thanks
to _mesa_format_fallback_rgbx_to_rgba().

On GLX, this creates no new configs, and therefore breaks no existing
apps. See in-patch comments for explanation. I tested with glxinfo and
glxgears on Skylake.

On Wayland, this also creates no new configs, and therfore breaks no
existing apps. (I tested with mesa-demos' eglinfo and es2gears_wayland
on Skylake). The reason differs from GLX, though. In
dri2_wl_add_configs_for_visual(), the format table contains only
B8G8R8X8, B8G8R8A8, and B5G6B5; and dri2_add_config() correctly matches
EGLConfig to format by inspecting channel masks.

On Android, in Chrome OS, I tested this on a Broxton device. I confirmed
that the Google Play Store's EGLSurface used HAL_PIXEL_FORMAT_RGBA_8888,
and that an Asteroid game's EGLSurface used HAL_PIXEL_FORMAT_RGBX_8888.
Both apps worked well. (Disclaimer: I didn't test this patch on Android
with Mesa master. I backported this patch series to an older Android
branch).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: do not use format string as literal string
Juan A. Suarez Romero [Wed, 28 Jun 2017 11:40:48 +0000 (13:40 +0200)]
mesa: do not use format string as literal string

This fixes a couple of  errors when building in Android:

external/mesa3d/src/mesa/main/shaderapi.c:293:49: error: format string
is not a string literal (potentially insecure)
[-Werror,-Wformat-security]
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^~~~~~
external/mesa3d/src/mesa/main/shaderapi.c:293:49: note: treat the string
as an argument to avoid this
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoscons: add code to generate format_fallback.c file
Brian Paul [Wed, 28 Jun 2017 02:56:22 +0000 (20:56 -0600)]
scons: add code to generate format_fallback.c file

Fixes: a1983223d8839a0c9 "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: add KHR_no_error support for glClear()
Samuel Pitoiset [Mon, 26 Jun 2017 15:46:39 +0000 (17:46 +0200)]
mesa: add KHR_no_error support for glClear()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear() helper
Samuel Pitoiset [Mon, 26 Jun 2017 15:44:44 +0000 (17:44 +0200)]
mesa: add clear() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support for glBindAttribLocation()
Samuel Pitoiset [Mon, 26 Jun 2017 15:38:22 +0000 (17:38 +0200)]
mesa: add KHR_no_error support for glBindAttribLocation()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add bind_attrib_location() helper
Samuel Pitoiset [Mon, 26 Jun 2017 15:35:24 +0000 (17:35 +0200)]
mesa: add bind_attrib_location() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support for gl*ReadBuffer()
Samuel Pitoiset [Mon, 26 Jun 2017 15:12:18 +0000 (17:12 +0200)]
mesa: add KHR_no_error support for gl*ReadBuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: create read_buffer_err() and always inline read_buffer()
Samuel Pitoiset [Mon, 26 Jun 2017 15:06:14 +0000 (17:06 +0200)]
mesa: create read_buffer_err() and always inline read_buffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support for glVertex*AttribBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:50:48 +0000 (15:50 +0200)]
mesa: add KHR_no_error support for glVertex*AttribBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support for glShaderStorageBlockBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:35:10 +0000 (15:35 +0200)]
mesa: add KHR_no_error support for glShaderStorageBlockBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add shader_storage_block_binding() helper
Samuel Pitoiset [Mon, 26 Jun 2017 13:31:28 +0000 (15:31 +0200)]
mesa: add shader_storage_block_binding() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support for glUniformBlockBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:09:04 +0000 (15:09 +0200)]
mesa: add KHR_no_error support for glUniformBlockBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add uniform_block_binding() helper
Samuel Pitoiset [Mon, 26 Jun 2017 13:05:02 +0000 (15:05 +0200)]
mesa: add uniform_block_binding() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>