mesa.git
7 years agonir: Return progress from nir_lower_atomics().
Matt Turner [Thu, 2 Mar 2017 19:24:19 +0000 (11:24 -0800)]
nir: Return progress from nir_lower_atomics().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_clamp_color_outputs().
Matt Turner [Thu, 2 Mar 2017 19:18:04 +0000 (11:18 -0800)]
nir: Return progress from nir_lower_clamp_color_outputs().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_clip_fs().
Matt Turner [Thu, 2 Mar 2017 19:15:53 +0000 (11:15 -0800)]
nir: Return progress from nir_lower_clip_fs().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_clip_vs().
Matt Turner [Thu, 2 Mar 2017 19:14:36 +0000 (11:14 -0800)]
nir: Return progress from nir_lower_clip_vs().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_move_vec_src_uses_to_dest().
Matt Turner [Tue, 28 Feb 2017 00:28:43 +0000 (16:28 -0800)]
nir: Return progress from nir_move_vec_src_uses_to_dest().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_to_source_mods().
Matt Turner [Fri, 24 Feb 2017 23:45:09 +0000 (15:45 -0800)]
nir: Return progress from nir_lower_to_source_mods().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_clip_cull_distance_arrays().
Matt Turner [Fri, 24 Feb 2017 23:38:28 +0000 (15:38 -0800)]
nir: Return progress from nir_lower_clip_cull_distance_arrays().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_var_copies().
Matt Turner [Fri, 24 Feb 2017 23:34:40 +0000 (15:34 -0800)]
nir: Return progress from nir_lower_var_copies().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_load_const_to_scalar().
Matt Turner [Fri, 24 Feb 2017 23:32:11 +0000 (15:32 -0800)]
nir: Return progress from nir_lower_load_const_to_scalar().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_64bit_pack().
Matt Turner [Fri, 24 Feb 2017 23:29:24 +0000 (15:29 -0800)]
nir: Return progress from nir_lower_64bit_pack().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_doubles().
Matt Turner [Fri, 24 Feb 2017 23:27:07 +0000 (15:27 -0800)]
nir: Return progress from nir_lower_doubles().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Return progress from nir_lower_vars_to_ssa().
Matt Turner [Fri, 24 Feb 2017 23:22:54 +0000 (15:22 -0800)]
nir: Return progress from nir_lower_vars_to_ssa().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Fix syntax.
Matt Turner [Thu, 2 Mar 2017 19:09:00 +0000 (11:09 -0800)]
nir: Fix syntax.

et is not an abbreviation.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Fix misspellings.
Matt Turner [Tue, 28 Feb 2017 00:28:53 +0000 (16:28 -0800)]
nir: Fix misspellings.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: Stop using apostrophes to pluralize.
Matt Turner [Tue, 28 Feb 2017 01:21:42 +0000 (17:21 -0800)]
nir: Stop using apostrophes to pluralize.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agost/omx/enc: use PIPE_USAGE_STAGING for output buffer
Leo Liu [Thu, 23 Mar 2017 14:29:47 +0000 (10:29 -0400)]
st/omx/enc: use PIPE_USAGE_STAGING for output buffer

Workaround an unknown bug with inside the transfer_map for certain
ASIC, also tested with un-affected ASICs, the performance actually
improved slightly.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogbm: Use unsigned for BO offset getter
Daniel Stone [Thu, 23 Mar 2017 15:09:49 +0000 (15:09 +0000)]
gbm: Use unsigned for BO offset getter

The actual offset returned is uint32_t, however int64_t was used as the
return type from gbm_bo_get_offset to allow negative returns to signal
errors to the caller.

In case of an error getting the offset, the user will also be unable to
get the handle/FD, and thus have nothing to offset into. This means that
returning 0 as an error value is harmless, allowing us to change the
return type to uint32_t in order to avoid signed/unsigned confusion in
callers.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Jason Ekstrand <jason@jlekstrand.net>
7 years agoREVIEWERS: add autogen.sh to the autoconf group
Eric Engestrom [Wed, 22 Mar 2017 16:54:52 +0000 (16:54 +0000)]
REVIEWERS: add autogen.sh to the autoconf group

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agodocs/submittingpatches: add mention about legal disclaimers
Eric Engestrom [Wed, 22 Mar 2017 15:55:28 +0000 (15:55 +0000)]
docs/submittingpatches: add mention about legal disclaimers

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agor600_shader.c: fix indentation
Julien Isorce [Wed, 22 Mar 2017 13:43:45 +0000 (13:43 +0000)]
r600_shader.c: fix indentation

Introduced by ad13bd2e51a5dc01b0f8a0eb927022f0deac0a0c

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoglx: Prefer library path given by pkgconfig over the system
Topi Pohjolainen [Thu, 23 Mar 2017 12:27:40 +0000 (12:27 +0000)]
glx: Prefer library path given by pkgconfig over the system

Recent change to use drmGetDevices2() made me realize that
build configured using

PKG_CONFIG_PATH=my_drm_lib_path/pkgconfig ./autogen.sh

considers the libdrm path gotten from pkgconfig only during
make. When invoking "make install" the relink command puts
system library ahead of the path gotten from pkgconfig
(and starts to fail as system libdrm isn't new enough).

This change forces the relink command to respect pkgconfig
settings.

It looks to me that in

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

with Emil et al considering it a libtool bug.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
[Emil Velikov: add inline comment]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agointel: move gen_decoder.* to DECODER_FILES
Tapani Pälli [Thu, 23 Mar 2017 07:15:54 +0000 (09:15 +0200)]
intel: move gen_decoder.* to DECODER_FILES

patch adds DECODER_FILES for libintel_common, this is so that platforms
such as Android not currently using this functionality can opt out.

Fixes: 7d84bb3 ("intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoandroid: fix vulkan build issues with anv_entrypoints
Tapani Pälli [Thu, 23 Mar 2017 10:48:34 +0000 (12:48 +0200)]
android: fix vulkan build issues with anv_entrypoints

Patch fixes entrypoint generation for libmesa_anv_entrypoints that
still used old style of calling generator script.

Also small fixes to libmesa_vulkan_common where there was a typo
in target name (vulknan) and files were generated to wrong folder.

Fixes: 8211e3e6 ("anv: Generate anv_entrypoints header and code in one command")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoandroid: i965: generate code for OA counter queries
Mauro Rossi [Sun, 12 Mar 2017 23:01:21 +0000 (00:01 +0100)]
android: i965: generate code for OA counter queries

Automake generation rules are replicated for android.
$* macro was expected to return "hsw" but instead gives "hsw.{h,c}"
so $(basename $*) is used as a workaround
to set the correct --chipset option for brw_oa.py script.

Build tested with nougat-x86

Fixes: e565505 "i965: Add script to gen code for OA counter queries"
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Robert Bragg <robert@sixbynine.org>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoandroid: rename Intel Vulkan library to match desktop one
Tapani Pälli [Tue, 21 Mar 2017 08:04:48 +0000 (10:04 +0200)]
android: rename Intel Vulkan library to match desktop one

Original naming was following Vulkan HAL naming scheme for no good
purpose and we need same binary name for build-id code.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agonouveau: enable glsl/tgsi on-disk cache
Boyan Ding [Wed, 22 Mar 2017 03:18:19 +0000 (11:18 +0800)]
nouveau: enable glsl/tgsi on-disk cache

v2: Fix argument to nouveau_screen_get_name()

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agoREVIEWERS: add myself as a reviewer for EGL and docs
Eric Engestrom [Wed, 22 Mar 2017 16:10:30 +0000 (16:10 +0000)]
REVIEWERS: add myself as a reviewer for EGL and docs

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoanv: Remove dead prototype from entrypoints
Dylan Baker [Thu, 23 Feb 2017 17:46:52 +0000 (09:46 -0800)]
anv: Remove dead prototype from entrypoints

Spotted by Emil.

v2: - Add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: use cElementTree in anv_entrypoints_gen.py
Dylan Baker [Tue, 21 Feb 2017 19:21:24 +0000 (11:21 -0800)]
anv: use cElementTree in anv_entrypoints_gen.py

It's written in C rather than pure python and is strictly faster, the
only reason not to use it that it's classes cannot be subclassed.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: don't use Element.get in anv_entrypoints_gen.py
Dylan Baker [Tue, 21 Feb 2017 19:16:43 +0000 (11:16 -0800)]
anv: don't use Element.get in anv_entrypoints_gen.py

This has the potential to mask errors, since Element.get works like
dict.get, returning None if the element isn't found. I think the reason
that Element.get was used is that vulkan has one extension that isn't
really an extension, and thus is missing the 'protect' field.

This patch changes the behavior slightly by replacing get with explicit
lookup in the Element.attrib dictionary, and using xpath to only iterate
over extensions with a "protect" attribute.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: use dict.get in anv_entrypoints_gen.py
Dylan Baker [Tue, 21 Feb 2017 19:07:44 +0000 (11:07 -0800)]
anv: use dict.get in anv_entrypoints_gen.py

Instead of using an if and a check, use dict.get, which does the same
thing, but more succinctly.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: anv_entrypoints_gen.py: use reduce function.
Dylan Baker [Tue, 21 Feb 2017 19:00:41 +0000 (11:00 -0800)]
anv: anv_entrypoints_gen.py: use reduce function.

Reduce is it's own reward.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: anv-entrypoints_gen.py: rename hash to cal_hash.
Dylan Baker [Tue, 21 Feb 2017 18:58:32 +0000 (10:58 -0800)]
anv: anv-entrypoints_gen.py: rename hash to cal_hash.

hash is reserved name in python, it's the interface to access an
object's hash protocol.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: Generate anv_entrypoints header and code in one command
Dylan Baker [Fri, 3 Mar 2017 22:22:44 +0000 (14:22 -0800)]
anv: Generate anv_entrypoints header and code in one command

This produces the header and the code in one command, saving the need to
call the same script twice, which parses the same XML file.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: anv_entrypoints_gen.py: directly write files instead of piping
Dylan Baker [Sat, 18 Feb 2017 00:59:42 +0000 (16:59 -0800)]
anv: anv_entrypoints_gen.py: directly write files instead of piping

This changes the output to be written as a file rather than being piped.
This had one critical advantage, it encapsulates the encoding. This
prevents bugs where a symbol (generally unicode like © [copyright]) is
printed and the system being built on doesn't have a unicode locale.

v2: - Update Android.mk
v3: - Don't generate both files at once
    - Fix Android.mk
    - drop --outdir, since the filename is passed in as an argument

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: convert C generation to template in anv_entrypoints_gen.py
Dylan Baker [Sat, 18 Feb 2017 00:54:27 +0000 (16:54 -0800)]
anv: convert C generation to template in anv_entrypoints_gen.py

This produces a file that is identical except for whitespace, there is a
table that has 8 columns in the original and is easy to do with prints,
but is ugly using mako, so it doesn't have columns; the data is not
inherently tabular.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: convert header generation in anv_entrypoints_gen.py to mako
Dylan Baker [Fri, 17 Feb 2017 22:31:20 +0000 (14:31 -0800)]
anv: convert header generation in anv_entrypoints_gen.py to mako

This produces an identical file except for whitespace.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: Update "do not edit" comments with proper filename
Dylan Baker [Fri, 24 Feb 2017 16:47:54 +0000 (08:47 -0800)]
anv: Update "do not edit" comments with proper filename

This does two things, first it updates both the .h and the .c file to
have the same do not edit string. Second, it uses __file__ to ensure
that even if the file is moved or renamed that the name will be correct.

One thing to note is the use of '{{' and '}}' in the C template. This is
to instruct python to print a literal '{' and '}' respectively, rather
than treating the contents as a formatter specifier.

v3: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: split main into two functions in anv_entrypoints_gen.py
Dylan Baker [Fri, 17 Feb 2017 19:45:24 +0000 (11:45 -0800)]
anv: split main into two functions in anv_entrypoints_gen.py

This is groundwork for the next patches, it will allows porting the
header and the code to mako separately, and will also allow both to be
run simultaneously.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: don't pass xmlfile via stdin anv_entrypoints_gen.py
Dylan Baker [Fri, 17 Feb 2017 19:41:03 +0000 (11:41 -0800)]
anv: don't pass xmlfile via stdin anv_entrypoints_gen.py

It's slow, and has the potential for encoding issues.

v2: - pass xml file location via argument
    - update Android.mk

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: make constants capitals in anv_entrypoints_gen.py
Dylan Baker [Fri, 17 Feb 2017 19:31:11 +0000 (11:31 -0800)]
anv: make constants capitals in anv_entrypoints_gen.py

Again, it's standard python style.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: Use python style in anv_entrypoints_gen.py
Dylan Baker [Fri, 17 Feb 2017 19:06:22 +0000 (11:06 -0800)]
anv: Use python style in anv_entrypoints_gen.py

These are all fairly small cleanups/tweaks that don't really deserve
their own patch.

- Prefer comprehensions to map() and filter(), since they're faster
- replace unused variables with _
- Use 4 spaces of indent
- drop semicolons from the end of lines
- Don't use parens around if conditions
- don't put spaces around brackets
- don't import modules as caps (ET -> et)
- Use docstrings instead of comments

v2: - Replace comprehensions with multiplication

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoanv: anv_entrypoints_gen.py: use a main function
Dylan Baker [Fri, 17 Feb 2017 19:00:03 +0000 (11:00 -0800)]
anv: anv_entrypoints_gen.py: use a main function

This is just good practice.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoradv: Invalidate L2 for TRANSFER_WRITE barriers
Alex Smith [Tue, 21 Mar 2017 17:02:33 +0000 (17:02 +0000)]
radv: Invalidate L2 for TRANSFER_WRITE barriers

CP DMA and PKT3_WRITE_DATA (in CmdUpdateBuffer) don't (currently) write
through L2. Therefore, to make these writes visible to later accesses
we must invalidate L2 rather than just writing it back, to avoid the
possibility that stale data is read through L2.

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoglsl: Link glsl_compiler with CLOCK_LIB.
Vinson Lee [Tue, 21 Mar 2017 23:24:29 +0000 (16:24 -0700)]
glsl: Link glsl_compiler with CLOCK_LIB.

Fix linking error on CentOS 6.

  CXXLD  glsl_compiler
glsl/.libs/libstandalone.a(lt16-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>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoutil/disk_cache: use rand_xorshift128plus() to get our random int
Timothy Arceri [Tue, 21 Mar 2017 08:35:22 +0000 (19:35 +1100)]
util/disk_cache: use rand_xorshift128plus() to get our random int

Otherwise for apps that don't seed the regular rand() we will always
remove old cache entries from the same dirs.

V2: assume bits returned by rand are independent uniformly distributed
    bits and grab our hex value without taking the modulus of the whole
    value, this also fixes a bug where 'f' was always missing.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoutil/rand_xor: add function to seed rand
Timothy Arceri [Tue, 21 Mar 2017 23:48:57 +0000 (10:48 +1100)]
util/rand_xor: add function to seed rand

V2: pass the seed to the seed function so that we can isolate
    its uses. Stop leaking fd when urandom couldn't be read.

Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoutil: move rand_xorshift128plus() to utils
Timothy Arceri [Tue, 21 Mar 2017 23:47:05 +0000 (10:47 +1100)]
util: move rand_xorshift128plus() to utils

V2: pass the seed to rand_xorshift128plus() so that we can isolate
    its uses.

Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agodrirc: add force_glsl_abs_sqrt() for "Spec Ops: The Line"
Samuel Pitoiset [Fri, 17 Mar 2017 00:06:57 +0000 (01:06 +0100)]
drirc: add force_glsl_abs_sqrt() for "Spec Ops: The Line"

Game ported from D3D9 which expects sqrt() to compute the absolute
value as explained in the spec.

This gets rid of the NaN values as well as the black squares
with RadeonSI.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97338
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agost/glsl_to_tgsi: enable lower_sqrt() conditionally
Samuel Pitoiset [Fri, 17 Mar 2017 13:58:49 +0000 (14:58 +0100)]
st/glsl_to_tgsi: enable lower_sqrt() conditionally

It relies on the force_glsl_abs_sqrt driconf option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoglsl: lower sqrt(abs()) and inversesqrt(abs()) if requested
Samuel Pitoiset [Fri, 17 Mar 2017 13:58:22 +0000 (14:58 +0100)]
glsl: lower sqrt(abs()) and inversesqrt(abs()) if requested

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agodriconf: add force_glsl_abs_sqrt option
Samuel Pitoiset [Fri, 17 Mar 2017 00:06:54 +0000 (01:06 +0100)]
driconf: add force_glsl_abs_sqrt option

This will allow to force computing the absolute value for sqrt()
and inversesqrt() in order to follow D3D9 behaviour for buggy
apps that rely on it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoswr: [rasterizer jitter] fix llvm >= 5.0 build break
Tim Rowley [Tue, 21 Mar 2017 16:42:31 +0000 (11:42 -0500)]
swr: [rasterizer jitter] fix llvm >= 5.0 build break

Function::getArgumentList() doesn't exist anymore, switch to using
arg_begin() (existed back to at least llvm-3.6.0).

Reviewed-by: Vedran Miletić <vedran@miletic.net>
CC: <mesa-stable@lists.freedesktop.org>
7 years agoAndroid: drop Android 4.4 (KitKat) support
Rob Herring [Tue, 21 Mar 2017 18:51:20 +0000 (13:51 -0500)]
Android: drop Android 4.4 (KitKat) support

Any users of KitKat are likely using an older version of Mesa and
KitKat support adds complexity to the make files. Dropping support
allows removing the MESA_LOLLIPOP_BUILD make variable in various make
files.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: kill off {MESA_}ANDROID_VERSION defines aka Android 4.1 and older
Rob Herring [Tue, 21 Mar 2017 18:51:19 +0000 (13:51 -0500)]
Android: kill off {MESA_}ANDROID_VERSION defines aka Android 4.1 and older

The Android version defines are only needed for versions less than 4.2
which aren't really supported or tested.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: fix libz dependency for host targets
Rob Herring [Tue, 21 Mar 2017 18:51:18 +0000 (13:51 -0500)]
Android: fix libz dependency for host targets

Commit 6facb0c08fa1 ("android: fix libz dynamic library dependencies")
added libz as a dependency, but this breaks host targets as the host
dependency is libz-host. As no host lib needs libz, just remove the
dependency for them.

Fixes: 6facb0c08fa1 "android: fix libz dynamic library dependencies"
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: remove host libmesa_util
Rob Herring [Tue, 21 Mar 2017 18:51:17 +0000 (13:51 -0500)]
Android: remove host libmesa_util

The host libmesa_util is never used for Android builds, so remove it.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: clean-up trailing '\' in make variables
Rob Herring [Tue, 21 Mar 2017 18:51:16 +0000 (13:51 -0500)]
Android: clean-up trailing '\' in make variables

Fixed with the following command:

perl -pe 'BEGIN{undef $/;} s/ \\\n\n/\n\n/smg' $(find . -name 'Android.*')

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa/main: remove unused strndup.h include
Emil Velikov [Wed, 22 Mar 2017 16:56:41 +0000 (16:56 +0000)]
mesa/main: remove unused strndup.h include

No longer needed as of commit ac257f1070a ("glsl: calculate
TOP_LEVEL_ARRAY_SIZE and STRIDE when adding resources")

Reported-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoutil: automake: beautify sources list
Emil Velikov [Mon, 20 Mar 2017 16:04:42 +0000 (16:04 +0000)]
util: automake: beautify sources list

Remove trailing tabs and sort alphabetically.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoutil/strndup: move header inclusion as applicable
Emil Velikov [Mon, 20 Mar 2017 16:04:41 +0000 (16:04 +0000)]
util/strndup: move header inclusion as applicable

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoutil: inline strndup implementation in the header
Emil Velikov [Mon, 20 Mar 2017 16:04:41 +0000 (16:04 +0000)]
util: inline strndup implementation in the header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoutil: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:40 +0000 (16:04 +0000)]
util: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agomesa/program: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:39 +0000 (16:04 +0000)]
mesa/program: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agomesa/main: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:38 +0000 (16:04 +0000)]
mesa/main: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agointel/compiler: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:38 +0000 (16:04 +0000)]
intel/compiler: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agointel/common: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:37 +0000 (16:04 +0000)]
intel/common: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoi965: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:19 +0000 (16:04 +0000)]
i965: consistently use ifndef guards over pragma once

The only remaining case is the brw_oa.py generator which pipes the
generated file to stdout. That will be resolved with later commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agost/wgl: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:19 +0000 (16:04 +0000)]
st/wgl: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoegl/dri2: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:18 +0000 (16:04 +0000)]
egl/dri2: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agospirv: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:17 +0000 (16:04 +0000)]
spirv: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agonir: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:16 +0000 (16:04 +0000)]
nir: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:08 +0000 (16:04 +0000)]
glsl: consistently use ifndef guards over pragma once

Through the glsl headers we had an odd mix of guards be that
"ifndef", "pragma once" neither or both.

Simplify things by using the more common ones (ifndef) and annotating
all the sources, barring the generated builting header -
builtin_int64.h.

The final header - udivmod64.h - is [seemingly] unused and on its way
out (patch purge it is on the mailing list).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agocompiler: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:07 +0000 (16:04 +0000)]
compiler: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoradv: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:05 +0000 (16:04 +0000)]
radv: consistently use ifndef guards over pragma once

Namely: annotate the single file which is not using a ifndef guard -
vk_format.h

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoac: consistently use ifndef guards over pragma once
Emil Velikov [Mon, 20 Mar 2017 16:04:04 +0000 (16:04 +0000)]
ac: consistently use ifndef guards over pragma once

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoi965: make brw_setup_image_uniform_values static
Emil Velikov [Mon, 20 Mar 2017 16:04:03 +0000 (16:04 +0000)]
i965: make brw_setup_image_uniform_values static

Used only internally.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agodocs/releasing: do not pass any arguments to autogen.sh
Emil Velikov [Fri, 17 Mar 2017 18:17:14 +0000 (18:17 +0000)]
docs/releasing: do not pass any arguments to autogen.sh

This should just work (tm) with the default options. Plus the one we
pass is already the default, so just drop it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
7 years agomesa: more unused linux/version.h include
Emil Velikov [Thu, 16 Mar 2017 15:47:45 +0000 (15:47 +0000)]
mesa: more unused linux/version.h include

The header provides the LINUX_VERSION_CODE and KERNEL_VERSION macros.
With neither of which being used by any part of mesa.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoac: fix build with LLVM 5.0svn
Marek Olšák [Tue, 21 Mar 2017 22:15:05 +0000 (23:15 +0100)]
ac: fix build with LLVM 5.0svn

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agogallivm: remove lp_add_attr_dereferenceable in favor of amd/common
Marek Olšák [Tue, 21 Mar 2017 22:13:46 +0000 (23:13 +0100)]
gallivm: remove lp_add_attr_dereferenceable in favor of amd/common

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoanv/device: Move push descriptor query handling
Jason Ekstrand [Tue, 21 Mar 2017 21:36:08 +0000 (14:36 -0700)]
anv/device: Move push descriptor query handling

The query is a properties query so it needs to be handled in
GetPhysicalDeviceProperties2, not GetPhysicalDeviceFeatures2.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv/image: Return early when unbinding an image
Jason Ekstrand [Wed, 22 Mar 2017 00:16:46 +0000 (17:16 -0700)]
anv/image: Return early when unbinding an image

Found by inspection.

Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Cc: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
7 years agoutil/sha1: harmonize _mesa_sha1_* wrappers
Grazvydas Ignotas [Tue, 21 Mar 2017 23:43:34 +0000 (01:43 +0200)]
util/sha1: harmonize _mesa_sha1_* wrappers

Rather than using 3 different ways to wrap _mesa_sha1_*() to SHA1*()
functions (a macro, prototype with implementation in .c and an inline
function), make all 3 inline functions.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoanv: android: remove unused include/vulkan include
Emil Velikov [Mon, 20 Mar 2017 15:14:33 +0000 (15:14 +0000)]
anv: android: remove unused include/vulkan include

Spotted while skimming through similar hunks for the Autotools build.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
7 years agoanv: automake: use the local headers over any system provided ones
Emil Velikov [Mon, 20 Mar 2017 14:56:03 +0000 (14:56 +0000)]
anv: automake: use the local headers over any system provided ones

At the moment, we would honour any system headers - vulkan_intel.h in
particular over the ones in-tree.

Thus, if one does incremental build of mesa, without the vulkan.h
already installed (or at least not in the same directory as
vulkan_intel.h) the build will fail.

In the future we might want to upstream the vulkan_intel.h within
vulkan.h or use other ways to make vulkan_intel.h obsolete. In either
case, the more robust thing is to rely on our own copy.

v2: Move AM_CPPFLAGS just above LIBDRM_CFLAGS (Grazvydas, Jason)

Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Fixes: ee8044fd "intel/vulkan: Get rid of recursive make"
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reported-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa/main: fix MultiDrawElements[BaseVertex] validation of primcount
Nicolai Hähnle [Wed, 22 Feb 2017 13:00:29 +0000 (14:00 +0100)]
mesa/main: fix MultiDrawElements[BaseVertex] validation of primcount

primcount must be a GLsizei as in the signature for MultiDrawElements
or bad things can happen.

Furthermore, an error should be flagged when primcount is negative.

Curiously, this code used to work somewhat correctly even when primcount
was negative, because the loop that checks count[i] would iterate out of
bounds and almost certainly hit a negative value at some point.

Found by an ASAN error in
GL45-CTS.gtf32.GL3Tests.draw_elements_base_vertex.draw_elements_base_vertex_primcount

Note that the OpenGL spec seems to have s/primcount/drawcount/ at some
point, and the code still reflects the old language.

v2: provide the correct spec quotes (pointed out by Ian)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agomesa: Avoid out-of-bounds stack read via _mesa_Materiali
Nicolai Hähnle [Wed, 22 Feb 2017 17:06:46 +0000 (18:06 +0100)]
mesa: Avoid out-of-bounds stack read via _mesa_Materiali

MATERIALFV may end up reading up to 4 floats from the passed parameter.

This should really set a GL_INVALID_ENUM error in the cases where it
matters, but does anybody really care?

Found by ASAN in piglit gl-1.0-beginend-coverage.

v2: fix a trivial compiler warning

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
7 years agoconfigure.ac: Do not strip away space after regex word match.
Vinson Lee [Wed, 22 Mar 2017 07:27:15 +0000 (00:27 -0700)]
configure.ac: Do not strip away space after regex word match.

Fixes: 62c48ccb413b ("configure.ac: Use POSIX compatible regex for word boundary.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
7 years agoconfigure.ac: Use POSIX compatible regex for word boundary.
Vinson Lee [Thu, 16 Mar 2017 22:26:18 +0000 (15:26 -0700)]
configure.ac: Use POSIX compatible regex for word boundary.

Fixes build error on Mac OS X.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100236
Suggested-by: Jan Beich <jbeich@freebsd.org>
Suggested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoisl: Refactor row pitch calculation (v2)
Chad Versace [Sat, 25 Feb 2017 00:23:02 +0000 (16:23 -0800)]
isl: Refactor row pitch calculation (v2)

The calculations of row_pitch, the row pitch's alignment, surface size,
and base_alignment were mixed together. This patch moves the calculation
of row_pitch and its alignment to occur before the calculation of
surface_size and base_alignment.

This simplifies a follow-on patch that adds a new member, 'row_pitch',
to struct isl_surf_init_info.

v2:
  - Also extract the row pitch alignment.
  - More helper functions that will later help validate the row pitch.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
7 years agoisl: Drop misplaced comment about padding
Chad Versace [Fri, 10 Mar 2017 23:13:16 +0000 (15:13 -0800)]
isl: Drop misplaced comment about padding

isl has a giant comment that explains the hardware's padding
requirements. (Hint: Cache lines and page faults). But the comment is in
the wrong place, in isl_calc_linear_row_pitch(), which is unrelated to
padding.

The important parts of that comment were copied to
isl_apply_surface_padding() long ago. So drop the misplaced comment.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Turn on support for image modifiers
Ben Widawsky [Sat, 18 Mar 2017 18:56:31 +0000 (11:56 -0700)]
i965/dri: Turn on support for image modifiers

All the plumbing is in place so the extension just needs to be
advertised.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Handle X-tiled modifier
Ben Widawsky [Mon, 2 Jan 2017 23:01:54 +0000 (15:01 -0800)]
i965/dri: Handle X-tiled modifier

This doesn't really "do" anything because the default tiling for the
winsys buffer is X tiled. We do however want the X tiled modifier to
work correctly from the API perspective, which would imply that if you
set this modifier, and later do a get_modifier, you get back at least X
tiled.

Running with a modified kmscube, here are the bandwidth measurements.

Linear:
Read bandwidth: 1039.31 MiB/s
Write bandwidth: 1453.56 MiB/s

Y-tiled:
Read bandwidth: 458.29 MiB/s
Write bandwidth: 542.12 MiB/s

X-tiled:
Read bandwidth: 575.01 MiB/s
Write bandwidth: 606.25 MiB/s

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Handle Y-tiled modifier
Ben Widawsky [Fri, 4 Nov 2016 19:34:40 +0000 (12:34 -0700)]
i965/dri: Handle Y-tiled modifier

This patch begins introducing how we'll actually handle the potentially
many modifiers coming in from the API, how we'll store them, and the
structure in the code to support it.

Prior to this patch, the Y-tiled modifier would be entirely ignored. It
shouldn't actually be used until this point because we've not bumped the
DRIimage extension version (which is a requirement to use modifiers).

Measuring later in the series with kmscube:
Linear:
Read bandwidth: 1048.44 MiB/s
Write bandwidth: 1483.17 MiB/s

Y-tiled:
Read bandwidth: 471.13 MiB/s
Write bandwidth: 589.10 MiB/s

Similar functionality was introduced and then reverted here:

commit 6a0d036483caf87d43ebe2edd1905873446c9589
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Apr 21 20:14:58 2016 -0700

    i965: Always use Y-tiled buffers on SKL+

v2: Use last set bit instead of first set bit in modifiers to address
bug found by Daniel Stone.

v3: Use the new priority modifier selection thing. This nullifies the
bug fixed by v2 also.

v4: Get rid of modifier compaction which originally served another
purpose and now serves none (Jason)

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Handle the linear fb modifier
Ben Widawsky [Fri, 13 Jan 2017 20:01:37 +0000 (12:01 -0800)]
i965/dri: Handle the linear fb modifier

At image creation create a path for dealing with the linear modifier.
This works exactly like the old usage flags where __DRI_IMAGE_USE_LINEAR
was specified.

During development of this patch series, it was decided that a lack of
modifier was an insufficient way to express the required modifiers. As a
result, 0 was repurposed to mean a modifier for a LINEAR layout.

NOTE: This patch was added for v3 of the patch series.

v2: Rework the algorithm for modifier selection to go from a bitmask
based selection to this priority value.

v3: Make DRM_FORMAT_MOD_INVALID allowed at selection as a way of
identifying no modifiers found (because 0 is LINEAR) (Jason)

v4: Remove the logic to prune unknown modifiers (like those from other
vendors) and simply handle is in select_best_modifier (Jason)

Requested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Enable modifier queries
Ben Widawsky [Fri, 17 Mar 2017 20:29:08 +0000 (13:29 -0700)]
i965/dri: Enable modifier queries

New to the patch series after reordering things for landing smaller
chunks.

This will essentially enable modifiers from clients that were just
enabled in previous patches. A client could use the modifiers by
setting all of them at create, but had no way to actually query them
after creating the surface (ie. stupid clients could be broken before
this patch, but in more ways than this).

Obviously, there are no modifiers being actually stored yet - so this
patch shouldn't do anything other than allow the API to get back 0 (or
the LINEAR modifier).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Store the screen associated with the image
Ben Widawsky [Thu, 20 Oct 2016 21:51:53 +0000 (14:51 -0700)]
i965/dri: Store the screen associated with the image

I intend to need to get to the devinfo structure, and storing the screen
is an easy way to do that.

It seems to be the consensus that you cannot share an image between
multiple screens.

Scape-goat: Rob Clark <robdclark@gmail.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agogbm: Disallow INVALID modifiers returned upon image creation
Ben Widawsky [Tue, 21 Mar 2017 18:59:51 +0000 (11:59 -0700)]
gbm: Disallow INVALID modifiers returned upon image creation

v2: Add a TODO about modifier validation (Jason)

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965/dri: Disallow image with INVALID modifier
Ben Widawsky [Tue, 21 Mar 2017 18:59:33 +0000 (11:59 -0700)]
i965/dri: Disallow image with INVALID modifier

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>