OSDN Git Service

android-x86/external-mesa.git
7 years agoradv: fix stencil only clears.
Dave Airlie [Tue, 2 May 2017 05:29:28 +0000 (15:29 +1000)]
radv: fix stencil only clears.

If we are clearing stencil only, we still need to provide a
a valid Z output from the vertex shader, we can't rely
on the depth clear value having any meaning, as we use this
for the position output, and it could get clipped, so we
don't end up clearing anything.

Fixes:
dEQP-VK.renderpass.simple.stencil
since I added S8 support.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 3c730639740f9b1243e95d06e6608cb54649be9a)

7 years agoradv/wsi: report presentation error per image request
Dave Airlie [Tue, 2 May 2017 03:40:36 +0000 (13:40 +1000)]
radv/wsi: report presentation error per image request

This ports
0fcb92c17dee681bd39c08ddf0abc358a27337c7
anv: wsi: report presentation error per image request

This fixes:
dEQP-VK.wsi.xlib.incremental_present.scale_none.*

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 09034aab64c7a6022a2c508658fead1442f08576)

7 years agoi915: Fix build break with empty unreachable()
Daniel Stone [Fri, 5 May 2017 17:24:44 +0000 (18:24 +0100)]
i915: Fix build break with empty unreachable()

Actually put something in unreachable(), so as not to break the build on
a Friday evening.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit d4342b1398a001af1192497ca4db3a304f98c309)
Fixes: 467332a0ab2 ("i965: Use helper function for modifier -> tiling")
Fixes: 8b8af19065a ("i965: Set modifier for imported and duplicated images")

7 years agoUpdate version to 17.1.0-rc4
Emil Velikov [Mon, 8 May 2017 10:40:34 +0000 (11:40 +0100)]
Update version to 17.1.0-rc4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoradv: apply the tess+GS hang workaround to Polaris12 as well
Dave Airlie [Sat, 6 May 2017 20:14:11 +0000 (21:14 +0100)]
radv: apply the tess+GS hang workaround to Polaris12 as well

As I pointed out for radeonsi, and AMD confirmed, so fix this
in radv as well.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 2add79a73291e40621081b9a12938ac1931b9e96)

7 years agoradv/meta: fix restoring a push descriptor set
Fredrik Höglund [Tue, 2 May 2017 15:09:27 +0000 (17:09 +0200)]
radv/meta: fix restoring a push descriptor set

radv_bind_descriptor_set cannot be used to bind a push descriptor set
since a push descriptor set does not have a buffer list. However,
there is no need to add the buffers again when restoring a set, so
this fix is also an optimization.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 5ff48581119258214801de24a327bdd6a29e0ccc)
[Emil Velikov: resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/amd/vulkan/radv_meta.c

7 years agoi965: Don't try to unmap NULL program cache BO.
Kenneth Graunke [Thu, 4 May 2017 02:24:32 +0000 (19:24 -0700)]
i965: Don't try to unmap NULL program cache BO.

When running shader-db with intel_stub and recent Mesa, context creation
fails when making a logical hardware context.  In this case, we call
intelDestroyContext(), which gets here and tries to unmap the cache BO.

But there isn't one - we haven't made it yet.  So we try to unmap a
NULL pointer, which used to be safe (it did nothing), but crashes
after commit 7c3b8ed87859bfdfb985d21685115a729f9cd138.

The result is that we crash rather than failing context creation with
a nice message.  Either way nothing works, but this is more polite.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit bc074a45180eddf30ea723bbdf89895e2c7684ca)

7 years agoRevert "mesa: Require mipmap completeness for glCopyImageSubData(), sometimes."
Kenneth Graunke [Fri, 5 May 2017 16:20:56 +0000 (09:20 -0700)]
Revert "mesa: Require mipmap completeness for glCopyImageSubData(), sometimes."

This reverts commit c5bf7cb52942cb7df9f5d73746ffbf3c102d12cc.

This broke rendering in "Total War: WARHAMMER", which uses a single
level RGBA_UINT32 texture and the default filter modes of GL_LINEAR
and GL_NEAREST_MIPMAP_LINEAR.  However, the texture max level is 0,
so it is actually mipmap complete - it's the integer + linear rule
that causes the error.

I'm working with Khronos to find a real solution.  However it turns
out, this patch is not correct and breaks real programs, so let's
revert it for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100690
Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1456da91c8a14f77dd347981e2bc95e0644e0fd2)

7 years agofreedreno/a3xx: fix hang w/ large render targets and small gmem
Rob Clark [Sat, 6 May 2017 18:00:35 +0000 (14:00 -0400)]
freedreno/a3xx: fix hang w/ large render targets and small gmem

Possibly other gen's have a similar limit.  Fixes glmark2 -b shadow
with larger resolutions on devices with small gmem (for example,
fullscreen 1080p on 8x16/db410c).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 6050d5bf3d8d0043386de35cad4efa77e8be957e)

7 years agoi965: Set modifier for imported and duplicated images
Daniel Stone [Wed, 3 May 2017 08:38:13 +0000 (09:38 +0100)]
i965: Set modifier for imported and duplicated images

When a buffer is being created from FD or GEM flink import, the current
API makes no provision for passing modifier information along with this.
Set the modifier for such images to DRM_FORMAT_MOD_INVALID.

Also preserve the modifier when duplicating an image, as will be done by
GBM when importing from a wl_buffer.

This doubly tripped up Wayland, as the images would first have been
created (as wl_buffers) with a 0 modifier, and then lost what modifier
they would've had when being duplicated into gbm_bos.

Fixes: d78a36ea624 ("i965/dri: Handle the linear fb modifier")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 8b8af19065a5bfd06fd0d97b891cfff807704935)

7 years agoi965: Use helper function for modifier -> tiling
Daniel Stone [Wed, 3 May 2017 17:05:10 +0000 (18:05 +0100)]
i965: Use helper function for modifier -> tiling

Use a helper function and struct to convert between a modifier and
tiling mode, so we can use it later for a tiling -> modifier lookup.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 467332a0ab2a2328a37ad302dedd81a654e36313)

7 years agoradv: don't leak DRM devices
Grazvydas Ignotas [Tue, 2 May 2017 17:05:07 +0000 (20:05 +0300)]
radv: don't leak DRM devices

After successful drmGetDevices2() call, drmFreeDevices() needs to be called.

Fixes: 743315f2 "radv: do not open random render node(s)"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 8aab792e92d8f7d20a1e34169e8a714291ba1c6f)

7 years agoradv: fix possible stack corruption
Grazvydas Ignotas [Tue, 2 May 2017 16:41:13 +0000 (19:41 +0300)]
radv: fix possible stack corruption

drmGetDevices2 takes count and not size. Probably hasn't caused problems
yet in practice and was missed as setups with more than 8 DRM devices
are not very common.

Fixes: 743315f2 "radv: do not open random render node(s)"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 898cbb491b3c02697f006d175d5689893bdf929b)

7 years agoradv: Don't set dynamic state for pipelines with rasterizer dicard.
Bas Nieuwenhuizen [Tue, 2 May 2017 21:39:29 +0000 (23:39 +0200)]
radv: Don't set dynamic state for pipelines with rasterizer dicard.

All of the dynamic states apply to rasterization & fragment processing,
so we don't need to set them if we don't rasterize.

We don't clear the dirty flags for them though, so we don't miss any
updates for the next pipeline with rasterization.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 76603aa90b8 "radv: Drop the default viewport when 0 viewports are given."
(cherry picked from commit 9e847eedd5e71fa102003326a3e04e485884fe24)

7 years agoradeonsi: apply the tess+GS hang workaround to Polaris12 as well
Marek Olšák [Fri, 5 May 2017 15:05:05 +0000 (17:05 +0200)]
radeonsi: apply the tess+GS hang workaround to Polaris12 as well

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit ee5908396e4b0d4be64d8bc486d25c2e95b7fd71)

7 years agoradv: enable POLARIS12 support.
Dave Airlie [Fri, 5 May 2017 00:27:33 +0000 (10:27 +1000)]
radv: enable POLARIS12 support.

This just adds the chip in the right places.

We don't set the partial_vs_wave workaround, as radeonsi
doesn't, but have to confirm it's not required.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit a096d8d3f7a8c6dffc91b2ac1794fdd215c054d3)

7 years agoegl/android: Set EGLSurface.Lost to EGL_TRUE/EGL_FALSE
Nicolas Boichat [Fri, 5 May 2017 02:43:50 +0000 (10:43 +0800)]
egl/android: Set EGLSurface.Lost to EGL_TRUE/EGL_FALSE

Lost is an EGLBoolean, so we should assign it to EGL_TRUE/EGL_FALSE,
not true/false.

Fixes: e5eace58684 ("egl/android: Mark surface as lost when dequeueBuffer fails")
Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor")
Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit 63b12b0c77759a0244416cd1406c2bf50e7c01ec)

7 years agoegl/android: Mark surface as lost when dequeueBuffer fails
Chad Versace [Fri, 5 May 2017 00:46:34 +0000 (17:46 -0700)]
egl/android: Mark surface as lost when dequeueBuffer fails

This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit
an error.

This patch is part of a series for fixing
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface
on Chrome OS x86 devices.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit e5eace586848511f4ceaffaa2d45131c31c45ae0)

7 years agoegl/android: Cancel any outstanding ANativeBuffer in surface destructor
Chad Versace [Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)]
egl/android: Cancel any outstanding ANativeBuffer in surface destructor

That is, call ANativeWindow::cancelBuffer in droid_destroy_surface().

This should prevent application deadlock when the app destroys the
EGLSurface after EGL has acquired a buffer from SurfaceFlinger
(ANativeWindow::dequeueBuffer) but before EGL has released it
(ANativeWindow::enqueueBuffer).

This patch is part of a series for fixing
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface
on Chrome OS x86 devices.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 0212db350407e1331ff23f04136684cf2b7396cf)

7 years agoegl: Emit error when EGLSurface is lost
Chad Versace [Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)]
egl: Emit error when EGLSurface is lost

Add a new bool, _EGLSurface::Lost, and check it in eglMakeCurrent and
eglSwapBuffers. The EGL 1.5 spec says that those functions emit errors
when the native surface is no longer valid.

This patch just updates core EGL. No driver sets _EGLSurface::Lost yet.

I discovered that Mesa failed to detect lost surfaces while debugging an
Android CTS camera test,
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface.
This patch doesn't fix the test though, though, because the test expects
EGL_BAD_SURFACE when the surface becomes lost, and this patch actually
complies with the EGL spec. If I interpreted the EGL spec correctly,
EGL_BAD_NATIVE_WINDOW or EGL_BAD_CURRENT_SURFACE is the correct error.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 23c86c74cc450a23848b85cfe914376caede1cdf)

7 years agowinsys/amdgpu: fix Polaris12 (RX 550) breakage
Marek Olšák [Thu, 4 May 2017 23:16:57 +0000 (01:16 +0200)]
winsys/amdgpu: fix Polaris12 (RX 550) breakage

reported by Greg White.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100892
Cc: 17.1 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 69e6eab6533ff48f72223cd21ef640242c52598b)

7 years agoradeonsi/gfx9: make some PA & DB registers match the closed Vulkan driver
Marek Olšák [Fri, 28 Apr 2017 17:28:06 +0000 (19:28 +0200)]
radeonsi/gfx9: make some PA & DB registers match the closed Vulkan driver

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 283a1d1e27b5456cfda848a54b9d74be0993e038)

7 years agoglx: glX_proto_send.py: use correct compile guard GLX_INDIRECT_RENDERING
Emil Velikov [Thu, 13 Apr 2017 16:17:45 +0000 (17:17 +0100)]
glx: glX_proto_send.py: use correct compile guard GLX_INDIRECT_RENDERING

The code itself has nothing to do with shared glapi, thus having it
behind GLX_SHARED_GLAPI is misleading. Use GLX_INDIRECT_RENDERING
instead.

The latter macro is set at global scope by the Autotools and Scons build
systems.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6177d60a374a3d48969fcb062ac1d82465850cb4)

7 years agomesa/dri: always link against shared glapi
Emil Velikov [Thu, 13 Apr 2017 18:36:56 +0000 (19:36 +0100)]
mesa/dri: always link against shared glapi

Analogous to previous commit. Check with the extensive commit
description and bug report referenced.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 51accecce7755be9b7eb1baadaec7e4b7d1011af)

7 years agogallium/dri: always link against shared glapi
Emil Velikov [Thu, 13 Apr 2017 17:54:03 +0000 (18:54 +0100)]
gallium/dri: always link against shared glapi

In the early days of Xorg and Mesa we had multiple providers of the
GLAPI. All of those were the ones responsible for dlopening the DRI
module. Hence it was perfectly fine, and actually expected, for the DRI
modules to have unresolved symbols.

Since then we've moved the API to a separate shared library and no other
libraries provide the symbols.

Here comes the picky part:
It's possible that one uses old Xorg (where libglx.so provides the
GLAPI) and new Mesa (with DRI modules linking against libglapi.so).

That should still work, since the the libglx.so symbols will take
precedence over the libglapi.so ones.

I've verified this while running 1.14 series Xorg alongside this (and
next) patch.

It may seem a bit fragile, but that's of reasonably OK since all of the
affected Xorg versions have been EOL for years.

The final one being the 1.14 series, which saw its final bug fix release
1.14.7 in June 2014.

To ensure that the binaries do not have unresolved symbols add
-no-undefined and $(LD_NO_UNDEFINED), just like we do everywhere else
throughout mesa.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98428
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 79a26b663acdffc3f21d6e37f3334495aed16ae5)

7 years agoscons: update for LLVM 4.0
Ben Boeckel [Thu, 27 Apr 2017 20:31:48 +0000 (16:31 -0400)]
scons: update for LLVM 4.0

LLVMDemangle, LLVMGlobalISel, and LLVMDebugInfoMSF are new.

Also update the comment to add irreader to the list of components.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 58f51f0754d736e76248e075bd25424ff4b64b46)

7 years agoegl/platform/drm: Don't take display ownership until gbm is initialized
Adam Jackson [Wed, 3 May 2017 15:03:34 +0000 (11:03 -0400)]
egl/platform/drm: Don't take display ownership until gbm is initialized

If the gbm_create_device() call here actually did fail, any subsequent
eglTerminate on the display would segfault.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit f258815c7d4187fd83f6944943e78206a6cdc4cb)

7 years agoanv: anv_gem_mmap() returns MAP_FAILED as mapping error
Samuel Iglesias Gonsálvez [Wed, 3 May 2017 06:02:21 +0000 (08:02 +0200)]
anv: anv_gem_mmap() returns MAP_FAILED as mapping error

Take it into account when checking if the mapping failed.

v2:
- Remove map == NULL and its related comment (Emil)

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Fixes: 6f3e3c715a7 ("vk/allocator: Add a BO pool")
Fixes: 9919a2d34de ("anv/image: Memset hiz surfaces to 0 when binding memory")
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b546c9d318731b988aa3d8c4e4735cdbb596cfbf)

Squashed with:

anv: vkBindImageMemory() should return VK_ERROR_OUT_OF_{HOST,DEVICE}_MEMORY on failure

According to the spec we get VK_ERROR_OUT_OF_HOST_MEMORY or
VK_ERROR_OUT_OF_DEVICE_MEMORY on vkBindImageMemory failure.

Fixes returned value changed by b546c9d.

Fixes: b546c9d ("anv: anv_gem_mmap() returns MAP_FAILED as mapping error")
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 939b015736d5091faeabde4f5a373e6a1612c5ed)

Squashed with:

anv: fix anv_gem_mmap comment to not mention NULL

The function cannot return NULL, update the comment accordingly.

Fixes: b546c9d ("anv: anv_gem_mmap() returns MAP_FAILED as mapping error")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
(cherry picked from commit 9d2aa6e5067752efbc0acbd728bc0bde49aefb61)

7 years agoradeonsi/gfx9: fix gl_ViewportIndex
Marek Olšák [Mon, 1 May 2017 15:34:41 +0000 (17:34 +0200)]
radeonsi/gfx9: fix gl_ViewportIndex

v2: remove unnecessary LLVMBuildAnd calls

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit f466683cb07796fa89f96ef87a6f076218ae6db8)

7 years agoetnaviv: add L8A8_UNORM texture format
Christian Gmeiner [Tue, 2 May 2017 20:06:53 +0000 (22:06 +0200)]
etnaviv: add L8A8_UNORM texture format

No piglit regressions.

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry picked from commit a8007ed6872ce1e2cce7145585a4dd1cfd1cec62)

7 years agoi965/vec4: don't modify regioning parameters to the sources of DF align1 instructions
Samuel Iglesias Gonsálvez [Tue, 25 Apr 2017 10:28:18 +0000 (12:28 +0200)]
i965/vec4: don't modify regioning parameters to the sources of DF align1 instructions

The regioning parameters are now properly set by convert_to_hw_regs()
and we don't need to fix them in the generator. That latter fix
previously done in the generator was strictly speaking wrong for any
non-identity regions.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit f57e234fdd52331d0aa6656a36efdebea9d11e9d)

7 years agoi965/vec4: fix register width for DF VGRF and UNIFORM
Samuel Iglesias Gonsálvez [Tue, 25 Apr 2017 10:18:17 +0000 (12:18 +0200)]
i965/vec4: fix register width for DF VGRF and UNIFORM

On gen7, the swizzles used in DF align16 instructions works for element
size of 32 bits, so we can address only 2 consecutive DFs. As we assumed that
in the rest of the code and prepare the instructions for this (scalarize_df()),
we need to set it to two again.

However, for DF align1 instructions, a width of 2 is wrong as we are not
reading the data we want. For example, an uniform would have a region of
<0, 2, 1> so it would repeat the first 2 DFs, when we wanted to access
to the first 4.

This patch sets the default one to 4 and then modifies the width of
align16 instruction's DF sources when we translate the logical swizzle
to the physical one.

v2:
- Remove conditional (Curro).

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit aaeb1c99beed39d85c300ebdb8a7bf056ee6717c)

7 years agoi965/vec4: fix vertical stride to avoid breaking region parameter rule
Samuel Iglesias Gonsálvez [Wed, 26 Apr 2017 08:12:03 +0000 (10:12 +0200)]
i965/vec4: fix vertical stride to avoid breaking region parameter rule

From IVB PRM, vol4, part3, "General Restrictions on Regioning
Parameters":

  "If ExecSize = Width and HorzStride ≠ 0, VertStride must
   be set to Width * HorzStride."

In next patch, we are going to modify the region parameter for
uniforms and vgrf. For uniforms that are the source of
DF align1 instructions, they will have <0, 4, 1> regioning and
the execsize for those instructions will be 4, so they will break
the regioning rule. This will be the same for VGRF sources where
we use the vstride == 0 exploit.

As we know we are not going to cross the GRF boundary with that
execsize and parameters (not even with the exploit), we just fix
the vstride here.

v2:
- Move is_align1_df() (Curro)
- Refactor exec_size == width calculation (Curro)

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 7f728bce811fc283e672e3a07b008bb7b52de35e)

7 years agorenderonly: use drmIoctl
Philipp Zabel [Fri, 28 Apr 2017 11:14:20 +0000 (13:14 +0200)]
renderonly: use drmIoctl

To restart interrupted system calls, use drmIoctl.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit b539335e50b355854202c4b1b42aa4ddbe9289fa)

7 years agorenderonly: drop resources on destroy
Philipp Zabel [Thu, 27 Apr 2017 16:44:02 +0000 (18:44 +0200)]
renderonly: drop resources on destroy

The renderonly_scanout holds a reference on its prime pipe resource,
which should be released when it is destroyed. If it was created by
renderonly_create_kms_dumb_buffer_for_resource, the dumb BO also has
to be destroyed.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit cd8ee259c8e9b1c16b5c3214595b91eb31e7de19)

7 years agorenderonly: close transfer prime_fd
Philipp Zabel [Thu, 27 Apr 2017 16:44:01 +0000 (18:44 +0200)]
renderonly: close transfer prime_fd

prime_fd is only used to transfer the scanout buffer to the GPU inside
renderonly_create_kms_dumb_buffer_for_resource. It should be closed
immediately to avoid leaking the DMA-BUF file handle.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit ab51cd2f26496500d52f6b2847291d884f711bc2)

7 years agonir: Pick just the channels we want for bitmap and drawpixels lowering.
Eric Anholt [Wed, 8 Mar 2017 23:20:31 +0000 (15:20 -0800)]
nir: Pick just the channels we want for bitmap and drawpixels lowering.

NIR now validates that SSA references use the same number of channels as
are in the SSA value.

v2: Reword commit message, since the commit didn't land before the
    validation change did.

Fixes: 370d68babcbb ("nir/validate: Validate that bit sizes and components always match")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v1)
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fba6559a1e76a22135b14490fdf5a6f1de1ae272)

7 years agoi965: Solve Android native fence fd double close
Randy Xu [Tue, 18 Apr 2017 06:27:10 +0000 (14:27 +0800)]
i965: Solve Android native fence fd double close

The Android native fence in i965 has two fds: _EGLSync::SyncFd and
brw_fence::sync_fd.

The semantics of __DRI2fenceExtensionRec::create_fence_fd are unclear on
whether the DRI driver takes ownership of the incoming fd (which is the
same incoming fd from eglCreateSync).  i965 did take ownership, but all
other Mesa drivers do not; instead, they dup the incoming fd. As
a result, _EGLSync::SyncFd and brw_fence::sync_fd were the same fd, and
both egl_dri2 and i965 believed they owned it. On eglDestroySync, that
led to a double-close.

Fix the double-close by making brw_dri_create_fence_fd dup the incoming
fd, just like the other drivers do.

Signed-off-by: Randy Xu <randy.xu@intel.com>
Test: Run Vulkan and GLES stress test and no crash.
Fixes: 6403e376511 ("i965/sync: Implement fences based on Linux sync_file")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
[chadv: Polish the commit message]
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 6f21b5601cc1260eac53f65c8941b3aa66d0f5e9)

7 years agovc4: Only build the NEON code on arm32.
Eric Anholt [Fri, 14 Apr 2017 17:41:51 +0000 (10:41 -0700)]
vc4: Only build the NEON code on arm32.

NEON is sufficiently different on arm64 that we can't just reuse this
code.  Disable it on arm64 for now.

v2: Use PIPE_ARCH_ARM instead, as __ARM_ARCH may be 8 for a 32-bit build
    for a v8 CPU.

Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d884d1a6540ec0f60768c30df47f0228a37ea61c)

7 years agoUpdate version to 17.1.0-rc3
Emil Velikov [Sun, 30 Apr 2017 08:44:14 +0000 (09:44 +0100)]
Update version to 17.1.0-rc3

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotravis: bump MAKEFLAGS to -j4
Emil Velikov [Thu, 27 Apr 2017 16:09:12 +0000 (17:09 +0100)]
travis: bump MAKEFLAGS to -j4

The instance should have 2 cores, yet bumping the jobs to 4 should give
us a minor speed improvement.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit b1d45c3366034341ce4650b0fb5b5605ae761c00)

7 years agotravis: enable wayland support
Emil Velikov [Tue, 18 Apr 2017 12:57:31 +0000 (13:57 +0100)]
travis: enable wayland support

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 27a0b383b9edbacb177553685272408945ec630c)

7 years agotravis: add Gallium state-tracker targets
Emil Velikov [Fri, 7 Apr 2017 13:06:25 +0000 (14:06 +0100)]
travis: add Gallium state-tracker targets

Split into OpenCL and others, since the former is quite time consuming.

v2:
 - explicitly enable/disable components
 - build libvdpau 1.1 requirement
 - enable st/vdpau
 - build libva 1.6.2 (API 0.38) requirement

v3: Drop ubuntu-toolchain-r-test from sources (Andres)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 0e6a36cd3f2db7208e85864d4d552f8575200fbe)

7 years agotravis: model scons check target like the make one
Emil Velikov [Fri, 28 Apr 2017 18:01:33 +0000 (19:01 +0100)]
travis: model scons check target like the make one

Should make things a bit more consistent across the board.

Cc: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit b3f2076549ec2bf13ee8bca965d3bf887abb6f20)

7 years agotravis: split the make target to three separate ones
Emil Velikov [Fri, 7 Apr 2017 11:13:56 +0000 (12:13 +0100)]
travis: split the make target to three separate ones

Split the target to allow faster builds for each run.

The overall build time will be more, yet Travis runs multiple builds in
parallel so we're limited by the slowest one.

Things are split roughly as:
 - DRI loaders, classic DRI drivers, classic OSMesa, make check
 - All Gallium drivers (minus the SWR) alongside st/dri (mesa)
 - The Vulkan drivers - ANV and RADV, make check (anv)

v2:
 - rework RUN_CHECK to MAKE_CHECK_COMMAND
 - explicitly disable DRI loaders
 - generate linux/memfd.h locally and enable ANV
 - add libedit-dev

v3: Use printf to create the header (Andres).
v4: Really add the libedit + printf hunks.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 7e2af374742f6f387cada8c3e1e8585be3831405)

7 years agotravis: add "make swr" to the build matrix
Emil Velikov [Thu, 6 Apr 2017 17:01:19 +0000 (18:01 +0100)]
travis: add "make swr" to the build matrix

v2: Quote OVERRIDE variables.
v3: Add missplaced libedit-dev hunk (Andres).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 8479fd8a1099c4bf37fb8cded7a3040b4d366fbc)

7 years agotravis: add "scons swr" to the build matrix
Emil Velikov [Thu, 6 Apr 2017 15:23:21 +0000 (16:23 +0100)]
travis: add "scons swr" to the build matrix

Requires GCC 5.0 (due to the C++14 requirement) and LLVM 3.9.

v2: Enable the target, add libedit-dev, rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS, quote OVERRIDE
variables.
v4: Keep check target as-is (Andres)

Cc: Tim Rowley <timothy.o.rowley@intel.com>
Cc: George Kyriazis <george.kyriazis@intel.com>
Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit f55d98ac85145fc35e7ee1e41520c07b6f083bb8)

7 years agotravis: add separate "scons" and "scons llvm" targets
Emil Velikov [Thu, 6 Apr 2017 13:41:44 +0000 (14:41 +0100)]
travis: add separate "scons" and "scons llvm" targets

The former does not require any LLVM, while the latter uses LLVM 3.3.

This way we'll quickly catch any LLVM 3.3+ functionality that gets
introduced where it shouldn't.

Add the full list of addons for each build permutation.

v2: Keep libedit-dev, rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS
v4:
 - Remove llvm-toolchain-trusty-3.3 source (Andres)
 - Keep check target as-is (Andres)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 85ee2c6cfcd5deeca2ee0cf11079afccd6e7324e)

7 years agotravis: split out matrix from env
Emil Velikov [Thu, 6 Apr 2017 13:38:40 +0000 (14:38 +0100)]
travis: split out matrix from env

With next commits we'll add a couple of more options.

v2: Rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS
v4: Keep check target as-is, will rework with later patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 56ba252e230dfeb93fad26cdbf5f6247524459c7)

7 years agotravis: rework "if test" blocks in the script section
Emil Velikov [Thu, 6 Apr 2017 13:23:36 +0000 (14:23 +0100)]
travis: rework "if test" blocks in the script section

Split the "if test" blocks so that we get more sensible output in case
of a failure.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit abcfea23add91ffa7013a3c862712cfdaefcf8b0)

7 years agotravis: remove unused -dev packages
Emil Velikov [Thu, 6 Apr 2017 13:09:58 +0000 (14:09 +0100)]
travis: remove unused -dev packages

We effectively override libdrm-dev and libxcb-dri2-0-dev since we build
and install the package locally.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit ae713a7b79f60b45befea7c40b6d2aa3d3789441)

7 years agotravis: automatically manage ccache caching
Emil Velikov [Thu, 6 Apr 2017 13:02:38 +0000 (14:02 +0100)]
travis: automatically manage ccache caching

According to the manual

"If you are using ccache, use:

  language: c # or other C/C++ variants

  cache: ccache

to cache $HOME/.ccache and automatically add /usr/lib/ccache to your
$PATH."

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 6431b98c54ea2dc0c0f716b5f4a19af45a3b67f3)

7 years agotravis: enable apt cache
Emil Velikov [Thu, 6 Apr 2017 15:36:59 +0000 (16:36 +0100)]
travis: enable apt cache

Provides a small, but consistent improvement.
Example numbers of the jobs added later in the series.

"make loaders/classic DRI" - 1s
"scons SWR" - 6s

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit 486f28ba88259cc70ee59ad67b2b4277b0da0ce4)

7 years agotravis: add the possibility of using the txc-dxtn library
Andres Gomez [Fri, 7 Apr 2017 12:16:21 +0000 (15:16 +0300)]
travis: add the possibility of using the txc-dxtn library

The txc-dxtn library implements the patented S3 Texture Compression
algorithm.

By default it won't be used but we add the possibility of setting the
USE_TXC_DXTN variable to yes in the travis web UI so it will be
installed and used for the scons tests.

Cc: Eric Anholt <eric@anholt.net>
Cc: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
[Emil Velikov: keep the LIB prefix, drop the LD_LIBRARY_PATH, fold URL]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 29322daef2b77c4d869d2945fa1226e6b433c687)

7 years agotravis: replace Trusty-based LLVM toolchain apt-get with apt addon
Andres Gomez [Wed, 5 Apr 2017 17:27:30 +0000 (20:27 +0300)]
travis: replace Trusty-based LLVM toolchain apt-get with apt addon

Trusty's LLVM toochain repository was whitelisted some time ago. See:
https://github.com/travis-ci/apt-source-whitelist/commit/479067c5e74cb0c1e2419209179b1afe2edce274

Signed-off-by: Andres Gomez <agomez@igalia.com>
[Emil Velikov]
 - set sudo to false
 - reference the Trusty change (Rhys)
 - keep libedit-dev
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 7819d265c79ceb1bfcadb7b5e9c1586de5b6aac8)

7 years agotravis: explicitly LD_LIBRARY_PATH the local libraries
Emil Velikov [Thu, 6 Apr 2017 12:32:36 +0000 (13:32 +0100)]
travis: explicitly LD_LIBRARY_PATH the local libraries

Some of the libraries may be dlopened, which may not always work due to
the non-standard prefix that we're using.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
(cherry picked from commit cb820daa3ff2dcd697144150e2a9daf1a8898117)

7 years agoanv/cmd_buffer: Use the device allocator for QueueSubmit
Jason Ekstrand [Tue, 28 Feb 2017 01:31:05 +0000 (17:31 -0800)]
anv/cmd_buffer: Use the device allocator for QueueSubmit

The command is really operating on a Queue not a command buffer and the
nearest object to that with an allocator is VkDevice.

Reviewed-by: Chad Versace <chadversary@chromium.org>
Cc: "17.0 17.1" <mesa-dev@lists.freedesktop.org>
(cherry picked from commit bd3a9813b92bd2e116b58f0932bc7f1f722a9f63)

7 years agogallium/targets: fix bool setting on BE architectures
Ilia Mirkin [Tue, 18 Apr 2017 04:00:40 +0000 (00:00 -0400)]
gallium/targets: fix bool setting on BE architectures

val_bool and val_int are in a union. val_bool gets the first byte, which
happens to work on LE when setting via the int, but breaks on BE. By
setting the value properly, we are able to use DRI3 on BE architectures.
Tested by running glxgears with a NV34 in a G5 PPC.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
[Emil Velikov: squash the vmwgfx hunk]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 6af14778a3f68030c4ad6426c75fe25d726235d5)

7 years agost/mesa: don't cast the incomplete framebufer to st_framebuffer
Nicolai Hähnle [Fri, 21 Apr 2017 13:06:47 +0000 (15:06 +0200)]
st/mesa: don't cast the incomplete framebufer to st_framebuffer

The incomplete framebuffer is set for a surfaceless context. This leads to
the following error in piglit spec@egl_khr_surfaceless_context@viewport:

==26703==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6886e43240 at pc 0x7f68854db0fd bp 0x7ffca404b3b0 sp 0x7ffca404b3a0
READ of size 8 at 0x7f6886e43240 thread T0
    #0 0x7f68854db0fc in st_viewport ../../../mesa-src/src/mesa/state_tracker/st_cb_viewport.c:57
    #1 0x556840176cdb in main tests/egl/spec/egl_khr_surfaceless_context/viewport.c:101
    #2 0x7f688edcf3f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)
    #3 0x556840176e19 in _start (/home/nha/amd/piglit/bin/egl-surfaceless-context-viewport+0xe19)

0x7f6886e43240 is located 32 bytes to the left of global variable 'DummyRenderbuffer' defined in '../../../mesa-src/src/mesa/main/fbobject.c:69:31' (0x7f6886e43260) of size 112
0x7f6886e43240 is located 8 bytes to the right of global variable 'IncompleteFramebuffer' defined in '../../../mesa-src/src/mesa/main/fbobject.c:73:30' (0x7f6886e42de0) of size 1112
SUMMARY: AddressSanitizer: global-buffer-overflow ../../../mesa-src/src/mesa/state_tracker/st_cb_viewport.c:57 in st_viewport

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek@olsak@amd.com>
(cherry picked from commit 19b61799e3d06795d783b34fdbbf8474ef1e9a7c)

7 years agoutil/disk_cache: remove percentage based max cache limit
Timothy Arceri [Fri, 28 Apr 2017 03:05:52 +0000 (13:05 +1000)]
util/disk_cache: remove percentage based max cache limit

The more I think about it the more this seems like a bad idea.
When we were deleting old cache dirs this wasn't so bad as it
was unlikely we would ever hit the actual limit before things
were cleaned up. Now that we only start cleaning up old cache
items once the limit is reached the a percentage based max
cache limit is more risky.

For the inital release of shader cache I think its better to
stick to a more conservative cache limit, at least until we
have some way of cleaning up the cache more aggressively.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 22fa3d90a92c1628215d0f5fccbe1116d4f5147f)

7 years agodisk_cache: use block size rather than file size
Timothy Arceri [Thu, 27 Apr 2017 01:15:30 +0000 (11:15 +1000)]
disk_cache: use block size rather than file size

The majority of cache files are less than 1kb this resulted in us
greatly miscalculating the amount of disk space used by the cache.

Using the number of blocks allocated to the file is more
conservative and less likely to cause issues.

This change will result in cache sizes being miscalculated further
until old items added with the previous calculation have all been
removed. However I don't see anyway around that, the previous
patch should help limit that problem.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 4e1f3afea9bdeddb0d21f00d25319bce580d80c3)

7 years agodisk_cache: reduce default cache size to 5% of filesystem
Timothy Arceri [Thu, 27 Apr 2017 01:15:29 +0000 (11:15 +1000)]
disk_cache: reduce default cache size to 5% of filesystem

Modern disks are extremely large and are only going to get bigger.
Usage has shown frequent Mesa upgrades can result in the cache
growing very fast i.e. wasting a lot of disk space unnecessarily.

5% seems like a more reasonable default.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit ce412371513c90bf9156f22c3567ee57750ef264)

7 years agoanv: Don't place scratch buffers above the 32-bit boundary
Jason Ekstrand [Sat, 22 Apr 2017 22:51:01 +0000 (15:51 -0700)]
anv: Don't place scratch buffers above the 32-bit boundary

This fixes rendering corruptions in DOOM.  Hopefully, it will also make
Jenkins a bit more stable as we've been seeing some random failures and
GPU hangs ever since turning on 48bit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100620
Fixes: 651ec926fc1 "anv: Add support for 48-bit addresses"
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c43b4bc85eddba8bc31665cfee5928bed8343516)

7 years agoradeonsi: adjust ESGS ring buffer size computation on VI
Marek Olšák [Sat, 22 Apr 2017 12:47:03 +0000 (14:47 +0200)]
radeonsi: adjust ESGS ring buffer size computation on VI

Cc: 17.0 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 3f2a0649abc982fe5de647a96fbe354aa9e41a59)

7 years agoradeonsi/gfx9: don't set deprecated field PARTIAL_ES_WAVE_ON
Marek Olšák [Sun, 23 Apr 2017 18:29:04 +0000 (20:29 +0200)]
radeonsi/gfx9: don't set deprecated field PARTIAL_ES_WAVE_ON

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 80814819c28353a38c03d4cdba39983b8cf260ac)

7 years agoradeonsi/gfx9: set MAX_PRIMGRP_IN_WAVE in the correct register
Marek Olšák [Sun, 23 Apr 2017 18:14:42 +0000 (20:14 +0200)]
radeonsi/gfx9: set MAX_PRIMGRP_IN_WAVE in the correct register

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 60a20e6879e4ce0911b12848ffd9e372f096590e)

7 years agoradeonsi/gfx9: add a workaround for viewing a slice of 3D as a 2D image
Marek Olšák [Sun, 23 Apr 2017 22:01:06 +0000 (00:01 +0200)]
radeonsi/gfx9: add a workaround for viewing a slice of 3D as a 2D image

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 8e8570a9e8bae7f4d3ad623475dfadc715a828d7)

7 years agoradeonsi/gfx9: fix 1D array shader images
Marek Olšák [Sun, 23 Apr 2017 21:29:20 +0000 (23:29 +0200)]
radeonsi/gfx9: fix 1D array shader images

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 482e6b07cc6ce4b2ceac8188be19dbf252eaecde)

7 years agoradeonsi/gfx9: fix most things wrong with shader images
Marek Olšák [Sun, 23 Apr 2017 21:06:38 +0000 (23:06 +0200)]
radeonsi/gfx9: fix most things wrong with shader images

There are 2 major hw changes:
- The address must always point to the address of level 0. GFX9 tiling
  modes don't allow binding to a non-0 level.
- 3D must always be bound as 3D, because 2D and 3D use entirely different
  tiling modes, and the texture target determines which set of modes is
  used.

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 5c94779585e24e8bd1bd41707521584af4251de3)

7 years agoradeonsi/gfx9: fix texture buffer objects and image buffers with IDXEN==0
Marek Olšák [Sun, 23 Apr 2017 19:32:22 +0000 (21:32 +0200)]
radeonsi/gfx9: fix texture buffer objects and image buffers with IDXEN==0

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 65e0c3fba74ee98cacadbba4bd005b930609b65e)

7 years agointel/fs: Take into account amount of data read in spilling cost heuristic.
Francisco Jerez [Thu, 20 Apr 2017 18:42:27 +0000 (11:42 -0700)]
intel/fs: Take into account amount of data read in spilling cost heuristic.

Until now the spilling cost calculation was neglecting the amount of
data read from the register during the spilling cost calculation.
This caused it to make suboptimal decisions in some cases leading to
higher memory bandwidth usage than necessary.

Improves Unigine Heaven performance by ~4% on BDW, reversing an
unintended FPS regression from my previous commit
147e71242ce539ff28e282f009c332818c35f5ac with n=12 and statistical
significance 5%.  In addition SynMark2 OglCSDof performance is
improved by an additional ~5% on SKL, and a Kerbal Space Program
apitrace around the Moho planet I can provide on request improves by
~20%.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 58324389be7bc7c5e10093b9cc0a8efa9b4c93a9)

7 years agointel/fs: Use regs_written() in spilling cost heuristic for improved accuracy.
Francisco Jerez [Thu, 20 Apr 2017 18:44:01 +0000 (11:44 -0700)]
intel/fs: Use regs_written() in spilling cost heuristic for improved accuracy.

This is what we use later on to compute the number of registers that
will actually get spilled to memory, so it's more likely to match
reality than the current open-coded approximation.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit ecc19e12dca95d2571d3761dea6dec24b061013c)

7 years agoi965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().
Kenneth Graunke [Fri, 21 Apr 2017 08:28:13 +0000 (01:28 -0700)]
i965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().

opt_register_coalesce() was optimizing sequences such as:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) vgrf5.xy:D, attr18.xyyy:D, attr19.xyyy:D
   mov(8) m4.zw:F, vgrf5.xxxy:F

into:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) m4.zw:D, attr18.xxxy:D, attr19.xxxy:D

This doesn't work - if we're going to reswizzle MACH, we'd need to
reswizzle the MUL as well.  Here, the MUL fills the accumulator's .zw
components with attr18.yy * attr19.yy.  But the MACH instruction expects
.z to contain attr18.x * attr19.x.  Bogus results ensue.

No change in shader-db on Haswell.  Prevents regressions in Timothy's
patches to use enhanced layouts for varying packing (which rearrange
code just enough to trigger this pre-existing bug, but were fine
themselves).

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 2faf227ec2e22c7a37e0a54783a3f0a0062ac852)

Squashed with commit:

i965/vec4: Use reads_accumulator_implicitly(), not MACH checks.

Curro pointed out that I should not just check for MACH, but use
the reads_accumulator_implicitly() helper, which would also prevent
the same bug with MAC and SADA2 (if we ever decide to use them).

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 6b10c37b9c3a73add73f444fe1aee73c9ec82c94)

7 years agoUpdate version to 17.1.0-rc2
Emil Velikov [Mon, 24 Apr 2017 14:23:07 +0000 (15:23 +0100)]
Update version to 17.1.0-rc2

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agost/clover: add space between < and ::
Emil Velikov [Wed, 19 Apr 2017 10:35:10 +0000 (11:35 +0100)]
st/clover: add space between < and ::

As pointed out by compiler

./llvm/codegen.hpp:52:22: error: ‘<::’ cannot begin a template-argument list [-fpermissive]
./llvm/codegen.hpp:52:22: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’

Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
(cherry picked from commit dd6ec78b4fc1208c9ec330642ad42361fea91678)

7 years agoconfigure.ac: Fix typos.
Vinson Lee [Thu, 20 Apr 2017 21:48:50 +0000 (14:48 -0700)]
configure.ac: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b81d85f1754928139f9f01474495e024946aa1b4)

7 years agomesa: validate sampler type across the whole program
Timothy Arceri [Fri, 21 Apr 2017 07:04:10 +0000 (17:04 +1000)]
mesa: validate sampler type across the whole program

Currently we were only making sure types were the same within a
single stage. This looks to have regressed with 953a0af8e3f73.

Fixes: 953a0af8e3f73 ("mesa: validate sampler uniforms during gluniform calls")

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
https://bugs.freedesktop.org/show_bug.cgi?id=97524
(cherry picked from commit d682f8aa8e0edd166166f87fcd774dd2d57b4180)

7 years agomesa/glthread: correctly compare thread handles
Emil Velikov [Thu, 20 Apr 2017 15:24:08 +0000 (16:24 +0100)]
mesa/glthread: correctly compare thread handles

As mentioned in the manual - comparing pthread_t handles via the C
comparison operator is incorrect and pthread_equal() should be used
instead.

Cc: Timothy Arceri <tarceri@itsqueeze.com>
Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 52df318d61f4892dbbaa8f0da4787f25caf1b0d1)

7 years agost/mesa: automake: honour the vdpau header install location
Emil Velikov [Sun, 16 Apr 2017 14:46:28 +0000 (15:46 +0100)]
st/mesa: automake: honour the vdpau header install location

If VDPAU is installed in the non-default location, we'll fail to find
the headers and error at build time.

../../src/gallium/include/state_tracker/vdpau_dmabuf.h:37:25: fatal error: vdpau/vdpau.h: No such file or directory
 #include <vdpau/vdpau.h>
                         ^

Fixes: faba96bc60b ("st/vdpau: add new interop interface")
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 51c0c213b7fa53b249e9fcb9004a3ba1076fe773)

7 years agoconfigure.ac: check require_basic_egl only if egl enabled
Emil Velikov [Sun, 16 Apr 2017 00:46:59 +0000 (01:46 +0100)]
configure.ac: check require_basic_egl only if egl enabled

Fixes: 1ac40173c2a ("configure.ac: simplify EGL requirements for drivers dependent on EGL")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 4516bfbd309a6996c18f577de47b13e33dce0828)

7 years agoconfigure.ac: manually expand PKG_CHECK_VAR
Emil Velikov [Tue, 18 Apr 2017 10:33:42 +0000 (11:33 +0100)]
configure.ac: manually expand PKG_CHECK_VAR

The macro is introduced with pkgconfig v0.28 which isn't universally
available. Thus it will error at configure stage.

Reported-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 179e21a72045ceb09cebf4c426bae16580fdd438)

7 years agoutil/queue: don't hang at exit
Rob Clark [Tue, 18 Apr 2017 01:20:37 +0000 (21:20 -0400)]
util/queue: don't hang at exit

So atexit() is horrible and 4aea8fe7 is probably not a good idea.  But
add an extra layer of duct-tape to the problem.  Otherwise we hit a
situation where app using an atexit() handler that runs later than ours
doesn't hang when trying to tear down a context.

 (gdb) bt
 #0  util_queue_killall_and_wait (queue=queue@entry=0x52bc80) at ../../../src/util/u_queue.c:264
 #1  0x0000007fb6c380c0 in atexit_handler () at ../../../src/util/u_queue.c:51
 #2  0x0000007fb7730e2c in __run_exit_handlers () from /lib64/libc.so.6
 #3  0x0000007fb7730e5c in exit () from /lib64/libc.so.6
 #4  0x0000007fb7ce17dc in piglit_report_result (result=PIGLIT_PASS) at /home/robclark/src/piglit/tests/util/piglit-util.c:267
 #5  0x0000007fb7ef99f8 in process_next_event (x11_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:139
 #6  0x0000007fb7ef9a90 in enter_event_loop (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:153
 #7  0x0000007fb7ef8e50 in run_test (gl_fw=0x432c20, argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:88
 #8  0x0000007fb7edb890 in piglit_gl_test_run (argc=1, argv=0x7ffffff588, config=0x7ffffff400) at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:203
 #9  0x0000000000401224 in main (argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/bugs/drawbuffer-modes.c:46
 (gdb) c
 Continuing.
 [Thread 0x7fb67580c0 (LWP 3471) exited]
 ^C
 Thread 1 "drawbuffer-mode" received signal SIGINT, Interrupt.
 0x0000007fb72dda34 in pthread_cond_wait@@GLIBC_2.17 () from /lib64/libpthread.so.0
 (gdb) bt
 #0  0x0000007fb72dda34 in pthread_cond_wait@@GLIBC_2.17 () from /lib64/libpthread.so.0
 #1  0x0000007fb6c38304 in cnd_wait (mtx=0x5bdc90, cond=0x5bdcc0) at ../../../include/c11/threads_posix.h:159
 #2  util_queue_fence_wait (fence=0x5bdc90) at ../../../src/util/u_queue.c:106
 #3  0x0000007fb6daac70 in fd_batch_sync (batch=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:233
 #4  batch_reset (batch=batch@entry=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:183
 #5  0x0000007fb6daa5e0 in batch_flush (batch=0x5bdc70) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:290
 #6  fd_batch_flush (batch=0x5bdc70, sync=<optimized out>) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch.c:308
 #7  0x0000007fb6daba2c in fd_bc_flush (cache=0x461220, ctx=0x52b920) at ../../../../../src/gallium/drivers/freedreno/freedreno_batch_cache.c:141
 #8  0x0000007fb6dac954 in fd_context_flush (pctx=0x52b920, fence=0x0, flags=<optimized out>) at ../../../../../src/gallium/drivers/freedreno/freedreno_context.c:54
 #9  0x0000007fb6b43294 in st_glFlush (ctx=<optimized out>) at ../../../src/mesa/state_tracker/st_cb_flush.c:121
 #10 0x0000007fb69a84e8 in _mesa_make_current (newCtx=newCtx@entry=0x0, drawBuffer=drawBuffer@entry=0x0, readBuffer=readBuffer@entry=0x0) at ../../../src/mesa/main/context.c:1654
 #11 0x0000007fb6b7ca58 in st_api_make_current (stapi=<optimized out>, stctxi=0x0, stdrawi=0x0, streadi=0x0) at ../../../src/mesa/state_tracker/st_manager.c:827
 #12 0x0000007fb6cc87e8 in dri_unbind_context (cPriv=<optimized out>) at ../../../../../src/gallium/state_trackers/dri/dri_context.c:217
 #13 0x0000007fb6cc80b0 in driUnbindContext (pcp=0x5271e0) at ../../../../../../src/mesa/drivers/dri/common/dri_util.c:591
 #14 0x0000007fb7d1da08 in MakeContextCurrent (dpy=0x433380, draw=0, read=0, gc_user=0x0) at ../../../src/glx/glxcurrent.c:214
 #15 0x0000007fb7a8d5e0 in glx_platform_make_current () from /lib64/libwaffle-1.so.0
 #16 0x0000007fb7a894e4 in waffle_make_current () from /lib64/libwaffle-1.so.0
 #17 0x0000007fb7ef8c60 in piglit_wfl_framework_teardown (wfl_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_wfl_framework.c:628
 #18 0x0000007fb7ef939c in piglit_winsys_framework_teardown (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:238
 #19 0x0000007fb7ef9c30 in destroy (gl_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:212
 #20 0x0000007fb7edb7c4 in destroy () at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:184
 #21 0x0000007fb7730e2c in __run_exit_handlers () from /lib64/libc.so.6
 #22 0x0000007fb7730e5c in exit () from /lib64/libc.so.6
 #23 0x0000007fb7ce17dc in piglit_report_result (result=PIGLIT_PASS) at /home/robclark/src/piglit/tests/util/piglit-util.c:267
 #24 0x0000007fb7ef99f8 in process_next_event (x11_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:139
 #25 0x0000007fb7ef9a90 in enter_event_loop (winsys_fw=0x432c20) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_x11_framework.c:153
 #26 0x0000007fb7ef8e50 in run_test (gl_fw=0x432c20, argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/util/piglit-framework-gl/piglit_winsys_framework.c:88
 #27 0x0000007fb7edb890 in piglit_gl_test_run (argc=1, argv=0x7ffffff588, config=0x7ffffff400) at /home/robclark/src/piglit/tests/util/piglit-framework-gl.c:203
 #28 0x0000000000401224 in main (argc=1, argv=0x7ffffff588) at /home/robclark/src/piglit/tests/bugs/drawbuffer-modes.c:46
 (gdb) r

Fixes: 4aea8fe7 ("gallium/u_queue: fix random crashes when the app calls exit()")
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6fb7935dedc87ffd767a2999f402ce1a46d18cce)

7 years agoconfigure.ac: print deprecation warning as needed
Emil Velikov [Mon, 17 Apr 2017 14:07:44 +0000 (15:07 +0100)]
configure.ac: print deprecation warning as needed

The warning should be printed only when one explicitly uses the
deprecated configure toggle.

Fixes: 7748c3f5eb1 ("configure.ac: deprecate --with-egl-platforms over
--with-platforms")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9915753e631a203d7f22bfa308fbf688644a8a37)

7 years agost/mesa: invalidate the readpix cache in st_indirect_draw_vbo
Marek Olšák [Sun, 9 Apr 2017 14:03:59 +0000 (16:03 +0200)]
st/mesa: invalidate the readpix cache in st_indirect_draw_vbo

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7cd6e2df65de9e2f0d77022a64c4e48ca2ebcb33)

7 years agowinsys/sw/dri: don't use GNU void pointer arithmetic
Emil Velikov [Sun, 16 Apr 2017 13:39:03 +0000 (14:39 +0100)]
winsys/sw/dri: don't use GNU void pointer arithmetic

Resolves build issues like the following:

src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                               ^
src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                                                              ^

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 309f4067a795219027f523bf0733692e48f2fd58)

7 years agovbo: fix gl_DrawID handling in glMultiDrawArrays
Nicolai Hähnle [Fri, 7 Apr 2017 16:24:44 +0000 (18:24 +0200)]
vbo: fix gl_DrawID handling in glMultiDrawArrays

Fixes a bug in
KHR-GL45.shader_draw_parameters_tests.ShaderMultiDrawArraysParameters.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 51deba0eb35d0d27560bb7dad24b8d39abb58be6)

7 years agomesa: move glMultiDrawArrays to vbo and fix error handling
Nicolai Hähnle [Fri, 7 Apr 2017 16:20:34 +0000 (18:20 +0200)]
mesa: move glMultiDrawArrays to vbo and fix error handling

When any count[i] is negative, we must skip all draws.

Moving to vbo makes the subsequent change easier.

v2:
- provide the function in all contexts, including GLES
- adjust validation accordingly to include the xfb check
v3:
- fix mix-up of pre- and post-xfb prim count (Nils Wallménius)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 42d5465b9ba85b4918b9e6fb57994720e3c8a80b)

7 years agomesa: extract need_xfb_remaining_prims_check
Nicolai Hähnle [Thu, 13 Apr 2017 19:06:11 +0000 (21:06 +0200)]
mesa: extract need_xfb_remaining_prims_check

The same logic needs to be applied to glMultiDrawArrays.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 756e9ebbdd84018382908d3556973a62dbda09ca)

7 years agomesa: fix remaining xfb prims check for GLES with multiple instances
Nicolai Hähnle [Thu, 13 Apr 2017 18:53:17 +0000 (20:53 +0200)]
mesa: fix remaining xfb prims check for GLES with multiple instances

Found by inspection.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ea9a8940cadb30ac8d72a26b82bdb54872c0e199)

7 years agoanv/cmd_buffer: Disable CCS on BDW input attachments
Nanley Chery [Thu, 13 Apr 2017 16:52:31 +0000 (09:52 -0700)]
anv/cmd_buffer: Disable CCS on BDW input attachments

The description under RENDER_SURFACE_STATE::RedClearColor says,

   For Sampling Engine Multisampled Surfaces and Render Targets:
    Specifies the clear value for the red channel.
   For Other Surfaces:
    This field is ignored.

This means that the sampler on BDW doesn't support CCS.

Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit d9d793696bf54e970491302605a1efd0aa182d1b)

7 years agoanv: blorp: flush memory after copy
Lionel Landwerlin [Mon, 17 Apr 2017 21:45:08 +0000 (14:45 -0700)]
anv: blorp: flush memory after copy

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d71efbe5f2a0ff934b8e9eeb96cd680a83bc0259)

7 years agofreedreno: fix crash if ctx torn down with no rendering
Rob Clark [Sat, 15 Apr 2017 16:32:17 +0000 (12:32 -0400)]
freedreno: fix crash if ctx torn down with no rendering

In this case, ctx->flush_queue would not have been initialized.

Fixes: 0b613c20 ("freedreno: enable draw/batch reordering by default")
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit d4601b0efc7f5e24e3f39fefa8e29e79560245ce)

7 years agoUpdate version to 17.1.0-rc1
Emil Velikov [Mon, 17 Apr 2017 13:51:04 +0000 (14:51 +0100)]
Update version to 17.1.0-rc1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoRevert "docs: add 17.2.0-devel release notes template, bump version"
Emil Velikov [Mon, 17 Apr 2017 13:30:44 +0000 (14:30 +0100)]
Revert "docs: add 17.2.0-devel release notes template, bump version"

This reverts commit 47dd2544e194029bdafb58b93d08c510571655d5.

Should have landed in the master branch

7 years agodocs: add 17.2.0-devel release notes template, bump version
Emil Velikov [Mon, 17 Apr 2017 13:27:10 +0000 (14:27 +0100)]
docs: add 17.2.0-devel release notes template, bump version

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoconfigure.ac: deprecate --with-egl-platforms over --with-platforms
Emil Velikov [Mon, 17 Apr 2017 12:29:41 +0000 (13:29 +0100)]
configure.ac: deprecate --with-egl-platforms over --with-platforms

Currently the former controls more than just EGL. With follow-up commits
we'll unwind and fix things so that one can build the different drivers
with said platform support.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoconfigure: remove egl platforms check
Emil Velikov [Thu, 8 Dec 2016 19:21:44 +0000 (19:21 +0000)]
configure: remove egl platforms check

The configure option is used by more than just EGL and with next commit
we'll rename it accordingly. Thus having the check will (and is atm)
incorrect.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotravis: remove unneeded dri3/present proto requirement
Emil Velikov [Thu, 8 Dec 2016 19:21:42 +0000 (19:21 +0000)]
travis: remove unneeded dri3/present proto requirement

Signed-off-by: Emil Velikov <emil.lvelikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoconfigure: remove unneeded dri3/present proto requirements
Emil Velikov [Thu, 8 Dec 2016 19:21:41 +0000 (19:21 +0000)]
configure: remove unneeded dri3/present proto requirements

We are not using either of these. The respecive xcb packages are used
instead.

v2: Rebase, reword commit message.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agoEGL: Implement the libglvnd interface for EGL (v3)
Kyle Brenneman [Wed, 4 Jan 2017 18:31:58 +0000 (11:31 -0700)]
EGL: Implement the libglvnd interface for EGL (v3)

The new interface mostly just sits on top of the existing library.

The only change to the existing EGL code is to split the client
extension string into platform extensions and everything else. On
non-glvnd builds, eglQueryString will just concatenate the two strings.

The EGL dispatch stubs are all generated. The script is based on the one
used to generate entrypoints in libglvnd itself.

v2: [Kyle]
 - Rebased against master.
 - Reworked the EGL makefile to use separate libraries
 - Made the EGL code generation scripts work with Python 2 and 3.
 - Change gen_egl_dispatch.py to use argparse for the command line arguments.
 - Assorted formatting and style cleanup in the Python scripts.

v3: [Emil Velikov]
 - Rebase
 - Remove separate glvnd glx/egl configure toggles

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>