mesa.git
6 years agonir: fix condition propagation when src has a swizzle
Timothy Arceri [Fri, 2 Nov 2018 11:10:36 +0000 (22:10 +1100)]
nir: fix condition propagation when src has a swizzle

We cannot use nir_build_alu() to create the new alu as it has no
way to know how many components of the src we will use. This
results in it guessing the max number of components from one of
its inputs.

Fixes the following CTS tests:

dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_frag
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_geom
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_tessc
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_vert

Fixes: 2975422ceb6c ("nir: propagates if condition evaluation down some alu chains")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoandroid: gallium/auxiliary: add include to get u_debug.h header
Mauro Rossi [Wed, 31 Oct 2018 14:53:21 +0000 (15:53 +0100)]
android: gallium/auxiliary: add include to get u_debug.h header

To avoid build error in u_debug_stack_android.cpp
due to now missing u_debug.h header:

external/mesa/src/gallium/auxiliary/util/u_debug_stack_android.cpp:26:10:
fatal error: 'u_debug.h' file not found
#include "u_debug.h"
         ^
1 error generated.

Fixes: 37db383abb ("util: Move u_debug to utils")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agovirgl/vtest-winsys: Use virgl version of bind flags
Gert Wollny [Thu, 1 Nov 2018 09:49:58 +0000 (10:49 +0100)]
virgl/vtest-winsys: Use virgl version of bind flags

The bind flags defined by mesa/gallium might not always be in sync
with the ones copied to virglrenderer/gallium. Therefore, use the
flags defined in virgl like it is done for all the other calls to
create resources.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agomesa/st: Add support for EXT_texture_sRGB_R8
Gert Wollny [Thu, 1 Nov 2018 11:59:26 +0000 (12:59 +0100)]
mesa/st: Add support for EXT_texture_sRGB_R8

This only adds support on the Gallium core level, for the drivers
it is likely that additional changes are needed to support the
new texture format and thereby enabling the extension.

Enables on softpipe and makes pass:
  dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.*

v2: - add include for getting GL_SR8_EXT
v4: - since the extension is not required don't bother providing
      a fallback (Ilia Mirkin)
    - split patch (2/2) to separate Gallium and mesa/st parts
      (Roland Scheidegger)
    - trim commit message to only contain the history of the patch
      relevant to this part
v5: - don't include GLES headers (required enum has been added to glheader.h)
      (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agoGallium: Add format PIPE_FORMAT_R8_SRGB
Gert Wollny [Thu, 1 Nov 2018 11:59:25 +0000 (12:59 +0100)]
Gallium: Add format PIPE_FORMAT_R8_SRGB

This format is needed to support EXT_texture_sRGB_R8. THe patch adds a new
format enum, the format entries in Gallium and and svga, the mapping between
sRGB and linear formats, and tests.

  v2: - add mapping to linear format for PIPE_FORMATR_R8_SRGB
  v3: - Add texture format to svga format table since otherwise building
        mesa will fail when this driver is enabled. It was not tested
        whether the extension actually works.
  v4: - svga: remove the SVGA specific format definitions and table entries
        and only add correct the location of PIPE_FORMAT_R8_SRGB in the
        format_conversion_table (Ilia Mirkin)
      - Split patch (1/2) to separate Gallium part and mesa/st part.
        (Roland Scheidegger)
      - Trim the commit message to only contain the relevant parts from the
        split.
  v5: - svga: correct location of PIPE_FORMAT_SRGB_R8 (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agomesa/core: Add definitions and translations for EXT_texture_sRGB_R8
Gert Wollny [Thu, 1 Nov 2018 11:59:24 +0000 (12:59 +0100)]
mesa/core: Add definitions and translations for EXT_texture_sRGB_R8

v2: - fix format definition line
    - disable  for desktop GL
    - don't add GL_R8_EXT to glext.h since it is already in
      GLES2/gl2ext.h in glext.h and include this header  where needed
      (all Emil)
v3: - swrast: Fill the function table for sRGB_R8
      The size of the function table is checked at compile time and must
      correspond to the number of mesa texture formats.
      dri/swrast being gles-2.0 doesn't support the extension though
v4: - correct format layout comment (Ilia Mirkin)
    - correct logic for accepting GL_RED only textures (in part Ilia Mirkin)
      EXT_texture_sRGB_R8 requires OpenGL ES 3.0 which includes
      ARB_texture_rg/EXT_texture_rg, so one only must check for the first
      when SR8_EXT is really requested.
v5: - add define for GL_ES8_XT to glheader.h and don't include GLES
      headers  (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agoglsl: do not allow implicit casts of unsized array initializers
Erik Faye-Lund [Thu, 25 Oct 2018 19:33:52 +0000 (21:33 +0200)]
glsl: do not allow implicit casts of unsized array initializers

The GLSL 4.6 specification (section 4.1.14. "Implicit Conversions")
says:

  "There are no implicit array or structure conversions. For
   example, an array of int cannot be implicitly converted to an
   array of float."

So let's add a check in place when assigning array initializers to
implicitly sized arrays, to avoid incorrectly allowing code on the
form:

int[] foo = float[](1.0, 2.0, 3.0)

This fixes the following dEQP test-cases:
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_fragment

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agomesa/glsl: add support for EXT_shader_implicit_conversions
Erik Faye-Lund [Thu, 25 Oct 2018 14:40:13 +0000 (16:40 +0200)]
mesa/glsl: add support for EXT_shader_implicit_conversions

EXT_shader_implicit_conversions adds support for implicit conversions
for GLES 3.1 and above.

This is essentially a subset of ARB_gpu_shader5, and augments
OES_gpu_shader5.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoglsl: fall back to inexact function-match
Erik Faye-Lund [Tue, 30 Oct 2018 14:15:58 +0000 (15:15 +0100)]
glsl: fall back to inexact function-match

In GLES, we currently either need an exact match with a local function,
or an exact match with a builtin.

However, if we add support for implicit conversions for GLES shaders,
we also need to fall back to a non-exact match in the case where there
were no builtin match either.

Luckily, we already have a variable ready with this, so let's just
return it if the builtin-search failed.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoglsl: add has_implicit_uint_to_int_conversion()-helper
Erik Faye-Lund [Thu, 25 Oct 2018 14:01:00 +0000 (16:01 +0200)]
glsl: add has_implicit_uint_to_int_conversion()-helper

This makes the code a bit easier to read, as well as reduces repetition,
especially when we add support for EXT_shader_implicit_conversions.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoglsl: add has_implicit_conversions()-helper
Erik Faye-Lund [Thu, 25 Oct 2018 14:00:14 +0000 (16:00 +0200)]
glsl: add has_implicit_conversions()-helper

This makes the code a bit easier to read, as well as will reduce
repetition when we add support for EXT_shader_implicit_conversions.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agomesa: Remove needless indirection in some draw functions.
Mathias Fröhlich [Thu, 1 Nov 2018 06:25:42 +0000 (07:25 +0100)]
mesa: Remove needless indirection in some draw functions.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agonir: allow propagation of if evaluation for bcsel
Timothy Arceri [Thu, 1 Nov 2018 21:53:16 +0000 (08:53 +1100)]
nir: allow propagation of if evaluation for bcsel

Shader-db results Skylake:

total instructions in shared programs: 13109035 -> 13109024 (<.01%)
instructions in affected programs: 4777 -> 4766 (-0.23%)
helped: 11
HURT: 0

total cycles in shared programs: 332090418 -> 332090443 (<.01%)
cycles in affected programs: 19474 -> 19499 (0.13%)
helped: 6
HURT: 4

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoradv: fix begin/end transform feedback with 0 counter buffers.
Dave Airlie [Wed, 31 Oct 2018 23:55:29 +0000 (23:55 +0000)]
radv: fix begin/end transform feedback with 0 counter buffers.

If the user gives 0 counterBuffers then the driver should still
enable transform feedback on all targets. This changes the
driver to always enable xfb, and use counter buffers where
one is defined for the target in question.

Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoradv: apply xfb buffer offset at buffer binding time not later. (v2)
Dave Airlie [Wed, 31 Oct 2018 23:38:20 +0000 (23:38 +0000)]
radv: apply xfb buffer offset at buffer binding time not later. (v2)

In order to handle pause/resume properly, the offset should
be added to the buffer binding not to the begin/end paths.

v2: don't add offset to size
Fixes ext_transform_feedback-alignment* under zink

Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoRevert "i965/batch: avoid reverting batch buffer if saved state is an empty"
Mark Janes [Thu, 1 Nov 2018 22:44:45 +0000 (15:44 -0700)]
Revert "i965/batch: avoid reverting batch buffer if saved state is an empty"

This reverts commit a9031bf9b55602d93cccef6c926e2179c23205b4.

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

6 years agovc4: Drop the winsys_stride relayout in the simluator
Eric Anholt [Thu, 1 Nov 2018 21:34:02 +0000 (14:34 -0700)]
vc4: Drop the winsys_stride relayout in the simluator

Since 0c1dd9dee0da ("broadcom/vc4: Allow importing linear BOs with
arbitrary offset/stride."), we have the vc4-side BO properly laid out
(assuming it's linear) in the winsys BO so that we can skip this extra
copy.

6 years agov3d: Update the TLB config for depth writes on V3D 4.2.
Eric Anholt [Tue, 30 Oct 2018 19:17:00 +0000 (12:17 -0700)]
v3d: Update the TLB config for depth writes on V3D 4.2.

Fixes 311 piglit cases on the simulator.

6 years agov3d: Use the TLB R/B swapping instead of recompiles when available.
Eric Anholt [Mon, 10 Sep 2018 15:19:48 +0000 (08:19 -0700)]
v3d: Use the TLB R/B swapping instead of recompiles when available.

The recompile reduction is nice, but this also makes it so that a straight
texture copy could get optimized some day to not unpack/repack the f16
values.

6 years agov3d: Take advantage of _mesa_hash_table_remove_key() in the simulator.
Eric Anholt [Thu, 1 Nov 2018 19:22:05 +0000 (12:22 -0700)]
v3d: Take advantage of _mesa_hash_table_remove_key() in the simulator.

6 years agov3d: Respect user-passed strides for BO imports.
Eric Anholt [Thu, 1 Nov 2018 19:15:25 +0000 (12:15 -0700)]
v3d: Respect user-passed strides for BO imports.

If the caller has passed in a stride for (linear) BO import, we should use
that stride when rendering to the BO (or, if we some day support texturing
from linear-imported BOs, when doing the linear-to-UIF shadow copy).  This
lets us remove the extra stride-changing relayout in the simulator.

6 years agov3d: Drop #if 0-ed out v3d_dump_to_file().
Eric Anholt [Thu, 1 Nov 2018 19:04:33 +0000 (12:04 -0700)]
v3d: Drop #if 0-ed out v3d_dump_to_file().

This came from vc4, where we had a file format for GPU hangs.  I don't
have one of those for V3D, and I probably won't ever have the simulator
side produce dumps even if I do.

6 years agov3d: Fix a typo in a comment in job handling.
Eric Anholt [Thu, 1 Nov 2018 18:57:40 +0000 (11:57 -0700)]
v3d: Fix a typo in a comment in job handling.

6 years agov3d: Fix a copy-and-paste comment in the simulator code.
Eric Anholt [Thu, 1 Nov 2018 18:42:18 +0000 (11:42 -0700)]
v3d: Fix a copy-and-paste comment in the simulator code.

6 years agoanv/icl: Set Error Detection Behavior Control Bit in L3CNTLREG
Anuj Phogat [Fri, 12 Oct 2018 21:12:50 +0000 (14:12 -0700)]
anv/icl: Set Error Detection Behavior Control Bit in L3CNTLREG

The default setting of this bit is not the desirable behavior.
WA_1406697149

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoi965/icl: Set Error Detection Behavior Control Bit in L3CNTLREG
Anuj Phogat [Tue, 2 Oct 2018 16:10:04 +0000 (09:10 -0700)]
i965/icl: Set Error Detection Behavior Control Bit in L3CNTLREG

The default setting of this bit is not the desirable behavior.
WA_1406697149

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agodocs: add 19.0.0-devel release notes template
Emil Velikov [Thu, 1 Nov 2018 18:56:54 +0000 (18:56 +0000)]
docs: add 19.0.0-devel release notes template

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomesa: bump version to 19.1.0-devel
Emil Velikov [Thu, 1 Nov 2018 18:50:49 +0000 (18:50 +0000)]
mesa: bump version to 19.1.0-devel

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: don't install translation files
Dylan Baker [Thu, 1 Nov 2018 16:02:39 +0000 (09:02 -0700)]
meson: don't install translation files

Tested-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 7834926a4f5ca0a60ec3d18c87a1e0a68b615820
       ("meson: add support for generating translation mo files")

6 years agoegl: use the LC_ALL hammer instead of LANG
Eric Engestrom [Thu, 1 Nov 2018 16:40:28 +0000 (16:40 +0000)]
egl: use the LC_ALL hammer instead of LANG

Some environment (like Travis apparently) set LC_* vars, messing up the
sort ordering, so let's use envvar with the highest priority to make
sure this is actually sorted in ASCII order.

Suggested-by: Michel Dänzer <michel@daenzer.net>
Fixes: b42dc50a5f1b22103b26 "egl: fix entrypoint sorting test"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
6 years agoegl: fix entrypoint sorting test
Eric Engestrom [Thu, 1 Nov 2018 15:33:35 +0000 (15:33 +0000)]
egl: fix entrypoint sorting test

Fixes: 68dc591af16ebb36814e "egl: Fix eglentrypoint.h sort order."
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agointel/tools: fix resource leak
Andrii Simiklit [Fri, 26 Oct 2018 14:29:34 +0000 (17:29 +0300)]
intel/tools: fix resource leak

Some memory and file descriptors are not freed/closed.

v2: fixed case where we skipped the 'aub' variable initialization

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agointel/tools: include stdarg.h in error2aub
Jonathan Gray [Thu, 1 Nov 2018 04:07:32 +0000 (15:07 +1100)]
intel/tools: include stdarg.h in error2aub

Include stdarg.h in error2aub.c otherwise it fails to build on
OpenBSD due to not finding definitions for va_list va_start va_end.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoegl: Fix eglentrypoint.h sort order.
Mathias Fröhlich [Thu, 1 Nov 2018 06:23:06 +0000 (07:23 +0100)]
egl: Fix eglentrypoint.h sort order.

Fixes a make check failure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108617
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoradv: set PA_SU_PRIM_FILTER_CNTL optimally
Samuel Pitoiset [Mon, 29 Oct 2018 10:37:03 +0000 (11:37 +0100)]
radv: set PA_SU_PRIM_FILTER_CNTL optimally

Ported from RadeonSI. It's always TRUE for CIK+ because RADV
doesn't support 16 samples.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: only enable gl_SampleMask if MSAA is enabled too
Samuel Pitoiset [Mon, 29 Oct 2018 10:37:02 +0000 (11:37 +0100)]
radv: only enable gl_SampleMask if MSAA is enabled too

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: use radeon_info::num_good_cu_per_sh
Samuel Pitoiset [Mon, 29 Oct 2018 10:37:01 +0000 (11:37 +0100)]
radv: use radeon_info::num_good_cu_per_sh

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoac/nir: make use of i1false in few more places
Samuel Pitoiset [Mon, 29 Oct 2018 16:05:15 +0000 (17:05 +0100)]
ac/nir: make use of i1false in few more places

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: add support for Raven2
Samuel Pitoiset [Tue, 30 Oct 2018 10:52:37 +0000 (11:52 +0100)]
radv: add support for Raven2

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agomesa: Collect all the draw functions in draw.{h,c}.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:20 +0000 (06:13 +0100)]
mesa: Collect all the draw functions in draw.{h,c}.

Some of these functions were distributed across different
implementation and header files. Put them at a central place.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agomesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirect
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:20 +0000 (06:13 +0100)]
mesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirect

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agomesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:20 +0000 (06:13 +0100)]
mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c

The array type draw is no longer directly dependent on the vbo module.
Thus move array type draws into mesa/main/draw.c.
Rename symbols starting with vbo_* to _mesa_* and apply some
reindenting to make it consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Pull the _mesa_set_draw_vao calls out of the if clauses.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Pull the _mesa_set_draw_vao calls out of the if clauses.

These calls are just the same in each if branch. So pull that
before the if.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Preserve vbo_save::no_current_update on primitive restart.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Preserve vbo_save::no_current_update on primitive restart.

With this change we preserve the no_current_update property when we
observe a glPrimitiveRestart call. That means that we now also get the
no_current_update optimization for display lists that are made
out of indexed draws using primitive restart.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Make no_current_update an argument to vbo_save_NotifyBegin.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Make no_current_update an argument to vbo_save_NotifyBegin.

Instead of coding additional information into the primitive
mode, make the only remaining flag there a direct argument to
vbo_save_NotifyBegin.

v2: Fix incorrect no_current_update in glRectf.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Move no_current_update out of _mesa_prim.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Move no_current_update out of _mesa_prim.

The _mesa_prim::no_current_update flag should tell the compiled
display list if the current attributes that are placed in the dlists
vbo shall take a defined state past replay of a display list.
Immediate mode draws compiled into display lists should set the
current values. Array draws may leave the current values in
undefined state.
So finally this flag is not a property of every primitive
but it is a property of the compiled display list and there it
is a property of the last primitive compiled into the list.
So move the flag out of _mesa_prim into vbo_save.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove the now unused VBO_SAVE_PRIM_WEAK define.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove the now unused VBO_SAVE_PRIM_WEAK define.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove the always false branch dlist replay.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove the always false branch dlist replay.

The previous patch left a constant if (0) in the code.
Clean that up now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Test for VBO_SAVE_PRIM_WEAK in _mesa_prim::mode is false.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Test for VBO_SAVE_PRIM_WEAK in _mesa_prim::mode is false.

When setting the _mesa_prim::mode field we always filter out
all non OpenGL primitive mode bits. So this tested bit cannot be
there anymore and the test evaluates to zero.
The zero is removed with the next patch to ease review.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove VBO_SAVE_PRIM_WEAK from vbo_save_NotifyBegin calls.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove VBO_SAVE_PRIM_WEAK from vbo_save_NotifyBegin calls.

Now looking at the implementation of vbo_save_NotifyBegin.
The VBO_SAVE_PRIM_WEAK flag, delivered in the primitive mode
argument to vbo_save_NotifyBegin, is not evaluated anymore.
The two users of the mode argument are the primitive mode
itself, where the VBO_SAVE_PRIM_WEAK bit is masked out to
retrieve the underlying OpenGL primitive mode. The other
user is to check for the VBO_SAVE_PRIM_NO_CURRENT_UPDATE bit
which is different from VBO_SAVE_PRIM_WEAK.
So, since vbo_save_NotifyBegin does not care about
VBO_SAVE_PRIM_WEAK, we can savely remove it from the call
arguments of vbo_save_NotifyBegin.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove set but not used weak field from _mesa_prim.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove set but not used weak field from _mesa_prim.

The only reader of the weak field in _mesa_prim is pretty
console printing. By that, remove the weak field from _mesa_prim.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove the VBO_SAVE_FALLBACK flag.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove the VBO_SAVE_FALLBACK flag.

On finishing a display list playback the VBO_SAVE_FALLBACK bit
is still kept in vbo_save_context::replay_flags. But examining
replay_flags and the display list flags that feed this value
the corresponding bit is never set these days anymore.
So, since it is nowhere set or checked, we can safely remove it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agovbo: Remove unused vbo_save_fallback function.
Mathias Fröhlich [Mon, 29 Oct 2018 05:13:19 +0000 (06:13 +0100)]
vbo: Remove unused vbo_save_fallback function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agodocs/relnotes: add the EGL Device extensions
Emil Velikov [Wed, 31 Oct 2018 21:36:16 +0000 (21:36 +0000)]
docs/relnotes: add the EGL Device extensions

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: egl: group dri2 bits separately from haiku
Emil Velikov [Sat, 18 Aug 2018 12:23:11 +0000 (13:23 +0100)]
meson: egl: group dri2 bits separately from haiku

One cannot have haiku and dri2 - surfaceless,x11,etc.

Group things up, which will make the addition of platform_device a bit
easier.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agoegl: enable EGL_EXT_device_{base,enumeration,query}
Emil Velikov [Mon, 3 Sep 2018 17:48:29 +0000 (18:48 +0100)]
egl: enable EGL_EXT_device_{base,enumeration,query}

Now that we support the extensions, fully, enabled them.

The specs mandate that we always have at least one device and each dpy
has a device associated with it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoegl: set the EGLDevice when creating a display
Emil Velikov [Tue, 4 Sep 2018 10:20:03 +0000 (11:20 +0100)]
egl: set the EGLDevice when creating a display

This is the final requirement from the base EGLDevice spec.

v2:
 - split from another patch
 - move wayland hunk after we have the fd

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoegl: add EGL_EXT_device_drm support
Emil Velikov [Wed, 4 Jul 2018 16:21:16 +0000 (17:21 +0100)]
egl: add EGL_EXT_device_drm support

Add implementation based around the drmDevice API. As such it's only
available only when building with libdrm. With the latter already a
requirement when using !SW code paths in the platform code.

Note: the current code will work if a device is hot-plugged. Yet
hot-unplugged is not implemented, since I have no ways of testing it.

v2:
 - ddd some _eglDeviceSupports checks
 - require DRM_NODE_RENDER
 - add _eglGetDRMDeviceRenderNode helper

v3:
 - flip inverted asserts (Mathias)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoegl: add EGL_MESA_device_software support
Emil Velikov [Tue, 3 Jul 2018 12:08:59 +0000 (13:08 +0100)]
egl: add EGL_MESA_device_software support

Add a plain software device, which is always available.

We can safely assign it as the first/initial device in _eglGlobals,
although we ensure that's the case with a handful of _eglDeviceSupports
checks throughout the code.

v2:
 - s/_eglFindDevice/_eglAddDevice/ (Eric)
 - s/_eglLookupAllDevices/_eglRefreshDeviceList/ (Eric)
 - move ^^ helpers into a earlier patch (Eric, Mathias)
 - set the SW device on _eglGlobal init. (Eric)
 - add a number of _eglDeviceSupports checks (Mathias)
 - split Device/Display attach to a separate patch

v3:
 - flip inverted asserts (Mathias)
 - s/on-stack/static/ (Mathias)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agospecs: Add EGL_MESA_device_software
Adam Jackson [Wed, 2 Aug 2017 20:24:06 +0000 (16:24 -0400)]
specs: Add EGL_MESA_device_software

The device extension string is expected to contain the name of the
extension defining what kind of device it is, so the caller can know
what kinds of operations it can perform with it. So that string had
better be non-empty, hence this trivial extension.

v2:
 - drop "fallback", update history and update contributor list

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoegl: add base EGL_EXT_device_base implementation
Emil Velikov [Fri, 24 Jul 2015 14:19:55 +0000 (16:19 +0200)]
egl: add base EGL_EXT_device_base implementation

Introduce the API for device query and enumeration. Those at the moment
produce nothing useful since zero devices are actually available.

That contradicts with the spec, so the extension isn't advertised just
yet.

With later commits we'll add support for software (always) and hardware
devices. Each one exposing the respective extension string.

v2:
 - fold API boilerplate into this patch
 - move _eglAddDevice, _eglDeviceSupports, _eglRefreshDeviceList to this
patch (Eric, Mathias)
 - make _eglFiniDevice the one called last

v3:
 - comment on the dummy _egl_device_extension enum entry (Eric)
 - annotate dev as MAYBE_UNUSED (Mathias)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
6 years agoglx: be explicit about when mapping X <> GLX visuals
Emil Velikov [Thu, 6 Sep 2018 10:25:38 +0000 (11:25 +0100)]
glx: be explicit about when mapping X <> GLX visuals

Write down both X and GLX visual types when mapping from one to the
other. Makes grepping through the code a tiny bit easier.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agoglx: remove unused __glXPreferEGL() declaration
Emil Velikov [Tue, 4 Sep 2018 16:34:43 +0000 (17:34 +0100)]
glx: remove unused __glXPreferEGL() declaration

The function definition is no longer around, drop the useless declaration.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agotravis: use mako for python2
Emil Velikov [Wed, 31 Oct 2018 21:54:49 +0000 (21:54 +0000)]
travis: use mako for python2

Earlier commit flipped the default to python2 but forgot to update the
travis file. Props to pip caching things "worked" for a little while.

Fixes: f22ad5ef182 ("travis: use python3 for the autoconf builds")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoradv/xfb: don't increase offset by component mask start.
Dave Airlie [Wed, 31 Oct 2018 02:56:09 +0000 (02:56 +0000)]
radv/xfb: don't increase offset by component mask start.

This is incorrect, the offset is into the buffer, and it's legal
to write

loc 0,0 -> buffer0, offset 0
loc 0,1 -> buffer1, offset 0

This fixes a bunch of piglits running on my zink xfb code on
radv.

Fixes: 6c21645046 (radv: emit stream outputs for vertex and tessellation stages)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoutil/gen_xmlpool: Make use of python's foreach loop
Dylan Baker [Wed, 24 Oct 2018 19:34:33 +0000 (12:34 -0700)]
util/gen_xmlpool: Make use of python's foreach loop

Instead of using a while loop with indexing. This is much cleaner. This
requires some other small changes.

Acked-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: Don't use len to test for container emptiness
Dylan Baker [Wed, 24 Oct 2018 19:30:03 +0000 (12:30 -0700)]
util/gen_xmlpool: Don't use len to test for container emptiness

This is a very common python anti-pattern. Not using length allows us to
go through faster C paths, but has the same meaning.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: Don't write via shell redirection
Dylan Baker [Wed, 24 Oct 2018 19:20:48 +0000 (12:20 -0700)]
util/gen_xmlpool: Don't write via shell redirection

Using shell redirection to write to a file is more complicated than
necessary, and has the potential to run into unicode encoding problems.
It's also less code.

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

v2: - update commit message to say less about LANG=C
    - use flags instead of positional arguments for the script (Emil)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: use with statement to open file
Dylan Baker [Wed, 24 Oct 2018 19:08:38 +0000 (12:08 -0700)]
util/gen_xmlpool: use with statement to open file

Which ensures it is closed at the end of the scope.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: use a main function
Dylan Baker [Wed, 24 Oct 2018 19:05:56 +0000 (12:05 -0700)]
util/gen_xmlpool: use a main function

Again, just good style

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: Use print function instad of sys.stderr.write
Dylan Baker [Wed, 24 Oct 2018 19:02:41 +0000 (12:02 -0700)]
util/gen_xmlpool: Use print function instad of sys.stderr.write

This ensures that stderr is flushed, unlike writing

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: Use more standard style
Dylan Baker [Wed, 24 Oct 2018 18:56:49 +0000 (11:56 -0700)]
util/gen_xmlpool: Use more standard style

gen_xmlpool uses a style unlike the rest of mesa, spaces between
function/method calls and the parens, strange whitespace to force lining
up method calls, and some other whitespace stuff. Since I'm going to be
doing some work in the file, I'm going to start cleaning those up.

Acked-by: Emil Velikov <emil.velikov@collabora.com>
6 years agodocs/meson: Add note about update translations
Dylan Baker [Tue, 23 Oct 2018 02:33:08 +0000 (19:33 -0700)]
docs/meson: Add note about update translations

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/xmlpool: Update for meson generation
Dylan Baker [Fri, 24 Aug 2018 13:49:55 +0000 (06:49 -0700)]
util/xmlpool: Update for meson generation

Meson won't put the .gmo files in the layout that python's
gettext.translation() expects, it puts them in the build directory in a
flat layout. This modifies android and autotools to do the same (scons
doesn't work with translations at all)

v3: - Squash 4 patches into this patch

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: add support for generating translation mo files
Dylan Baker [Fri, 24 Aug 2018 12:56:01 +0000 (05:56 -0700)]
meson: add support for generating translation mo files

Meson has handy a handy built-in module for handling gettext called
i18n, this module works a bit differently than our autotools build does,
namely it doesn't automatically generate translations instead it creates
3 new top level targets to run. These are:

xmlpool-pot
xmlpool-update-po
xmlpool-gmo

v2: - Add new files to autotools dist tarball

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoutil/gen_xmlpool: use argparse for argument handling
Dylan Baker [Fri, 24 Aug 2018 13:28:41 +0000 (06:28 -0700)]
util/gen_xmlpool: use argparse for argument handling

This is a little cleaner than just looking at sys.argv, but it's also
going to allow us to handle the differences in the way meson and
autotools handle translations more cleanly.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agonir: fix if condition propagation for alu use
Timothy Arceri [Wed, 31 Oct 2018 02:16:28 +0000 (13:16 +1100)]
nir: fix if condition propagation for alu use

We need to update the cursor before we check if the alu use is
dominated by the if condition. Previously we were checking if
the current location of the alu instruction was dominated by
the if condition which would miss some optimisation opportunities.

Fixes: a3b4cb34589e ("nir/opt_if: Rework condition propagation")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agofreedreno: Do not link ir3_compiler with valgrind libraries.
Vinson Lee [Wed, 31 Oct 2018 18:50:48 +0000 (11:50 -0700)]
freedreno: Do not link ir3_compiler with valgrind libraries.

This patch fixes this freedreno autotools build error.

  CXXLD    ir3_compiler
/usr/lib/valgrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-m_main.o): In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
/usr/bin/ld: /usr/lib/valgrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-m_main.o): relocation R_X86_64_32S against undefined symbol `vgPlain_interim_stack' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/lib/valgrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-m_trampoline.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/lib/valgrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-dispatch-amd64-linux.o): relocation R_X86_64_32S against symbol `vgPlain_stats__n_xindirs_32' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

Fixes: f3cc0d274756 ("freedreno: import libdrm_freedreno + redesign submit")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108595
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
6 years agotravis: use python3 for the autoconf builds
Emil Velikov [Thu, 16 Aug 2018 12:01:05 +0000 (13:01 +0100)]
travis: use python3 for the autoconf builds

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agoconfigure: allow building with python3
Emil Velikov [Thu, 16 Aug 2018 12:59:38 +0000 (13:59 +0100)]
configure: allow building with python3

Pretty much all of the scripts are python2+3 compatible.
Check and allow using python3, while adjusting the PYTHON2 refs.

Note:
 - python3.4 is used as it's the earliest supported version
 - python2 chosen prior to python3

v2: use python2 by default

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agodocs: update calendar, add new item and link release notes for 18.2.4
Juan A. Suarez Romero [Wed, 31 Oct 2018 18:58:00 +0000 (19:58 +0100)]
docs: update calendar, add new item and link release notes for 18.2.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
6 years agodocs: add sha256 checksums for 18.2.4
Juan A. Suarez Romero [Wed, 31 Oct 2018 18:55:05 +0000 (19:55 +0100)]
docs: add sha256 checksums for 18.2.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 624e384ea86afea737f9d3b952a9c3edbecd3950)

6 years agodocs: add release notes for 18.2.4
Juan A. Suarez Romero [Wed, 31 Oct 2018 18:04:16 +0000 (18:04 +0000)]
docs: add release notes for 18.2.4

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 1cdef5e70ca1745b6cbc133c3bdb94cd6541ad4a)

6 years agomeson: hide warnings from external project `gtest`
Eric Engestrom [Wed, 31 Oct 2018 16:40:50 +0000 (16:40 +0000)]
meson: hide warnings from external project `gtest`

gtest is an external project that is copied in this tree for technical
reasons, but isn't maintained by us, so its warnings are irrelevant.

Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agotools/imgui: disable all warnings
Eric Engestrom [Tue, 30 Oct 2018 19:01:21 +0000 (19:01 +0000)]
tools/imgui: disable all warnings

This is an external project we have no control over, and will not be
fixing (other than by sometimes pulling the latest sources), so warnings
serve no purpose here.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoglspirv: no need to force entrypoint name to "main"
Alejandro Piñeiro [Wed, 31 Oct 2018 10:55:44 +0000 (11:55 +0100)]
glspirv: no need to force entrypoint name to "main"

Since commit "intel/compiler: Stop assuming the entrypoint is called
"main"" there is no need to force the entrypoint name to be "main".

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoglsl/linker: validate attribute aliasing before optimizations
Tapani Pälli [Wed, 6 Jun 2018 11:19:16 +0000 (14:19 +0300)]
glsl/linker: validate attribute aliasing before optimizations

Patch does a 'dry run' of assign_attribute_or_color_locations before
optimizations to catch cases where we have aliasing of unused attributes
which is forbidden by the GLSL ES 3.x specifications.

We need to run this pass before unused attributes may be removed and with
attribute binding information from program, therefore we re-use existing
pass in linker rather than attempt to write another one.

This fixes WebGL2 test 'gl-bindAttribLocation-aliasing-inactive' and
Piglit test 'gles-3.0-attribute-aliasing'.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106833
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoegl: drop EGL driver `name`
Eric Engestrom [Wed, 18 Oct 2017 15:32:33 +0000 (16:32 +0100)]
egl: drop EGL driver `name`

This is a revert of Marek's 2cb9ab53dd3ae6850a26 revert.
It was needed to revert the previous commit, and didn't have any issue
itself.
--

The "DRI2" name was reported as confusing when printing EGL infos (one
user reported thinking DRI3 was not working on his X server), and the
only alternative is Haiku, which can only be used on a Haiku machine.

The name therefore doesn't add any information that the user wouldn't
know already, so let's just drop it.

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Related-to: b174a1ae720cb404738c ("egl: Simplify the "driver" interface")
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoegl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}
Eric Engestrom [Mon, 25 Sep 2017 21:35:24 +0000 (22:35 +0100)]
egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}

This is a revert of Marek's 84f3afc2e122cb418573 revert, with a missing
line added back. I failed a rebase and dropped that crucial line, and
didn't do a runtime test after my rebase, and as a result broke EGL for
everyone.
This commit has been tested by Intel's CI and I re-read it once more, so
it should be good this time.
--

Note: dropping the EGL_BAD_ALLOC in egl_haiku because it's
overwritten by the EGL_NOT_INITIALIZED in eglInitialize().

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoRevert "imx: make use of loader_open_render_node(..) helper"
Christian Gmeiner [Mon, 29 Oct 2018 20:13:01 +0000 (21:13 +0100)]
Revert "imx: make use of loader_open_render_node(..) helper"

This reverts commit 773d6ea6e715d207bda3a53a9dfc8acf686035b0.

Since kernel 4.17 (drm/etnaviv: remove the need for a gpu-subsystem DT
node) the etnaviv DRM driver doesn't have an associated DT node
anymore. This is technically correct, as the etnaviv device is a
virtual device driving multiple hardware devices.

Before 4.17 the userspace had access to the following information:
DRIVER=etnaviv
OF_NAME=gpu-subsystem
OF_FULLNAME=/gpu-subsystem
OF_COMPATIBLE_0=fsl,imx-gpu-subsystem
OF_COMPATIBLE_N=1
MODALIAS=of:Ngpu-subsystemT<NULL>Cfsl,imx-gpu-subsystem
DRIVER=imx-drm
OF_NAME=display-subsystem
OF_FULLNAME=/display-subsystem
OF_COMPATIBLE_0=fsl,imx-display-subsystem
OF_COMPATIBLE_N=1

Afer 4.17:
DRIVER=etnaviv
MODALIAS=platform:etnaviv

The OF node has never been part of the etnaviv UABI, simply due to the
fact that it's still possible to instantiate the etnaviv driver from a
platform file, instead of a devicetree node.

A patch set to fix this problem was send out [1] but it looks like
that a proper solution needs more time to bake.

[1] https://lists.freedesktop.org/archives/dri-devel/2018-October/194651.html

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
6 years agoradv: use WAIT_REG_MEM_GREATER_OR_EQUAL instead of a magic value
Samuel Pitoiset [Tue, 30 Oct 2018 11:29:13 +0000 (12:29 +0100)]
radv: use WAIT_REG_MEM_GREATER_OR_EQUAL instead of a magic value

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: use pool->stride when calling radv_query_shader()
Samuel Pitoiset [Tue, 30 Oct 2018 14:18:57 +0000 (15:18 +0100)]
radv: use pool->stride when calling radv_query_shader()

Not needed to recompute the stride.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: rename some parameters in Cmd{Begin,End}TransformFeedbackEXT()
Samuel Pitoiset [Tue, 30 Oct 2018 09:09:39 +0000 (10:09 +0100)]
radv: rename some parameters in Cmd{Begin,End}TransformFeedbackEXT()

To match latest spec.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/winsys: do not assign last submission when chained path failed
Samuel Pitoiset [Tue, 30 Oct 2018 10:41:20 +0000 (11:41 +0100)]
radv/winsys: do not assign last submission when chained path failed

I don't think we want to wait for something that hasn't been
correctly submitted. This is similar to the fallback path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/winsys: fix buffer deletion in the sysmem path
Samuel Pitoiset [Tue, 30 Oct 2018 10:41:19 +0000 (11:41 +0100)]
radv/winsys: fix buffer deletion in the sysmem path

In case we failed to submit the CS correctly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/winsys: cleanup the chained submission path
Samuel Pitoiset [Tue, 30 Oct 2018 10:41:18 +0000 (11:41 +0100)]
radv/winsys: cleanup the chained submission path

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv/winsys: remove unused surface_best()
Samuel Pitoiset [Tue, 30 Oct 2018 10:41:17 +0000 (11:41 +0100)]
radv/winsys: remove unused surface_best()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agointel/compiler: Stop assuming the entrypoint is called "main"
Jason Ekstrand [Mon, 29 Oct 2018 17:08:29 +0000 (12:08 -0500)]
intel/compiler: Stop assuming the entrypoint is called "main"

This isn't true for Vulkan so we have to whack it to "main" in anv which
is silly.  Instead of walking the list of functions and asserting that
everything is named "main" and hoping there's only one function named
"main", just use the nir_shader_get_entrypoint() helper which has better
assertions anyway.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agost/glsl_to_nir: fix next_stage gathering
Timothy Arceri [Sat, 20 Oct 2018 04:02:59 +0000 (15:02 +1100)]
st/glsl_to_nir: fix next_stage gathering

ffs() just returns the bit that is set, we need to know what
stage that bit represents so use u_bit_scan() instead.

Fixes: 2ca5d9548fc4 ("st/glsl_to_nir: gather next_stage in shader_info")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agost/mesa: calculate buffer size correctly for packed uniforms
Timothy Arceri [Mon, 29 Oct 2018 09:27:08 +0000 (20:27 +1100)]
st/mesa: calculate buffer size correctly for packed uniforms

Fixes: edded1237607 ("mesa: rework ParameterList to allow packing")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>