OSDN Git Service

android-x86/external-mesa.git
6 years agoradv: Remove SI num RB override for occlusion queries.
Bas Nieuwenhuizen [Tue, 6 Jun 2017 20:03:49 +0000 (22:03 +0200)]
radv: Remove SI num RB override for occlusion queries.

radeonsi doesn't have it anymore either.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 59c2e2a061736a981819c3cb217e92e1509d9852)

6 years agoradv: fewer than 8 RBs are possible
Nicolai Hähnle [Tue, 16 May 2017 15:05:02 +0000 (17:05 +0200)]
radv: fewer than 8 RBs are possible

This fixes the subsequent assertion on Bonaire.

Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 388d36dfd180bc16b9d2803d9a213aa5e5ee011f)

6 years agoradv: expose integrated device type for APUs.
Dave Airlie [Mon, 15 May 2017 01:27:10 +0000 (11:27 +1000)]
radv: expose integrated device type for APUs.

This just sets the vulkan device type depending on whether
this is an APU or GPU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
(cherry picked from commit 2890a711587e03f906530919056275b599f5f03e)

6 years agoradv: Dirty all descriptors sets when changing the pipeline.
Bas Nieuwenhuizen [Fri, 2 Jun 2017 22:01:36 +0000 (00:01 +0200)]
radv: Dirty all descriptors sets when changing the pipeline.

Sets could have been ignored during previous descriptor set flush
due to the shader not using them and therefore no SGPR being assigned.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: ae61ddabe8c "radv: move userdata sgpr ownership to compiler side."
(cherry picked from commit 4415a46be2cbb752b94b62bdf5bc7d4d4bbe9fab)

Conflicts:
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_meta.c

6 years agoradv: Set both compute and graphics SGPRS on descriptor set flush.
Bas Nieuwenhuizen [Fri, 2 Jun 2017 21:51:50 +0000 (23:51 +0200)]
radv: Set both compute and graphics SGPRS on descriptor set flush.

We clear the descriptors_dirty array afterwards, so the SGPRs for
the other pipeline don't get updated on the flush for that other
draw/dispatch, so we have to make sure we do it immediately.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: ae61ddabe8c "radv: move userdata sgpr ownership to compiler side."
(cherry picked from commit 5fb8bb306534d633ceb4e33d89984718326773ba)
[Emil Velikov: drop radv_flush_indirect_descriptor_sets hunk - missing
in branch]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/amd/vulkan/radv_cmd_buffer.c

6 years agoegl: fix _eglQuerySurface in EGL_BUFFER_AGE_EXT case
Tapani Pälli [Thu, 8 Jun 2017 09:24:24 +0000 (12:24 +0300)]
egl: fix _eglQuerySurface in EGL_BUFFER_AGE_EXT case

Specification states that in case of error, value should not be
written, patch changes buffer age queries to return -1 in case of
error so that we can skip changing the value.

In addition, small change to droid_query_buffer_age to return 0
in case buffer does not have a back buffer available.

Fixes:
   dEQP-EGL.functional.negative_partial_update.not_postable_surface

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8fac894f9b8e4e2cb93061fdd25f3aecbfb3bbb7)

6 years agoswr: relax c++ requirement from c++14 to c++11
Tim Rowley [Thu, 8 Jun 2017 15:38:52 +0000 (10:38 -0500)]
swr: relax c++ requirement from c++14 to c++11

Remove c++14 generic lambda to keep compiler requirement at c++11.

No regressions on piglit or vtk test suites.

Tested-by: Chuck Atkins <chuck.atkins@kitware.com>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
CC: mesa-stable@lists.freedesktop.org
(cherry picked from commit 0b80b025021f97d27520390867c20336dc891a16)

6 years agoradeonsi: disable the patch ID workaround on SI when the patch ID isn't used (v2)
Marek Olšák [Tue, 6 Jun 2017 13:23:42 +0000 (15:23 +0200)]
radeonsi: disable the patch ID workaround on SI when the patch ID isn't used (v2)

The workaround causes a massive performance decrease on 1-SE parts.
(Cape Verde, Hainan, Oland)

The performance regression is already part of 17.0 and 17.1.

v2: check tess_uses_prim_id

Cc: 17.0 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 391673af7ad1565a5f6ac8fc2f8c9fcdd1fe9908)
[Emil Velikov: s/tcs_tes_uses_prim_id/tess_uses_prim_id/]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoi965: Mark depth surfaces as needing a HiZ resolve after blitting
Jason Ekstrand [Fri, 26 May 2017 16:33:55 +0000 (09:33 -0700)]
i965: Mark depth surfaces as needing a HiZ resolve after blitting

Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit 5097fcbfdc8dc5aab779af92022f9b5ff16026f0)

6 years agoi965: Perform HiZ flush/stall prior to HiZ resolves
Jason Ekstrand [Mon, 5 Jun 2017 18:52:32 +0000 (11:52 -0700)]
i965: Perform HiZ flush/stall prior to HiZ resolves

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit acbd02450bfd53f61bbe468a6f0e8bf5e4507095)

6 years agoi965: Move the pre-depth-clear flush/stalls to intel_hiz_exec
Jason Ekstrand [Mon, 5 Jun 2017 18:49:24 +0000 (11:49 -0700)]
i965: Move the pre-depth-clear flush/stalls to intel_hiz_exec

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit acb9a2ef8f5d92002ed7eb7676c4a96db661ba3a)

6 years agoi965/blorp: Take a layer range in intel_hiz_exec
Jason Ekstrand [Mon, 5 Jun 2017 18:46:22 +0000 (11:46 -0700)]
i965/blorp: Take a layer range in intel_hiz_exec

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 252b004a51d951391846ec5644abe88bfffb72bd)

6 years agodri3/GLX: Fix drawable invalidation v2
Thomas Hellstrom [Thu, 1 Jun 2017 10:04:05 +0000 (12:04 +0200)]
dri3/GLX: Fix drawable invalidation v2

A number of internal VMware apitrace traces image comparisons fail with
dri3 because the viewport transformation becomes incorrect after an X
drawable resize. The incorrect viewport transformation sometimes persist
until the second draw-call after a swapBuffer.

Comparing with the dri2 glx code there are a couple of places where dri2
invalidates the drawable in the absence of server-triggered invalidation,
where dri3 doesn't do that. When these invalidation points are added to
dri3, the image comparisons become correct.

v2:
Addressed review comment by Michel Dänzer.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-and-tested-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 1253d58983b2b6ba4ed16444a344327e8117f333)

6 years agoradeonsi: fix a GPU hang with tessellation on 2-CU configs
Marek Olšák [Tue, 23 May 2017 19:52:11 +0000 (21:52 +0200)]
radeonsi: fix a GPU hang with tessellation on 2-CU configs

Only harvested Stoney has 2 CUs. Tested on 2-CU Stoney and Fiji forced
to 2 CUs.

Cc: 17.0 17.1 <mesa-stable@lists.freedesktop.org>
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
(cherry picked from commit 6c655cfeb49a8142c44782c5164619a5860c7706)

6 years agost/mesa: don't load cached TGSI shaders on demand
Marek Olšák [Wed, 31 May 2017 11:07:04 +0000 (13:07 +0200)]
st/mesa: don't load cached TGSI shaders on demand

This fixes a performance issue with the shader cache that delayed Gallium
shader create calls until draw calls.

I'd like this in stable, but it's not a showstopper.

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit 2ec50f98a9be9ee94aa0dd82fb7560c00153b03f)

6 years agonvc0: disable BGRA8 images on Fermi
Lyude [Sat, 3 Jun 2017 00:45:36 +0000 (20:45 -0400)]
nvc0: disable BGRA8 images on Fermi

BGRA8 image stores on Fermi don't work, which results in breaking
PBO downloads, such that they always return 0x0. Discovered this
through a glamor bug, and confirmed it does indeed break a good number
of piglit tests such as spec/arb_pixel_buffer_object/pbo-read-argb8888

Fixes: 8e7893eb53213 ("nvc0: add support for BGRA8 images")
Signed-off-by: Lyude <lyude@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 245912b684b862d47cde10052b137d76a55d0bd3)

6 years agoxlib: fix glXGetCurrentDisplay() failure
Brian Paul [Mon, 22 May 2017 17:46:27 +0000 (11:46 -0600)]
xlib: fix glXGetCurrentDisplay() failure

glXGetCurrentDisplay() has been broken for years and nobody noticed until
recently.  This change adds a new XMesaGetCurrentDisplay() that the GLX
emulation API can call, just as we did for glXGetCurrentContext().

Tested by hacking glxgears to call glXGetCurrentContext() before and
after glXMakeCurrent() to verify the return value is NULL beforehand and
the same as the opened display afterward.

Also tested by Tom Hudson with his tests programs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100988
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Tom Hudson <tom.hudson.phd@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c6ba85a8c0f02b3b7058dae7afb6c49f56567319)

6 years agoautomake: Link all libGL.so variants with -Bsymbolic.
Jose Fonseca [Thu, 1 Jun 2017 15:41:13 +0000 (16:41 +0100)]
automake: Link all libGL.so variants with -Bsymbolic.

We were linking src/glx with -Bsymbolic, but not the classic/gallium X11
libGL.so.

But it's always a good idea to build all libGL.so and all DRI drivers
with -Bsymbolic, otherwise they might resolve symbols from the 3rd party
application executable or shared libraries, which is _never_ what we
want.

In particular, this can happen when intercepting OpenGL calls with
apitrace, before
https://github.com/apitrace/apitrace/commit/63194b2573176ef34efce1a5c8b08e624b8dddf5

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit ce5e83b8a0c757072075e781a090d35d9dc0e285)

6 years agoi965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()
Chad Versace [Sat, 27 May 2017 00:28:21 +0000 (17:28 -0700)]
i965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()

This function never occurs in the callchain of a GL function. It occurs
only in the callchain of eglCreate*Surface and the analogous paths for
GLX.  Therefore, even if a  thread does have a bound GL context,
emitting a GL error here is wrong. A misplaced GL error, when no GL
call is made, can confuse clients.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9d996e94fbbfdb3692061009f5441cf61bba36ae)
[Emil Velikov: resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/mesa/drivers/dri/i965/intel_fbo.c

6 years agoetnaviv: always do cpu_fini in transfer_unmap
Lucas Stach [Thu, 18 May 2017 13:39:58 +0000 (15:39 +0200)]
etnaviv: always do cpu_fini in transfer_unmap

The cpu_fini() call pushes the buffer back into the GPU domain, which needs
to be done for all buffers, not just the ones with CPU written content. The
etnaviv kernel driver currently doesn't validate this, but may start to do
so at a later point in time. If there is a temporary resource the fini needs
to happen before the RS uses this one as the source for the upload.

Also remove an invalid comment about flushing CPU caches, cpu_fini takes
care of everything involved in this.

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: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-By: Wladimir J. van der Laan <laanwj@gmail.com>
(cherry picked from commit cab5996c2637c31a78a0196e42ec6de9eb61f270)

7 years agodocs: add sha256 checksums for 17.1.2
Juan A. Suarez Romero [Mon, 5 Jun 2017 21:15:43 +0000 (21:15 +0000)]
docs: add sha256 checksums for 17.1.2

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agodocs: add release notes for 17.1.2
Juan A. Suarez Romero [Mon, 5 Jun 2017 20:27:24 +0000 (20:27 +0000)]
docs: add release notes for 17.1.2

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoUpdate version to 17.1.2
Juan A. Suarez Romero [Mon, 5 Jun 2017 20:15:30 +0000 (20:15 +0000)]
Update version to 17.1.2

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Require vertex buffers to come from a 32-bit heap
Jason Ekstrand [Wed, 17 May 2017 18:54:24 +0000 (11:54 -0700)]
anv: Require vertex buffers to come from a 32-bit heap

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 39adea9330376a64a4b5e8da98f5e055ebd3331e)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoRevert "cherry-ignore: anv: Require vertex buffers to come from a 32-bit heap"
Juan A. Suarez Romero [Sat, 3 Jun 2017 18:36:43 +0000 (20:36 +0200)]
Revert "cherry-ignore: anv: Require vertex buffers to come from a 32-bit heap"

This reverts commit b3e48a07c0bb0c58e73ec6d82f3a3104ec26aacb.

7 years agoi965: Rework Sandy Bridge HiZ and stencil layouts
Jason Ekstrand [Sat, 27 May 2017 17:36:23 +0000 (10:36 -0700)]
i965: Rework Sandy Bridge HiZ and stencil layouts

Sandy Bridge does not technically support mipmapped depth/stencil.  In
order to work around this, we allocate what are effectively completely
separate images for each miplevel, ensure that they are page-aligned,
and manually offset to them.  Prior to layered rendering, this was a
simple matter of setting a large enough halign/valign.

With the advent of layered rendering, however, things got more
complicated.  Now, things weren't as simple as just handing a surface
off to the hardware.  Any miplevel of a normally mipmapped surface can
be considered as just an array surface given the right qpitch.  However,
the hardware gives us no capability to specify qpitch so this won't
work.  Instead, the chosen solution was to use a new "all slices at each
LOD" layout which laid things out as a mipmap of arrays rather than an
array of mipmaps.  This way you can easily offset to any of the
miplevels and each is a valid array.

Unfortunately, the "all slices at each lod" concept missed one
fundamental thing about SNB HiZ and stencil hardware:  It doesn't just
always act as if you're always working with a non-mipmapped surface, it
acts as if you're always working on a non-mipmapped surface of the same
size as LOD0.  In other words, even though it may only write the
upper-left corner of each array slice, the qpitch for the array is for a
surface the size of LOD0 of the depth surface.  This mistake causes us
to under-allocate HiZ and stencil in some cases and also to accidentally
allow different miplevels to overlap.  Sadly, piglit test coverage
didn't quite catch this until I started making changes to the resolve
code that caused additional HiZ resolves in certain tests.

This commit switches Sandy Bridge HiZ and stencil over to a new scheme
that lays out the non-zero miplevels horizontally below LOD0.  This way
they can all have the same qpitch without interfering with each other.
Technically, the miplevels still overlap, but things are spaced out
enough that each page is only in the "written area" of one LOD.

Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 10903d228919085cdb160c563c481ed1cc09e34c)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Advertise both 32-bit and 48-bit heaps when we have enough memory
Jason Ekstrand [Wed, 17 May 2017 18:54:12 +0000 (11:54 -0700)]
anv: Advertise both 32-bit and 48-bit heaps when we have enough memory

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 50d0eb5096bd9514821a641f25c0b3455c0f8a88)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Refactor memory type setup
Jason Ekstrand [Wed, 17 May 2017 18:42:36 +0000 (11:42 -0700)]
anv: Refactor memory type setup

This makes us walk over the heaps one at a time and add the types for
LLC and !LLC to each heap.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 34581fdd4f149894dfa51777a2f7eb289bd08b71)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Make supports_48bit_addresses a heap property
Jason Ekstrand [Wed, 17 May 2017 18:38:16 +0000 (11:38 -0700)]
anv: Make supports_48bit_addresses a heap property

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

7 years agoanv: Stop setting BO flags in bo_init_new
Jason Ekstrand [Wed, 17 May 2017 18:31:02 +0000 (11:31 -0700)]
anv: Stop setting BO flags in bo_init_new

The idea behind doing this was to make it easier to set various flags.
However, we have enough custom flag settings floating around the driver
that this is more of a nuisance than a help.  This commit has the
following functional changes:

 1) The workaround_bo created in anv_CreateDevice loses both flags.
    This shouldn't matter because it's very small and entirely internal
    to the driver.

 2) The bo created in anv_CreateDmaBufImageINTEL loses the
    EXEC_OBJECT_ASYNC flag.  In retrospect, it never should have gotten
    EXEC_OBJECT_ASYNC in the first place.

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

7 years agoanv: Add valid_bufer_usage to the memory type metadata
Jason Ekstrand [Wed, 17 May 2017 18:14:06 +0000 (11:14 -0700)]
anv: Add valid_bufer_usage to the memory type metadata

Instead of returning valid types as just a number, we now walk the list
and check the buffer's usage against the usage flags we store in the new
anv_memory_type structure.  Currently, valid_buffer_usage == ~0.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f7736ccf53eaeb66c4270afe0916e2cb29ab8667)
[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: Determine the type of mapping based on type metadata
Jason Ekstrand [Wed, 17 May 2017 18:13:01 +0000 (11:13 -0700)]
anv: Determine the type of mapping based on type metadata

Before, we were just comparing the type index to 0.  Now we actually
look the type up in the table and check its properties to determine what
kind of mapping we want to do.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 92325a7efc769c32e03031323e21700dc55171e4)
[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: Set EXEC_OBJECT_ASYNC when available
Jason Ekstrand [Thu, 13 Apr 2017 23:30:19 +0000 (16:30 -0700)]
anv: Set EXEC_OBJECT_ASYNC when available

Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit 35e626bd0e59e7ce9fd97ccef66b2468c09206a4)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Squashed with:

anv/tests: Create a dummy instance as well as device

This fixes crashes caused by 35e626bd0e59e7ce9fd97ccef66b2468c09206a4
which made us start referencing the instance in the allocators.  With
this commit, the tests now happily pass again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100877
Tested-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit 6ef1bd4fa57b36efc7919773fd26c36fd43d2ea9)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoRevert "cherry-ignore: anv: [...]"
Juan A. Suarez Romero [Fri, 2 Jun 2017 10:33:41 +0000 (10:33 +0000)]
Revert "cherry-ignore: anv: [...]"

Revert "cherry-ignore: anv: Refactor memory type setup"
This reverts commit eab4a503a0b04dfe1fdcfc2dcde62eb09c038aca.

Revert "cherry-ignore: anv: Add valid_bufer_usage to the memory type metadata"
This reverts commit c31e814a85a27249e2a57cb7350240c01a1cad58.

Revert "cherry-ignore: anv: Advertise both 32-bit and 48-bit heaps when we have enough memory"
This reverts commit e391144853640ee39fca8dfe0e9387bbf1d90a76.

Revert "cherry-ignore: anv: Make supports_48bit_addresses a heap property"
This reverts commit dbadd066321786ea9b8f0259413740a10f753f36.

Revert "cherry-ignore: anv: Stop setting BO flags in bo_init_new"
This reverts commit 07867f72cf53209d230b3fb13f24f9371ab9d4b4.

Revert "cherry-ignore: anv: Determine the type of mapping based on type metadata"
This reverts commit 9299466b83ce88c911b30b35d9f4f6addb25c92a.

7 years agocherry-ignore: anv: Refactor memory type setup
Juan A. Suarez Romero [Thu, 1 Jun 2017 01:52:49 +0000 (01:52 +0000)]
cherry-ignore: anv: Refactor memory type setup

7 years agocherry-ignore: anv: Add valid_bufer_usage to the memory type metadata
Juan A. Suarez Romero [Thu, 1 Jun 2017 01:42:27 +0000 (03:42 +0200)]
cherry-ignore: anv: Add valid_bufer_usage to the memory type metadata

7 years agocherry-ignore: radv: fix regression in descriptor set freeing
Juan A. Suarez Romero [Wed, 31 May 2017 20:03:14 +0000 (22:03 +0200)]
cherry-ignore: radv: fix regression in descriptor set freeing

7 years agocherry-ignore: anv: Require vertex buffers to come from a 32-bit heap
Juan A. Suarez Romero [Wed, 31 May 2017 19:42:53 +0000 (21:42 +0200)]
cherry-ignore: anv: Require vertex buffers to come from a 32-bit heap

7 years agocherry-ignore: anv: Advertise both 32-bit and 48-bit heaps when we have enough memory
Juan A. Suarez Romero [Wed, 31 May 2017 19:38:30 +0000 (21:38 +0200)]
cherry-ignore: anv: Advertise both 32-bit and 48-bit heaps when we have enough memory

7 years agocherry-ignore: anv: Make supports_48bit_addresses a heap property
Juan A. Suarez Romero [Wed, 31 May 2017 19:37:31 +0000 (21:37 +0200)]
cherry-ignore: anv: Make supports_48bit_addresses a heap property

7 years agocherry-ignore: anv: Stop setting BO flags in bo_init_new
Juan A. Suarez Romero [Wed, 31 May 2017 19:31:40 +0000 (21:31 +0200)]
cherry-ignore: anv: Stop setting BO flags in bo_init_new

7 years agocherry-ignore: anv: Determine the type of mapping based on type metadata
Juan A. Suarez Romero [Wed, 31 May 2017 19:14:02 +0000 (19:14 +0000)]
cherry-ignore: anv: Determine the type of mapping based on type metadata

7 years agocherry-ignore: radeonsi: load patch_id for TES-as-ES when exporting for PS
Juan A. Suarez Romero [Wed, 31 May 2017 14:17:39 +0000 (16:17 +0200)]
cherry-ignore: radeonsi: load patch_id for TES-as-ES when exporting for PS

7 years agor100: Use _mesa_get_format_base_format in radeon_update_wrapper
Ian Romanick [Fri, 26 May 2017 04:26:09 +0000 (21:26 -0700)]
r100: Use _mesa_get_format_base_format in radeon_update_wrapper

The wrapper is for a renderbuffer around a texture.  Textures can have
formats (e.g., 3) that aren't valide for API generated renderbuffers.
_mesa_base_fbo_format will return 0, but _mesa_get_format_base_format
will return the base format of RGB.

Fixes a crashes in piglit tests fbo-alphatest-formats (all subtests
pass) and fbo-colormask-formats (some subtests pass, some fail).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 303b47f253f595ca0f708bef1059cbb4996f83a0)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agor100,r200: Don't assume glVisual is non-NULL during context creation
Ian Romanick [Thu, 25 May 2017 05:14:44 +0000 (22:14 -0700)]
r100,r200: Don't assume glVisual is non-NULL during context creation

Thanks to EGL_MESA_configless_context, the visual pointer can be NULL.

Fixes a segfault (or assertion failure) in piglit's
egl-configless-context test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c24881d39c139c451c1c096d6b0a98c8945c902b)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agor100: Don't assume that the base mipmap of a texture exists
Ian Romanick [Wed, 24 May 2017 23:36:28 +0000 (16:36 -0700)]
r100: Don't assume that the base mipmap of a texture exists

Fixes crashes in piglit's gl-1.2-texture-base-level.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2dcec62075d8da8b7d8741df75b09907e1eea460)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoegl/android: fix segfault within swap_buffers
Tapani Pälli [Thu, 18 May 2017 07:21:59 +0000 (10:21 +0300)]
egl/android: fix segfault within swap_buffers

Function droid_swap_buffers may get called without dri2_surf->buffer set,
in these cases we don't have a back buffer set either. Patch fixes segfault
seen with 3DMark that uses android.opengl.GLSurfaceView for rendering it's UI.

backtrace:
   #00 pc 00013f88  /system/lib/egl/libGLES_mesa.so (droid_swap_buffers+104)
   #01 pc 000117b2  /system/lib/egl/libGLES_mesa.so (dri2_swap_buffers+50)
   #02 pc 000058b2  /system/lib/egl/libGLES_mesa.so (eglSwapBuffers+386)
   #03 pc 00011329  /system/lib/libEGL.so (eglSwapBuffersWithDamageKHR+553)
   #04 pc 000118e7  /system/lib/libEGL.so (eglSwapBuffers+55)
   #05 pc 000754dc  /system/lib/libandroid_runtime.so

Note, this is v1 as v2 caused dEQP regressions.

Fixes: 2acc69d ("EGL/Android: Add EGL_EXT_buffer_age extension")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f347bac30f4045a9583f95a5776484b1a2947183)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoRevert "android: fix segfault within swap_buffers"
Juan A. Suarez Romero [Thu, 1 Jun 2017 07:48:54 +0000 (09:48 +0200)]
Revert "android: fix segfault within swap_buffers"

This reverts commit 4d4558411db166d2d66f8cec9cb581149dbe1597.

See https://lists.freedesktop.org/archives/mesa-stable/2017-June/006408.html

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoconfigure.ac: Also match -androideabi tuple
Nicolas Boichat [Fri, 5 May 2017 02:26:00 +0000 (10:26 +0800)]
configure.ac: Also match -androideabi tuple

On ARM Android platforms, the host_os tuple should be linux-androideabi,
so let's match both -android and -androideabi (or any other
-android* tuple) to determine if we should do an Android build.

Reviewed-by: Chad Versace <chadversary@chromium.org>
(cherry picked from commit f6ac3d0db67dd81f0aff754b977ed1277b33af63)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agost/mesa: remove redundant stfb->iface checks
Nicolai Hähnle [Fri, 21 Apr 2017 13:11:34 +0000 (15:11 +0200)]
st/mesa: remove redundant stfb->iface checks

stfb->iface is always non-NULL for an st_framebuffer. These checks
were incorrect, relying on out-of-bounds memory access in the
surface-less case of EGL_KHR_surfaceless_context.

v2: remove redundant stread check (Marek)

Reviewed-by: Marek Olšák <marek@olsak@amd.com> (v2)
(cherry picked from commit 9d346af322e3f9d6d52e00759e8c3cd37c192004)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agomesa: Avoid leaking surface in st_renderbuffer_delete
Bartosz Tomczyk [Sat, 29 Apr 2017 14:37:45 +0000 (16:37 +0200)]
mesa: Avoid leaking surface in st_renderbuffer_delete

v2: add comment in code

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100741
Fixes: a5e733c6b52 mesa: drop current draw/read buffer when ctx is released
Reviewed-by: Rob Clark <robdclark@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit fd6c2a3f3eb7f5f3077fb95b1441ddaa43b806fe)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoradv: Reserve space for descriptor and push constant user SGPR setting.
Bas Nieuwenhuizen [Sun, 28 May 2017 22:18:56 +0000 (00:18 +0200)]
radv: Reserve space for descriptor and push constant user SGPR setting.

flush_compute_state doesn't reserve a large chunk, so these need their own reservation.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
(cherry picked from commit 18efb404cfb38f722a16df7539390cf9a4a71929)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Conflicts:
src/amd/vulkan/radv_cmd_buffer.c

7 years agoegl/wayland: select the format based on the interface used
Emil Velikov [Fri, 12 May 2017 13:19:59 +0000 (14:19 +0100)]
egl/wayland: select the format based on the interface used

Rather than misleadingly depending on DRI2 for the WL_DRM vs WL_SHM
formats, use the wl_drm and wl_shm interface respectively.

Fixes: a1727aa75ed ("egl/wayland: Don't use DRM format codes for SHM")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 6ef0fc400c690362b66add9c3533fae5f21d2cae)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agofreedreno: fix fence creation fail if no rendering
Rob Clark [Fri, 26 May 2017 14:18:31 +0000 (10:18 -0400)]
freedreno: fix fence creation fail if no rendering

Android tries to create a FENCE_FD fence without any rendering.  And
then falls over when that fails.  So just always create an initial
batch.

Fixes: e4ad8695 ("freedreno: fix crash when flush() but no rendering")
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 8fc9702a1b7027d266121713771eafd2aa1a93b6)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agost/mesa: don't mark the program as in cache_fallback when there is cache miss
Timothy Arceri [Thu, 18 May 2017 05:10:08 +0000 (15:10 +1000)]
st/mesa: don't mark the program as in cache_fallback when there is cache miss

When we fallback currently the gl_program objects are re-allocated.

This is likely to change when the i965 cache lands, but for now
this fixes a crash when using MESA_GLSL=cache_fb. This env var
simulates the fallback path taken when a tgsi cache item doesn't
exist due to being evicted previously or some kind of error.

Unlike i965 we are always falling back at link time so it's safe to
just re-allocate everything. We will be unnecessarily freeing and
re-allocate a bunch of things here but it's probably not a huge deal,
and can be changed when the i965 code lands.

Fixes: 0e9991f957e2 ("glsl: don't reference shader prog data during cache fallback")

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 80e643345ed0d8d3263b4ee23dd2998f0da170a8)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoegl/wayland: Ensure we get a back buffer
Daniel Stone [Mon, 15 May 2017 21:22:32 +0000 (22:22 +0100)]
egl/wayland: Ensure we get a back buffer

Commit 9ca6711faa03 changed the Wayland winsys to only block for the
frame callback inside SwapBuffers, rather than get_back_bo. get_back_bo
would perform a single non-blocking Wayland event dispatch, to try to
find any release events which we had pulled off the wire but not
actually processed. The blocking dispatch was moved to SwapBuffers.

This removed a guarantee that we would've processed all events inside
get_back_bo(), and introduced a failure whereby the server could've sent
a buffer release event, but we wouldn't have read it. In clients
unconstrained by SwapInterval (rendering ~as fast as possible), which
were being displayed directly without composition (buffer release delayed),
this could lead to get_back_bo() failing because there were no free
buffers available to it.

The drawing rightly failed, but this was papered over because of the
path in eglSwapBuffers() which attempts to guarantee a BO, in order to
support calling SwapBuffers twice in a row with no rendering actually
having been performed.

Since eglSwapBuffers will perform a blocking dispatch of Wayland
events, a buffer release would have arrived by that point, and we
could then choose a buffer to post to the server. The effect was that
frames were displayed out-of-order, since we grabbed a frame with random
past content to display to the compositor.

Ideally get_back_bo() failing should store a failure flag inside the
surface and cause the next SwapBuffers to fail, but for the meantime,
restore the correct behaviour such that get_back_bo() no longer fails.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98833
Fixes: 9ca6711faa03 ("Revert "wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers"")
(cherry picked from commit 1f2d0093bf5084f65a923582881dc74153c804a4)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
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)