Anuj Phogat [Thu, 16 Mar 2017 17:35:49 +0000 (10:35 -0700)]
i965: Delete fast copy blit code
Fast copy blit was primarily added to support Yf/Ys detiling.
But, Yf/Ys tiling never got used in i965 due to not delivering
the expected performance benefits. Also, replacing legacy blits
with fast copy blit didn't help the benchmarking numbers. This
is probably due to a h/w restriction that says "start pixel for
Fast Copy blit should be on an OWord boundary". This restriction
causes many blit operations to skip fast copy blit and use legacy
blits. So, this patch is deleting this dead code in favor of
adding it later when we actually find it useful.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Kenneth Graunke [Wed, 22 Mar 2017 22:20:51 +0000 (15:20 -0700)]
i965: Require Kernel 3.6 for Gen4-5 platforms.
We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
commit
92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable
to require it for Gen4-5 as well, bumping the requirement from 2.6.39.
This is necessary for glClientWaitSync with a timeout to work, which
is a feature we expose on Gen4-5. Without it, we would fall back to an
infinite wait, which is pretty bad.
See kernel commit
172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Timothy Arceri [Mon, 27 Mar 2017 22:56:27 +0000 (09:56 +1100)]
glsl: fix spelling of embedded in comment
Timothy Arceri [Sun, 26 Mar 2017 12:34:13 +0000 (23:34 +1100)]
glsl: fix lower jumps for returns when loop is inside an if
Previously we would just escape the loop and move everything
following the loop inside the if to the else branch of a new if
with a return flag conditional. However everything outside the
if the loop was nested in would still get executed.
Adding a new return to the then branch of the new if fixes this
and we just let a follow pass clean it up if needed.
Fixes:
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Dave Airlie [Mon, 27 Mar 2017 19:45:00 +0000 (05:45 +1000)]
radv: don't emit no color formats. (v3)
If we had no rasterization, we'd emit SPI color
format as all 0's the hw dislikes this, add the workaround
from radeonsi.
Found while debugging tessellation
v2: handle at pipeline stage, we have to handle
it after we process the fragment shader. (Bas)
v3: simplify even further, remove old fallback.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Vinson Lee [Mon, 27 Mar 2017 18:57:48 +0000 (11:57 -0700)]
mesa/tests: Link main-test with CLOCK_LIB.
Fix 'make check' linking error with glibc < 2.17.
CXXLD main-test
../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano':
src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime'
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Matt Turner [Thu, 23 Mar 2017 19:12:18 +0000 (12:12 -0700)]
i965/fs: Don't emit SEL instructions for type-converting MOVs.
SEL can only convert between a few integer types, which we basically
never do.
Fixes fs/vs-double-uniform-array-direct-indirect-non-uniform-control-flow
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
Xu Randy [Mon, 20 Mar 2017 07:31:35 +0000 (15:31 +0800)]
anv/blorp: Fix a crash in CmdClearColorImage
We should use anv_get_layerCount() to access layerCount of VkImageSub-
resourceRange in anv_CmdClearColorImage and anv_CmdClearDepthStencil-
Image, which handles the VK_REMAINING_ARRAY_LAYERS (~0) case.
Test: Sample multithreadcmdbuf from LunarG can run without crash
Signed-off-by: Xu Randy <randy.xu@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Brian Paul [Mon, 27 Mar 2017 14:30:43 +0000 (08:30 -0600)]
mesa: simplify code around 'variable_data' in marshal.c
Remove needless pointer increments, unneeded vars, etc. Untested.
Plus, fix a couple comments.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Brian Paul [Mon, 27 Mar 2017 14:30:43 +0000 (08:30 -0600)]
st/mesa: move duplicated st_ws_framebuffer() function into header file
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Andres Gomez [Mon, 20 Feb 2017 15:20:58 +0000 (17:20 +0200)]
glsl: Interface Block instances don't need linking validation
From page 45 (page 52 of the PDF) of the GLSL ES 3.00 v.6 spec:
" When instance names are present on matched block names, it is
allowed for the instance names to differ; they need not match for
the blocks to match.
From page 51 (page 57 of the PDF) of the GLSL 4.30 v.8 spec:
" When instance names are present on matched block names, it is
allowed for the instance names to differ; they need not match for
the blocks to match."
Therefore, no cross linking validation is needed for the instance name
of an Interface Block.
This patch will make that no link error will be reported on a program
like this:
"# VS
layout(binding = 1) Block1 {
vec4 color;
} uni_block;
...
# FS
layout(binding = 2) Block2 {
vec4 color;
} uni_block;
..."
Fixes GL45-CTS.enhanced_layouts.ssb_layout_qualifier_conflict
Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Andres Gomez [Mon, 20 Feb 2017 14:49:14 +0000 (16:49 +0200)]
glsl: UBOs and SSBOs must match the binding qualifier too
From page 140 (page 147 of the PDF) of the GLSL ES 3.10 v.4 spec:
" 9.2 Matching of Qualifiers
The following tables summarize the requirements for matching of
qualifiers. It applies whenever there are two or more matching
variables in a shader interface.
Notes:
1. Yes means the qualifiers must match.
...
9.2.1 Linked Shaders
| Qualifier | Qualifier | in/out | Default | uniform | buffer|
| Class | | | Uniforms | Block | Block |
...
| Layout | binding | N/A | Yes | Yes | Yes |"
From page 93 (page 110 of the PDF) of the GL 4.2 (Core Profile) spec:
" 2.11.7 Uniform Variables
...
Uniform Blocks
...
When a named uniform block is declared by multiple shaders in a
program, it must be declared identically in each shader. The
uniforms within the block must be declared with the same names and
types, and in the same order. If a program contains multiple
shaders with different declarations for the same named uniform
block differs between shader, the program will fail to link."
From page 129 (page 150 of the PDF) of the GL 4.3 (Core Profile) spec:
" 7.8 Shader Buffer Variables and Shader Storage Blocks
...
When a named shader storage block is declared by multiple shaders
in a program, it must be declared identically in each shader. The
buffer variables within the block must be declared with the same
names, types, qualification, and declaration order. If a program
contains multiple shaders with different declarations for the same
named shader storage block, the program will fail to link."
Therefore, if the binding qualifier differs between two linked Uniform
or Shader Storage Blocks of the same name, a link error should happen.
This patch will make that a link error will be reported on a program
like this:
"# VS
layout(binding = 1) Block {
vec4 color;
} uni_block1;
...
# FS
layout(binding = 2) Block {
vec4 color;
} uni_block2;
..."
Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Andres Gomez [Wed, 22 Feb 2017 15:03:22 +0000 (17:03 +0200)]
glsl: on UBO/SSBOs link error reset the number of active blocks to 0
While it's legal to have an active blocks count > 0 on link failure.
Unless we actually assign memory for the blocks array we can end up
segfaulting in calls such as glUniformBlockBinding().
To avoid having to NULL check these api calls we simply reset the
block count to 0 if the array was not created.
Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Iglesias Gonsálvez [Thu, 23 Mar 2017 11:19:39 +0000 (12:19 +0100)]
anv: enable sampling from fast-cleared images on SKL
A resolve is not needed on Skylake in this case. We were forcing
a resolve because we set the input_aux_usage to ISL_AUX_USAGE_NONE.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Grazvydas Ignotas [Sun, 26 Mar 2017 16:30:23 +0000 (19:30 +0300)]
glsl, st/shader_cache: check the whole sha1 for zero
The checks were only looking at the first byte, while the intention
seems to be to check if the whole sha1 is zero. This prevented all
shaders with first byte zero in their sha1 from being saved.
This shaves around a second from Deus Ex load time on a hot cache.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Grazvydas Ignotas [Sun, 26 Mar 2017 16:28:38 +0000 (19:28 +0300)]
glsl/shader_cache: restore evicted shader keys
Even though the programs themselves stay in cache and are loaded, the
shader keys can be evicted separately. If that happens, unnecessary
compiles are caused that waste time, and no matter how many times the
program is re-run, performance never recovers to the levels of first
hot cache run. To deal with this, we need to refresh the shader keys
of shaders that were recompiled.
An easy way to currently observe this is running Deux Ex, then piglit
and Deux Ex again, or deleting just the cache index. The later is
causing over a minute of lost time on all later Deux Ex runs, with this
patch it returns to normal after 1 run.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Axel Davy [Wed, 15 Mar 2017 21:53:36 +0000 (22:53 +0100)]
st/nine: Use atomics for available_texture_mem
Resource dtor can be executed in the worker thread.
Use atomic to avoid threading safety issues.
CC: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: James Harvey <lothmordor@gmail.com>
Axel Davy [Wed, 15 Mar 2017 21:45:03 +0000 (22:45 +0100)]
st/nine: Resolve deadlock in surface/volume dtors when using csmt
Surfaces and Volumes can be freed in the worker thread.
Without this patch, pending_uploads_counter could be non-zero
in the Surfaces or Volumes dtor, leading to deadlock.
Instead decrease properly the counter before releasing the
item.
Also avoid another potential deadlock if the item is not
properly unlocked: Do not call UnlockRect which will cause deadlock,
but free directly using the deadlock safe
nine_context_get_pipe_multithread.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99246
CC: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: James Harvey <lothmordor@gmail.com>
Axel Davy [Wed, 15 Mar 2017 21:29:12 +0000 (22:29 +0100)]
st/nine: Fix user vertex data uploader with csmt
Fix regression caused by
abb1c645c476b5dd289ce3efae0594f8796f9cf8
The patch made csmt use context.pipe instead of
secondary_pipe, leading to thread safety issues.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Jose Fonseca [Sun, 26 Mar 2017 20:28:29 +0000 (21:28 +0100)]
scons: Fix dependencies of marshal_generated.[ch].
These generated source files depend not only upon gl_and_es_API.xml, but
all other XML files that are included by it.
This change updates the generation rules to depend on all gen/*.xml
files, like done for other SCons generation rules, and should fix
incremental broken SCons builds due to missing dependencies.
Trivial.
Vinson Lee [Wed, 22 Mar 2017 22:23:17 +0000 (15:23 -0700)]
glsl: Link tests with CLOCK_LIB.
Fix 'make check' linking errors with glibc < 2.17.
CXXLD glsl/glsl_test
glsl/.libs/libglsl.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano':
src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime'
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Timothy Arceri [Fri, 24 Mar 2017 06:46:20 +0000 (17:46 +1100)]
mesa/glthread: add custom marshalling for ClearBufferfv()
This is one of the main causes of syncs in Civ6.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Grazvydas Ignotas [Fri, 24 Mar 2017 23:58:42 +0000 (01:58 +0200)]
util/disk_cache: don't deadlock on premature EOF
If we get EOF earlier than expected, the current read loops will
deadlock. This may easily happen if the disk cache gets corrupted.
Fix it by using a helper function that handles EOF.
Steps to reproduce (on a build with asserts disabled):
$ glxgears
$ find ~/.cache/mesa/ -type f -exec truncate -s 0 '{}' \;
$ glxgears # deadlock
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Chad Versace [Tue, 21 Mar 2017 21:41:50 +0000 (14:41 -0700)]
genxml: Add 3DSTATE_DEPTH_BUFFER to gen5.xml
isl will use this for validating the depth buffer pitch.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Grazvydas Ignotas [Fri, 24 Mar 2017 22:56:51 +0000 (00:56 +0200)]
tests/cache_test: mark arguments const
While at it, also fix up a failure message to not reference timestamp
and gpu dirs as those are no longer being made.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Rob Clark [Tue, 21 Mar 2017 15:35:40 +0000 (11:35 -0400)]
freedreno: free compiler when screen is destroyed
Drop ir3_compiler_destroy(), since it is only ralloc_free() and we
shouldn't really have an ir3 dependency in core. If some future hw
has a new compiler, as long as all it's resources are ralloc()d then
things will all just work.
(In practice, I suppose you never really see this leak, but removing
it at least cleans up some noise in valgrind.)
Signed-off-by: Rob Clark <robdclark@gmail.com>
Jason Ekstrand [Fri, 24 Mar 2017 21:26:20 +0000 (14:26 -0700)]
genxml: Whitespace fixes
Some field names had extra spaces and some had places where we should
have had a space but didn't.
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Fri, 24 Mar 2017 21:25:57 +0000 (14:25 -0700)]
genxml: Replace "[N]" with "N"
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Fri, 24 Mar 2017 21:10:23 +0000 (14:10 -0700)]
genxml/gen6: Remove a couple of bogus values
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Fri, 24 Mar 2017 20:52:18 +0000 (13:52 -0700)]
genxml/gen8: Remove BLACK_LEVEL_CORRECTION_STATE
We've never used it, it only exists on gen8, and the name of the struct
contains piles of bad characters.
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Fri, 24 Mar 2017 20:50:34 +0000 (13:50 -0700)]
genxml: Rename two MCS fields to Auxiliary Surface on gen7
This makes gen7 more consistent with gen8+
Reviewed-by: Chad Versace <chadversary@chromium.org>
Rob Clark [Fri, 24 Mar 2017 21:03:05 +0000 (17:03 -0400)]
freedreno: fix memory leak
Otherwise blitter would still hold a ref to, for example, sampler-
views.
To reproduce:
glmark2 -b desktop:duration=2 --run-forever
Fixes: a8e6734 ("freedreno: support for using generic clear path")
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Chad Versace [Wed, 22 Mar 2017 22:59:02 +0000 (15:59 -0700)]
genxml: Fix gen_zipped_file.py dependency
The gen*_xml.h files depend on gen_zipped_file.py, not the gen*_pack.h
files.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Wed, 22 Mar 2017 22:49:39 +0000 (15:49 -0700)]
genxml: Define GENXML_XML_FILES in Makefile.sources
The future header genX_bits.h will depend on GENXML_XML_FILES.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Jan Vesely [Thu, 2 Mar 2017 00:45:03 +0000 (19:45 -0500)]
clover: use pipe_resource references
v2: buffers are created with one reference.
v3: add pipe_resource reference to mapping object
v4: rename to pres and drop inline initializers
CC: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Kenneth Graunke [Wed, 1 Mar 2017 01:04:00 +0000 (17:04 -0800)]
i965: Fix symbolic size of next_offset[] array.
It's indexed by buffer, not stream. BRW_MAX_SOL_BUFFERS and
MAX_VERTEX_STREAMS happen to both be 4, so there's no actual bug.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Fri, 17 Mar 2017 00:20:10 +0000 (17:20 -0700)]
i965: Remove pointless NULL check from Gen6 primitive counting code.
We create the BO when creating a transform feedback object, and only
destroy it when deleting that object. So it won't be NULL.
CID:
1401410
Reviewed-by: Matt Turner <mattst88@gmail.com>
Marek Olšák [Thu, 23 Mar 2017 23:38:15 +0000 (00:38 +0100)]
radeonsi: don't crash on compute shader compile failure
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 23 Mar 2017 23:17:23 +0000 (00:17 +0100)]
radeonsi: don't hang on shader compile failure
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>
Nicolai Hähnle [Thu, 23 Mar 2017 16:54:43 +0000 (17:54 +0100)]
radeonsi: fix dvec[34] attributes sourced from current attribute state
The state tracker no longer uploads those attributes for us,
so we must conservatively upload the size of the largest
attribute, which is a dvec4.
Fixes a regression of GL45-CTS.gpu_shader_fp64.varyings and
GL45-CTS.vertex_attrib_64bit.limits_test.
Fixes: 9b91e0b54cc2 ("radeonsi: allow unaligned vertex buffer offsets and strides on CIK-VI")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Emil Velikov [Thu, 23 Mar 2017 18:27:29 +0000 (18:27 +0000)]
anv: automake: ensure that the destination directory is created
Earlier commit unintentionally dropped the mkdir, as it was rebased.
Some versions of autotools will not create the output directory for
generated sources. Thus the issue went unnoticed by the original author.
Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Steven Newbury <steve@snewbury.org.uk>
Reported-by: Steven Newbury <steve@snewbury.org.uk> Fixes:
Fixes: 1610b3dede1 ("anv: don't pass xmlfile via stdin anv_entrypoints_gen.py")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Samuel Pitoiset [Thu, 23 Mar 2017 19:17:50 +0000 (20:17 +0100)]
glsl_to_tgsi: don't rely on glsl types when visiting tex instructions
Instead add is_cube_shadow like is_cube_array.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Iago Toral Quiroga [Wed, 22 Mar 2017 09:15:59 +0000 (10:15 +0100)]
anv/query: handle out of host memory without crashing in compute_query_result()
We don't need to make the caller (CmdCopyQueryPoolResults) aware of the
problem since compute_query_result() only emits state. The caller is also
expected to hit OOM in this scenario right after calling this function, but
it is already handling it safely.
Fixes:
dEQP-VK.api.out_of_host_memory.cmd_copy_query_pool_results
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Iago Toral Quiroga [Thu, 23 Mar 2017 10:56:06 +0000 (11:56 +0100)]
anv/pipeline: make FragCoord include sample positions when sample shading
We need to know if sample shading has been requested during shader
compilation since that affects the way fragment coordinates are
computed.
Notice that the semantics of fragment coordinates only depend on
whether sample shading has been requested, not on whether more
than one sample will actually be produced (that is,
minSampleShading and rasterizationSamples do not affect this
behavior).
Because this setting affects the code we generate for the shader, we also
need to include it in the WM prog key. Notice we don't need to alter the
OpenGL code because it doesn't ever use this behavior, so they key's
value is always false (the default).
Fixes:
dEQP-VK.glsl.builtin_var.fragcoord_msaa.*
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Iago Toral Quiroga [Thu, 23 Mar 2017 10:54:16 +0000 (11:54 +0100)]
nir/lower_wpos_center: support adding sample position to fragment coordinate
According to section 14.6 of the Vulkan specification:
"When sample shading is enabled, the x and y components of FragCoord
reflect the location of the sample corresponding to the shader
invocation."
So add a boolean parameter to the lowering pass to select this behavior
when we need it.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Iago Toral Quiroga [Wed, 22 Mar 2017 08:18:56 +0000 (09:18 +0100)]
anv: return VK_ERROR_DEVICE_LOST immeditely when device is known to be lost
If we know the device has been lost we should return this error code for
any command that can report it before we attempt to do anything with the
device.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Iago Toral Quiroga [Wed, 22 Mar 2017 07:46:04 +0000 (08:46 +0100)]
anv/device: keep track of 'device lost' state
The Vulkan specs say:
"A logical device may become lost because of hardware errors, execution
timeouts, power management events and/or platform-specific events. This
may cause pending and future command execution to fail and cause hardware
resources to be corrupted. When this happens, certain commands will
return VK_ERROR_DEVICE_LOST (see Error Codes for a list of such commands).
After any such event, the logical device is considered lost. It is not
possible to reset the logical device to a non-lost state, however the lost
state is specific to a logical device (VkDevice), and the corresponding
physical device (VkPhysicalDevice) may be otherwise unaffected. In some
cases, the physical device may also be lost, and attempting to create a
new logical device will fail, returning VK_ERROR_DEVICE_LOST."
This means that we need to track if a logical device has been lost so we can
have the commands referenced by the spec return VK_ERROR_DEVICE_LOST
immediately.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Iago Toral Quiroga [Wed, 22 Mar 2017 07:35:39 +0000 (08:35 +0100)]
anv/device: return VK_ERROR_DEVICE_LOST for errors during queue submissions
So that we don't have to do things like rolling back address relocations in
case that we ran into OOM after computing them, etc
Also, make sure that if the queue submission comes with a fence, we set it up
correctly so it behaves according to the spec after returning
VK_ERROR_DEVICE_LOST.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Timothy Arceri [Thu, 23 Mar 2017 06:19:36 +0000 (17:19 +1100)]
mesa/marshal: add custom BufferData/BufferSubData marshalling
GL_AMD_pinned_memory requires memory to be aligned correctly, so
we skip marshalling in this case. Also copying the data defeats
the purpose of EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD.
Fixes GL_AMD_pinned_memory piglit tests when glthread is enabled.
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Timothy Arceri [Tue, 21 Mar 2017 05:05:20 +0000 (16:05 +1100)]
util/disk_cache: write cache entry keys to file header
This can be used to deal with key hash collisions from different
versions (should we find that to actually happen) and to find
which mesa version produced the cache entry.
V2: use blob created at cache creation.
v3: remove left over var from v1.
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Grazvydas Ignotas [Wed, 15 Mar 2017 23:09:31 +0000 (01:09 +0200)]
util/disk_cache: hash pointer size and gpu name into cache keys
This allows to get rid of the arch and gpu name directories.
v2: (Timothy Arceri) don't use an opaque data type to store
pointer size and gpu name.
v3: (Timothy Arceri) use blob to store driver keys just make sure
to store null terminator for strings, and make sure blob is
defined by disk_cache and not it's users.
v4: (Timothy Arceri) fix typo, and make ptr_size a uint8_t.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Grazvydas Ignotas [Wed, 15 Mar 2017 23:09:29 +0000 (01:09 +0200)]
util/disk_cache: hash timestamps into the cache keys
Instead of using a directory, hash the timestamps into the cache keys
themselves. Since there is no more timestamp directory, there is no more
need for deleting the cache of other mesa versions and we rely on
eviction to clean up the old cache entries. This solves the problem of
using several incarnations of disk_cache at the same time, where one
deletes a directory belonging to the other, like when both OpenGL and
gallium nine are used simultaneously (or several different mesa
installations).
v2: using additional blob instead of trying to clone sha1 state
v3: (Timothy Arceri) don't use an opaque data type to store
timestamp.
V4: (Timothy Arceri) use blob to store driver keys just make sure
to store null terminator for strings, and make sure blob is
defined by disk_cache and not it's users.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100091
Miklós Máté [Sat, 18 Mar 2017 21:55:43 +0000 (22:55 +0100)]
mesa: set thread name for glthread
Signed-off-by: Miklós Máté <mtmkls@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Matt Turner [Thu, 9 Mar 2017 19:40:17 +0000 (11:40 -0800)]
i965: Replace OPT_V() with OPT().
We want to be able to check the progress of each pass and dump the NIR
for debugging purposes if it changed.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 19:13:52 +0000 (11:13 -0800)]
i965/fs: Return progress from demote_sample_qualifiers().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 19:05:08 +0000 (11:05 -0800)]
i965/fs: Return progress from move_interpolation_to_top().
And mark as static at the same time.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 19:01:53 +0000 (11:01 -0800)]
i965: Return progress from brw_nir_lower_uniforms().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 19:49:57 +0000 (11:49 -0800)]
nir: Return progress from nir_convert_from_ssa().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 19:01:22 +0000 (11:01 -0800)]
nir: Return progress from nir_lower_io().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 9 Mar 2017 18:56:20 +0000 (10:56 -0800)]
nir: Return progress from nir_lower_regs_to_ssa().
And from nir_lower_regs_to_ssa_impl() as well.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:28:14 +0000 (11:28 -0800)]
nir: Return progress from nir_lower_samplers().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:24:19 +0000 (11:24 -0800)]
nir: Return progress from nir_lower_atomics().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:18:04 +0000 (11:18 -0800)]
nir: Return progress from nir_lower_clamp_color_outputs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:15:53 +0000 (11:15 -0800)]
nir: Return progress from nir_lower_clip_fs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:14:36 +0000 (11:14 -0800)]
nir: Return progress from nir_lower_clip_vs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Tue, 28 Feb 2017 00:28:43 +0000 (16:28 -0800)]
nir: Return progress from nir_move_vec_src_uses_to_dest().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:45:09 +0000 (15:45 -0800)]
nir: Return progress from nir_lower_to_source_mods().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:38:28 +0000 (15:38 -0800)]
nir: Return progress from nir_lower_clip_cull_distance_arrays().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:34:40 +0000 (15:34 -0800)]
nir: Return progress from nir_lower_var_copies().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:32:11 +0000 (15:32 -0800)]
nir: Return progress from nir_lower_load_const_to_scalar().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:29:24 +0000 (15:29 -0800)]
nir: Return progress from nir_lower_64bit_pack().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:27:07 +0000 (15:27 -0800)]
nir: Return progress from nir_lower_doubles().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 24 Feb 2017 23:22:54 +0000 (15:22 -0800)]
nir: Return progress from nir_lower_vars_to_ssa().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Thu, 2 Mar 2017 19:09:00 +0000 (11:09 -0800)]
nir: Fix syntax.
et is not an abbreviation.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Tue, 28 Feb 2017 00:28:53 +0000 (16:28 -0800)]
nir: Fix misspellings.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Tue, 28 Feb 2017 01:21:42 +0000 (17:21 -0800)]
nir: Stop using apostrophes to pluralize.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Leo Liu [Thu, 23 Mar 2017 14:29:47 +0000 (10:29 -0400)]
st/omx/enc: use PIPE_USAGE_STAGING for output buffer
Workaround an unknown bug with inside the transfer_map for certain
ASIC, also tested with un-affected ASICs, the performance actually
improved slightly.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Daniel Stone [Thu, 23 Mar 2017 15:09:49 +0000 (15:09 +0000)]
gbm: Use unsigned for BO offset getter
The actual offset returned is uint32_t, however int64_t was used as the
return type from gbm_bo_get_offset to allow negative returns to signal
errors to the caller.
In case of an error getting the offset, the user will also be unable to
get the handle/FD, and thus have nothing to offset into. This means that
returning 0 as an error value is harmless, allowing us to change the
return type to uint32_t in order to avoid signed/unsigned confusion in
callers.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Eric Engestrom [Wed, 22 Mar 2017 16:54:52 +0000 (16:54 +0000)]
REVIEWERS: add autogen.sh to the autoconf group
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Eric Engestrom [Wed, 22 Mar 2017 15:55:28 +0000 (15:55 +0000)]
docs/submittingpatches: add mention about legal disclaimers
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Julien Isorce [Wed, 22 Mar 2017 13:43:45 +0000 (13:43 +0000)]
r600_shader.c: fix indentation
Introduced by
ad13bd2e51a5dc01b0f8a0eb927022f0deac0a0c
Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Topi Pohjolainen [Thu, 23 Mar 2017 12:27:40 +0000 (12:27 +0000)]
glx: Prefer library path given by pkgconfig over the system
Recent change to use drmGetDevices2() made me realize that
build configured using
PKG_CONFIG_PATH=my_drm_lib_path/pkgconfig ./autogen.sh
considers the libdrm path gotten from pkgconfig only during
make. When invoking "make install" the relink command puts
system library ahead of the path gotten from pkgconfig
(and starts to fail as system libdrm isn't new enough).
This change forces the relink command to respect pkgconfig
settings.
It looks to me that in
https://bugs.freedesktop.org/show_bug.cgi?id=100259
with Emil et al considering it a libtool bug.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
[Emil Velikov: add inline comment]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tapani Pälli [Thu, 23 Mar 2017 07:15:54 +0000 (09:15 +0200)]
intel: move gen_decoder.* to DECODER_FILES
patch adds DECODER_FILES for libintel_common, this is so that platforms
such as Android not currently using this functionality can opt out.
Fixes: 7d84bb3 ("intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Tapani Pälli [Thu, 23 Mar 2017 10:48:34 +0000 (12:48 +0200)]
android: fix vulkan build issues with anv_entrypoints
Patch fixes entrypoint generation for libmesa_anv_entrypoints that
still used old style of calling generator script.
Also small fixes to libmesa_vulkan_common where there was a typo
in target name (vulknan) and files were generated to wrong folder.
Fixes: 8211e3e6 ("anv: Generate anv_entrypoints header and code in one command")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Mauro Rossi [Sun, 12 Mar 2017 23:01:21 +0000 (00:01 +0100)]
android: i965: generate code for OA counter queries
Automake generation rules are replicated for android.
$* macro was expected to return "hsw" but instead gives "hsw.{h,c}"
so $(basename $*) is used as a workaround
to set the correct --chipset option for brw_oa.py script.
Build tested with nougat-x86
Fixes: e565505 "i965: Add script to gen code for OA counter queries"
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Robert Bragg <robert@sixbynine.org>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Tapani Pälli [Tue, 21 Mar 2017 08:04:48 +0000 (10:04 +0200)]
android: rename Intel Vulkan library to match desktop one
Original naming was following Vulkan HAL naming scheme for no good
purpose and we need same binary name for build-id code.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Boyan Ding [Wed, 22 Mar 2017 03:18:19 +0000 (11:18 +0800)]
nouveau: enable glsl/tgsi on-disk cache
v2: Fix argument to nouveau_screen_get_name()
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Eric Engestrom [Wed, 22 Mar 2017 16:10:30 +0000 (16:10 +0000)]
REVIEWERS: add myself as a reviewer for EGL and docs
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Dylan Baker [Thu, 23 Feb 2017 17:46:52 +0000 (09:46 -0800)]
anv: Remove dead prototype from entrypoints
Spotted by Emil.
v2: - Add this patch
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Tue, 21 Feb 2017 19:21:24 +0000 (11:21 -0800)]
anv: use cElementTree in anv_entrypoints_gen.py
It's written in C rather than pure python and is strictly faster, the
only reason not to use it that it's classes cannot be subclassed.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Tue, 21 Feb 2017 19:16:43 +0000 (11:16 -0800)]
anv: don't use Element.get in anv_entrypoints_gen.py
This has the potential to mask errors, since Element.get works like
dict.get, returning None if the element isn't found. I think the reason
that Element.get was used is that vulkan has one extension that isn't
really an extension, and thus is missing the 'protect' field.
This patch changes the behavior slightly by replacing get with explicit
lookup in the Element.attrib dictionary, and using xpath to only iterate
over extensions with a "protect" attribute.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Tue, 21 Feb 2017 19:07:44 +0000 (11:07 -0800)]
anv: use dict.get in anv_entrypoints_gen.py
Instead of using an if and a check, use dict.get, which does the same
thing, but more succinctly.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Tue, 21 Feb 2017 19:00:41 +0000 (11:00 -0800)]
anv: anv_entrypoints_gen.py: use reduce function.
Reduce is it's own reward.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Tue, 21 Feb 2017 18:58:32 +0000 (10:58 -0800)]
anv: anv-entrypoints_gen.py: rename hash to cal_hash.
hash is reserved name in python, it's the interface to access an
object's hash protocol.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Fri, 3 Mar 2017 22:22:44 +0000 (14:22 -0800)]
anv: Generate anv_entrypoints header and code in one command
This produces the header and the code in one command, saving the need to
call the same script twice, which parses the same XML file.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Sat, 18 Feb 2017 00:59:42 +0000 (16:59 -0800)]
anv: anv_entrypoints_gen.py: directly write files instead of piping
This changes the output to be written as a file rather than being piped.
This had one critical advantage, it encapsulates the encoding. This
prevents bugs where a symbol (generally unicode like © [copyright]) is
printed and the system being built on doesn't have a unicode locale.
v2: - Update Android.mk
v3: - Don't generate both files at once
- Fix Android.mk
- drop --outdir, since the filename is passed in as an argument
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Sat, 18 Feb 2017 00:54:27 +0000 (16:54 -0800)]
anv: convert C generation to template in anv_entrypoints_gen.py
This produces a file that is identical except for whitespace, there is a
table that has 8 columns in the original and is easy to do with prints,
but is ugly using mako, so it doesn't have columns; the data is not
inherently tabular.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Fri, 17 Feb 2017 22:31:20 +0000 (14:31 -0800)]
anv: convert header generation in anv_entrypoints_gen.py to mako
This produces an identical file except for whitespace.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Fri, 24 Feb 2017 16:47:54 +0000 (08:47 -0800)]
anv: Update "do not edit" comments with proper filename
This does two things, first it updates both the .h and the .c file to
have the same do not edit string. Second, it uses __file__ to ensure
that even if the file is moved or renamed that the name will be correct.
One thing to note is the use of '{{' and '}}' in the C template. This is
to instruct python to print a literal '{' and '}' respectively, rather
than treating the contents as a formatter specifier.
v3: - add this patch
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Dylan Baker [Fri, 17 Feb 2017 19:45:24 +0000 (11:45 -0800)]
anv: split main into two functions in anv_entrypoints_gen.py
This is groundwork for the next patches, it will allows porting the
header and the code to mako separately, and will also allow both to be
run simultaneously.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>