From 60fe2f6eccc263e89dc78f5488148c65b2824623 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 2 Nov 2018 18:50:48 +0000
Subject: [PATCH 001/220] egl: add EGL_EXT_device_base entrypoints
eglQueryDevicesEXT (unlike the other three functions) does not depend
on the display. It is implemented in GLVND, which calls into each
driver collecting the list of devices and presenting it to the user.
For the other entrypoints, GLVND acts as pass through stub calling into
the vendor library. The vendor implementation calls back into GLVND to
get the vendor dispatch. Then the driver proceeds to call itself via
the said dispatch.
This design makes is possible to keep using "old" GLVND with newer
vendor drivers. Since effectively all the extension code is within the
latter itself.
Without said entrypoints, any user will outright crash - as reported in
the bug report.
Note: there's a follow-up fix needed to our GLVND code, to make piglit
happy.
v2: add some beefy documentation in the commit message.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108635
Fixes: 7552fcb7b9b ("egl: add base EGL_EXT_device_base implementation")
Reported-by: kyle.devir@mykolab.com
Cc: kyle.devir@mykolab.com
Acked-by: Eric Engestrom
Signed-off-by: Emil Velikov
Tested-by: Emil Velikov
(cherry picked from commit 2a8fefdeb0f4e259cc01e32dae40bc2f3063f5e0)
---
src/egl/generate/eglFunctionList.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/egl/generate/eglFunctionList.py b/src/egl/generate/eglFunctionList.py
index fb5b3c30bdf..667704eb2cb 100644
--- a/src/egl/generate/eglFunctionList.py
+++ b/src/egl/generate/eglFunctionList.py
@@ -199,5 +199,12 @@ def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dis
# EGL_EXT_image_dma_buf_import_modifiers
_eglFunc("eglQueryDmaBufFormatsEXT", "display"),
_eglFunc("eglQueryDmaBufModifiersEXT", "display"),
+
+ # EGL_EXT_device_base
+ _eglFunc("eglQueryDeviceAttribEXT", "device"),
+ _eglFunc("eglQueryDeviceStringEXT", "device"),
+ _eglFunc("eglQueryDevicesEXT", "none"),
+ _eglFunc("eglQueryDisplayAttribEXT", "display"),
+
)
From 22201d2048c1834ed46fa340cdb60273acd720b0 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 2 Nov 2018 18:34:19 +0000
Subject: [PATCH 002/220] egl/glvnd: correctly report errors when vendor cannot
be found
If the user provides an invalid display or device the ToVendor lookup
will fail.
In this case, the local [Mesa vendor] error code will be set. Thus on
sequential eglGetError(), the error will be EGL_SUCCESS.
To be more specific, GLVND remembers the last vendor and calls back
into it's eglGetError, although there's no guarantee to ever have had
one.
v2:
- Add _eglError call, so the debug callback is executed (Kyle)
- Drop XXX comment.
Piglit: tests/egl/spec/egl_ext_device_query
Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Cc: Eric Engestrom
Signed-off-by: Emil Velikov
Reviewed-by: Kyle Brenneman
(cherry picked from commit b3ade6538798ad9bf397d8b386eab3dd8af57f3d)
---
src/egl/main/egldispatchstubs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/egl/main/egldispatchstubs.c b/src/egl/main/egldispatchstubs.c
index bfc3195c779..96708aeb0dc 100644
--- a/src/egl/main/egldispatchstubs.c
+++ b/src/egl/main/egldispatchstubs.c
@@ -59,6 +59,11 @@ static __eglMustCastToProperFunctionPointerType FetchVendorFunc(__EGLvendorInfo
}
if (func == NULL) {
if (errorCode != EGL_SUCCESS) {
+ // Since we have no vendor, the follow-up eglGetError() call will
+ // end up using the GLVND error code. Set it here.
+ if (vendor == NULL) {
+ exports->setEGLError(errorCode);
+ }
_eglError(errorCode, __EGL_DISPATCH_FUNC_NAMES[index]);
}
return NULL;
From 949b1048f731e67f34acc0a6fbe188782b31e261 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Tue, 6 Nov 2018 15:30:57 +0000
Subject: [PATCH 003/220] Update version to 18.3.0-rc1
Signed-off-by: Emil Velikov
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index 8b16de0851f..bb28ad2e2bd 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.3.0-devel
+18.3.0-rc1
From 12c5eb2fd3fbd7725b169dccc32c9b29b1d0a8d0 Mon Sep 17 00:00:00 2001
From: Dave Airlie
Date: Wed, 31 Oct 2018 23:38:20 +0000
Subject: [PATCH 004/220] radv: apply xfb buffer offset at buffer binding time
not later. (v2)
In order to handle pause/resume properly, the offset should
be added to the buffer binding not to the begin/end paths.
v2: don't add offset to size
Fixes ext_transform_feedback-alignment* under zink
Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset
(cherry picked from commit 7f37a52a21a15fc28b2c452fff54dd871d5dfe53)
---
src/amd/vulkan/radv_cmd_buffer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index c43e12f6d62..296b626b19c 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1950,6 +1950,8 @@ radv_flush_streamout_descriptors(struct radv_cmd_buffer *cmd_buffer)
va = radv_buffer_get_va(buffer->bo) + buffer->offset;
+ va += sb[i].offset;
+
/* Set the descriptor.
*
* On VI, the format must be non-INVALID, otherwise
@@ -4754,7 +4756,7 @@ void radv_CmdBeginTransformFeedbackEXT(
* SGPRs what to do.
*/
radeon_set_context_reg_seq(cs, R_028AD0_VGT_STRMOUT_BUFFER_SIZE_0 + 16*i, 2);
- radeon_emit(cs, (sb[i].offset + sb[i].size) >> 2); /* BUFFER_SIZE (in DW) */
+ radeon_emit(cs, sb[i].size >> 2); /* BUFFER_SIZE (in DW) */
radeon_emit(cs, so->stride_in_dw[i]); /* VTX_STRIDE (in DW) */
if (pCounterBuffers && pCounterBuffers[i]) {
@@ -4783,7 +4785,7 @@ void radv_CmdBeginTransformFeedbackEXT(
STRMOUT_OFFSET_SOURCE(STRMOUT_OFFSET_FROM_PACKET)); /* control */
radeon_emit(cs, 0); /* unused */
radeon_emit(cs, 0); /* unused */
- radeon_emit(cs, sb[i].offset >> 2); /* buffer offset in DW */
+ radeon_emit(cs, 0); /* unused */
radeon_emit(cs, 0); /* unused */
}
}
From 52e01585c4714c0bfcf04b4a4e99319f08ef13bf Mon Sep 17 00:00:00 2001
From: Dave Airlie
Date: Wed, 31 Oct 2018 23:55:29 +0000
Subject: [PATCH 005/220] radv: fix begin/end transform feedback with 0 counter
buffers.
If the user gives 0 counterBuffers then the driver should still
enable transform feedback on all targets. This changes the
driver to always enable xfb, and use counter buffers where
one is defined for the target in question.
Fixes: b4eb029062 (radv: implement VK_EXT_transform_feedback)
Reviewed-by: Samuel Pitoiset
(cherry picked from commit 677b496b6bd07cbe05dd429344ba525619cdd08c)
---
src/amd/vulkan/radv_cmd_buffer.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 296b626b19c..6510a5c4425 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -4743,13 +4743,15 @@ void radv_CmdBeginTransformFeedbackEXT(
struct radv_streamout_binding *sb = cmd_buffer->streamout_bindings;
struct radv_streamout_state *so = &cmd_buffer->state.streamout;
struct radeon_cmdbuf *cs = cmd_buffer->cs;
+ uint32_t i;
radv_flush_vgt_streamout(cmd_buffer);
assert(firstCounterBuffer + counterBufferCount <= MAX_SO_BUFFERS);
- for (uint32_t i = firstCounterBuffer; i < counterBufferCount; i++) {
- if (!(so->enabled_mask & (1 << i)))
- continue;
+ for_each_bit(i, so->enabled_mask) {
+ int32_t counter_buffer_idx = i - firstCounterBuffer;
+ if (counter_buffer_idx >= 0 && counter_buffer_idx > counterBufferCount)
+ counter_buffer_idx = -1;
/* SI binds streamout buffers as shader resources.
* VGT only counts primitives and tells the shader through
@@ -4759,12 +4761,12 @@ void radv_CmdBeginTransformFeedbackEXT(
radeon_emit(cs, sb[i].size >> 2); /* BUFFER_SIZE (in DW) */
radeon_emit(cs, so->stride_in_dw[i]); /* VTX_STRIDE (in DW) */
- if (pCounterBuffers && pCounterBuffers[i]) {
+ if (counter_buffer_idx >= 0 && pCounterBuffers && pCounterBuffers[counter_buffer_idx]) {
/* The array of counter buffers is optional. */
- RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[i]);
+ RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[counter_buffer_idx]);
uint64_t va = radv_buffer_get_va(buffer->bo);
- va += buffer->offset + pCounterBufferOffsets[i];
+ va += buffer->offset + pCounterBufferOffsets[counter_buffer_idx];
/* Append */
radeon_emit(cs, PKT3(PKT3_STRMOUT_BUFFER_UPDATE, 4, 0));
@@ -4803,20 +4805,22 @@ void radv_CmdEndTransformFeedbackEXT(
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
struct radv_streamout_state *so = &cmd_buffer->state.streamout;
struct radeon_cmdbuf *cs = cmd_buffer->cs;
+ uint32_t i;
radv_flush_vgt_streamout(cmd_buffer);
assert(firstCounterBuffer + counterBufferCount <= MAX_SO_BUFFERS);
- for (uint32_t i = firstCounterBuffer; i < counterBufferCount; i++) {
- if (!(so->enabled_mask & (1 << i)))
- continue;
+ for_each_bit(i, so->enabled_mask) {
+ int32_t counter_buffer_idx = i - firstCounterBuffer;
+ if (counter_buffer_idx >= 0 && counter_buffer_idx > counterBufferCount)
+ counter_buffer_idx = -1;
- if (pCounterBuffers && pCounterBuffers[i]) {
+ if (counter_buffer_idx >= 0 && pCounterBuffers && pCounterBuffers[counter_buffer_idx]) {
/* The array of counters buffer is optional. */
- RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[i]);
+ RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[counter_buffer_idx]);
uint64_t va = radv_buffer_get_va(buffer->bo);
- va += buffer->offset + pCounterBufferOffsets[i];
+ va += buffer->offset + pCounterBufferOffsets[counter_buffer_idx];
radeon_emit(cs, PKT3(PKT3_STRMOUT_BUFFER_UPDATE, 4, 0));
radeon_emit(cs, STRMOUT_SELECT_BUFFER(i) |
From 959a9d42d7169b75d1ab92b71c292174555bf8cb Mon Sep 17 00:00:00 2001
From: Mauro Rossi
Date: Wed, 31 Oct 2018 15:53:21 +0100
Subject: [PATCH 006/220] android: gallium/auxiliary: add include to get
u_debug.h header
To avoid build error in u_debug_stack_android.cpp
due to now missing u_debug.h header:
external/mesa/src/gallium/auxiliary/util/u_debug_stack_android.cpp:26:10:
fatal error: 'u_debug.h' file not found
#include "u_debug.h"
^
1 error generated.
Fixes: 37db383abb ("util: Move u_debug to utils")
Signed-off-by: Mauro Rossi
Reviewed-by: Dylan Baker
(cherry picked from commit b9dec214f5151f3ad87eb2faf982c57e5323f534)
---
src/gallium/auxiliary/Android.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index acd243b8346..7618c6fcd93 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -36,7 +36,8 @@ LOCAL_SRC_FILES := \
util/u_debug_stack_android.cpp
LOCAL_C_INCLUDES := \
- $(GALLIUM_TOP)/auxiliary/util
+ $(GALLIUM_TOP)/auxiliary/util \
+ $(MESA_TOP)/src/util
ifeq ($(MESA_ENABLE_LLVM),true)
LOCAL_SRC_FILES += \
From d5e33d2aa6cc7484a1a6bed2cd65d18f62f55f49 Mon Sep 17 00:00:00 2001
From: Timothy Arceri
Date: Fri, 2 Nov 2018 08:53:16 +1100
Subject: [PATCH 007/220] nir: allow propagation of if evaluation for bcsel
Shader-db results Skylake:
total instructions in shared programs: 13109035 -> 13109024 (<.01%)
instructions in affected programs: 4777 -> 4766 (-0.23%)
helped: 11
HURT: 0
total cycles in shared programs: 332090418 -> 332090443 (<.01%)
cycles in affected programs: 19474 -> 19499 (0.13%)
helped: 6
HURT: 4
Reviewed-by: Jason Ekstrand
(cherry picked from commit c7bdda8aa5f1fb1d797512a0a54a032153755c6c)
---
src/compiler/nir/nir_opt_if.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c
index 1fe95e53766..ed93cac9ce9 100644
--- a/src/compiler/nir/nir_opt_if.c
+++ b/src/compiler/nir/nir_opt_if.c
@@ -448,7 +448,7 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
if (!evaluate_if_condition(nif, b->cursor, &bool_value))
return false;
- nir_ssa_def *def[2] = {0};
+ nir_ssa_def *def[4] = {0};
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
if (alu->src[i].src.ssa == use_src->ssa) {
def[i] = nir_imm_bool(b, bool_value);
@@ -456,7 +456,7 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
def[i] = alu->src[i].src.ssa;
}
}
- nir_ssa_def *nalu = nir_build_alu(b, alu->op, def[0], def[1], NULL, NULL);
+ nir_ssa_def *nalu = nir_build_alu(b, alu->op, def[0], def[1], def[2], def[3]);
/* Rewrite use to use new alu instruction */
nir_src new_src = nir_src_for_ssa(nalu);
@@ -472,14 +472,21 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
static bool
can_propagate_through_alu(nir_src *src)
{
- if (src->parent_instr->type == nir_instr_type_alu &&
- (nir_instr_as_alu(src->parent_instr)->op == nir_op_ior ||
- nir_instr_as_alu(src->parent_instr)->op == nir_op_iand ||
- nir_instr_as_alu(src->parent_instr)->op == nir_op_inot ||
- nir_instr_as_alu(src->parent_instr)->op == nir_op_b2i))
- return true;
+ if (src->parent_instr->type != nir_instr_type_alu)
+ return false;
- return false;
+ nir_alu_instr *alu = nir_instr_as_alu(src->parent_instr);
+ switch (alu->op) {
+ case nir_op_ior:
+ case nir_op_iand:
+ case nir_op_inot:
+ case nir_op_b2i:
+ return true;
+ case nir_op_bcsel:
+ return src == &alu->src[0].src;
+ default:
+ return false;
+ }
}
static bool
From 6adbf17ce91fbc907935af0b8e1c7d2eb26dd9a9 Mon Sep 17 00:00:00 2001
From: Timothy Arceri
Date: Fri, 2 Nov 2018 22:10:36 +1100
Subject: [PATCH 008/220] nir: fix condition propagation when src has a swizzle
We cannot use nir_build_alu() to create the new alu as it has no
way to know how many components of the src we will use. This
results in it guessing the max number of components from one of
its inputs.
Fixes the following CTS tests:
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_frag
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_geom
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_tessc
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_vert
Fixes: 2975422ceb6c ("nir: propagates if condition evaluation down some alu chains")
Reviewed-by: Jason Ekstrand
(cherry picked from commit 769ae9fb7f8cea1d4a03e31f7f4a1c988e424c03)
---
src/compiler/nir/nir_opt_if.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c
index ed93cac9ce9..8a971c43f24 100644
--- a/src/compiler/nir/nir_opt_if.c
+++ b/src/compiler/nir/nir_opt_if.c
@@ -391,6 +391,34 @@ evaluate_if_condition(nir_if *nif, nir_cursor cursor, bool *value)
}
}
+static nir_ssa_def *
+clone_alu_and_replace_src_defs(nir_builder *b, const nir_alu_instr *alu,
+ nir_ssa_def **src_defs)
+{
+ nir_alu_instr *nalu = nir_alu_instr_create(b->shader, alu->op);
+ nalu->exact = alu->exact;
+
+ nir_ssa_dest_init(&nalu->instr, &nalu->dest.dest,
+ alu->dest.dest.ssa.num_components,
+ alu->dest.dest.ssa.bit_size, alu->dest.dest.ssa.name);
+
+ nalu->dest.saturate = alu->dest.saturate;
+ nalu->dest.write_mask = alu->dest.write_mask;
+
+ for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
+ assert(alu->src[i].src.is_ssa);
+ nalu->src[i].src = nir_src_for_ssa(src_defs[i]);
+ nalu->src[i].negate = alu->src[i].negate;
+ nalu->src[i].abs = alu->src[i].abs;
+ memcpy(nalu->src[i].swizzle, alu->src[i].swizzle,
+ sizeof(nalu->src[i].swizzle));
+ }
+
+ nir_builder_instr_insert(b, &nalu->instr);
+
+ return &nalu->dest.dest.ssa;;
+}
+
/*
* This propagates if condition evaluation down the chain of some alu
* instructions. For example by checking the use of some of the following alu
@@ -456,7 +484,8 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
def[i] = alu->src[i].src.ssa;
}
}
- nir_ssa_def *nalu = nir_build_alu(b, alu->op, def[0], def[1], def[2], def[3]);
+
+ nir_ssa_def *nalu = clone_alu_and_replace_src_defs(b, alu, def);
/* Rewrite use to use new alu instruction */
nir_src new_src = nir_src_for_ssa(nalu);
From 5adc1920ee391b0d231fbd593b6a8cb0dd281bd5 Mon Sep 17 00:00:00 2001
From: Dylan Baker
Date: Thu, 1 Nov 2018 14:12:57 -0700
Subject: [PATCH 009/220] meson: link gallium nine with pthreads
In some cases (not building with llvm, which automatically pulls in
pthreads) nine needs to be directly linked with pthreads. Fixes building
on x86 (32 bit) without llvm.
Distro bug: https://bugs.gentoo.org/670094
Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
("meson: build gallium nine state_tracker")
Tested-by: Rafal Lalik
Reviewed-by: Matt Turner
(cherry picked from commit 7652931d33b36c93b2e84713baa8c283d568402e)
---
src/gallium/targets/d3dadapter9/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/targets/d3dadapter9/meson.build b/src/gallium/targets/d3dadapter9/meson.build
index bd05b4f9692..bc72b1110a0 100644
--- a/src/gallium/targets/d3dadapter9/meson.build
+++ b/src/gallium/targets/d3dadapter9/meson.build
@@ -53,7 +53,7 @@ libgallium_nine = shared_library(
libswkmsdri,
],
dependencies : [
- dep_selinux, dep_expat, dep_libdrm, dep_llvm,
+ dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread,
driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
driver_i915, driver_svga,
],
From 45fe51a0eefd1b4f7bb70869da6eb3286788a659 Mon Sep 17 00:00:00 2001
From: Mauro Rossi
Date: Tue, 30 Oct 2018 22:35:43 +0100
Subject: [PATCH 010/220] android: radv: add libmesa_git_sha1 static dependency
libmesa_git_sha1 whole static dependency is added to get git_sha1.h header
and avoid following building error:
external/mesa/src/amd/vulkan/radv_device.c:46:10:
fatal error: 'git_sha1.h' file not found
^
1 error generated.
Fixes: 9d40ec2cf6 ("radv: Add support for VK_KHR_driver_properties.")
Signed-off-by: Mauro Rossi
Reviewed-by: Eric Engestrom
(cherry picked from commit 5c0cff868a48202df1ddb30d1dca848101063cb6)
---
src/amd/vulkan/Android.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/amd/vulkan/Android.mk b/src/amd/vulkan/Android.mk
index 51b03561fa7..9574bf54e5a 100644
--- a/src/amd/vulkan/Android.mk
+++ b/src/amd/vulkan/Android.mk
@@ -74,7 +74,8 @@ LOCAL_C_INCLUDES := \
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
LOCAL_WHOLE_STATIC_LIBRARIES := \
- libmesa_vulkan_util
+ libmesa_vulkan_util \
+ libmesa_git_sha1
LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.c
LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
From 6463af186c803eb96cd70df521d6915300ea497c Mon Sep 17 00:00:00 2001
From: Vinson Lee
Date: Wed, 31 Oct 2018 15:35:23 -0700
Subject: [PATCH 011/220] r600/sb: Fix constant logical operand in assert.
Fixes: da977ad90747 ("r600/sb: start adding GDS support")
Signed-off-by: Vinson Lee
Reviewed-By: Gert Wollny
(cherry picked from commit 64a9ed8848ed5c2c909b59e0e4b600b2b01bba28)
---
src/gallium/drivers/r600/sb/sb_bc_builder.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/sb/sb_bc_builder.cpp b/src/gallium/drivers/r600/sb/sb_bc_builder.cpp
index 5681fdc4425..b7d87eac9f4 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_builder.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_builder.cpp
@@ -567,7 +567,7 @@ int bc_builder::build_fetch_gds(fetch_node *n) {
const fetch_op_info *fop = bc.op_ptr;
unsigned gds_op = (ctx.fetch_opcode(bc.op) >> 8) & 0x3f;
unsigned mem_op = 4;
- assert(fop->flags && FF_GDS);
+ assert(fop->flags & FF_GDS);
if (bc.op == FETCH_OP_TF_WRITE) {
mem_op = 5;
From 97a3ef3d1cdcea64681e1350ea864ec7f7b5dec4 Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset
Date: Wed, 31 Oct 2018 11:43:34 +0100
Subject: [PATCH 012/220] radv: add missing TFB queries support to
CmdCopyQueryPoolsResults()
Cc: 18.3
Fixes: b4eb029062a ("radv: implement VK_EXT_transform_feedback")
Signed-off-by: Samuel Pitoiset
Reviewed-by: Dave Airlie
(cherry picked from commit b1b2dd06a7b777e862b525302b15bcaf407d3648)
---
src/amd/vulkan/radv_private.h | 1 +
src/amd/vulkan/radv_query.c | 277 ++++++++++++++++++++++++++++++++++
2 files changed, 278 insertions(+)
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 7e9e82e3158..253e6455604 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -595,6 +595,7 @@ struct radv_meta_state {
VkPipelineLayout p_layout;
VkPipeline occlusion_query_pipeline;
VkPipeline pipeline_statistics_query_pipeline;
+ VkPipeline tfb_query_pipeline;
} query;
};
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index 57ea22fb847..ae8fc3834bf 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -512,11 +512,233 @@ build_pipeline_statistics_query_shader(struct radv_device *device) {
return b.shader;
}
+static nir_shader *
+build_tfb_query_shader(struct radv_device *device)
+{
+ /* the shader this builds is roughly
+ *
+ * uint32_t src_stride = 32;
+ *
+ * location(binding = 0) buffer dst_buf;
+ * location(binding = 1) buffer src_buf;
+ *
+ * void main() {
+ * uint64_t result[2] = {};
+ * bool available = false;
+ * uint64_t src_offset = src_stride * global_id.x;
+ * uint64_t dst_offset = dst_stride * global_id.x;
+ * uint64_t *src_data = src_buf[src_offset];
+ * uint32_t avail = (src_data[0] >> 32) &
+ * (src_data[1] >> 32) &
+ * (src_data[2] >> 32) &
+ * (src_data[3] >> 32);
+ * if (avail & 0x80000000) {
+ * result[0] = src_data[3] - src_data[1];
+ * result[1] = src_data[2] - src_data[0];
+ * available = true;
+ * }
+ * uint32_t result_size = flags & VK_QUERY_RESULT_64_BIT ? 16 : 8;
+ * if ((flags & VK_QUERY_RESULT_PARTIAL_BIT) || available) {
+ * if (flags & VK_QUERY_RESULT_64_BIT) {
+ * dst_buf[dst_offset] = result;
+ * } else {
+ * dst_buf[dst_offset] = (uint32_t)result;
+ * }
+ * }
+ * if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) {
+ * dst_buf[dst_offset + result_size] = available;
+ * }
+ * }
+ */
+ nir_builder b;
+ nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_COMPUTE, NULL);
+ b.shader->info.name = ralloc_strdup(b.shader, "tfb_query");
+ b.shader->info.cs.local_size[0] = 64;
+ b.shader->info.cs.local_size[1] = 1;
+ b.shader->info.cs.local_size[2] = 1;
+
+ /* Create and initialize local variables. */
+ nir_variable *result =
+ nir_local_variable_create(b.impl,
+ glsl_vector_type(GLSL_TYPE_UINT64, 2),
+ "result");
+ nir_variable *available =
+ nir_local_variable_create(b.impl, glsl_int_type(), "available");
+
+ nir_store_var(&b, result,
+ nir_vec2(&b, nir_imm_int64(&b, 0),
+ nir_imm_int64(&b, 0)), 0x3);
+ nir_store_var(&b, available, nir_imm_int(&b, 0), 0x1);
+
+ nir_ssa_def *flags = radv_load_push_int(&b, 0, "flags");
+
+ /* Load resources. */
+ nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
+ nir_intrinsic_vulkan_resource_index);
+ dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+ nir_intrinsic_set_desc_set(dst_buf, 0);
+ nir_intrinsic_set_binding(dst_buf, 0);
+ nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+ nir_builder_instr_insert(&b, &dst_buf->instr);
+
+ nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
+ nir_intrinsic_vulkan_resource_index);
+ src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+ nir_intrinsic_set_desc_set(src_buf, 0);
+ nir_intrinsic_set_binding(src_buf, 1);
+ nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
+ nir_builder_instr_insert(&b, &src_buf->instr);
+
+ /* Compute global ID. */
+ nir_ssa_def *invoc_id = nir_load_system_value(&b, nir_intrinsic_load_local_invocation_id, 0);
+ nir_ssa_def *wg_id = nir_load_system_value(&b, nir_intrinsic_load_work_group_id, 0);
+ nir_ssa_def *block_size = nir_imm_ivec4(&b,
+ b.shader->info.cs.local_size[0],
+ b.shader->info.cs.local_size[1],
+ b.shader->info.cs.local_size[2], 0);
+ nir_ssa_def *global_id = nir_iadd(&b, nir_imul(&b, wg_id, block_size), invoc_id);
+ global_id = nir_channel(&b, global_id, 0); // We only care about x here.
+
+ /* Compute src/dst strides. */
+ nir_ssa_def *input_stride = nir_imm_int(&b, 32);
+ nir_ssa_def *input_base = nir_imul(&b, input_stride, global_id);
+ nir_ssa_def *output_stride = radv_load_push_int(&b, 4, "output_stride");
+ nir_ssa_def *output_base = nir_imul(&b, output_stride, global_id);
+
+ /* Load data from the query pool. */
+ nir_intrinsic_instr *load1 = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ssbo);
+ load1->src[0] = nir_src_for_ssa(&src_buf->dest.ssa);
+ load1->src[1] = nir_src_for_ssa(input_base);
+ nir_ssa_dest_init(&load1->instr, &load1->dest, 4, 32, NULL);
+ load1->num_components = 4;
+ nir_builder_instr_insert(&b, &load1->instr);
+
+ nir_intrinsic_instr *load2 = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ssbo);
+ load2->src[0] = nir_src_for_ssa(&src_buf->dest.ssa);
+ load2->src[1] = nir_src_for_ssa(nir_iadd(&b, input_base, nir_imm_int(&b, 16)));
+ nir_ssa_dest_init(&load2->instr, &load2->dest, 4, 32, NULL);
+ load2->num_components = 4;
+ nir_builder_instr_insert(&b, &load2->instr);
+
+ /* Check if result is available. */
+ nir_ssa_def *avails[2];
+ avails[0] = nir_iand(&b, nir_channel(&b, &load1->dest.ssa, 1),
+ nir_channel(&b, &load1->dest.ssa, 3));
+ avails[1] = nir_iand(&b, nir_channel(&b, &load2->dest.ssa, 1),
+ nir_channel(&b, &load2->dest.ssa, 3));
+ nir_ssa_def *result_is_available =
+ nir_iand(&b, nir_iand(&b, avails[0], avails[1]),
+ nir_imm_int(&b, 0x80000000));
+
+ /* Only compute result if available. */
+ nir_if *available_if = nir_if_create(b.shader);
+ available_if->condition = nir_src_for_ssa(result_is_available);
+ nir_cf_node_insert(b.cursor, &available_if->cf_node);
+
+ b.cursor = nir_after_cf_list(&available_if->then_list);
+
+ /* Pack values. */
+ nir_ssa_def *packed64[4];
+ packed64[0] = nir_pack_64_2x32(&b, nir_vec2(&b,
+ nir_channel(&b, &load1->dest.ssa, 0),
+ nir_channel(&b, &load1->dest.ssa, 1)));
+ packed64[1] = nir_pack_64_2x32(&b, nir_vec2(&b,
+ nir_channel(&b, &load1->dest.ssa, 2),
+ nir_channel(&b, &load1->dest.ssa, 3)));
+ packed64[2] = nir_pack_64_2x32(&b, nir_vec2(&b,
+ nir_channel(&b, &load2->dest.ssa, 0),
+ nir_channel(&b, &load2->dest.ssa, 1)));
+ packed64[3] = nir_pack_64_2x32(&b, nir_vec2(&b,
+ nir_channel(&b, &load2->dest.ssa, 2),
+ nir_channel(&b, &load2->dest.ssa, 3)));
+
+ /* Compute result. */
+ nir_ssa_def *num_primitive_written =
+ nir_isub(&b, packed64[3], packed64[1]);
+ nir_ssa_def *primitive_storage_needed =
+ nir_isub(&b, packed64[2], packed64[0]);
+
+ nir_store_var(&b, result,
+ nir_vec2(&b, num_primitive_written,
+ primitive_storage_needed), 0x3);
+ nir_store_var(&b, available, nir_imm_int(&b, 1), 0x1);
+
+ b.cursor = nir_after_cf_node(&available_if->cf_node);
+
+ /* Determine if result is 64 or 32 bit. */
+ nir_ssa_def *result_is_64bit =
+ nir_iand(&b, flags, nir_imm_int(&b, VK_QUERY_RESULT_64_BIT));
+ nir_ssa_def *result_size =
+ nir_bcsel(&b, result_is_64bit, nir_imm_int(&b, 16),
+ nir_imm_int(&b, 8));
+
+ /* Store the result if complete or partial results have been requested. */
+ nir_if *store_if = nir_if_create(b.shader);
+ store_if->condition =
+ nir_src_for_ssa(nir_ior(&b, nir_iand(&b, flags,
+ nir_imm_int(&b, VK_QUERY_RESULT_PARTIAL_BIT)),
+ nir_load_var(&b, available)));
+ nir_cf_node_insert(b.cursor, &store_if->cf_node);
+
+ b.cursor = nir_after_cf_list(&store_if->then_list);
+
+ /* Store result. */
+ nir_if *store_64bit_if = nir_if_create(b.shader);
+ store_64bit_if->condition = nir_src_for_ssa(result_is_64bit);
+ nir_cf_node_insert(b.cursor, &store_64bit_if->cf_node);
+
+ b.cursor = nir_after_cf_list(&store_64bit_if->then_list);
+
+ nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
+ store->src[0] = nir_src_for_ssa(nir_load_var(&b, result));
+ store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
+ store->src[2] = nir_src_for_ssa(output_base);
+ nir_intrinsic_set_write_mask(store, 0x3);
+ store->num_components = 2;
+ nir_builder_instr_insert(&b, &store->instr);
+
+ b.cursor = nir_after_cf_list(&store_64bit_if->else_list);
+
+ store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
+ store->src[0] = nir_src_for_ssa(nir_u2u32(&b, nir_load_var(&b, result)));
+ store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
+ store->src[2] = nir_src_for_ssa(output_base);
+ nir_intrinsic_set_write_mask(store, 0x3);
+ store->num_components = 2;
+ nir_builder_instr_insert(&b, &store->instr);
+
+ b.cursor = nir_after_cf_node(&store_64bit_if->cf_node);
+
+ b.cursor = nir_after_cf_node(&store_if->cf_node);
+
+ /* Store the availability bit if requested. */
+ nir_if *availability_if = nir_if_create(b.shader);
+ availability_if->condition =
+ nir_src_for_ssa(nir_iand(&b, flags,
+ nir_imm_int(&b, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)));
+ nir_cf_node_insert(b.cursor, &availability_if->cf_node);
+
+ b.cursor = nir_after_cf_list(&availability_if->then_list);
+
+ store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
+ store->src[0] = nir_src_for_ssa(nir_load_var(&b, available));
+ store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
+ store->src[2] = nir_src_for_ssa(nir_iadd(&b, result_size, output_base));
+ nir_intrinsic_set_write_mask(store, 0x1);
+ store->num_components = 1;
+ nir_builder_instr_insert(&b, &store->instr);
+
+ b.cursor = nir_after_cf_node(&availability_if->cf_node);
+
+ return b.shader;
+}
+
static VkResult radv_device_init_meta_query_state_internal(struct radv_device *device)
{
VkResult result;
struct radv_shader_module occlusion_cs = { .nir = NULL };
struct radv_shader_module pipeline_statistics_cs = { .nir = NULL };
+ struct radv_shader_module tfb_cs = { .nir = NULL };
mtx_lock(&device->meta_state.mtx);
if (device->meta_state.query.pipeline_statistics_query_pipeline) {
@@ -525,6 +747,7 @@ static VkResult radv_device_init_meta_query_state_internal(struct radv_device *d
}
occlusion_cs.nir = build_occlusion_query_shader(device);
pipeline_statistics_cs.nir = build_pipeline_statistics_query_shader(device);
+ tfb_cs.nir = build_tfb_query_shader(device);
VkDescriptorSetLayoutCreateInfo occlusion_ds_create_info = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
@@ -611,12 +834,34 @@ static VkResult radv_device_init_meta_query_state_internal(struct radv_device *d
radv_pipeline_cache_to_handle(&device->meta_state.cache),
1, &pipeline_statistics_vk_pipeline_info, NULL,
&device->meta_state.query.pipeline_statistics_query_pipeline);
+ if (result != VK_SUCCESS)
+ goto fail;
+ VkPipelineShaderStageCreateInfo tfb_pipeline_shader_stage = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
+ .stage = VK_SHADER_STAGE_COMPUTE_BIT,
+ .module = radv_shader_module_to_handle(&tfb_cs),
+ .pName = "main",
+ .pSpecializationInfo = NULL,
+ };
+
+ VkComputePipelineCreateInfo tfb_pipeline_info = {
+ .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
+ .stage = tfb_pipeline_shader_stage,
+ .flags = 0,
+ .layout = device->meta_state.query.p_layout,
+ };
+
+ result = radv_CreateComputePipelines(radv_device_to_handle(device),
+ radv_pipeline_cache_to_handle(&device->meta_state.cache),
+ 1, &tfb_pipeline_info, NULL,
+ &device->meta_state.query.tfb_query_pipeline);
fail:
if (result != VK_SUCCESS)
radv_device_finish_meta_query_state(device);
ralloc_free(occlusion_cs.nir);
ralloc_free(pipeline_statistics_cs.nir);
+ ralloc_free(tfb_cs.nir);
mtx_unlock(&device->meta_state.mtx);
return result;
}
@@ -631,6 +876,11 @@ VkResult radv_device_init_meta_query_state(struct radv_device *device, bool on_d
void radv_device_finish_meta_query_state(struct radv_device *device)
{
+ if (device->meta_state.query.tfb_query_pipeline)
+ radv_DestroyPipeline(radv_device_to_handle(device),
+ device->meta_state.query.tfb_query_pipeline,
+ &device->meta_state.alloc);
+
if (device->meta_state.query.pipeline_statistics_query_pipeline)
radv_DestroyPipeline(radv_device_to_handle(device),
device->meta_state.query.pipeline_statistics_query_pipeline,
@@ -1115,6 +1365,33 @@ void radv_CmdCopyQueryPoolResults(
assert(cs->cdw <= cdw_max);
}
break;
+ case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT:
+ if (flags & VK_QUERY_RESULT_WAIT_BIT) {
+ for(unsigned i = 0; i < queryCount; i++) {
+ unsigned query = firstQuery + i;
+ uint64_t src_va = va + query * pool->stride;
+
+ /* Wait on the upper word of all results. */
+ for (unsigned j = 0; j < 4; j++, src_va += 8) {
+ radeon_emit(cs, PKT3(PKT3_WAIT_REG_MEM, 5, 0));
+ radeon_emit(cs, WAIT_REG_MEM_GREATER_OR_EQUAL |
+ WAIT_REG_MEM_MEM_SPACE(1));
+ radeon_emit(cs, (src_va + 4));
+ radeon_emit(cs, (src_va + 4) >> 32);
+ radeon_emit(cs, 0x80000000); /* reference value */
+ radeon_emit(cs, 0xffffffff); /* mask */
+ radeon_emit(cs, 4); /* poll interval */
+ }
+ }
+ }
+
+ radv_query_shader(cmd_buffer, &cmd_buffer->device->meta_state.query.tfb_query_pipeline,
+ pool->bo, dst_buffer->bo,
+ firstQuery * pool->stride,
+ dst_buffer->offset + dstOffset,
+ pool->stride, stride,
+ queryCount, flags, 0, 0);
+ break;
default:
unreachable("trying to get results of unhandled query type");
}
From 1348e6e25558743fbbdf4b2130b334fb9a8ff475 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Mon, 5 Nov 2018 09:55:02 +0000
Subject: [PATCH 013/220] wsi/wayland: use proper VkResult type
Signed-off-by: Eric Engestrom
Reviewed-by: Dave Airlie
(cherry picked from commit dcee22afed935a434118935bcdad5c4fc7246077)
---
src/vulkan/wsi/wsi_common_wayland.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index e9cc22ec603..12014b0c143 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -455,10 +455,10 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
(struct wsi_wayland *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND];
struct wsi_wl_display display;
- int ret = wsi_wl_display_init(wsi, &display, wl_display, false);
+ VkResult ret = wsi_wl_display_init(wsi, &display, wl_display, false);
wsi_wl_display_finish(&display);
- return ret == 0;
+ return ret == VK_SUCCESS;
}
static VkResult
From 422c905f4b6739e0913fe58fd987826b1fbd119e Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Mon, 5 Nov 2018 09:57:09 +0000
Subject: [PATCH 014/220] wsi/wayland: only finish() a successfully init()ed
display
Fixes: 43691024982b3ea734ad0 "vulkan/wsi/wayland: Stop caching Wayland displays"
Signed-off-by: Eric Engestrom
Reviewed-by: Dave Airlie
Reviewed-by: Philipp Zabel
(cherry picked from commit d515ded4d951b830b560c352d64918a89027bee5)
---
src/vulkan/wsi/wsi_common_wayland.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index 12014b0c143..3d3a60167bf 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -456,7 +456,8 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
struct wsi_wl_display display;
VkResult ret = wsi_wl_display_init(wsi, &display, wl_display, false);
- wsi_wl_display_finish(&display);
+ if (ret == VK_SUCCESS)
+ wsi_wl_display_finish(&display);
return ret == VK_SUCCESS;
}
From 327330e77c04aa1516ceb70ccad2c0599b7772a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Fri, 2 Nov 2018 20:56:42 -0400
Subject: [PATCH 015/220] st/va: fix incorrect use of resource_destroy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: 4373dd32154 ("st/va: Support YUV formats in vaCreateSurfaces")
Cc: Drew Davenport
Reviewed-by: Emil Velikov
Reviewed-by: Michel Dänzer
(cherry picked from commit 04298a2f24455541f28ccffd2f0f73b831833d57)
---
src/gallium/state_trackers/va/surface.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 5376be28531..9646427ea5f 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -598,10 +598,8 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface,
return VA_STATUS_SUCCESS;
fail:
- for (i = 0; i < VL_NUM_COMPONENTS; i++) {
- if (resources[i])
- pscreen->resource_destroy(pscreen, resources[i]);
- }
+ for (i = 0; i < VL_NUM_COMPONENTS; i++)
+ pipe_resource_reference(&resources[i], NULL);
return result;
}
From 7053fe50c3cda1709b728003703c11c5080a82b2 Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin
Date: Mon, 5 Nov 2018 20:42:40 +0000
Subject: [PATCH 016/220] intel/decoders: fix instruction base address parsing
Signed-off-by: Lionel Landwerlin
Fixes: 00103db04ab879 ("intel: Fix decoding for partial STATE_BASE_ADDRESS updates.")
Reviewed-by: Kenneth Graunke
(cherry picked from commit b47a69ed4c907df5917de10cbe5ef12e2d900bce)
---
src/intel/common/gen_batch_decoder.c | 2 +-
src/intel/tools/aubinator_viewer_decoder.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c
index 63f04627572..36ee7706e40 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -214,7 +214,7 @@ handle_state_base_address(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
surface_modify = iter.raw_value;
} else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") == 0) {
dynamic_modify = iter.raw_value;
- } else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") == 0) {
+ } else if (strcmp(iter.name, "Instruction Base Address Modify Enable") == 0) {
instruction_modify = iter.raw_value;
}
}
diff --git a/src/intel/tools/aubinator_viewer_decoder.cpp b/src/intel/tools/aubinator_viewer_decoder.cpp
index 5311a8afc31..59cde530409 100644
--- a/src/intel/tools/aubinator_viewer_decoder.cpp
+++ b/src/intel/tools/aubinator_viewer_decoder.cpp
@@ -172,7 +172,7 @@ handle_state_base_address(struct aub_viewer_decode_ctx *ctx,
surface_modify = iter.raw_value;
} else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") == 0) {
dynamic_modify = iter.raw_value;
- } else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") == 0) {
+ } else if (strcmp(iter.name, "Instruction Base Address Modify Enable") == 0) {
instruction_modify = iter.raw_value;
}
}
From a93d19f5426d6069b9858d87fb2e9c78fbbbb02d Mon Sep 17 00:00:00 2001
From: Olivier Fourdan
Date: Thu, 25 Oct 2018 14:48:15 +0200
Subject: [PATCH 017/220] wayland/egl: Resize EGL surface on update buffer for
swrast
After commit a9fb331ea ("wayland/egl: update surface size on window
resize"), the surface size is updated as soon as the resize is done, and
`update_buffers()` would resize only if the surface size differs from
the attached size.
However, in the case of swrast, there is no resize callback and the
attached size is updated in `dri2_wl_swrast_commit_backbuffer()` prior
to the `swrast_update_buffers()` so the attached size is always up to
date when it reaches `swrast_update_buffers()` and the surface is never
resized.
This can be observed with "totem" using the GDK backend on Wayland (the
default) when running on software rendering:
$ LIBGL_ALWAYS_SOFTWARE=true CLUTTER_BACKEND=gdk totem
Resizing the window would leave the EGL surface size unchanged.
To avoid the issue, partially revert the part of commit a9fb331ea for
`swrast_update_buffers()` and resize on the win size and not the
attached size.
Fixes: a9fb331ea - wayland/egl: update surface size on window resize
Signed-off-by: Olivier Fourdan
CC: Daniel Stone
CC: Juan A. Suarez Romero
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
(cherry picked from commit 55af17ffed289bdcc1396829e461245644175ed4)
---
src/egl/drivers/dri2/platform_wayland.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index eb9f5e2b1e2..dc16a69dfbc 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1661,8 +1661,8 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)
if (dri2_surf->back)
return 0;
- if (dri2_surf->base.Width != dri2_surf->wl_win->attached_width ||
- dri2_surf->base.Height != dri2_surf->wl_win->attached_height) {
+ if (dri2_surf->base.Width != dri2_surf->wl_win->width ||
+ dri2_surf->base.Height != dri2_surf->wl_win->height) {
dri2_wl_release_buffers(dri2_surf);
From ecb1bef8714ede7b3b5b00a62c749b4c1b722e1c Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin
Date: Tue, 6 Nov 2018 11:37:51 +0000
Subject: [PATCH 018/220] anv/android: mark gralloc allocated BOs as external
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Allocating through Gralloc implies buffers are going to be used
outside the driver. We have special MOCS settings for external BOs and
we probably want to use them here too.
Signed-off-by: Lionel Landwerlin
Fixes: a1220e73116bad7 ("anv/android: Set the BO flags in bo_cache_import (v2)")
Reviewed-by: Tapani Pälli
(cherry picked from commit 421fa01d64d9f2a7191ded3a819118d216436ab8)
---
src/intel/vulkan/anv_android.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 46c41d57861..916e76c93ff 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevice device_h,
*/
int dma_buf = gralloc_info->handle->data[0];
- uint64_t bo_flags = 0;
+ uint64_t bo_flags = ANV_BO_EXTERNAL;
if (device->instance->physicalDevice.supports_48bit_addresses)
bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
if (device->instance->physicalDevice.use_softpin)
From ede46c67ea35c076721aac0d1b751eb589e50629 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Wed, 7 Nov 2018 15:59:07 +0000
Subject: [PATCH 019/220] docs: document the staging branch and add reference
to it
A while back we agreed that having a live/staging branch is beneficial.
Sadly we forgot to document that, so here is my first attempt.
Document the caveat that the branch history is not stable.
CC: Andres Gomez
CC: Dylan Baker
CC: Juan A. Suarez Romero
Signed-off-by: Emil Velikov
(cherry picked from commit 0a60708870e256432bdef1a22c98b09f83d8a440)
---
docs/releasing.html | 20 ++++++++++++++++++++
docs/submittingpatches.html | 3 +++
2 files changed, 23 insertions(+)
diff --git a/docs/releasing.html b/docs/releasing.html
index 52e102207d1..c79a020efa7 100644
--- a/docs/releasing.html
+++ b/docs/releasing.html
@@ -21,6 +21,7 @@ Releasing process
Overview
Release schedule
Cherry-pick and test
+Staging branch
Making a branchpoint
Pre-release announcement
Making a new release
@@ -209,6 +210,25 @@ Regression/functionality testing
idea too.
+Staging branch
+
+
+A live branch, which contains the currently merge/rejected patches is available
+in the main repository under staging/X.Y. For example:
+
+
+ staging/18.1 - WIP branch for the 18.1 series
+ staging/18.2 - WIP branch for the 18.2 series
+
+
+
+Notes:
+
+
+- People are encouraged to test the branch and report regressions.
+- The branch history is not stable and it will be rebased,
+
+
Making a branchpoint
diff --git a/docs/submittingpatches.html b/docs/submittingpatches.html
index e5350bdb2cf..d7ea0a310db 100644
--- a/docs/submittingpatches.html
+++ b/docs/submittingpatches.html
@@ -251,6 +251,9 @@ Nominating a commit for a stable branch
nomination request.
+
+The current patch status can be observed in the staging branch.
+
The stable tag
From 5b35600422ddbe1e17f11e9235cbcff043e303bf Mon Sep 17 00:00:00 2001
From: Timothy Arceri
Date: Fri, 2 Nov 2018 13:33:52 +1100
Subject: [PATCH 020/220] ac/nir_to_llvm: fix b2f for f64
Fixes: d7e0d47b9de3 ("nir: Add a bunch of b2[if] optimizations")
Reviewed-by: Dave Airlie
(cherry picked from commit 9aa3c1915ea039a0301849f2ac78fbe579972864)
---
src/amd/common/ac_nir_to_llvm.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index e5fbe003f53..c950b81dca2 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -311,9 +311,18 @@ static LLVMValueRef emit_uint_carry(struct ac_llvm_context *ctx,
}
static LLVMValueRef emit_b2f(struct ac_llvm_context *ctx,
- LLVMValueRef src0)
+ LLVMValueRef src0,
+ unsigned bitsize)
{
- return LLVMBuildAnd(ctx->builder, src0, LLVMBuildBitCast(ctx->builder, LLVMConstReal(ctx->f32, 1.0), ctx->i32, ""), "");
+ LLVMValueRef result = LLVMBuildAnd(ctx->builder, src0,
+ LLVMBuildBitCast(ctx->builder, LLVMConstReal(ctx->f32, 1.0), ctx->i32, ""),
+ "");
+ result = LLVMBuildBitCast(ctx->builder, result, ctx->f32, "");
+
+ if (bitsize == 32)
+ return result;
+
+ return LLVMBuildFPExt(ctx->builder, result, ctx->f64, "");
}
static LLVMValueRef emit_f2b(struct ac_llvm_context *ctx,
@@ -932,7 +941,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
result = emit_uint_carry(&ctx->ac, "llvm.usub.with.overflow.i32", src[0], src[1]);
break;
case nir_op_b2f:
- result = emit_b2f(&ctx->ac, src[0]);
+ result = emit_b2f(&ctx->ac, src[0], instr->dest.dest.ssa.bit_size);
break;
case nir_op_f2b:
result = emit_f2b(&ctx->ac, src[0]);
From 61c64f64d73096acb9ee352ac9535ca7e1a930e8 Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset
Date: Mon, 5 Nov 2018 09:54:28 +0100
Subject: [PATCH 021/220] radv: disable conditional rendering for
vkCmdCopyQueryPoolResults()
VK_EXT_conditional_rendering says that copy commands should not be
affected by conditional rendering.
Cc: 18.2 18.3
Signed-off-by: Samuel Pitoiset
Reviewed-by: Dave Airlie
(cherry picked from commit 0a0aa2ba6c37085948cc7efe11695ebe4fdf12fe)
Conflicts:
src/amd/vulkan/radv_query.c
---
src/amd/vulkan/radv_query.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index ae8fc3834bf..d538170c67d 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -913,6 +913,7 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
{
struct radv_device *device = cmd_buffer->device;
struct radv_meta_saved_state saved_state;
+ bool old_predicating;
if (!*pipeline) {
VkResult ret = radv_device_init_meta_query_state_internal(device);
@@ -927,6 +928,12 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
RADV_META_SAVE_CONSTANTS |
RADV_META_SAVE_DESCRIPTORS);
+ /* VK_EXT_conditional_rendering says that copy commands should not be
+ * affected by conditional rendering.
+ */
+ old_predicating = cmd_buffer->state.predicating;
+ cmd_buffer->state.predicating = false;
+
struct radv_buffer dst_buffer = {
.bo = dst_bo,
.offset = dst_offset,
@@ -1008,6 +1015,8 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_INV_GLOBAL_L2 |
RADV_CMD_FLAG_INV_VMEM_L1 |
RADV_CMD_FLAG_CS_PARTIAL_FLUSH;
+ /* Restore conditional rendering. */
+ cmd_buffer->state.predicating = old_predicating;
radv_meta_restore(&saved_state, cmd_buffer);
}
From 15442cac5c747e54952fcc972f5c43faa208dbbf Mon Sep 17 00:00:00 2001
From: Sergii Romantsov
Date: Thu, 1 Nov 2018 13:02:43 +0200
Subject: [PATCH 022/220] autotools: library-dependency when no sse and 32-bit
Building of 32bit Mesa may fail if __SSE__ is not specified.
Added missed dependency from libm.
v2: avoided dependecy on any flag, just link
v3: meson doesn't fail, but have added dependency on libm
CC: Dylan Baker
CC: Lionel G Landwerlin
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560
Signed-off-by: Sergii Romantsov
Reviewed-by: Dylan Baker
(cherry picked from commit ce837a537282f10bc48c4ac426fa9a31241beea2)
---
src/util/Makefile.am | 3 ++-
src/util/meson.build | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index b857db8a866..4bda54c551d 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -60,7 +60,8 @@ libmesautil_la_LIBADD = \
$(PTHREAD_LIBS) \
$(CLOCK_LIB) \
$(ZLIB_LIBS) \
- $(LIBATOMIC_LIBS)
+ $(LIBATOMIC_LIBS) \
+ -lm
libxmlconfig_la_SOURCES = $(XMLCONFIG_FILES)
libxmlconfig_la_CFLAGS = \
diff --git a/src/util/meson.build b/src/util/meson.build
index 7caea27d660..156621aff65 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -119,7 +119,7 @@ libmesa_util = static_library(
'mesa_util',
[files_mesa_util, format_srgb],
include_directories : inc_common,
- dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic],
+ dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
c_args : [c_msvc_compat_args, c_vis_args],
build_by_default : false
)
From 09c5e548c4eb1b9a4f5a8b3c2bac3da857338464 Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 25 Oct 2018 21:33:52 +0200
Subject: [PATCH 023/220] glsl: do not allow implicit casts of unsized array
initializers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The GLSL 4.6 specification (section 4.1.14. "Implicit Conversions")
says:
"There are no implicit array or structure conversions. For
example, an array of int cannot be implicitly converted to an
array of float."
So let's add a check in place when assigning array initializers to
implicitly sized arrays, to avoid incorrectly allowing code on the
form:
int[] foo = float[](1.0, 2.0, 3.0)
This fixes the following dEQP test-cases:
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_fragment
Signed-off-by: Erik Faye-Lund
Reviewed-by: Tapani Pälli
(cherry picked from commit 742dace8251b764775ee049cf529715f90afecc1)
---
src/compiler/glsl/ast_to_hir.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 084b7021a9f..cf52f079df2 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -892,7 +892,8 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
}
if (unsized_array) {
if (is_initializer) {
- return rhs;
+ if (rhs->type->get_scalar_type() == lhs->type->get_scalar_type())
+ return rhs;
} else {
_mesa_glsl_error(&loc, state,
"implicitly sized arrays cannot be assigned");
From 4c995fcae76ed241fe963206dbe473d0f801f3ad Mon Sep 17 00:00:00 2001
From: Gert Wollny
Date: Thu, 1 Nov 2018 10:49:58 +0100
Subject: [PATCH 024/220] virgl/vtest-winsys: Use virgl version of bind flags
The bind flags defined by mesa/gallium might not always be in sync
with the ones copied to virglrenderer/gallium. Therefore, use the
flags defined in virgl like it is done for all the other calls to
create resources.
Signed-off-by: Gert Wollny
Reviewed-by: Dave Airlie
(cherry picked from commit b710680093a29d4f7dcde2e5a3ee61bba80404ca)
---
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
index a589f694bb0..f44d4d74ff1 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
@@ -559,7 +559,7 @@ virgl_cs_create_fence(struct virgl_winsys *vws)
res = virgl_vtest_winsys_resource_cache_create(vws,
PIPE_BUFFER,
PIPE_FORMAT_R8_UNORM,
- PIPE_BIND_CUSTOM,
+ VIRGL_BIND_CUSTOM,
8, 1, 1, 0, 0, 0, 8);
return (struct pipe_fence_handle *)res;
From f55265776fed8db8d738e5a25b1a1126b48f45ee Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 9 Nov 2018 11:00:00 +0000
Subject: [PATCH 025/220] Update version to 18.3.0-rc2
Signed-off-by: Emil Velikov
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index bb28ad2e2bd..9bdced0d72e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.3.0-rc1
+18.3.0-rc2
From 73f457f486468724674883796fb3e8e7649a4236 Mon Sep 17 00:00:00 2001
From: Mark Janes
Date: Thu, 1 Nov 2018 15:44:45 -0700
Subject: [PATCH 026/220] Revert "i965/batch: avoid reverting batch buffer if
saved state is an empty"
This reverts commit a9031bf9b55602d93cccef6c926e2179c23205b4.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630
(cherry picked from commit 5f312e95f8775e050ef9f8218be0eed6da1ee21d)
---
src/mesa/drivers/dri/i965/brw_compute.c | 3 +--
src/mesa/drivers/dri/i965/brw_draw.c | 3 +--
src/mesa/drivers/dri/i965/genX_blorp_exec.c | 3 +--
src/mesa/drivers/dri/i965/intel_batchbuffer.c | 7 -------
src/mesa/drivers/dri/i965/intel_batchbuffer.h | 1 -
5 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_compute.c b/src/mesa/drivers/dri/i965/brw_compute.c
index 5c8e3a5d4de..de08fc3ac16 100644
--- a/src/mesa/drivers/dri/i965/brw_compute.c
+++ b/src/mesa/drivers/dri/i965/brw_compute.c
@@ -167,7 +167,7 @@ static void
brw_dispatch_compute_common(struct gl_context *ctx)
{
struct brw_context *brw = brw_context(ctx);
- bool fail_next;
+ bool fail_next = false;
if (!_mesa_check_conditional_render(ctx))
return;
@@ -185,7 +185,6 @@ brw_dispatch_compute_common(struct gl_context *ctx)
intel_batchbuffer_require_space(brw, 600);
brw_require_statebuffer_space(brw, 2500);
intel_batchbuffer_save_state(brw);
- fail_next = intel_batchbuffer_saved_state_is_empty(brw);
retry:
brw->batch.no_wrap = true;
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 19ee3962d74..8536c040109 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -885,7 +885,7 @@ brw_draw_single_prim(struct gl_context *ctx,
{
struct brw_context *brw = brw_context(ctx);
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- bool fail_next;
+ bool fail_next = false;
/* Flag BRW_NEW_DRAW_CALL on every draw. This allows us to have
* atoms that happen on every draw call.
@@ -898,7 +898,6 @@ brw_draw_single_prim(struct gl_context *ctx,
intel_batchbuffer_require_space(brw, 1500);
brw_require_statebuffer_space(brw, 2400);
intel_batchbuffer_save_state(brw);
- fail_next = intel_batchbuffer_saved_state_is_empty(brw);
if (brw->num_instances != prim->num_instances ||
brw->basevertex != prim->basevertex ||
diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
index fd9ce93c6c7..34bfcad03eb 100644
--- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
+++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
@@ -268,7 +268,7 @@ genX(blorp_exec)(struct blorp_batch *batch,
assert(batch->blorp->driver_ctx == batch->driver_batch);
struct brw_context *brw = batch->driver_batch;
struct gl_context *ctx = &brw->ctx;
- bool check_aperture_failed_once;
+ bool check_aperture_failed_once = false;
#if GEN_GEN >= 11
/* The PIPE_CONTROL command description says:
@@ -309,7 +309,6 @@ genX(blorp_exec)(struct blorp_batch *batch,
intel_batchbuffer_require_space(brw, 1400);
brw_require_statebuffer_space(brw, 600);
intel_batchbuffer_save_state(brw);
- check_aperture_failed_once = intel_batchbuffer_saved_state_is_empty(brw);
brw->batch.no_wrap = true;
#if GEN_GEN == 6
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 6207de5a06f..8b769eaf534 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -301,13 +301,6 @@ intel_batchbuffer_save_state(struct brw_context *brw)
brw->batch.saved.exec_count = brw->batch.exec_count;
}
-bool
-intel_batchbuffer_saved_state_is_empty(struct brw_context *brw)
-{
- struct intel_batchbuffer *batch = &brw->batch;
- return (batch->saved.map_next == batch->batch.map);
-}
-
void
intel_batchbuffer_reset_to_saved(struct brw_context *brw)
{
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
index 91720dad5b4..0632142cd31 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
@@ -24,7 +24,6 @@ struct intel_batchbuffer;
void intel_batchbuffer_init(struct brw_context *brw);
void intel_batchbuffer_free(struct intel_batchbuffer *batch);
void intel_batchbuffer_save_state(struct brw_context *brw);
-bool intel_batchbuffer_saved_state_is_empty(struct brw_context *brw);
void intel_batchbuffer_reset_to_saved(struct brw_context *brw);
void intel_batchbuffer_require_space(struct brw_context *brw, GLuint sz);
int _intel_batchbuffer_flush_fence(struct brw_context *brw,
From c64a78ec0a5daf862e10d8a4fb931348167b6d3f Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset
Date: Wed, 7 Nov 2018 17:06:27 +0100
Subject: [PATCH 027/220] radv: only expose VK_SUBGROUP_FEATURE_ARITHMETIC_BIT
for VI+
Inclusive and exclusives scan are missing because older chips
don't have llvm.amdgcn.update.dpp.
This fixes crashes with dEQP-VK.subgroups.arithmetic.*.
CC: mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset
Reviewed-by: Dave Airlie
(cherry picked from commit 0dcd99c6870aae5b15c8709a8afcc942d116c976)
---
src/amd/vulkan/radv_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index d68111c25bf..92254bed2e1 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1058,12 +1058,12 @@ void radv_GetPhysicalDeviceProperties2(
* is fixed in LLVM.
*/
properties->supportedOperations =
- VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
VK_SUBGROUP_FEATURE_BASIC_BIT |
VK_SUBGROUP_FEATURE_BALLOT_BIT |
VK_SUBGROUP_FEATURE_QUAD_BIT;
if (pdevice->rad_info.chip_class >= VI) {
properties->supportedOperations |=
+ VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT;
}
From 5f137e94b992a62e98dfa604cd43f57c5385e53b Mon Sep 17 00:00:00 2001
From: Andre Heider
Date: Tue, 6 Nov 2018 09:27:12 +0100
Subject: [PATCH 028/220] st/nine: fix stack corruption due to ABI mismatch
This fixes various crashes and hangs when using nine's 'thread_submit'
feature.
On 64bit, the thread function's data argument would just be NULL.
On 32bit, the data argument would be garbage depending on the compiler
flags (in my case -march>=core2).
Fixes: f3fa7e3068512d ("st/nine: Use WINE thread for threadpool")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andre Heider
Reviewed-by: Axel Davy
(cherry picked from commit 10598c9667a9c5ea04ac8279549b1df8c026ef51)
---
src/gallium/state_trackers/nine/threadpool.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/gallium/state_trackers/nine/threadpool.c b/src/gallium/state_trackers/nine/threadpool.c
index cc62fd25799..19721aab2dd 100644
--- a/src/gallium/state_trackers/nine/threadpool.c
+++ b/src/gallium/state_trackers/nine/threadpool.c
@@ -37,6 +37,7 @@
#include "os/os_thread.h"
#include "threadpool.h"
+/* POSIX thread function */
static void *
threadpool_worker(void *data)
{
@@ -76,6 +77,15 @@ threadpool_worker(void *data)
return NULL;
}
+/* Windows thread function */
+static DWORD NINE_WINAPI
+wthreadpool_worker(void *data)
+{
+ threadpool_worker(data);
+
+ return 0;
+}
+
struct threadpool *
_mesa_threadpool_create(struct NineSwapChain9 *swapchain)
{
@@ -87,7 +97,9 @@ _mesa_threadpool_create(struct NineSwapChain9 *swapchain)
pthread_mutex_init(&pool->m, NULL);
pthread_cond_init(&pool->new_work, NULL);
- pool->wthread = NineSwapChain9_CreateThread(swapchain, threadpool_worker, pool);
+ /* This uses WINE's CreateThread, so the thread function needs to use
+ * the Windows ABI */
+ pool->wthread = NineSwapChain9_CreateThread(swapchain, wthreadpool_worker, pool);
if (!pool->wthread) {
/* using pthread as fallback */
pthread_create(&pool->pthread, NULL, threadpool_worker, pool);
From fff64af317a62dae8cd4ac451aa1a643714cb3b6 Mon Sep 17 00:00:00 2001
From: Timothy Arceri
Date: Mon, 12 Nov 2018 13:24:42 +1100
Subject: [PATCH 029/220] nir: add glsl_type_is_integer() helper
Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")
Reviewed-by: Jason Ekstrand
(cherry picked from commit 9dd737bb02923d26d4d947ebf265b05f13dd2c0c)
---
src/compiler/nir_types.cpp | 5 +++++
src/compiler/nir_types.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index d24f0941519..3cd61f66056 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -301,6 +301,11 @@ glsl_type_is_boolean(const struct glsl_type *type)
{
return type->is_boolean();
}
+bool
+glsl_type_is_integer(const struct glsl_type *type)
+{
+ return type->is_integer();
+}
const glsl_type *
glsl_void_type(void)
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index 77454fa9fab..70d593b96ab 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -142,6 +142,7 @@ bool glsl_type_is_image(const struct glsl_type *type);
bool glsl_type_is_dual_slot(const struct glsl_type *type);
bool glsl_type_is_numeric(const struct glsl_type *type);
bool glsl_type_is_boolean(const struct glsl_type *type);
+bool glsl_type_is_integer(const struct glsl_type *type);
bool glsl_sampler_type_is_shadow(const struct glsl_type *type);
bool glsl_sampler_type_is_array(const struct glsl_type *type);
bool glsl_contains_atomic(const struct glsl_type *type);
From 9b8380a4f9ca28b2ba569c272e4951084b011210 Mon Sep 17 00:00:00 2001
From: Timothy Arceri
Date: Mon, 12 Nov 2018 13:25:27 +1100
Subject: [PATCH 030/220] nir: don't pack varyings ints with floats unless flat
Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")
Reviewed-by: Jason Ekstrand
(cherry picked from commit a068958692cc662203f04e488356005533568a56)
---
src/compiler/nir/nir_linking_helpers.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index de6f2481def..3845ed66b49 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -195,9 +195,12 @@ nir_remove_unused_varyings(nir_shader *producer, nir_shader *consumer)
}
static uint8_t
-get_interp_type(nir_variable *var, bool default_to_smooth_interp)
+get_interp_type(nir_variable *var, const struct glsl_type *type,
+ bool default_to_smooth_interp)
{
- if (var->data.interpolation != INTERP_MODE_NONE)
+ if (glsl_type_is_integer(type))
+ return INTERP_MODE_FLAT;
+ else if (var->data.interpolation != INTERP_MODE_NONE)
return var->data.interpolation;
else if (default_to_smooth_interp)
return INTERP_MODE_SMOOTH;
@@ -252,7 +255,7 @@ get_slot_component_masks_and_interp_types(struct exec_list *var_list,
unsigned comps_slot2 = 0;
for (unsigned i = 0; i < slots; i++) {
interp_type[location + i] =
- get_interp_type(var, default_to_smooth_interp);
+ get_interp_type(var, type, default_to_smooth_interp);
interp_loc[location + i] = get_interp_loc(var);
if (dual_slot) {
@@ -424,7 +427,7 @@ compact_components(nir_shader *producer, nir_shader *consumer, uint8_t *comps,
continue;
bool found_new_offset = false;
- uint8_t interp = get_interp_type(var, default_to_smooth_interp);
+ uint8_t interp = get_interp_type(var, type, default_to_smooth_interp);
for (; cursor[interp] < 32; cursor[interp]++) {
uint8_t cursor_used_comps = comps[cursor[interp]];
From 6a706763d0266bb1c4f86faff8b8a71fd4386641 Mon Sep 17 00:00:00 2001
From: Dylan Baker
Date: Fri, 9 Nov 2018 13:27:56 -0800
Subject: [PATCH 031/220] meson: Don't set -Wall
meson does this for you with its warn levels, so we don't need to set
it ourselves.
Fixes: d1992255bb29054fa51763376d125183a9f602f3
("meson: Add build Intel "anv" vulkan driver")
Reviewed-by: Eric Engestrom
(cherry picked from commit 9c2a95b29868f1388408b5eb9193fff39f942217)
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 18667988bac..dabfb9abddd 100644
--- a/meson.build
+++ b/meson.build
@@ -787,7 +787,7 @@ endif
# Check for generic C arguments
c_args = []
-foreach a : ['-Wall', '-Werror=implicit-function-declaration',
+foreach a : ['-Werror=implicit-function-declaration',
'-Werror=missing-prototypes', '-Werror=return-type',
'-fno-math-errno',
'-fno-trapping-math', '-Qunused-arguments']
@@ -809,7 +809,7 @@ endif
# Check for generic C++ arguments
cpp_args = []
-foreach a : ['-Wall', '-Werror=return-type',
+foreach a : ['-Werror=return-type',
'-fno-math-errno', '-fno-trapping-math',
'-Qunused-arguments']
if cpp.has_argument(a)
From 7ea4e43c554c2ccecb3f4cd737aa34506d55ba0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Mon, 12 Nov 2018 15:43:58 -0500
Subject: [PATCH 032/220] st/mesa: disable L3 thread pinning
This implementation can have massive drawbacks.
Cc: 18.3
Reviewed-by: Edmondo Tommasina
(cherry picked from commit e0c7114eb3c19d4c2653f661698a6baa3bc9bedf)
---
src/mesa/state_tracker/st_manager.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index ceb48dd4903..776b563e50e 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -1069,15 +1069,6 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi,
* of the referenced drawables no longer exist.
*/
st_framebuffers_purge(st);
-
- /* Notify the driver that the context thread may have been changed.
- * This should pin all driver threads to a specific L3 cache for optimal
- * performance on AMD Zen CPUs.
- */
- struct glthread_state *glthread = st->ctx->GLThread;
- thrd_t *upper_thread = glthread ? &glthread->queue.threads[0] : NULL;
-
- util_context_thread_changed(st->pipe, upper_thread);
}
else {
ret = _mesa_make_current(NULL, NULL, NULL);
From ad99afdce6c2d54ae40aec10b91fe3b65f7f3904 Mon Sep 17 00:00:00 2001
From: Dylan Baker
Date: Fri, 9 Nov 2018 12:56:00 -0800
Subject: [PATCH 033/220] meson: fix libatomic tests
There are two problems:
1) the extra underscore in MISSING_64BIT_ATOMICS
2) we should link with libatomic if the previous test decided we needed
it
Fixes: d1992255bb29054fa51763376d125183a9f602f3
("meson: Add build Intel "anv" vulkan driver")
Reviewed-and-Tested-by: Matt Turner
(cherry picked from commit 4eab98b66e7dc495f26ac3b0e356e405c0796b74)
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index dabfb9abddd..58ff3ea9735 100644
--- a/meson.build
+++ b/meson.build
@@ -905,8 +905,9 @@ if not cc.links('''#include
int main() {
return __sync_add_and_fetch(&v, (uint64_t)1);
}''',
+ dependencies : dep_atomic,
name : 'GCC 64bit atomics')
- pre_args += '-DMISSING_64_BIT_ATOMICS'
+ pre_args += '-DMISSING_64BIT_ATOMICS'
endif
# TODO: shared/static? Is this even worth doing?
From cc572038bf81025c30825178b390f3e38a664887 Mon Sep 17 00:00:00 2001
From: Matt Turner
Date: Sun, 11 Nov 2018 13:44:41 -0800
Subject: [PATCH 034/220] util/ralloc: Make sizeof(linear_header) a multiple of
8
Prior to this patch sizeof(linear_header) was 20 bytes in a
non-debug build on 32-bit platforms. We do some pointer arithmetic to
calculate the next available location with
ptr = (linear_size_chunk *)((char *)&latest[1] + latest->offset);
in linear_alloc_child(). The &latest[1] adds 20 bytes, so an allocation
would only be 4-byte aligned.
On 32-bit SPARC a 'sttw' instruction (which stores a consecutive pair of
4-byte registers to memory) requires an 8-byte aligned address. Such an
instruction is used to store to an 8-byte integer type, like intmax_t
which is used in glcpp's expression_value_t struct.
As a result of the 4-byte alignment returned by linear_alloc_child() we
would generate a SIGBUS (unaligned exception) on SPARC.
According to the GNU libc manual malloc() always returns memory that has
at least an alignment of 8-bytes [1]. I think our allocator should do
the same.
So, simple fix with two parts:
(1) Increase SUBALLOC_ALIGNMENT to 8 unconditionally.
(2) Mark linear_header with an aligned attribute, which will cause
its sizeof to be rounded up to that alignment. (We already do
this for ralloc_header)
With this done, all Mesa's unit tests now pass on SPARC.
[1] https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html
Fixes: 47e17586924f ("glcpp: use the linear allocator for most objects")
Bug: https://bugs.gentoo.org/636326
Reviewed-by: Eric Anholt
(cherry picked from commit efb1ccadca89b1b3f39fb52b7b83154dff764a15)
Conflicts:
src/util/ralloc.c
---
src/util/ralloc.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index 5d77f75ee85..5a7fa7e84e9 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -554,10 +554,18 @@ ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
*/
#define MIN_LINEAR_BUFSIZE 2048
-#define SUBALLOC_ALIGNMENT sizeof(uintptr_t)
+#define SUBALLOC_ALIGNMENT 8
#define LMAGIC 0x87b9c7d3
-struct linear_header {
+struct
+#ifdef _MSC_VER
+ __declspec(align(8))
+#elif defined(__LP64__)
+ __attribute__((aligned(16)))
+#else
+ __attribute__((aligned(8)))
+#endif
+ linear_header {
#ifdef DEBUG
unsigned magic; /* for debugging */
#endif
@@ -651,6 +659,8 @@ linear_alloc_child(void *parent, unsigned size)
ptr = (linear_size_chunk *)((char*)&latest[1] + latest->offset);
ptr->size = size;
latest->offset += full_size;
+
+ assert((uintptr_t)&ptr[1] % SUBALLOC_ALIGNMENT == 0);
return &ptr[1];
}
From 8a79c536d57fbbd77d804dc47635872c356edf9b Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset
Date: Mon, 12 Nov 2018 11:37:20 +0100
Subject: [PATCH 035/220] radv: binding streamout buffers doesn't change
context regs
Cc: 18.3
Signed-off-by: Samuel Pitoiset
Reviewed-by: Bas Nieuwenhuizen
(cherry picked from commit b5f213bb1dcde22949dffe9d3a431fecd5d0f33b)
---
src/amd/vulkan/radv_cmd_buffer.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 6510a5c4425..b9d5726bfba 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3520,8 +3520,13 @@ static bool radv_need_late_scissor_emission(struct radv_cmd_buffer *cmd_buffer,
uint32_t used_states = cmd_buffer->state.pipeline->graphics.needed_dynamic_state | ~RADV_CMD_DIRTY_DYNAMIC_ALL;
- /* Index & Vertex buffer don't change context regs, and pipeline is handled later. */
- used_states &= ~(RADV_CMD_DIRTY_INDEX_BUFFER | RADV_CMD_DIRTY_VERTEX_BUFFER | RADV_CMD_DIRTY_PIPELINE);
+ /* Index, vertex and streamout buffers don't change context regs, and
+ * pipeline is handled later.
+ */
+ used_states &= ~(RADV_CMD_DIRTY_INDEX_BUFFER |
+ RADV_CMD_DIRTY_VERTEX_BUFFER |
+ RADV_CMD_DIRTY_STREAMOUT_BUFFER |
+ RADV_CMD_DIRTY_PIPELINE);
/* Assume all state changes except these two can imply context rolls. */
if (cmd_buffer->state.dirty & used_states)
From e2494a9387860354051f945c7dd423a59e4ffb08 Mon Sep 17 00:00:00 2001
From: Gert Wollny
Date: Mon, 12 Nov 2018 12:34:26 +0100
Subject: [PATCH 036/220] mesa: Reference count shaders that are used by
transform feedback objects
Transform feedback objects may hold a pointer to a shader program, and
at least in Gallium, this must be a valid pointer until
ctx->Driver.EndTransformFeedback in glEndTransformFeedback has been called
- which is conform with the spec that any program that is part of a
current rendering state should only be flagged for deletion by glDeleteProgram.
This was not handled properly for the transform feedback objects so that
a call sequence
glUseProgram(x)
glBeginTransformFreedback(...)
glPauseTransformFeedback(...)
glDeleteProgram(x)
glEndTransformFeedback(...)
would result in a use after free bug. With this patch the transform
feedback object also updates the reference count to the used program
thereby keeping the program valid as long as the transform feedback
objects links to it.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108713
Fixes: 654587696b4234d09a6b471b70e9629cf2887c27
mesa: add end_transform_feedback() helper
Signed-off-by: Gert Wollny
Reviewed-by: Emil Velikov
(cherry picked from commit caa964b422152788a95a1b248c884df8918a2bbd)
---
src/mesa/main/transformfeedback.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index a46c9f94bca..8eccdc20b76 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -40,6 +40,7 @@
#include "shaderapi.h"
#include "shaderobj.h"
+#include "program/program.h"
#include "program/prog_parameter.h"
struct using_program_tuple
@@ -470,6 +471,7 @@ begin_transform_feedback(struct gl_context *ctx, GLenum mode, bool no_error)
if (obj->program != source) {
ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedbackProg;
+ _mesa_reference_program_(ctx, &obj->program, source);
obj->program = source;
}
@@ -504,6 +506,7 @@ end_transform_feedback(struct gl_context *ctx,
assert(ctx->Driver.EndTransformFeedback);
ctx->Driver.EndTransformFeedback(ctx, obj);
+ _mesa_reference_program_(ctx, &obj->program, NULL);
ctx->TransformFeedback.CurrentObject->Active = GL_FALSE;
ctx->TransformFeedback.CurrentObject->Paused = GL_FALSE;
ctx->TransformFeedback.CurrentObject->EndedAnytime = GL_TRUE;
From 9d92b603f1ad710041c280d6b12ac4c6254d9209 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Thu, 11 Oct 2018 16:21:14 +0100
Subject: [PATCH 037/220] meson: only run vulkan's meson.build when building
vulkan
Fixes: d1992255bb29054fa5176 "meson: Add build Intel "anv" vulkan driver"
Signed-off-by: Eric Engestrom
Reviewed-by: Emil Velikov
Reviewed-by: Dylan Baker
(cherry picked from commit 3832db275efdb235b3b7b27c9b41e64d5507aa2c)
---
src/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/meson.build b/src/meson.build
index 73146d37143..2c0bff73432 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -52,7 +52,9 @@ subdir('mapi')
# TODO: opengl
subdir('compiler')
subdir('egl/wayland/wayland-drm')
-subdir('vulkan')
+if with_any_vk
+ subdir('vulkan')
+endif
if with_gallium_radeonsi or with_amd_vk
subdir('amd')
endif
From 940d3a4ef8c101a75e439613c5f8c2c402389ca1 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Thu, 11 Oct 2018 16:27:07 +0100
Subject: [PATCH 038/220] gbm: remove unnecessary meson include
`inc_wayland_drm` is only used if wayland is built, and it's already
added in that case a few lines below.
Fixes: a29869e8720b385d3692f "gbm: Don't traverse backwards for includes"
Signed-off-by: Eric Engestrom
Reviewed-by: Emil Velikov
Reviewed-by: Dylan Baker
(cherry picked from commit 7df80de6e645ba8c20d97f5f2b1f6c12aa962e29)
---
src/gbm/meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 2e9d380c0b4..719f9c1a9b8 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -32,7 +32,6 @@ args_gbm = []
deps_gbm = []
incs_gbm = [
include_directories('main'), inc_include, inc_src, inc_loader,
- inc_wayland_drm,
]
if with_dri2
From fbe2a549913784fb4c2b3bb2fe73809807d134f8 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Thu, 11 Oct 2018 16:00:04 +0100
Subject: [PATCH 039/220] meson: fix wayland-less builds
Those empty variables in the !wayland case are useless and running that
meson.build with them breaks the build:
[287/850] Generating wayland-drm-client-protocol.h with a custom command.
FAILED: src/egl/wayland/wayland-drm/wayland-drm-client-protocol.h
client-header ../src/egl/wayland/wayland-drm/wayland-drm.xml src/egl/wayland/wayland-drm/wayland-drm-client-protocol.h
/bin/sh: client-header: command not found
ninja: build stopped: subcommand failed.
Fixes: d1992255bb29054fa5176 "meson: Add build Intel "anv" vulkan driver"
Signed-off-by: Eric Engestrom
Reviewed-by: Emil Velikov
Reviewed-by: Dylan Baker
(cherry picked from commit 4fa2fb35245448f8b5d81fb5b37afec4f343f18a)
---
meson.build | 7 -------
src/meson.build | 4 +++-
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index 58ff3ea9735..1b475877827 100644
--- a/meson.build
+++ b/meson.build
@@ -1318,13 +1318,6 @@ if with_platform_wayland
'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml'
)
pre_args += ['-DHAVE_WAYLAND_PLATFORM', '-DWL_HIDE_DEPRECATED']
-else
- prog_wl_scanner = []
- wl_scanner_arg = ''
- dep_wl_protocols = null_dep
- dep_wayland_client = null_dep
- dep_wayland_server = null_dep
- wayland_dmabuf_xml = ''
endif
dep_x11 = null_dep
diff --git a/src/meson.build b/src/meson.build
index 2c0bff73432..0d0ecf2c530 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -51,7 +51,9 @@ subdir('util')
subdir('mapi')
# TODO: opengl
subdir('compiler')
-subdir('egl/wayland/wayland-drm')
+if with_platform_wayland
+ subdir('egl/wayland/wayland-drm')
+endif
if with_any_vk
subdir('vulkan')
endif
From e1dc5715b23bfdffdd2d6f4cbc86ae1120276cc5 Mon Sep 17 00:00:00 2001
From: Karol Herbst
Date: Thu, 26 Apr 2018 16:54:26 +0200
Subject: [PATCH 040/220] nir/spirv: cast shift operand to u32
v2: fix for specialization constants as well
Reviewed-by: Jason Ekstrand
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Karol Herbst
(cherry picked from commit b4380cb070c0865f1fbfb3720056545665759bc3)
---
src/compiler/spirv/spirv_to_nir.c | 20 ++++++++++++++++++++
src/compiler/spirv/vtn_alu.c | 11 +++++++++++
2 files changed, 31 insertions(+)
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 96ff09c3659..77ce0be369e 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1811,6 +1811,26 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
src[j] = src_val->constant->values[0];
}
+ /* fix up fixed size sources */
+ switch (op) {
+ case nir_op_ishl:
+ case nir_op_ishr:
+ case nir_op_ushr: {
+ if (bit_size == 32)
+ break;
+ for (unsigned i = 0; i < num_components; ++i) {
+ switch (bit_size) {
+ case 64: src[1].u32[i] = src[1].u64[i]; break;
+ case 16: src[1].u32[i] = src[1].u16[i]; break;
+ case 8: src[1].u32[i] = src[1].u8[i]; break;
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
val->constant->values[0] =
nir_eval_const_opcode(op, num_components, bit_size, src);
break;
diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
index 6860e7dc090..a23f8c29b5c 100644
--- a/src/compiler/spirv/vtn_alu.c
+++ b/src/compiler/spirv/vtn_alu.c
@@ -696,6 +696,17 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
src[1] = tmp;
}
+ switch (op) {
+ case nir_op_ishl:
+ case nir_op_ishr:
+ case nir_op_ushr:
+ if (src[1]->bit_size != 32)
+ src[1] = nir_u2u32(&b->nb, src[1]);
+ break;
+ default:
+ break;
+ }
+
val->ssa->def = nir_build_alu(&b->nb, op, src[0], src[1], src[2], src[3]);
break;
} /* default */
From 9650fc05a5f4fcb8b62151127ca752a5b93d5e8c Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:13 +0000
Subject: [PATCH 041/220] bin/get-pick-list.sh: simplify git oneline printing
Currently we force disable the pager via "|cat" where --no-pager
exists. Additionally we could use git show instead of git log -n1.
Use those for a slightly more understandable code.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Reviewed-by: Eric Engestrom
Signed-off-by: Emil Velikov
(cherry picked from commit 559c32d2412b2ea602bb59aa61da75403d01a872)
---
bin/get-pick-list.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 9e9a39e494b..ba741cc4114 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -32,7 +32,7 @@ do
continue
fi
- git log -n1 --pretty=oneline $sha | cat
+ git --no-pager show --summary --oneline $sha
done
rm -f already_picked
From fc99358bdc57494c91ffe26dbd224747f648b1aa Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:14 +0000
Subject: [PATCH 042/220] bin/get-pick-list.sh: prefix output with "[stable] "
With later commits we'll fold all the different scripts into one.
Add the explicit prefix, so that we know the origin of the nomination
v2:
- pass the sha as argument to the function
- swap $tag = none for an else statment (Juan)
- grep -q instead of using a variable (Eric)
- print the tag and commit oneline separately (Eric)
v3:
- drop unused "tag=none" assignment (Juan)
- typo nomination
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Reviewed-by: Eric Engestrom (v2)
Signed-off-by: Emil Velikov
(cherry picked from commit fac10169bbad2da918ef07a62c01e0b321508cfe)
---
bin/get-pick-list.sh | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index ba741cc4114..2c7d87db0c6 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -7,6 +7,14 @@
# $ bin/get-pick-list.sh
# $ bin/get-pick-list.sh > picklist
# $ bin/get-pick-list.sh | tee picklist
+#
+# The output is as follows:
+# [nomination_type] commit_sha commit summary
+
+is_stable_nomination()
+{
+ git show --summary "$1" | grep -q -i -o "CC:.*mesa-stable"
+}
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
@@ -32,6 +40,13 @@ do
continue
fi
+ if is_stable_nomination "$sha"; then
+ tag=stable
+ else
+ continue
+ fi
+
+ printf "[ %8s ] " "$tag"
git --no-pager show --summary --oneline $sha
done
From 98c0d87acd655314761c1ea607c19fb39fe4acfc Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:15 +0000
Subject: [PATCH 043/220] bin/get-pick-list.sh: handle "typod" usecase.
As the comment in get-typod-pick-list.sh says, there's little point in
having a duplicate file.
Add the new pattern + tag to get-pick-list.sh and nuke this file.
v2:
- pass the sha as argument to the function
- grep -q instead of using a variable (Eric)
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Reviewed-by: Eric Engestrom
Signed-off-by: Emil Velikov
(cherry picked from commit e6b3a3b2014413366110f6deeced8095e7262b1d)
---
bin/get-pick-list.sh | 9 +++++++-
bin/get-typod-pick-list.sh | 42 --------------------------------------
2 files changed, 8 insertions(+), 43 deletions(-)
delete mode 100755 bin/get-typod-pick-list.sh
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 2c7d87db0c6..2476b593f14 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -16,6 +16,11 @@ is_stable_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-stable"
}
+is_typod_nomination()
+{
+ git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
+}
+
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
@@ -25,7 +30,7 @@ git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable' $latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev' $latest_branchpoint..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
@@ -42,6 +47,8 @@ do
if is_stable_nomination "$sha"; then
tag=stable
+ elif is_typod_nomination "$sha"; then
+ tag=typod
else
continue
fi
diff --git a/bin/get-typod-pick-list.sh b/bin/get-typod-pick-list.sh
deleted file mode 100755
index eb4181d66b8..00000000000
--- a/bin/get-typod-pick-list.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# Script for generating a list of candidates which have typos in the nomination line
-#
-# Usage examples:
-#
-# $ bin/get-typod-pick-list.sh
-# $ bin/get-typod-pick-list.sh > picklist
-# $ bin/get-typod-pick-list.sh | tee picklist
-
-# NB:
-# This script intentionally _never_ checks for specific version tag
-# Should we consider folding it with the original get-pick-list.sh
-
-# Use the last branchpoint as our limit for the search
-latest_branchpoint=`git merge-base origin/master HEAD`
-
-# Grep for commits with "cherry picked from commit" in the commit message.
-git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
- grep "cherry picked from commit" |\
- sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
-
-# Grep for commits that were marked as a candidate for the stable tree.
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-dev' $latest_branchpoint..origin/master |\
-while read sha
-do
- # Check to see whether the patch is on the ignore list.
- if [ -f bin/.cherry-ignore ] ; then
- if grep -q ^$sha bin/.cherry-ignore ; then
- continue
- fi
- fi
-
- # Check to see if it has already been picked over.
- if grep -q ^$sha already_picked ; then
- continue
- fi
-
- git log -n1 --pretty=oneline $sha | cat
-done
-
-rm -f already_picked
From 3853b9c14d25b6d770a14d078acf80210385e7fa Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:16 +0000
Subject: [PATCH 044/220] bin/get-pick-list.sh: handle the fixes tag
Having a separate script to handle the fixes tag, brings a number of
issues, so let's fold it in get-pick-list.sh.
v2:
- pass the sha as argument to the function
- Keep original sed pattern
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit 181203f3c5e9c6b3e95e0b93ad3b22630c3c0437)
---
bin/get-fixes-pick-list.sh | 81 --------------------------------------
bin/get-pick-list.sh | 46 ++++++++++++++++++++--
2 files changed, 43 insertions(+), 84 deletions(-)
delete mode 100755 bin/get-fixes-pick-list.sh
diff --git a/bin/get-fixes-pick-list.sh b/bin/get-fixes-pick-list.sh
deleted file mode 100755
index 047ea3bec10..00000000000
--- a/bin/get-fixes-pick-list.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-# Script for generating a list of candidates [referenced by a Fixes tag] for
-# cherry-picking to a stable branch
-#
-# Usage examples:
-#
-# $ bin/get-fixes-pick-list.sh
-# $ bin/get-fixes-pick-list.sh > picklist
-# $ bin/get-fixes-pick-list.sh | tee picklist
-
-# Use the last branchpoint as our limit for the search
-latest_branchpoint=`git merge-base origin/master HEAD`
-
-# List all the commits between day 1 and the branch point...
-git log --reverse --pretty=%H $latest_branchpoint > already_landed
-
-# ... and the ones cherry-picked.
-git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
- grep "cherry picked from commit" |\
- sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
-
-# Grep for commits with Fixes tag
-git log --reverse --pretty=%H -i --grep="fixes:" $latest_branchpoint..origin/master |\
-while read sha
-do
- # Check to see whether the patch is on the ignore list ...
- if [ -f bin/.cherry-ignore ] ; then
- if grep -q ^$sha bin/.cherry-ignore ; then
- continue
- fi
- fi
-
- # Skip if it has been already cherry-picked.
- if grep -q ^$sha already_picked ; then
- continue
- fi
-
- # Place every "fixes:" tag on its own line and join with the next word
- # on its line or a later one.
- fixes=`git show --pretty=medium -s $sha | tr -d "\n" | sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
-
- # For each one try to extract the tag
- fixes_count=`echo "$fixes" | wc -l`
- warn=`(test $fixes_count -gt 1 && echo $fixes_count) || echo 0`
- while [ $fixes_count -gt 0 ] ; do
- # Treat only the current line
- id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : -f 2`
- fixes_count=$(($fixes_count-1))
-
- # Bail out if we cannot find suitable id.
- # Any specific validation the $id is valid and not some junk, is
- # implied with the follow up code
- if [ "x$id" = x ] ; then
- continue
- fi
-
- # Check if the offending commit is in branch.
-
- # Be that cherry-picked ...
- # ... or landed before the branchpoint.
- if grep -q ^$id already_picked ||
- grep -q ^$id already_landed ; then
-
- printf "Commit \"%s\" fixes %s\n" \
- "`git log -n1 --pretty=oneline $sha`" \
- "$id"
- warn=$(($warn-1))
- fi
-
- done
-
- if [ $warn -gt 0 ] ; then
- printf "WARNING: Commit \"%s\" has more than one Fixes tag\n" \
- "`git log -n1 --pretty=oneline $sha`"
- fi
-
-done
-
-rm -f already_picked
-rm -f already_landed
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 2476b593f14..c1f2bf11ca5 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -21,16 +21,53 @@ is_typod_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
}
+is_fixes_nomination()
+{
+ fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
+ sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
+ grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+
+ fixes_count=`echo "$fixes" | wc -l`
+ if [ $fixes_count -eq 0 ] ; then
+ return 0
+ fi
+ while [ $fixes_count -gt 0 ] ; do
+ # Treat only the current line
+ id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : -f 2`
+ fixes_count=$(($fixes_count-1))
+
+ # Bail out if we cannot find suitable id.
+ # Any specific validation the $id is valid and not some junk, is
+ # implied with the follow up code
+ if [ "x$id" = x ] ; then
+ continue
+ fi
+
+ #Check if the offending commit is in branch.
+
+ # Be that cherry-picked ...
+ # ... or landed before the branchpoint.
+ if grep -q ^$id already_picked ||
+ grep -q ^$id already_landed ; then
+ return 0
+ fi
+ done
+ return 1
+}
+
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
-# Grep for commits with "cherry picked from commit" in the commit message.
+# List all the commits between day 1 and the branch point...
+git log --reverse --pretty=%H $latest_branchpoint > already_landed
+
+# ... and the ones cherry-picked.
git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
grep "cherry picked from commit" |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
-# Grep for commits that were marked as a candidate for the stable tree.
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev' $latest_branchpoint..origin/master |\
+# Grep for potential candidates
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|fixes:' $latest_branchpoint..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
@@ -49,6 +86,8 @@ do
tag=stable
elif is_typod_nomination "$sha"; then
tag=typod
+ elif is_fixes_nomination "$sha"; then
+ tag=fixes
else
continue
fi
@@ -58,3 +97,4 @@ do
done
rm -f already_picked
+rm -f already_landed
From cfd333c7686ba955b6b0d47d063279a338866d7b Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:17 +0000
Subject: [PATCH 045/220] bin/get-pick-list.sh: tweak the commit sha matching
pattern
Currently we match on:
- any arbitrary length of,
- any a-z A-Z and 0-9 characters
At the same time, a commit sha consists of lowercase hexadecimal
numbers. Any sha shorter than 8 characters is ambiguous - in some cases
even 11+ are required.
So change the pattern to a-f0-9 and adjust the length to 8-40.
As we're here we could use a single grep, instead of the grep/sed combo.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit 533fead4236459c3f04700ff130ffaee1503cb69)
---
bin/get-pick-list.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index c1f2bf11ca5..05dd3820e12 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -25,7 +25,7 @@ is_fixes_nomination()
{
fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
- grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+ grep -Eo 'fixes:[a-f0-9]{8,40}'`
fixes_count=`echo "$fixes" | wc -l`
if [ $fixes_count -eq 0 ] ; then
From 8b5ce5fa709ec70fa35b4b51f0d7a18a05898f7d Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:18 +0000
Subject: [PATCH 046/220] bin/get-pick-list.sh: flesh out is_sha_nomination
Refactor is_fixes_nomination into a is_sha_nomination helper. This way
we can reuse it for more than the usual "Fixes:" tag.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit b7418d1f3f102aeed8d3d38195f9b7d672216df0)
---
bin/get-pick-list.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 05dd3820e12..c456fdb3b81 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -21,10 +21,12 @@ is_typod_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
}
-is_fixes_nomination()
+# Helper to handle various mistypos of the fixes tag.
+# The tag string itself is passed as argument and normalised within.
+is_sha_nomination()
{
fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
- sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
+ sed -e 's/'"$2"'/\nfixes:/Ig' | \
grep -Eo 'fixes:[a-f0-9]{8,40}'`
fixes_count=`echo "$fixes" | wc -l`
@@ -55,6 +57,11 @@ is_fixes_nomination()
return 1
}
+is_fixes_nomination()
+{
+ is_sha_nomination "$1" "fixes:[[:space:]]*"
+}
+
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
From 4505df167696c2b535c7e5d6582351741b5638ea Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:19 +0000
Subject: [PATCH 047/220] bin/get-pick-list.sh: handle fixes tag with missing
colon
Every so often, we forget to add the colon after "fixes". Trivially
tweak the script to catch it.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit 209525aafb8314f827838dedeb771b72c256a4d3)
---
bin/get-pick-list.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index c456fdb3b81..d327c61d254 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -60,6 +60,10 @@ is_sha_nomination()
is_fixes_nomination()
{
is_sha_nomination "$1" "fixes:[[:space:]]*"
+ if test $? -eq 0; then
+ return 0
+ fi
+ is_sha_nomination "$1" "fixes[[:space:]]\+"
}
# Use the last branchpoint as our limit for the search
@@ -74,7 +78,7 @@ git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for potential candidates
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|fixes:' $latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\' $latest_branchpoint..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
From c8fef27cd37c0d4f09275fda12d0ab9882ec68fe Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:20 +0000
Subject: [PATCH 048/220] bin/get-pick-list.sh: handle unofficial "broken by"
tag
We have a number of cases were devs will use a tag "broken by".
While it's not something officially documented or recommended, checking
for it is trivial enough.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit 77ff0bfb5f915bb841623ec181ee359a099f2c52)
---
bin/get-pick-list.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index d327c61d254..a540cedfbd0 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -66,6 +66,11 @@ is_fixes_nomination()
is_sha_nomination "$1" "fixes[[:space:]]\+"
}
+is_brokenby_nomination()
+{
+ is_sha_nomination "$1" "broken by"
+}
+
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
@@ -78,7 +83,7 @@ git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for potential candidates
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\' $latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\\|\' $latest_branchpoint..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
@@ -99,6 +104,8 @@ do
tag=typod
elif is_fixes_nomination "$sha"; then
tag=fixes
+ elif is_brokenby_nomination "$sha"; then
+ tag=brokenby
else
continue
fi
From 221a8e3366dcaef54c4773fbbbc9e2caa786d5b9 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 8 Nov 2018 15:05:21 +0000
Subject: [PATCH 049/220] bin/get-pick-list.sh: use test instead of [ ]
Latter is rather picky wrt surrounding white space. The explicit `test`
doesn't have that problem, plus the statements read a bit easier.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit c0012a07088e86f6d30405d0522a0d72801e2ec7)
---
bin/get-pick-list.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index a540cedfbd0..e7fffdd1280 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -30,10 +30,10 @@ is_sha_nomination()
grep -Eo 'fixes:[a-f0-9]{8,40}'`
fixes_count=`echo "$fixes" | wc -l`
- if [ $fixes_count -eq 0 ] ; then
+ if test $fixes_count -eq 0; then
return 0
fi
- while [ $fixes_count -gt 0 ] ; do
+ while test $fixes_count -gt 0; do
# Treat only the current line
id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : -f 2`
fixes_count=$(($fixes_count-1))
@@ -41,7 +41,7 @@ is_sha_nomination()
# Bail out if we cannot find suitable id.
# Any specific validation the $id is valid and not some junk, is
# implied with the follow up code
- if [ "x$id" = x ] ; then
+ if test "x$id" = x; then
continue
fi
@@ -87,7 +87,7 @@ git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\
Date: Wed, 14 Nov 2018 18:49:54 +0000
Subject: [PATCH 050/220] bin/get-pick-list.sh: handle reverts prior to the
branchpoint
Currently we detect when a breaking commit:
- has landed in stable, and
- is referenced by a untagged fix in master
Yet we did not consider the case of breaking commit:
- prior to the branchpoint, and
- is referenced by a untagged fix in master
Addressing the latter is extremely slow, due to the size of the lookup.
That said, we can trivially use the existing is_sha_nomination() helper
to catch reverts.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez
Signed-off-by: Emil Velikov
(cherry picked from commit adbdfc6666052d604a97009d736b6dee957908a0)
---
bin/get-pick-list.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index e7fffdd1280..9f9cbc44026 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -71,6 +71,11 @@ is_brokenby_nomination()
is_sha_nomination "$1" "broken by"
}
+is_revert_nomination()
+{
+ is_sha_nomination "$1" "This reverts commit "
+}
+
# Use the last branchpoint as our limit for the search
latest_branchpoint=`git merge-base origin/master HEAD`
@@ -83,7 +88,7 @@ git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for potential candidates
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\\|\' $latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\\|\\|This reverts commit' $latest_branchpoint..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
@@ -106,6 +111,8 @@ do
tag=fixes
elif is_brokenby_nomination "$sha"; then
tag=brokenby
+ elif is_revert_nomination "$sha"; then
+ tag=revert
else
continue
fi
From 971ce9f854893c4fb6aabb3e60912332ba61edc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Tue, 13 Nov 2018 18:37:39 -0500
Subject: [PATCH 051/220] radeonsi: fix video APIs on Raven2
This was missed when I added the new enum.
Cc: 18.3
Reviewed-by: Bas Nieuwenhuizen
Reviewed-by: Leo Liu
(cherry picked from commit 9367514524f70faad99c721bac92339c8ff8bad9)
---
src/gallium/drivers/radeonsi/si_get.c | 9 ++++++---
src/gallium/drivers/radeonsi/si_uvd.c | 3 ++-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index b440230d227..91f38329d59 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -580,10 +580,12 @@ static int si_get_video_param(struct pipe_screen *screen,
case PIPE_VIDEO_CAP_SUPPORTED:
return (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC &&
(si_vce_is_fw_version_supported(sscreen) ||
- sscreen->info.family == CHIP_RAVEN)) ||
+ sscreen->info.family == CHIP_RAVEN ||
+ sscreen->info.family == CHIP_RAVEN2)) ||
(profile == PIPE_VIDEO_PROFILE_HEVC_MAIN &&
(sscreen->info.family == CHIP_RAVEN ||
- si_radeon_uvd_enc_supported(sscreen)));
+ sscreen->info.family == CHIP_RAVEN2 ||
+ si_radeon_uvd_enc_supported(sscreen)));
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
@@ -631,7 +633,8 @@ static int si_get_video_param(struct pipe_screen *screen,
return profile == PIPE_VIDEO_PROFILE_HEVC_MAIN;
return false;
case PIPE_VIDEO_FORMAT_JPEG:
- if (sscreen->info.family == CHIP_RAVEN)
+ if (sscreen->info.family == CHIP_RAVEN ||
+ sscreen->info.family == CHIP_RAVEN2)
return true;
if (sscreen->info.family < CHIP_CARRIZO || sscreen->info.family >= CHIP_VEGA10)
return false;
diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c
index 1a9d8f8d9fa..8c9553acbf3 100644
--- a/src/gallium/drivers/radeonsi/si_uvd.c
+++ b/src/gallium/drivers/radeonsi/si_uvd.c
@@ -146,7 +146,8 @@ struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
const struct pipe_video_codec *templ)
{
struct si_context *ctx = (struct si_context *)context;
- bool vcn = (ctx->family == CHIP_RAVEN) ? true : false;
+ bool vcn = ctx->family == CHIP_RAVEN ||
+ ctx->family == CHIP_RAVEN2;
if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
if (vcn) {
From a57a727617affa30ae92d11869f493825099103f Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Wed, 14 Nov 2018 12:51:38 +0000
Subject: [PATCH 052/220] egl: add missing glvnd entrypoint for
EGL_ANDROID_blob_cache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes dEQP-EGL.functional.get_proc_address.extension.egl_android_blob_cache
on builds with glvnd enabled.
Fixes: 6f5b57093b3462a54e9c7 "egl: add support for EGL_ANDROID_blob_cache"
Signed-off-by: Eric Engestrom
Reviewed-by: Tapani Pälli
Reviewed-by: Emil Velikov
(cherry picked from commit c9733649670243a1a6eb7ca2c376bd27960f8d8a)
Squashed with commit:
egl: fix bad rebase
I screwed up a rebase over a refactor and didn't notice locally because
the uncommitted refactor hid the issue.
Fixes: c9733649670243a1a6eb "egl: add missing glvnd entrypoint for EGL_ANDROID_blob_cache"
Signed-off-by: Eric Engestrom
(cherry picked from commit 2b2f790e594cde3aa0d4dcebafc9a072651cd62a)
---
src/egl/generate/eglFunctionList.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/egl/generate/eglFunctionList.py b/src/egl/generate/eglFunctionList.py
index 667704eb2cb..2cd35557bc4 100644
--- a/src/egl/generate/eglFunctionList.py
+++ b/src/egl/generate/eglFunctionList.py
@@ -196,6 +196,9 @@ def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dis
# EGL_ANDROID_native_fence_sync
_eglFunc("eglDupNativeFenceFDANDROID", "display"),
+ # EGL_ANDROID_blob_cache
+ _eglFunc("eglSetBlobCacheFuncsANDROID", "display"),
+
# EGL_EXT_image_dma_buf_import_modifiers
_eglFunc("eglQueryDmaBufFormatsEXT", "display"),
_eglFunc("eglQueryDmaBufModifiersEXT", "display"),
From 087f1534ae5bcfb9e4aa736e6c559ab4b768527a Mon Sep 17 00:00:00 2001
From: Jason Ekstrand
Date: Tue, 13 Nov 2018 13:24:34 -0600
Subject: [PATCH 053/220] nir/lower_alu_to_scalar: Don't try to lower
unpack_32_2x16
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It messes up when trying to lower.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez
(cherry picked from commit 4266932c0b301005dcc747fb6c2fef36a3af6ffe)
---
src/compiler/nir/nir_lower_alu_to_scalar.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/nir/nir_lower_alu_to_scalar.c b/src/compiler/nir/nir_lower_alu_to_scalar.c
index 0be3aba9456..7ef032cd164 100644
--- a/src/compiler/nir/nir_lower_alu_to_scalar.c
+++ b/src/compiler/nir/nir_lower_alu_to_scalar.c
@@ -194,6 +194,7 @@ lower_alu_instr_scalar(nir_alu_instr *instr, nir_builder *b)
}
case nir_op_unpack_64_2x32:
+ case nir_op_unpack_32_2x16:
return false;
LOWER_REDUCTION(nir_op_fdot, nir_op_fmul, nir_op_fadd);
From 0b48c82ad9c04fe263393cc38692fe1aaefbede7 Mon Sep 17 00:00:00 2001
From: Danylo Piliaiev
Date: Thu, 15 Nov 2018 12:03:31 +0200
Subject: [PATCH 054/220] i965: Fix calculation of layers array length for
isl_view
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Handle all cases in calculation of layers count for isl_view
taking into account texture view and image unit.
st_convert_image was taken as a reference.
When u->Layered is true the whole level is taken with respect to
image view. In other case only one layer is taken.
v3: (Józef Kucia and Ilia Mirkin)
- Rewrote patch by taking st_convert_image as a reference
- Removed now unused get_image_num_layers function
- Changed commit message
v4: (Jason Ekstrand)
- Added assert
Fixes: 5a8c8903
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856
Signed-off-by: Danylo Piliaiev
Reviewed-by: Jason Ekstrand
(cherry picked from commit f9fd0cf4790cb2a530e75d1a2206dbb9d8af7cb2)
---
.../drivers/dri/i965/brw_wm_surface_state.c | 33 ++++++++++---------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 8d21cf5fa70..3286c222e5b 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1499,18 +1499,6 @@ update_buffer_image_param(struct brw_context *brw,
param->stride[0] = _mesa_get_format_bytes(u->_ActualFormat);
}
-static unsigned
-get_image_num_layers(const struct intel_mipmap_tree *mt, GLenum target,
- unsigned level)
-{
- if (target == GL_TEXTURE_CUBE_MAP)
- return 6;
-
- return target == GL_TEXTURE_3D ?
- minify(mt->surf.logical_level0_px.depth, level) :
- mt->surf.logical_level0_px.array_len;
-}
-
static void
update_image_surface(struct brw_context *brw,
struct gl_image_unit *u,
@@ -1541,14 +1529,29 @@ update_image_surface(struct brw_context *brw,
} else {
struct intel_texture_object *intel_obj = intel_texture_object(obj);
struct intel_mipmap_tree *mt = intel_obj->mt;
- const unsigned num_layers = u->Layered ?
- get_image_num_layers(mt, obj->Target, u->Level) : 1;
+
+ unsigned base_layer, num_layers;
+ if (u->Layered) {
+ if (obj->Target == GL_TEXTURE_3D) {
+ base_layer = 0;
+ num_layers = minify(mt->surf.logical_level0_px.depth, u->Level);
+ } else {
+ assert(obj->Immutable || obj->MinLayer == 0);
+ base_layer = obj->MinLayer;
+ num_layers = obj->Immutable ?
+ obj->NumLayers :
+ mt->surf.logical_level0_px.array_len;
+ }
+ } else {
+ base_layer = obj->MinLayer + u->_Layer;
+ num_layers = 1;
+ }
struct isl_view view = {
.format = format,
.base_level = obj->MinLevel + u->Level,
.levels = 1,
- .base_array_layer = obj->MinLayer + u->_Layer,
+ .base_array_layer = base_layer,
.array_len = num_layers,
.swizzle = ISL_SWIZZLE_IDENTITY,
.usage = ISL_SURF_USAGE_STORAGE_BIT,
From f25fb52eae78ff3b29edba5c0a18db366c5ab0e8 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Thu, 25 Oct 2018 09:12:50 -0700
Subject: [PATCH 055/220] vc4: Make sure we make ro scanout resources for
create_with_modifiers.
The DRI3 create_with_modifiers paths don't set tmpl.bind to SCANOUT or
SHARED, with the theory that given that you've got modifiers, that's all
you need. However, we were looking at the tmpl.bind for setting up the
KMS handle in the renderonly case, so we'd end up trying to use vc4's
handle on the hx8357d fd.
Fixes: 84ed8b67c56b ("vc4: Set shareable BOs as T tiled if possible")
(cherry picked from commit cc0bc76a382f908b4412ee8ab7a8409766ecf16a)
---
src/gallium/drivers/vc4/vc4_resource.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index 94784bbdc0a..41e6ec5c1cb 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -572,7 +572,15 @@ vc4_resource_create_with_modifiers(struct pipe_screen *pscreen,
goto fail;
}
- if (screen->ro && tmpl->bind & PIPE_BIND_SCANOUT) {
+ /* Set up the "scanout resource" (the dmabuf export of our buffer to
+ * the KMS handle) if the buffer might ever have
+ * resource_get_handle(WINSYS_HANDLE_TYPE_KMS) called on it.
+ * create_with_modifiers() doesn't give us usage flags, so we have to
+ * assume that all calls with modifiers are scanout-possible.
+ */
+ if (screen->ro &&
+ ((tmpl->bind & PIPE_BIND_SCANOUT) ||
+ !(count == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID))) {
rsc->scanout =
renderonly_scanout_for_resource(prsc, screen->ro, NULL);
if (!rsc->scanout)
From 65926d5d949a00954917d2c2f715f27960907a8b Mon Sep 17 00:00:00 2001
From: Connor Abbott
Date: Wed, 17 Oct 2018 16:57:01 +0200
Subject: [PATCH 056/220] Revert "radv: disable VK_SUBGROUP_FEATURE_VOTE_BIT"
This reverts commit 647c2b90e96a9ab8571baf958a7c67c1e816911a. There was
one recently-introduced bug in ac for dvec3 loads, but the other test
failures were actually bugs in the tests. See
https://github.com/KhronosGroup/VK-GL-CTS/commit/9429e621c48848d224e35f30a1ae45a4a079922c
Reviewed-by: Bas Nieuwenhuizen
(cherry picked from commit ba94a00c7ce1514372bfe9b35c8e0c7fb8cd710e)
---
src/amd/vulkan/radv_device.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 92254bed2e1..957d6ac9bad 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1054,13 +1054,11 @@ void radv_GetPhysicalDeviceProperties2(
(VkPhysicalDeviceSubgroupProperties*)ext;
properties->subgroupSize = 64;
properties->supportedStages = VK_SHADER_STAGE_ALL;
- /* TODO: Enable VK_SUBGROUP_FEATURE_VOTE_BIT when wwm
- * is fixed in LLVM.
- */
properties->supportedOperations =
VK_SUBGROUP_FEATURE_BASIC_BIT |
VK_SUBGROUP_FEATURE_BALLOT_BIT |
- VK_SUBGROUP_FEATURE_QUAD_BIT;
+ VK_SUBGROUP_FEATURE_QUAD_BIT |
+ VK_SUBGROUP_FEATURE_VOTE_BIT;
if (pdevice->rad_info.chip_class >= VI) {
properties->supportedOperations |=
VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
From 4b3f884673ac8a0d88593f207be8cd94392338be Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 16 Nov 2018 11:58:55 +0000
Subject: [PATCH 057/220] Update version to 18.3.0-rc3
Signed-off-by: Emil Velikov
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index 9bdced0d72e..bd71fb7fc65 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.3.0-rc2
+18.3.0-rc3
From 2e393b483d7d0007d3e8d1771a52f41aeea0a704 Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin
Date: Tue, 13 Nov 2018 14:10:45 +0000
Subject: [PATCH 058/220] egl/dri: fix error value with unknown drm format
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
According to the EGL_EXT_image_dma_buf_import spec, creating an EGL
image with a DRM format not supported should yield the BAD_MATCH
error :
"
* If is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
attribute is set to a format not supported by the EGL, EGL_BAD_MATCH
is generated.
"
Signed-off-by: Lionel Landwerlin
Fixes: 20de7f9f226401 ("egl/dri2: support for creating images out of dma buffers")
Reviewed-by: Emil Velikov
Reviewed-by: Tapani Pälli
Reviewed-by: Eric Engestrom
Reviewed-by: Chad Versace
(cherry picked from commit 1c56d211563300e8b837378962dd455d45d7956e)
---
src/egl/drivers/dri2/egl_dri2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 87e1a704c6e..4f226b27126 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2309,7 +2309,7 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
{
unsigned plane_n = dri2_num_fourcc_format_planes(attrs->DMABufFourCC.Value);
if (plane_n == 0) {
- _eglError(EGL_BAD_ATTRIBUTE, "invalid format");
+ _eglError(EGL_BAD_MATCH, "unknown drm fourcc format");
return 0;
}
From e299f1ba5964cc68a4a542422941f7648ca4e6d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?=
Date: Fri, 16 Nov 2018 17:20:26 +0100
Subject: [PATCH 059/220] radeonsi: fix an out-of-bounds read reported by ASAN
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We read 4 values out of sample_locs_8x, so make sure the array is
big enough.
Fixes: ac76aeef20 ("radeonsi: switch back to standard DX sample positions")
Reviewed-by: Marek Olšák
(cherry picked from commit 46a59ce0262a44d6520787741085a716c99200ed)
---
src/gallium/drivers/radeonsi/si_state_msaa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gallium/drivers/radeonsi/si_state_msaa.c b/src/gallium/drivers/radeonsi/si_state_msaa.c
index b741bcadec8..e6d97fe6727 100644
--- a/src/gallium/drivers/radeonsi/si_state_msaa.c
+++ b/src/gallium/drivers/radeonsi/si_state_msaa.c
@@ -101,6 +101,10 @@ static const uint64_t centroid_priority_4x = 0x3210321032103210ull;
static const uint32_t sample_locs_8x[] = {
FILL_SREG(-3,-5, 5, 1, -1, 3, 7,-7),
FILL_SREG(-7,-1, 3, 7, -5, 5, 1,-3),
+ /* The following are unused by hardware, but we emit them to IBs
+ * instead of multiple SET_CONTEXT_REG packets. */
+ 0,
+ 0,
};
static const uint64_t centroid_priority_8x = 0x3546012735460127ull;
From d7795a8431b133f04744c4e0fdbec804b61b8877 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 16 Nov 2018 11:10:57 +0000
Subject: [PATCH 060/220] travis: drop unneeded x11proto-xf86vidmode-dev
The only place where the package is needed is for building the DRI
based libGL library.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov
Acked-by: Dylan Baker
Acked-by: Eric Engestrom
(cherry picked from commit 84445a86d192c0d7f07bc25a84080458de764149)
---
.travis.yml | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 8d6ddb2f201..81ac7696050 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -120,7 +120,6 @@ matrix:
- llvm-6.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -150,7 +149,6 @@ matrix:
- llvm-6.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -183,7 +181,6 @@ matrix:
- llvm-3.9-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -222,7 +219,6 @@ matrix:
- libclang-3.9-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -258,7 +254,6 @@ matrix:
- libclang-4.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -294,7 +289,6 @@ matrix:
- libclang-5.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -327,7 +321,6 @@ matrix:
- libclang-6.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -361,7 +354,6 @@ matrix:
- libclang-7-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -397,7 +389,6 @@ matrix:
- libedit-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
@@ -427,7 +418,6 @@ matrix:
- llvm-6.0-dev
# Common
- xz-utils
- - x11proto-xf86vidmode-dev
- libexpat1-dev
- libx11-xcb-dev
- libelf-dev
From 200004fe0312580cf5e678affe97926a65595c2b Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 16 Nov 2018 11:15:37 +0000
Subject: [PATCH 061/220] glx: make xf86vidmode mandatory for direct rendering
Currently we detect the module and if missing, the glXGetMsc* API is
effectively a stub, always returning false.
This is what effectively has been happening with our meson build :-(
Thus users have no chance of using it - they cannot even distinguish
if the failure is due to a misconfigured build.
There's no reason for keeping xf86vidmode optional - it has been
available in all distributions for years.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov
Acked-by: Dylan Baker
Reviewed-by: Eric Engestrom
Fixes: a47c525f3281a2753180e "meson: build glx"
(cherry picked from commit 5bc509363b6dbc42af72668fe500b6aec988dbf0)
---
configure.ac | 12 +-----------
meson.build | 6 ++----
src/glx/Makefile.am | 5 -----
src/glx/SConscript | 5 +----
src/glx/glxcmds.c | 7 +------
src/glx/meson.build | 6 +-----
6 files changed, 6 insertions(+), 35 deletions(-)
diff --git a/configure.ac b/configure.ac
index d782f56205d..a3d10cf40e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1725,11 +1725,7 @@ xdri)
fi
fi
- # add xf86vidmode if available
- PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
- if test "$HAVE_XF86VIDMODE" = yes ; then
- dri_modules="$dri_modules xxf86vm"
- fi
+ dri_modules="$dri_modules xxf86vm"
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
@@ -1742,10 +1738,6 @@ xdri)
;;
esac
-# This is outside the case (above) so that it is invoked even for non-GLX
-# builds.
-AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
-
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
@@ -1762,8 +1754,6 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
-AC_SUBST([HAVE_XF86VIDMODE])
-
dnl
dnl More GLX setup
dnl
diff --git a/meson.build b/meson.build
index 1b475877827..33f4e5ad3cf 100644
--- a/meson.build
+++ b/meson.build
@@ -1350,7 +1350,7 @@ if with_platform_x11
dep_xdamage = dependency('xdamage', version : '>= 1.1')
dep_xfixes = dependency('xfixes')
dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
- dep_xxf86vm = dependency('xxf86vm', required : false)
+ dep_xxf86vm = dependency('xxf86vm')
endif
if (with_any_vk or with_glx == 'dri' or
(with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or
@@ -1428,13 +1428,11 @@ elif with_glx == 'dri'
if with_dri_platform == 'drm'
gl_priv_reqs += 'xcb-dri2 >= 1.8'
endif
+ gl_priv_reqs += 'xxf86vm'
endif
if dep_libdrm.found()
gl_priv_reqs += 'libdrm >= 2.4.75'
endif
-if dep_xxf86vm.found()
- gl_priv_reqs += 'xxf86vm'
-endif
gl_priv_libs = []
if dep_thread.found()
diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index 8f9d80c9f41..d06ae2972e9 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -24,10 +24,6 @@ SUBDIRS =
EXTRA_DIST = SConscript meson.build
-if HAVE_XF86VIDMODE
-EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
-endif
-
AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/GL/internal \
@@ -38,7 +34,6 @@ AM_CFLAGS = \
-I$(top_builddir)/src/mapi/glapi \
-I$(top_srcdir)/src/mapi/glapi \
$(VISIBILITY_CFLAGS) \
- $(EXTRA_DEFINES_XF86VIDMODE) \
-D_REENTRANT \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
$(DEFINES) \
diff --git a/src/glx/SConscript b/src/glx/SConscript
index 8ce17715814..051f55b7669 100644
--- a/src/glx/SConscript
+++ b/src/glx/SConscript
@@ -36,10 +36,7 @@ env.Prepend(LIBS = [
env.PkgUseModules('X11')
env.PkgUseModules('XCB')
env.PkgUseModules('DRM')
-
-if env['HAVE_XF86VIDMODE']:
- env.Append(CPPDEFINES = ['XF86VIDMODE'])
- env.PkgUseModules('XF86VIDMODE')
+env.PkgUseModules('XF86VIDMODE')
sources = [
'clientattrib.c',
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 4db0228eaba..79e3503be8f 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -46,11 +46,9 @@
#include "util/debug.h"
#else
#include
-#ifdef XF86VIDMODE
#include
#endif
#endif
-#endif
#include
#include
@@ -2071,7 +2069,6 @@ _X_HIDDEN GLboolean
__glxGetMscRate(struct glx_screen *psc,
int32_t * numerator, int32_t * denominator)
{
-#ifdef XF86VIDMODE
XF86VidModeModeLine mode_line;
int dot_clock;
int i;
@@ -2118,8 +2115,6 @@ __glxGetMscRate(struct glx_screen *psc,
return True;
}
- else
-#endif
return False;
}
@@ -2145,7 +2140,7 @@ _X_HIDDEN GLboolean
__glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
int32_t * numerator, int32_t * denominator)
{
-#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
+#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
__GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable);
if (draw == NULL)
diff --git a/src/glx/meson.build b/src/glx/meson.build
index dd8ba60ad80..f3bbcb433ad 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -137,10 +137,6 @@ gl_lib_cargs = [
'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
]
-if dep_xxf86vm.found()
- gl_lib_cargs += '-DHAVE_XF86VIDMODE'
-endif
-
libglx = static_library(
'glx',
[files_libglx, glx_generated],
@@ -167,7 +163,7 @@ if with_glx == 'dri'
link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl],
dependencies : [
dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb,
- dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage,
+ dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm,
extra_deps_libgl,
],
version : gl_lib_version,
From 1869f3f6af6776da675c19ea295326c06a05c58e Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 7 Sep 2018 14:58:56 +0100
Subject: [PATCH 062/220] travis: adding missing x11-xcb for meson+vulkan
Required by the x11 WSI
Fixes: df82012b2cb ("travis: add meson build for vulkan drivers.")
Signed-off-by: Emil Velikov
Reviewed-by: Dylan Baker
(cherry picked from commit 982e012b3ac924dab56b41c5407f722bd2a4c359)
---
.travis.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.travis.yml b/.travis.yml
index 81ac7696050..6b50d49e143 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -52,6 +52,7 @@ matrix:
# Common
- xz-utils
- libexpat1-dev
+ - libx11-xcb-dev
- libelf-dev
- python3.5
- python3-pip
From 8168ee771278436bb103a0a86394fd80cada7226 Mon Sep 17 00:00:00 2001
From: Andrii Simiklit
Date: Mon, 5 Nov 2018 09:48:26 +0200
Subject: [PATCH 063/220] i965/batch: avoid reverting batch buffer if saved
state is an empty
There's no point reverting to the last saved point if that save point is
the empty batch, we will just repeat ourselves.
v2: Merge with new commits, changes was minimized, added the 'fixes' tag
v3: Added in to patch series
v4: Fixed the regression which was introduced by this patch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630
Reported-by: Mark Janes
The solution provided by: Jordan Justen
CC: Chris Wilson
Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring
the batchbuffer state."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107626
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630 (fixed in v4)
Signed-off-by: Andrii Simiklit
Reviewed-by: Jordan Justen
Reviewed-by: Kenneth Graunke
(cherry picked from commit b787dcf57b7298868ce9b6885a827d57a6127ba1)
---
src/mesa/drivers/dri/i965/brw_compute.c | 3 ++-
src/mesa/drivers/dri/i965/brw_draw.c | 3 ++-
src/mesa/drivers/dri/i965/genX_blorp_exec.c | 1 +
src/mesa/drivers/dri/i965/intel_batchbuffer.c | 7 +++++++
src/mesa/drivers/dri/i965/intel_batchbuffer.h | 1 +
5 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_compute.c b/src/mesa/drivers/dri/i965/brw_compute.c
index de08fc3ac16..5c8e3a5d4de 100644
--- a/src/mesa/drivers/dri/i965/brw_compute.c
+++ b/src/mesa/drivers/dri/i965/brw_compute.c
@@ -167,7 +167,7 @@ static void
brw_dispatch_compute_common(struct gl_context *ctx)
{
struct brw_context *brw = brw_context(ctx);
- bool fail_next = false;
+ bool fail_next;
if (!_mesa_check_conditional_render(ctx))
return;
@@ -185,6 +185,7 @@ brw_dispatch_compute_common(struct gl_context *ctx)
intel_batchbuffer_require_space(brw, 600);
brw_require_statebuffer_space(brw, 2500);
intel_batchbuffer_save_state(brw);
+ fail_next = intel_batchbuffer_saved_state_is_empty(brw);
retry:
brw->batch.no_wrap = true;
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 8536c040109..19ee3962d74 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -885,7 +885,7 @@ brw_draw_single_prim(struct gl_context *ctx,
{
struct brw_context *brw = brw_context(ctx);
const struct gen_device_info *devinfo = &brw->screen->devinfo;
- bool fail_next = false;
+ bool fail_next;
/* Flag BRW_NEW_DRAW_CALL on every draw. This allows us to have
* atoms that happen on every draw call.
@@ -898,6 +898,7 @@ brw_draw_single_prim(struct gl_context *ctx,
intel_batchbuffer_require_space(brw, 1500);
brw_require_statebuffer_space(brw, 2400);
intel_batchbuffer_save_state(brw);
+ fail_next = intel_batchbuffer_saved_state_is_empty(brw);
if (brw->num_instances != prim->num_instances ||
brw->basevertex != prim->basevertex ||
diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
index 34bfcad03eb..a62b88e166c 100644
--- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
+++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
@@ -309,6 +309,7 @@ genX(blorp_exec)(struct blorp_batch *batch,
intel_batchbuffer_require_space(brw, 1400);
brw_require_statebuffer_space(brw, 600);
intel_batchbuffer_save_state(brw);
+ check_aperture_failed_once |= intel_batchbuffer_saved_state_is_empty(brw);
brw->batch.no_wrap = true;
#if GEN_GEN == 6
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 8b769eaf534..6207de5a06f 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -301,6 +301,13 @@ intel_batchbuffer_save_state(struct brw_context *brw)
brw->batch.saved.exec_count = brw->batch.exec_count;
}
+bool
+intel_batchbuffer_saved_state_is_empty(struct brw_context *brw)
+{
+ struct intel_batchbuffer *batch = &brw->batch;
+ return (batch->saved.map_next == batch->batch.map);
+}
+
void
intel_batchbuffer_reset_to_saved(struct brw_context *brw)
{
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
index 0632142cd31..91720dad5b4 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
@@ -24,6 +24,7 @@ struct intel_batchbuffer;
void intel_batchbuffer_init(struct brw_context *brw);
void intel_batchbuffer_free(struct intel_batchbuffer *batch);
void intel_batchbuffer_save_state(struct brw_context *brw);
+bool intel_batchbuffer_saved_state_is_empty(struct brw_context *brw);
void intel_batchbuffer_reset_to_saved(struct brw_context *brw);
void intel_batchbuffer_require_space(struct brw_context *brw, GLuint sz);
int _intel_batchbuffer_flush_fence(struct brw_context *brw,
From 3036ffa1a2300111a5808fc9b295488723176287 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Tue, 13 Nov 2018 16:19:42 -0500
Subject: [PATCH 064/220] radeonsi: go back to using bottom-of-pipe for
beginning of TIME_ELAPSED
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102597
Cc: 18.3
Tested-by: Dieter Nützel
Reviewed-by: Dave Airlie
(cherry picked from commit ea9f95e2a67eca90bb84eea24e7b4b804b3b1345)
---
src/gallium/drivers/radeonsi/si_query.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c
index 9b09c74d48a..7a2c7afdbfd 100644
--- a/src/gallium/drivers/radeonsi/si_query.c
+++ b/src/gallium/drivers/radeonsi/si_query.c
@@ -793,17 +793,10 @@ static void si_query_hw_do_emit_start(struct si_context *sctx,
emit_sample_streamout(cs, va + 32 * stream, stream);
break;
case PIPE_QUERY_TIME_ELAPSED:
- /* Write the timestamp from the CP not waiting for
- * outstanding draws (top-of-pipe).
- */
- radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
- radeon_emit(cs, COPY_DATA_COUNT_SEL |
- COPY_DATA_SRC_SEL(COPY_DATA_TIMESTAMP) |
- COPY_DATA_DST_SEL(COPY_DATA_DST_MEM));
- radeon_emit(cs, 0);
- radeon_emit(cs, 0);
- radeon_emit(cs, va);
- radeon_emit(cs, va >> 32);
+ si_cp_release_mem(sctx, V_028A90_BOTTOM_OF_PIPE_TS, 0,
+ EOP_DST_SEL_MEM, EOP_INT_SEL_NONE,
+ EOP_DATA_SEL_TIMESTAMP, NULL, va,
+ 0, query->b.type);
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 2, 0));
From 3dd73ab2483be6f1ca0ebf08c6a73ca1dea9aa4b Mon Sep 17 00:00:00 2001
From: Gert Wollny
Date: Fri, 16 Nov 2018 12:48:08 +0100
Subject: [PATCH 065/220] r600: clean up the GS ring buffers when the context
is destroyed
This fixes two memory leaks reported by ASAN:
Direct leak of 248 byte(s) in 1 object(s) allocated from:
in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
in r600_alloc_buffer_struct ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:578
in r600_buffer_create ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:600
in r600_resource_create_common ../../samba/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1265
in r600_resource_create ../../samba/mesa/src/gallium/drivers/r600/r600_pipe.c:725
in pipe_buffer_create ../../samba/mesa/src/gallium/auxiliary/util/u_inlines.h:291
in update_gs_block_state ../../samba/mesa/src/gallium/drivers/r600/r600_state_common.c:1482
Direct leak of 248 byte(s) in 1 object(s) allocated from:
in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
in r600_alloc_buffer_struct ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:578
in r600_buffer_create ../../samba/mesa/src/gallium/drivers/r600/r600_buffer_common.c:600
in r600_resource_create_common ../../samba/mesa/src/gallium/drivers/r600/r600_pipe_common.c:1265
in r600_resource_create ../../samba/mesa/src/gallium/drivers/r600/r600_pipe.c:722
in pipe_buffer_create ../../samba/mesa/src/gallium/auxiliary/util/u_inlines.h:291
in update_gs_block_state ../../samba/mesa/src/gallium/drivers/r600/r600_state_common.c:1489
Signed-off-by: Gert Wollny
Fixes: 1371d65a7fbd695d3516861fe733685569d890d0
r600g: initial support for geometry shaders on evergreen (v2)
Reviewed-by: Roland Scheidegger
(cherry picked from commit 61b535437e2ea1115d6915fbd62d9b8745071525)
---
src/gallium/drivers/r600/r600_pipe.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 2680396c3d6..41e83af1db1 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -105,6 +105,12 @@ static void r600_destroy_context(struct pipe_context *context)
}
util_unreference_framebuffer_state(&rctx->framebuffer.state);
+ if (rctx->gs_rings.gsvs_ring.buffer)
+ pipe_resource_reference(&rctx->gs_rings.gsvs_ring.buffer, NULL);
+
+ if (rctx->gs_rings.esgs_ring.buffer)
+ pipe_resource_reference(&rctx->gs_rings.esgs_ring.buffer, NULL);
+
for (sh = 0; sh < PIPE_SHADER_TYPES; ++sh)
for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; ++i)
rctx->b.b.set_constant_buffer(context, sh, i, NULL);
From 33f1569f02230b080a0a33414121fd95a7cbea6d Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 22 Nov 2018 12:58:48 +0000
Subject: [PATCH 066/220] Update version to 18.3.0-rc4
Signed-off-by: Emil Velikov
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index bd71fb7fc65..09c62b68556 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.3.0-rc3
+18.3.0-rc4
From b8502f15177b55b0fb28ca0a7f4c2fb058340586 Mon Sep 17 00:00:00 2001
From: Jason Ekstrand
Date: Wed, 21 Nov 2018 17:15:37 -0600
Subject: [PATCH 067/220] anv: Put robust buffer access in the pipeline hash
It affects apply_pipeline_layout. Shaders compiled with the wrong value
will work but they may not be robust as requested by the app.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga
(cherry picked from commit 617e402b3d1be185f200b1667540096d9a8b2aec)
---
src/intel/vulkan/anv_pipeline.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index ad0f08253e7..f170366d030 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -446,6 +446,9 @@ anv_pipeline_hash_graphics(struct anv_pipeline *pipeline,
if (layout)
_mesa_sha1_update(&ctx, layout->sha1, sizeof(layout->sha1));
+ const bool rba = pipeline->device->robust_buffer_access;
+ _mesa_sha1_update(&ctx, &rba, sizeof(rba));
+
for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
if (stages[s].entrypoint)
anv_pipeline_hash_shader(&ctx, &stages[s]);
@@ -466,6 +469,9 @@ anv_pipeline_hash_compute(struct anv_pipeline *pipeline,
if (layout)
_mesa_sha1_update(&ctx, layout->sha1, sizeof(layout->sha1));
+ const bool rba = pipeline->device->robust_buffer_access;
+ _mesa_sha1_update(&ctx, &rba, sizeof(rba));
+
anv_pipeline_hash_shader(&ctx, stage);
_mesa_sha1_final(&ctx, sha1_out);
From f7040d91078d8a903e3f81db44e48928ae44c6fa Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Thu, 22 Nov 2018 13:33:28 +0000
Subject: [PATCH 068/220] glapi: add missing visibility args
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108829
Fixes: 3218056e0eb375eeda470 "meson: Build i965 and dri stack"
Signed-off-by: Eric Engestrom
Reviewed-by: Emil Velikov
(cherry picked from commit 896c59d690e38e92682f9bc509b5e3658aba5670)
---
src/mapi/shared-glapi/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build
index dcc6079af3d..3f041471fb9 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -40,7 +40,7 @@ libglapi = shared_library(
'glapi',
[files_mapi_glapi, files_mapi_util, shared_glapi_mapi_tmp_h],
c_args : [
- c_msvc_compat_args, '-DMAPI_MODE_GLAPI',
+ c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_GLAPI',
'-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
],
link_args : [ld_args_gc_sections],
From a941399117c3706aeb31b11f28a3332d9fca83b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Mon, 19 Nov 2018 18:12:12 -0500
Subject: [PATCH 069/220] winsys/amdgpu: fix a buffer leak in
amdgpu_bo_from_handle
Cc: 18.2 18.3
Reviewed-by: Bas Nieuwenhuizen
(cherry picked from commit 82aa07f81fcc5ed696eea16f48cec7e39c3cd3d1)
---
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 68f0562a644..f108058052d 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -1310,6 +1310,12 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,
if (bo) {
p_atomic_inc(&bo->base.reference.count);
simple_mtx_unlock(&ws->bo_export_table_lock);
+
+ /* Release the buffer handle, because we don't need it anymore.
+ * This function is returning an existing buffer, which has its own
+ * handle.
+ */
+ amdgpu_bo_free(result.buf_handle);
return &bo->base;
}
From 825cb768602235a9bbe4d0597aba69830f4efe9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?=
Date: Mon, 19 Nov 2018 18:17:40 -0500
Subject: [PATCH 070/220] winsys/amdgpu: fix a device handle leak in
amdgpu_winsys_create
Cc: 18.2 18.3
Reviewed-by: Bas Nieuwenhuizen
(cherry picked from commit d4e7d8b7f053db081a4ffdb59dc53f3531b0e60b)
---
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index f32bbd9d086..b20d702670d 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -280,6 +280,12 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
if (ws) {
pipe_reference(NULL, &ws->reference);
simple_mtx_unlock(&dev_tab_mutex);
+
+ /* Release the device handle, because we don't need it anymore.
+ * This function is returning an existing winsys instance, which
+ * has its own device handle.
+ */
+ amdgpu_device_deinitialize(dev);
return &ws->base;
}
From 02566b97258d12a045f2de0b2d6ef7bf05ae1ceb Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen
Date: Sat, 24 Nov 2018 20:52:20 +0100
Subject: [PATCH 071/220] radv: Fix opaque metadata descriptor last layer.
We used the layer count which results in an off by one error.
Not sure this really affects anything.
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie
(cherry picked from commit 3c96a1e3a97ba89dad803e7be8f9e3d4f6516fa3)
---
src/amd/vulkan/radv_image.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 64346aa340f..a0fa0506350 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -691,7 +691,7 @@ radv_query_opaque_metadata(struct radv_device *device,
si_make_texture_descriptor(device, image, false,
(VkImageViewType)image->type, image->vk_format,
&fixedmapping, 0, image->info.levels - 1, 0,
- image->info.array_size,
+ image->info.array_size - 1,
image->info.width, image->info.height,
image->info.depth,
desc, NULL);
From 6b9b7ce38ca3ae7745ed6faf95f4a7b03843ebb4 Mon Sep 17 00:00:00 2001
From: Gert Wollny
Date: Fri, 16 Nov 2018 19:12:46 +0100
Subject: [PATCH 072/220] glsl: free or reuse memory allocated for TF varying
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When a shader program is de-serialized the gl_shader_program passed in
may actually still hold memory allocations for the transform feedback
varyings. If that is the case, free the varying names and reallocate
the new storage for the names array.
This fixes a memory leak:
Direct leak of 48 byte(s) in 6 object(s) allocated from:
in malloc (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0xdb880)
in transform_feedback_varyings ../../samba/mesa/src/mesa/main/transformfeedback.c:875
in _mesa_TransformFeedbackVaryings ../../samba/mesa/src/mesa/main/transformfeedback.c:985
...
Indirect leak of 42 byte(s) in 6 object(s) allocated from:
in __interceptor_strdup (/usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so+0x761c8)
in transform_feedback_varyings ../../samba/mesa/src/mesa/main/transformfeedback.c:887
in _mesa_TransformFeedbackVaryings ../../samba/mesa/src/mesa/main/transformfeedback.c:985
Fixes: ab2643e4b06f63c93a57624003679903442634a8
glsl: serialize data from glTransformFeedbackVaryings
Signed-off-by: Gert Wollny
Reviewed-by: Tapani Pälli
(cherry picked from commit f5d053702fa976a3112d9c6a2425430365db40f8)
---
src/compiler/glsl/serialize.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/serialize.cpp b/src/compiler/glsl/serialize.cpp
index 267700e7e78..26d8ec4b75b 100644
--- a/src/compiler/glsl/serialize.cpp
+++ b/src/compiler/glsl/serialize.cpp
@@ -360,13 +360,20 @@ read_xfb(struct blob_reader *metadata, struct gl_shader_program *shProg)
if (xfb_stage == ~0u)
return;
+ if (shProg->TransformFeedback.VaryingNames) {
+ for (unsigned i = 0; i < shProg->TransformFeedback.NumVarying; ++i)
+ free(shProg->TransformFeedback.VaryingNames[i]);
+ }
+
/* Data set by glTransformFeedbackVaryings. */
shProg->TransformFeedback.BufferMode = blob_read_uint32(metadata);
blob_copy_bytes(metadata, &shProg->TransformFeedback.BufferStride,
sizeof(shProg->TransformFeedback.BufferStride));
shProg->TransformFeedback.NumVarying = blob_read_uint32(metadata);
+
shProg->TransformFeedback.VaryingNames = (char **)
- malloc(shProg->TransformFeedback.NumVarying * sizeof(GLchar *));
+ realloc(shProg->TransformFeedback.VaryingNames,
+ shProg->TransformFeedback.NumVarying * sizeof(GLchar *));
/* Note, malloc used with VaryingNames. */
for (unsigned i = 0; i < shProg->TransformFeedback.NumVarying; i++)
shProg->TransformFeedback.VaryingNames[i] =
From 1a905e4c5b3bff052085b3efdc17fe2fb252bad3 Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 22 Nov 2018 15:17:13 +0100
Subject: [PATCH 073/220] mesa/main: remove bogus error for zero-sized images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The explanation quotes the spec on the following wording to justify the
error:
"An INVALID_VALUE error is generated if xoffset + width is greater than
the texture’s width, yoffset + height is greater than the texture’s
height, or zoffset + depth is greater than the texture’s depth."
However, this shouldn't generate an error in the case where *all three*
of width, xoffset and the texture's width are zero. In this case, we end
up generating an unspecified error.
So let's remove this check, and instead make sure that we consider this
as an empty texture.
So let's not generate an error, there's non mandated in the spec in
xoffset/yoffset/zoffset = 0 case. We already avoid doing any work in
this case, because of the final, non-error generating check in this
function.
Fixes: b37b35a5d26 "getteximage: assume texture image is empty for non defined levels"
Signed-off-by: Erik Faye-Lund
Reviewed-by: Juan A. Suarez
(cherry picked from commit 38bbb61252aa503571986080afddd98a56bcf2e7)
---
src/mesa/main/texgetimage.c | 49 ++++++++++---------------------------
1 file changed, 13 insertions(+), 36 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 0ab9ed445d6..0c1e5d208b8 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -900,8 +900,7 @@ select_tex_image(const struct gl_texture_object *texObj, GLenum target,
/**
* Error-check the offset and size arguments to
- * glGet[Compressed]TextureSubImage(). Also checks if the specified
- * texture image is missing.
+ * glGet[Compressed]TextureSubImage().
* \return true if error, false if no error.
*/
static bool
@@ -913,6 +912,7 @@ dimensions_error_check(struct gl_context *ctx,
const char *caller)
{
const struct gl_texture_image *texImage;
+ GLuint imageWidth = 0, imageHeight = 0, imageDepth = 0;
if (xoffset < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(xoffset = %d)", caller, xoffset);
@@ -1002,61 +1002,38 @@ dimensions_error_check(struct gl_context *ctx,
}
texImage = select_tex_image(texObj, target, level, zoffset);
- if (!texImage) {
- /* Trying to return a non-defined level is a valid operation per se, as
- * OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries") does not
- * handle this case as an error.
- *
- * Rather, we need to look at section 8.22 ("Texture State and Proxy
- * State"):
- *
- * "Each initial texture image is null. It has zero width, height, and
- * depth, internal format RGBA, or R8 for buffer textures, component
- * sizes set to zero and component types set to NONE, the compressed
- * flag set to FALSE, a zero compressed size, and the bound buffer
- * object name is zero."
- *
- * This means we need to assume the image for the non-defined level is
- * an empty image. With this assumption, we can go back to section
- * 8.11.4 and checking again the errors:
- *
- * "An INVALID_VALUE error is generated if xoffset + width is greater
- * than the texture’s width, yoffset + height is greater than the
- * texture’s height, or zoffset + depth is greater than the texture’s
- * depth."
- *
- * Thus why we return INVALID_VALUE.
- */
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(missing image)", caller);
- return true;
+ if (texImage) {
+ imageWidth = texImage->Width;
+ imageHeight = texImage->Height;
+ imageDepth = texImage->Depth;
}
- if (xoffset + width > texImage->Width) {
+ if (xoffset + width > imageWidth) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(xoffset %d + width %d > %u)",
- caller, xoffset, width, texImage->Width);
+ caller, xoffset, width, imageWidth);
return true;
}
- if (yoffset + height > texImage->Height) {
+ if (yoffset + height > imageHeight) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(yoffset %d + height %d > %u)",
- caller, yoffset, height, texImage->Height);
+ caller, yoffset, height, imageHeight);
return true;
}
if (target != GL_TEXTURE_CUBE_MAP) {
/* Cube map error checking was done above */
- if (zoffset + depth > texImage->Depth) {
+ if (zoffset + depth > imageDepth) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(zoffset %d + depth %d > %u)",
- caller, zoffset, depth, texImage->Depth);
+ caller, zoffset, depth, imageDepth);
return true;
}
}
/* Extra checks for compressed textures */
- {
+ if (texImage) {
GLuint bw, bh, bd;
_mesa_get_format_block_size_3d(texImage->TexFormat, &bw, &bh, &bd);
if (bw > 1 || bh > 1 || bd > 1) {
From 35e9cd34283a44a671db662e6f434ba3a2e5490b Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 22 Nov 2018 12:17:32 +0100
Subject: [PATCH 074/220] mesa/main: factor out tex-image error-checking
This will be useful when we split error-checking for getteximage and
gettexsubimage later.
Signed-off-by: Erik Faye-Lund
Reviewed-by: Juan A. Suarez
(cherry picked from commit 5e0a84f31cac14f1ccc5c74ce2e7cd997f267752)
---
src/mesa/main/texgetimage.c | 110 +++++++++++++++++++++---------------
1 file changed, 64 insertions(+), 46 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 0c1e5d208b8..5fce932c3c8 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1139,53 +1139,15 @@ pbo_error_check(struct gl_context *ctx, GLenum target,
/**
- * Do error checking for all (non-compressed) get-texture-image functions.
- * \return true if any error, false if no errors.
+ * Do teximage-related error checking for getting uncompressed images.
+ * \return true if there was an error
*/
static bool
-getteximage_error_check(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei bufSize,
- GLvoid *pixels, const char *caller)
+teximage_error_check(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ GLenum format, const char *caller)
{
- struct gl_texture_image *texImage;
- GLenum baseFormat, err;
- GLint maxLevels;
-
- assert(texObj);
-
- if (texObj->Target == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture)", caller);
- return true;
- }
-
- maxLevels = _mesa_max_texture_levels(ctx, target);
- if (level < 0 || level >= maxLevels) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(level = %d)", caller, level);
- return true;
- }
-
- err = _mesa_error_check_format_and_type(ctx, format, type);
- if (err != GL_NO_ERROR) {
- _mesa_error(ctx, err, "%s(format/type)", caller);
- return true;
- }
-
- if (dimensions_error_check(ctx, texObj, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth, caller)) {
- return true;
- }
-
- if (pbo_error_check(ctx, target, width, height, depth,
- format, type, bufSize, pixels, caller)) {
- return true;
- }
-
- texImage = select_tex_image(texObj, target, level, zoffset);
+ GLenum baseFormat;
assert(texImage);
/*
@@ -1218,8 +1180,8 @@ getteximage_error_check(struct gl_context *ctx,
return true;
}
else if (_mesa_is_stencil_format(format)
- && !_mesa_is_depthstencil_format(baseFormat)
- && !_mesa_is_stencil_format(baseFormat)) {
+ && !_mesa_is_depthstencil_format(baseFormat)
+ && !_mesa_is_stencil_format(baseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(format mismatch)", caller);
return true;
@@ -1248,6 +1210,62 @@ getteximage_error_check(struct gl_context *ctx,
}
+/**
+ * Do error checking for all (non-compressed) get-texture-image functions.
+ * \return true if any error, false if no errors.
+ */
+static bool
+getteximage_error_check(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels, const char *caller)
+{
+ struct gl_texture_image *texImage;
+ GLenum err;
+ GLint maxLevels;
+
+ assert(texObj);
+
+ if (texObj->Target == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture)", caller);
+ return true;
+ }
+
+ maxLevels = _mesa_max_texture_levels(ctx, target);
+ if (level < 0 || level >= maxLevels) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(level = %d)", caller, level);
+ return true;
+ }
+
+ err = _mesa_error_check_format_and_type(ctx, format, type);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err, "%s(format/type)", caller);
+ return true;
+ }
+
+ if (dimensions_error_check(ctx, texObj, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth, caller)) {
+ return true;
+ }
+
+ if (pbo_error_check(ctx, target, width, height, depth,
+ format, type, bufSize, pixels, caller)) {
+ return true;
+ }
+
+ texImage = select_tex_image(texObj, target, level, zoffset);
+ if (teximage_error_check(ctx, texImage, format, caller)) {
+ return true;
+ }
+
+ return false;
+}
+
+
/**
* Return the width, height and depth of a texture image.
* This function must be resilient to bad parameter values since
From 5598426132a6bf6c71ecc6bd2c701696bb5da8fb Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 22 Nov 2018 12:37:33 +0100
Subject: [PATCH 075/220] mesa/main: factor out common error-checking
This error checking is the same for teximage and texsubimage getters, so
let's factor it out to its own function.
This will be useful when getteximage and gettexsubimage gets their own
error checking routines a bit later.
Signed-off-by: Erik Faye-Lund
Reviewed-by: Juan A. Suarez
(cherry picked from commit 42820c572750c30ae86175ae58bb70439dc2e644)
---
src/mesa/main/texgetimage.c | 46 +++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 12 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 5fce932c3c8..792535c3245 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1211,24 +1211,20 @@ teximage_error_check(struct gl_context *ctx,
/**
- * Do error checking for all (non-compressed) get-texture-image functions.
- * \return true if any error, false if no errors.
+ * Do common teximage-related error checking for getting uncompressed images.
+ * \return true if there was an error
*/
static bool
-getteximage_error_check(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei bufSize,
- GLvoid *pixels, const char *caller)
+common_error_check(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum target, GLint level,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels, const char *caller)
{
- struct gl_texture_image *texImage;
GLenum err;
GLint maxLevels;
- assert(texObj);
-
if (texObj->Target == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid texture)", caller);
return true;
@@ -1246,6 +1242,32 @@ getteximage_error_check(struct gl_context *ctx,
return true;
}
+ return false;
+}
+
+
+/**
+ * Do error checking for all (non-compressed) get-texture-image functions.
+ * \return true if any error, false if no errors.
+ */
+static bool
+getteximage_error_check(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels, const char *caller)
+{
+ struct gl_texture_image *texImage;
+
+ assert(texObj);
+
+ if (common_error_check(ctx, texObj, target, level, width, height, depth,
+ format, type, bufSize, pixels, caller)) {
+ return true;
+ }
+
if (dimensions_error_check(ctx, texObj, target, level,
xoffset, yoffset, zoffset,
width, height, depth, caller)) {
From 7d8a9087ae8902acfa87bd51f025fc39d43a99e7 Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 22 Nov 2018 17:40:47 +0100
Subject: [PATCH 076/220] mesa/main: check cube-completeness in common code
This check is the only part of dimensions_error_check that isn't about
error-checking the offset and size arguments of
glGet[Compressed]TextureSubImage(), so it doesn't really belong in here.
This doesn't make a difference right now, apart for changing the
presedence of this error. But it will make a difference for the next
patch, where we no longer call this method from the non-sub tex-image
getters.
Signed-off-by: Erik Faye-Lund
Reviewed-by: Juan A. Suarez
(cherry picked from commit 38af69adfaf47019926bfe3a8cf352752068d389)
---
src/mesa/main/texgetimage.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 792535c3245..1876efc1311 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -981,21 +981,6 @@ dimensions_error_check(struct gl_context *ctx,
"%s(zoffset + depth = %d)", caller, zoffset + depth);
return true;
}
- /* According to OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries"):
- *
- * "An INVALID_OPERATION error is generated by GetTextureImage if the
- * effective target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY ,
- * and the texture object is not cube complete or cube array complete,
- * respectively."
- *
- * This applies also to GetTextureSubImage, GetCompressedTexImage,
- * GetCompressedTextureImage, and GetnCompressedTexImage.
- */
- if (!_mesa_cube_complete(texObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(cube incomplete)", caller);
- return true;
- }
break;
default:
; /* nothing */
@@ -1242,6 +1227,22 @@ common_error_check(struct gl_context *ctx,
return true;
}
+ /* According to OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries"):
+ *
+ * "An INVALID_OPERATION error is generated by GetTextureImage if the
+ * effective target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY ,
+ * and the texture object is not cube complete or cube array complete,
+ * respectively."
+ *
+ * This applies also to GetTextureSubImage, GetCompressedTexImage,
+ * GetCompressedTextureImage, and GetnCompressedTexImage.
+ */
+ if (target == GL_TEXTURE_CUBE_MAP && !_mesa_cube_complete(texObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(cube incomplete)", caller);
+ return true;
+ }
+
return false;
}
From d575455be6420e9e9121a0941b2e8df765cd6b0a Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund
Date: Thu, 22 Nov 2018 11:10:50 +0100
Subject: [PATCH 077/220] mesa/main: fix incorrect depth-error
If glGetTexImage or glGetnTexImage is called with a level that doesn't
exist, we get an error message on this form:
Mesa: User error: GL_INVALID_VALUE in glGetTexImage(depth = 0)
This is clearly nonsensical, because these APIs don't even have a
depth-parameter. The reason is that get_texture_image_dims() return
all-zero dimensions for non-existent texture-images, and we go on to
validate these dimensions as if they were user-input, because
glGetTextureSubImage requires checking.
So let's split this logic in two, so glGetTextureSubImage can have
stricter input-validation. All arguments that are no longer validated
are generated internally by mesa, so there's no use in validating them.
Fixes: 42891dbaa12 "gettextsubimage: verify zoffset and depth are correct"
Signed-off-by: Erik Faye-Lund
Reviewed-by: Juan A. Suarez
(cherry picked from commit c120dbfe4d18240315ecec9b43a61aeb9ab239ac)
---
src/mesa/main/texgetimage.c | 57 ++++++++++++++++++++++++++++++++-----
1 file changed, 50 insertions(+), 7 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 1876efc1311..bb4f7006618 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1255,7 +1255,6 @@ static bool
getteximage_error_check(struct gl_context *ctx,
struct gl_texture_object *texObj,
GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, GLsizei bufSize,
GLvoid *pixels, const char *caller)
@@ -1269,6 +1268,49 @@ getteximage_error_check(struct gl_context *ctx,
return true;
}
+ if (width == 0 || height == 0 || depth == 0) {
+ /* Not an error, but nothing to do. Return 'true' so that the
+ * caller simply returns.
+ */
+ return true;
+ }
+
+ if (pbo_error_check(ctx, target, width, height, depth,
+ format, type, bufSize, pixels, caller)) {
+ return true;
+ }
+
+ texImage = select_tex_image(texObj, target, level, 0);
+ if (teximage_error_check(ctx, texImage, format, caller)) {
+ return true;
+ }
+
+ return false;
+}
+
+
+/**
+ * Do error checking for all (non-compressed) get-texture-image functions.
+ * \return true if any error, false if no errors.
+ */
+static bool
+gettexsubimage_error_check(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels, const char *caller)
+{
+ struct gl_texture_image *texImage;
+
+ assert(texObj);
+
+ if (common_error_check(ctx, texObj, target, level, width, height, depth,
+ format, type, bufSize, pixels, caller)) {
+ return true;
+ }
+
if (dimensions_error_check(ctx, texObj, target, level,
xoffset, yoffset, zoffset,
width, height, depth, caller)) {
@@ -1417,7 +1459,7 @@ _mesa_GetnTexImageARB(GLenum target, GLint level, GLenum format, GLenum type,
get_texture_image_dims(texObj, target, level, &width, &height, &depth);
if (getteximage_error_check(ctx, texObj, target, level,
- 0, 0, 0, width, height, depth,
+ width, height, depth,
format, type, bufSize, pixels, caller)) {
return;
}
@@ -1448,7 +1490,7 @@ _mesa_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type,
get_texture_image_dims(texObj, target, level, &width, &height, &depth);
if (getteximage_error_check(ctx, texObj, target, level,
- 0, 0, 0, width, height, depth,
+ width, height, depth,
format, type, INT_MAX, pixels, caller)) {
return;
}
@@ -1482,7 +1524,7 @@ _mesa_GetTextureImage(GLuint texture, GLint level, GLenum format, GLenum type,
&width, &height, &depth);
if (getteximage_error_check(ctx, texObj, texObj->Target, level,
- 0, 0, 0, width, height, depth,
+ width, height, depth,
format, type, bufSize, pixels, caller)) {
return;
}
@@ -1515,9 +1557,10 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
return;
}
- if (getteximage_error_check(ctx, texObj, texObj->Target, level,
- xoffset, yoffset, zoffset, width, height, depth,
- format, type, bufSize, pixels, caller)) {
+ if (gettexsubimage_error_check(ctx, texObj, texObj->Target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, bufSize, pixels, caller)) {
return;
}
From a32c568d39eb51b21cd9abecaabb77b676a5de35 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Fri, 23 Nov 2018 17:08:28 +0000
Subject: [PATCH 078/220] anv: correctly use vulkan 1.0 by default
Per chapter 3.2 "Instances":
> Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing
> an apiVersion of 0 is equivalent to providing an apiVersion of
> VK_MAKE_VERSION(1,0,0).
Reported-by: Niklas Haas
Fixes: 8c048af5890d43578ca4 "anv: Copy the appliation info into the instance"
Signed-off-by: Eric Engestrom
Reviewed-by: Lionel Landwerlin
Reviewed-by: Bas Nieuwenhuizen
(cherry picked from commit 56d126f8fd210dbd2c946bfbc2e3c81b04d27d09)
---
src/intel/vulkan/anv_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index ee35e013329..924470b3005 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -636,7 +636,7 @@ VkResult anv_CreateInstance(
}
if (instance->app_info.api_version == 0)
- anv_EnumerateInstanceVersion(&instance->app_info.api_version);
+ instance->app_info.api_version = VK_API_VERSION_1_0;
instance->enabled_extensions = enabled_extensions;
From a1f6ae4e27413727fc548d0201d7f6663f906e92 Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen
Date: Sat, 24 Nov 2018 23:21:05 +0100
Subject: [PATCH 079/220] radv: Clamp gfx9 image view extents to the allocated
image extents.
Mirrors AMDVLK. Looks like if we go over the alignment of height
we actually start to change the addressing. Seems like the extra
miplevels actually work with this.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108245
Fixes: f6cc15dccd5 "radv/gfx9: fix block compression texture views. (v2)"
Reviewed-by: Dave Airlie
Reviewed-by: Samuel Pitoiset
(cherry picked from commit 08ea6b9d9bb047603c249468dfe00d7bb9603d5e)
---
src/amd/vulkan/radv_image.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index a0fa0506350..6eb108c7e36 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1175,8 +1175,6 @@ radv_image_view_init(struct radv_image_view *iview,
if (device->physical_device->rad_info.chip_class >= GFX9 &&
vk_format_is_compressed(image->vk_format) &&
!vk_format_is_compressed(iview->vk_format)) {
- unsigned rounded_img_w = util_next_power_of_two(iview->extent.width);
- unsigned rounded_img_h = util_next_power_of_two(iview->extent.height);
unsigned lvl_width = radv_minify(image->info.width , range->baseMipLevel);
unsigned lvl_height = radv_minify(image->info.height, range->baseMipLevel);
@@ -1186,8 +1184,8 @@ radv_image_view_init(struct radv_image_view *iview,
lvl_width <<= range->baseMipLevel;
lvl_height <<= range->baseMipLevel;
- iview->extent.width = CLAMP(lvl_width, iview->extent.width, rounded_img_w);
- iview->extent.height = CLAMP(lvl_height, iview->extent.height, rounded_img_h);
+ iview->extent.width = CLAMP(lvl_width, iview->extent.width, iview->image->surface.u.gfx9.surf_pitch);
+ iview->extent.height = CLAMP(lvl_height, iview->extent.height, iview->image->surface.u.gfx9.surf_height);
}
}
From ec659efcbaae8fe3030437f9a46d036f4fe93b33 Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen
Date: Mon, 26 Nov 2018 03:28:05 +0100
Subject: [PATCH 080/220] radv: Align large buffers to the fragment size.
Improves performance in Talos by about 15% (and significant improvements
in RotR and possibly other but did not bench with final patch) on
kernel 4.19 and earlier.
On 4.20+ a similar effect comes from
433ca054949a "drm/amdgpu: try allocating VRAM as power of two"
v2: Do not impact the alignment of the physical memory.
Reviewed-by: Dave Airlie
Reviewed-by: Samuel Pitoiset
CC:
(cherry picked from commit 6569644bb6e1f58fd739d83bd4dc42e6af6b6097)
---
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
index 25764d93f6a..482cf0f6659 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
@@ -304,8 +304,12 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
return NULL;
}
+ unsigned virt_alignment = alignment;
+ if (size >= ws->info.pte_fragment_size)
+ virt_alignment = MAX2(virt_alignment, ws->info.pte_fragment_size);
+
r = amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
- size, alignment, 0, &va, &va_handle,
+ size, virt_alignment, 0, &va, &va_handle,
(flags & RADEON_FLAG_32BIT ? AMDGPU_VA_RANGE_32_BIT : 0) |
AMDGPU_VA_RANGE_HIGH);
if (r)
From 41671f5dc0532be81bb21e14660a66dc8beb3777 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Tue, 27 Nov 2018 13:34:37 +0000
Subject: [PATCH 081/220] wsi/display: fix mem leak when freeing swapchains
Fixes: da997ebec92942193955 "vulkan: Add KHR_display extension using DRM [v10]"
Signed-off-by: Eric Engestrom
Reviewed-by: Keith Packard
(cherry picked from commit 9575cd289325ddbfa96291d7886cfc32a0487e79)
---
src/vulkan/wsi/wsi_common_display.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c
index fd0d30ad80c..856040b4fe1 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -1062,6 +1062,8 @@ wsi_display_swapchain_destroy(struct wsi_swapchain *drv_chain,
for (uint32_t i = 0; i < chain->base.image_count; i++)
wsi_display_image_finish(drv_chain, allocator, &chain->images[i]);
+
+ wsi_swapchain_finish(&chain->base);
vk_free(allocator, chain);
return VK_SUCCESS;
}
From ace4860a4ff0d04a45743aeca080b314c7c7d289 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Fri, 23 Nov 2018 12:55:38 +0000
Subject: [PATCH 082/220] egl/wayland: bail out when drmGetMagic fails
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently as the function fails, we pass uninitialized data to the
authentication function. Stop doing that and print an warning when
the function fails.
v2: Plug memory leak in error path (Eric)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov
Reviewed-by: Tapani Pälli (v1)
Reviewed-by: Eric Engestrom
(cherry picked from commit c59d3aa4b9bc58994e199052171a8119aaa8195c)
---
src/egl/drivers/dri2/platform_wayland.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index dc16a69dfbc..73335ee2ad9 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1133,7 +1133,14 @@ drm_handle_device(void *data, struct wl_drm *drm, const char *device)
if (drmGetNodeTypeFromFd(dri2_dpy->fd) == DRM_NODE_RENDER) {
dri2_dpy->authenticated = true;
} else {
- drmGetMagic(dri2_dpy->fd, &magic);
+ if (drmGetMagic(dri2_dpy->fd, &magic)) {
+ close(dri2_dpy->fd);
+ dri2_dpy->fd = -1;
+ free(dri2_dpy->device_name);
+ dri2_dpy->device_name = NULL;
+ _eglLog(_EGL_WARNING, "wayland-egl: drmGetMagic failed");
+ return;
+ }
wl_drm_authenticate(dri2_dpy->wl_drm, magic);
}
}
From bcc8332606de70560a83c9865ef6ea9b0d34e155 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Tue, 27 Nov 2018 11:36:01 +0000
Subject: [PATCH 083/220] egl/wayland: plug memory leak in drm_handle_device()
As we fail to open the node, we leak the node/device name.
v2: Log and then free() (Eric)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov
Reviewed-by: Eric Engestrom
(cherry picked from commit ce74a7bb8de7f5b921d53384582de3324290cd60)
---
src/egl/drivers/dri2/platform_wayland.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 73335ee2ad9..817e9b1988a 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1127,6 +1127,8 @@ drm_handle_device(void *data, struct wl_drm *drm, const char *device)
if (dri2_dpy->fd == -1) {
_eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
dri2_dpy->device_name, strerror(errno));
+ free(dri2_dpy->device_name);
+ dri2_dpy->device_name = NULL;
return;
}
From ce6a9169f09a0fb16ff6ab395b0677aca4a43ba3 Mon Sep 17 00:00:00 2001
From: Eric Engestrom
Date: Tue, 20 Nov 2018 17:35:27 +0000
Subject: [PATCH 084/220] vulkan/wsi: fix s/,/;/ typo
Fixes: 59e58c348e6af16a5f2dd "vulkan/wsi: Only wait on semaphores on the first swapchain"
Signed-off-by: Eric Engestrom
Reviewed-by: Jason Ekstrand
(cherry picked from commit e0f1f74eda6e1bdb3bcee075f6cc5082d4137069)
---
src/vulkan/wsi/wsi_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 1cd5f8d62c5..58e25214149 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -954,8 +954,8 @@ wsi_common_queue_present(const struct wsi_device *wsi,
/* We only need/want to wait on semaphores once. After that, we're
* guaranteed ordering since it all happens on the same queue.
*/
- submit_info.waitSemaphoreCount = pPresentInfo->waitSemaphoreCount,
- submit_info.pWaitSemaphores = pPresentInfo->pWaitSemaphores,
+ submit_info.waitSemaphoreCount = pPresentInfo->waitSemaphoreCount;
+ submit_info.pWaitSemaphores = pPresentInfo->pWaitSemaphores;
/* Set up the pWaitDstStageMasks */
stage_flags = vk_alloc(&swapchain->alloc,
From bb4bbb5c2dddcdfb384e21c38b39b47f93d399df Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Wed, 28 Nov 2018 17:52:54 +0000
Subject: [PATCH 085/220] cherry-ignore: egl/wayland: rather obvious build fix
Commit was squashed into the respective offenders
Signed-off-by: Emil Velikov
---
bin/.cherry-ignore | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 bin/.cherry-ignore
diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
new file mode 100644
index 00000000000..9c4a21d82d1
--- /dev/null
+++ b/bin/.cherry-ignore
@@ -0,0 +1,2 @@
+# fixes: Commit was squashed into the respective offenders
+c02390f8fcd367c7350db568feabb2f062efca14 egl/wayland: rather obvious build fix
From b28aa1178a1e336bf6f73bb777a0aebce8e3c3c7 Mon Sep 17 00:00:00 2001
From: Emil Velikov
Date: Thu, 29 Nov 2018 11:56:27 +0000
Subject: [PATCH 086/220] Update version to 18.3.0-rc5
Signed-off-by: Emil Velikov
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index 09c62b68556..6742d1dc011 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.3.0-rc4
+18.3.0-rc5
From fe460ee8cdb0afb41f2e36afa318576a5d4f03fd Mon Sep 17 00:00:00 2001
From: Dave Airlie
Date: Thu, 11 Oct 2018 13:44:02 +1000
Subject: [PATCH 087/220] r600: make suballocator 256-bytes align
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108311
Cc:
(cherry picked from commit 2ddd44d941648d49dc0d917e03a579baec3590d9)
---
src/gallium/drivers/r600/r600_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c
index ccabab9cdb0..92f243b5c9a 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -1636,7 +1636,7 @@ static void r600_query_hw_get_result_resource(struct r600_common_context *rctx,
}
if (query->buffer.previous) {
- u_suballocator_alloc(rctx->allocator_zeroed_memory, 16, 16,
+ u_suballocator_alloc(rctx->allocator_zeroed_memory, 16, 256,
&tmp_buffer_offset, &tmp_buffer);
if (!tmp_buffer)
return;
From c2a22a44a19850c771a899e83d5ab55b98031a82 Mon Sep 17 00:00:00 2001
From: Thomas Hellstrom
Date: Mon, 26 Nov 2018 19:02:08 +0100
Subject: [PATCH 088/220] st/xa: Fix a memory leak
Free the context after destruction.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom
Reviewed-by: Sinclair Yeh
Reviewed-by: Emil Velikov
(cherry picked from commit 7fce3ca3759e2e156e2e3bf1bcc4ee378dc7fa2d)
---
src/gallium/state_trackers/xa/xa_context.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c
index ba220877c84..67d9eac53bb 100644
--- a/src/gallium/state_trackers/xa/xa_context.c
+++ b/src/gallium/state_trackers/xa/xa_context.c
@@ -91,6 +91,7 @@ xa_context_destroy(struct xa_context *r)
}
r->pipe->destroy(r->pipe);
+ free(r);
}
XA_EXPORT int
From 56f90f6213ecefa04160fec6b2d7e3c552ad9cb9 Mon Sep 17 00:00:00 2001
From: Thomas Hellstrom
Date: Mon, 26 Nov 2018 19:05:47 +0100
Subject: [PATCH 089/220] winsys/svga: Fix a memory leak
The ioctl.cap_3d member was never freed.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Thomas Hellstrom
Reviewed-by: Sinclair Yeh
Reviewed-by: Emil Velikov
(cherry picked from commit 058f85d41cbe3534b1a06d321fab9afb8fbadfc0)
---
src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 739e4ea131f..0ec8c1abe11 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -1198,4 +1198,6 @@ void
vmw_ioctl_cleanup(struct vmw_winsys_screen *vws)
{
VMW_FUNC;
+
+ free(vws->ioctl.cap_3d);
}
From 98d571d212701e235266ad2db999f4b57a13517f Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin
Date: Thu, 29 Nov 2018 13:02:03 +0000
Subject: [PATCH 090/220] anv: flush pipeline before query result copies
Pipeline state pending bits should be taken into account when copying
results.
In the particular bug below, the results of the
vkCmdCopyQueryPoolResults() command was being overwritten by the
preceding vkCmdCopyBuffer() with a same destination buffer. This is
because we copy the buffers using the 3D pipeline whereas we copy the
query results using the command streamer. Those pieces of HW work in
parallel and the results are somewhat undefined.
v2: Unconditionally flush the pipeline before copying the results
(Jason)
v3: Wrap & expressions (Jason)
Signed-off-by: Lionel Landwerlin
Suggested-by: Jason Ekstrand
Reviewed-by: Jason Ekstrand
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108894
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 37f9788e9a8e443772b5ad6f339567e6ae6a8320)
---
src/intel/vulkan/genX_query.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c
index ce8757f2643..4831c4ea334 100644
--- a/src/intel/vulkan/genX_query.c
+++ b/src/intel/vulkan/genX_query.c
@@ -729,11 +729,10 @@ void genX(CmdCopyQueryPoolResults)(
ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
ANV_FROM_HANDLE(anv_buffer, buffer, destBuffer);
- if (flags & VK_QUERY_RESULT_WAIT_BIT) {
- anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {
- pc.CommandStreamerStallEnable = true;
- pc.StallAtPixelScoreboard = true;
- }
+ if ((flags & VK_QUERY_RESULT_WAIT_BIT) ||
+ (cmd_buffer->state.pending_pipe_bits & ANV_PIPE_FLUSH_BITS)) {
+ cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_CS_STALL_BIT;
+ genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
}
struct anv_address dest_addr = anv_address_add(buffer->address, destOffset);
From ab83cfd2bfd551ca5520f0bdbdd3a4d245544ffc Mon Sep 17 00:00:00 2001
From: Vinson Lee
Date: Mon, 5 Nov 2018 10:50:41 -0800
Subject: [PATCH 091/220] st/xvmc: Add X11 include path.
This patch fixes this build error.
CC tests/xvmc_bench.o
In file included from tests/xvmc_bench.c:35:
tests/testlib.h:38:10: fatal error: 'X11/Xlib.h' file not found
^~~~~~~~~~~~
Signed-off-by: Vinson Lee
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov
(cherry picked from commit 4f74580d3038eca1b751a71e0c098ea9eb9cdb05)
---
src/gallium/state_trackers/xvmc/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/state_trackers/xvmc/Makefile.am b/src/gallium/state_trackers/xvmc/Makefile.am
index 85d0b5f4953..dc278099030 100644
--- a/src/gallium/state_trackers/xvmc/Makefile.am
+++ b/src/gallium/state_trackers/xvmc/Makefile.am
@@ -27,6 +27,7 @@ AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS) \
$(VL_CFLAGS) \
+ $(X11_INCLUDES) \
$(XCB_DRI3_CFLAGS) \
$(XVMC_CFLAGS)
From a7c4368a66fb203786d13eec6dbe394b1eea6292 Mon Sep 17 00:00:00 2001
From: Karol Herbst
Date: Sat, 24 Nov 2018 20:00:00 +0100
Subject: [PATCH 092/220] nv50,nvc0: Fix gallium nine regression regarding
sampler bindings
The new approach is that samplers don't get unbound even if they won't be used
in a draw and we should just leave them be as well.
Fixes a regression in multiple windows games using gallium nine and nouveau.
v2: adjust num_samplers to keep track of the highest sampler bound
v3: rework how to set the new value of num_samplers
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106577
Fixes: 4d6fab245eec3880e2a59424a579851f44857ce8
"cso: don't track the number of sampler states bound"
Signed-off-by: Karol Herbst
Reviewed-by: Ilia Mirkin
(cherry picked from commit fc0139d28339f58bcbb4946fea7608ecdaff93e7)
---
src/gallium/drivers/nouveau/nv50/nv50_state.c | 14 ++++++--------
src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 14 ++++++--------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
index fb4a259ce16..e1b2e20810a 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
@@ -600,25 +600,23 @@ static inline void
nv50_stage_sampler_states_bind(struct nv50_context *nv50, int s,
unsigned nr, void **hwcso)
{
+ unsigned highest_found = 0;
unsigned i;
assert(nr <= PIPE_MAX_SAMPLERS);
for (i = 0; i < nr; ++i) {
struct nv50_tsc_entry *old = nv50->samplers[s][i];
+ if (hwcso[i])
+ highest_found = i;
+
nv50->samplers[s][i] = nv50_tsc_entry(hwcso[i]);
if (old)
nv50_screen_tsc_unlock(nv50->screen, old);
}
assert(nv50->num_samplers[s] <= PIPE_MAX_SAMPLERS);
- for (; i < nv50->num_samplers[s]; ++i) {
- if (nv50->samplers[s][i]) {
- nv50_screen_tsc_unlock(nv50->screen, nv50->samplers[s][i]);
- nv50->samplers[s][i] = NULL;
- }
- }
-
- nv50->num_samplers[s] = nr;
+ if (nr >= nv50->num_samplers[s])
+ nv50->num_samplers[s] = highest_found + 1;
nv50->dirty_3d |= NV50_NEW_3D_SAMPLERS;
}
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index f2393cb27b5..9653de86fe9 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -464,11 +464,15 @@ nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0,
unsigned s,
unsigned nr, void **hwcso)
{
+ unsigned highest_found = 0;
unsigned i;
for (i = 0; i < nr; ++i) {
struct nv50_tsc_entry *old = nvc0->samplers[s][i];
+ if (hwcso[i])
+ highest_found = i;
+
if (hwcso[i] == old)
continue;
nvc0->samplers_dirty[s] |= 1 << i;
@@ -477,14 +481,8 @@ nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0,
if (old)
nvc0_screen_tsc_unlock(nvc0->screen, old);
}
- for (; i < nvc0->num_samplers[s]; ++i) {
- if (nvc0->samplers[s][i]) {
- nvc0_screen_tsc_unlock(nvc0->screen, nvc0->samplers[s][i]);
- nvc0->samplers[s][i] = NULL;
- }
- }
-
- nvc0->num_samplers[s] = nr;
+ if (nr >= nvc0->num_samplers[s])
+ nvc0->num_samplers[s] = highest_found + 1;
}
static void
From 3985a62afce60ef2c9b3588934d87082e0ebcb39 Mon Sep 17 00:00:00 2001
From: Tobias Klausmann
Date: Sat, 1 Dec 2018 18:30:20 +0100
Subject: [PATCH 093/220] amd/vulkan: meson build - use radv_deps for
libvulkan_radeon
Without this the build breaks with:
FAILED: src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o
cc -Isrc/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha -Isrc/amd/vulkan
-I../src/amd/vulkan -Isrc/../include -I../src/../include -Isrc -I../src
-Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include
-Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/amd -I../src/amd
-Isrc/amd/common -I../src/amd/common -Isrc/compiler -I../src/compiler
-Isrc/vulkan/util -I../src/vulkan/util -Isrc/vulkan/wsi -I../src/vulkan/wsi
-Isrc/compiler/nir -I../src/compiler/nir -I/usr/include -I/usr/include/libdrm
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-std=c99 -O2 -g '-DVERSION="18.3.0-rc5"' -DPACKAGE_VERSION=VERSION
'-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"'
-DGLX_USE_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0
-DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING
-DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DENABLE_SHADER_CACHE
-DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ
-DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT
-DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT
-DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE
-DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN
-DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE
-DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
-DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT
-DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
-DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS
-DHAVE_FUNC_ATTRIBUTE_NORETURN -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS
-DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H
-DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP
-DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L
-DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD
-DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LLVM=0x0600
-DMESA_LLVM_VERSION_PATCH=1 -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED
-DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration
-Werror=missing-prototypes -Werror=return-type -fno-math-errno
-fno-trapping-math -Wno-missing-field-initializers -Wno-format-truncation -O2
-Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -fPIC -pthread
-D__STDC_FORMAT_MACROS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_LIMIT_MACROS -fvisibility=hidden -Wno-override-init
-DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR
-DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_DISPLAY_KHR
-DVK_USE_PLATFORM_XLIB_XRANDR_EXT -MD -MQ
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o' -MF
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o.d' -o
'src/amd/vulkan/src@amd@vulkan@@vulkan_radeon@sha/radv_pipeline.c.o' -c
../src/amd/vulkan/radv_pipeline.c
In file included from ../src/vulkan/util/vk_alloc.h:29,
from ../src/amd/vulkan/radv_private.h:52,
from ../src/amd/vulkan/radv_debug.h:27,
from ../src/amd/vulkan/radv_pipeline.c:30:
../src/../include/vulkan/vulkan.h:54:10: fatal error: wayland-client.h: Datei
oder Verzeichnis nicht gefunden
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
The above command misses the include directory for wayland:
-I/usr/include/wayland
The missing include is contained in the (until now) unused radv_deps:
if with_platform_wayland
radv_deps += dep_wayland_client
radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
libradv_files += files('radv_wsi_wayland.c')
endif
Fixes: 673dda83307 "meson: build "radv" vulkan driver for radeon hardware"
Signed-off-by: Tobias Klausmann
Reviewed-by: Emil Velikov
Reviewed-by: Dylan Baker
(cherry picked from commit 9401a2f2e64bc04401a547d06810adbf0660edb8)
---
src/amd/vulkan/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build
index 0f1261d4809..cc2aa7fd17a 100644
--- a/src/amd/vulkan/meson.build
+++ b/src/amd/vulkan/meson.build
@@ -140,7 +140,7 @@ libvulkan_radeon = shared_library(
],
dependencies : [
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
- dep_valgrind,
+ dep_valgrind, radv_deps,
idep_nir,
],
c_args : [c_vis_args, no_override_init_args, radv_flags],
From babf9ab7da992299515ef01e46b15e627c8f976d Mon Sep 17 00:00:00 2001
From: Matt Turner
Date: Thu, 29 Nov 2018 15:46:18 -0800
Subject: [PATCH 094/220] mesa: Revert INTEL_fragment_shader_ordering support
This extension is not properly tested (testing for
GL_ARB_fragment_shader_interlock is not sufficient), and since this was
noted in review on August 28th no tests have been sent.
Revert "i965: Add INTEL_fragment_shader_ordering support."
Revert "mesa: Add GL/GLSL plumbing for INTEL_fragment_shader_ordering"
This reverts commit 03ecec9ed2099f6e2b62994b33dc948dc731e7b8.
This reverts commit 119435c8778dd26cb7c8bcde9f04b3982239fe60.
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Jason Ekstrand
Acked-by: Eric Anholt
(cherry picked from commit 017199d2d2e4c57015bc60edfcc656062c3a7472)
---
docs/relnotes/18.3.0.html | 1 -
src/compiler/glsl/builtin_functions.cpp | 17 -----------------
src/compiler/glsl/glsl_parser_extras.cpp | 1 -
src/compiler/glsl/glsl_parser_extras.h | 2 --
src/compiler/glsl/glsl_to_nir.cpp | 6 ------
src/compiler/glsl/ir.h | 1 -
src/compiler/nir/nir_intrinsics.py | 1 -
src/intel/compiler/brw_fs_nir.cpp | 1 -
src/mesa/drivers/dri/i965/intel_extensions.c | 1 -
src/mesa/main/extensions_table.h | 1 -
src/mesa/main/mtypes.h | 1 -
11 files changed, 33 deletions(-)
diff --git a/docs/relnotes/18.3.0.html b/docs/relnotes/18.3.0.html
index 8af225a61e1..aa924391919 100644
--- a/docs/relnotes/18.3.0.html
+++ b/docs/relnotes/18.3.0.html
@@ -61,7 +61,6 @@ New features
GL_EXT_vertex_attrib_64bit on i965, nvc0, radeonsi.
GL_EXT_window_rectangles on radeonsi.
GL_KHR_texture_compression_astc_sliced_3d on radeonsi.
-GL_INTEL_fragment_shader_ordering on i965.
GL_NV_fragment_shader_interlock on i965.
EGL_EXT_device_base for all drivers.
EGL_EXT_device_drm for all drivers.
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 5650365d1d5..b6018806865 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -525,12 +525,6 @@ supports_nv_fragment_shader_interlock(const _mesa_glsl_parse_state *state)
return state->NV_fragment_shader_interlock_enable;
}
-static bool
-supports_intel_fragment_shader_ordering(const _mesa_glsl_parse_state *state)
-{
- return state->INTEL_fragment_shader_ordering_enable;
-}
-
static bool
shader_clock(const _mesa_glsl_parse_state *state)
{
@@ -1311,11 +1305,6 @@ builtin_builder::create_intrinsics()
supports_arb_fragment_shader_interlock,
ir_intrinsic_end_invocation_interlock), NULL);
- add_function("__intrinsic_begin_fragment_shader_ordering",
- _invocation_interlock_intrinsic(
- supports_intel_fragment_shader_ordering,
- ir_intrinsic_begin_fragment_shader_ordering), NULL);
-
add_function("__intrinsic_shader_clock",
_shader_clock_intrinsic(shader_clock,
glsl_type::uvec2_type),
@@ -3430,12 +3419,6 @@ builtin_builder::create_builtins()
supports_nv_fragment_shader_interlock),
NULL);
- add_function("beginFragmentShaderOrderingINTEL",
- _invocation_interlock(
- "__intrinsic_begin_fragment_shader_ordering",
- supports_intel_fragment_shader_ordering),
- NULL);
-
add_function("anyInvocationARB",
_vote("__intrinsic_vote_any", vote),
NULL);
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 1bdd7c4bf17..efd1a013dbd 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -727,7 +727,6 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT_AEP(EXT_texture_buffer),
EXT_AEP(EXT_texture_cube_map_array),
EXT(INTEL_conservative_rasterization),
- EXT(INTEL_fragment_shader_ordering),
EXT(INTEL_shader_atomic_float_minmax),
EXT(MESA_shader_integer_functions),
EXT(NV_fragment_shader_interlock),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 966d848509c..69aa6cf9cf3 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -812,8 +812,6 @@ struct _mesa_glsl_parse_state {
bool EXT_texture_cube_map_array_warn;
bool INTEL_conservative_rasterization_enable;
bool INTEL_conservative_rasterization_warn;
- bool INTEL_fragment_shader_ordering_enable;
- bool INTEL_fragment_shader_ordering_warn;
bool INTEL_shader_atomic_float_minmax_enable;
bool INTEL_shader_atomic_float_minmax_warn;
bool MESA_shader_integer_functions_enable;
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 0479f8fcfe4..0956d2f6303 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -742,9 +742,6 @@ nir_visitor::visit(ir_call *ir)
case ir_intrinsic_end_invocation_interlock:
op = nir_intrinsic_end_invocation_interlock;
break;
- case ir_intrinsic_begin_fragment_shader_ordering:
- op = nir_intrinsic_begin_fragment_shader_ordering;
- break;
case ir_intrinsic_group_memory_barrier:
op = nir_intrinsic_group_memory_barrier;
break;
@@ -983,9 +980,6 @@ nir_visitor::visit(ir_call *ir)
case nir_intrinsic_end_invocation_interlock:
nir_builder_instr_insert(&b, &instr->instr);
break;
- case nir_intrinsic_begin_fragment_shader_ordering:
- nir_builder_instr_insert(&b, &instr->instr);
- break;
case nir_intrinsic_store_ssbo: {
exec_node *param = ir->actual_parameters.get_head();
ir_rvalue *block = ((ir_instruction *)param)->as_rvalue();
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index f478b29a6b5..d05d1998a50 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -1122,7 +1122,6 @@ enum ir_intrinsic_id {
ir_intrinsic_memory_barrier_shared,
ir_intrinsic_begin_invocation_interlock,
ir_intrinsic_end_invocation_interlock,
- ir_intrinsic_begin_fragment_shader_ordering,
ir_intrinsic_vote_all,
ir_intrinsic_vote_any,
diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index ec3049ca06d..910f9c336f8 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -199,7 +199,6 @@ def barrier(name):
barrier("memory_barrier_shared")
barrier("begin_invocation_interlock")
barrier("end_invocation_interlock")
-barrier("begin_fragment_shader_ordering")
# A conditional discard, with a single boolean source.
intrinsic("discard_if", src_comp=[1])
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index c845d87d59b..c33394d10d4 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4804,7 +4804,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
break;
}
- case nir_intrinsic_begin_fragment_shader_ordering:
case nir_intrinsic_begin_invocation_interlock: {
const fs_builder ubld = bld.group(8, 0);
const fs_reg tmp = ubld.vgrf(BRW_REGISTER_TYPE_UD, 2);
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index d7e02efb54d..0cfe2acbdd4 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -247,7 +247,6 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.OES_primitive_bounding_box = true;
ctx->Extensions.OES_texture_buffer = true;
ctx->Extensions.ARB_fragment_shader_interlock = true;
- ctx->Extensions.INTEL_fragment_shader_ordering = true;
if (can_do_pipelined_register_writes(brw->screen)) {
ctx->Extensions.ARB_draw_indirect = true;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 47db1583135..aac96290ded 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -317,7 +317,6 @@ EXT(IBM_texture_mirrored_repeat , dummy_true
EXT(INGR_blend_func_separate , EXT_blend_func_separate , GLL, x , x , x , 1999)
EXT(INTEL_conservative_rasterization , INTEL_conservative_rasterization , x , GLC, x , 31, 2013)
-EXT(INTEL_fragment_shader_ordering , INTEL_fragment_shader_ordering , GLL, GLC, x , x , 2013)
EXT(INTEL_performance_query , INTEL_performance_query , GLL, GLC, x , ES2, 2013)
EXT(INTEL_shader_atomic_float_minmax , INTEL_shader_atomic_float_minmax , GLL, GLC, x , x , 2018)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9ed49b7ff24..f30b778a7b1 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4296,7 +4296,6 @@ struct gl_extensions
GLboolean ATI_fragment_shader;
GLboolean GREMEDY_string_marker;
GLboolean INTEL_conservative_rasterization;
- GLboolean INTEL_fragment_shader_ordering;
GLboolean INTEL_performance_query;
GLboolean INTEL_shader_atomic_float_minmax;
GLboolean KHR_blend_equation_advanced;
From cc451083824a602298338cc4a34ff99123338f94 Mon Sep 17 00:00:00 2001
From: Matt Turner
Date: Mon, 3 Dec 2018 16:20:43 -0800
Subject: [PATCH 095/220] Revert "st/mesa: silenced unhanded enum warning in
st_glsl_to_tgsi.cpp"
This reverts commit 198c50f4873758e9f64d89eea262af5dd1644df9.
This needs to be reverted after commit 017199d2d2e4 ("mesa: Revert
INTEL_fragment_shader_ordering support")
(cherry picked from commit dd53bb7e1f69740a5712decbae79dc79df8ecaa1)
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 5322903b93a..0783f67f2b7 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4072,7 +4072,6 @@ glsl_to_tgsi_visitor::visit(ir_call *ir)
case ir_intrinsic_generic_atomic_comp_swap:
case ir_intrinsic_begin_invocation_interlock:
case ir_intrinsic_end_invocation_interlock:
- case ir_intrinsic_begin_fragment_shader_ordering:
unreachable("Invalid intrinsic");
}
}
From d369bd91c3b501941886e0fde9eab5266dde6f06 Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen
Date: Mon, 26 Nov 2018 16:26:35 +0100
Subject: [PATCH 096/220] radv/android: Mark android WSI image as shareable.
Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer."
Acked-by: Samuel Pitoiset
(cherry picked from commit 51091b3e1f212be956f91ac5214191c14e83ac59)
---
src/amd/vulkan/radv_android.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/amd/vulkan/radv_android.c b/src/amd/vulkan/radv_android.c
index f5d70825dd2..93799b87b8f 100644
--- a/src/amd/vulkan/radv_android.c
+++ b/src/amd/vulkan/radv_android.c
@@ -110,9 +110,19 @@ radv_image_from_gralloc(VkDevice device_h,
struct radv_bo *bo = NULL;
VkResult result;
+ VkImageCreateInfo updated_base_info = *base_info;
+
+ VkExternalMemoryImageCreateInfo external_memory_info = {
+ .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
+ .pNext = updated_base_info.pNext,
+ .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
+ };
+
+ updated_base_info.pNext = &external_memory_info;
+
result = radv_image_create(device_h,
&(struct radv_image_create_info) {
- .vk_info = base_info,
+ .vk_info = &updated_base_info,
.scanout = true,
.no_metadata_planes = true},
alloc,
From 5594bb584d538164e1b35b1eb6fcacd8c2b26c2f Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen