Commit Graph

90201 Commits

Author SHA1 Message Date
Iago Toral Quiroga 023ea3772d 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>
2017-03-24 08:11:53 +01:00
Iago Toral Quiroga 4da1832c00 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>
2017-03-24 08:11:53 +01:00
Iago Toral Quiroga 50c8d2c1f7 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>
2017-03-24 08:11:53 +01:00
Iago Toral Quiroga 70194c9f1a 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>
2017-03-24 08:11:53 +01:00
Timothy Arceri adced4a2f9 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>
2017-03-24 11:23:06 +11:00
Timothy Arceri 0a32b52a27 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>
2017-03-24 11:20:09 +11:00
Grazvydas Ignotas 5136c09e70 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>
2017-03-24 11:20:09 +11:00
Grazvydas Ignotas feb716239e 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
2017-03-24 11:20:09 +11:00
Miklós Máté 7ceb1a4fa8 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>
2017-03-24 10:00:19 +11:00
Matt Turner 7499bc7fd7 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>
2017-03-23 14:34:44 -07:00
Matt Turner 1be91bd9d8 i965/fs: Return progress from demote_sample_qualifiers().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner fd3351246c i965/fs: Return progress from move_interpolation_to_top().
And mark as static at the same time.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner e0f8daeb86 i965: Return progress from brw_nir_lower_uniforms().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner ef71af7356 nir: Return progress from nir_convert_from_ssa().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner abc8a702d0 nir: Return progress from nir_lower_io().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner a934b00222 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>
2017-03-23 14:34:44 -07:00
Matt Turner b0e72defc2 nir: Return progress from nir_lower_samplers().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner 01548f9f01 nir: Return progress from nir_lower_atomics().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner 0bd615d961 nir: Return progress from nir_lower_clamp_color_outputs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner 9dbf91f5c0 nir: Return progress from nir_lower_clip_fs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner 4e4927cd95 nir: Return progress from nir_lower_clip_vs().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:44 -07:00
Matt Turner 6077cc75aa nir: Return progress from nir_move_vec_src_uses_to_dest().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner a539e05d00 nir: Return progress from nir_lower_to_source_mods().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner 5a7e4ae23d nir: Return progress from nir_lower_clip_cull_distance_arrays().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner 19345fc160 nir: Return progress from nir_lower_var_copies().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner b831b8d2e1 nir: Return progress from nir_lower_load_const_to_scalar().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner adb157ddfd nir: Return progress from nir_lower_64bit_pack().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner 0012a6144a nir: Return progress from nir_lower_doubles().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner c597f87739 nir: Return progress from nir_lower_vars_to_ssa().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner 7d41bf8d7b nir: Fix syntax.
et is not an abbreviation.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner 70c0455974 nir: Fix misspellings.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Matt Turner d6e2bdfed3 nir: Stop using apostrophes to pluralize.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-23 14:34:43 -07:00
Leo Liu 54f9f34181 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>
2017-03-23 14:43:42 -04:00
Daniel Stone 378025ca8b 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>
2017-03-23 15:28:41 +00:00
Eric Engestrom ec0313fd58 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>
2017-03-23 14:50:51 +00:00
Eric Engestrom 0adc9832f5 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>
2017-03-23 14:21:48 +00:00
Julien Isorce 48b5f1cca7 r600_shader.c: fix indentation
Introduced by ad13bd2e51

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-23 13:21:37 +00:00
Topi Pohjolainen 90633079ec 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>
2017-03-23 12:30:19 +00:00
Tapani Pälli 4f69573178 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>
2017-03-23 14:05:19 +02:00
Tapani Pälli bcae4eb502 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>
2017-03-23 14:04:44 +02:00
Mauro Rossi 0ff8ac1b55 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>
2017-03-23 08:20:18 +02:00
Tapani Pälli dc9ebc6ef1 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>
2017-03-23 08:19:16 +02:00
Boyan Ding 51b7fae1ae 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>
2017-03-22 22:51:35 -04:00
Eric Engestrom e8875c7a87 REVIEWERS: add myself as a reviewer for EGL and docs
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-23 00:35:45 +00:00
Dylan Baker 4ee675d537 anv: Remove dead prototype from entrypoints
Spotted by Emil.

v2: - Add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2017-03-22 16:22:00 -07:00
Dylan Baker 860beb99a6 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>
2017-03-22 16:22:00 -07:00
Dylan Baker 9050138af7 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>
2017-03-22 16:22:00 -07:00
Dylan Baker 4d4697f868 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>
2017-03-22 16:22:00 -07:00
Dylan Baker 96a5f2a5ac anv: anv_entrypoints_gen.py: use reduce function.
Reduce is it's own reward.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2017-03-22 16:22:00 -07:00
Dylan Baker dd3830d11b 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>
2017-03-22 16:22:00 -07:00