OSDN Git Service

android-x86/external-mesa.git
7 years agoradv: automake: list shared libraries after the static ones
Emil Velikov [Fri, 19 May 2017 17:43:15 +0000 (18:43 +0100)]
radv: automake: list shared libraries after the static ones

Analogous to previous commit - the compiler can discard xcb + wayland
libs, since there is no user (the static libraries) before it on the
command line.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
(cherry picked from commit 2b6ad89d8695c6b87c113eda198a65389bae9f3a)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: automake: list shared libraries after the static ones
Emil Velikov [Fri, 19 May 2017 17:43:14 +0000 (18:43 +0100)]
anv: automake: list shared libraries after the static ones

The compiler can discard the shared ones from the link chain, since
there is no user (the static libraries) before it on the command line.

Cc: mesa-stable@lists.freedesktop.org
Reported-by: Laurent Carlier <lordheavym@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
(cherry picked from commit 3e8790bff096a1a56bd1a3046c556a7f93b68ca8)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoi965: Round copy size to the nearest block in intel_miptree_copy
Jason Ekstrand [Sat, 13 May 2017 18:02:22 +0000 (11:02 -0700)]
i965: Round copy size to the nearest block in intel_miptree_copy

The width and height of the copy don't have to be aligned to the block
size if they specify the right or bottom edges of the image.  (See also
the comment and asserts right above).  We need to round them up when we
do the division in order to get it 100% right.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0901d0bc4c78313eaaf29dff74c6a7bf5514f75b)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoi965/blorp: Do and end-of-pipe sync on both sides of fast-clear ops
Jason Ekstrand [Sat, 13 May 2017 17:30:19 +0000 (10:30 -0700)]
i965/blorp: Do and end-of-pipe sync on both sides of fast-clear ops

We've discovered in the Vulkan driver that simply doing the end-of-pipe
sync afterwards is insufficient.  The specific requirement stated in the
PRM is that you have to do one every time you transition between the
tree modes of "clear", "render", and "resolve".  This is GL, so we could
track it but any attempt to do so would most likely get it wrong.  For
now, it's easier to just assume that every fast-clear op is an island
and do the sync both before and after.

This also removes the unneeded flush and stall after slow-clear
operations.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 441cd7a81d6fb90dacf8ae441b438d9fe7db19eb)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Set image memory types based on the type count
Jason Ekstrand [Wed, 17 May 2017 18:16:57 +0000 (11:16 -0700)]
anv: Set image memory types based on the type count

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 10fad58b31ee2354330152ca4072327d228fc2e7)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Set up memory types and heaps during physical device init
Jason Ekstrand [Wed, 17 May 2017 17:55:41 +0000 (10:55 -0700)]
anv: Set up memory types and heaps during physical device init

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c1f4343807d1040bd7b5440aa2f5fccf5f12842d)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Conflicts:
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h

7 years agoanv: Predicate 48bit support on gen >= 8
Jason Ekstrand [Thu, 18 May 2017 17:57:42 +0000 (10:57 -0700)]
anv: Predicate 48bit support on gen >= 8

This doesn't matter right now since it only affects whether or not we
set the kernel bit but, if we ever do anything else based on it, we'll
want it to be correct per-gen.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit eceaf7e2340fca0079300692733206b2af555bd9)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/image: Get rid of the memset(aux, 0, sizeof(aux)) hack
Jason Ekstrand [Thu, 18 May 2017 18:31:48 +0000 (11:31 -0700)]
anv/image: Get rid of the memset(aux, 0, sizeof(aux)) hack

Up until now, we've been memsetting the auxiliary surface to 0 at
BindImageMemory time to ensure that it is properly initialized.
However, this isn't correct because apps are allowed to freely alias
memory between different images and buffers so long as they properly
track whether or not a particular image is valid and, if it isn't,
transition from UNINITIALIZED to something else before using it.  We
now implement those transitions so we can drop the hack.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4eecd534f0544b62ae831a97708ade007541bd32)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Handle transitioning depth from UNDEFINED to other layouts
Jason Ekstrand [Thu, 18 May 2017 18:30:47 +0000 (11:30 -0700)]
anv: Handle transitioning depth from UNDEFINED to other layouts

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cc45c4bb8072b6593812f9b68a7b3d2d00bfb9f0)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Handle color layout transitions from the UNINITIALIZED layout
Jason Ekstrand [Thu, 18 May 2017 02:02:42 +0000 (19:02 -0700)]
anv: Handle color layout transitions from the UNINITIALIZED layout

This causes dEQP-VK.api.copy_and_blit.resolve_image.partial.* to start
failing due to test bugs.  See CL 1031 for a test fix.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 75edecf5020a9b833ff7e2929f64ceb11c9df679)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoradeonsi/gfx9: compile shaders with +xnack
Marek Olšák [Fri, 7 Apr 2017 16:30:28 +0000 (18:30 +0200)]
radeonsi/gfx9: compile shaders with +xnack

so that LLVM doesn't allocate SGPRs where XNACK is.

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 2beb31bd7c186641a2bb9abf6d2e13d42e43d944)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agotravis: remove workarounds for the Vulkan target
Emil Velikov [Thu, 4 May 2017 10:05:27 +0000 (11:05 +0100)]
travis: remove workarounds for the Vulkan target

Previously we required --enable-egl for the platform selection to work.
Additionally due to the broken DRI3 dependency tracking we needed
--enable-glx.

Since both of these are now sorted now we no longer need the
workarounds.

While we're here, explicitly enable dri3.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit 552cd5cce5ff75527d4755e1e2fb13ecf268575f)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out if building XVMC w/o supported platform
Emil Velikov [Wed, 7 Dec 2016 14:42:00 +0000 (14:42 +0000)]
configure: error out if building XVMC w/o supported platform

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit b496fc29327a9dfb10a33ed0d6db72f1310fb88a)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out if building VDPAU w/o supported platform
Emil Velikov [Wed, 7 Dec 2016 14:40:39 +0000 (14:40 +0000)]
configure: error out if building VDPAU w/o supported platform

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit 037e9d37b4985e432a48b52f413ac4ba36ab7053)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out if building OMX w/o supported platform
Emil Velikov [Wed, 7 Dec 2016 14:38:10 +0000 (14:38 +0000)]
configure: error out if building OMX w/o supported platform

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit 1914c814a6c4aaaf03c26f6c20a9871ebc98895f)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out if building VA w/o supported platform
Emil Velikov [Wed, 7 Dec 2016 14:32:45 +0000 (14:32 +0000)]
configure: error out if building VA w/o supported platform

A bit pedantic patch to fool proof should someone start thinkering
without knowing what they do.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit 63e11ac2b5c99fa351be5f61a035f72384609a1c)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agogallium/targets: link against XCB only as needed
Emil Velikov [Wed, 3 May 2017 21:04:20 +0000 (22:04 +0100)]
gallium/targets: link against XCB only as needed

OMX and VA can optionally use the X11 DRI2/DRI3, thus we should link
only as required.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit fcbedce31012ee319d9e083a10bc44120f830e4d)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agost/omx: fix building against X11-less setups
Emil Velikov [Mon, 5 Dec 2016 22:22:44 +0000 (22:22 +0000)]
st/omx: fix building against X11-less setups

The vl_*_screen_create API properly falls back to a NOP when we're
building without specific platforms. So the only thing we need is to
handle the lack of X11/Xlib.h and provide a dummy Display define.

Cc: <mesa-stable@lists.freedesktop.org>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 115cb729d8feedf2d33187a5789ebc7582cc3042)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agost/omx: remove unneeded X11 include
Emil Velikov [Mon, 5 Dec 2016 22:27:21 +0000 (22:27 +0000)]
st/omx: remove unneeded X11 include

En route to a X11-less builds

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit d71ce62e84c588a804f457ad159c8ab94cf335b2)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agost/va: fix misplaced closing bracket
Emil Velikov [Fri, 25 Nov 2016 17:55:52 +0000 (17:55 +0000)]
st/va: fix misplaced closing bracket

It's been like this since the code was introduced.

Fixes: 86eb4131a90 (st/va: add headless support, i.e. VA_DISPLAY_DRM)
Cc: <mesa-stable@lists.freedesktop.org>
Cc: Julien Isorce <julien.isorce@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit aaea53c2c02e4d5352ce3d08dfd43b2676d32000)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoauxiliary/vl: use vl_*_screen_create stubs when building w/o platform
Emil Velikov [Tue, 2 May 2017 16:53:17 +0000 (17:53 +0100)]
auxiliary/vl: use vl_*_screen_create stubs when building w/o platform

Provide a dummy stub when the user has opted w/o said platform, thus
we can build the binaries without unnecessarily requiring X11/other
headers.

In order to avoid build and link-time issues, we remove the HAVE_DRI3
guards in the VA and VDPAU state-trackers.

With this change st/va will return VA_STATUS_ERROR_ALLOCATION_FAILED
instead of VA_STATUS_ERROR_UNIMPLEMENTED. That is fine since upstream
users of libva such as vlc and mpv do little error checking, let
alone distinguish between the two.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Guttula, Suresh <Suresh.Guttula@amd.com>
Cc: mesa-stable@lists.freedesktop.org
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 369e5dd939b4af6c653d6cbbe9be257a9c2c950e)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out when building X11 Vulkan without DRI3
Emil Velikov [Mon, 5 Dec 2016 20:14:24 +0000 (20:14 +0000)]
configure: error out when building X11 Vulkan without DRI3

Vulkan supports only DRI3 enabled X11 platforms. Make it obvious,
should one consider building without it.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 05043e0e8e0bd5e3019f480557d452b4c165f8f2)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoloader: build libloader_dri3_helper.la only with HAVE_PLATFORM_X11
Emil Velikov [Wed, 3 May 2017 15:20:49 +0000 (16:20 +0100)]
loader: build libloader_dri3_helper.la only with HAVE_PLATFORM_X11

Pretty much every other place does the same.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit d80d6d662e4199e9a4ec9d924007f8fb0b91b444)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: check once for DRI3 dependencies
Emil Velikov [Sun, 27 Nov 2016 00:25:28 +0000 (00:25 +0000)]
configure: check once for DRI3 dependencies

Currently we are having the XCB_DRI3 dependencies duplicated,
partially.

Just do a once-off check and add all of the respective CFLAGS/LIBS
where needed.

As a nice side effect this helps us solve a couple of FIXMEs.

DRI3 is not a thing w/o X11 so disable it in such cases.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit acf3d2afab0571b74c0c0d1aee0f631b33fdc7da)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
squashed with:

configure.ac: add xcb-fixes to the XCB DRI3 list

The XCB module is used by the VL targets. Thus omitting it can lead to
link-time errors due to unresolved symbols.

Other DRI3 users such as the Vulkan WSI and the dri3 loader helper do
not use an update region in their xcb_present_pixmap() call. We will
look into that at a later stage.

Fixes: acf3d2afab0 ("configure: check once for DRI3 dependencies")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101110
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 9a90d6a9d4ee1632aa357a2ac9be150e058e2c10)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
squashed with:

configure.ac: s/xcb-fixes/xcb-xfixes/

Former is not a thing, even if I have a hacked xcb-fixes.pc on my system.
Thanks for spotting it Mark!

Fixes: 9a90d6a9d4e ("configure.ac: add xcb-fixes to the XCB DRI3 list")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 48cd1919ff1584c211ec7958864cac2e1cb347cf)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: error out when building GLX w/o the X11 platform
Emil Velikov [Wed, 3 May 2017 14:57:31 +0000 (15:57 +0100)]
configure: error out when building GLX w/o the X11 platform

Building EGL/Vulkan/other without X11, while GLX is enabled is confusing
and misleading. In practise anyone aiming at the former will also
disable GLX.

The inverse (some examples below) should still work:
 ./configure --disable-glx --with-platforms=x11 --with-vulkan-drivers=intel
 ./configure --disable-glx --with-platforms=x11 --enable-egl

Keep in mind that the X11 platform is enabled, by default.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 8212fc95b59d0dd3cae1fe11359e0fa96d75e1bc)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: set HAVE_foo_PLATFORM as applicable
Emil Velikov [Mon, 5 Dec 2016 21:32:30 +0000 (21:32 +0000)]
configure: set HAVE_foo_PLATFORM as applicable

Rather than having multiple places that define the macros, do it just
once in configure. Makes existing code a bit shorter and easier to
manage as we fix the VL targets with follow-up commits.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit f353f844a08c78f2aa225165c05dae31f5700845)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: enable the surfaceless platform by default
Emil Velikov [Tue, 25 Apr 2017 15:39:52 +0000 (16:39 +0100)]
configure: enable the surfaceless platform by default

A simple platform that you want to use in a many usecases. See the
spec file details.

It has no special requirements plus it takes less than a second to
build.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 2d35773221d63658bb764f90bd7be95f910f6309)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: loosen --with-platforms heuristics
Emil Velikov [Wed, 3 May 2017 20:24:26 +0000 (21:24 +0100)]
configure: loosen --with-platforms heuristics

Remove the enable-egl pre-requirement. Platform selection does not
depend on EGL.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit edb5a65f93189472814afa97b1e3a54b2478b543)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: update remaining --with-egl-platforms references
Emil Velikov [Fri, 25 Nov 2016 18:34:03 +0000 (18:34 +0000)]
configure: update remaining --with-egl-platforms references

Rename the remaining references to omit the egl part.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 73682f82bc8ab2b96b76ec12da9d2d130ec5e352)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: rename remaining HAVE_EGL_PLATFORM_* guards
Emil Velikov [Fri, 25 Nov 2016 17:11:51 +0000 (17:11 +0000)]
configure: rename remaining HAVE_EGL_PLATFORM_* guards

Analogous to others earlier, these will be used to control the platform
for more than the EGL driver.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 27737e7e84ea1fc9afb44d9294bcf9896f876cfc)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure: move platform handling further up
Emil Velikov [Wed, 3 May 2017 16:02:35 +0000 (17:02 +0100)]
configure: move platform handling further up

We'll need it for the Vulkan drivers and the VL targets.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 3208fd2e46bc627633177ebe60636c59a5684add)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoegl/wayland: Use per-surface event queues
Daniel Stone [Fri, 5 May 2017 13:49:09 +0000 (14:49 +0100)]
egl/wayland: Use per-surface event queues

During display initialisation, we need a separate event queue to handle
the registry events, which is correctly handled. But we also need
separate per-surface event queues to handle swapchain-related events,
such as surface frame events and buffer release events. This avoids two
surfaces from the same EGLDisplay, both current on separate threads,
dispatching each other's events.

Create separate per-surface event queues, create wl_surface and wl_drm
proxy wrapper objects per surface, so we eliminate the race around
sending events to the wrong queue. swrast buffers do not need a
dedicated proxy wrapper, as the wl_shm_pool used to create the
wl_buffers, being transient, can itself be assigned to a queue.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 36b9976e1f99 ("egl/wayland: Avoid race conditions when on non-main thread")
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 03dd9a88b0be17ff0ce91e92f6902a9a85ba584a)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Squashed with:

egl/wayland: verify event queue was allocated

We're already verified that 'window' wasn't NULL, I'm guessing this
allocation error is about the newly created queue.

CID: 1409754
Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 30dc56bb5b313ae67c6e8648e23bb38c8e737488)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoegl/wayland: Don't open-code roundtrip
Daniel Stone [Fri, 5 May 2017 13:44:20 +0000 (14:44 +0100)]
egl/wayland: Don't open-code roundtrip

wl_display_roundtrip_queue() exists and can replace roundtrip(). The
API was introduced with wayland 1.6, while we currently require 1.11.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8118bc269f39ea0b965752ea89b886b28094db42)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agovulkan/wsi/wayland: Use proxy wrappers for swapchain
Daniel Stone [Tue, 2 May 2017 09:06:32 +0000 (10:06 +0100)]
vulkan/wsi/wayland: Use proxy wrappers for swapchain

Though most swapchain operations used a queue, they were racy in that
the object was created with the queue only set later, meaning that its
event could potentially be dispatched from the default queue in between
these two steps.

Use proxy wrappers to avoid this race, also assigning wl_buffers created
for the swapchain to the event queue.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 5034c615582add2be9309dc1d7383fb0daba6dd3)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Squashed with:

vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation

Before the swapchain event queue is destroyed, all proxy objects that reference
it must be dropped. Otherwise we risk a use-after-free if a frame callback event
or buffer release events are received afterwards.
This happens when an application destroys and recreates a swapchain in FIFO
mode between two frames without using the VkSwapchainCreateInfoKHR::oldSwapchain
mechanism to keep the old swapchain until after the next redraw.

Fixes: 5034c615582a ("vulkan/wsi/wayland: Use proxy wrappers for swapchain")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 1586768e7475a2732650f0ec2738b4e8429e4b40)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agovulkan/wsi/wayland: Use per-display event queue
Daniel Stone [Tue, 2 May 2017 09:04:33 +0000 (10:04 +0100)]
vulkan/wsi/wayland: Use per-display event queue

Calling random callbacks on the display's event queue is hostile, as
we may call into client code when it least expects it. Create our own
event queue, one per wsi_wl_display, and use that for the registry.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c902a1957d079941823006d56b6810e1e85be4b0)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agovulkan/wsi/wayland: Remove roundtrip when creating image
Daniel Stone [Tue, 2 May 2017 08:51:40 +0000 (09:51 +0100)]
vulkan/wsi/wayland: Remove roundtrip when creating image

There's no need to call wl_display_roundtrip() after trying to create a
buffer through wl_drm; if it succeeds then everything is fine, and if it
fails, then we get a fatal protocol error so can't recover anyway.

Additionally, doing a roundtrip on the default / main application queue,
is destructive anyway, so would need to be its own queue.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit afe8c8a2997950cd63076b7c9eba39e1858fee43)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agovulkan: Fix Wayland uninitialised registry
Daniel Stone [Fri, 28 Apr 2017 14:49:47 +0000 (16:49 +0200)]
vulkan: Fix Wayland uninitialised registry

Untangle the exit cleanup paths so we don't try to use the registry
variable before it's been initialised.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d9a8bba7f44f7042f0bbd659d0ed342236423dd3)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agodocs: add sha256 checksums for 17.1.1
Emil Velikov [Thu, 25 May 2017 07:18:59 +0000 (08:18 +0100)]
docs: add sha256 checksums for 17.1.1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agodocs: add release notes for 17.1.1
Emil Velikov [Thu, 25 May 2017 07:11:42 +0000 (08:11 +0100)]
docs: add release notes for 17.1.1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoUpdate version to 17.1.1
Emil Velikov [Thu, 25 May 2017 07:06:23 +0000 (08:06 +0100)]
Update version to 17.1.1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agonvc0/ir: SHLADD's middle source must be an immediate
Ilia Mirkin [Sat, 20 May 2017 07:11:12 +0000 (03:11 -0400)]
nvc0/ir: SHLADD's middle source must be an immediate

The instruction encodings only allow for immediates. Don't try to
replace a zero (which is dumb to have in that op in any case) with RZ.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 82e77d4e4484b5d4f6a7b4751a17c882e6d2ad69)

7 years agoautomake: add SWR LLVM gen_builder.hpp workaround
Emil Velikov [Thu, 18 May 2017 20:27:01 +0000 (21:27 +0100)]
automake: add SWR LLVM gen_builder.hpp workaround

As gen_builder.hpp file is generated, it contains information that is
specific to the LLVM version it originates from.

As suggested by Tim, the file seems to be forwards compatible. So in
order to produce ship a file which will work everywhere we should be
using earlies supported LLVM - 3.9.

With this we're back on track and can build all of mesa without
python/mako/flex and friends.

In the long term we might want to see if the python generators can be
updated to produce LLVM version agnostic files. At least within the
range supported by SWR.

Cc: <mesa-stable@lists.freedesktop.org>
Cc: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
(cherry picked from commit 5233eaf9ee85bb551ea38c1e2bbd8ac167754e50)

7 years agonir/lower_tex: Fix minor error in YUV color conversion matrix
Johnson Lin [Thu, 4 May 2017 06:37:52 +0000 (14:37 +0800)]
nir/lower_tex: Fix minor error in YUV color conversion matrix

The matrix used for YCbCr to RGB is listed in:

    https://en.wikipedia.org/wiki/YCbCr

There was an error in converting the offsets from integers to unorm
values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be
128.0/255.  With this fix, the CSC result is bit aligned with wikipedia's
conversion result and FFMPeg's result.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100854
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
(cherry picked from commit a6fb943f3eb86ca501a7e7b8d4621ba215f91133)

7 years agovirgl: fix virgl_bo_transfer_{put, get} box struct copy
Rob Herring [Fri, 12 May 2017 22:05:53 +0000 (17:05 -0500)]
virgl: fix virgl_bo_transfer_{put, get} box struct copy

Commit 3dfe61ed6ec6 ("gallium: decrease the size of pipe_box - 24 -> 16
bytes") changed the size of pipe_box, but the virgl code was relying on
pipe_box and drm_virtgpu_3d_box structs having the same size/layout doing
a struct copy. Copy the fields one by one instead.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Fixes: 3dfe61ed6ec ("gallium: decrease the size of pipe_box - 24 -> 16 bytes")
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 5771ecc90ee7625564c1d3cea1a4fc382b0f58b5)

7 years agoegl: add g_egldispatchstubs.h to the release tarball
Emil Velikov [Thu, 18 May 2017 18:07:08 +0000 (19:07 +0100)]
egl: add g_egldispatchstubs.h to the release tarball

Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit e19ea928b9ba3181d3416a8f388ee8276238dd76)

7 years agoi965/formats: Update the three-channel DXT1 mappings
Nanley Chery [Thu, 11 May 2017 22:57:59 +0000 (15:57 -0700)]
i965/formats: Update the three-channel DXT1 mappings

The procedure for decompressing an opaque DXT1 OpenGL format is
dependant on the comparison of two colors stored in the first 32 bits of
the compressed block. Here's the specified OpenGL behavior for
reference:

   The RGB color for a texel at location (x,y) in the block is given by:

      RGB0,              if color0 > color1 and code(x,y) == 0
      RGB1,              if color0 > color1 and code(x,y) == 1
      (2*RGB0+RGB1)/3,   if color0 > color1 and code(x,y) == 2
      (RGB0+2*RGB1)/3,   if color0 > color1 and code(x,y) == 3

      RGB0,              if color0 <= color1 and code(x,y) == 0
      RGB1,              if color0 <= color1 and code(x,y) == 1
      (RGB0+RGB1)/2,     if color0 <= color1 and code(x,y) == 2
      BLACK,             if color0 <= color1 and code(x,y) == 3

The sampling operation performed on an opaque DXT1 Intel format essentially
hard-codes the comparison result of the two colors as color0 > color1.
This means that the behavior is incompatible with OpenGL. This is stated
in the SKL PRM, Vol 5: Memory Views:

   Opaque Textures (DXT1_RGB)
      Texture format DXT1_RGB is identical to DXT1, with the exception that the
      One-bit Alpha encoding is removed. Color 0 and Color 1 are not compared, and
      the resulting texel color is derived strictly from the Opaque Color Encoding.
      The alpha channel defaults to 1.0.

      Programming Note
      Context: Opaque Textures (DXT1_RGB)
      The behavior of this format is not compliant with the OGL spec.

The opaque and non-opaque DXT1 OpenGL formats are specified to be
decoded in exactly the same way except the BLACK value must have a
transparent alpha channel in the latter. Use the four-channel BC1 Intel
formats with the alpha set to 1 to provide the behavior required by the
spec. Note that the alpha is already set to 1 for RGB formats in
brw_get_texture_swizzle().

v2: Provide a more detailed commit message (Kenneth Graunke).
v3: Ensure the alpha channel is set to 1 for DXT1 formats.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100925
Cc: <mesa-stable@lists.freedesktop.org>
Acked-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit 688ddb85c8c3357d8e1e9d360c74cd728b128d98)

7 years agoanv/formats: Update the three-channel BC1 mappings
Nanley Chery [Thu, 11 May 2017 22:57:59 +0000 (15:57 -0700)]
anv/formats: Update the three-channel BC1 mappings

The procedure for decompressing an opaque BC1 Vulkan format is dependant on the
comparison of two colors stored in the first 32 bits of the compressed block.
Here's the specified OpenGL (and Vulkan) behavior for reference:

   The RGB color for a texel at location (x,y) in the block is given by:

      RGB0,              if color0 > color1 and code(x,y) == 0
      RGB1,              if color0 > color1 and code(x,y) == 1
      (2*RGB0+RGB1)/3,   if color0 > color1 and code(x,y) == 2
      (RGB0+2*RGB1)/3,   if color0 > color1 and code(x,y) == 3

      RGB0,              if color0 <= color1 and code(x,y) == 0
      RGB1,              if color0 <= color1 and code(x,y) == 1
      (RGB0+RGB1)/2,     if color0 <= color1 and code(x,y) == 2
      BLACK,             if color0 <= color1 and code(x,y) == 3

The sampling operation performed on an opaque DXT1 Intel format essentially
hard-codes the comparison result of the two colors as color0 > color1. This
means that the behavior is incompatible with OpenGL and Vulkan. This is stated
in the SKL PRM, Vol 5: Memory Views:

   Opaque Textures (DXT1_RGB)
      Texture format DXT1_RGB is identical to DXT1, with the exception that the
      One-bit Alpha encoding is removed. Color 0 and Color 1 are not compared, and
      the resulting texel color is derived strictly from the Opaque Color Encoding.
      The alpha channel defaults to 1.0.

      Programming Note
      Context: Opaque Textures (DXT1_RGB)
      The behavior of this format is not compliant with the OGL spec.

The opaque and non-opaque BC1 Vulkan formats are specified to be decoded in
exactly the same way except the BLACK value must have a transparent alpha
channel in the latter. Use the four-channel BC1 Intel formats with the alpha
set to 1 to provide the behavior required by the spec.

v2 (Kenneth Graunke):
- Provide a more detailed commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100925
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit 56458cb168bf79ae51ba1efc3acec15874cc34a9)

7 years agogallivm: Make sure module has the correct data layout when pass manager runs
Tom Stellard [Fri, 5 May 2017 01:07:00 +0000 (01:07 +0000)]
gallivm: Make sure module has the correct data layout when pass manager runs

The datalayout for modules was purposely not being set in order to work around
the fact that the ExecutionEngine requires that the module's datalayout
matches the datalayout of the TargetMachine that the ExecutionEngine is
using.

When the pass manager runs on a module with no datalayout, it uses
the default datalayout which is little-endian.  This causes problems
on big-endian targets, because some optimizations that are legal on
little-endian or illegal on big-endian.

To resolve this, we set the datalayout prior to running the pass
manager, and then clear it before creating the ExectionEngine.

This patch fixes a lot of piglit tests on big-endian ppc64.

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 14e525a4d70649eb10185bebd2aef9dc339fb5e6)

7 years agoegl: Partially revert 23c86c74, fix eglMakeCurrent
Chad Versace [Fri, 12 May 2017 04:49:14 +0000 (21:49 -0700)]
egl: Partially revert 23c86c74, fix eglMakeCurrent

Fixes regressions in Android CtsVerifier.apk on Intel Chrome OS devices
due to incorrect error handling in eglMakeCurrent. See below on how to
confirm the regression is fixed.

This partially reverts

    commit 23c86c74cc450a23848b85cfe914376caede1cdf
    Author:  Chad Versace <chadversary@chromium.org>
    Subject: egl: Emit error when EGLSurface is lost

The problem with commit 23c86c74 is that, once an EGLSurface became
lost, the app could never unbind the bad surface. Each attempt to unbind
the bad surface with eglMakeCurrent failed with EGL_BAD_CURRENT_SURFACE.

Specificaly, the bad commit added the error handling below. #2 and #3
were right, but #1 was wrong.

    1. eglMakeCurrent emits EGL_BAD_CURRENT_SURFACE if the calling
       thread has unflushed commands and either previous surface is no
       longer valid.

    2. eglMakeCurrent emits EGL_BAD_NATIVE_WINDOW if either new surface
       is no longer valid.

    3. eglSwapBuffers emits EGL_BAD_NATIVE_WINDOW if the swapped surface
       is no longer valid.

Whe I wrote the bad commit, I misunderstood the EGL spec language
for #1. The correct behavior is, if I understand correctly now, is
below. This patch doesn't implement the correct behavior, though, it
just reverts the broken behavior.

    - Assume a bound EGLSurface is no longer valid.
    - Assume the bound EGLContext has unflushed commands.
    - The app calls eglMakeCurrent. The spec requires eglMakeCurrent to
      implicitly flush. After flushing, eglMakeCurrent emits
      EGL_BAD_CURRENT_SURFACE and does *not* alter the thread's
      current bindings.
    - If the app calls eglMakeCurrent again, and the app inserts no
      commands into the GL command stream between the two eglMakeCurrent
      calls, then this second eglMakeCurrent succeeds without emitting an
      error.

How to confirm this fixes the regression:

    Download android-cts-verifier-7.1_r5-linux_x86-x86.zip from
    source.android.com, unpack, and `adb install CtsVerifier.apk`.
    Run test "Projection Cube". Click the Pass button (a
    green checkmark). Then run test "Projection Widget". Confirm that
    widgets are visible and that logcat does not complain about
    eglMakeCurrent failure.

    Then confirm there are no regressions in the cts-traded module that
    commit 263243b1 fixed:

        cts-tf > run cts --skip-preconditions --skip-device-info \
                 -m CtsCameraTestCases \
                 -t android.hardware.camera2.cts.RobustnessTest

    Tested with Chrome OS board "reef".

Fixes: 23c86c74 (egl: Emit error when EGLSurface is lost)
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Nicolas Boichat <drinkcat@chromium.org>
Cc: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 8f62d21bd72059d723f4626f76de6fec4a569616)

7 years agofreedreno: fix crash when flush() but no rendering
Rob Clark [Sun, 14 May 2017 15:32:44 +0000 (11:32 -0400)]
freedreno: fix crash when flush() but no rendering

If we haven't created a batch, just bail in pipe->flush(), since there
is nothing to do.

Fixes crash in warsow, which creates a whole bunch of contexts used for
nothing but texture uploads.

Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit e4ad86952a197549894eb4c9a96af0c76dd95d18)

7 years agogbm/dri: Fix sign-extension in modifier query
Daniel Stone [Tue, 2 May 2017 18:44:38 +0000 (19:44 +0100)]
gbm/dri: Fix sign-extension in modifier query

When we were assembling the unsigned 64-bit query return from its
two signed 32-bit component parts, the lower half was getting
sign-extended into the top half. Be more explicit about what we want to
do.

Fixes gbm_bo_get_modifier() returning ((1 << 64) - 1) rather than
((1 << 56) - 1), i.e. DRM_FORMAT_MOD_INVALID.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
(cherry picked from commit 80ac89a952930f068a058a9eee3c2536832b10c9)
Fixes: 8378c576abd ("gbm: Export a get modifiers")

7 years agobin/get-fixes-pick-list.sh: bring back the warning
Andres Gomez [Mon, 8 May 2017 17:57:35 +0000 (20:57 +0300)]
bin/get-fixes-pick-list.sh: bring back the warning

We warn again if there are more than one line with the "fixes:" tag.

The warning is silenced when the commit has already landed or each
fixes tag reference a commit that is in branch.

v2:
 - Warn if any of the fixes tags has not landed (Emil)

v3:
 - Remove unnecessary head command
 - Clarify commit message (Emil)
 - Skip already picked commits sooner (Emil)

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

7 years agobin/get-fixes-pick-list.sh: don't warn if more than one, go over them
Andres Gomez [Sat, 6 May 2017 14:09:35 +0000 (17:09 +0300)]
bin/get-fixes-pick-list.sh: don't warn if more than one, go over them

If an identified commit was having more than one fix, we would warn
about that and only treat the first.

Now, we don't warn but treat all of them.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 77306e2afc4b2148b8532b6b4759af24cc135f6b)

7 years agobin/get-{extra,fixes}-pick-list.sh: improve output
Juan A. Suarez Romero [Wed, 5 Apr 2017 18:18:42 +0000 (20:18 +0200)]
bin/get-{extra,fixes}-pick-list.sh: improve output

Show the commit hash and the title in a way that it is easier to copy
and paste in the bin/.cherry-ignore-extra file if we want to ignore
those commits for the future.

v2:
- Use printf instead echo (Eric Engestrom)

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 3af7f8275b806d42daaad6f700c3917f8e33d3e4)

7 years agobin/get-{extra,fixes}-pick-list.sh: add support for ignore list
Juan A. Suarez Romero [Wed, 5 Apr 2017 18:14:22 +0000 (20:14 +0200)]
bin/get-{extra,fixes}-pick-list.sh: add support for ignore list

Both scripts does not use a file with the commits to ignore. So if we
have handled one of the suggested commits and decided we won't pick it,
the scripts will continue suggesting them.

v2:
- Mark the candidates in bin/get-extra-pick-list.sh (Juan A. Suarez)
- Use bin/.cherry-ignore to store rejected patches (Emil)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 99b41631bb98d154df3dd01f17edd5e5a6a7d1f1)

7 years agost/mesa: remove an incorrect assertion
Nicolai Hähnle [Wed, 17 May 2017 13:14:35 +0000 (15:14 +0200)]
st/mesa: remove an incorrect assertion

There is really no reason why the current DrawBuffer needs to be complete
at this point. In particular, the assertion gets hit on the X server side
in libglx when running .../piglit/bin/glx-get-current-display-ext -auto
(which uses indirect GLX rendering).

Fixes: 19b61799e3d0 ("st/mesa: don't cast the incomplete framebufer to st_framebuffer")
Reported-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 377877ff5f5d08a1a417e8baf923b44c74f0d7e7)

7 years agoAndroid: correct libz dependency
Chih-Wei Huang [Wed, 17 May 2017 05:10:02 +0000 (13:10 +0800)]
Android: correct libz dependency

Commit 6facb0c0 ("android: fix libz dynamic library dependencies")
unconditionally adds libz as a dependency to all shared libraries.
That is unnecessary.

Commit 85a9b1b5 introduced libz as a dependency to libmesa_util.
So only the shared libraries that use libmesa_util need libz.

Fix Android Lollipop build by adding the include path of zlib to
libmesa_util explicitly instead of getting the path implicitly
from zlib since it doesn't export the include path in Lollipop.

Fixes: 6facb0c0 "android: fix libz dynamic library dependencies"

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rob Herring <robh@kernel.org>
(cherry picked from commit bfc0c23843008fd510afa263ebe371bef3346445)

7 years agoconfigure: remove unneeded bits around libunwind handling
Emil Velikov [Mon, 8 May 2017 16:37:02 +0000 (17:37 +0100)]
configure: remove unneeded bits around libunwind handling

If libunwind is not found we'll fail at PKG_CHECK_MODULES, so the
follow-up check will be false. Additionally the AM_CONDITIONAL is not
used, so we can drop it.

Fixes: 3bcef6aa245 ("configure.ac: honour --disable-libunwind if the .pc file is present")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 709468a8088f7d9b3472ca6993e983a2361b5509)

7 years agoradeon: automake: remove unneeded elf Cflags/Libs
Emil Velikov [Thu, 4 May 2017 15:17:28 +0000 (16:17 +0100)]
radeon: automake: remove unneeded elf Cflags/Libs

No longer required as of commit d90bf4ef3e1 ("radeon: remove unused
radeon_elf_util.{c,h}")

v2: Add the required libelf link in src/amd/Makefile.common.am

Fixes: d90bf4ef3e1 ("radeon: remove unused  radeon_elf_util.{c,h}")
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
(cherry picked from commit 88b8aaea3b172d4a0224bcadf5f12e2ae6119a0c)

7 years agoanv: don't leak DRM devices
Grazvydas Ignotas [Tue, 2 May 2017 17:11:06 +0000 (20:11 +0300)]
anv: don't leak DRM devices

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

Fixes: b1fb6e8d "anv: do not open random render node(s)"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> # radv version
(cherry picked from commit 0ef302638f2883789a3b39c2b6cfd20814efa0bb)

7 years agoanv: fix possible stack corruption
Grazvydas Ignotas [Tue, 2 May 2017 16:26:17 +0000 (19:26 +0300)]
anv: 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: b1fb6e8d "anv: do not open random render node(s)"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit e0aee8b667955675e2e6c647a88048b64bc2796e)

7 years agoi965/vec4: load dvec3/4 uniforms first in the push constant buffer
Samuel Iglesias Gonsálvez [Wed, 19 Apr 2017 09:18:35 +0000 (11:18 +0200)]
i965/vec4: load dvec3/4 uniforms first in the push constant buffer

Reorder the uniforms to load first the dvec4-aligned variables in the
push constant buffer and then push the vec4-aligned ones. It takes
into account that the relocated uniforms should be aligned to their
channel size.

This fixes a bug were the dvec3/4 might be loaded one part on a GRF and
the rest in next GRF, so the region parameters to read that could break
the HW rules.

v2:
- Fix broken logic.
- Add a comment to explain what should be needed to optimise the usage
  of the push constant buffer slots, as this patch does not pack the
  uniforms.

v3:
- Implemented the push constant buffer usage optimization.

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

7 years agoi965/vec4: fix swizzle and writemask when loading an uniform with constant offset
Samuel Iglesias Gonsálvez [Wed, 19 Apr 2017 08:35:07 +0000 (10:35 +0200)]
i965/vec4: fix swizzle and writemask when loading an uniform with constant offset

It was setting XYWZ swizzle and writemask to all uniforms, no matter if they
were a vector or scalar, so this can lead to problems when loading them
to the push constant buffer.

Moreover, 'shift' calculation was designed to calculate the offset in
DWORDS, but it doesn't take into account DFs, so the calculated swizzle
for the later ones was wrong.

The indirect case is not changed because MOV INDIRECT will write
to all components. Added an assert to verify that these uniforms
are aligned.

v2:
- Fix 'shift' calculation (Curro)
- Set both swizzle and writemask.
- Add assert(shift == 0) for the indirect case.

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 8aa6ada8384a961b37dfefec7f9e40e5a4e27ce7)

7 years agoi965/vec4/gs: restore the uniform values which was overwritten by failed vec4_gs_visi...
Samuel Iglesias Gonsálvez [Fri, 5 May 2017 08:42:15 +0000 (10:42 +0200)]
i965/vec4/gs: restore the uniform values which was overwritten by failed vec4_gs_visitor execution

We are going to add a packing feature to reduce the usage of the push
constant buffer. One of the consequences is that 'nr_params' would be
modified by vec4_visitor's run call, so we need to restore it if one of
them failed before executing the fallback ones. Same thing happens to the
uniforms values that would be reordered afterwards.

Fixes GL45-CTS.arrays_of_arrays_gl.InteractionFunctionCalls2 when
the dvec4 alignment and packing patch is applied.

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

7 years agovc4: Don't allocate new BOs to avoid synchronization when they're shared.
Eric Anholt [Wed, 17 May 2017 20:22:39 +0000 (13:22 -0700)]
vc4: Don't allocate new BOs to avoid synchronization when they're shared.

If X11 did a software fallback to the entire screen, we would throw out
the BO the screen is scanning out from and allocate a new one.

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit e8ea42d245cb6adc7f16ee4e96fd89d905d2163a)

7 years agoglxglvnddispatch: Add missing dispatch for GetDriverConfig
Hans de Goede [Mon, 20 Mar 2017 07:41:26 +0000 (08:41 +0100)]
glxglvnddispatch: Add missing dispatch for GetDriverConfig

Together with some fixes to xdriinfo this fixes xdriinfo not working
with glvnd.

Since apps (xdriinfo) expect GetDriverConfig to work without going to
need through the dance to setup a glxcontext (which is a reasonable
expectation IMHO), the dispatch for this ends up significantly different
then any other dispatch function.

This patch gets the job done, but I'm not really happy with how this
patch turned out, suggestions for a better fix are welcome.

Cc: Kyle Brenneman <kbrenneman@nvidia.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 84f764a7591715104b28c035c837ce9fd86157ad)

7 years agointel/isl/gen7: Use stencil vertical alignment of 8 instead of 4
Pohjolainen, Topi [Wed, 3 May 2017 09:22:50 +0000 (12:22 +0300)]
intel/isl/gen7: Use stencil vertical alignment of 8 instead of 4

The reasoning Chad gave in the comment for choosing a valign of 4 is
entirely bunk.  The fact that you have to multiply pitch by 2 is
completely unrelated to the halign/valign parameters used for texture
layout.  (Not completely unrelated.  W-tiling is just Y-tiling with a
bit of extra swizzling which turns 8x8 W-tiled chunks into 16x4 y-tiled
chunks so it makes everything easier if miplevels are always aligned to
8x8.)  The fact that RENDER_SURFACE_STATE::SurfaceVerticalAlignmet
doesn't have a VALIGN_8 option doesn't matter since this is gen7 and you
can't do stencil texturing anyway.

v2 (Jason Ekstrand):
 - Delete most of Chad's comment and add a more descriptive commit
   message.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit 236f17a9f73935db6cddafd91e53a5fae34aae6e)

7 years agomesa/st: fix yuv EGLImage's
Rob Clark [Tue, 16 May 2017 14:29:44 +0000 (10:29 -0400)]
mesa/st: fix yuv EGLImage's

Don't reject YUV formats that the driver doesn't handle natively, since
mesa/st already knows how to lower this in shader.

Reported-by: Nicolas Dechesne <ndec@linaro.org>
Fixes: 83e9de2 ("st/mesa: EGLImageTarget* error handling")
Cc: 17.1 <mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Nicolas Dechesne <ndec@linaro.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 8b4588b090826a2da7c1b99497ed07705b149ae1)

7 years agoetnaviv: allow R/B swapped surfaces to be cleared
Lucas Stach [Wed, 10 May 2017 16:01:05 +0000 (18:01 +0200)]
etnaviv: allow R/B swapped surfaces to be cleared

Fixes: 7f62ffb68ad ("etnaviv: add support for rb swap")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit 20ce6f136188c24a019153e78c87872fb0a03060)

7 years agoetnaviv: stop oversizing buffer resources
Lucas Stach [Wed, 10 May 2017 16:01:04 +0000 (18:01 +0200)]
etnaviv: stop oversizing buffer resources

PIPE_BUFFER is a target enum, not a binding. This caused the driver to
up-align the height of buffer resources, leading to largely oversizing
those resources. This is especially bad, as the buffer resources used
by the upload manager are already 1MB in size. Height alignment meant
that those would result in 4 to 8MB big BOs.

Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs")
Cc: mesa-stable@lists.freedesktop.org
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>
(cherry picked from commit 8173d7d9e8b40cc9415811ad13924daa04a73646)

7 years agoradeonsi: fix gl_PrimitiveIDIn in geometry shader when using tessellation
Nicolai Hähnle [Mon, 15 May 2017 09:10:13 +0000 (11:10 +0200)]
radeonsi: fix gl_PrimitiveIDIn in geometry shader when using tessellation

This builds on commit 0549ea15ec38 ("radeonsi: fix primitive ID in
fragment shader when using tessellation").

Fixes piglit
arb_tessellation_shader/execution/gs-primitiveid-instanced.shader_test

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

7 years agoradeonsi/gfx9: add support for Raven
Marek Olšák [Mon, 27 Feb 2017 21:26:10 +0000 (22:26 +0100)]
radeonsi/gfx9: add support for Raven

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 7622181cade48d3b389024b6ce3e4e177073964e)

7 years agoamd/addrlib: import Raven support
Marek Olšák [Mon, 27 Feb 2017 21:25:43 +0000 (22:25 +0100)]
amd/addrlib: import Raven support

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 efdb378c3688b897bdbec11218cdc9ee5e801bbd)

7 years agorenderonly: Initialize fields of struct winsys_handle.
Eric Anholt [Tue, 9 May 2017 18:24:21 +0000 (11:24 -0700)]
renderonly: Initialize fields of struct winsys_handle.

vc4 was rejecting renderonly's import, because the offset field was
nonzero.

Fixes: 848b49b288f ("gallium: add renderonly library")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit c98f03c6ebaca82c265b2f3242aed5c6a3c5dcd8)

7 years agoradeonsi: add new vega10 pci ids
Alex Deucher [Wed, 10 May 2017 15:40:01 +0000 (11:40 -0400)]
radeonsi: add new vega10 pci ids

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

7 years agoswr: move msaa resolve to generalized StoreTile
Bruce Cherniak [Fri, 5 May 2017 00:33:36 +0000 (19:33 -0500)]
swr: move msaa resolve to generalized StoreTile

v3: list piglit tests fixed by this patch. Fixed typo Tim pointed out.
v2: Reword commit message to more closely adhere to community
guidelines.

This patch moves msaa resolve down into core/StoreTiles where the
surface format conversion routines are available.  The previous
"experimental" resolve was limited to 8-bit unsigned render targets.

This fixes a number of piglit msaa tests by adding resolve support for
all the render target formats we support.

Specifically:
layered-rendering/gl-layer-render: fail->pass
layered-rendering/gl-layer-render-storage: fail->pass
multisample-formats *[2,4,8,16] gl_arb_texture_rg: crash->pass
multisample-formats *[2,4,8,16] gl_ext_texture_snorm: crash->pass
multisample-formats *[2,4,8,16] gl_arb_texture_float: fail->pass
multisample-formats *[2,4,8,16] gl_arb_texture_rg-float: fail->pass

MSAA is still disabled by default, but can be enabled with
"export SWR_MSAA_MAX_COUNT=4" (1,2,4,8,16 are options)
The default is 0, which is disabled.

This patch improves the number of multisample-formats supported by swr,
and fixes several crashes currently in the 17.1 branch.  Therefore, it
should be considered for inclusion in the 17.1 stable release.  Being
disabled by default, it poses no risk to most users of swr.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit f52e63069a3fad23e03d42306a42bd20f0159da3)

7 years agoradeonsi: fix gl_PrimitiveID in tessellation with instanced draws on SI
Nicolai Hähnle [Wed, 3 May 2017 09:26:27 +0000 (11:26 +0200)]
radeonsi: fix gl_PrimitiveID in tessellation with instanced draws on SI

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

7 years agoradeonsi: fix primitive ID in fragment shader when using tessellation
Nicolai Hähnle [Wed, 3 May 2017 09:40:07 +0000 (11:40 +0200)]
radeonsi: fix primitive ID in fragment shader when using tessellation

In a VS->TCS->TES->PS pipeline, the primitive ID is read from TES exports,
so it is as if TES were using the primitive ID.

Specifically, this fixes a bug where the primitive ID is not reset at
the start of a new instance.

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

7 years agoradeonsi: mark fast-cleared textures as compressed when dirtying
Nicolai Hähnle [Thu, 4 May 2017 13:20:48 +0000 (15:20 +0200)]
radeonsi: mark fast-cleared textures as compressed when dirtying

There are a bunch of piglit fast clear tests that regressed on SI, for
example ./bin/ext_framebuffer_multisample-fast-clear single-sample.

The problem is that a texture is bound as a framebuffer, cleared, and
then rendered from in a loop that loops through different clear colors.
The texture is never rebound during all this, so the change to
tex->dirty_level_mask during fast clear was not taken into account
when checking for compressed textures.

I have considered simply reverting the problematic commit. However,
I think this solution is better. It does require looping through all
bound textures after a fast clear, but the alternative would require
visiting more textures needless on every draw. Draws are much more
common than clears.

Note that the rendering feedback loop rules do not apply here, because
the framebuffer binding is changed between the glClear and the draw
that samples from the texture that was cleared.

Fixes: bdd644976952 ("radeonsi: don't mark non-dirty textures with CMASK as compressed")
Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 854ed47f3e1501e4cc87bf9f19c6d4a1ad2bab08)

7 years agodocs: add sha256 checksums for 17.1.0
Emil Velikov [Wed, 10 May 2017 14:20:37 +0000 (15:20 +0100)]
docs: add sha256 checksums for 17.1.0

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agodocs: Update 17.1.0 release notes
Emil Velikov [Wed, 10 May 2017 11:11:03 +0000 (12:11 +0100)]
docs: Update 17.1.0 release notes

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoUpdate version to 17.1.0(final)
Emil Velikov [Wed, 10 May 2017 11:02:52 +0000 (12:02 +0100)]
Update version to 17.1.0(final)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoradv: don't advertise transfer props unless we can do anything else
Dave Airlie [Thu, 4 May 2017 00:51:49 +0000 (10:51 +1000)]
radv: don't advertise transfer props unless we can do anything else

There is no reason to advertise transfer ability for formats we can't
use for anything else. This stops some CTS tests hitting internal
error for 64-bit types when they see the transfer flags.

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

7 years agoradv/ac: canonicalize the output for 32-bit float min/max.
Dave Airlie [Fri, 17 Mar 2017 03:38:41 +0000 (13:38 +1000)]
radv/ac: canonicalize the output for 32-bit float min/max.

This fixes:
dEQP-VK.glsl.builtin.precision.min.*
dEQP-VK.glsl.builtin.precision.max.*
dEQP-VK.glsl.builtin.precision.clamp.*

The problem is the hw doesn't compare denorms properly,
so we have to flush them, even though the spec says
flushing is optional, if you don't flush the results
should be correct.

The -pro driver changes the shader float mode,
it would be nice if llvm could grow that perhaps.

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

7 years agoradv: flush f32->f16 conversion denormals to zero. (v2)
Dave Airlie [Fri, 17 Mar 2017 02:11:30 +0000 (12:11 +1000)]
radv: flush f32->f16 conversion denormals to zero. (v2)

SPIR-V defines the f32->f16 operation as flushing denormals to 0,
this compares the class using amd class opcode.

Thanks to Matt Arsenault for figuring it out.

This fix is VI+ only, add a TODO for SI/CIK.

This fixes:
dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero

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

7 years agoradv: flush more stages when semaphore are waiting.
Dave Airlie [Tue, 2 May 2017 21:13:21 +0000 (07:13 +1000)]
radv: flush more stages when semaphore are waiting.

This still doesn't give us complete pWaitDstStageMask support,
but it should provide enough to be correct if not as efficent as
possible.

If we have wait semaphores we must flush between submits and
flush the shaders as well.

This fixes the remaining fails in:
dEQP-VK.synchronization.op.single_queue.semaphore.*ssbo*

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

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)