mesa.git
4 years agoloader: Move non-error message to debug level
Fabio Estevam [Sat, 4 Mar 2017 22:07:27 +0000 (19:07 -0300)]
loader: Move non-error message to debug level

Currently when running mesa on imx6 the following loader warnings
are seen:

# kmscube -D /dev/dri/card1
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
Using display 0x1920948 with EGL version 1.4

As this is not an error message, change it to debug level in
order to have a cleaner log output.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoandroid: r600: fix libmesa_amd_common dependency
Mauro Rossi [Sun, 5 Mar 2017 21:23:24 +0000 (22:23 +0100)]
android: r600: fix libmesa_amd_common dependency

Adding libmesa_amd_common dependency and exporting its headers,
avoids the following building error:

external/mesa/src/gallium/drivers/r600/evergreen_compute.c:29:10: fatal error: 'ac_binary.h' file not found
         ^
1 error generated.

Fixes: 3bbbb63 "automake: r600: radeonsi: correctly manage libamd_common.la linking"
Fixes: 503fb13 "radeon/ac: switch to ac_shader_binary_config_start()"
v2 [Emil Velikov: drop unneeded LOCAL_EXPORT_C_INCLUDE_DIRS]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
4 years agogallium/targets: rework the empty targets removal
Emil Velikov [Sun, 5 Mar 2017 17:17:10 +0000 (17:17 +0000)]
gallium/targets: rework the empty targets removal

Earlier commit added extra tracking and we've attempted to remove the
vdpau/other folder if empty. V2 of said commit dropped the pipe
to /dev/null and the explicit "true" override.

Sadly both of those are needed since there's no guarantee that the
folder will be empty before we [mesa] make install.

Since we're bringing those two back, there's no need to track if we've
installed anything, and simply do "rm -d foo/ &>/dev/null || true"

Tested-by: Andy Furniss <adf.lists@gmail.com>
Reported-by: Andy Furniss <adf.lists@gmail.com>
Fixes: 1cd4fde053 ("gallium/targets: don't leave an empty target directory(ies)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil/indices: minor clean-ups
Brian Paul [Sun, 5 Mar 2017 19:59:09 +0000 (12:59 -0700)]
util/indices: minor clean-ups

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agoradeonsi: s/uint/enum pipe_shader_type/
Brian Paul [Tue, 7 Mar 2017 02:05:00 +0000 (19:05 -0700)]
radeonsi: s/uint/enum pipe_shader_type/

This can probably be done in more places in the driver.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agogallium: s/uint/enum pipe_render_cond_flag/ for set_render_condition()
Brian Paul [Sun, 5 Mar 2017 20:07:28 +0000 (13:07 -0700)]
gallium: s/uint/enum pipe_render_cond_flag/ for set_render_condition()

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agogallium: s/uint/enum pipe_shader_type/ for set_constant_buffer()
Brian Paul [Sun, 5 Mar 2017 19:45:34 +0000 (12:45 -0700)]
gallium: s/uint/enum pipe_shader_type/ for set_constant_buffer()

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agogallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()
Brian Paul [Sun, 5 Mar 2017 19:35:22 +0000 (12:35 -0700)]
gallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agovirgl: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:30:17 +0000 (12:30 -0700)]
virgl: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agoswr: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:30:01 +0000 (12:30 -0700)]
swr: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agosoftpipe: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:29:44 +0000 (12:29 -0700)]
softpipe: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agollvmpipe: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:29:22 +0000 (12:29 -0700)]
llvmpipe: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agofreedreno: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:29:07 +0000 (12:29 -0700)]
freedreno: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agoetnaviv: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:28:51 +0000 (12:28 -0700)]
etnaviv: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agodraw: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:18:06 +0000 (12:18 -0700)]
draw: s/unsigned/enum pipe_shader_type/

and some s/uint/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agocso: s/unsigned/enum pipe_shader_type/
Brian Paul [Sun, 5 Mar 2017 19:16:39 +0000 (12:16 -0700)]
cso: s/unsigned/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agogallium: s/unsigned/enum pipe_shader_type/ for pipe_screen::get_shader_param()
Brian Paul [Sun, 5 Mar 2017 19:13:02 +0000 (12:13 -0700)]
gallium: s/unsigned/enum pipe_shader_type/ for pipe_screen::get_shader_param()

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
4 years agoanv: change BLOCK_POOL_MEMFD_SIZE to exactly 2GB
Tapani Pälli [Tue, 7 Mar 2017 09:17:42 +0000 (11:17 +0200)]
anv: change BLOCK_POOL_MEMFD_SIZE to exactly 2GB

This is what comment above definition says and change fixes issue with
32bit build where BLOCK_POOL_MEMFD_SIZE is used as ftruncate parameter
and constant currently gets converted from 4294967296 to 0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
4 years agoRevert "configure.ac: Use PKG_CHECK_VAR for wayland-scanner."
Matt Turner [Wed, 8 Mar 2017 05:24:00 +0000 (21:24 -0800)]
Revert "configure.ac: Use PKG_CHECK_VAR for wayland-scanner."

This reverts commit 8a26e944399ae4d0fd662e5106f0b34f5ced462d.

4 years agoRevert "configure.ac: Use PKG_CHECK_VAR for libclc."
Matt Turner [Wed, 8 Mar 2017 05:23:57 +0000 (21:23 -0800)]
Revert "configure.ac: Use PKG_CHECK_VAR for libclc."

This reverts commit 706074cc96cec8bad6c3569fc53b0b3a05ad176f.

4 years agoi965: Remove use of deprecated drm_intel_aub routines
Chris Wilson [Fri, 7 Aug 2015 18:18:55 +0000 (19:18 +0100)]
i965: Remove use of deprecated drm_intel_aub routines

With mesa/drm commit cd2f91e18db087edf93fed828e568ee53b887860
Author: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Date:   Fri Jul 31 10:47:50 2015 -0700

    intel: Drop aub dumping functionality

the drm_intel_aub routines are mere stubs and do nothing. Likewise
remove our invocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agospirv: Silence unused variable warnings in release mode
Jason Ekstrand [Tue, 7 Mar 2017 20:54:33 +0000 (12:54 -0800)]
spirv: Silence unused variable warnings in release mode

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoanv: Make the framebuffer-renderpass format assert non-fatal
Jason Ekstrand [Tue, 7 Mar 2017 17:29:46 +0000 (09:29 -0800)]
anv: Make the framebuffer-renderpass format assert non-fatal

This should let Dota 2 run on debug builds though it will spew errors
like mad.  Hopefully, Valve will get this fixed sooner rather than
later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: Drop the anv_validate block helper
Jason Ekstrand [Tue, 7 Mar 2017 17:25:14 +0000 (09:25 -0800)]
anv: Drop the anv_validate block helper

Over the course of driver development, we've come up with a number of
different schemes for adding giant blocks of asserts inside the driver.
This one is only being used once in anv_pipeline.c and the way it's
being used actually generates compiler warnings in release builds.  This
commit drops the anv_validate macro and just puts the contents of the
one validation function in side of a "#ifdef DEBUG" guard.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: Get rid of the stub() macros
Jason Ekstrand [Tue, 7 Mar 2017 17:19:29 +0000 (09:19 -0800)]
anv: Get rid of the stub() macros

Except for a few unimplemented things on gen7, we don't really have
stubs anymore so we should drop this.  This commit replaces the few gen7
stub() calls with explicitly labeled finishme's and makes the sparse
binding stuff silently no-op or return a FEATURE_NOT_PRESENT error.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: Remove a pointless finishme
Jason Ekstrand [Tue, 7 Mar 2017 17:14:34 +0000 (09:14 -0800)]
anv: Remove a pointless finishme

We've been supporting multiple shaders per module for some time now.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: Convert the HiZ finishme's to perf_warn
Jason Ekstrand [Tue, 7 Mar 2017 17:14:23 +0000 (09:14 -0800)]
anv: Convert the HiZ finishme's to perf_warn

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: Add a performance warning helper
Jason Ekstrand [Tue, 7 Mar 2017 17:13:15 +0000 (09:13 -0800)]
anv: Add a performance warning helper

This acts identically to anv_finishme except that it only dumps out
these nice log messages if you run with INTEL_DEBUG=perf.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agost/mesa: don't propagate uniforms when restoring from cache
Timothy Arceri [Fri, 3 Mar 2017 05:59:48 +0000 (16:59 +1100)]
st/mesa: don't propagate uniforms when restoring from cache

We will have already loaded the uniforms when the parameter list
was restored from cache.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradv: remove duplicate initialization of alphaToOne feature
Damien Grassart [Sun, 5 Mar 2017 23:56:20 +0000 (00:56 +0100)]
radv: remove duplicate initialization of alphaToOne feature

Fixes a GCC warning when compiling with -Wextra:
radv_device.c:463:47: warning: initialized field overwritten [-Woverride-init]

Signed-off-by: Damien Grassart <damien@grassart.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: disable mip point pre clamping.
Dave Airlie [Tue, 7 Mar 2017 05:08:42 +0000 (05:08 +0000)]
radv: disable mip point pre clamping.

No idea what this does, but disabling it fixes a bunch
of failing CTS tests in the lod area, so let's go with that.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: fix multiple descriptor sets with dynamic buffers
Fredrik Höglund [Tue, 7 Mar 2017 00:53:22 +0000 (01:53 +0100)]
radv/ac: fix multiple descriptor sets with dynamic buffers

The dynamic_offset_offset in the descriptor set binding layout is
relative to the dynamic_offset_start for the set in the pipeline
layout.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: fix the size of the dynamic_buffers array
Fredrik Höglund [Tue, 7 Mar 2017 00:53:21 +0000 (01:53 +0100)]
radv: fix the size of the dynamic_buffers array

A buffer descriptor is 16 bytes, not 16 dwords.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: fix the dynamic buffer index in vkCmdBindDescriptorSets
Fredrik Höglund [Tue, 7 Mar 2017 00:53:20 +0000 (01:53 +0100)]
radv: fix the dynamic buffer index in vkCmdBindDescriptorSets

This fixes the wrong dynamic buffer descriptors being updated when
firstSet > 0.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoconfigure.ac: Ensure libomxil-bellagio exists before invoking pkg-config.
Matt Turner [Mon, 6 Mar 2017 18:49:05 +0000 (10:49 -0800)]
configure.ac: Ensure libomxil-bellagio exists before invoking pkg-config.

I was already tired of seeing the message

    Package libomxil-bellagio was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libomxil-bellagio.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libomxil-bellagio' found

on every configure, but I just got a distro bug reported where the user
was confused by this message and thought it indicated a bug.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoconfigure.ac: Ensure libva is enabled before invoking pkg-config.
Matt Turner [Mon, 6 Mar 2017 18:42:30 +0000 (10:42 -0800)]
configure.ac: Ensure libva is enabled before invoking pkg-config.

PKG_CHECK_VAR can only check --variable=$NAME, so it cannot handle
modversion.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoconfigure.ac: Use PKG_CHECK_VAR for libclc.
Matt Turner [Mon, 6 Mar 2017 18:42:10 +0000 (10:42 -0800)]
configure.ac: Use PKG_CHECK_VAR for libclc.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoconfigure.ac: Use PKG_CHECK_VAR for wayland-scanner.
Matt Turner [Mon, 6 Mar 2017 18:20:10 +0000 (10:20 -0800)]
configure.ac: Use PKG_CHECK_VAR for wayland-scanner.

Available since pkg-config-0.28 and pkgconf-0.8.10.

The removal of the AC_PATH_PROG is intentional. Use pkg-config.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoconfigure.ac: Fix error message in radeon_llvm_check().
Matt Turner [Mon, 6 Mar 2017 17:17:19 +0000 (09:17 -0800)]
configure.ac: Fix error message in radeon_llvm_check().

It printed the version of LLVM ($1):

   configure: error: 3.6.0 requires libelf when using llvm

instead of the driver name ($2):

   configure: error: r600 requires libelf when using llvm

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tobias Droste <tdroste@gmx.de>
4 years agobuild: Replace NEED_RADEON_LLVM with HAVE_GALLIUM_LLVM.
Matt Turner [Mon, 6 Mar 2017 17:35:33 +0000 (09:35 -0800)]
build: Replace NEED_RADEON_LLVM with HAVE_GALLIUM_LLVM.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoradv: Use the subresource range in HTILE initialization.
Bas Nieuwenhuizen [Tue, 7 Mar 2017 00:07:02 +0000 (01:07 +0100)]
radv: Use the subresource range in HTILE initialization.

v2: fix levelCount assert.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: Use winsys HTILE info.
Bas Nieuwenhuizen [Mon, 6 Mar 2017 23:58:04 +0000 (00:58 +0100)]
radv: Use winsys HTILE info.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/amdgpu: Let addrlib calculate the HTILE parameters.
Bas Nieuwenhuizen [Mon, 6 Mar 2017 23:37:46 +0000 (00:37 +0100)]
radv/amdgpu: Let addrlib calculate the HTILE parameters.

Still not sure we can support miptrees when sampling from
HTILE enabled textures.

Added the tcCompatible winsys stuff while I'm at it.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoamd/common: document PREDICATION OP 3 as 64-bit bool.
Dave Airlie [Wed, 1 Mar 2017 19:40:09 +0000 (05:40 +1000)]
amd/common: document PREDICATION OP 3 as 64-bit bool.

This just documents some info for possible future use.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: handle z offset for 3d image <-> buffer copies.
Dave Airlie [Tue, 7 Mar 2017 00:30:01 +0000 (00:30 +0000)]
radv: handle z offset for 3d image <-> buffer copies.

This fixes:
dEQP-VK.pipeline.render_to_image.3d.huge.depth.r8g8b8a8_unorm

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: move fast clear before resolve into own loop.
Dave Airlie [Mon, 6 Mar 2017 23:31:48 +0000 (23:31 +0000)]
radv: move fast clear before resolve into own loop.

Don't fast clear inside the meta loop as things get
confused, fixes a crash in:
dEQP-VK.api.copy_and_blit.resolve_image.whole_array_image.2_bit

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: Disable HTILE for textures with multiple layers/levels.
Bas Nieuwenhuizen [Mon, 6 Mar 2017 22:23:57 +0000 (23:23 +0100)]
radv: Disable HTILE for textures with multiple layers/levels.

It has issues and the fix I'm working on is too complicated for stable,
so disable for now.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
CC: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
4 years agoradv: Properly handle destroying NULL devices and instances
Dave Airlie [Mon, 6 Mar 2017 05:40:16 +0000 (15:40 +1000)]
radv: Properly handle destroying NULL devices and instances

Ported from anv:
3d33a23e anv: Properly handle destroying NULL devices and instances

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: introduce i1true/i1false to context.
Dave Airlie [Mon, 6 Mar 2017 02:24:59 +0000 (12:24 +1000)]
radv/ac: introduce i1true/i1false to context.

This uses these in a few places, and fixes one or two
cases which were using da as 32-bit instead of bool.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: handle Z export using new builder.
Dave Airlie [Mon, 6 Mar 2017 00:06:11 +0000 (10:06 +1000)]
radv/ac: handle Z export using new builder.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: move to using common ac_get_image_intr_name.
Dave Airlie [Sun, 5 Mar 2017 22:37:54 +0000 (08:37 +1000)]
radv/ac: move to using common ac_get_image_intr_name.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradeonsi/ac: move get_image_intr_name to common
Dave Airlie [Sun, 5 Mar 2017 22:37:22 +0000 (08:37 +1000)]
radeonsi/ac: move get_image_intr_name to common

This code is used in radv, so move to common build code.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agogallium/util: remove unused header from u_queue.c
Timothy Arceri [Mon, 6 Mar 2017 00:58:29 +0000 (11:58 +1100)]
gallium/util: remove unused header from u_queue.c

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: remove unused pipe_thread_destroy()
Timothy Arceri [Mon, 6 Mar 2017 00:58:28 +0000 (11:58 +1100)]
gallium/util: remove unused pipe_thread_destroy()

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_thread_wait() with thrd_join()
Timothy Arceri [Mon, 6 Mar 2017 00:58:27 +0000 (11:58 +1100)]
gallium/util: replace pipe_thread_wait() with thrd_join()

Replace done using:
find ./src -type f -exec sed -i -- \
's:pipe_thread_wait(\([^)]*\)):thrd_join(\1, NULL):g' {} \;

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: remove PIPE_THREAD_ROUTINE()
Timothy Arceri [Mon, 6 Mar 2017 00:58:26 +0000 (11:58 +1100)]
gallium/util: remove PIPE_THREAD_ROUTINE()

This was made unnecessary with fd33a6bcd7f12.

This was mostly done with:
find ./src -type f -exec sed -i -- \
's:PIPE_THREAD_ROUTINE(\([^,]*\), \([^)]*\)):int\n\1(void \*\2):g' {} \;

With some small manual tidy ups.

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar with cnd_t
Timothy Arceri [Sun, 5 Mar 2017 23:41:39 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar with cnd_t

pipe_condvar was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_thread with thrd_t
Timothy Arceri [Sun, 5 Mar 2017 01:39:49 +0000 (12:39 +1100)]
gallium/util: replace pipe_thread with thrd_t

pipe_thread was made unnecessary with fd33a6bcd7f12.

V2: fix compile error in u_queue.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_mutex_unlock() with mtx_unlock()
Timothy Arceri [Sun, 5 Mar 2017 01:32:06 +0000 (12:32 +1100)]
gallium/util: replace pipe_mutex_unlock() with mtx_unlock()

pipe_mutex_unlock() was made unnecessary with fd33a6bcd7f12.

Replaced using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_unlock(\([^)]*\)):mtx_unlock(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_mutex_lock() with mtx_lock()
Timothy Arceri [Sun, 5 Mar 2017 01:12:30 +0000 (12:12 +1100)]
gallium/util: replace pipe_mutex_lock() with mtx_lock()

replace pipe_mutex_lock() was made unnecessary with fd33a6bcd7f12.

Replaced using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_lock(\([^)]*\)):mtx_lock(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_mutex_destroy() with mtx_destroy()
Timothy Arceri [Sun, 5 Mar 2017 01:32:04 +0000 (12:32 +1100)]
gallium/util: replace pipe_mutex_destroy() with mtx_destroy()

pipe_mutex_destroy() was made unnecessary with fd33a6bcd7f12.

Replace was done with:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_mutex_init() with mtx_init()
Timothy Arceri [Sun, 5 Mar 2017 01:00:15 +0000 (12:00 +1100)]
gallium/util: replace pipe_mutex_init() with mtx_init()

pipe_mutex_init() was made unnecessary with fd33a6bcd7f12.

Replace was done using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_init(\([^)]*\)):(void) mtx_init(\&\1, mtx_plain):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: remove pipe_static_mutex()
Timothy Arceri [Sun, 5 Mar 2017 01:32:02 +0000 (12:32 +1100)]
gallium/util: remove pipe_static_mutex()

This was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_mutex with mtx_t
Timothy Arceri [Sun, 5 Mar 2017 01:32:01 +0000 (12:32 +1100)]
gallium/util: replace pipe_mutex with mtx_t

pipe_mutex was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()
Timothy Arceri [Sat, 4 Mar 2017 23:41:33 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()

pipe_condvar_broadcast() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar_signal() with cnd_signal()
Timothy Arceri [Sat, 4 Mar 2017 23:41:32 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar_signal() with cnd_signal()

pipe_condvar_signal() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar_wait() with cnd_wait()
Timothy Arceri [Sat, 4 Mar 2017 23:41:31 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar_wait() with cnd_wait()

pipe_condvar_wait() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar_destroy() with cnd_destroy()
Timothy Arceri [Sat, 4 Mar 2017 23:41:30 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar_destroy() with cnd_destroy()

pipe_condvar_destroy() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/util: replace pipe_condvar_init() with cnd_init()
Timothy Arceri [Sat, 4 Mar 2017 23:41:29 +0000 (10:41 +1100)]
gallium/util: replace pipe_condvar_init() with cnd_init()

pipe_condvar_init() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agost/dri: reduce dri_fill_st_options() params
Marek Olšák [Mon, 6 Mar 2017 04:03:17 +0000 (15:03 +1100)]
st/dri: reduce dri_fill_st_options() params

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
4 years agost/dri: use local pointer to st_context_iface
Marek Olšák [Mon, 6 Mar 2017 04:03:16 +0000 (15:03 +1100)]
st/dri: use local pointer to st_context_iface

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
4 years agoglapi: fix typo in count_scale
Gregory Hainaut [Mon, 6 Mar 2017 04:25:32 +0000 (15:25 +1100)]
glapi: fix typo in count_scale

 2*4=8

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
4 years agoi965: Return NULL from initScreen2, not false.
Kenneth Graunke [Thu, 2 Mar 2017 00:02:58 +0000 (16:02 -0800)]
i965: Return NULL from initScreen2, not false.

This returns a pointer, not a boolean.  No actual effect, but cleaner.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoi965: Make a devinfo local variable.
Kenneth Graunke [Wed, 1 Mar 2017 23:52:55 +0000 (15:52 -0800)]
i965: Make a devinfo local variable.

screen->devinfo.gen is annoying to type and linewrap.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoi965: Delete vestiges of resource streamer code.
Kenneth Graunke [Wed, 1 Mar 2017 23:36:54 +0000 (15:36 -0800)]
i965: Delete vestiges of resource streamer code.

We never actually used the resource streamer in any shipping build
of Mesa.  We have no plans to do so in the future.  We looked into
using it in Vulkan, and concluded that it was unusable.  We're not
the only ones to arrive at the conclusion that it's not worth using.

So, drop the last vestiges of resource streamer support and move on.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoi965: Drop duplicate #defines now that we've bumped libdrm requirements.
Kenneth Graunke [Wed, 1 Mar 2017 23:29:09 +0000 (15:29 -0800)]
i965: Drop duplicate #defines now that we've bumped libdrm requirements.

We've updated our libdrm requirement, and it will already provide these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agogetteximage: fix _mesa_GetTextureSubImage()
Samuel Pitoiset [Mon, 6 Mar 2017 20:33:28 +0000 (21:33 +0100)]
getteximage: fix _mesa_GetTextureSubImage()

Oops.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100088
Fixes: 5ae54c0cf7 ("getteximage: avoid to lookup textures with id 0")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoralloc: don't leave out the alignment factor
Grazvydas Ignotas [Sat, 4 Mar 2017 00:49:18 +0000 (02:49 +0200)]
ralloc: don't leave out the alignment factor

Experimentation shows that without alignment factor gcc and clang choose
a factor of 16 even on IA-32, which doesn't match what malloc() uses (8).
The problem is it makes gcc assume the pointer is 16 byte aligned, so
with -O3 it starts using aligned SSE instructions that later fault,
so always specify a suitable alignment factor.

Cc: Jonas Pfeil <pfeiljonas@gmx.de>
Fixes: cd2b55e5 "ralloc: Make sure ralloc() allocations match malloc()'s alignment."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100049
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested by: Mike Lothian <mike@fireburn.co.uk>
Tested by: Jonas Pfeil <pfeiljonas@gmx.de>

4 years agoi965: don't require 64bit cmpxchg
Grazvydas Ignotas [Sun, 5 Mar 2017 21:23:25 +0000 (23:23 +0200)]
i965: don't require 64bit cmpxchg

There are still some distributions trying to support unfortunate people
with old or exotic CPUs that don't have 64bit atomic operations. The
only thing preventing compile of the Intel driver for them seems to be
initialization of a debug variable.

v2: use call_once() instead of unsafe code, as suggested by Matt Turner

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93089
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
4 years agoradv: Emit pending flushes before executing a secondary command buffer
Alex Smith [Mon, 6 Mar 2017 14:54:28 +0000 (14:54 +0000)]
radv: Emit pending flushes before executing a secondary command buffer

If we have any pending flushes on the primary command buffer, these
must be performed before executing the secondary buffer.

This fixes potential corruption when the contents of a subpass which
clears any of its render targets are given in a secondary buffer: the
flushes after a fast clear would not have been performed until the
vkCmdEndRenderPass call.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
4 years agomesa/main: remove useless check in _mesa_IsSampler()
Samuel Pitoiset [Wed, 1 Mar 2017 21:53:52 +0000 (22:53 +0100)]
mesa/main: remove useless check in _mesa_IsSampler()

_mesa_lookup_samplerobj() returns NULL if sampler is 0.

v2: use _mesa_lookup...(...) != NULL

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogetteximage: avoid to lookup textures with id 0
Samuel Pitoiset [Wed, 1 Mar 2017 21:54:09 +0000 (22:54 +0100)]
getteximage: avoid to lookup textures with id 0

This fixes the following assertion when the key is 0.

main/hash.c:181: _mesa_HashLookup_unlocked: Assertion `key' failed.

Fixes: 633c959fae ("getteximage: Return correct error value when texure object is not found")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agodocs/relnotes/17.1.0: document the new LLVM requirement
Marek Olšák [Mon, 6 Mar 2017 16:34:41 +0000 (17:34 +0100)]
docs/relnotes/17.1.0: document the new LLVM requirement

4 years agogallium/radeon: don't monitor SDMA busyness on EG/Cayman/SI
Marek Olšák [Tue, 28 Feb 2017 20:27:59 +0000 (21:27 +0100)]
gallium/radeon: don't monitor SDMA busyness on EG/Cayman/SI

It's always busy.

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

Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradeonsi: drop support for LLVM 3.6 & 3.7
Marek Olšák [Sat, 4 Mar 2017 23:15:31 +0000 (00:15 +0100)]
radeonsi: drop support for LLVM 3.6 & 3.7

They are too old.

Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradeonsi: set the convergent attribute where needed
Marek Olšák [Sun, 26 Feb 2017 18:00:44 +0000 (19:00 +0100)]
radeonsi: set the convergent attribute where needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agogallivm,ac: add LP_FUNC_ATTR_CONVERGENT
Marek Olšák [Sun, 22 Jan 2017 01:36:48 +0000 (02:36 +0100)]
gallivm,ac: add LP_FUNC_ATTR_CONVERGENT

Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradeonsi: fix LLVM 3.9 - don't use non-matching attributes on declarations
Marek Olšák [Sun, 5 Mar 2017 22:19:57 +0000 (23:19 +0100)]
radeonsi: fix LLVM 3.9 - don't use non-matching attributes on declarations

Call site attributes are used since LLVM 4.0.

This also reverts commit b19caecbd6f310c1663b0cfe483d113ae3bd5fe2
"radeon/ac: fix intrinsic version check", because this is the correct fix.

Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agost/omx: Set end-of-frame flag on bitstream output buffers
Mark Thompson [Sun, 5 Mar 2017 23:18:11 +0000 (23:18 +0000)]
st/omx: Set end-of-frame flag on bitstream output buffers

Since all output buffers are whole frames, this should always be set.

Technically, setting this flag is is optional (see OpenMAX IL section
3.1.2.7.1), but some clients assume that it will be used and
therefore buffer indefinitely thinking that all output buffers are
fragments of the first frame when it is not set.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agost/omx: Fix port format enumeration
Mark Thompson [Sun, 5 Mar 2017 22:10:14 +0000 (22:10 +0000)]
st/omx: Fix port format enumeration

From OpenMAX IL section 4.3.5:
"The value of nIndex is the range 0 to N-1, where N is the number of
formats supported by the port.  There is no need for the port to
report N, as the caller can determine N by enumerating all the
formats supported by the port.  Each port shall support at least one
format.  If there are no more formats, OMX_GetParameter returns
OMX_ErrorNoMore (i.e., nIndex is supplied where the value is N or
greater)."

Only one format is supported, so N = 1 and OMX_ErrorNoMore should be
returned if nIndex >= 1.  The previous code here would return the
same format for all values of nIndex, resulting in an infinite loop
when a client attempts to enumerate all formats.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agost/va: Fix forward/backward referencing for deinterlacing
Mark Thompson [Wed, 1 Mar 2017 20:07:09 +0000 (20:07 +0000)]
st/va: Fix forward/backward referencing for deinterlacing

The VAAPI documentation is not very clear here, but the intent
appears to be that a forward reference is forward from a frame in the
past, not forward to a frame in the future (that is, forward as in
forward prediction, not as in a forward reference in source code).
This interpretation is derived from other implementations, in
particular the i965 driver and the gstreamer client.

In order to match those other implementations, this patch swaps the
meaning of forward and backward references as they currently appear
for motion-adaptive deinterlacing.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agost/va: Support fractional framerate in misc parameter
Mark Thompson [Fri, 27 Jan 2017 22:03:10 +0000 (22:03 +0000)]
st/va: Support fractional framerate in misc parameter

Signed-off-by: Mark Thompson <sw@jkqxz.net>
Acked-by: Christian König <christian.koenig@amd.com>
4 years agost/va encode handle ntsc framerate rate control
Andy Furniss [Sun, 29 Jan 2017 14:22:31 +0000 (14:22 +0000)]
st/va encode handle ntsc framerate rate control

Tested with ffmpeg and gst-vaapi. Without this bits per
frame is set way too low for fractional framerates.

v2: Mark Thompson: simplify calculation.
    Use float.

Signed-off-by: Andy Furniss <adf.lists@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
4 years agoradv: Use the new L2 writeback flag.
Bas Nieuwenhuizen [Mon, 6 Mar 2017 00:34:42 +0000 (01:34 +0100)]
radv: Use the new L2 writeback flag.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: Add L2 writeback.
Bas Nieuwenhuizen [Mon, 6 Mar 2017 00:28:53 +0000 (01:28 +0100)]
radv: Add L2 writeback.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoutil/disk_cache: fix make check
Timothy Arceri [Mon, 6 Mar 2017 02:25:59 +0000 (13:25 +1100)]
util/disk_cache: fix make check

Fixes make check after 11f0efec2e615f5233d which caused disk cache
to create an additional directory.

4 years agoradv/ac: use bitfield extract new intrinsics.
Dave Airlie [Sun, 5 Mar 2017 22:32:24 +0000 (08:32 +1000)]
radv/ac: use bitfield extract new intrinsics.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: move to new kill build.
Dave Airlie [Sun, 5 Mar 2017 22:29:07 +0000 (08:29 +1000)]
radv/ac: move to new kill build.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: move to using new export intrinsics.
Dave Airlie [Sun, 5 Mar 2017 22:23:53 +0000 (08:23 +1000)]
radv/ac: move to using new export intrinsics.

This uses the new code in build to do exports.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/ac: switch to new intrinsics for pkrtz and clamp.
Dave Airlie [Sun, 5 Mar 2017 22:06:04 +0000 (08:06 +1000)]
radv/ac: switch to new intrinsics for pkrtz and clamp.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>