Commit graph

93681 commits

Author SHA1 Message Date
Kenneth Graunke
df1279e9df i965: Print access flags in INTEL_DEBUG=buf output.
Being able to see the access mode of various mappings is incredibly
useful for debugging.  With this patch, INTEL_DEBUG=buf now shows
data such as:

   bo_create: buf 7 (bufferobj) 640b
   bo_map_gtt: 7 (bufferobj) -> 0x7fca1fae5000, WRITE ASYNC
   brw_bo_map_cpu: 7 (bufferobj) -> 0x7fca1fae4000, READ
   bo_map_gtt: 5 (bufferobj) -> 0x7fca1fad4000, WRITE ASYNC
   brw_bo_map_cpu: 7 (bufferobj) -> 0x7fca1fae4000, READ

which makes it easy to see that there are async GTT writes with
intervening CPU reads.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-07-01 11:48:08 -07:00
Chris Wilson
d8382d6889 i965: Remove clearing of bo->map_gtt after failure
With the conversion to storing the result of drm_mmap to a local and not
directly to bo->map_gtt itself, we no longer should clear bo->map_gtt.
In the best the operation is redundant as we know bo->map_gtt to already
be NULL, but in the worst case we overwrite a concurrent thread that
successfully mmaped the GTT.

Fixes: 314647c4c2 ("i965: Drop global bufmgr lock from brw_bo_map_* functions.")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-01 11:46:34 -07:00
Kenneth Graunke
f78aa2c986 i965: Add inline to brw_bo_unmap
I meant to do this in "i965: Make brw_bo_unmap a static inline."
but botched the commit fixup.
2017-06-30 20:35:14 -07:00
Chris Wilson
314647c4c2 i965: Drop global bufmgr lock from brw_bo_map_* functions.
After removing the unusuable debugging code in the previous commit, we
can also entirely remove the global mutex around mapping the buffer for
the first time and replace it with a single atomic operation to update
the cache once we retrieve the mmap.

v2 (Ken): Split out from Chris's original commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-06-30 15:54:57 -07:00
Kenneth Graunke
bca92849b9 i965: Make brw_bo_unmap a static inline.
With the broken debugging code gone, it doesn't do anything anymore.
We could technically eliminate it, but I'd like to keep it around in
case we want to add something there again someday.  Otherwise we'd
have to go all over the codebase adding unmap calls back again.

Based on a patch by Chris Wilson.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-06-30 15:54:54 -07:00
Chris Wilson
c913241458 i965: Discard bo->map_count
Supposedly we were keeping a reference count for the number of users of
a mapping so that we could use valgrind to detect access to the map
outside of the valid section. However, we were incrementing the counter
only when first creating the cached mapping but decrementing on every
unmap. The bo->map_count tracking was wrong and so the debugging code
was completely useless.

v2 (Ken): Separate out atomic compare and swap optimization.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-06-30 15:54:52 -07:00
Kenneth Graunke
58d81d9dc2 i965: Add a comment about not needing VALGRIND_MALLOCLIKE_BLOCK.
At first glance this seems missing, since we handle it manually for CPU
and WC maps.  Although a bit inconsistent, it's actually not necessary.

Thanks to Chris Wilson for explaining this to me.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-06-30 15:54:44 -07:00
Bas Nieuwenhuizen
87d3349393 radv: Use v4i32 variant of llvm.SI.load.const.
We apparently still used v16i8 ....

As radeonsi doesn't use it with LLVM version checks I don't think
we need them either.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-06-30 23:30:55 +02:00
Brian Paul
f215f42f1b svga: add texture size/levels sanity check code in svga_texture_create()
The state tracker should never ask us to create a texture with invalid
dimensions / mipmap levels.  Do some assertions to check that.

No Piglit regressions.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-06-30 13:37:10 -06:00
Brian Paul
95d5c48f68 st/mesa: fix texture image resource selection in st_render_texture()
If we're rendering to an incomplete/inconsistent (cube) texture, the
different faces/levels of the texture may be stored in different
resources.  Before, we always used the texture object resource.  Now,
we use the texture image resource.  In normal circumstances, that's
the same resource.  But in some cases, such as the Piglit
fbo-incomplete-texture-03 test, the cube faces are in different
resources and we need to render to the texture image resource.

Fixes fbo-incomplete-texture-03 with VMware driver.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-06-30 13:37:10 -06:00
Brian Paul
f4d5e55dd1 st/mesa: check for incomplete texture in st_finalize_texture()
Return early from st_finalize_texture() if we have an incomplete
texture.  This avoids trying to create a texture resource with invalid
parameters (too many mipmap levels given the base dimension).

Specifically, the Piglit fbo-incomplete-texture-03 test winds up
calling pipe_screen::resource_create() with width0=32, height0=32 and
last_level=6 because the first five cube faces are 32x32 but the sixth
face is 64x64.  Some drivers handle this, but others (like VMware svga)
do not (generates device errors).

Note that this code is on the path that's usually not taken (we normally
build consistent textures).

No Piglit regressions.

v2: only need to check for base-level completeness since that's what has to
be consistent in order to specify the dimensions for a new gallium texture.
Per Roland.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-06-30 13:37:10 -06:00
Brian Paul
e54fe78e0e gallium/docs: document that TXF is used with PIPE_BUFFER resources
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-06-30 13:37:10 -06:00
Brian Paul
f4091e1638 gallium/docs: clarify that samplers are not used with PIPE_BUFFER resources
Commit 8aba778fa2 "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>
2017-06-30 13:37:10 -06:00
Eric Anholt
d623040dd5 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.
2017-06-30 12:25:45 -07:00
Eric Anholt
56541d356d vc4: Replace a couple of magic numbers with #define usage. 2017-06-30 12:25:45 -07:00
Eric Anholt
f6c5c6b9be 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
2017-06-30 12:25:45 -07:00
Eric Anholt
bd1925562a vc4: Convert the driver to emitting the shader record using pack macros. 2017-06-30 12:25:45 -07:00
Eric Anholt
8d36bd3d08 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
2017-06-30 12:25:45 -07:00
Eric Anholt
4cef255872 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
2017-06-30 12:25:45 -07:00
Eric Anholt
7f80a9ff13 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>
2017-06-30 12:25:45 -07:00
Bruce Cherniak
6646f6ba0d 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
b9b53e2695 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
80bd5cd9d0 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
ab564c7ab4 swr/rast: move default split size from driver to rasterizer
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Tim Rowley
64af92c977 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
fc4f6c44c4 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
8b66d18a3b 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
614de92f10 swr/rast: Fix unused variable warnings
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Tim Rowley
0cc7c46cf4 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
5eecaca911 swr/rast: gen_backends.py remove extraneous semicolon
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Tim Rowley
f87ff64850 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
cae53b24d7 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>
2017-06-30 13:26:19 -05:00
Tim Rowley
b89bd3694c swr/rast: gen_backends.py removal of commented debug prints
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Tim Rowley
248663f91d swr/rast: gen_backends.py quote cleanup
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Tim Rowley
ba64ddedc2 swr/rast: generators will create target directories
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
2017-06-30 13:26:19 -05:00
Andres Gomez
7d0f80b1d3 docs: update calendar, add news item and link release notes for 17.1.4
Signed-off-by: Andres Gomez <agomez@igalia.com>
2017-06-30 20:38:01 +03:00
Andres Gomez
ed587f7868 docs: add sha256 checksums for 17.1.4
Signed-off-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 5a24aa8c55)
2017-06-30 20:34:32 +03:00
Andres Gomez
158fb2ef20 docs: add release notes for 17.1.4
Signed-off-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit e60d010ef4)
2017-06-30 20:34:32 +03:00
Mauro Rossi
84690d06c1 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>
2017-06-30 11:23:51 -05:00
Brian Paul
0782350b80 svga: update a few surface format names
To sync with in-house changes.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
2017-06-30 08:24:27 -06:00
Brian Paul
d3cbe8c5f3 svga: whitespace fixes in svga_resource_buffer_upload.c
Trivial.
2017-06-30 08:24:27 -06:00
Charmaine Lee
5e5d5f1a2e 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>
2017-06-30 08:24:27 -06:00
Brian Paul
4f3974d758 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>
2017-06-30 08:24:27 -06:00
Charmaine Lee
adead35320 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>
2017-06-30 08:24:27 -06:00
Neha Bhende
31fe1d10b2 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>
2017-06-30 08:24:27 -06:00
Charmaine Lee
203d88460c svga: add mksstats for context creation
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-06-30 08:24:27 -06:00
Charmaine Lee
dbb5d2a790 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>
2017-06-30 08:24:27 -06:00
Juan A. Suarez Romero
5355107034 automake: include git_sha1_gen.sh into EXTRA_DIST
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-30 16:15:54 +02:00
Nicolai Hähnle
7fd08177a6 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>
2017-06-30 15:29:50 +02:00
Johnson Lin
165e704719 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>
2017-06-30 10:16:26 +01:00