mesa.git
6 years agoradv: use different builtin shader cache for 32bit
Grazvydas Ignotas [Mon, 20 Aug 2018 21:21:57 +0000 (00:21 +0300)]
radv: use different builtin shader cache for 32bit

Currently if 64bit and 32bit programs are used interchangeably, radv
will keep overwriting the cache. Use separate cache files to avoid
that.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: place pointer length into cache uuid
Grazvydas Ignotas [Mon, 20 Aug 2018 21:08:54 +0000 (00:08 +0300)]
radv: place pointer length into cache uuid

Thanks to reproducible builds, binary file timestamps may be identical
for both 32bit and 64bit packages when built from the same source.
This means radv will use the same cache for both 32 and 64 bit
processes, which leads to crashes.

Conveniently there is a spare byte in cache_uuid, let's place the
pointer size there.

Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107601
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105904
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agollvmpipe: add cc clobber to inline asm
Grazvydas Ignotas [Wed, 25 Jul 2018 17:27:48 +0000 (20:27 +0300)]
llvmpipe: add cc clobber to inline asm

The bsr instruction modifies flags, so that needs to be indicated to the
compiler. No effect on generated code, but still needed for correctness.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agointel/isl: Avoid tiling some 16K-wide render targets
Nanley Chery [Fri, 27 Jul 2018 22:34:05 +0000 (15:34 -0700)]
intel/isl: Avoid tiling some 16K-wide render targets

Fix rendering issues on BDW and SKL.

Fixes: 0288fe8d0417730bdd5b3477130dd1dc32bdbcd3
("i965/miptree: Use the correct BLT pitch")

Fixes the following regressions seen

exclusively on SKL:
* KHR-GL46.texture_barrier_ARB.disjoint-texels
* KHR-GL46.texture_barrier_ARB.overlapping-texels
* KHR-GL46.texture_barrier.disjoint-texels
* KHR-GL46.texture_barrier.overlapping-texels

and both on BDW and SKL:
* GTF-GL46.gtf21.GL2FixedTests.buffer_corners.buffer_corners
* GTF-GL46.gtf21.GL2FixedTests.stencil_plane_corners.stencil_plane_corners

v2: Note the fixed tests (Andres).
    Don't cause failures with multisampled buffers (Andres).
    Don't hamper SKL GT4 (Ken).
v3: Fix the Fixes tag (Dylan).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107359
Cc: <mesa-stable@lists.freedesktop.org>
Tested-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Fix can_blit_slice()
Nanley Chery [Mon, 23 Jul 2018 17:09:20 +0000 (10:09 -0700)]
i965/miptree: Fix can_blit_slice()

Check the destination's row pitch against the BLT engine's row pitch
limitation as well.

Fixes: 0288fe8d0417730bdd5b3477130dd1dc32bdbcd3
("i965/miptree: Use the correct BLT pitch")

v2: Fix the Fixes tag (Dylan).
    Check the destination row pitch (Chris).

Reported-by: Dylan Baker <dylan@pnwbakers.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Use miptree_map in map_blit functions
Nanley Chery [Fri, 17 Aug 2018 22:03:14 +0000 (15:03 -0700)]
i965/miptree: Use miptree_map in map_blit functions

This struct contains all the data of interest. can_blit_slice() will use
it in the next patch to calculate the correct pitch.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agointel/tools/aubwrite: Always use physical addresses for traces.
Rafael Antognolli [Tue, 21 Aug 2018 16:49:03 +0000 (09:49 -0700)]
intel/tools/aubwrite: Always use physical addresses for traces.

It looks like we can't rely on the simulator to always translate virtual
addresses to physical ones correctly. So let's use physical everywhere.

Since our current GGTT maps virtual to physical addresses in a 1:1 way,
no further changes are required.

Additionally, we have other address spaces not in use right now. So
let's make it easier to switch which one we are using but putting the
default one into the aub_file struct.

Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel/tools/aubwrite: Rename "legacy" to "Trace Block".
Rafael Antognolli [Tue, 21 Aug 2018 16:47:17 +0000 (09:47 -0700)]
intel/tools/aubwrite: Rename "legacy" to "Trace Block".

Hopefully it's a little more descriptive, and more accurate.

Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agonir/vars_to_ssa: Don't build deref nodes for non-local variables
Jason Ekstrand [Mon, 9 Jul 2018 04:55:40 +0000 (21:55 -0700)]
nir/vars_to_ssa: Don't build deref nodes for non-local variables

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
6 years agoac: fix WAITCNT flags for GFX9
Marek Olšák [Thu, 16 Aug 2018 01:43:32 +0000 (21:43 -0400)]
ac: fix WAITCNT flags for GFX9

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoamd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in Addr::V1::EgBasedLib::HwlGetSi...
Kai Wasserbäch [Sat, 18 Aug 2018 10:01:14 +0000 (12:01 +0200)]
amd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled

Only used, when asserts are enabled.

Fixes an unused-but-set-variable warning with GCC 8:
 ../../../src/amd/addrlib/r800/egbaddrlib.cpp: In member function 'virtual long long unsigned int Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled(unsigned int, unsigned int, ADDR_SURFACE_FLAGS, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned int*) const':
 ../../../src/amd/addrlib/r800/egbaddrlib.cpp:4111:13: warning: variable 'physicalSliceSize' set but not used [-Wunused-but-set-variable]
      UINT_64 physicalSliceSize;
              ^~~~~~~~~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoamd/addrlib: mark numPipes as MAYBE_UNUSED in Addr::V1::EgBasedLib::SanityCheckMacroT...
Kai Wasserbäch [Tue, 21 Aug 2018 15:25:46 +0000 (17:25 +0200)]
amd/addrlib: mark numPipes as MAYBE_UNUSED in Addr::V1::EgBasedLib::SanityCheckMacroTiled (v2)

Only used, when asserts are enabled.

Fixes an unused-variable warning with GCC 8:
 ../../../src/amd/addrlib/r800/egbaddrlib.cpp: In member function 'int Addr::V1::EgBasedLib::SanityCheckMacroTiled(ADDR_TILEINFO*) const':
 ../../../src/amd/addrlib/r800/egbaddrlib.cpp:982:13: warning: unused variable 'numPipes' [-Wunused-variable]
      UINT_32 numPipes    = HwlGetPipes(pTileInfo);
              ^~~~~~~~

v2: Don't realign other variable definitions, to keep in line with file
    style (Marek)

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoamd/addrlib: mark *pEqToCheck as MAYBE_UNUSED in Addr::V2::Gfx9Lib::ComputeStereoInfo...
Kai Wasserbäch [Tue, 21 Aug 2018 15:25:45 +0000 (17:25 +0200)]
amd/addrlib: mark *pEqToCheck as MAYBE_UNUSED in Addr::V2::Gfx9Lib::ComputeStereoInfo (v2)

Only used, when asserts are enabled.

Fixes an unused-variable warning with GCC 8:
 ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp: In member function 'ADDR_E_RETURNCODE Addr::V2::Gfx9Lib::ComputeStereoInfo(const ADDR2_COMPUTE_SURFACE_INFO_INPUT*, ADDR2_COMPUTE_SURFACE_INFO_OUTPUT*, unsigned int*) const':
 ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp:3879:34: warning: unused variable 'pEqToCheck' [-Wunused-variable]
              const ADDR_EQUATION *pEqToCheck        = &m_equationTable[eqIndex];
                                   ^~~~~~~~~~

v2: Don't realign other variable definitions, to keep in line with file
    style (Marek)

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoamd/addrlib: mark microBlockDim as MAYBE_UNUSED in Addr::V2::Gfx9Lib::HwlComputeBlock...
Kai Wasserbäch [Sat, 18 Aug 2018 09:45:30 +0000 (11:45 +0200)]
amd/addrlib: mark microBlockDim as MAYBE_UNUSED in Addr::V2::Gfx9Lib::HwlComputeBlock256Equation

Only used, when asserts are enabled.

Fixes an unused-but-set-variable warning with GCC 8:
 ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp: In member function 'virtual ADDR_E_RETURNCODE Addr::V2::Gfx9Lib::HwlComputeBlock256Equation(AddrResourceType, AddrSwizzleMode, unsigned int, ADDR_EQUATION*) const':
 ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp:2473:15: warning: variable 'microBlockDim' set but not used [-Wunused-but-set-variable]
          Dim2d microBlockDim = Block256_2d[elementBytesLog2];
                ^~~~~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoamd/addrlib: mark returnCode as MAYBE_UNUSED in ElemGetExportNorm
Kai Wasserbäch [Fri, 17 Aug 2018 10:14:22 +0000 (12:14 +0200)]
amd/addrlib: mark returnCode as MAYBE_UNUSED in ElemGetExportNorm

Only used, when asserts are enabled.

Fixes an unused-but-set-variable warning with GCC 8:
 ../../../src/amd/addrlib/addrinterface.cpp: In function 'int ElemGetExportNorm(ADDR_HANDLE, const ELEM_GETEXPORTNORM_INPUT*)':
 ../../../src/amd/addrlib/addrinterface.cpp:835:23: warning: variable 'returnCode' set but not used [-Wunused-but-set-variable]
      ADDR_E_RETURNCODE returnCode = ADDR_OK;
                        ^~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agointel: aubinator_viewer: add urb view
Lionel Landwerlin [Fri, 3 Aug 2018 09:41:01 +0000 (10:41 +0100)]
intel: aubinator_viewer: add urb view

This is available through a "Show URB" button on the 3DPRIMITIVE
instructions.

v2: Fix urb allocation end value in tooltip (Rafael)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: aubinator_viewer: store urb state during decoding
Lionel Landwerlin [Fri, 3 Aug 2018 09:40:43 +0000 (10:40 +0100)]
intel: aubinator_viewer: store urb state during decoding

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: add aubinator viewer
Lionel Landwerlin [Sat, 28 Jul 2018 18:13:28 +0000 (19:13 +0100)]
intel: tools: add aubinator viewer

A graphical user interface version of aubinator.
Allows you to :

   - simultaneously look at multiple points in the aub file (using all
     the goodness of the existing decoding in aubinator)

   - edit an aub file

v2: Switch from GLFW to GTK+3

v3: Fix warning when exiting

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rafael Antognolli <rafael.antognolli@intel.com> (v1)
6 years agointel: tools: import ImGui
Lionel Landwerlin [Sun, 29 Jul 2018 18:32:45 +0000 (19:32 +0100)]
intel: tools: import ImGui

We want to add a new UI tool to decode aub files. This will use the
Dear ImGui library to render its interface. The build of this UI
toolkit is conditional to -Dwith_tools=intel-ui which superseeds
-Dwith_tools=intel.

The main way to use ImGui is to embed its source code at a particular
revision. Most embedding projects have to do a bit of integration
which is really specific to one's project. In our case the only
modification is to include libepoxy. We also choose to use Gtk+3 for
the window system integration. As oppose to the previous previous
version of this patch using GLFW, Gtk+ is able to handle X11/Wayland
session as well as property DPI scaling on retina monitors.

The import was done at this commit (https://github.com/ocornut/imgui) :

commit 6211f40f3d903dd9df961256e044029c49793aa3
Author: omar <omarcornut@gmail.com>
Date:   Fri Jul 27 12:29:33 2018 +0200

    Internals: Drag and Drop: default drop preview use a narrower clipping rectangle (no effect here, but other branches uses a narrow clipping rectangle that was too small so this is a fix for it) + Comments

v2: Switch from GLFW to GTK+ (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: aub_mem: reuse already mapped ppgtt buffers
Lionel Landwerlin [Mon, 6 Aug 2018 11:06:13 +0000 (12:06 +0100)]
intel: tools: aub_mem: reuse already mapped ppgtt buffers

When we map a PPGTT buffer into a continous address space of aubinator
to be able to inspect it, we currently add it to the list of BOs to
unmap once we're finished. An optimization we can apply it to look up
that list before trying to remap PPGTT buffers again (we already do
this for GGTT buffers).

We need to take some care before doing this because the list also
contains GGTT BOs. As GGTT & PPGTT are 2 different address spaces, we
can have matching addresses in both that point to different physical
locations.

This changes adds a flag on the elements of the list of mapped BOs to
differenciate between GGTT & PPGTT, which allows use to reuse that
list when looking up both address spaces.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: aubmem: map gtt data to aub file
Lionel Landwerlin [Thu, 2 Aug 2018 09:15:41 +0000 (10:15 +0100)]
intel: tools: aubmem: map gtt data to aub file

This will allow the aubinator viewer tool to modify the aub data that
was loaded at a particular gtt address.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: create libaub
Lionel Landwerlin [Sun, 5 Aug 2018 09:22:37 +0000 (10:22 +0100)]
intel: tools: create libaub

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel: tools: aubwrite: wrap function declarations for c++
Lionel Landwerlin [Sun, 29 Jul 2018 18:32:13 +0000 (19:32 +0100)]
intel: tools: aubwrite: wrap function declarations for c++

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: split memory management out of aubinator
Lionel Landwerlin [Sun, 29 Jul 2018 00:01:36 +0000 (01:01 +0100)]
intel: tools: split memory management out of aubinator

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agoutil: rb_tree: add safe iterators
Lionel Landwerlin [Sun, 29 Jul 2018 13:13:25 +0000 (14:13 +0100)]
util: rb_tree: add safe iterators

v2: Add helper to make iterators more readable (Rafael)
    Fix rev iterator bug (Rafael)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
6 years agointel: tools: split aub parsing from aubinator
Lionel Landwerlin [Sat, 28 Jul 2018 18:13:04 +0000 (19:13 +0100)]
intel: tools: split aub parsing from aubinator

v2: add parsing error callback (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com> (v1)
6 years agomeson: Run the test with Python 3
Mathieu Bridon [Fri, 17 Aug 2018 19:32:18 +0000 (21:32 +0200)]
meson: Run the test with Python 3

This is a patch from me and a patch from Mathieu Bridon squashed
together.

Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Mathieu Bridon <bochecha@daitauha.fr>
6 years agopython: Disable universal newlines
Mathieu Bridon [Fri, 17 Aug 2018 19:32:17 +0000 (21:32 +0200)]
python: Disable universal newlines

We are testing the behaviour of a tool, for different input files, each
one using a different newline sequence. ('\n' on UNIX, '\r\n' on
Windows, …)

Unfortunately, when opening a file in text mode, Python 3 will by
default enable the "universal newlines" mode, which means it replaces
all the known newline sequences by '\n'.

This (usually useful) behaviour breaks the tests, which are specifically
trying to handle files with newline sequences different from '\n'.

Disabling the universal newlines mode fixes the tests.

However, to keep the script compatible with both Python 2 and 3, we must
use the io.open() function instead of the open() builtin, as the latter
only knows about the `newline` argument on Python 3.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agopython: difflib prefers unicode strings
Mathieu Bridon [Fri, 17 Aug 2018 19:32:16 +0000 (21:32 +0200)]
python: difflib prefers unicode strings

Python 3 does not automatically convert from bytes to unicode strings
like Python 2 used to do.

This commit makes sure we pass unicode strings to difflib.unified_diff,
so that the script works on both Python 2 and 3.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agocompiler/glsl/tests: Make tests python3 safe
Dylan Baker [Thu, 16 Aug 2018 21:17:24 +0000 (14:17 -0700)]
compiler/glsl/tests: Make tests python3 safe

v2: - explicitly decode the output of subprocesses
    - handle bytes and string types consistently rather than relying on
      python 2's coercion for bytes and ignoring them in python 3
v3: - explicitly set encode as well as decode
    - python 2.7 and 3.x `bytes` instead of defining an alias

Reviewed-by: Mathieu Bridon <bochecha@daitauha.fr>
6 years agotravis: SWR requires LLVM 6.0
Juan A. Suarez Romero [Tue, 21 Aug 2018 10:34:48 +0000 (12:34 +0200)]
travis: SWR requires LLVM 6.0

v2: update clarification why ubuntu-toolchain-r-test is required (Emil)

Fixes: 0cef0cccf51 ("swr: bump minimum supported LLVM version to 6.0")
Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoac/nir: fix getting GLSL type of array of samplers for TG4
Samuel Pitoiset [Wed, 22 Aug 2018 12:42:51 +0000 (14:42 +0200)]
ac/nir: fix getting GLSL type of array of samplers for TG4

This fixes a crash in build_tex_intrinsic() when trying to
launch the Basemark GPU benchmark on GFX8. It looks like
there is still something wrong because some frames are black.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106980
CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: remove dead variables after splitting per member structs
Samuel Pitoiset [Wed, 22 Aug 2018 10:34:13 +0000 (12:34 +0200)]
radv: remove dead variables after splitting per member structs

Otherwise, nir_lower_clip_cull_distance_arrays might report
wrong number of output clips/culls because it relies on
shader output variables and some of them might be dead.

This fixes a rendering issue with Dolphin and Super Mario
Sunshine.

Fixes: b0c643d8f5 ("spirv: Use NIR per-member splitting")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107610
CC: 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoanv: add VK_EXT_sampler_filter_minmax support
Yunchao He [Mon, 20 Aug 2018 16:29:49 +0000 (10:29 -0600)]
anv: add VK_EXT_sampler_filter_minmax support

This extension can be supported on SKL+. With this patch,
all corresponding tests (6K+) in CTS can pass. No test fails.

I verified CTS with the command below:
deqp-vk --deqp-case=dEQP-VK.pipeline.sampler.view_type.*reduce*

v2: 1) support all depth formats, not depth-only formats, 2) fix
a wrong indention (Jason).

v3: fix a few nits (Lionel).

v4: fix failures in CI: disable sampler reduction when sampler
reduction mode is not specified via this extension (Lionel).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoradv: use ac_build_imad()
Samuel Pitoiset [Tue, 21 Aug 2018 07:49:02 +0000 (09:49 +0200)]
radv: use ac_build_imad()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac,radeonsi: use ac_build_gather_values more
Marek Olšák [Thu, 16 Aug 2018 01:06:54 +0000 (21:06 -0400)]
ac,radeonsi: use ac_build_gather_values more

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac,radeonsi: use ac_build_fmad
Marek Olšák [Thu, 16 Aug 2018 00:50:03 +0000 (20:50 -0400)]
ac,radeonsi: use ac_build_fmad

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradeonsi: use ac_build_imad
Marek Olšák [Thu, 16 Aug 2018 00:43:12 +0000 (20:43 -0400)]
radeonsi: use ac_build_imad

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: add imad & fmad helpers
Marek Olšák [Tue, 14 Aug 2018 05:49:49 +0000 (01:49 -0400)]
ac: add imad & fmad helpers

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: add ac_build_s_barrier
Marek Olšák [Tue, 14 Aug 2018 03:59:28 +0000 (23:59 -0400)]
ac: add ac_build_s_barrier

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradeonsi: print the shader stage name when printing LLVM IR
Marek Olšák [Mon, 13 Aug 2018 19:55:00 +0000 (15:55 -0400)]
radeonsi: print the shader stage name when printing LLVM IR

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradeonsi: use is_merged shader in si_prolog_get_rw_buffers
Marek Olšák [Mon, 13 Aug 2018 17:15:39 +0000 (13:15 -0400)]
radeonsi: use is_merged shader in si_prolog_get_rw_buffers

needed to change the input type to si_shader_context

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: completely remove +auto-waitcnt-before-barrier
Marek Olšák [Thu, 16 Aug 2018 01:14:47 +0000 (21:14 -0400)]
ac: completely remove +auto-waitcnt-before-barrier

it causes corruption on several different GPU generations.

Cc: 18.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoanv/icl: Allow headerless sampler messages for pre-emptable contexts
Anuj Phogat [Fri, 17 Aug 2018 23:42:23 +0000 (16:42 -0700)]
anv/icl: Allow headerless sampler messages for pre-emptable contexts

It fixes simulator warnings in vulkancts tests complaining about missing
support for headerless sampler messages for pre-emptable contexts.
Bit 5 in SAMPLER MODE register is newly introduced for ICLLP.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoanv/icl: Disable binding table prefetching
Anuj Phogat [Thu, 9 Aug 2018 16:52:39 +0000 (09:52 -0700)]
anv/icl: Disable binding table prefetching

Gen 11 workarounds table #2056 WABTPPrefetchDisable suggests to
disable prefetching of binding tables for ICLLP A0 and B0
steppings. We have a similar patch for i965 driver in  Mesa
commit a5889d70.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/icl: Allow headerless sampler messages for pre-emptable contexts
Anuj Phogat [Fri, 17 Aug 2018 23:36:17 +0000 (16:36 -0700)]
i965/icl: Allow headerless sampler messages for pre-emptable contexts

It fixes simulator warnings in piglit tests complaining about missing
support for headerless sampler messages for pre-emptable contexts.
Bit 5 in SAMPLER MODE register is newly introduced for ICLLP.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agor600/eg: rework atomic counter emission with flushes
Dave Airlie [Tue, 7 Aug 2018 00:41:20 +0000 (01:41 +0100)]
r600/eg: rework atomic counter emission with flushes

With the current code, we didn't do the space checks prior
to atomic counter setup emission, but we also didn't add
atomic counters to the space check so we could get a flush
later as well.

These flushes would be bad, and lead to problems with
parallel tests. We have to ensure the atomic counter copy in,
draw emits and counter copy out are kept in the same command
submission unit.

This reworks the code to drop some useless masks, make the
counting separate to the emits, and make the space checker
handle atomic counter space.

[airlied: want this in 18.2]

Fixes: 06993e4ee (r600: add support for hw atomic counters. (v3))
6 years agovirgl: ARB_enhanced_layouts support
Dave Airlie [Thu, 14 Jun 2018 04:51:04 +0000 (14:51 +1000)]
virgl: ARB_enhanced_layouts support

We need to handle the gaps in the streamout bindings on the guest
side and enable if it the host has the rest enabled.

Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
6 years agoi965: Implement EGL_KHR_mutable_render_buffer
Chad Versace [Wed, 11 Apr 2018 06:22:03 +0000 (23:22 -0700)]
i965: Implement EGL_KHR_mutable_render_buffer

Testing:
  - Manually tested a low-latency handwriting demo that toggles
    EGL_RENDER_BUFFER. Toggling changed the display latency as expected.
    Used Android on Chrome OS, Kabylake GT2.
  - No change in dEQP-EGL.functional.* on Fedora 27, Wayland, Skylake
    GT2.  Used deqp at tag android-p-preview-5.
  - No regressions in dEQP-EGL.functional.*, ran on Android on Chrome
    OS, Kabylake GT2. Some dEQP-EGL.functional.mutable_render_buffer.*
    test change from NotSupported to Pass.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoegl/android: Implement EGL_KHR_mutable_render_buffer
Chad Versace [Tue, 1 May 2018 05:35:17 +0000 (22:35 -0700)]
egl/android: Implement EGL_KHR_mutable_render_buffer

Specifically, implement the extension DRI_MutableRenderBufferLoader.
However, the loader enables EGL_KHR_mutable_render_buffer only if the
DRI driver implements its half of the extension,
DRI_MutableRenderBufferDriver.

Testing:
  - No change in dEQP-EGL.functional.* on Fedora 27, Wayland, Skylake
    GT2.  Used deqp at tag android-p-preview-5.
  - No change in dEQP-EGL.functional.*, ran on Android on Chrome OS,
    Kabylake GT2.
  - Manually inspected Android apps on same Chrome OS device.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoutil/xmlpool: make indentation coherent
Eric Engestrom [Thu, 16 Aug 2018 15:03:06 +0000 (16:03 +0100)]
util/xmlpool: make indentation coherent

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agoegl: add helper to combine two u32 into one u64
Eric Engestrom [Thu, 16 Aug 2018 14:22:46 +0000 (15:22 +0100)]
egl: add helper to combine two u32 into one u64

Use a helper to avoid the common issues of upcasting after the right shift
(losing the upper bits) and shifting signed values (sign gets shifted too).

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agodocs: trivial s/>/&gt;/ html fix
Eric Engestrom [Tue, 17 Jul 2018 11:46:17 +0000 (12:46 +0100)]
docs: trivial s/>/&gt;/ html fix

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoautotools: don't ship the git_sha1.h generated in git in the tarballs
Eric Engestrom [Tue, 21 Aug 2018 11:57:00 +0000 (12:57 +0100)]
autotools: don't ship the git_sha1.h generated in git in the tarballs

This file is regenerated at build time anyway, so this would just get
overwritten anyway. No reason to ship it in the tarball.

Fixes: 44df06211cf2c301f6ef "autotools: include git_sha1.h in dist tarball"
Fixes: 471f708ed6f4787813d0 "git_sha1: simplify logic"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agointel/genxml: minor python style fix
Eric Engestrom [Tue, 21 Aug 2018 14:20:40 +0000 (15:20 +0100)]
intel/genxml: minor python style fix

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoappveyor: Set git core.autocrlf setting to true.
Jose Fonseca [Fri, 17 Aug 2018 15:39:33 +0000 (16:39 +0100)]
appveyor: Set git core.autocrlf setting to true.

The git core.autocrlf setting defaults to true (ie, all text files get
checked out as CRLF on Windows), except on Appveyor where's set to
"input" (ie, all text files get checked out with the upstream
repository's line endings, which for us typically means LF.)

And this was masking on Appveyor a regression in gen_xmlpool.py
processing t_options.h with CRLF line endings.

This change makes core.autocrlf to be true, which would have enabled to
immediately catch the issue, as seen in
https://ci.appveyor.com/project/jrfonseca/mesa/build/51

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agomesa: move legacy hyperz option from dri config
Timothy Arceri [Wed, 15 Aug 2018 06:56:49 +0000 (16:56 +1000)]
mesa: move legacy hyperz option from dri config

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agomesa: remove unused dri config option disable_shader_bit_encoding
Timothy Arceri [Wed, 15 Aug 2018 04:22:29 +0000 (14:22 +1000)]
mesa: remove unused dri config option disable_shader_bit_encoding

This was added as a workaround for Heaven 3.0 but was later removed
by 5ead448719f3 to allow Heaven 4.0 to work correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agomesa: drop legacy no_rast dri option
Timothy Arceri [Wed, 15 Aug 2018 03:56:53 +0000 (13:56 +1000)]
mesa: drop legacy no_rast dri option

Add enviroment var overrides to legacy drivers instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965: remove unused no_rast bool
Timothy Arceri [Wed, 15 Aug 2018 03:29:44 +0000 (13:29 +1000)]
i965: remove unused no_rast bool

Forcing software fallbacks for i965 hasn't been an option since
5e3c093ff866.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi915: remove early_z dri option
Timothy Arceri [Wed, 15 Aug 2018 03:16:58 +0000 (13:16 +1000)]
i915: remove early_z dri option

This driver is in maintenance mode so lets remove this hidden
unsafe option.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoAdd NV_fragment_shader_interlock support.
Kevin Rogovin [Wed, 15 Aug 2018 11:29:28 +0000 (14:29 +0300)]
Add NV_fragment_shader_interlock support.

The main purpose for having NV_fragment_shader_interlock
extension is because that extension is also for GLES31 while
the ARB extension is for GL only.

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
6 years agoautotools: include git_sha1.h in dist tarball
Juan A. Suarez Romero [Mon, 20 Aug 2018 11:38:23 +0000 (13:38 +0200)]
autotools: include git_sha1.h in dist tarball

This fixes `make distcheck`.

Fixes: 471f708ed6 ("git_sha1: simplify logic")
CC: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agoswr: bump minimum supported LLVM version to 6.0
Juan A. Suarez Romero [Mon, 6 Aug 2018 09:30:08 +0000 (11:30 +0200)]
swr: bump minimum supported LLVM version to 6.0

RADV now requires LLVM 6.0 or greater, and thus we can't build dist
tarball because swr requires LLVM 5.0.

Let's bump required LLVM to 6.0 in swr too.

v2: bump also in meson.build (Eric)

Fixes: fd1121e839 ("amd: remove support for LLVM 5.0")
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoi965: Advertise 8 bits subpixel precision for viewport bounds on gen6+
Danylo Piliaiev [Mon, 18 Jun 2018 12:50:57 +0000 (15:50 +0300)]
i965: Advertise 8 bits subpixel precision for viewport bounds on gen6+

We use floating-points for viewport bounds so VIEWPORT_SUBPIXEL_BITS
should reflect this.

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

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agofreedreno: fix context teardown race
Rob Clark [Mon, 20 Aug 2018 13:55:12 +0000 (09:55 -0400)]
freedreno: fix context teardown race

We could still have batches queued up to flush, so fd_context_destroy()
(which will kill and sync on the flush_queue) before deleting buffers
that might be referenced from fdN_gmem() from context of flush_queue.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agointel/decoder: mark total_length as MAYBE_UNUSED in gen_spec_load
Kai Wasserbäch [Sat, 18 Aug 2018 11:16:15 +0000 (13:16 +0200)]
intel/decoder: mark total_length as MAYBE_UNUSED in gen_spec_load

Only used, when asserts are enabled.

Fixes an unused-variable warning with GCC 8:
 ../../../src/intel/common/gen_decoder.c: In function 'gen_spec_load':
 ../../../src/intel/common/gen_decoder.c:535:47: warning: variable 'total_length' set but not used [-Wunused-but-set-variable]
     uint32_t text_offset = 0, text_length = 0, total_length;
                                                ^~~~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel/tools: initialise bo_addr to 0 in main
Kai Wasserbäch [Sat, 18 Aug 2018 11:16:14 +0000 (13:16 +0200)]
intel/tools: initialise bo_addr to 0 in main

Supresses a maybe-uninitialized warning with GCC 8.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel: aubinator: mark ftruncate_res as MAYBE_UNUSED in ensure_phys_mem
Kai Wasserbäch [Sat, 18 Aug 2018 11:16:11 +0000 (13:16 +0200)]
intel: aubinator: mark ftruncate_res as MAYBE_UNUSED in ensure_phys_mem

Only used, when asserts are enabled.

Fixes an unused-variable warning with GCC 8:
 ../../../src/intel/tools/aubinator.c: In function 'ensure_phys_mem':
 ../../../src/intel/tools/aubinator.c:209:11: warning: unused variable 'ftruncate_res' [-Wunused-variable]
        int ftruncate_res = ftruncate(mem_fd, mem_fd_len += 4096);
            ^~~~~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel/aubinator_error_decode: mark ret as MAYBE_UNUSED in main
Kai Wasserbäch [Sat, 18 Aug 2018 11:16:10 +0000 (13:16 +0200)]
intel/aubinator_error_decode: mark ret as MAYBE_UNUSED in main

Only used, when asserts are enabled.

Fixes an unused-but-set-variable warning with GCC 8:
 ../../../src/intel/tools/aubinator_error_decode.c: In function 'main':
 ../../../src/intel/tools/aubinator_error_decode.c:759:11: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
        int ret;
            ^~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoradv: do not use CP predication for DCC decompressions
Samuel Pitoiset [Thu, 16 Aug 2018 16:56:22 +0000 (18:56 +0200)]
radv: do not use CP predication for DCC decompressions

This fixes a regression with some Unity demos. Not sure
what the root cause of the problem is, especially because
the driver doesn't perform any fast color clears. So, it
shouldn't be needed to decompress DCC. RadeonSI says that
the decompression is relatively cheap if the surface has
been decompressed already.

One possible improvement is to two use predicates, one for
DCC and one for FCE that could be cleared when DCC, FMASK
or CMASK are performed by the driver. That might skip some
unnecessary decompression passes (not DCC though).

Fixes: ff7daadca1 ("radv: enable/disable predication for the DCC decompression pass")
CC: 18.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107563
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoegl: implement EXT_surface_SMPTE2086_metadata and EXT_surface_CTA861_3_metadata
Tapani Pälli [Thu, 5 Apr 2018 10:02:36 +0000 (13:02 +0300)]
egl: implement EXT_surface_SMPTE2086_metadata and EXT_surface_CTA861_3_metadata

Patch implements common bits for EXT_surface_SMPTE2086_metadata
and EXT_surface_CTA861_3_metadata extensions by adding new required
attributes and eglQuerySurface + eglSurfaceAttrib changes.

Currently none of the drivers are utilizing this data but this patch
is enabler in getting there.

v2: don't enable extension globally, should be only enabled by
    EGL drivers that can transfer metadata to the window system (Jason)
    use EGLint instead of uint16_t (Eric)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agomesa: move legacy dri config option texture_units
Timothy Arceri [Wed, 15 Aug 2018 09:39:27 +0000 (19:39 +1000)]
mesa: move legacy dri config option texture_units

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomesa: remove unused dri config option texture_heaps
Timothy Arceri [Wed, 15 Aug 2018 07:20:18 +0000 (17:20 +1000)]
mesa: remove unused dri config option texture_heaps

This seems to have only been used by DRI1 drivers which were
removed with e4344161bde2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomesa: move legacy dri config option texture_blend_quality
Timothy Arceri [Wed, 15 Aug 2018 07:19:36 +0000 (17:19 +1000)]
mesa: move legacy dri config option texture_blend_quality

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agoutil: remove unused S3TC translation for dri config
Timothy Arceri [Wed, 15 Aug 2018 05:49:27 +0000 (15:49 +1000)]
util: remove unused S3TC translation for dri config

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomesa: remove dri configs unused software-fallback options
Timothy Arceri [Wed, 15 Aug 2018 04:38:58 +0000 (14:38 +1000)]
mesa: remove dri configs unused software-fallback options

These seems to have only been used by DRI1 drivers which were
removed with e4344161bde2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomesa: remove unused dri config option excess_mipmap
Timothy Arceri [Wed, 15 Aug 2018 04:26:12 +0000 (14:26 +1000)]
mesa: remove unused dri config option excess_mipmap

This seems to have only been used by DRI1 drivers which were
removed with e4344161bde2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomesa: remove unused dri config option performance_boxes
Timothy Arceri [Wed, 15 Aug 2018 04:06:40 +0000 (14:06 +1000)]
mesa: remove unused dri config option performance_boxes

This seems to have only been used by DRI1 drivers which were
removed with e4344161bde2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agodocs: update the default mesa shader cache dir
Timothy Arceri [Sun, 19 Aug 2018 22:08:58 +0000 (08:08 +1000)]
docs: update the default mesa shader cache dir

We renamed the dir in commit 28b326238bcc, this just updates the
website to reflect the change.

6 years agovulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues
Kai Wasserbäch [Fri, 17 Aug 2018 14:32:33 +0000 (16:32 +0200)]
vulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues

Supresses a maybe-uninitialized warning with GCC 8.

Note: image_index should always be initialised due to the result check,
      but the compiler doesn't see that.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agonir: mark *prev_block as MAYBE_UNUSED in opt_peel_loop_initial_if
Kai Wasserbäch [Fri, 17 Aug 2018 14:32:32 +0000 (16:32 +0200)]
nir: mark *prev_block as MAYBE_UNUSED in opt_peel_loop_initial_if

Only used, when asserts are enabled.

Fixes an unused-variable warning with gcc-8:
 ../../../src/compiler/nir/nir_opt_if.c: In function 'opt_peel_loop_initial_if':
 ../../../src/compiler/nir/nir_opt_if.c:109:15: warning: unused variable 'prev_block' [-Wunused-variable]
     nir_block *prev_block =
                ^~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoutil: mark s as MAYBE_UNUSED in _mesa_half_to_unorm8
Kai Wasserbäch [Fri, 17 Aug 2018 14:32:31 +0000 (16:32 +0200)]
util: mark s as MAYBE_UNUSED in _mesa_half_to_unorm8

Only used, when asserts are enabled.

Fixes an unused-variable warning with gcc-8:
 ../../../src/util/half_float.c: In function '_mesa_half_to_unorm8':
 ../../../src/util/half_float.c:189:14: warning: unused variable 's' [-Wunused-variable]
     const int s = (val >> 15) & 0x1;
               ^

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoutil: add drirc workarounds for RAGE
Timothy Arceri [Fri, 17 Aug 2018 23:26:51 +0000 (09:26 +1000)]
util: add drirc workarounds for RAGE

This allows the game to run on wine (tested on radeonsi where we
have compat profile support).

6 years agoutil: better handle program names from wine
Timothy Arceri [Thu, 16 Aug 2018 05:29:06 +0000 (15:29 +1000)]
util: better handle program names from wine

For some reason wine will sometimes give us a windows style path
for an application. For example when running the 64bit version
of Rage wine gives a Unix style path, but when running the 32bit
version is gives a windows style path.

If we detect no '/' in the path at all it should be safe to
assume we have a wine application and instead look for a '\'.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agonir: allow more nested loops to be unrolled
Timothy Arceri [Mon, 23 Jul 2018 08:02:28 +0000 (18:02 +1000)]
nir: allow more nested loops to be unrolled

The innermost check was added to stop us from unrolling multiple
loops in a single pass, and to stop outer loops from unrolling.

When we successfully unroll a loop we need to run the analysis
pass again before deciding if we want to go ahead an unroll a
second loop.

However the logic was flawed because it never tried to unroll any
nested loops other than the first innermost loop it found.
If this innermost loop is not unrolled we end up skipping all
other nested loops.

This unrolls a loop in a Deus Ex: MD shader on ultra settings and
also unrolls a loop in a shader from the game Prey when running
on DXVK.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agogallium/winsys/kms: don't unmap what wasn't mapped
Ray Strode [Thu, 16 Aug 2018 20:37:25 +0000 (16:37 -0400)]
gallium/winsys/kms: don't unmap what wasn't mapped

At the moment, depending on pipe transfer flags, the dumb
buffer map address can end up at either kms_sw_dt->ro_mapped
or kms_sw_dt->mapped.

When it's time to unmap the dumb buffer, both locations get unmapped,
even though one is probably initialized to 0.

That leads to the code segment getting unmapped at runtime and
crashes when trying to call into unrelated code.

This commit addresses the problem by using MAP_FAILED instead of
NULL for ro_mapped and mapped when the dumb buffer is unmapped,
and only unmapping mapped addresses at unmap time.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107098
Signed-off-by: Ray Strode <rstrode@redhat.com>
Fixes: d891f28df9a ("gallium/winsys/kms: Fix possible leak in map/unmap.")
Cc: Lepton Wu <lepton@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoloader: add dri_driver option to override dri driver to load
Qiang Yu [Mon, 6 Aug 2018 03:19:27 +0000 (11:19 +0800)]
loader: add dri_driver option to override dri driver to load

drirc implementation of MESA_LOADER_DRIVER_OVERRIDE which can be
used to override dri driver to load.

Usage:

override dri driver for device with spec kernel driver name:

<device kernel_driver="kernel_driver_name">
  <option name="dri_driver" value="new_dri_driver" />
</device>

or

<device driver="loader" kernel_driver="kernel_driver_name">
  <option name="dri_driver" value="new_dri_driver" />
</device>

v2:
  add kernel_driver device attribute to specify kernel
  driver name instead of reuse driver attribute

v3:
  seperate loader_get_kernel_driver_name into another patch
  seperate add kernel_driver attribute into another patch

Suggested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[v4 Emil: add HAVE_LIBDRM guard around __driConfigOptionsLoader and
loader_get_dri_config_driver]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoxmlconfig: add kernel_driver device attribute
Qiang Yu [Mon, 6 Aug 2018 03:19:26 +0000 (11:19 +0800)]
xmlconfig: add kernel_driver device attribute

This attribute can be used by loader to apply different
option to device use specific kernel driver.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoloader: abstract loader_get_kernel_driver_name for reuse
Qiang Yu [Mon, 6 Aug 2018 03:19:25 +0000 (11:19 +0800)]
loader: abstract loader_get_kernel_driver_name for reuse

This function can be shared by the following kernel_driver
drirc patch.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agodriconf: move ${sysconfdir}/drirc to ${datadir}/drirc.d/00-mesa-defaults.conf
Qiang Yu [Mon, 6 Aug 2018 03:19:24 +0000 (11:19 +0800)]
driconf: move ${sysconfdir}/drirc to ${datadir}/drirc.d/00-mesa-defaults.conf

${sysconfdir} is for store admin config files, so move
this mesa default config file to ${datadir}/drirc.d.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoxmlconfig: read more config files from drirc.d/
Qiang Yu [Mon, 6 Aug 2018 03:41:33 +0000 (11:41 +0800)]
xmlconfig: read more config files from drirc.d/

Driver and application can put their drirc files in
${datadir}/drirc.d/ with name xxx.conf. Config files
will be read and applied in file name alphabetic order.

So there are three places for drirc listed in order:
1. /usr/share/drirc.d/
2. /etc/drirc
3. ~/.drirc

v4:
  fix meson build

v3:
  1. seperate driParseConfigFiles refine into another patch
  2. fix entries[i] mem leak

v2:
  drop /etc/drirc.d

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoxmlconfig: refine driParseConfigFiles to use parseOneConfigFile
Emil Velikov [Mon, 6 Aug 2018 03:19:22 +0000 (11:19 +0800)]
xmlconfig: refine driParseConfigFiles to use parseOneConfigFile

Also prepare for the usage of following parseConfigDir patch.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil: add #include <limits.h>]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoanv/pipeline: Lower pipeline layouts etc. after linking
Jason Ekstrand [Tue, 7 Aug 2018 22:47:54 +0000 (15:47 -0700)]
anv/pipeline: Lower pipeline layouts etc. after linking

This allows us to use the link-optimized shader for determining binding
table layouts and, more importantly, URB layouts.  For apps running on
DXVK, this is extremely important as DXVK likes to declare max-size
inputs and outputs and this lets is massively shrink our URB space
requirements.

VkPipeline-db results (Batman pipelines only) on KBL:

    total instructions in shared programs: 820403 -> 790008 (-3.70%)
    instructions in affected programs: 273759 -> 243364 (-11.10%)
    helped: 622
    HURT: 42

    total spills in shared programs: 8449 -> 5212 (-38.31%)
    spills in affected programs: 3427 -> 190 (-94.46%)
    helped: 607
    HURT: 2

    total fills in shared programs: 11638 -> 6067 (-47.87%)
    fills in affected programs: 5879 -> 308 (-94.76%)
    helped: 606
    HURT: 3

Looking at shaders by hand, it makes the URB between TCS and TES go from
containing 32 per-vertex varyings per tessellation shader pair to a more
reasonable 8-12.  For a 3-vertex patch, that's at least half the URB
space no matter how big the patch section is.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoanv/pipeline: Set tess IO read/written key fields in compile_*
Jason Ekstrand [Tue, 7 Aug 2018 23:21:13 +0000 (16:21 -0700)]
anv/pipeline: Set tess IO read/written key fields in compile_*

We want these to be set as close to the final compile as possible so
that they are guaranteed to happen after nir_shader_gather_info is
called.  The next commit is going to move nir_shader_gather_info to
after the linking step which makes this necessary.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoanv/pipeline: Use more fields from stage in compile_cs
Jason Ekstrand [Wed, 8 Aug 2018 02:53:38 +0000 (19:53 -0700)]
anv/pipeline: Use more fields from stage in compile_cs

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoanv/apply_pipeline_layout: Add to the bind map instead of replacing it
Jason Ekstrand [Tue, 7 Aug 2018 22:29:43 +0000 (15:29 -0700)]
anv/apply_pipeline_layout: Add to the bind map instead of replacing it

This commit makes three changes.  One is to only walk the descriptors once
and set bind map sizes at the same time as filling out the entries.  The
second is to make the pass additive so that we can put stuff in the bind
map before applying the pipeline layout.  Third, we switch to using
designated initializers.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoanv/lower_ycbcr: Use the binding array size for bounds checks
Jason Ekstrand [Tue, 7 Aug 2018 22:11:57 +0000 (15:11 -0700)]
anv/lower_ycbcr: Use the binding array size for bounds checks

Because lower_ycbcr gets called before apply_pipeline_layout, the
indices are all logical and the binding layout HW size is actually too
big for the bounds check.  We should just use the regular logical array
size instead.

Fixes: f3e91e78a33 "anv: add nir lowering pass for ycbcr textures"
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agopython: Open the template as text, with an explicit encoding
Mathieu Bridon [Fri, 17 Aug 2018 15:16:00 +0000 (09:16 -0600)]
python: Open the template as text, with an explicit encoding

In commit bd27203f4d808763ac24ac94eb677cacf3e7cb99 we changed this to
open in binary mode, to then explicitly decode the lines with the right
encoding.

Unfortunately, that broke the build on Windows, where the template file
can have '\r\n' as line terminators: opening in binary mode would keep
those terminators and break the regexp.

We need to go back to text mode, where the "universal newlines" mode
takes care of this.

However, to fix the initial issue, let's specify the encoding explicitly
when opening the file, and make sure it is open in text mode, so we only
get unicode strings.

Reviewed-by: Jose Fonseca <jfonseca@vmware>
6 years agopython: Help Python 2 print the line
Mathieu Bridon [Fri, 17 Aug 2018 15:33:02 +0000 (09:33 -0600)]
python: Help Python 2 print the line

Reviewed-by: Jose Fonseca <jfonseca@vmware>