mesa.git
7 years agoswr/rast: constify swr rasterizer
Tim Rowley [Wed, 26 Jul 2017 17:27:44 +0000 (12:27 -0500)]
swr/rast: constify swr rasterizer

Add "const" as appropriate in method/function signatures.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: SIMD16 shaders - widen fetch and vertex shaders
Tim Rowley [Thu, 20 Jul 2017 23:27:51 +0000 (18:27 -0500)]
swr/rast: SIMD16 shaders - widen fetch and vertex shaders

Work in progress, disabled by default.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: vmask() implementations for KNL
Tim Rowley [Thu, 27 Jul 2017 19:56:46 +0000 (14:56 -0500)]
swr/rast: vmask() implementations for KNL

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: rename frontend pVertexStore
Tim Rowley [Mon, 24 Jul 2017 23:25:51 +0000 (18:25 -0500)]
swr/rast: rename frontend pVertexStore

Rename to reflect global nature.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: fix movemask_ps / movemask_pd on AVX512
Tim Rowley [Thu, 20 Jul 2017 22:06:14 +0000 (17:06 -0500)]
swr/rast: fix movemask_ps / movemask_pd on AVX512

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: stop using MSFT types in platform independent code
Tim Rowley [Thu, 20 Jul 2017 18:48:28 +0000 (13:48 -0500)]
swr/rast: stop using MSFT types in platform independent code

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: enable USE_SIMD16_FRONTEND by default
Tim Rowley [Wed, 19 Jul 2017 22:49:17 +0000 (17:49 -0500)]
swr/rast: enable USE_SIMD16_FRONTEND by default

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: disable AVX512 optimization of SSE / AVX code
Tim Rowley [Wed, 19 Jul 2017 21:16:57 +0000 (16:16 -0500)]
swr/rast: disable AVX512 optimization of SSE / AVX code

Disable an optimization which implemented sse/avx operations on avx512
using avx512 intrinsics (to avoid switching between lane widths).

Compile with SIMD_OPT_128_AVX512 / SIMD_OPT_256_AVX512 defined to enable
these optimizations.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: fix USE_SIMD16_FRONTEND issues
Tim Rowley [Wed, 19 Jul 2017 04:52:38 +0000 (23:52 -0500)]
swr/rast: fix USE_SIMD16_FRONTEND issues

Fix problems found when enabling USE_SIMD16_FRONTEND, mostly related to
vMask / movemask_ps(pd).

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: simdlib better separation of core vs knights avx512
Tim Rowley [Mon, 24 Jul 2017 21:13:12 +0000 (16:13 -0500)]
swr/rast: simdlib better separation of core vs knights avx512

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: threadID via portable std::this_thread::get_id()
Tim Rowley [Mon, 24 Jul 2017 21:12:52 +0000 (16:12 -0500)]
swr/rast: threadID via portable std::this_thread::get_id()

Replace use of Win32 GetCurrentThreadId() with portable
std::this_thread::get_id().

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agospirv: Fix SpvImageFormatR16ui
Jason Ekstrand [Wed, 12 Jul 2017 18:36:29 +0000 (11:36 -0700)]
spirv: Fix SpvImageFormatR16ui

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "17.1 17.2" <mesa-stable@lists.freedesktop.org>
7 years agoanv: Advertise VK_KHR_relaxed_block_layout
Jason Ekstrand [Tue, 1 Aug 2017 16:01:51 +0000 (09:01 -0700)]
anv: Advertise VK_KHR_relaxed_block_layout

There is literally no work for us to do here.  It already just works in
our driver.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Bump the advertised version to 1.0.57
Jason Ekstrand [Tue, 1 Aug 2017 18:53:20 +0000 (11:53 -0700)]
anv: Bump the advertised version to 1.0.57

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Pull the API version from anv_extensions.py
Jason Ekstrand [Tue, 1 Aug 2017 18:50:59 +0000 (11:50 -0700)]
anv: Pull the API version from anv_extensions.py

This way everything stays in sync and we only have the one version
number.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Use python to generate ICD json files
Jason Ekstrand [Tue, 1 Aug 2017 18:31:51 +0000 (11:31 -0700)]
anv: Use python to generate ICD json files

This is more lines of code but the python is far easier to read than the
sed expressions we were using before.  Also, this allows us to pull the
API version from anv_entrypoints.py so it never gets out-of-sync.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Add MAX_API_VERSION to anv_extensions.py
Jason Ekstrand [Tue, 1 Aug 2017 18:09:50 +0000 (11:09 -0700)]
anv: Add MAX_API_VERSION to anv_extensions.py

The VkVersion class is probably overkill but it makes it really easy to
compare versions in a way that's safe without the caller having to think
about patch vs. no patch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Make some bits of anv_extensions module-private
Jason Ekstrand [Tue, 1 Aug 2017 17:59:40 +0000 (10:59 -0700)]
anv: Make some bits of anv_extensions module-private

This way we can use "from anv_extensions import *" in the entrypoint
generator without worrying too much about pollution

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agogit_sha1_gen: catch any error the same way
Eric Engestrom [Wed, 2 Aug 2017 13:57:52 +0000 (14:57 +0100)]
git_sha1_gen: catch any error the same way

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agobuild: Don't bail on OSError in git_sha1_gen.py
Tobias Klausmann [Wed, 2 Aug 2017 01:05:42 +0000 (03:05 +0200)]
build: Don't bail on OSError in git_sha1_gen.py

When building sandboxed, we may encounter additional errors. Ignore the errors,
as we are in a constrained environment.

This can be observed when building latest git with OBS.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agost/mesa: replace st_shader_stage_to_ptarget
Nicolai Hähnle [Wed, 2 Aug 2017 09:56:16 +0000 (11:56 +0200)]
st/mesa: replace st_shader_stage_to_ptarget

Use pipe_shader_type_from_mesa instead.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa: add GLSL 4.60 to shading_language_version()
Samuel Pitoiset [Tue, 1 Aug 2017 10:26:31 +0000 (12:26 +0200)]
mesa: add GLSL 4.60 to shading_language_version()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: add always-false enable for GL 4.6
Samuel Pitoiset [Tue, 1 Aug 2017 10:26:30 +0000 (12:26 +0200)]
mesa: add always-false enable for GL 4.6

I believe this should be enough for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglsl: recognize GLSL 4.60
Samuel Pitoiset [Tue, 1 Aug 2017 10:26:29 +0000 (12:26 +0200)]
glsl: recognize GLSL 4.60

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agodri3: Wait for all pending swapbuffers to be scheduled before touching the front
Thomas Hellstrom [Thu, 22 Jun 2017 07:24:34 +0000 (09:24 +0200)]
dri3: Wait for all pending swapbuffers to be scheduled before touching the front

This implements a wait for glXWaitGL, glXCopySubBuffer, dri flush_front and
creation of fake front until all pending SwapBuffers have been committed to
hardware. Among other things this fixes piglit glx-copy-sub-buffers on dri3.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: <mesa-stable@lists.freedesktop.org>
7 years agomesa: add KHR_no_error support to glPolygonMode()
Samuel Pitoiset [Thu, 27 Jul 2017 10:16:44 +0000 (12:16 +0200)]
mesa: add KHR_no_error support to glPolygonMode()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add polygon_mode() helper
Samuel Pitoiset [Thu, 27 Jul 2017 10:15:04 +0000 (12:15 +0200)]
mesa: add polygon_mode() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glClearBufferiv()
Samuel Pitoiset [Fri, 21 Jul 2017 12:28:52 +0000 (14:28 +0200)]
mesa: add KHR_no_error support to glClearBufferiv()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear_bufferiv() helper
Samuel Pitoiset [Fri, 21 Jul 2017 12:27:23 +0000 (14:27 +0200)]
mesa: add clear_bufferiv() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glClearBufferuiv()
Samuel Pitoiset [Fri, 21 Jul 2017 12:25:03 +0000 (14:25 +0200)]
mesa: add KHR_no_error support to glClearBufferuiv()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear_bufferuiv() helper
Samuel Pitoiset [Fri, 21 Jul 2017 12:23:35 +0000 (14:23 +0200)]
mesa: add clear_bufferuiv() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glClearBufferfi()
Samuel Pitoiset [Fri, 21 Jul 2017 12:21:10 +0000 (14:21 +0200)]
mesa: add KHR_no_error support to glClearBufferfi()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear_bufferi() helper
Samuel Pitoiset [Fri, 21 Jul 2017 12:19:27 +0000 (14:19 +0200)]
mesa: add clear_bufferi() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glClearBufferfv()
Samuel Pitoiset [Fri, 21 Jul 2017 12:04:15 +0000 (14:04 +0200)]
mesa: add KHR_no_error support to glClearBufferfv()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear_bufferfv() helper
Samuel Pitoiset [Fri, 21 Jul 2017 12:02:20 +0000 (14:02 +0200)]
mesa: add clear_bufferfv() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glClear*Buffer*Data()
Samuel Pitoiset [Fri, 21 Jul 2017 10:02:26 +0000 (12:02 +0200)]
mesa: add KHR_no_error support to glClear*Buffer*Data()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add clear_buffer_sub_data_error() helper
Samuel Pitoiset [Fri, 21 Jul 2017 09:51:47 +0000 (11:51 +0200)]
mesa: add clear_buffer_sub_data_error() helper

And make clear_buffer_sub_data() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: make get_texbuffer_format() global
Samuel Pitoiset [Fri, 21 Jul 2017 09:50:56 +0000 (11:50 +0200)]
mesa: make get_texbuffer_format() global

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glLinkProgram()
Samuel Pitoiset [Thu, 20 Jul 2017 09:41:31 +0000 (11:41 +0200)]
mesa: add KHR_no_error support to glLinkProgram()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add link_program() and link_program_error() helpers
Samuel Pitoiset [Thu, 20 Jul 2017 09:34:32 +0000 (11:34 +0200)]
mesa: add link_program() and link_program_error() helpers

And call link_program_error() from _mesa_link_program().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glShaderSource()
Samuel Pitoiset [Thu, 20 Jul 2017 09:26:42 +0000 (11:26 +0200)]
mesa: add KHR_no_error support to glShaderSource()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add shader_source() helper
Samuel Pitoiset [Thu, 20 Jul 2017 09:24:10 +0000 (11:24 +0200)]
mesa: add shader_source() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: rename shader_source() to set_shader_source()
Samuel Pitoiset [Thu, 20 Jul 2017 09:21:32 +0000 (11:21 +0200)]
mesa: rename shader_source() to set_shader_source()

There is already get_shader_source(), and shader_source() will
be used for adding KHR_no_error support.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glEndConditionalRender()
Samuel Pitoiset [Thu, 20 Jul 2017 09:10:41 +0000 (11:10 +0200)]
mesa: add KHR_no_error support to glEndConditionalRender()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add end_conditional_render() render
Samuel Pitoiset [Thu, 20 Jul 2017 09:09:16 +0000 (11:09 +0200)]
mesa: add end_conditional_render() render

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glBeginConditionalRender()
Samuel Pitoiset [Thu, 20 Jul 2017 09:07:57 +0000 (11:07 +0200)]
mesa: add KHR_no_error support to glBeginConditionalRender()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add begin_conditional_render() helper
Samuel Pitoiset [Thu, 20 Jul 2017 09:05:39 +0000 (11:05 +0200)]
mesa: add begin_conditional_render() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glNamedBufferData() and glBufferData()
Samuel Pitoiset [Thu, 20 Jul 2017 08:59:41 +0000 (10:59 +0200)]
mesa: add KHR_no_error support to glNamedBufferData() and glBufferData()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add buffer_data() and buffer_data_error() helpers
Samuel Pitoiset [Thu, 20 Jul 2017 08:43:30 +0000 (10:43 +0200)]
mesa: add buffer_data() and buffer_data_error() helpers

And call buffer_data_error() from _mesa_buffer_data().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add KHR_no_error support to glLineWidth()
Samuel Pitoiset [Thu, 20 Jul 2017 08:24:12 +0000 (10:24 +0200)]
mesa: add KHR_no_error support to glLineWidth()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: add line_width() helper
Samuel Pitoiset [Thu, 20 Jul 2017 08:22:24 +0000 (10:22 +0200)]
mesa: add line_width() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agopipe-loader: fix driinfo for software and non-radeonsi drivers
Nicolai Hähnle [Wed, 2 Aug 2017 09:38:32 +0000 (11:38 +0200)]
pipe-loader: fix driinfo for software and non-radeonsi drivers

Fixes: 678dadf1237 ("gallium: move driinfo XML to pipe_loader")
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
7 years agomesa/st: Reduce the number of frontbuffer flush calls
Thomas Hellstrom [Tue, 20 Jun 2017 19:12:50 +0000 (21:12 +0200)]
mesa/st: Reduce the number of frontbuffer flush calls

The mesa state tracker was needlessly flushing the front buffer even if it
hadn't been drawn to since the last flush. This was happening during
glXSwapBuffers if we at some point previously had set that frontbuffer as
a read- or draw renderbuffer, or at glFlush() or glFinish() if we at some
point previously had rendered to the front buffer. Since the frontbuffer
flush typically means a full drawable copy, it's a pretty big waste.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
7 years agoFix gallium SCons build
Nicolai Hähnle [Wed, 2 Aug 2017 09:48:23 +0000 (11:48 +0200)]
Fix gallium SCons build

7 years agoglsl: look up for transform feedback varyings after linking
Juan A. Suarez Romero [Thu, 6 Jul 2017 08:35:37 +0000 (08:35 +0000)]
glsl: look up for transform feedback varyings after linking

Check if shaders have transform feedback varyings also after the
post-link step.

This fixes:
KHR-GL45.enhanced_layouts.xfb_vertex_streams
piglit/spec/arb_enhanced_layouts/gs-stream-location-aliasing

v2: add claryfing comments (Timothy)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoradeonsi: add enable_sisched driconf option
Nicolai Hähnle [Wed, 28 Jun 2017 15:37:53 +0000 (17:37 +0200)]
radeonsi: add enable_sisched driconf option

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: prepare for driver-specific driconf options
Nicolai Hähnle [Thu, 29 Jun 2017 15:31:57 +0000 (17:31 +0200)]
radeonsi: prepare for driver-specific driconf options

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agopipe-loader: move configuration_query into drm_helper
Nicolai Hähnle [Thu, 29 Jun 2017 15:48:28 +0000 (17:48 +0200)]
pipe-loader: move configuration_query into drm_helper

Having it inline is pointless anyway, since it's only called via a
function pointer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agost/dri: implement v2 of DRI_ConfigOptions
Nicolai Hähnle [Fri, 30 Jun 2017 09:06:06 +0000 (11:06 +0200)]
st/dri: implement v2 of DRI_ConfigOptions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agopipe-loader: extract a standalone get_driver_descriptor helper function
Nicolai Hähnle [Fri, 30 Jun 2017 09:06:44 +0000 (11:06 +0200)]
pipe-loader: extract a standalone get_driver_descriptor helper function

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agopipe-loader: pass only the driver_name to pipe_loader_find_module
Nicolai Hähnle [Fri, 30 Jun 2017 08:30:14 +0000 (10:30 +0200)]
pipe-loader: pass only the driver_name to pipe_loader_find_module

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: add driconf options to pipe_screen_config
Nicolai Hähnle [Fri, 30 Jun 2017 07:58:46 +0000 (09:58 +0200)]
gallium: add driconf options to pipe_screen_config

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: move loading of drirc to pipe-loader
Nicolai Hähnle [Wed, 28 Jun 2017 15:50:19 +0000 (17:50 +0200)]
gallium: move loading of drirc to pipe-loader

v2: rebase compile fix: addition of mesa_no_error

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
7 years agogallium: move driinfo XML to pipe_loader
Nicolai Hähnle [Thu, 29 Jun 2017 15:37:18 +0000 (17:37 +0200)]
gallium: move driinfo XML to pipe_loader

We will switch to the pipe_loader loading the configuration options,
so that they can be passed to the driver independently of the state
tracker.

Put the description into its own file so that it can be merged easily
with driver-specific options in future commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: add pipe_screen_config to screen_create functions
Nicolai Hähnle [Wed, 28 Jun 2017 12:47:32 +0000 (14:47 +0200)]
gallium: add pipe_screen_config to screen_create functions

This allows a more generic mechanism for passing user configurations
into drivers by accessing the dri options directly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agost/drm: add DRM_CONF_XML_OPTIONS
Nicolai Hähnle [Wed, 28 Jun 2017 15:53:16 +0000 (17:53 +0200)]
st/drm: add DRM_CONF_XML_OPTIONS

Allow drivers to return the XML that describes the available config
options.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoutil: add merge_driinfo.py
Nicolai Hähnle [Thu, 29 Jun 2017 15:34:37 +0000 (17:34 +0200)]
util: add merge_driinfo.py

This tool merges driinfo XML that is built using DRI_CONF_xxx macros.
The intention is to merge together state-tracker options with
driver-specific options.

Acked-by: Marek Olšák <marek.olsak@amd.com>
7 years agoglx: use v2 of DRI_ConfigOptions
Nicolai Hähnle [Fri, 30 Jun 2017 09:04:49 +0000 (11:04 +0200)]
glx: use v2 of DRI_ConfigOptions

Most of the change is concerned with avoiding memory leaks, since v2 of
the DRI extension returns a malloc'ed string. This also allows us to
resolve the long-standing issue of keeping drivers loaded when returning
from glXGetDriverConfig.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agodri: define a version 2 of the DRI_ConfigOptions extension
Nicolai Hähnle [Fri, 30 Jun 2017 08:52:48 +0000 (10:52 +0200)]
dri: define a version 2 of the DRI_ConfigOptions extension

The new function is defined to return a malloc'ed pointer. In the
following patches, this helps avoid leaking library handles when pipe
drivers are linked dynamically.

It also allows us to generate the XML string on the fly in the future.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: enable ARB_transform_feedback_overflow_query
Nicolai Hähnle [Wed, 26 Jul 2017 17:37:21 +0000 (19:37 +0200)]
radeonsi: enable ARB_transform_feedback_overflow_query

v2: update for new cap name

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: avoid redundant SET_PREDICATION packet with QBO workaround
Nicolai Hähnle [Thu, 27 Jul 2017 17:41:26 +0000 (19:41 +0200)]
radeonsi: avoid redundant SET_PREDICATION packet with QBO workaround

The QBO workaround compute grid launch emits the render condition atom
when dirty, so install the render condition in the context only after
launching the compute grid. This avoids a redundant SET_PREDICATION.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: fix streamout overflow predication on VI+
Nicolai Hähnle [Thu, 27 Jul 2017 17:24:59 +0000 (19:24 +0200)]
radeonsi: fix streamout overflow predication on VI+

There is a firmware regression that causes failures. Work around it by
using the compute shader for query_buffer_objects to summarize the query
results.

v2: rename to PREDICATION_OP_BOOL64 (consistent with sid.h)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium/radeon: implement qbo for SO_OVERFLOW_PREDICATE
Nicolai Hähnle [Thu, 27 Jul 2017 09:33:41 +0000 (11:33 +0200)]
gallium/radeon: implement qbo for SO_OVERFLOW_PREDICATE

v2: use R600_MAX_STREAMS instead of 4 (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium/radeon: implement basic parts of PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE
Nicolai Hähnle [Wed, 26 Jul 2017 17:35:40 +0000 (19:35 +0200)]
gallium/radeon: implement basic parts of PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE

v2: use R600_MAX_STREAMS instead of 4 (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium/radeon: fix render predication by SO overflow predicate
Nicolai Hähnle [Wed, 26 Jul 2017 17:07:22 +0000 (19:07 +0200)]
gallium/radeon: fix render predication by SO overflow predicate

The predication bits are "visible or no overflow" and "not visible or
overflow", so we need to invert the check relative to the GL and Gallium
interface semantics.

Also, predication by the other streamout-related queries is not allowed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium/radeon: fix ARB_query_buffer_object conversion to boolean
Nicolai Hähnle [Thu, 27 Jul 2017 12:06:59 +0000 (14:06 +0200)]
gallium/radeon: fix ARB_query_buffer_object conversion to boolean

The issue here is that the immediate is treated as a 64-bit value,
and fetching it does not work reliably with swizzles that are different
from xy and zw.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agost/mesa: implement ARB_transform_feedback_overflow_query
Nicolai Hähnle [Wed, 26 Jul 2017 16:57:56 +0000 (18:57 +0200)]
st/mesa: implement ARB_transform_feedback_overflow_query

v2: update for new cap name

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoddebug: handle get_query_result_resource as a GPU call
Nicolai Hähnle [Thu, 27 Jul 2017 09:59:20 +0000 (11:59 +0200)]
ddebug: handle get_query_result_resource as a GPU call

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium/util: add util_{str,dump}_query_value_type
Nicolai Hähnle [Thu, 27 Jul 2017 09:59:38 +0000 (11:59 +0200)]
gallium/util: add util_{str,dump}_query_value_type

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: add util_dump_query_type and use it in ddebug
Nicolai Hähnle [Thu, 27 Jul 2017 09:50:41 +0000 (11:50 +0200)]
gallium: add util_dump_query_type and use it in ddebug

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: rename util_dump_* to util_str_* for enum-to-string conversion
Nicolai Hähnle [Thu, 27 Jul 2017 09:40:25 +0000 (11:40 +0200)]
gallium: rename util_dump_* to util_str_* for enum-to-string conversion

This is mostly mechanical search-and-replace, plus touching up the
macros in u_dump_defines.c manually a bit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agogallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding cap
Nicolai Hähnle [Wed, 26 Jul 2017 17:16:14 +0000 (19:16 +0200)]
gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding cap

v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit
    in the documentation

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoandroid: export intermediates from libmesa_util
Tapani Pälli [Tue, 1 Aug 2017 11:23:00 +0000 (14:23 +0300)]
android: export intermediates from libmesa_util

Fixes following build issues:

   In file included from vendor/intel/external/android_ia/mesa/src/mesa/drivers/dri/common/dri_util.c:45:
   vendor/intel/external/android_ia/mesa/src/util/xmlpool.h:103:10: fatal error: 'xmlpool/options.h' file not found
   ...
   In file included from vendor/intel/external/android_ia/mesa/src/mesa/drivers/dri/i965/intel_screen.c:44:
   vendor/intel/external/android_ia/mesa/src/util/xmlpool.h:103:10: fatal error: 'xmlpool/options.h' file not found

Fixes: 601093f9 (xmlconfig: move into src/util)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
7 years agointel: move gen_decoder.* back to COMMON_FILES
Tapani Pälli [Mon, 31 Jul 2017 08:32:34 +0000 (11:32 +0300)]
intel: move gen_decoder.* back to COMMON_FILES

this change reverts commit 4f695731, we want to be able to build
with -DDEBUG and gen_decoder on Android.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoandroid: link libmesa_intel_common with zlib and expat
Tapani Pälli [Mon, 31 Jul 2017 08:32:33 +0000 (11:32 +0300)]
android: link libmesa_intel_common with zlib and expat

Makes it possible to build Mesa on Android with -DDEBUG with
the next patch that reverts 4f695731.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoac/nir: Add float cast before shadow comparator clamp.
Bas Nieuwenhuizen [Tue, 1 Aug 2017 10:24:01 +0000 (12:24 +0200)]
ac/nir: Add float cast before shadow comparator clamp.

LLVM complained about passing an i32 to a float clamp.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 0f9e32519bb "ac/nir: clamp shadow texture comparison value on VI"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoi965: Check result of make_surface() for intel_miptree_create_for_bo
Chris Wilson [Mon, 31 Jul 2017 09:22:44 +0000 (10:22 +0100)]
i965: Check result of make_surface() for intel_miptree_create_for_bo

Since make_surface() can fail, if the format isn't support by hw or
simlar error, we need to check the result before dereferencing it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agovirgl: add BPTC support.
Dave Airlie [Wed, 2 Aug 2017 03:29:22 +0000 (13:29 +1000)]
virgl: add BPTC support.

This just adds the guest checks for BPTC, the host renderer
also needs code to support these.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agomesa/st: fix conditional jump depends on uninitialised value
Timothy Arceri [Mon, 31 Jul 2017 12:48:27 +0000 (22:48 +1000)]
mesa/st: fix conditional jump depends on uninitialised value

Reported by valgrind at:
glsl_to_tgsi_visitor::visit(ir_expression*) (st_glsl_to_tgsi.cpp:1560)

When compiling the Deus Ex shaders.

Fixes: 28a5e7104 ("st/glsl_to_tgsi: handle precise modifier")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeon/ac: use ds_swizzle for derivs on si/cik.
Dave Airlie [Tue, 1 Aug 2017 04:10:49 +0000 (05:10 +0100)]
radeon/ac: use ds_swizzle for derivs on si/cik.

This looks like it's supported since llvm 3.9 at least,
so switch over radeonsi and radv to using it, -pro also
uses this. We can now drop creating lds for these operations
as the ds_swizzle operation doesn't actually write to lds at all.

Acked-by: Marek Olšák <marek.olsak@amd.com>
(stable requested due to fixing radv CIK conformance tests)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agovulkan: Import in the latest 1.0.57 header and XML from Khronos
Jason Ekstrand [Tue, 1 Aug 2017 15:59:24 +0000 (08:59 -0700)]
vulkan: Import in the latest 1.0.57 header and XML from Khronos

Acked-by: Dave Airlie <airlied@redhat.com>
7 years agoac/nir: fix nir_op_unpack_64_2x32_split_y emission
Connor Abbott [Tue, 1 Aug 2017 01:31:54 +0000 (18:31 -0700)]
ac/nir: fix nir_op_unpack_64_2x32_split_y emission

This was broken thanks to a typo in b2367cf.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoac/nir: fix lsb emission
Connor Abbott [Tue, 1 Aug 2017 01:28:45 +0000 (18:28 -0700)]
ac/nir: fix lsb emission

This makes it match radeonsi. The LLVM backend itself will emit the
correct instruction, but LLVM might do incorrect optimizations since it
thinks the output is undefined when the input is 0, even though it's not
supposed to be. We really need a new intrinsic, or for the backend to
become smarter and recognize this pattern.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
7 years agonir: fix algebraic optimizations
Connor Abbott [Tue, 1 Aug 2017 01:26:49 +0000 (18:26 -0700)]
nir: fix algebraic optimizations

The optimizations are only valid for 32-bit integers. They were
mistakenly firing for 64-bit integers as well.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoanv: Autogenerate extension query and lookup
Jason Ekstrand [Fri, 14 Jul 2017 05:50:30 +0000 (22:50 -0700)]
anv: Autogenerate extension query and lookup

As time goes on, extension advertising is going to get more complex.
Today, we either implement an extension or we don't.  However, in the
future, whether or not we advertise an extension will depend on kernel
or hardware features.  This commit introduces a python codegen framework
that generates the anv_EnumerateFooExtensionProperties functions as well
as a pair of anv_foo_extension_supported functions for querying for the
support of a given extension string.  Each extension has an "enable"
predicate that is any valid C expression.  For device extensions, the
physical device is available as "device" so the expression could be
something such as "device->has_kernel_feature".  For instance
extensions, the only option is VK_USE_PLATFORM defines.

This mechanism also means that we have a single one-line-per-entry table
for all extension declarations instead of the two tables we had in
anv_device.c and the one we had in anv_entrypoints_gen.py.  The Python
code is smart and uses the XML to determine whether an extension is an
instance extension or device extension.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoanv: Add a new centralized extensions file
Jason Ekstrand [Fri, 14 Jul 2017 02:10:25 +0000 (19:10 -0700)]
anv: Add a new centralized extensions file

This will allow us to keep everything in one place when it comes to
declaring what extensions are supported.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoegl/drm: Fix misused x and y offsets in swrast_get_image()
Gwan-gyeong Mun [Wed, 19 Jul 2017 14:05:31 +0000 (15:05 +0100)]
egl/drm: Fix misused x and y offsets in swrast_get_image()

It fixes misused x and y variables on the calculation of the memory copy regions.

Cc: Giovanni Campagna <gcampagna@src.gnome.org>
Fixes: 8430af5ebe1ee8119e14 "Add support for swrast to the DRM EGL platform"
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoegl/drm: Fix misused x and y offsets in swrast_put_image2()
Gwan-gyeong Mun [Wed, 19 Jul 2017 14:05:30 +0000 (15:05 +0100)]
egl/drm: Fix misused x and y offsets in swrast_put_image2()

It fixes misused x and y variables on the calculation of the memory copy regions.

Cc: Giovanni Campagna <gcampagna@src.gnome.org>
Fixes: 8430af5ebe1ee8119e14 "Add support for swrast to the DRM EGL platform"
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agogbm: add gbm_bo_get_bpp()
Eric Engestrom [Wed, 19 Jul 2017 14:05:29 +0000 (15:05 +0100)]
gbm: add gbm_bo_get_bpp()

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agogles: Restore some lost typedefs
Scott D Phillips [Fri, 30 Jun 2017 20:49:53 +0000 (13:49 -0700)]
gles: Restore some lost typedefs

GLES/gl.h has historically provided some typedefs that are not
used in the API itself. Restore these typedefs that were lost to
avoid breaking applications.

These seem to be the only typedefs removed in the update.

Fixes: 7fd0817 "Update Khronos-supplied headers"
[Eric: added a big warning to revert this patch when pulling the updated header]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>