mesa.git
4 years agoradeonsi: set COMPUTE_DISPATCH_INITIATOR.ORDER_MODE = 1
Marek Olšák [Tue, 27 Jun 2017 15:33:54 +0000 (17:33 +0200)]
radeonsi: set COMPUTE_DISPATCH_INITIATOR.ORDER_MODE = 1

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoradeonsi: use the DISPATCH packets to force COMPUTE_START_X/Y/Z = 0
Marek Olšák [Tue, 27 Jun 2017 15:25:28 +0000 (17:25 +0200)]
radeonsi: use the DISPATCH packets to force COMPUTE_START_X/Y/Z = 0

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoAndroid: use symlinks for driver loading
Rob Herring [Tue, 23 May 2017 00:04:48 +0000 (19:04 -0500)]
Android: use symlinks for driver loading

Instead of having special driver loading logic for Android, create
symlinks to gallium_dri.so so we can use the standard loading logic.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
4 years agoAndroid: i965: remove libdrm_intel dependency
Rob Herring [Wed, 28 Jun 2017 22:08:54 +0000 (17:08 -0500)]
Android: i965: remove libdrm_intel dependency

Commit 7dd20bc3ee8f ("anv/i965: drop libdrm_intel dependency completely")
removed the libdrm_intel dependency for automake, but Android builds still
depended on it. Now the build requires a newer version of i915_drm.h and
fails on Android builds:

src/mesa/drivers/dri/i965/brw_performance_query.c:616:9: error: use of undeclared identifier 'I915_OA_FORMAT_A32u40_A4u32_B8_C8'
   case I915_OA_FORMAT_A32u40_A4u32_B8_C8:
        ^
src/mesa/drivers/dri/i965/brw_performance_query.c:1887:18: error: use of undeclared identifier 'I915_PARAM_SLICE_MASK'
      gp.param = I915_PARAM_SLICE_MASK;
                 ^
src/mesa/drivers/dri/i965/brw_performance_query.c:1893:18: error: use of undeclared identifier 'I915_PARAM_SUBSLICE_MASK'
      gp.param = I915_PARAM_SUBSLICE_MASK;
                 ^

Remove the libdrm_intel dependency for Android builds and add the necessary
include paths for the local copy of i915_drm.h.

Fixes: 7dd20bc ("anv/i965: drop libdrm_intel dependency completely")
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoandroid: anv: drop libdrm_intel dependency
Mauro Rossi [Thu, 29 Jun 2017 00:46:38 +0000 (02:46 +0200)]
android: anv: drop libdrm_intel dependency

In addition to Rob Herring "Android: i965: remove libdrm_intel dependency",
we can drop libdrm_intel dependency in anv for Android.

Please check if libdrm has to stay as shared dependency and drop this comment line.

Fixes: 7dd20bc ("anv/i965: drop libdrm_intel dependency completely")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoetnaviv: fix memory leak when BO allocation fails
Lucas Stach [Fri, 9 Jun 2017 16:20:56 +0000 (18:20 +0200)]
etnaviv: fix memory leak when BO allocation fails

The resource struct is already allocated at this point and should be
freed properly.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
4 years agoetnaviv: fill in layer_stride for imported resources
Lucas Stach [Thu, 22 Jun 2017 14:10:48 +0000 (16:10 +0200)]
etnaviv: fill in layer_stride for imported resources

The layer stride information is used in various parts of the driver,
so it needs to be present regardless if the driver allocated the
buffer itself or merely imported it from an external source.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
4 years agoanv: use devinfo for number of thread/eu
Lionel Landwerlin [Fri, 23 Jun 2017 14:01:47 +0000 (17:01 +0300)]
anv: use devinfo for number of thread/eu

It turns out Gen9LP has fewer threads per EU (6 vs 7).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
4 years agointel: tools: add intel_aub.h as part of aubinator
Juan A. Suarez Romero [Wed, 28 Jun 2017 14:43:30 +0000 (14:43 +0000)]
intel: tools: add intel_aub.h as part of aubinator

Include intel_aub.h in the Makefile.tools.am

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agointel: automake: include Makefile.drm.am
Juan A. Suarez Romero [Wed, 28 Jun 2017 14:42:47 +0000 (14:42 +0000)]
intel: automake: include Makefile.drm.am

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agomesa: Require mipmap completeness for glCopyImageSubData() at times.
Kenneth Graunke [Thu, 23 Feb 2017 23:04:52 +0000 (15:04 -0800)]
mesa: Require mipmap completeness for glCopyImageSubData() at times.

This patch makes glCopyImageSubData require mipmap completeness when the
texture object's built-in sampler object has a mipmapping MinFilter.
This is apparently the de facto behavior and mandated by Android's CTS.

One exception is that we ignore format based completeness rules
(specifically integer formats with linear filtering), as this is
also the de facto behavior that until recently was mandated by the
OpenGL 4.5 CTS.

This was discussed with both the OpenGL and OpenGL ES working groups,
and while everyone agrees this behavior is unfortunate and complicated,
it is what it is at this point.  There was little appetite for relaxing
restrictions given that all conformant Android drivers followed the
mipmapping rule, and all conformant GL 4.5 implementations ignored the
integer/linear rule.

Fixes (on i965):
dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agomesa: tidy up white space in pixelstore.c
Timothy Arceri [Thu, 29 Jun 2017 04:14:03 +0000 (14:14 +1000)]
mesa: tidy up white space in pixelstore.c

4 years agomesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targets
Ian Romanick [Wed, 13 Jan 2016 01:09:50 +0000 (17:09 -0800)]
mesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targets

Add a big spec quotation justifying the error generated, which has
changed over the GL versions.

v2: Compact the spec quote based on a Khronos bug and discussion with Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
4 years agoi965: Drop index buffer re-alignment code.
Kenneth Graunke [Thu, 22 Jun 2017 18:16:06 +0000 (11:16 -0700)]
i965: Drop index buffer re-alignment code.

This shouldn't ever happen - GL requires it to be aligned:

   "Clients must align data elements consistent with the requirements
    of the client platform, with an additional base-level requirement
    that an offset within a buffer to a datum comprising N basic
    machine units be a multiple of N."

Mesa should reject unaligned index buffers for us - we shouldn't have
to handle them in the driver.

Note that Gallium already makes this assumption.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
4 years agomesa: add KHR_no_error support for glBlendFunc*()
Timothy Arceri [Wed, 28 Jun 2017 05:28:13 +0000 (15:28 +1000)]
mesa: add KHR_no_error support for glBlendFunc*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: create some glBlendFunc*() helper functions
Timothy Arceri [Wed, 28 Jun 2017 05:21:51 +0000 (15:21 +1000)]
mesa: create some glBlendFunc*() helper functions

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glBindFragDataLocation*()
Timothy Arceri [Wed, 28 Jun 2017 04:46:06 +0000 (14:46 +1000)]
mesa: add KHR_no_error support for glBindFragDataLocation*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add bind_frag_data_location() helper
Timothy Arceri [Wed, 28 Jun 2017 04:40:25 +0000 (14:40 +1000)]
mesa: add bind_frag_data_location() helper

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glGetUniformLocation()
Timothy Arceri [Wed, 28 Jun 2017 04:34:14 +0000 (14:34 +1000)]
mesa: add KHR_no_error support for glGetUniformLocation()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: inline _mesa_finish()
Timothy Arceri [Wed, 28 Jun 2017 04:20:48 +0000 (14:20 +1000)]
mesa: inline _mesa_finish()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glDisableVertexA*A*()
Timothy Arceri [Wed, 28 Jun 2017 04:09:22 +0000 (14:09 +1000)]
mesa: add KHR_no_error support for glDisableVertexA*A*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: move error handling into disable_vertex_array_attrib() callers
Timothy Arceri [Wed, 28 Jun 2017 04:03:07 +0000 (14:03 +1000)]
mesa: move error handling into disable_vertex_array_attrib() callers

This will let us just call disable_vertex_array_attrib() for
KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glEnableVertexA*A*()
Timothy Arceri [Wed, 28 Jun 2017 03:57:10 +0000 (13:57 +1000)]
mesa: add KHR_no_error support for glEnableVertexA*A*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glLogicOp()
Timothy Arceri [Wed, 28 Jun 2017 03:47:42 +0000 (13:47 +1000)]
mesa: add KHR_no_error support for glLogicOp()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add logic_op() helper
Timothy Arceri [Wed, 28 Jun 2017 03:40:09 +0000 (13:40 +1000)]
mesa: add logic_op() helper

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add KHR_no_error support for glPixelStore*()
Timothy Arceri [Wed, 28 Jun 2017 03:32:35 +0000 (13:32 +1000)]
mesa: add KHR_no_error support for glPixelStore*()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: add pixel_storei() helper
Timothy Arceri [Wed, 28 Jun 2017 03:27:46 +0000 (13:27 +1000)]
mesa: add pixel_storei() helper

Will be used to add KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: remove redundant error check
Timothy Arceri [Tue, 27 Jun 2017 06:46:19 +0000 (16:46 +1000)]
mesa: remove redundant error check

We do the same check in the shared code in the set_tex_parameterf()
call.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agomesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on GL_ARB_texture...
Ian Romanick [Wed, 7 Jun 2017 08:35:08 +0000 (01:35 -0700)]
mesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on GL_ARB_texture_border_clamp

On NV20 (and probably also on earlier NV GPUs that lack
GL_ARB_texture_border_clamp) fixes the following piglit tests:

    gl-1.0-beginend-coverage gltexparameter[if]{v,}
    push-pop-texture-state
    texwrap 1d
    texwrap 1d proj
    texwrap 2d proj
    texwrap formats

All told, 49 more tests pass on NV20 (10de:0201).

No changes on Intel CI run or RV250 (1002:4c66).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
4 years agogenxml: Silence about a billion unused parameter warnings
Ian Romanick [Thu, 15 Jun 2017 01:59:09 +0000 (18:59 -0700)]
genxml: Silence about a billion unused parameter warnings

v2: Use textwrap.dedent to make the source line a lot shorter.
Shortening (?) the line was requested by Jason.

v3: Simplify the texwrap.dedent usage.  Suggested by Dylan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
4 years agomesa: Fix Android build
Chad Versace [Wed, 28 Jun 2017 21:36:29 +0000 (14:36 -0700)]
mesa: Fix Android build

The format_fallback.py script wants two arguments: 'csv-file' and
'out-file'.

Fixes: 20c99eaece "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"
Reported-by: Rob Herring <robh@kernel.org>
4 years agoi965: Fix anisotropic filtering for mag filter
Eero Tamminen [Tue, 27 Jun 2017 17:37:16 +0000 (10:37 -0700)]
i965: Fix anisotropic filtering for mag filter

Commit f8d69beed49c64f883bb8ffb28d4960306baf575 moving sampler
handling to genxml messed up change done by commit
6a7c5257cac23cd9767aa4bc8fdab68925b11157.

This broke rendering in SynMark CSDof and TexFilterAniso tests.

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

Thanks to Kevin, who spotted the actual typo!
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agoetnaviv: fix shader miscompilation with more than 16 labels
Lucas Stach [Mon, 26 Jun 2017 16:24:31 +0000 (18:24 +0200)]
etnaviv: fix shader miscompilation with more than 16 labels

The labels array may change its virtual address on a reallocation, so
it is invalid to cache pointers into the array. Rather than using the
pointer directly, remember the array index.

Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs.

Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
4 years agoac/nir: remove last remnants of v16i8
Dave Airlie [Wed, 28 Jun 2017 19:14:58 +0000 (20:14 +0100)]
ac/nir: remove last remnants of v16i8

llvm doesn't need this workaround anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4 years agoac/nir: Use correct LLVM intrinsics for atomic ops on imageBuffers
Alex Smith [Mon, 26 Jun 2017 16:17:32 +0000 (17:17 +0100)]
ac/nir: Use correct LLVM intrinsics for atomic ops on imageBuffers

The buffer intrinsics should be used instead of the image ones.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac/nir: assert printfs will fit
James Legg [Fri, 23 Jun 2017 10:18:57 +0000 (11:18 +0100)]
ac/nir: assert printfs will fit

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac/nir: Make intrinsic_name buffer long enough
James Legg [Fri, 23 Jun 2017 10:18:56 +0000 (11:18 +0100)]
ac/nir: Make intrinsic_name buffer long enough

When using cmpswap on an image, it was being trunctated to
lvm.amdgcn.image.atomic.cmpswa, with the coords type missing entirely.

v2: Add stable CC

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoi965/dri: Support R8G8B8A8 and R8G8B8X8 configs
Chad Versace [Sat, 27 May 2017 02:08:47 +0000 (19:08 -0700)]
i965/dri: Support R8G8B8A8 and R8G8B8X8 configs

The Android framework requires support for EGLConfigs with
HAL_PIXEL_FORMAT_RGBX_8888 and HAL_PIXEL_FORMAT_RGBA_8888.

Even though all RGBX formats are disabled on gen9 by
brw_surface_formats.c, the new configs work correctly on Broxton thanks
to _mesa_format_fallback_rgbx_to_rgba().

On GLX, this creates no new configs, and therefore breaks no existing
apps. See in-patch comments for explanation. I tested with glxinfo and
glxgears on Skylake.

On Wayland, this also creates no new configs, and therfore breaks no
existing apps. (I tested with mesa-demos' eglinfo and es2gears_wayland
on Skylake). The reason differs from GLX, though. In
dri2_wl_add_configs_for_visual(), the format table contains only
B8G8R8X8, B8G8R8A8, and B5G6B5; and dri2_add_config() correctly matches
EGLConfig to format by inspecting channel masks.

On Android, in Chrome OS, I tested this on a Broxton device. I confirmed
that the Google Play Store's EGLSurface used HAL_PIXEL_FORMAT_RGBA_8888,
and that an Asteroid game's EGLSurface used HAL_PIXEL_FORMAT_RGBX_8888.
Both apps worked well. (Disclaimer: I didn't test this patch on Android
with Mesa master. I backported this patch series to an older Android
branch).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomesa: do not use format string as literal string
Juan A. Suarez Romero [Wed, 28 Jun 2017 11:40:48 +0000 (13:40 +0200)]
mesa: do not use format string as literal string

This fixes a couple of  errors when building in Android:

external/mesa3d/src/mesa/main/shaderapi.c:293:49: error: format string
is not a string literal (potentially insecure)
[-Werror,-Wformat-security]
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^~~~~~
external/mesa3d/src/mesa/main/shaderapi.c:293:49: note: treat the string
as an argument to avoid this
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
4 years agoscons: add code to generate format_fallback.c file
Brian Paul [Wed, 28 Jun 2017 02:56:22 +0000 (20:56 -0600)]
scons: add code to generate format_fallback.c file

Fixes: a1983223d8839a0c9 "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomesa: add KHR_no_error support for glClear()
Samuel Pitoiset [Mon, 26 Jun 2017 15:46:39 +0000 (17:46 +0200)]
mesa: add KHR_no_error support for glClear()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add clear() helper
Samuel Pitoiset [Mon, 26 Jun 2017 15:44:44 +0000 (17:44 +0200)]
mesa: add clear() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glBindAttribLocation()
Samuel Pitoiset [Mon, 26 Jun 2017 15:38:22 +0000 (17:38 +0200)]
mesa: add KHR_no_error support for glBindAttribLocation()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add bind_attrib_location() helper
Samuel Pitoiset [Mon, 26 Jun 2017 15:35:24 +0000 (17:35 +0200)]
mesa: add bind_attrib_location() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*ReadBuffer()
Samuel Pitoiset [Mon, 26 Jun 2017 15:12:18 +0000 (17:12 +0200)]
mesa: add KHR_no_error support for gl*ReadBuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: create read_buffer_err() and always inline read_buffer()
Samuel Pitoiset [Mon, 26 Jun 2017 15:06:14 +0000 (17:06 +0200)]
mesa: create read_buffer_err() and always inline read_buffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glVertex*AttribBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:50:48 +0000 (15:50 +0200)]
mesa: add KHR_no_error support for glVertex*AttribBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glShaderStorageBlockBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:35:10 +0000 (15:35 +0200)]
mesa: add KHR_no_error support for glShaderStorageBlockBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add shader_storage_block_binding() helper
Samuel Pitoiset [Mon, 26 Jun 2017 13:31:28 +0000 (15:31 +0200)]
mesa: add shader_storage_block_binding() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glUniformBlockBinding()
Samuel Pitoiset [Mon, 26 Jun 2017 13:09:04 +0000 (15:09 +0200)]
mesa: add KHR_no_error support for glUniformBlockBinding()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add uniform_block_binding() helper
Samuel Pitoiset [Mon, 26 Jun 2017 13:05:02 +0000 (15:05 +0200)]
mesa: add uniform_block_binding() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glFenceSync()
Samuel Pitoiset [Mon, 26 Jun 2017 12:49:51 +0000 (14:49 +0200)]
mesa: add KHR_no_error support for glFenceSync()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add fence_sync() helper
Samuel Pitoiset [Mon, 26 Jun 2017 12:48:24 +0000 (14:48 +0200)]
mesa: add fence_sync() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glClientWaitSync()
Samuel Pitoiset [Mon, 26 Jun 2017 12:44:43 +0000 (14:44 +0200)]
mesa: add KHR_no_error support for glClientWaitSync()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add client_wait_sync() helper
Samuel Pitoiset [Mon, 26 Jun 2017 12:42:54 +0000 (14:42 +0200)]
mesa: add client_wait_sync() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glCheckFramebufferStatus()
Samuel Pitoiset [Mon, 26 Jun 2017 12:16:41 +0000 (14:16 +0200)]
mesa: add KHR_no_error support for glCheckFramebufferStatus()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*Renderbuffers()
Samuel Pitoiset [Mon, 26 Jun 2017 16:27:49 +0000 (18:27 +0200)]
mesa: add KHR_no_error support for gl*Renderbuffers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: prepare create_render_buffers() for KHR_no_error support
Samuel Pitoiset [Mon, 26 Jun 2017 16:25:10 +0000 (18:25 +0200)]
mesa: prepare create_render_buffers() for KHR_no_error support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*ProgramPipelines()
Samuel Pitoiset [Mon, 26 Jun 2017 12:13:01 +0000 (14:13 +0200)]
mesa: add KHR_no_error support for gl*ProgramPipelines()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: prepare create_program_pipelines() for KHR_no_error support
Samuel Pitoiset [Mon, 26 Jun 2017 12:10:12 +0000 (14:10 +0200)]
mesa: prepare create_program_pipelines() for KHR_no_error support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*Samplers()
Samuel Pitoiset [Mon, 26 Jun 2017 12:05:46 +0000 (14:05 +0200)]
mesa: add KHR_no_error support for gl*Samplers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: prepare create_samplers() helper for KHR_no_error support
Samuel Pitoiset [Mon, 26 Jun 2017 12:01:27 +0000 (14:01 +0200)]
mesa: prepare create_samplers() helper for KHR_no_error support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*Textures()
Samuel Pitoiset [Mon, 26 Jun 2017 11:53:02 +0000 (13:53 +0200)]
mesa: add KHR_no_error support for gl*Textures()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: prepare create_textures() helper for KHR_no_error support
Samuel Pitoiset [Mon, 26 Jun 2017 11:49:03 +0000 (13:49 +0200)]
mesa: prepare create_textures() helper for KHR_no_error support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: fix an error message in create_textures()
Samuel Pitoiset [Mon, 26 Jun 2017 11:46:19 +0000 (13:46 +0200)]
mesa: fix an error message in create_textures()

Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for gl*Buffers()
Samuel Pitoiset [Mon, 26 Jun 2017 10:42:25 +0000 (12:42 +0200)]
mesa: add KHR_no_error support for gl*Buffers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: prepare create_buffers() helper for KHR_no_error support
Samuel Pitoiset [Mon, 26 Jun 2017 10:39:42 +0000 (12:39 +0200)]
mesa: prepare create_buffers() helper for KHR_no_error support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glBindTextureUnit()
Samuel Pitoiset [Mon, 26 Jun 2017 10:31:37 +0000 (12:31 +0200)]
mesa: add KHR_no_error support for glBindTextureUnit()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add bind_texture_unit() helper
Samuel Pitoiset [Mon, 26 Jun 2017 10:29:36 +0000 (12:29 +0200)]
mesa: add bind_texture_unit() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glDepthRangeIndexed()
Samuel Pitoiset [Fri, 23 Jun 2017 16:09:12 +0000 (18:09 +0200)]
mesa: add KHR_no_error support for glDepthRangeIndexed()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glDepthFunc()
Samuel Pitoiset [Fri, 23 Jun 2017 15:21:39 +0000 (17:21 +0200)]
mesa: add KHR_no_error support for glDepthFunc()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add depth_func() helper
Samuel Pitoiset [Fri, 23 Jun 2017 15:20:39 +0000 (17:20 +0200)]
mesa: add depth_func() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glFrontFace()
Samuel Pitoiset [Fri, 23 Jun 2017 15:35:51 +0000 (17:35 +0200)]
mesa: add KHR_no_error support for glFrontFace()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add front_face() helper
Samuel Pitoiset [Fri, 23 Jun 2017 15:33:29 +0000 (17:33 +0200)]
mesa: add front_face() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glCullFace()
Samuel Pitoiset [Fri, 23 Jun 2017 15:11:05 +0000 (17:11 +0200)]
mesa: add KHR_no_error support for glCullFace()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add cull_face() helper
Samuel Pitoiset [Fri, 23 Jun 2017 15:09:32 +0000 (17:09 +0200)]
mesa: add cull_face() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glCreateShader() and glCreateShaderObjectARB()
Samuel Pitoiset [Mon, 26 Jun 2017 10:21:05 +0000 (12:21 +0200)]
mesa: add KHR_no_error support for glCreateShader() and glCreateShaderObjectARB()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: rename create_shader() to create_shader_err()
Samuel Pitoiset [Mon, 26 Jun 2017 10:16:42 +0000 (12:16 +0200)]
mesa: rename create_shader() to create_shader_err()

And add a no_error variant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: pass the 'caller' function to create_shader()
Samuel Pitoiset [Mon, 26 Jun 2017 10:15:18 +0000 (12:15 +0200)]
mesa: pass the 'caller' function to create_shader()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support for glAttachShader() and glAttachObjectARB()
Samuel Pitoiset [Fri, 23 Jun 2017 15:01:22 +0000 (17:01 +0200)]
mesa: add KHR_no_error support for glAttachShader() and glAttachObjectARB()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: rename attach_shader() to attach_shader_err()
Samuel Pitoiset [Fri, 23 Jun 2017 14:54:40 +0000 (16:54 +0200)]
mesa: rename attach_shader() to attach_shader_err()

And add a no_error variant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: pass the 'caller' function to attach_shader()
Samuel Pitoiset [Fri, 23 Jun 2017 14:53:55 +0000 (16:53 +0200)]
mesa: pass the 'caller' function to attach_shader()

In order to fix GL error messages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomapi: Enable assembly language API acceleration for PPC64LE (V2)
Ben Crocker [Fri, 2 Jun 2017 23:37:55 +0000 (19:37 -0400)]
mapi: Enable assembly language API acceleration for PPC64LE (V2)

Implement assembly language API acceleration for PPC64LE,
analogous to long-standing implementations for X86 and X86-64.

See also similar implementation in libglvnd.

Tested with Piglit.

Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4 years agoi965: Add a RGBX->RGBA fallback for glEGLImageTextureTarget2D()
Chad Versace [Tue, 30 May 2017 19:27:54 +0000 (12:27 -0700)]
i965: Add a RGBX->RGBA fallback for glEGLImageTextureTarget2D()

This enables support for importing RGBX8888 EGLImage textures on
Skylake.

Chrome OS needs support for RGBX8888 EGLImage textures because because
the Android framework produces HAL_PIXEL_FORMAT_RGBX8888 winsys
surfaces, which the Chrome OS compositor consumes as dma_bufs.  On
hardware for which RGBX is unsupported or disabled, normally core Mesa
provides the RGBX->RGBA fallback during glTexStorage.  But the DRIimage
code bypasses core Mesa, so we must do the fallback in i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agomesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]
Chad Versace [Tue, 20 Jun 2017 23:53:36 +0000 (16:53 -0700)]
mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]

The new function takes a mesa_format and, if the format is an alpha
format with a non-alpha variant, returns the non-alpha format.
Otherwise, it returns the original format.

Example:
  input -> output

  // Fallback exists
  MESA_FORMAT_R8G8B8X8_UNORM -> MESA_FORMAT_R8G8B8A8_UNORM
  MESA_FORMAT_RGBX_UNORM16 -> MESA_FORMAT_RGBA_UNORM16

  // No fallback
  MESA_FORMAT_R8G8B8A8_UNORM -> MESA_FORMAT_R8G8B8A8_UNORM
  MESA_FORMAT_Z_FLOAT32 -> MESA_FORMAT_Z_FLOAT32

i965 will use this for EGLImages and DRIimages.

v2 (Jason Ekstrand):
 - Use mako
 - Rework to be easier to read
 - Write directly to the output file

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agoradeonsi: move instance divisors into a constant buffer
Marek Olšák [Fri, 9 Jun 2017 16:46:07 +0000 (18:46 +0200)]
radeonsi: move instance divisors into a constant buffer

Shader key size: 107 -> 47

Divisors of 0 and 1 are encoded in the shader key. Greater instance divisors
are loaded from a constant buffer.

The shader code doing the division is huge. Is it something we need to
worry about? Does any app use instance divisors >= 2?

VS prolog disassembly:
    s_load_dwordx4 s[12:15], s[0:1], 0x80  ; C00A0300 00000080
    s_nop 0                                ; BF800000
    s_waitcnt lgkmcnt(0)                   ; BF8C007F
    s_buffer_load_dword s14, s[12:15], 0x4 ; C0220386 00000004
    s_waitcnt lgkmcnt(0)                   ; BF8C007F
    v_cvt_f32_u32_e32 v4, s14              ; 7E080C0E
    v_rcp_iflag_f32_e32 v4, v4             ; 7E084704
    v_mul_f32_e32 v4, 0x4f800000, v4       ; 0A0808FF 4F800000
    v_cvt_u32_f32_e32 v4, v4               ; 7E080F04
    v_mul_hi_u32 v5, v4, s14               ; D2860005 00001D04
    v_mul_lo_i32 v6, v4, s14               ; D2850006 00001D04
    v_cmp_eq_u32_e64 s[12:13], 0, v5       ; D0CA000C 00020A80
    v_sub_i32_e32 v5, vcc, 0, v6           ; 340A0C80
    v_cndmask_b32_e64 v5, v6, v5, s[12:13] ; D1000005 00320B06
    v_mul_hi_u32 v5, v5, v4                ; D2860005 00020905
    v_add_i32_e32 v6, vcc, v5, v4          ; 320C0905
    v_subrev_i32_e32 v4, vcc, v5, v4       ; 36080905
    v_cndmask_b32_e64 v4, v4, v6, s[12:13] ; D1000004 00320D04
    v_mul_hi_u32 v5, v4, v1                ; D2860005 00020304
    v_add_i32_e32 v4, vcc, s8, v0          ; 32080008
    v_mul_lo_i32 v6, v5, s14               ; D2850006 00001D05
    v_add_i32_e32 v7, vcc, 1, v5           ; 320E0A81
    v_cmp_ge_u32_e64 s[12:13], v1, v6      ; D0CE000C 00020D01
    v_sub_i32_e32 v6, vcc, v1, v6          ; 340C0D01
    v_cmp_le_u32_e32 vcc, s14, v6          ; 7D960C0E
    v_cndmask_b32_e64 v8, 0, -1, s[12:13]  ; D1000008 00318280
    v_cndmask_b32_e64 v6, 0, -1, vcc       ; D1000006 01A98280
    v_and_b32_e32 v6, v8, v6               ; 260C0D08
    v_cmp_eq_u32_e32 vcc, 0, v6            ; 7D940C80
    v_cndmask_b32_e32 v6, v7, v5, vcc      ; 000C0B07
    v_add_i32_e32 v5, vcc, -1, v5          ; 320A0AC1
    v_cmp_eq_u32_e32 vcc, 0, v8            ; 7D941080
    v_cndmask_b32_e32 v5, v6, v5, vcc      ; 000A0B06
    v_add_i32_e32 v5, vcc, s9, v5          ; 320A0A09

v2: set prefer_mono for fetched instance divisors

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoradeonsi: check nr_cbufs in other places before flushing CB
Marek Olšák [Mon, 26 Jun 2017 22:32:47 +0000 (00:32 +0200)]
radeonsi: check nr_cbufs in other places before flushing CB

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoradeonsi: use #pragma pack to pack si_shader_key
Marek Olšák [Mon, 19 Jun 2017 23:21:19 +0000 (01:21 +0200)]
radeonsi: use #pragma pack to pack si_shader_key

sizeof(struct si_shader_key):
  Before reverting the 2 commits: 120 bytes
  After reverting the 2 commits: 128 bytes
  With #pragma pack: 107 bytes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoRevert "radeonsi: use uint32_t to declare si_shader_key.opt.kill_outputs"
Marek Olšák [Mon, 19 Jun 2017 23:12:47 +0000 (01:12 +0200)]
Revert "radeonsi: use uint32_t to declare si_shader_key.opt.kill_outputs"

This reverts commit 7b2240ac9ce3ba9bd86f4ae8aac53af8878c0b10.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agoRevert "radeonsi: remove 8 bytes from si_shader_key with uint32_t ff_tcs_inputs_to_copy"
Marek Olšák [Mon, 19 Jun 2017 23:12:38 +0000 (01:12 +0200)]
Revert "radeonsi: remove 8 bytes from si_shader_key with uint32_t ff_tcs_inputs_to_copy"

This reverts commit 6b6fed3a3c81c2b0d319ef121df20a0dc914705f.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agomesa: optimize GL_PRIMITIVE_RESTART_NV more
Marek Olšák [Thu, 22 Jun 2017 15:16:14 +0000 (17:16 +0200)]
mesa: optimize GL_PRIMITIVE_RESTART_NV more

And other client state changes don't have to call
update_derived_primitive_restart_state.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
4 years agomesa: fix clip plane enable breakage
Marek Olšák [Sat, 24 Jun 2017 01:16:06 +0000 (03:16 +0200)]
mesa: fix clip plane enable breakage

Broken by:

commit 00173d91b70ae4dcea7c6324ee4858c498cae14b
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Sat Jun 10 12:09:43 2017 +0200

    mesa: don't flag _NEW_TRANSFORM for st/mesa if possible

It also optimizes the case slightly for GL core.

It doesn't try to fix that glEnable might be a bad place to do the
clip plane transformation.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agoradeon/vcn: enable h264 decode entension support
Leo Liu [Fri, 23 Jun 2017 17:21:09 +0000 (13:21 -0400)]
radeon/vcn: enable h264 decode entension support

It's enabled through message buffer for UVD

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
4 years agosvga: clean up format_cap_table
Charmaine Lee [Mon, 26 Jun 2017 20:18:33 +0000 (14:18 -0600)]
svga: clean up format_cap_table

Per Jose's suggestion, this patch cleans up format_cap_table to remove
the unnecessary default cap value for vgpu10 formats since those devcap values
can be retrieved from the device.

Tested with MTT conform, glretrace, piglit in HWv13 and HWv8.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
4 years agosvga: fix the default devcap for SVGA3D_Z_D24S8_INT
Charmaine Lee [Mon, 12 Jun 2017 22:56:17 +0000 (15:56 -0700)]
svga: fix the default devcap for SVGA3D_Z_D24S8_INT

The default devcap for format SVGA3D_Z_D24S8_INT in HWv8 when its devcap is
not explicitly advertised should be set to zero to match the default value
in the device.

Tested with MTT piglit in HW version 8.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
4 years agosvga: create buffer surfaces for incompatible bind flags
Charmaine Lee [Wed, 16 Nov 2016 23:31:00 +0000 (15:31 -0800)]
svga: create buffer surfaces for incompatible bind flags

In cases where certain bind flags cannot be enabled together,
such as CONSTANT_BUFFER cannot be combined with any other flags,
a separate host surface will be created.
For example, if a stream output buffer is reused as a constant buffer,
two host surfaces will be created, one for stream output,
and another one for constant buffer. Data will be copied from the
stream output surface to the constant buffer surface.

Fixes piglit test ext_transform_feedback-immediate-reuse-index-buffer,
                  ext_transform_feedback-immediate-reuse-uniform-buffer

Tested with MTT piglit, MTT glretrace, Nature, NobelClinician Viewer, Tropics.

v2: Fix bind flags compatibility check as suggested by Brian.
v3: Use the list utility to maintain the buffer surface list.
v4: Use the SAFE rev of LIST_FOR_EACH_ENTRY

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
4 years agosvga: do not unconditionally enable streamout bind flag
Charmaine Lee [Tue, 15 Nov 2016 18:15:46 +0000 (10:15 -0800)]
svga: do not unconditionally enable streamout bind flag

Currently we unconditionally enable streamout bind flag at
buffer resource creation time. This is not necessary if the buffer
is never used as a streamout buffer. With this patch, we enable
streamout bind flag as indicated by the state tracker. If the buffer
is later bound to streamout and does not already has streamout bind
flag enabled, we will recreate the buffer with
the new set of bind flags. Buffer content will be copied
from the old buffer to the new one.

Tested with MTT piglit, Nature, Tropics, Lightsmark.

v2: Fix bind flags check as suggested by Brian.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
4 years agosvga: pass tobind_flags to svga_buffer_handle
Charmaine Lee [Mon, 26 Jun 2017 23:24:15 +0000 (17:24 -0600)]
svga: pass tobind_flags to svga_buffer_handle

This is to prepare for more bind_flags optimization
in subsequent patches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
4 years agosvga: pass bind_flags to surface create functions
Charmaine Lee [Fri, 11 Nov 2016 22:40:57 +0000 (14:40 -0800)]
svga: pass bind_flags to surface create functions

This is to prepare for other bind_flags optimization
in subsequent patches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
4 years agopipe_loader_sw: fix compilation warning
Brian Paul [Mon, 26 Jun 2017 20:40:58 +0000 (14:40 -0600)]
pipe_loader_sw: fix compilation warning

Add the new 'flags' parameter to pipe_loader_sw_create_screen().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>