Dave Airlie [Wed, 19 Jul 2017 02:56:04 +0000 (03:56 +0100)]
radv: introduce some wrapper in cs code to make porting off libdrm_amdgpu easier.
This just introduces a central semaphore info struct, and passes it around,
and introduces some wrappers that will make porting off libdrm_amdgpu easier.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Tim Rowley [Fri, 7 Jul 2017 18:58:09 +0000 (13:58 -0500)]
configure/swr: add KNL and SKX architecture targets
Not built by default. Currently only builds with icc.
v2:
* document knl,skx possibilities for swr_archs
* merge with changed loader lib selection code
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Tim Rowley [Fri, 7 Jul 2017 18:38:22 +0000 (13:38 -0500)]
configure/swr: configurable swr architectures
Allow configuration of the SWR architecture depend libraries
we build for with --with-swr-archs. Maintains current behavior
by defaulting to avx,avx2.
Scons changes made to make it still build and work, but
without the changes for configuring which architectures.
v2:
* add missing comma for swr_archs default
* check that at least one architecture is enabled
* modify loader logic to make it clearer how to add archs
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Tim Rowley [Wed, 19 Jul 2017 19:18:49 +0000 (14:18 -0500)]
gallium/util: fix nondeterministic avx512 detection
cpuid.7 requires cx=0 to select the extended feature leaf.
avx512 detection was using the non-indexed cpuid resulting
in random non-detection of avx512.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Marek Olšák [Wed, 19 Jul 2017 15:53:43 +0000 (11:53 -0400)]
drirc: whitelist War Thunder (Wine) for glthread
Nominated by František Zatloukal <zatloukal.frantisek@gmail.com>
Andres Gomez [Wed, 19 Jul 2017 16:14:03 +0000 (19:14 +0300)]
travis: add missing wayland-protocols
> checking for WAYLAND... no
>
> configure: error: Package requirements (wayland-client >= 1.11 wayland-server >= 1.11 wayland-protocols >= 1.8) were not met:
>
> No package 'wayland-protocols' found
>
> Consider adjusting the PKG_CONFIG_PATH environment variable if you
> installed software in a non-standard prefix.
>
> Alternatively, you may set the environment variables WAYLAND_CFLAGS
> and WAYLAND_LIBS to avoid the need to call pkg-config.
> See the pkg-config man page for more details.
Also, added extra path to PKG_CONFIG_PATH env variable.
Fixes:
02cc359372 ("egl/wayland: Use linux-dmabuf interface for buffers")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Mon, 17 Jul 2017 22:18:51 +0000 (15:18 -0700)]
anv/image: Fix VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
We incorrectly detected VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT. We looked
for the bit in VkImageCreateInfo::usage, but it's actually in
VkImageCreateInfo::flags.
Found by assertion failures while enabling VK_ANDROID_native_buffer.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Andres Gomez [Sat, 8 Jul 2017 19:59:41 +0000 (22:59 +0300)]
docs: update master's release notes, news and calendar commit
This reflects closer what we are actually doing.
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Andres Gomez [Sat, 8 Jul 2017 19:59:40 +0000 (22:59 +0300)]
docs: avoid overwrite of LD_LIBRARY_PATH during basic testing
The LD_LIBRARY_PATH environment variable could be already defined so
we extend it and restore it rather than just overwriting it.
v2:
- Unset the __old_ld helper variable when we are done with it.
- Corrected test for and escaping of variables (Eric).
v3: Remove unneeded variable (Emil).
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Andres Gomez [Sat, 8 Jul 2017 19:59:38 +0000 (22:59 +0300)]
docs: add instructions to specify LLVM version for basic testing
The "Perform basic testing" and "Use the release.sh script from xorg
util-modular" sections provide some instructions to do so. We add now
some comments in order to use a recent enough LLVM version to run
dist/distcheck and the automake generated binaries.
v2: Suggested the need to define LLVM_CONFIG also before running the
release.sh script.
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Eric Engestrom [Wed, 19 Jul 2017 14:30:32 +0000 (15:30 +0100)]
egl: fix line continuation
Trailing space after the backslash meant the rest of the AM_CFLAGS lines
were no longer included.
This has been silently ignored because of the next line starting with
a `-` dash, instructing make to be silent about that line.
Fixes:
02cc359372773800de81 "egl/wayland: Use linux-dmabuf interface for buffers"
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Eric Engestrom [Wed, 19 Jul 2017 13:30:06 +0000 (14:30 +0100)]
gbm: fix typo
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Eric Engestrom [Wed, 19 Jul 2017 09:12:17 +0000 (10:12 +0100)]
configure.ac: fix whitespace
Whitespace-only change (`diff -w` is empty).
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Lucas Stach [Fri, 23 Jun 2017 14:22:43 +0000 (16:22 +0200)]
etnaviv: advertise supported dmabuf modifiers
Simply advertise all supported modifiers, independent of the format.
Special formats, like compressed, which don't support all those modifiers
are already culled from the dmabuf format list, as we don't support
the render target binding for them.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Thu, 22 Jun 2017 13:14:31 +0000 (15:14 +0200)]
etnaviv: implement resource creation with modifier
This allows to create buffers with a specific tiling layout, which is primarily
used by GBM to allocate the EGL back buffers with the correct tiling/modifier
for use with the scanout engines.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Thu, 22 Jun 2017 11:56:24 +0000 (13:56 +0200)]
etnaviv: fill in modifier in etna_resource_get_handle
This allows the state trackers to know the tiling layout of the
resource and pass this through the various userspace protocols.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Thu, 22 Jun 2017 11:43:36 +0000 (13:43 +0200)]
etnaviv: fold etna_screen_bo_get_handle into etna_resource_get_handle
There is no point in keeping this indirection. Makes the code easier to
follow.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com> (v1)
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Thu, 22 Jun 2017 10:49:17 +0000 (12:49 +0200)]
etnaviv: implement resource import with modifier
This implements resource import with modifier, deriving the correct
internal layout from the modifier and constructing a render compatible
base resource if needed.
This removes the special cases for DDX and renderonly scanout allocated
buffers, as the linear modifier is enough to trigger correct handling
of those buffers.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Thu, 22 Jun 2017 14:02:10 +0000 (16:02 +0200)]
etnaviv: also update textures from external resources
This reworks the logic in etna_update_sampler_source to select the
newest resource view for updating the texture view. This should make
the logic easier to follow and fixes texture updates from imported
dma-bufs.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Lucas Stach [Thu, 22 Jun 2017 14:07:46 +0000 (16:07 +0200)]
etnaviv: increment correct seqno for external resources
If we import a dma-buf with a sampler/pixel pipe incompatible modifier,
the imported buffer will end up in an external resource view. As
resource_changed signals the change of the imported resource, we need
to update the external view seqno, instead of the base resource seqno.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Lucas Stach [Fri, 9 Jun 2017 16:44:46 +0000 (18:44 +0200)]
etnaviv: pad scanout buffer size to RS alignment
This fixes failures to import the scanout buffer with screen resolutions
that don't satisfy the RS alignment restrictions, like 1680x1050.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
Lucas Stach [Tue, 4 Jul 2017 14:19:51 +0000 (16:19 +0200)]
etnaviv: add helper to work out RS alignment
The minimum RS alignment calculation is needed in various places.
Extract a helper to avoid open-coding the calcuation at every site.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Lucas Stach [Fri, 9 Jun 2017 16:23:16 +0000 (18:23 +0200)]
renderonly/etnaviv: stop importing resource from renderonly
The current way of importing the resource from renderonly after allocation
is opaque and is taking away control from the driver, which it needs in
order to implement more advanced scenarios than the simple linear scanout
with matching stride alignments.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Lucas Stach [Wed, 19 Jul 2017 12:37:54 +0000 (14:37 +0200)]
configure.ac: bump required etnaviv libdrm version to 2.4.82
The following changes need the modifier definitions for the Vivante tiled
formats, which are shipped with libdrm 2.4.82.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Emil Velikov [Tue, 18 Jul 2017 11:22:21 +0000 (12:22 +0100)]
dri/common: use designated initializers for OptConfElems
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tomasz Figa [Tue, 18 Jul 2017 07:20:52 +0000 (16:20 +0900)]
gallium: auxiliary: Fix standalone Android build of u_cpu_detect (v2)
Commit
463b7d0332c5("gallium: Enable ARM NEON CPU detection.")
introduced CPU feature detection based Android cpufeatures library.
Unfortunately it also added an assumption that if PIPE_OS_ANDROID is
defined, the library is also available, which is not true for the
standalone build without using Android build system.
Fix it by defining HAS_ANDROID_CPUFEATURES in Android.mk and replacing
respective #ifdefs to use it instead.
v2:
- Add a comment explaining why the separate flag is needed (Emil).
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Emil Velikov [Thu, 13 Jul 2017 19:04:33 +0000 (20:04 +0100)]
egl: propagate EGL_BAD_ATTRIBUTE during EGLImage attr parsing
Earlier commit refactored/split the parsing into separate hunks.
While no functional change was intended, it did not attribute that
different error is set when the attrib. value is incorrect.
Fixes:
3ee2be4113d ("egl: split _eglParseImageAttribList into per
extension functions")
Cc: Michel Dänzer <michel@daenzer.net>
Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Emil Velikov [Mon, 17 Jul 2017 14:34:14 +0000 (15:34 +0100)]
swr: remove unneeded fallback strcasecmp define
The last user of the function was removed with earlier commit.
Fixes:
50842e8a931 ("swr: replace gallium->swr format enum conversion")
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
Emil Velikov [Fri, 7 Jul 2017 18:41:29 +0000 (19:41 +0100)]
st/dri: list __DRI2_FENCE extension only where needed
The extension should be present (if applicable) in the list returned by
getExtensions(). AFAICT no loader has ever looked for it in
__driDriverExtensions/__driDriverGetExtensions.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Emil Velikov [Fri, 7 Jul 2017 18:13:59 +0000 (19:13 +0100)]
swrast: add dri2ConfigQueryExtension to the correct extension list
The extension should be in the list as returned by getExtensions().
Seems to have gone unnoticed since close to nobody wants to change the
vblank mode for the software driver.
v2: Rebase
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Emil Velikov [Fri, 7 Jul 2017 18:08:42 +0000 (19:08 +0100)]
radeon: remove local vblank_mode option
Analogous to previous commits.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Emil Velikov [Fri, 7 Jul 2017 18:06:35 +0000 (19:06 +0100)]
i915: remove local vblank_mode option
Analogous to previous commit.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Emil Velikov [Fri, 7 Jul 2017 17:43:35 +0000 (18:43 +0100)]
i965: remove local vblank_mode option
The option is only queried from the loader, which has access to the
dri common code in src/mesa/drivers/dri/common/.
One could grant the loader access to brw_config_options but even
then, having the same option in both places is not a good idea.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Gwan-gyeong Mun [Tue, 18 Jul 2017 08:12:26 +0000 (17:12 +0900)]
egl/dri2: remove unused buffer_count variable
It removes unused buffer_count variable from dri2_egl_surface.
And it polishes the assert of dri2_drm_get_buffers_with_format().
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Gwan-gyeong Mun [Mon, 17 Jul 2017 15:21:32 +0000 (00:21 +0900)]
egl/drm: Format code in platform_drm.c according to style guide.
This is a tiny housekeeping patch which does the following:
* Limit lines to 78 or fewer characters.
According to the mesa coding style guidelines.
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Gwan-gyeong Mun [Mon, 17 Jul 2017 15:03:14 +0000 (00:03 +0900)]
egl/drm: add going out of the loop when the designated buffer is found
Because the color_buffers have a each unique bo, if the designated buffer is
found, release_buffer() can go out the loop which seaches the buffer.
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Gwan-gyeong Mun [Mon, 17 Jul 2017 14:01:27 +0000 (23:01 +0900)]
gbm: fix typo in doxygen comment
This fixes the misspelling of gbm_bo_import api param.
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Wed, 19 Jul 2017 08:51:23 +0000 (09:51 +0100)]
egl: Add MKDIR_GEN definition
Adding linux-dmabuf Wayland protocol files as generated did the right
thing, by prepending $(MKDIR_GEN) so autotools didn't try to write into
a build directory which didn't yet exist.
Unfortunately MKDIR_GEN needs to be defined in every Makefile it's used
in (which we do now), or alternately defined and substituted in
configure.ac (which we don't do), and src/egl/ didn't actually have it
from either method. As unset variables expand to nothing, it was
silently being skipped.
Copy & paste the defintion to make sure drivers/dri2/ exists before we
try to generate files into it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Nick Sarnie <commendsarnex@gmail.com>
Reported-by: Mike Lothian <mike@fireburn.co.uk>
Fixes:
02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
Kenneth Graunke [Thu, 13 Jul 2017 23:22:12 +0000 (16:22 -0700)]
util: Make CLAMP turn NaN into MIN.
The previous implementation of CLAMP() allowed NaN to pass through
unscathed, by failing both comparisons. NaN isn't exactly a value
between MIN and MAX, which can break the assumptions of many callers.
This patch changes CLAMP to convert NaN to MIN, arbitrarily. Callers
that need NaN to be handled in a specific manner should probably open
code something, or use a macro specifically designed to do that.
Section 2.3.4.1 of the OpenGL 4.5 spec says:
"Any representable floating-point value is legal as input to a GL
command that requires floating-point data. The result of providing a
value that is not a floating-point number to such a command is
unspecified, but must not lead to GL interruption or termination.
In IEEE arithmetic, for example, providing a negative zero or a
denormalized number to a GL command yields predictable results,
while providing a NaN or an infinity yields unspecified results."
While CLAMP may apply to more than just GL inputs, it seems reasonable
to follow those rules, and allow MIN as an "unspecified result".
This prevents assertion failures in i965 when running the games
"XCOM: Enemy Unknown" and "XCOM: Enemy Within", which call
glTexEnv(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT,
-nan(0x7ffff3));
presumably unintentionally. i965 clamps the LOD bias to be in range,
and asserts that it's in the proper range when converting to fixed
point. NaN is not, so it crashed. We'd like to at least avoid that.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Kenneth Graunke [Tue, 18 Jul 2017 04:08:42 +0000 (21:08 -0700)]
nir: Use nir_src_copy instead of direct assignments.
If the source is an indirect register, there is ralloc'd data. Copying
with a direct assignment will copy the pointer, but the data will still
belong to the old instruction's memory context. Since we're lowering
and throwing away instructions, that could free the data by mistake.
Instead, use nir_src_copy, which properly handles this.
This is admittedly not a common case, so I think the bug is real,
but unlikely to be hit.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Timothy Arceri [Thu, 25 May 2017 02:29:20 +0000 (12:29 +1000)]
glsl: disable array splitting for AoA
While it produces functioning code the pass creates worse code
for arrays of arrays. See the comment added in this patch for more
detail.
V2: skip splitting of AoA of matrices too.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Timothy Arceri [Fri, 30 Jun 2017 02:03:18 +0000 (12:03 +1000)]
nir: fix nir_opt_copy_prop_vars() for arrays of arrays
Previously we only incremented the guide for a single
dimension/wildcard.
V2: rework logic to avoid code duplication
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Jason Ekstrand [Tue, 18 Jul 2017 23:50:39 +0000 (16:50 -0700)]
nir/vars_to_ssa: Handle missing struct members in foreach_deref_node
This can happen if, for instance, you have an array of structs and there
are both direct and wildcard references to the same struct and some
members only have direct or only have indirect.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Cc: mesa-stable@lists.freedesktop.org
Kenneth Graunke [Sun, 23 Apr 2017 03:00:14 +0000 (20:00 -0700)]
i965/blorp: Use the return value of brw_emit_reloc.
This guarantees that the value written in the batch matches the
value recorded in the relocation entry.
(Chris Wilson wrote an identical patch as well.)
Kenneth Graunke [Tue, 18 Jul 2017 06:57:04 +0000 (23:57 -0700)]
i965: Delete dead brw_program_reloc function.
Rafael eliminated the last use of brw_program_reloc recently.
Rafael Antognolli [Wed, 21 Jun 2017 18:13:48 +0000 (11:13 -0700)]
i965: Convert WM_STATE to genxml on gen4-5.
The code doesn't get exactly a lot simpler but at least it is in a single
place, and we delete more than we add.
Another good point is that you get rid of struct brw_wm_unit_state
which was a third mechanism for encoding GEN state. We used to have
GENXML, manual packing and these bitfield structs. Now we're down to
just GENXML and some manual packing. (Khristian)
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Rafael Antognolli [Fri, 14 Jul 2017 18:02:57 +0000 (11:02 -0700)]
i965: Convert CLIP_STATE to genxml.
Add the code into its own function and atom, since almost nothing is
shared with GEN >= 6.
v2: Split GEN <=5 and GEN >= 6 into separate functions (Ken).
v3: Minor tidying by Ken.
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Daniel Stone [Fri, 16 Jun 2017 17:01:23 +0000 (18:01 +0100)]
egl/wayland: Use linux-dmabuf interface for buffers
When available, use the zwp_linux_dambuf_v1 interface to create buffers,
which allows multiple planes and buffer modifiers to be used.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 16:37:19 +0000 (17:37 +0100)]
egl/wayland: Remove duplicate wl_buffer creation code
Now create_wl_buffer is generic enough, we can use it for the
EGL_WL_create_wayland_buffer_from_image extension.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 16:33:56 +0000 (17:33 +0100)]
egl/wayland: Remove more surface specifics from create_wl_buffer
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 16:29:42 +0000 (17:29 +0100)]
egl/wayland: Make create_wl_buffer more generic
Remove surface-specific code from create_wl_buffer, so it's now just a
generic translation from DRIimage to wl_buffer.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 13:28:42 +0000 (14:28 +0100)]
gbm: Remove is_planar_format dead code
This was only used in create_dumb() to blacklist planar formats.
However, the start of the function already whitelists ARGB8888 (cursor)
and XRGB8888 (scanout), and nothing else. So this entire function can be
removed.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 13:19:40 +0000 (14:19 +0100)]
gbm: Check harder for supported formats
Luckily no-one really used the is_format_supported() call, because it
only supported three formats.
Also, since buffers with alpha can be displayed on planes, stop banning
them from use.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 13:11:16 +0000 (14:11 +0100)]
gbm: Pull out FourCC <-> DRIimage format table
Rather than duplicated (yet asymmetric) open-coded tables, pull them out
to a common structure.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Daniel Stone [Fri, 16 Jun 2017 09:28:03 +0000 (10:28 +0100)]
gbm: Axe buffer import format conversion table
Wayland buffers coming from wl_drm use the WL_DRM_FORMAT_* enums, which
are identical to GBM_FORMAT_*. Similarly, FD imports do not need to
convert between GBM and DRI FourCC, since they are (almost) completely
compatible.
This widens the formats accepted by gbm_bo_import() when importing
wl_buffers; previously, only XRGB8888, ARGB8888, RGB565 and YUYV were
supported.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Topi Pohjolainen [Mon, 5 Jun 2017 10:00:49 +0000 (13:00 +0300)]
i965/gen4: Set tile offsets to zero after depth rebase
Current logic calls intel_renderbuffer_set_draw_offset() which in
turn tries to calculate x and y offset against layer/level settings
that are against the original miptree actually having sufficient
levels/layers. This returns correctly x=0 y=0 regardless of the given
layer/level only because one calls intel_miptree_get_image_offset()
which goes and consults miptree offset table which in turn luckily
contains entries for max-mipmap levels, all initialised to zero even
in case of non-mipmapped.
This patch stops consulting the table and simply sets the draw
offsets to zero that are compatible with the single slice miptree
backing the renderbuffer.
This prepares for ISL based miptrees that calculate offsets
on-demand and do not tolerate levels beyond what the miptree has.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Mon, 29 May 2017 12:17:48 +0000 (15:17 +0300)]
i965: Refactor check for separate stencil
v2 (Jason): s/needs_stencil/needs_separate_stencil/
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Fri, 7 Jul 2017 08:33:12 +0000 (11:33 +0300)]
intel/blorp/gen4: Drop cube map flag for single face copy
This will falsely trigger an assert on number of layers once
isl is used for 3D layouts of Gen4 cube maps.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Wed, 28 Jun 2017 06:22:14 +0000 (09:22 +0300)]
i965/wm: Use level offsets directly
dropping dependency to slice table.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Wed, 28 Jun 2017 06:14:02 +0000 (09:14 +0300)]
i965: Use offset helper in intel_readpixels_tiled_memcpy()
providing support for isl based.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Mon, 3 Jul 2017 06:57:00 +0000 (09:57 +0300)]
i965/miptree: Pass flags instead of explicit tiling to surface creator
allowing one to use isl tiling filter.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Thu, 29 Jun 2017 14:03:01 +0000 (17:03 +0300)]
i965/miptree: Add pitch override for imported buffer objects
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Tue, 27 Jun 2017 18:52:19 +0000 (21:52 +0300)]
i965/miptree: Stop setting total_width/height for existing bo
Now that image surface vertical slice calculator doesn't depend
on total_height, total dimensions are only needed when new buffer
objects are created. Therefore one can safely ignore them when
miptrees are created for already exisiting buffer objects.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Tue, 27 Jun 2017 19:39:32 +0000 (22:39 +0300)]
i965/wm: Use isl for filling tex image parameters
This helps to drop dependency to miptree::total_height which is
used in brw_miptree_get_vertical_slice_pitch().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Tue, 18 Jul 2017 05:53:16 +0000 (08:53 +0300)]
intel/isl: Take 3D surfaces into account in image params
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Tue, 20 Jun 2017 14:36:46 +0000 (17:36 +0300)]
i965/miptree: Check for miptree_create() failures
Rest of the function assumes it always succeeds.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Thu, 22 Jun 2017 08:26:05 +0000 (11:26 +0300)]
i965/miptree: Do not rely on msaa type to decide if aux is needed
Once the driver moves to ISL both compressed and uncompressed have
the same type. One needs to tell them apart by other means. This
can be done by checking the existence of mcs_buf.
There is a short period of time within intel_miptree_create()
where mcs_buf doesn't exist yet (between calls to
intel_miptree_create_layout() and intel_miptree_alloc_mcs()).
First compute_msaa_layout() makes the decision if compression is
to be used and sets the msaa_layout type. Then based on the type
one sets aux_usage and finally decides if mcs_buf is needed.
This patch duplicates the logic in compute_msaa_layout() and uses
that to make the decision on aux_usage and mcs_buf allocation.
Most of the original logic in compute_msaa_layout() will be gone
in later patch leaving only one version.
Elsewhere only brw_populate_sampler_prog_key_data() needs to know
if compression is used based on the msaa_type. This is now
replaced with consideration for number of samples and existence
of mcs_buf. All other occurrences consider CMS || UMS which can
be represented using single the type of ISL_MSAA_LAYOUT_ARRAY
without any tweaks.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Thu, 29 Jun 2017 07:36:58 +0000 (10:36 +0300)]
i965: Make irb::mt_layer logical instead of physical
same as irb::layer_count. In case of copies and blits msaa
surfacas already fall to blorp which natively works with logical
slices.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Fri, 30 Jun 2017 17:56:01 +0000 (20:56 +0300)]
i965/tex: Use offset helper instead of accessing table directly
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Wed, 28 Jun 2017 05:33:14 +0000 (08:33 +0300)]
i965: Mark read-only args as const in intel_miptree_supports_hiz()
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Wed, 28 Jun 2017 08:40:15 +0000 (11:40 +0300)]
i965/miptree: Use > 1 instead of > 0 to check for multisampling
Checking against zero currently works as single sampling is
represented with zero. Once one moves to isl single sampling
really has sample number of one.
This keeps later patches simpler.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Topi Pohjolainen [Mon, 3 Jul 2017 11:23:35 +0000 (14:23 +0300)]
i965/miptree: Set refcount before failing via _release()
Otherwise one wraps uint to UINT_MAX via -1.
Fixes:
3cf470f2b6c ("i965: Add isl based miptree creator")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Kenneth Graunke [Tue, 18 Jul 2017 18:09:37 +0000 (11:09 -0700)]
build: Add $(top_srcdir)/src/compiler/spirv to AM_CPPFLAGS
Generated C files try to include spirv_info.h. For in-tree builds,
the header is in the same directory, so it just works. For out-of-tree
builds, we need to look for it in srcdir rather than builddir.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101831
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Marek Olšák [Mon, 17 Jul 2017 20:03:29 +0000 (16:03 -0400)]
radeonsi: add back the USE_MININUM_PRIORITY flag to the low-prio compiler queue
Accidentally removed in
9f320e0a387a1009c5218daf130b3b754a3c2800.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Jason Ekstrand [Tue, 18 Jul 2017 16:49:13 +0000 (09:49 -0700)]
compiler/spirv: Add a .gitignore and ignore spirv_info.c
Jason Ekstrand [Tue, 16 May 2017 15:35:07 +0000 (08:35 -0700)]
anv: Advertise support for VK_KHR_variable_pointers
We don't support the general version yet because that requires us to
lower shared variables up-front in SPIR-V -> NIR. This shouldn't be a
whole lot of work but it's not something we support today.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Thu, 29 Jun 2017 17:26:53 +0000 (10:26 -0700)]
anv: Advertise support for VK_KHR_storage_buffer_storage_class
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Wed, 28 Jun 2017 07:45:36 +0000 (00:45 -0700)]
nir/spirv: Add support for SPV_KHR_variable_pointers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Wed, 28 Jun 2017 09:50:33 +0000 (02:50 -0700)]
nir/spirv: Add a helper for pushing SSA values
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Wed, 28 Jun 2017 23:31:06 +0000 (16:31 -0700)]
nir/spirv: Implement OpPtrAccessChain for buffers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Wed, 5 Jul 2017 22:30:22 +0000 (15:30 -0700)]
spirv/nir: Add some useful asserts for type decorations
Now that vtn_type has piles of unions, we should assert sanity before
setting fields that may stomp others.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Jason Ekstrand [Tue, 16 May 2017 15:34:50 +0000 (08:34 -0700)]
spirv: Add support for the StorageBuffer storage class
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Ian Romanick [Mon, 17 Jul 2017 19:31:06 +0000 (12:31 -0700)]
spirv: Generate spirv_info.c
The old table based spirv_*_to_string functions would return NULL for
any values "inside" the table that didn't have entries. The tables also
needed to be updated by hand each time a new spirv.h was imported.
Generate the file instead.
v2: Make this script work more like src/mesa/main/format_fallback.py.
Suggested by Jason. Remove SCons supports. Suggested by Jason and
Emil. Put all the build work in Makefile.nir.am in lieu of adding a new
Makefile.spirv.am. Suggested by Emil. Add support for Android builds
based on code provided by Emil.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Ian Romanick [Sat, 15 Jul 2017 01:39:02 +0000 (18:39 -0700)]
spirv: Import the lastest 1.0.2 JSON from Khronos
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 13 Jul 2017 19:36:59 +0000 (12:36 -0700)]
spirv: Import the latest 1.2 header from Khronos
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Brian Paul [Mon, 17 Jul 2017 18:31:57 +0000 (12:31 -0600)]
mesa: whitespace fixes in get.c
Remove trailing whitespace.
Replace tabs with spaces.
Trivial.
Brian Paul [Mon, 17 Jul 2017 18:09:42 +0000 (12:09 -0600)]
mesa: fix GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT query
This query is not allowed in GL core profile 3.3 and later (since
GL_QUADS and GL_QUAD_STRIP are disallowed). The query was (mistakenly)
supported in GL 3.2. This fixes the glGet error test accordingly.
Reviewed-by: Neha Bhende<bhenden@vmware.com>
Eric Engestrom [Tue, 18 Jul 2017 10:06:43 +0000 (11:06 +0100)]
vulkan/util: fix typo in comment
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Samuel Pitoiset [Mon, 17 Jul 2017 20:40:49 +0000 (22:40 +0200)]
mapi: add missing no_error tag to glBlitNamedFramebuffer()
Fixes:
6fedb31785 ("mesa: add KHR_no_error support for glBlitNamedFramebuffer()")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Alex Smith [Mon, 17 Jul 2017 10:14:33 +0000 (11:14 +0100)]
radv: Set the RADEON_SURF_OPTIMIZE_FOR_SPACE flag for images
This looks like a regression from
df301237940 ("radv: use
ac_compute_surface"). Before that, the opt4Space addrlib flag was set
to true unless the image has FMASK (ac_compute_surface will similarly
only set that flag for images without FMASK).
This saves multiple gigabytes of VRAM on one of our games, and brings
its VRAM utilisation on RADV in line with AMDGPU-PRO and NVIDIA.
Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 12 Jun 2017 19:54:08 +0000 (05:54 +1000)]
radv: don't shadow meta_va.
Coverity warned about dead code below, as meta_va was being shadowed.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Kenneth Graunke [Tue, 18 Jul 2017 05:42:50 +0000 (22:42 -0700)]
i965: Delete brw_sf_state.c again
"...and stay dead!"
Rafael deleted this file in
c2b5a26dc25b9c62954a75465e25294c7fd3851a
(i965: Convert SF_STATE to genxml.) but Marek accidentally brought it
back in commit
e7a091936fb6fd578c6ced9baa38b306b638a11b (mesa: replace
ctx->Polygon._FrontBit with a helper function) when resolving conflicts.
It's not actually even compiled, but it's still here trolling people
into thinking it still exists and needs patching.
Connor Abbott [Mon, 26 Jun 2017 22:50:07 +0000 (15:50 -0700)]
ac/nir: rewrite shared variable handling (v2)
Translate the NIR variables directly to LLVM instead of lowering to a
TGSI-style giant array of vec4's and then back to a variable. This
should fix indirect dereferences, make shared variables more tightly
packed, and make LLVM's alias analysis more precise. This should fix an
upcoming Feral title, which has a compute shader that was failing to
compile because the extra padding made us run out of LDS space.
v2: Combine the previous two patches into one, only use this for shared
variables for now until LLVM becomes smarter.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Alex Smith <asmith@feralinteractive.com>
Jason Ekstrand [Sun, 16 Jul 2017 23:54:44 +0000 (16:54 -0700)]
i965: Check if the modifier is supported in select_best_modifier
Otherwise, if a client gave us a list of modifiers that contained a
modifier we understand but which is not supported on the hardware, we
might return that one and then fail to create the image.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Jason Ekstrand [Sun, 16 Jul 2017 23:35:22 +0000 (16:35 -0700)]
i965: Rework the modifier info map
This commit splits the mapping in half. The modifier_infos table now
only contains the modifier and the since_gen field. The tiling bits
have been moved into a table in tiling_to_modifier as that's the only
place it was ever used. The modifier_is_supported function now takes a
devinfo and does the since_gen check.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Jason Ekstrand [Fri, 14 Jul 2017 22:28:21 +0000 (15:28 -0700)]
i965/surface_state: Remove the mcs_buf->offset == 0 restriction
This assert was removed in
b0cc55f29831638069407a4c1a5c809b26902ab6 but
got added back in
1a43d774b613d0b00e26b28cc752d944ce8049aa, probably by
accident.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Tue, 13 Jun 2017 20:35:15 +0000 (13:35 -0700)]
intel/isl: Add a row_pitch parameter to surf_get_ccs_surf
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Thu, 13 Jul 2017 00:14:49 +0000 (17:14 -0700)]
i965/miptree: Use BO_ALLOC_ZEROED for CCS_E buffers
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Thu, 13 Jul 2017 00:06:29 +0000 (17:06 -0700)]
i965/screen: Allocate ZEROED BOs for images
Reviewed-by: Chad Versace <chadversary@chromium.org>
Jason Ekstrand [Wed, 12 Jul 2017 23:48:43 +0000 (16:48 -0700)]
i965/bufmgr: Add a BO_ALLOC_ZEROED flag
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>