mesa.git
7 years agost_cb_bitmap: check NULL return from u_upload_alloc
Julien Isorce [Thu, 23 Mar 2017 13:49:30 +0000 (13:49 +0000)]
st_cb_bitmap: check NULL return from u_upload_alloc

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agosi_compute: check NULL return from u_upload_alloc
Julien Isorce [Thu, 23 Mar 2017 13:43:49 +0000 (13:43 +0000)]
si_compute: check NULL return from u_upload_alloc

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agor600g: check NULL return from u_upload_alloc
Julien Isorce [Thu, 23 Mar 2017 13:34:07 +0000 (13:34 +0000)]
r600g: check NULL return from u_upload_alloc

Like done in si_state_draw.c::si_draw_vbo

u_upload_alloc can fail, i.e. set output param *ptr to NULL, for 2 reasons:
alloc fails or map fails. For both there is already a fprintf/stderr in
radeon_create_bo and radeon_bo_do_map.

In src/gallium/drivers/ it is a common usage to just avoid to crash by doing
a silent check. But defer fprintf where the error comes from, libdrm calls.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoswr: fix llvm-5.0.0 build bustage
Tim Rowley [Mon, 27 Mar 2017 18:30:10 +0000 (13:30 -0500)]
swr: fix llvm-5.0.0 build bustage

Handle rename of llvm AttributeSet to AttributeList in the same
fashion as ac_llvm_helper.cpp.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr: [rasterizer jitter] fix llvm-5.0.0 build bustage
Tim Rowley [Mon, 27 Mar 2017 18:29:31 +0000 (13:29 -0500)]
swr: [rasterizer jitter] fix llvm-5.0.0 build bustage

Add CreateAlignmentAssumptionHelper to gen_llvm_ir_macros.py ignore list.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoisl: Drop unused isl_surf_init_info::min_pitch
Chad Versace [Fri, 10 Mar 2017 21:58:13 +0000 (13:58 -0800)]
isl: Drop unused isl_surf_init_info::min_pitch

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agointel: Fix requests for exact surface row pitch (v2)
Chad Versace [Sat, 25 Feb 2017 01:15:43 +0000 (17:15 -0800)]
intel: Fix requests for exact surface row pitch (v2)

All callers of isl_surf_init() that set 'min_row_pitch' wanted to
request an *exact* row pitch, as evidenced by nearby asserts, but isl
lacked API for doing so. Now that isl has an API for that, update the
code to use it.

v2: Assert that isl_surf_init() succeeds because the callers assume
    it.  [for jekstrand]

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> (v1)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (v1)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
7 years agoisl: Let isl_surf_init's caller set the exact row pitch (v2)
Chad Versace [Sat, 25 Feb 2017 00:30:13 +0000 (16:30 -0800)]
isl: Let isl_surf_init's caller set the exact row pitch (v2)

The caller does so by setting the new field
isl_surf_init_info::row_pitch.

v2: Validate the requested row_pitch.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
7 years agoisl: Validate the calculated row pitch (v45)
Chad Versace [Tue, 21 Mar 2017 21:11:57 +0000 (14:11 -0700)]
isl: Validate the calculated row pitch (v45)

Validate that isl_surf::row_pitch fits in the below bitfields,
if applicable based on isl_surf::usage.

    RENDER_SURFACE_STATE::SurfacePitch
    RENDER_SURFACE_STATE::AuxiliarySurfacePitch
    3DSTATE_DEPTH_BUFFER::SurfacePitch
    3DSTATE_HIER_DEPTH_BUFFER::SurfacePitch

v2:
  -Add a Makefile dependency on generated header genX_bits.h.
v3:
  - Test ISL_SURF_USAGE_STORAGE_BIT too. [for jekstrand]
  - Drop explicity dependency on generated header. [for emil]
v4:
  - Rebase for new gen_bits_header.py script.
  - Replace gen_10x with gen_device_info*.
v5:
  - Drop FINISHME for validation of GEN9 1D row pitch. [for jekstrand]
  - Reformat bit tests. [for jekstrand]

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v4)
7 years agogenxml: New generated header genX_bits.h (v6)
Chad Versace [Fri, 24 Mar 2017 21:35:24 +0000 (14:35 -0700)]
genxml: New generated header genX_bits.h (v6)

genX_bits.h contains the sizes of bitfields in genxml instructions,
structures, and registers. It also defines some functions to query those
sizes.

isl_surf_init() will use the new header to validate that requested
pitches fit in their destination bitfields.

What's currently in genX_bits.h:

  - Each CONTAINER::Field from gen*.xml that has a bitsize has a macro
    in genX_bits.h:

        #define GEN{N}_CONTAINER_Field_bits {bitsize}

  - For each set of macros whose name, after stripping the GEN prefix,
    is the same, genX_bits.h contains a query function:

      static inline uint32_t __attribute__((pure))
      CONTAINER_Field_bits(const struct gen_device_info *devinfo);

v2 (Chad Versace):
  - Parse the XML instead of scraping the generated gen*_pack.h headers.

v3 (Dylan Baker):
  - Port to Mako.

v4 (Jason Ekstrand):
  - Make the _bits functions take a gen_device_info.

v5 (Chad Versace):
  - Fix autotools out-of-tree build.
  - Fix Android build. Tested with git://github.com/android-ia/manifest.
  - Fix macro names. They were all missing the "_bits" suffix.
  - Fix macros names more. Remove all double-underscores.
  - Unindent all generated code. (It was floating in a sea of whitespace).
  - Reformat header to appear human-written not machine-generated.
  - Sort gens from high to low. Newest gens should come first because,
    when we read code, we likely want to read the gen8/9 code and ignore
    the gen4 code. So put the gen4 code at the bottom.
  - Replace 'const' attributes with 'pure', because the functions now
    have a pointer parameter.
  - Add --cpp-guard flag. Used by Android.
  - Kill class FieldCollection. After Jason's rewrite, it was just
    a dict.

v6 (Chad Versace):
  - Replace `key not in d.keys()` with `key not in d`. [for dylan]

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v5)
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (v6)
7 years agoswr: [rasterizer core] Disable inline function expansion
Tim Rowley [Thu, 23 Mar 2017 00:20:42 +0000 (19:20 -0500)]
swr: [rasterizer core] Disable inline function expansion

Disable expansion in windows Debug builds.

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer common] Use C++ thread_local keyword
Tim Rowley [Wed, 22 Mar 2017 23:55:13 +0000 (18:55 -0500)]
swr: [rasterizer common] Use C++ thread_local keyword

Allows use of thread_local objects with constructors.

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer core] SIMD16 Frontend WIP
Tim Rowley [Wed, 22 Mar 2017 17:36:49 +0000 (12:36 -0500)]
swr: [rasterizer core] SIMD16 Frontend WIP

Implement widened clipper and binner interfaces for SIMD16.

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer core] Don't bind single-threaded contexts
Tim Rowley [Tue, 21 Mar 2017 21:52:49 +0000 (16:52 -0500)]
swr: [rasterizer core] Don't bind single-threaded contexts

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer core] Enable SIMD16
Tim Rowley [Tue, 21 Mar 2017 20:32:34 +0000 (15:32 -0500)]
swr: [rasterizer core] Enable SIMD16

Make the AVX512 insert/extract intrinsics KNL-compatible

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer jitter] Clean up EngineBuilder construction
Tim Rowley [Tue, 21 Mar 2017 00:44:49 +0000 (19:44 -0500)]
swr: [rasterizer jitter] Clean up EngineBuilder construction

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer codegen] add cmdline to archrast gen files
Tim Rowley [Mon, 20 Mar 2017 22:39:41 +0000 (17:39 -0500)]
swr: [rasterizer codegen] add cmdline to archrast gen files

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer core] SIMD16 Frontend WIP
Tim Rowley [Mon, 20 Mar 2017 17:17:07 +0000 (12:17 -0500)]
swr: [rasterizer core] SIMD16 Frontend WIP

Fix GS and streamout.

Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
7 years agoswr: [rasterizer codegen] Refactor codegen
Tim Rowley [Fri, 17 Mar 2017 17:39:15 +0000 (12:39 -0500)]
swr: [rasterizer codegen] Refactor codegen

Move common codegen functions into gen_common.py.

v2: change gen_knobs.py to find the template file internally, like
the rest of the gen scripts.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agotests/cache_test: allow crossing mount points
Juan A. Suarez Romero [Tue, 28 Mar 2017 16:00:39 +0000 (18:00 +0200)]
tests/cache_test: allow crossing mount points

When using an overlayfs system (like a Docker container), rmrf_local()
fails because part of the files to be removed are in different mount
points (layouts). And thus cache-test fails.

Letting crossing mount points is not a big problem, specially because
this is just for a test, not to be used in real code.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglcpp/tests/glcpp-test-cr-lf: error out if we cannot find any tests
Emil Velikov [Tue, 28 Feb 2017 13:29:06 +0000 (13:29 +0000)]
glcpp/tests/glcpp-test-cr-lf: error out if we cannot find any tests

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglcpp/tests/glcpp-test-cr-lf: correctly set/use srcdir/abs_builddir
Emil Velikov [Tue, 28 Feb 2017 13:24:55 +0000 (13:24 +0000)]
glcpp/tests/glcpp-test-cr-lf: correctly set/use srcdir/abs_builddir

Otherwise manual invokation of the script from elsewhere than
`dirname $0` will fail.

With these all the artefacts should be created in the correct location,
and thus we can remove the old (and slighly strange) clean-local line.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglcpp/tests: update testname in help string
Emil Velikov [Tue, 28 Feb 2017 12:13:58 +0000 (12:13 +0000)]
glcpp/tests: update testname in help string

Rather than hardcoding glcpp/other use `basename "$0"` which expands
appropriatelly.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglcpp/tests/glcpp-test: error out if we cannot find any tests
Emil Velikov [Tue, 28 Feb 2017 12:10:41 +0000 (12:10 +0000)]
glcpp/tests/glcpp-test: error out if we cannot find any tests

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglcpp/tests/glcpp-test: print only the test basename
Emil Velikov [Tue, 28 Feb 2017 12:08:52 +0000 (12:08 +0000)]
glcpp/tests/glcpp-test: print only the test basename

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglcpp/tests/glcpp-test: set srcdir/abs_builddir variables
Emil Velikov [Tue, 28 Feb 2017 12:02:35 +0000 (12:02 +0000)]
glcpp/tests/glcpp-test: set srcdir/abs_builddir variables

Current definitions work fine for the manual invokation of the script,
although the whole script does not consider that one can run it OOT.

The latter will be handled with latter patches, although it will be
extensively using the two variables.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: 'echo' only folders which has generators
Emil Velikov [Mon, 27 Feb 2017 18:58:06 +0000 (18:58 +0000)]
glsl/tests/optimization-test: 'echo' only folders which has generators

The current "let's print any folder which exists" is simply confusing.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: print only the test basedir/name
Emil Velikov [Mon, 27 Feb 2017 18:56:38 +0000 (18:56 +0000)]
glsl/tests/optimization-test: print only the test basedir/name

The relative/absolute path brings little to no benefit in being printed
as testname. Trim it out.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: error if zero tests were executed
Emil Velikov [Sun, 26 Feb 2017 20:43:05 +0000 (20:43 +0000)]
glsl/tests/optimization-test: error if zero tests were executed

We don't want to lie ourselves that 'everything is fine' when no tests
were found/ran.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: pass glsl_test as argument
Emil Velikov [Sun, 26 Feb 2017 20:28:21 +0000 (20:28 +0000)]
glsl/tests/optimization-test: pass glsl_test as argument

Rather than hardcoding the binary location (which ends up wrong in a
number of occasions) in the python script, pass it as argument.

This allows us to remove a couple of dirname/basename workarounds that
aimed to keep this working, and succeeded in the odd occasion.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: error out if we fail to generate any tests
Emil Velikov [Thu, 23 Feb 2017 14:53:03 +0000 (14:53 +0000)]
glsl/tests/optimization-test: error out if we fail to generate any tests

v2: use -eq over a string comparison (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: correctly manage srcdir/builddir
Emil Velikov [Sun, 26 Feb 2017 20:17:00 +0000 (20:17 +0000)]
glsl/tests/optimization-test: correctly manage srcdir/builddir

At the moment we look for generator script(s) in builddir while they
are in srcdir, and we proceed to generate the tests and expected output
in srcdir, which is not allowed.

To untangle:
 - look for the generator script in the correct place
 - generate the files in builddir, by extending create_test_cases.py to
use --outdir

With this in place the test passes `make check' for OOT builds - would
that be as standalone or part of `make distcheck'

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimisation-test: ensure that compare_ir is available
Emil Velikov [Thu, 23 Feb 2017 14:17:09 +0000 (14:17 +0000)]
glsl/tests/optimisation-test: ensure that compare_ir is available

Bail out early if the script is not where we expect it to be.

v2: use -f instead of -e. latter returns true on folder(s)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: correctly set compare_ir
Emil Velikov [Mon, 27 Feb 2017 18:21:36 +0000 (18:21 +0000)]
glsl/tests/optimization-test: correctly set compare_ir

Now that we have srcdir we can use it to correctly manage/point to the
script. Effectively fixing OOT invokation of `make check'.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimization-test: add fallback srcdir/abs_builddir defines
Emil Velikov [Thu, 23 Feb 2017 14:27:08 +0000 (14:27 +0000)]
glsl/tests/optimization-test: add fallback srcdir/abs_builddir defines

There is no robust way to detect either one, so simply hope for the best
and warn just in case.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/optimisation-test: make sure that $PYTHON2 is set/available
Emil Velikov [Thu, 23 Feb 2017 13:15:42 +0000 (13:15 +0000)]
glsl/tests/optimisation-test: make sure that $PYTHON2 is set/available

Otherwise we'll fail when invoking the script outside of "make check"

v2: use -ne over a string comparison (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/warnings-test: print only the test basename
Emil Velikov [Sun, 26 Feb 2017 21:24:42 +0000 (21:24 +0000)]
glsl/tests/warnings-test: print only the test basename

Spamming the log with the (in some cases extremely long) test location
is of limited use.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/warnings-test: error if zero tests were executed
Emil Velikov [Sun, 26 Feb 2017 21:33:08 +0000 (21:33 +0000)]
glsl/tests/warnings-test: error if zero tests were executed

We don't want to lie ourselves that 'everything is fine' when no tests
were found/ran.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/warnings-test: correctly manage srcdir/builddir
Emil Velikov [Sun, 26 Feb 2017 21:24:26 +0000 (21:24 +0000)]
glsl/tests/warnings-test: correctly manage srcdir/builddir

Before this commit, we would effectively fail to run any of the test in
a OOT builds.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/warnings-test: add fallback srcdir/abs_builddir defines
Emil Velikov [Sun, 26 Feb 2017 21:06:07 +0000 (21:06 +0000)]
glsl/tests/warnings-test: add fallback srcdir/abs_builddir defines

There is no robust way to detect either one, so simply hope for the best
and warn just in case.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests/warnings-test: error out if glsl_compiler is missing
Emil Velikov [Sun, 26 Feb 2017 20:47:30 +0000 (20:47 +0000)]
glsl/tests/warnings-test: error out if glsl_compiler is missing

 ... or non-executable, in particular.

v2: use test -x (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl: automake: export abs_builddir for the tests
Emil Velikov [Sun, 26 Feb 2017 22:39:26 +0000 (22:39 +0000)]
glsl: automake: export abs_builddir for the tests

We're going to use them with the next commits to determine where to put
the generated tests and/or built binaries.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoglsl/tests: automake: cleanup all artefacts during clean-local
Emil Velikov [Thu, 16 Mar 2017 18:03:34 +0000 (18:03 +0000)]
glsl/tests: automake: cleanup all artefacts during clean-local

With later commits we'll fix the generators to produce the files in the
correct location. That in itself will cause an issue since the files
will be left dangling and make distcheck will fail.

v2: Use -r only as needed (Eric)

Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agost/va: remove assert for single slice
Nayan Deshmukh [Tue, 21 Mar 2017 08:14:27 +0000 (13:44 +0530)]
st/va: remove assert for single slice

we anyway allow for multiple slices

v2: do not remove assert to check for buf->size

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeonsi: use DMA for clears with unaligned size
Nicolai Hähnle [Mon, 13 Feb 2017 12:19:45 +0000 (13:19 +0100)]
radeonsi: use DMA for clears with unaligned size

Only a small tail needs to be uploaded manually.

This is only partly a performance measure (apps are expected to use
aligned access). Mostly it is preparation for sparse buffers, which the
old code would incorrectly have attempted to map directly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: CP DMA clear supports unaligned destination addresses
Nicolai Hähnle [Mon, 13 Feb 2017 12:08:52 +0000 (13:08 +0100)]
radeonsi: CP DMA clear supports unaligned destination addresses

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: remove the early-out for SDMA in si_clear_buffer
Nicolai Hähnle [Mon, 13 Feb 2017 11:51:36 +0000 (12:51 +0100)]
radeonsi: remove the early-out for SDMA in si_clear_buffer

This allows the next patches to be simple while still being able
to make use of SDMA even in some unusual cases.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradv: move shader stages calculation to pipeline.
Dave Airlie [Tue, 28 Mar 2017 02:59:17 +0000 (12:59 +1000)]
radv: move shader stages calculation to pipeline.

With tess this becomes a bit more complex. so move to pipeline
for now.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move pa_cl_vs_out_cntl calculation to pipeline
Dave Airlie [Tue, 28 Mar 2017 01:48:38 +0000 (11:48 +1000)]
radv: move pa_cl_vs_out_cntl calculation to pipeline

This also takes the side band setting code from radeonsi.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move calculating fragment shader i/os to pipeline.
Dave Airlie [Tue, 28 Mar 2017 01:43:48 +0000 (11:43 +1000)]
radv: move calculating fragment shader i/os to pipeline.

There is no need to calculate this on each command submit.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move shader_z_format calculation to pipeline.
Dave Airlie [Tue, 28 Mar 2017 01:34:46 +0000 (11:34 +1000)]
radv: move shader_z_format calculation to pipeline.

No need to recalculate this every time.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move db_shader_control calculation to pipeline.
Dave Airlie [Tue, 28 Mar 2017 01:34:19 +0000 (11:34 +1000)]
radv: move db_shader_control calculation to pipeline.

There is no need to recalculate this every time.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move vgt_gs_mode value to pipeline.
Dave Airlie [Tue, 28 Mar 2017 01:33:35 +0000 (11:33 +1000)]
radv: move vgt_gs_mode value to pipeline.

No need to recalculate this everytime.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: add parameter to emit_waitcnt.
Dave Airlie [Mon, 27 Mar 2017 22:46:35 +0000 (08:46 +1000)]
radv: add parameter to emit_waitcnt.

This is just a precursor for tess support, which needs to
pass different values here.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: rework vertex/export shader output handling
Dave Airlie [Mon, 27 Mar 2017 20:13:09 +0000 (06:13 +1000)]
radv: rework vertex/export shader output handling

In order to faciliate adding tess support, split the vs/es
output info into a separate block, so we make it easier to
have the tess shaders export the same info.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: fix ia_multi_vgt_param for instanced vs indirect draw.
Dave Airlie [Mon, 27 Mar 2017 19:53:50 +0000 (05:53 +1000)]
radv: fix ia_multi_vgt_param for instanced vs indirect draw.

The logic was different than radeonsi, fix it up before adding
tess support.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: handle NULL multisample state.
Dave Airlie [Mon, 27 Mar 2017 19:48:27 +0000 (05:48 +1000)]
radv: handle NULL multisample state.

If rasterization is disabled, we can get a NULL multisample
state.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: flush DB cache before and after HTILE decompress.
Bas Nieuwenhuizen [Mon, 27 Mar 2017 23:48:15 +0000 (01:48 +0200)]
radv: flush DB cache before and after HTILE decompress.

It reads @ writes the DB cache, and we haven't flushed dst caches yet,
so DB cache may be stale. Also the user might be shader read (and probably is),
so also flush after.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
CC: <mesa-stable@lists.freedesktop.org>
Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
7 years agoi965: Delete tile resource mode code
Anuj Phogat [Thu, 16 Mar 2017 17:36:46 +0000 (10:36 -0700)]
i965: Delete tile resource mode code

Yf/Ys tiling never got used in i965 due to not delivering
the expected performance benefits. So, this patch is deleting
this dead code in favor of adding it later in ISL when we
actually find it useful. ISL can then share this code between
vulkan and GL.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965: Delete fast copy blit code
Anuj Phogat [Thu, 16 Mar 2017 17:35:49 +0000 (10:35 -0700)]
i965: Delete fast copy blit code

Fast copy blit was primarily added to support Yf/Ys detiling.
But, Yf/Ys tiling never got used in i965 due to not delivering
the expected performance benefits. Also, replacing legacy blits
with fast copy blit didn't help the benchmarking numbers. This
is probably due to a h/w restriction that says "start pixel for
Fast Copy blit should be on an OWord boundary". This restriction
causes many blit operations to skip fast copy blit and use legacy
blits. So, this patch is deleting this dead code in favor of
adding it later when we actually find it useful.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965: Require Kernel 3.6 for Gen4-5 platforms.
Kenneth Graunke [Wed, 22 Mar 2017 22:20:51 +0000 (15:20 -0700)]
i965: Require Kernel 3.6 for Gen4-5 platforms.

We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
commit 92d2f5acfadea672417b6785710c9e8b7f605e41).  It seems reasonable
to require it for Gen4-5 as well, bumping the requirement from 2.6.39.

This is necessary for glClientWaitSync with a timeout to work, which
is a feature we expose on Gen4-5.  Without it, we would fall back to an
infinite wait, which is pretty bad.

See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.

Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoglsl: fix spelling of embedded in comment
Timothy Arceri [Mon, 27 Mar 2017 22:56:27 +0000 (09:56 +1100)]
glsl: fix spelling of embedded in comment

7 years agoglsl: fix lower jumps for returns when loop is inside an if
Timothy Arceri [Sun, 26 Mar 2017 12:34:13 +0000 (23:34 +1100)]
glsl: fix lower jumps for returns when loop is inside an if

Previously we would just escape the loop and move everything
following the loop inside the if to the else branch of a new if
with a return flag conditional. However everything outside the
if the loop was nested in would still get executed.

Adding a new return to the then branch of the new if fixes this
and we just let a follow pass clean it up if needed.

Fixes:
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test

Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
7 years agoradv: don't emit no color formats. (v3)
Dave Airlie [Mon, 27 Mar 2017 19:45:00 +0000 (05:45 +1000)]
radv: don't emit no color formats. (v3)

If we had no rasterization, we'd emit SPI color
format as all 0's the hw dislikes this, add the workaround
from radeonsi.

Found while debugging tessellation

v2: handle at pipeline stage, we have to handle
it after we process the fragment shader. (Bas)
v3: simplify even further, remove old fallback.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agomesa/tests: Link main-test with CLOCK_LIB.
Vinson Lee [Mon, 27 Mar 2017 18:57:48 +0000 (11:57 -0700)]
mesa/tests: Link main-test with CLOCK_LIB.

Fix 'make check' linking error with glibc < 2.17.

  CXXLD  main-test
../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano':
src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
7 years agoi965/fs: Don't emit SEL instructions for type-converting MOVs.
Matt Turner [Thu, 23 Mar 2017 19:12:18 +0000 (12:12 -0700)]
i965/fs: Don't emit SEL instructions for type-converting MOVs.

SEL can only convert between a few integer types, which we basically
never do.

Fixes fs/vs-double-uniform-array-direct-indirect-non-uniform-control-flow
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
7 years agoanv/blorp: Fix a crash in CmdClearColorImage
Xu Randy [Mon, 20 Mar 2017 07:31:35 +0000 (15:31 +0800)]
anv/blorp: Fix a crash in CmdClearColorImage

We should use anv_get_layerCount() to access layerCount of VkImageSub-
resourceRange in anv_CmdClearColorImage and anv_CmdClearDepthStencil-
Image, which handles the VK_REMAINING_ARRAY_LAYERS (~0) case.

Test: Sample multithreadcmdbuf from LunarG can run without crash

Signed-off-by: Xu Randy <randy.xu@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
7 years agomesa: simplify code around 'variable_data' in marshal.c
Brian Paul [Mon, 27 Mar 2017 14:30:43 +0000 (08:30 -0600)]
mesa: simplify code around 'variable_data' in marshal.c

Remove needless pointer increments, unneeded vars, etc.  Untested.
Plus, fix a couple comments.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agost/mesa: move duplicated st_ws_framebuffer() function into header file
Brian Paul [Mon, 27 Mar 2017 14:30:43 +0000 (08:30 -0600)]
st/mesa: move duplicated st_ws_framebuffer() function into header file

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoglsl: Interface Block instances don't need linking validation
Andres Gomez [Mon, 20 Feb 2017 15:20:58 +0000 (17:20 +0200)]
glsl: Interface Block instances don't need linking validation

From page 45 (page 52 of the PDF) of the GLSL ES 3.00 v.6 spec:

  " When instance names are present on matched block names, it is
    allowed for the instance names to differ; they need not match for
    the blocks to match.

From page 51 (page 57 of the PDF) of the GLSL 4.30 v.8 spec:

  " When instance names are present on matched block names, it is
    allowed for the instance names to differ; they need not match for
    the blocks to match."

Therefore, no cross linking validation is needed for the instance name
of an Interface Block.

This patch will make that no link error will be reported on a program
like this:

    "# VS

    layout(binding = 1) Block1 {
      vec4 color;
    } uni_block;

    ...

    # FS

    layout(binding = 2) Block2 {
      vec4 color;
    } uni_block;

    ..."

Fixes GL45-CTS.enhanced_layouts.ssb_layout_qualifier_conflict

Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoglsl: UBOs and SSBOs must match the binding qualifier too
Andres Gomez [Mon, 20 Feb 2017 14:49:14 +0000 (16:49 +0200)]
glsl: UBOs and SSBOs must match the binding qualifier too

From page 140 (page 147 of the PDF) of the GLSL ES 3.10 v.4 spec:

  " 9.2 Matching of Qualifiers

    The following tables summarize the requirements for matching of
    qualifiers.  It applies whenever there are two or more matching
    variables in a shader interface.

    Notes:

    1. Yes means the qualifiers must match.

    ...

    9.2.1 Linked Shaders

    | Qualifier | Qualifier | in/out | Default  | uniform | buffer|
    |   Class   |           |        | Uniforms |  Block  | Block |

    ...

    |  Layout   |  binding  |  N/A   |   Yes    |   Yes   |  Yes  |"

From page 93 (page 110 of the PDF) of the GL 4.2 (Core Profile) spec:

  " 2.11.7 Uniform Variables

    ...

    Uniform Blocks

    ...

    When a named uniform block is declared by multiple shaders in a
    program, it must be declared identically in each shader. The
    uniforms within the block must be declared with the same names and
    types, and in the same order. If a program contains multiple
    shaders with different declarations for the same named uniform
    block differs between shader, the program will fail to link."

From page 129 (page 150 of the PDF) of the GL 4.3 (Core Profile) spec:

  " 7.8 Shader Buffer Variables and Shader Storage Blocks

    ...

    When a named shader storage block is declared by multiple shaders
    in a program, it must be declared identically in each shader. The
    buffer variables within the block must be declared with the same
    names, types, qualification, and declaration order. If a program
    contains multiple shaders with different declarations for the same
    named shader storage block, the program will fail to link."

Therefore, if the binding qualifier differs between two linked Uniform
or Shader Storage Blocks of the same name, a link error should happen.

This patch will make that a link error will be reported on a program
like this:

    "# VS

    layout(binding = 1) Block {
      vec4 color;
    } uni_block1;

    ...

    # FS

    layout(binding = 2) Block {
      vec4 color;
    } uni_block2;

    ..."

Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoglsl: on UBO/SSBOs link error reset the number of active blocks to 0
Andres Gomez [Wed, 22 Feb 2017 15:03:22 +0000 (17:03 +0200)]
glsl: on UBO/SSBOs link error reset the number of active blocks to 0

While it's legal to have an active blocks count > 0 on link failure.
Unless we actually assign memory for the blocks array we can end up
segfaulting in calls such as glUniformBlockBinding().

To avoid having to NULL check these api calls we simply reset the
block count to 0 if the array was not created.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoanv: enable sampling from fast-cleared images on SKL
Samuel Iglesias Gonsálvez [Thu, 23 Mar 2017 11:19:39 +0000 (12:19 +0100)]
anv: enable sampling from fast-cleared images on SKL

A resolve is not needed on Skylake in this case. We were forcing
a resolve because we set the input_aux_usage to ISL_AUX_USAGE_NONE.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
7 years agoglsl, st/shader_cache: check the whole sha1 for zero
Grazvydas Ignotas [Sun, 26 Mar 2017 16:30:23 +0000 (19:30 +0300)]
glsl, st/shader_cache: check the whole sha1 for zero

The checks were only looking at the first byte, while the intention
seems to be to check if the whole sha1 is zero. This prevented all
shaders with first byte zero in their sha1 from being saved.

This shaves around a second from Deus Ex load time on a hot cache.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl/shader_cache: restore evicted shader keys
Grazvydas Ignotas [Sun, 26 Mar 2017 16:28:38 +0000 (19:28 +0300)]
glsl/shader_cache: restore evicted shader keys

Even though the programs themselves stay in cache and are loaded, the
shader keys can be evicted separately. If that happens, unnecessary
compiles are caused that waste time, and no matter how many times the
program is re-run, performance never recovers to the levels of first
hot cache run. To deal with this, we need to refresh the shader keys
of shaders that were recompiled.

An easy way to currently observe this is running Deux Ex, then piglit
and Deux Ex again, or deleting just the cache index. The later is
causing over a minute of lost time on all later Deux Ex runs, with this
patch it returns to normal after 1 run.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agost/nine: Use atomics for available_texture_mem
Axel Davy [Wed, 15 Mar 2017 21:53:36 +0000 (22:53 +0100)]
st/nine: Use atomics for available_texture_mem

Resource dtor can be executed in the worker thread.
Use atomic to avoid threading safety issues.

CC: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: James Harvey <lothmordor@gmail.com>
7 years agost/nine: Resolve deadlock in surface/volume dtors when using csmt
Axel Davy [Wed, 15 Mar 2017 21:45:03 +0000 (22:45 +0100)]
st/nine: Resolve deadlock in surface/volume dtors when using csmt

Surfaces and Volumes can be freed in the worker thread.

Without this patch, pending_uploads_counter could be non-zero
in the Surfaces or Volumes dtor, leading to deadlock.
Instead decrease properly the counter before releasing the
item.

Also avoid another potential deadlock if the item is not
properly unlocked: Do not call UnlockRect which will cause deadlock,
but free directly using the deadlock safe
nine_context_get_pipe_multithread.

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

CC: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: James Harvey <lothmordor@gmail.com>
7 years agost/nine: Fix user vertex data uploader with csmt
Axel Davy [Wed, 15 Mar 2017 21:29:12 +0000 (22:29 +0100)]
st/nine: Fix user vertex data uploader with csmt

Fix regression caused by
abb1c645c476b5dd289ce3efae0594f8796f9cf8

The patch made csmt use context.pipe instead of
secondary_pipe, leading to thread safety issues.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
7 years agoscons: Fix dependencies of marshal_generated.[ch].
Jose Fonseca [Sun, 26 Mar 2017 20:28:29 +0000 (21:28 +0100)]
scons: Fix dependencies of marshal_generated.[ch].

These generated source files depend not only upon gl_and_es_API.xml, but
all other XML files that are included by it.

This change updates the generation rules to depend on all gen/*.xml
files, like done for other SCons generation rules, and should fix
incremental broken SCons builds due to missing dependencies.

Trivial.

7 years agoglsl: Link tests with CLOCK_LIB.
Vinson Lee [Wed, 22 Mar 2017 22:23:17 +0000 (15:23 -0700)]
glsl: Link tests with CLOCK_LIB.

Fix 'make check' linking errors with glibc < 2.17.

  CXXLD  glsl/glsl_test
glsl/.libs/libglsl.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano':
src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
7 years agomesa/glthread: add custom marshalling for ClearBufferfv()
Timothy Arceri [Fri, 24 Mar 2017 06:46:20 +0000 (17:46 +1100)]
mesa/glthread: add custom marshalling for ClearBufferfv()

This is one of the main causes of syncs in Civ6.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoutil/disk_cache: don't deadlock on premature EOF
Grazvydas Ignotas [Fri, 24 Mar 2017 23:58:42 +0000 (01:58 +0200)]
util/disk_cache: don't deadlock on premature EOF

If we get EOF earlier than expected, the current read loops will
deadlock. This may easily happen if the disk cache gets corrupted.
Fix it by using a helper function that handles EOF.

Steps to reproduce (on a build with asserts disabled):
$ glxgears
$ find ~/.cache/mesa/ -type f -exec truncate -s 0 '{}' \;
$ glxgears # deadlock

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agogenxml: Add 3DSTATE_DEPTH_BUFFER to gen5.xml
Chad Versace [Tue, 21 Mar 2017 21:41:50 +0000 (14:41 -0700)]
genxml: Add 3DSTATE_DEPTH_BUFFER to gen5.xml

isl will use this for validating the depth buffer pitch.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agotests/cache_test: mark arguments const
Grazvydas Ignotas [Fri, 24 Mar 2017 22:56:51 +0000 (00:56 +0200)]
tests/cache_test: mark arguments const

While at it, also fix up a failure message to not reference timestamp
and gpu dirs as those are no longer being made.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agofreedreno: free compiler when screen is destroyed
Rob Clark [Tue, 21 Mar 2017 15:35:40 +0000 (11:35 -0400)]
freedreno: free compiler when screen is destroyed

Drop ir3_compiler_destroy(), since it is only ralloc_free() and we
shouldn't really have an ir3 dependency in core.  If some future hw
has a new compiler, as long as all it's resources are ralloc()d then
things will all just work.

(In practice, I suppose you never really see this leak, but removing
it at least cleans up some noise in valgrind.)

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agogenxml: Whitespace fixes
Jason Ekstrand [Fri, 24 Mar 2017 21:26:20 +0000 (14:26 -0700)]
genxml: Whitespace fixes

Some field names had extra spaces and some had places where we should
have had a space but didn't.

Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agogenxml: Replace "[N]" with "N"
Jason Ekstrand [Fri, 24 Mar 2017 21:25:57 +0000 (14:25 -0700)]
genxml: Replace "[N]" with "N"

Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agogenxml/gen6: Remove a couple of bogus values
Jason Ekstrand [Fri, 24 Mar 2017 21:10:23 +0000 (14:10 -0700)]
genxml/gen6: Remove a couple of bogus values

Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agogenxml/gen8: Remove BLACK_LEVEL_CORRECTION_STATE
Jason Ekstrand [Fri, 24 Mar 2017 20:52:18 +0000 (13:52 -0700)]
genxml/gen8: Remove BLACK_LEVEL_CORRECTION_STATE

We've never used it, it only exists on gen8, and the name of the struct
contains piles of bad characters.

Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agogenxml: Rename two MCS fields to Auxiliary Surface on gen7
Jason Ekstrand [Fri, 24 Mar 2017 20:50:34 +0000 (13:50 -0700)]
genxml: Rename two MCS fields to Auxiliary Surface on gen7

This makes gen7 more consistent with gen8+

Reviewed-by: Chad Versace <chadversary@chromium.org>
7 years agofreedreno: fix memory leak
Rob Clark [Fri, 24 Mar 2017 21:03:05 +0000 (17:03 -0400)]
freedreno: fix memory leak

Otherwise blitter would still hold a ref to, for example, sampler-
views.

To reproduce:

   glmark2 -b desktop:duration=2 --run-forever

Fixes: a8e6734 ("freedreno: support for using generic clear path")
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agogenxml: Fix gen_zipped_file.py dependency
Chad Versace [Wed, 22 Mar 2017 22:59:02 +0000 (15:59 -0700)]
genxml: Fix gen_zipped_file.py dependency

The gen*_xml.h files depend on gen_zipped_file.py, not the gen*_pack.h
files.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agogenxml: Define GENXML_XML_FILES in Makefile.sources
Chad Versace [Wed, 22 Mar 2017 22:49:39 +0000 (15:49 -0700)]
genxml: Define GENXML_XML_FILES in Makefile.sources

The future header genX_bits.h will depend on GENXML_XML_FILES.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoclover: use pipe_resource references
Jan Vesely [Thu, 2 Mar 2017 00:45:03 +0000 (19:45 -0500)]
clover: use pipe_resource references

v2: buffers are created with one reference.
v3: add pipe_resource reference to mapping object
v4: rename to pres and drop inline initializers

CC: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
7 years agoi965: Fix symbolic size of next_offset[] array.
Kenneth Graunke [Wed, 1 Mar 2017 01:04:00 +0000 (17:04 -0800)]
i965: Fix symbolic size of next_offset[] array.

It's indexed by buffer, not stream.  BRW_MAX_SOL_BUFFERS and
MAX_VERTEX_STREAMS happen to both be 4, so there's no actual bug.

Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoi965: Remove pointless NULL check from Gen6 primitive counting code.
Kenneth Graunke [Fri, 17 Mar 2017 00:20:10 +0000 (17:20 -0700)]
i965: Remove pointless NULL check from Gen6 primitive counting code.

We create the BO when creating a transform feedback object, and only
destroy it when deleting that object.  So it won't be NULL.

CID: 1401410

Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoradeonsi: don't crash on compute shader compile failure
Marek Olšák [Thu, 23 Mar 2017 23:38:15 +0000 (00:38 +0100)]
radeonsi: don't crash on compute shader compile failure

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: don't hang on shader compile failure
Marek Olšák [Thu, 23 Mar 2017 23:17:23 +0000 (00:17 +0100)]
radeonsi: don't hang on shader compile failure

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: fix dvec[34] attributes sourced from current attribute state
Nicolai Hähnle [Thu, 23 Mar 2017 16:54:43 +0000 (17:54 +0100)]
radeonsi: fix dvec[34] attributes sourced from current attribute state

The state tracker no longer uploads those attributes for us,
so we must conservatively upload the size of the largest
attribute, which is a dvec4.

Fixes a regression of GL45-CTS.gpu_shader_fp64.varyings and
GL45-CTS.vertex_attrib_64bit.limits_test.

Fixes: 9b91e0b54cc2 ("radeonsi: allow unaligned vertex buffer offsets and strides on CIK-VI")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoanv: automake: ensure that the destination directory is created
Emil Velikov [Thu, 23 Mar 2017 18:27:29 +0000 (18:27 +0000)]
anv: automake: ensure that the destination directory is created

Earlier commit unintentionally dropped the mkdir, as it was rebased.

Some versions of autotools will not create the output directory for
generated sources. Thus the issue went unnoticed by the original author.

Cc: Dylan Baker <dylan@pnwbakers.com>
Cc: Steven Newbury <steve@snewbury.org.uk>
Reported-by: Steven Newbury <steve@snewbury.org.uk> Fixes:
Fixes: 1610b3dede1 ("anv: don't pass xmlfile via stdin anv_entrypoints_gen.py")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>