mesa.git
5 years agomesa/main: split float-texture support checking in two
Erik Faye-Lund [Fri, 16 Nov 2018 09:49:55 +0000 (10:49 +0100)]
mesa/main: split float-texture support checking in two

On OpenGL ES 2.0, there's separate extensions adding support for
half-float and float textures. So we need to validate the enums
separately as well.

This also prevents these enums from incorrectly being allowed on
OpenGL ES 1.x, where there's no extension that enables this in the
first place.

While we're at it, remove the pointless default-case, and the seemingly
stale fallthrough comment.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow EXT_texture_sRGB_R8 enums before gles3
Erik Faye-Lund [Fri, 16 Nov 2018 10:30:34 +0000 (11:30 +0100)]
mesa/main: do not allow EXT_texture_sRGB_R8 enums before gles3

ctx->Extensions.EXT_texture_sRGB_R8 is set regardless of the API
that's used, so checking for those direcly will always allow the
enums from this extensions when they are supported by the driver.

There's no extension adding support for this on OpenGL ES before
version 3.0, so let's tighten the check.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow sRGB texture enums before gles3
Erik Faye-Lund [Fri, 16 Nov 2018 10:25:17 +0000 (11:25 +0100)]
mesa/main: do not allow sRGB texture enums before gles3

ctx->Extensions.EXT_texture_sRGB is set regardless of the API that's
used, so checking for those direcly will always allow the enums from
this extensions when they are supported by the driver.

There's no extension adding support for this on OpenGL ES before
version 3.0, so let's tighten the check.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow snorm-texture enums before gles3
Erik Faye-Lund [Fri, 16 Nov 2018 10:10:23 +0000 (11:10 +0100)]
mesa/main: do not allow snorm-texture enums before gles3

ctx->Extensions.EXT_texture_snorm is set regardless of the API
that's used, so checking for those direcly will always allow the
enums from this extensions when they are supported by the driver.

There's no extension adding support for this on OpenGL ES before
version 3.0, so let's tighten the check.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow floating-point texture enums on gles1
Erik Faye-Lund [Fri, 16 Nov 2018 10:07:01 +0000 (11:07 +0100)]
mesa/main: do not allow floating-point texture enums on gles1

ctx->Extensions.OES_texture_float is set regardless of the API
that's used, so checking for those direcly will always allow the
enums from this extensions when they are supported by the driver.

There's no extension enabling floating-point textures for OpenGL
ES 1.x, so we shouldn't allow those enums there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow type_2_10_10_10_REV enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 17:37:18 +0000 (18:37 +0100)]
mesa/main: do not allow type_2_10_10_10_REV enums before gles3

ctx->Extensions.EXT_texture_type_2_10_10_10_REV is set regardless of
the API that's used, so checking for those direcly will always enable
extensions when they are supported by the driver.

There's no corresponding extension for OpenGL ES 1.x/2.0, so we
shouldn't allow these enums there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow MESA_ycbcr_texture enums on gles
Erik Faye-Lund [Thu, 15 Nov 2018 17:08:33 +0000 (18:08 +0100)]
mesa/main: do not allow MESA_ycbcr_texture enums on gles

This extension requies OpenGL, and shouldn't be available on OpenGL ES.
So let's not allow the enums from it either.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow EXT_texture_shared_exponent enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 17:00:24 +0000 (18:00 +0100)]
mesa/main: do not allow EXT_texture_shared_exponent enums before gles3

ctx->Extensions.EXT_texture_shared_exponent is set regardless of the
API that's used, so checking for those direcly will always allow the
enums from this extensions when they are supported by the driver.

We also need to make sure this is enabled on OpenGL ES 3. Because the
check is repeated, let's introduce a helper.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow rg-textures enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 16:43:36 +0000 (17:43 +0100)]
mesa/main: do not allow rg-textures enums before gles3

EXT_packed_float isn't supported on OpenGL ES, we shouldn't allow
these enums there, before OpenGL ES 3.0 which also introduce support
for these enums.

Since this check is repeated a lot, let's make a helper for this.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow EXT_packed_float enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 16:19:44 +0000 (17:19 +0100)]
mesa/main: do not allow EXT_packed_float enums before gles3

EXT_packed_float isn't supported on OpenGL ES, we shouldn't allow
these enums there, before OpenGL ES 3.0 which also introduce support
for these enums.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow ARB_depth_buffer_float enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 16:02:32 +0000 (17:02 +0100)]
mesa/main: do not allow ARB_depth_buffer_float enums before gles3

Floating-point depth buffers are only supported on OpenGL 3.0, OpenGL ES
3.0, or if ARB_depth_buffer_float is supported. Because we checked a
driver capability rather than using an extension-check helper, we ended
up incorrectly allowing this on OpenGL ES 1.x and 2.x.

Since this logic is repeated, let's make a helper for it.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow integer-texture enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 15:55:46 +0000 (16:55 +0100)]
mesa/main: do not allow integer-texture enums before gles3

Integer textures shouldn't be implicitly exposed on OpenGL ES 1.x and
2.x, but because the code checked against a driver-capability rather
than using an extension-check helper, we ended up accidentally allowing
these enums on older versions when the driver supports it.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow ARB_texture_rgb10_a2ui enums before gles3
Erik Faye-Lund [Thu, 15 Nov 2018 15:40:31 +0000 (16:40 +0100)]
mesa/main: do not allow ARB_texture_rgb10_a2ui enums before gles3

ARB_texture_rgb10_a2ui isn't supported on OpenGL ES, we shouldn't expose
it there even if the driver supports it.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow stencil-texture enums on gles1
Erik Faye-Lund [Fri, 16 Nov 2018 08:56:34 +0000 (09:56 +0100)]
mesa/main: do not allow stencil-texture enums on gles1

ctx->Extensions.ARB_texture_stencil8 is set regardless of the API
that's used, so checking for those direcly will always allow the
enums from this extensions when they are supported by the driver.

So let's instead check for both ARB_texture_stencil8 and
OES_texture_stencil8, so we support depth textures on OpenGL and
OpenGL ES 2.0+. There's no extension enabling stencil-textures for
OpenGL ES 1.x, so we shouldn't allow those enums there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow depth-texture enums on gles1
Erik Faye-Lund [Fri, 16 Nov 2018 08:52:49 +0000 (09:52 +0100)]
mesa/main: do not allow depth-texture enums on gles1

ctx->Extensions.ARB_depth_texture is set regardless of the API that's
used, so checking for those direcly will always allow the enums from
this extensions when they are supported by the driver.

So let's instead check for both ARB_depth_texture and OES_depth_texture,
so we support depth textures on OpenGL and OpenGL ES 2.0+. There's no
extension enabling depth-textures for OpenGL ES 1.x, so we shouldn't
allow those enums there.

This fixes oes_packed_depth_stencil-depth-stencil-texture_gles1 on i965

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow astc enums on gles1
Erik Faye-Lund [Fri, 16 Nov 2018 08:51:26 +0000 (09:51 +0100)]
mesa/main: do not allow astc enums on gles1

ctx->Extensions.KHR_texture_compression_astc_ldr is set regardless of
the API that's used, so checking for those direcly will always enable
extensions when they are supported by the driver.

But there's no extension enabling ASTC for OpenGL ES 1.x, so we
shouldn't allow those enums there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow etc2 enums on gles1
Erik Faye-Lund [Thu, 15 Nov 2018 15:33:49 +0000 (16:33 +0100)]
mesa/main: do not allow etc2 enums on gles1

ctx->Extensions.ARB_ES3_compatibility is set regardless of the API
that's used, so checking for those direcly will always enable
extensions when they are supported by the driver.

But there's no extension enabling ETC2 for OpenGL ES 1.x, so we
shouldn't allow those enums there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: do not allow s3tc enums on gles1
Erik Faye-Lund [Thu, 15 Nov 2018 15:15:41 +0000 (16:15 +0100)]
mesa/main: do not allow s3tc enums on gles1

There's no extension enabling S3TC formats on OpenGL ES 1.x, so we
shouldn't allow these even if the driver can support it. So let's check
for EXT_texture_compression_s3tc instead of ANGLE_texture_compression_dxt,
which is supported on all other OpenGL variations.

We also need to use _mesa_has_EXT_texture_compression_s3tc() instead of
checking the driver cap directly, otherwise we end up enabling this on
OpenGL ES 1.x, as the API isn't checked.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: use _mesa_has_FOO_bar for compressed format checks
Erik Faye-Lund [Thu, 15 Nov 2018 15:07:32 +0000 (16:07 +0100)]
mesa/main: use _mesa_has_FOO_bar for compressed format checks

_mesa_has_FOO_bar() knows about the APIs these extensions should be
supported under, so let's use that to simplify these checks a bit.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: clean up integer texture check
Erik Faye-Lund [Thu, 15 Nov 2018 15:46:36 +0000 (16:46 +0100)]
mesa/main: clean up integer texture check

This makes the logic a little bit easier to follow, and reduce a bit of
repetition.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: clean up ES2_compatibility check
Erik Faye-Lund [Thu, 15 Nov 2018 17:40:26 +0000 (18:40 +0100)]
mesa/main: clean up ES2_compatibility check

This makes the logic a little bit easier to follow; this is *either*
about ES2 compatibility *or* about gles. GL_RGB565 was added already in
OpenGL ES 1.0.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: clean up OES_texture_float_linear check
Erik Faye-Lund [Fri, 16 Nov 2018 10:43:00 +0000 (11:43 +0100)]
mesa/main: clean up OES_texture_float_linear check

Using the _mesa_has_FOO_bar helpers is generally more safe and should
generally be prefered over checking driver-caps like this code did,
because the _mesa_has_FOO_bar helpers also verify the API type and
version.

This shouldn't have any practical effect here, as this function only
gets called for OpenGL ES 3.x right now. But if this was to change in
the future, this makes the function behave a lot more predictable.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: clean up S3_s3tc check
Erik Faye-Lund [Thu, 15 Nov 2018 15:01:49 +0000 (16:01 +0100)]
mesa/main: clean up S3_s3tc check

S3_s3tc is the extension that enables this functionality on desktop, so
let's check for that one. The _mesa_has_S3_s3tc() helper already
verifies the API according to the extension-table.

As for the second hunk, we currently already only expose
EXT_texture_compression_s3tc on desktop so by using the helper instead,
we get rid of this detail here, and once we enable it for GLES we'll
automaticall get the interaction right.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: rename format-check function
Erik Faye-Lund [Fri, 16 Nov 2018 09:58:12 +0000 (10:58 +0100)]
mesa/main: rename format-check function

_mesa_es3_error_check_format_and_type isn't specific to OpenGL ES 3.x,
it applies to all versions of OpenGL ES. So let's rename it to reflect
this.

While we're at it, let's also rename a helper function it uses similarly.
As the helper is static, we can also remove the namespacing-prefix from
the name.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agomesa/main: make _mesa_has_tessellation return bool
Erik Faye-Lund [Thu, 15 Nov 2018 14:57:10 +0000 (15:57 +0100)]
mesa/main: make _mesa_has_tessellation return bool

All other _mesa_has_foo functions return bool rather than GLboolean, so
let's follow that style here as well.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoi965: Fix -Wswitch on INTEL_COPY_STREAMING_LOAD
Chad Versace [Thu, 8 Nov 2018 20:55:35 +0000 (12:55 -0800)]
i965: Fix -Wswitch on INTEL_COPY_STREAMING_LOAD

The warning is emitted when building without INLINE_SSE41.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agonv50,nvc0: Fix gallium nine regression regarding sampler bindings
Karol Herbst [Sat, 24 Nov 2018 19:00:00 +0000 (20:00 +0100)]
nv50,nvc0: Fix gallium nine regression regarding sampler bindings

The new approach is that samplers don't get unbound even if they won't be used
in a draw and we should just leave them be as well.

Fixes a regression in multiple windows games using gallium nine and nouveau.

v2: adjust num_samplers to keep track of the highest sampler bound
v3: rework how to set the new value of num_samplers

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106577
Fixes: 4d6fab245eec3880e2a59424a579851f44857ce8
       "cso: don't track the number of sampler states bound"
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agod3dadapter9: use snprintf(..., "%s", ...) instead of strncpy
Andre Heider [Sun, 25 Nov 2018 09:49:59 +0000 (10:49 +0100)]
d3dadapter9: use snprintf(..., "%s", ...) instead of strncpy

Fixes -Wstringop-truncation compiler warnings.
See f836d799f9066adf58f36 "intel/decoder: use snprintf(..., "%s", ...) instead of strncpy"

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
5 years agoandroid: st/mesa: fix building error due to sched_getcpu()
Mauro Rossi [Fri, 30 Nov 2018 23:42:40 +0000 (00:42 +0100)]
android: st/mesa: fix building error due to sched_getcpu()

Android has cpufeatures library but pinning of threads is not supported
PIPE_OS_LINUX code path causes build error due to sched_getcpu() unavailable
thus we need to avoid setting HAVE_SCHED_GETCPU for Android

Fixes: 48f2160 ("st/mesa: regularly re-pin driver threads to the CCX where the app thread is")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agost/xvmc: Add X11 include path.
Vinson Lee [Mon, 5 Nov 2018 18:50:41 +0000 (10:50 -0800)]
st/xvmc: Add X11 include path.

This patch fixes this build error.

  CC       tests/xvmc_bench.o
In file included from tests/xvmc_bench.c:35:
tests/testlib.h:38:10: fatal error: 'X11/Xlib.h' file not found
         ^~~~~~~~~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoandroid: amd/addrlib: update Mesa's copy of addrlib
Mauro Rossi [Fri, 30 Nov 2018 22:36:59 +0000 (23:36 +0100)]
android: amd/addrlib: update Mesa's copy of addrlib

Needed to fix build error in addrlib in mesa for Android

Fixes: 776b911 ("amd/addrlib: update Mesa's copy of addrlib")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agovirgl: don't mark buffers as unclean after a write
Gurchetan Singh [Mon, 26 Nov 2018 17:54:05 +0000 (09:54 -0800)]
virgl: don't mark buffers as unclean after a write

We can mark the buffer unclean if it's ever bound as a TBO,
SSBO, ABO, or image.

This improves

dEQP-GLES3.performance.buffer.data_upload.function_call.map_buffer_range.new_specified_buffer.flag_write_full.stream_draw

from 9.58 MB/s to 451.17 MB/s.

v2: Track buffer cleanliness as a function of bindings (Ilia).
v3: virgl_modify_clean --> virgl_dirty_res (Erik)

Tested-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agovirgl: avoid large inline transfers
Gurchetan Singh [Mon, 26 Nov 2018 17:54:04 +0000 (09:54 -0800)]
virgl: avoid large inline transfers

We flush everytime the command buffer (16 kB) is full, which is
quite costly.

This improves

dEQP-GLES3.performance.buffer.data_upload.function_call.buffer_data.new_buffer.usage_stream_draw

from 111.16 MB/s to 1930.36 MB/s.

In addition, I made the benchmark produce buffers from 0 --> VIRGL_MAX_CMDBUF_DWORDS * 4,
and tried ((VIRGL_MAX_CMDBUF_DWORDS * 4) / 2), ((VIRGL_MAX_CMDBUF_DWORDS * 4) / 4), etc.

I didn't notice any clear differences, so let's just go with the most obvious
heuristic.

Tested-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agovirgl: quadruple command buffer size
Gurchetan Singh [Mon, 26 Nov 2018 17:54:03 +0000 (09:54 -0800)]
virgl: quadruple command buffer size

Tested running WebGL aquarium on Nvidia host (10,000 fishes)

This moves us from 7 fps to 9 fps.  After quadrupling, performance
gains diminish.

v2: Remove change ID (Erik)

Tested-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
5 years agoanv: flush pipeline before query result copies
Lionel Landwerlin [Thu, 29 Nov 2018 13:02:03 +0000 (13:02 +0000)]
anv: flush pipeline before query result copies

Pipeline state pending bits should be taken into account when copying
results.

In the particular bug below, the results of the
vkCmdCopyQueryPoolResults() command was being overwritten by the
preceding vkCmdCopyBuffer() with a same destination buffer. This is
because we copy the buffers using the 3D pipeline whereas we copy the
query results using the command streamer. Those pieces of HW work in
parallel and the results are somewhat undefined.

v2: Unconditionally flush the pipeline before copying the results
    (Jason)

v3: Wrap & expressions (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108894
Cc: mesa-stable@lists.freedesktop.org
5 years agoRevert "winsys/amdgpu: overallocate buffers for faster address translation on Gfx9"
Marek Olšák [Thu, 29 Nov 2018 19:45:42 +0000 (14:45 -0500)]
Revert "winsys/amdgpu: overallocate buffers for faster address translation on Gfx9"

I didn't mean to push this. I don't think it makes any difference.

This reverts commit f737fe00a047ae1ae9ec4e15a4ea8b578389f2f6.

5 years agodraw: fix infinite loop in line stippling
Roland Scheidegger [Fri, 23 Nov 2018 01:31:24 +0000 (02:31 +0100)]
draw: fix infinite loop in line stippling

The calculated length of a line may be infinite, if the coords we
get are bogus. This leads to an infinite loop in line stippling.
To prevent this test for this explicitly (although technically
on at least x86 sse it would actually work without the explicit
test, as long as we use the int-converted length value).
While here also get rid of some always-true condition.

Note this does not actually solve the root cause, which is that
the coords we receive are bogus after clipping. This seems a difficult
problem to solve. One issue is that due to float arithmetic, clip w
may become 0 after clipping if the incoming geometry is
"sufficiently degenerate", hence x/y/z ndc (and window) coords will
be all inf (or nan). Even with w not quite 0, I believe it's possible
we produce values which are actually outside the view volume.
(Also, x=y=z=w=0 coords in clipspace would be not considered subject
to clipping, and similarly result in all NaN coords.) We just hope for
now other draw stages (and rasterizers) can handle those relatively
safely (llvmpipe itself should be sort of robust against this, certainly
converstion to fixed point will produce garbage, it might fail a couple
assertions but should neither hang nor crash otherwise).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
5 years agonir: Fix assert in print_intrinsic_instr().
Józef Kucia [Mon, 26 Nov 2018 15:04:30 +0000 (16:04 +0100)]
nir: Fix assert in print_intrinsic_instr().

Signed-off-by: Józef Kucia <joseph.kucia@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agoamd/addrlib: update Mesa's copy of addrlib
Nicolai Hähnle [Mon, 19 Nov 2018 17:53:09 +0000 (18:53 +0100)]
amd/addrlib: update Mesa's copy of addrlib

Update to the internal master as of 2018-11-15.

This has a lot of gratuitous whitespace change, but on the plus
side it's built using the same tooling that's used for AMDVLK,
which should help going forward.

5 years agoac/surface/gfx9: let addrlib choose the preferred swizzle kind
Nicolai Hähnle [Thu, 28 Jun 2018 18:55:38 +0000 (20:55 +0200)]
ac/surface/gfx9: let addrlib choose the preferred swizzle kind

Our choices here are simply redundant as long as sin.flags is set
correctly.

(v2:
- remove unused function parameter)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoradv: remove dependency on addrlib gfx9_enum.h
Nicolai Hähnle [Mon, 19 Nov 2018 17:23:40 +0000 (18:23 +0100)]
radv: remove dependency on addrlib gfx9_enum.h

v2:
- use SI_CONTEXT_REG_OFFSET

Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agowinsys/svga: Fix a memory leak
Thomas Hellstrom [Mon, 26 Nov 2018 18:05:47 +0000 (19:05 +0100)]
winsys/svga: Fix a memory leak

The ioctl.cap_3d member was never freed.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agost/xa: Fix a memory leak
Thomas Hellstrom [Mon, 26 Nov 2018 18:02:08 +0000 (19:02 +0100)]
st/xa: Fix a memory leak

Free the context after destruction.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoradv: drop few useless state changes when doing color/depth decompressions
Samuel Pitoiset [Thu, 22 Nov 2018 18:10:15 +0000 (19:10 +0100)]
radv: drop few useless state changes when doing color/depth decompressions

Viewport/scissor don't need to be updated for array textures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: remove unused pending_clears param in the transition path
Samuel Pitoiset [Thu, 22 Nov 2018 18:10:14 +0000 (19:10 +0100)]
radv: remove unused pending_clears param in the transition path

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: optimize CmdClear{Color,DepthStencil}Image() for layered textures
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:15 +0000 (17:04 +0100)]
radv: optimize CmdClear{Color,DepthStencil}Image() for layered textures

If all layers are bound we can perform a fast color or depth clear
instead of iterating over all layers. This has the advantage
to avoid trashing the framebuffer for nothing if you we end up by
doing a fast clear when calling radv_clear_image_layer(), and
clearing all layers in one shot is obviously faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: refactor the fast clear path for better re-use
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:14 +0000 (17:04 +0100)]
radv: refactor the fast clear path for better re-use

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: simplify a check in emit_fast_color_clear()
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:13 +0000 (17:04 +0100)]
radv: simplify a check in emit_fast_color_clear()

Currently only true if RADV_PERFTEST=dccmsaa is set.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: add radv_can_fast_clear_{color,depth}() helpers
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:12 +0000 (17:04 +0100)]
radv: add radv_can_fast_clear_{color,depth}() helpers

For further optimisations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: add radv_image_view_can_fast_clear() helper
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:11 +0000 (17:04 +0100)]
radv: add radv_image_view_can_fast_clear() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: add radv_image_can_fast_clear() helper
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:10 +0000 (17:04 +0100)]
radv: add radv_image_can_fast_clear() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: remove useless check in emit_fast_color_clear()
Samuel Pitoiset [Fri, 23 Nov 2018 16:04:09 +0000 (17:04 +0100)]
radv: remove useless check in emit_fast_color_clear()

The driver doesn't support DCC/CMASK for mipmapped textures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agofreedreno: Fix autotools build.
Vinson Lee [Wed, 28 Nov 2018 21:21:50 +0000 (13:21 -0800)]
freedreno: Fix autotools build.

Fix build error.

  CXXLD    pipe_msm.la
../../../../src/gallium/drivers/freedreno/.libs/libfreedreno.a(freedreno_batch.o): In function `batch_init':
src/gallium/drivers/freedreno/freedreno_batch.c:54: undefined reference to `fd_device_version'
src/gallium/drivers/freedreno/freedreno_batch.c:59: undefined reference to `fd_submit_new'
src/gallium/drivers/freedreno/freedreno_batch.c:61: undefined reference to `fd_submit_new_ringbuffer'
src/gallium/drivers/freedreno/freedreno_batch.c:64: undefined reference to `fd_submit_new_ringbuffer'
src/gallium/drivers/freedreno/freedreno_batch.c:66: undefined reference to `fd_submit_new_ringbuffer'
src/gallium/drivers/freedreno/freedreno_batch.c:70: undefined reference to `fd_submit_new_ringbuffer'

Fixes: b4476138d5ad ("freedreno: move drm to common location")
Fixes: aa0fed10d357 ("freedreno: move ir3 to common location")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agoradeonsi: add memory management stress tests for GDS
Marek Olšák [Tue, 27 Nov 2018 01:55:26 +0000 (20:55 -0500)]
radeonsi: add memory management stress tests for GDS

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: add support for allocating GDS and OA resources
Marek Olšák [Tue, 27 Nov 2018 01:52:58 +0000 (20:52 -0500)]
winsys/amdgpu: add support for allocating GDS and OA resources

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradeonsi: allow si_cp_dma_clear_buffer to clear GDS from any IB
Marek Olšák [Sat, 22 Sep 2018 01:01:46 +0000 (21:01 -0400)]
radeonsi: allow si_cp_dma_clear_buffer to clear GDS from any IB

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: use optimal VM alignment for CPU allocations
Marek Olšák [Mon, 26 Nov 2018 22:16:59 +0000 (17:16 -0500)]
winsys/amdgpu: use optimal VM alignment for CPU allocations

Acked-by: Christian König <christian.koenig@amd.com>
5 years agowinsys/amdgpu: use optimal VM alignment for imported buffers
Marek Olšák [Mon, 26 Nov 2018 22:13:47 +0000 (17:13 -0500)]
winsys/amdgpu: use optimal VM alignment for imported buffers

Window system buffers didn't use the optimal alignment.

Acked-by: Christian König <christian.koenig@amd.com>
5 years agowinsys/amdgpu,radeon: pass vm_alignment to buffer_from_handle
Marek Olšák [Mon, 26 Nov 2018 22:06:20 +0000 (17:06 -0500)]
winsys/amdgpu,radeon: pass vm_alignment to buffer_from_handle

Acked-by: Christian König <christian.koenig@amd.com>
5 years agowinsys/amdgpu: overallocate buffers for faster address translation on Gfx9
Marek Olšák [Wed, 21 Nov 2018 23:06:54 +0000 (18:06 -0500)]
winsys/amdgpu: overallocate buffers for faster address translation on Gfx9

Sadly, the 3 games I tested (DeusEx:MD, DiRT Rally, DOTA 2) are unaffected
by the overallocation, because I guess their buffers don't fall into
the small range below a power-of-two size.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: increase the VM alignment to the MSB of the size for Gfx9
Marek Olšák [Fri, 23 Nov 2018 23:27:00 +0000 (18:27 -0500)]
winsys/amdgpu: increase the VM alignment to the MSB of the size for Gfx9

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: use >= instead of > for VM address alignment
Marek Olšák [Wed, 21 Nov 2018 22:28:13 +0000 (17:28 -0500)]
winsys/amdgpu: use >= instead of > for VM address alignment

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: clean up code around BO VM alignment
Marek Olšák [Fri, 23 Nov 2018 23:20:49 +0000 (18:20 -0500)]
winsys/amdgpu: clean up code around BO VM alignment

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agowinsys/amdgpu: optimize slab allocation for 2 MB amdgpu page tables
Marek Olšák [Wed, 21 Nov 2018 07:15:11 +0000 (02:15 -0500)]
winsys/amdgpu: optimize slab allocation for 2 MB amdgpu page tables

- the slab buffer size increased from 128 KB to 2 MB (PTE fragment size)
- the max suballocated buffer size increased from 64 KB to 256 KB,
  this increases memory usage because it wastes memory
- the number of suballocators increased from 1 to 3 and they are layered
  on top of each other to minimize unused space in slabs

The final increase in memory usage is:
  DeusEx:MD:  1.8%
  DOTA 2:     1.75%
  DiRT Rally: 0.2%

The kernel driver will also receive fewer buffers.

5 years agoradeonsi: generalize the slab allocator code to allow layered slab allocators
Marek Olšák [Wed, 21 Nov 2018 07:10:14 +0000 (02:10 -0500)]
radeonsi: generalize the slab allocator code to allow layered slab allocators

There is no change in behavior. It just makes it easier to change the number
of slab allocators.

5 years agowinsys/amdgpu: always reclaim/release slabs if there is not enough memory
Marek Olšák [Wed, 21 Nov 2018 05:22:48 +0000 (00:22 -0500)]
winsys/amdgpu: always reclaim/release slabs if there is not enough memory

5 years agoradeonsi: fix is_oneway_access_only for bindless images
Marek Olšák [Tue, 20 Nov 2018 03:29:00 +0000 (22:29 -0500)]
radeonsi: fix is_oneway_access_only for bindless images

5 years agoradeonsi/nir: parse more information about bindless usage
Marek Olšák [Tue, 20 Nov 2018 03:27:49 +0000 (22:27 -0500)]
radeonsi/nir: parse more information about bindless usage

fill more tgsi_shader_info fields.

5 years agotgsi/scan: add more information about bindless usage
Marek Olšák [Tue, 20 Nov 2018 03:27:15 +0000 (22:27 -0500)]
tgsi/scan: add more information about bindless usage

radeonsi will use this.

5 years agoradeonsi: small cleanup for memory opcodes
Marek Olšák [Tue, 20 Nov 2018 02:54:37 +0000 (21:54 -0500)]
radeonsi: small cleanup for memory opcodes

5 years agoradeonsi: fix is_oneway_access_only for image stores
Marek Olšák [Tue, 20 Nov 2018 02:53:55 +0000 (21:53 -0500)]
radeonsi: fix is_oneway_access_only for image stores

We need to look at the Dst for image stores.

5 years agoradeonsi: use structured buffer intrinsics for image views
Marek Olšák [Tue, 20 Nov 2018 01:36:35 +0000 (20:36 -0500)]
radeonsi: use structured buffer intrinsics for image views

to stop using the workaround in si_make_buffer_descriptor.

5 years agoradeonsi: clean up primitive binning enablement
Marek Olšák [Wed, 21 Nov 2018 01:58:17 +0000 (20:58 -0500)]
radeonsi: clean up primitive binning enablement

no change in behavior.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agovirgl: fix undefined shift to use unsigned.
Dave Airlie [Wed, 28 Nov 2018 23:07:35 +0000 (09:07 +1000)]
virgl: fix undefined shift to use unsigned.

Ported from virglrenderer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
5 years agor600: make suballocator 256-bytes align
Dave Airlie [Thu, 11 Oct 2018 03:44:02 +0000 (13:44 +1000)]
r600: make suballocator 256-bytes align

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108311
Cc: <mesa-stable@lists.freedesktop.org>
5 years agointel/compiler: Use nir's info when checking uses_streams.
Kenneth Graunke [Mon, 26 Nov 2018 22:58:54 +0000 (14:58 -0800)]
intel/compiler: Use nir's info when checking uses_streams.

Vulkan and Gallium don't use Mesa's gl_program data structure, so they
can't poke at 'prog'.  But we can simply use the copy of the shader info
stored with the NIR shader, which is guaranteed to exist.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
5 years agonir/derefs: Add a nir_derefs_do_not_alias enum value
Jason Ekstrand [Mon, 19 Nov 2018 18:32:16 +0000 (12:32 -0600)]
nir/derefs: Add a nir_derefs_do_not_alias enum value

This makes some of the code more clear.

Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
5 years agoegl: add missing #include <stddef.h> in egldevice.h
Gurchetan Singh [Wed, 28 Nov 2018 16:39:34 +0000 (08:39 -0800)]
egl: add missing #include <stddef.h> in egldevice.h

Otherwise, I get this error:

main/egldevice.h:54:13: error: ‘NULL’ undeclared (first use in this function)
       dev = NULL;
             ^~~~
with this config:

./autogen.sh --enable-gles1 --enable-gles2 --with-platforms='surfaceless' --disable-glx
             --with-dri-drivers="i965" --with-gallium-drivers="" --enable-gbm

v3: Use stddef.h (Matt)
v4: Modify commit message (Eric)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogallivm: Use nextafterf(0.5, 0.0) as rounding constant
Matt Turner [Wed, 21 Nov 2018 20:13:19 +0000 (12:13 -0800)]
gallivm: Use nextafterf(0.5, 0.0) as rounding constant

The common truncf(x + 0.5) fails for the floating-point value just less
than 0.5 (nextafterf(0.5, 0.0)). nextafterf(0.5, 0.0) + 0.5, after
rounding is 1.0, thus truncf does not produce the desired value.

The solution is to add nextafterf(0.5, 0.0) instead of 0.5 before
truncating. This works for all values.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agodocs: update calendar, add news item and link release notes for 18.2.6
Juan A. Suarez Romero [Wed, 28 Nov 2018 18:19:49 +0000 (19:19 +0100)]
docs: update calendar, add news item and link release notes for 18.2.6

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
5 years agodocs: add sha256 checksums for 18.2.6
Juan A. Suarez Romero [Wed, 28 Nov 2018 18:14:21 +0000 (19:14 +0100)]
docs: add sha256 checksums for 18.2.6

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

5 years agodocs: add release notes for 18.2.6
Juan A. Suarez Romero [Wed, 28 Nov 2018 17:39:26 +0000 (18:39 +0100)]
docs: add release notes for 18.2.6

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

5 years agoegl/wayland: rather obvious build fix
Nicolai Hähnle [Wed, 28 Nov 2018 17:30:36 +0000 (18:30 +0100)]
egl/wayland: rather obvious build fix

Fixes: ce74a7bb8de7 ("egl/wayland: plug memory leak in drm_handle_device()")
Fixes: c59d3aa4b9bc ("egl/wayland: bail out when drmGetMagic fails")
5 years agowinsys/amdgpu: explicitly declare whether buffer_map is permanent or not
Nicolai Hähnle [Wed, 21 Nov 2018 17:17:02 +0000 (18:17 +0100)]
winsys/amdgpu: explicitly declare whether buffer_map is permanent or not

Introduce a new driver-private transfer flag RADEON_TRANSFER_TEMPORARY
that specifies whether the caller will use buffer_unmap or not. The
default behavior is set to permanent maps, because that's what drivers
do for Gallium buffer maps.

This should eliminate the need for hacks in libdrm. Assertions are added
to catch when the buffer_unmap calls don't match the (temporary)
buffer_map calls.

I did my best to update r600 for consistency (r300 needs no changes
because it never calls buffer_unmap), even though the radeon winsys
ignores the new flag.

As an added bonus, this should actually improve the performance of
the normal fast path, because we no longer call into libdrm at all
after the first map, and there's one less atomic in the winsys itself
(there are now no atomics left in the UNSYNCHRONIZED fast path).

Cc: Leo Liu <leo.liu@amd.com>
v2:
- remove comment about visible VRAM (Marek)
- don't rely on amdgpu_bo_cpu_map doing an atomic write
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agowinsys/amdgpu: add amdgpu_winsys_bo::lock
Nicolai Hähnle [Wed, 21 Nov 2018 16:34:38 +0000 (17:34 +0100)]
winsys/amdgpu: add amdgpu_winsys_bo::lock

We'll use it in the upcoming mapping change. Sparse buffers have always
had one.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agovulkan/wsi: fix s/,/;/ typo
Eric Engestrom [Tue, 20 Nov 2018 17:35:27 +0000 (17:35 +0000)]
vulkan/wsi: fix s/,/;/ typo

Fixes: 59e58c348e6af16a5f2dd "vulkan/wsi: Only wait on semaphores on the first swapchain"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoegl/wayland: plug memory leak in drm_handle_device()
Emil Velikov [Tue, 27 Nov 2018 11:36:01 +0000 (11:36 +0000)]
egl/wayland: plug memory leak in drm_handle_device()

As we fail to open the node, we leak the node/device name.

v2: Log and then free() (Eric)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoegl/wayland: bail out when drmGetMagic fails
Emil Velikov [Fri, 23 Nov 2018 12:55:38 +0000 (12:55 +0000)]
egl/wayland: bail out when drmGetMagic fails

Currently as the function fails, we pass uninitialized data to the
authentication function. Stop doing that and print an warning when
the function fails.

v2: Plug memory leak in error path (Eric)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agowsi/display: fix mem leak when freeing swapchains
Eric Engestrom [Tue, 27 Nov 2018 13:34:37 +0000 (13:34 +0000)]
wsi/display: fix mem leak when freeing swapchains

Fixes: da997ebec92942193955 "vulkan: Add KHR_display extension using DRM [v10]"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
5 years agoi965: Set the FBO error state INCOMPLETE_ATTACHMENT only for SRGB_R8
Gert Wollny [Thu, 22 Nov 2018 18:00:03 +0000 (19:00 +0100)]
i965: Set the FBO error state INCOMPLETE_ATTACHMENT only for SRGB_R8

Originally the driver reported GL_FRAMEBUFFER_UNSUPPORTED in all cases,
adding more specific error messages was not correct and broke many tests.
Mostly revert this and only report GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
for MESA_FORMAT_R_SRGB8.

Fixes: ebcde3454552adc6d3fea8af2207aafaba857796
  i965: be more specific about FBO completeness errors

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agoi965: Explicitely handle swizzles for MESA_FORMAT_R_SRGB8
Gert Wollny [Thu, 22 Nov 2018 18:00:02 +0000 (19:00 +0100)]
i965: Explicitely handle swizzles for MESA_FORMAT_R_SRGB8

The format is emulated by using ISL_FORMAT_L8_SRGB, therefore we need to
force swizzles for the GBA channels. However, doing this only based on the
data type GL_RED breaks other formats, therefore, test specifically for the
format.

Fixes: c5363869d4971780401b21bb75083ef2518c12be
  i965: Force zero swizzles for unused components in GL_RED and GL_RG
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agovirgl: Don't try handling server fences when they are not supported
Gert Wollny [Tue, 27 Nov 2018 19:50:44 +0000 (20:50 +0100)]
virgl: Don't try handling server fences when they are not supported

vtest doesn't implement the according API and would segfault:

Program received signal SIGSEGV, Segmentation fault.
  #0  0x0000000000000000 in ?? ()
  #1  in virgl_fence_server_sync  at
       src/gallium/drivers/virgl/virgl_context.c:1049
  #2  in st_server_wait_sync  at
       src/mesa/state_tracker/st_cb_syncobj.c:155

so just don't do the call when the function pointers are not set.

Fixes dEQP:
  dEQP-GLES3.functional.fence_sync.wait_sync_smalldraw
  dEQP-GLES3.functional.fence_sync.wait_sync_largedraw

Fixes: d1a1c21e7621b5177febf191fcd3d3b8ef69dc96
  virgl: native fence fd support

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
5 years agovirgl,vtest: Initialize return value
Gert Wollny [Tue, 27 Nov 2018 19:50:43 +0000 (20:50 +0100)]
virgl,vtest: Initialize return value

Avoids:
Conditional jump or move depends on uninitialised value(s)
  at 0x9E2B39F: virgl_vtest_winsys_resource_cache_create (virgl_vtest_winsys.c:379)
  by 0x9E2725F: virgl_buffer_create (virgl_buffer.c:169)
  by 0x9E246D5: virgl_resource_create (virgl_resource.c:60)
  by 0xA0C1B9F: bufferobj_data (st_cb_bufferobjects.c:344)
  by 0xA0C1B9F: st_bufferobj_data (st_cb_bufferobjects.c:390)
  by 0x9F4ACE3: vbo_use_buffer_objects (vbo_exec_api.c:1136)
  by 0xA0C68C3: st_create_context_priv (st_context.c:416)
  by 0xA0C707A: st_create_context (st_context.c:598)
  by 0x9F81C6B: st_api_create_context (st_manager.c:918)
  by 0x9BBE591: dri_create_context (dri_context.c:161)
  by 0x9BB6931: driCreateContextAttribs (dri_util.c:473)
  by 0x4E97A44: drisw_create_context_attribs (drisw_glx.c:630)
  by 0x4E7C591: glXCreateContextAttribsARB (create_context.c:78)
Uninitialised value was created by a stack allocation
  at 0x9E2B249: virgl_vtest_winsys_resource_cache_create (virgl_vtest_winsys.c:342)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
5 years agointel/compiler: fix register allocation in opt_peephole_sel
Iago Toral Quiroga [Tue, 27 Nov 2018 07:57:13 +0000 (08:57 +0100)]
intel/compiler: fix register allocation in opt_peephole_sel

This wasn't handling 64-bit cases properly. Found by inspection.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
5 years agoglsl: Remove unused member variable
Matt Turner [Tue, 30 Oct 2018 12:36:02 +0000 (05:36 -0700)]
glsl: Remove unused member variable

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agonir: Call fflush() at the end of nir_print_shader()
Matt Turner [Mon, 26 Nov 2018 19:29:41 +0000 (11:29 -0800)]
nir: Call fflush() at the end of nir_print_shader()

We normally call with stderr which is unbuffered, so this won't affect
that, but it does let me call nir_print_shader(nir, fopen("log", "w+"))
from gdb and actually get the whole shader in my file.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agov3d: Add renderonly support.
Eric Anholt [Sat, 27 Oct 2018 01:02:20 +0000 (18:02 -0700)]
v3d: Add renderonly support.

I've been using this with the kmsro series to test v3d on VKMS without my
old KMS hack in the v3d kernel driver.  KMSRO still needs some cleanup,
but v3d RO support seems reasonable.

5 years agogallium: Remove unused variable in u_tests.
Eric Anholt [Tue, 27 Nov 2018 19:25:09 +0000 (11:25 -0800)]
gallium: Remove unused variable in u_tests.

Fixes: 0d17b685b1ff ("gallium/u_tests: add a compute shader test that clears an image")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoradv: Align large buffers to the fragment size.
Bas Nieuwenhuizen [Mon, 26 Nov 2018 02:28:05 +0000 (03:28 +0100)]
radv: Align large buffers to the fragment size.

Improves performance in Talos by about 15% (and significant improvements
in RotR and possibly other but did not bench with final patch) on
kernel 4.19 and earlier.

On 4.20+ a similar effect comes from

433ca054949a "drm/amdgpu: try allocating VRAM as power of two"

v2: Do not impact the alignment of the physical memory.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
5 years agofreedreno: implements get_sample_position
Hyunjun Ko [Wed, 7 Nov 2018 02:30:31 +0000 (11:30 +0900)]
freedreno: implements get_sample_position

Since 1285f71d3e landed, it needs to provide apps with proper sample
position for MSAA.

Currently no way to query this to hw, these are taken from blob driver.

Fixes: dEQP-GLES31.functional.texture.multisample.samples_#.sample_position
Signed-off-by: Rob Clark <robdclark@gmail.com>