[Mesa-dev] [PATCH] glsl: handle error case with ast_post_inc, ast_post_dec

2018-08-06 Thread Tapani Pälli
Return ir_rvalue::error_value with ast_post_inc, ast_post_dec if
parser error was emitted previously. This way process_array_size
won't see bogus IR generated like with commit 9c676a64273.

Signed-off-by: Tapani Pälli 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98699
---
 src/compiler/glsl/ast_to_hir.cpp | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 74160ec142b..5d3f10b6823 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1928,6 +1928,11 @@ ast_expression::do_hir(exec_list *instructions,
 
   error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
 
+  if (error_emitted) {
+ result = ir_rvalue::error_value(ctx);
+ break;
+  }
+
   type = arithmetic_result_type(op[0], op[1], false, state, & loc);
 
   ir_rvalue *temp_rhs;
-- 
2.14.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] [rfc] r600: set vpm bit for loop start clause

2018-08-06 Thread Dave Airlie
On 5 August 2018 at 19:47, Gert Wollny  wrote:
> Am Freitag, den 03.08.2018, 06:02 +0200 schrieb Roland Scheidegger:
>> Am 03.08.2018 um 05:10 schrieb Dave Airlie:
>> > From: Dave Airlie 
>> >
>> > This fixes some hangs with the arb_shader_image_load_store-
>> > atomicity tests
>> > on evergreen/cayman GPUs.
>> >
>> > I'm not 100% sure why (VPM hurts my brain), I'm running some piglit
>> > runs to see if it has any bad side effects.
>> > ---
>> >  src/gallium/drivers/r600/r600_shader.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/gallium/drivers/r600/r600_shader.c
>> > b/src/gallium/drivers/r600/r600_shader.c
>> > index 2229dc8fab3..1341bf2c48c 100644
>> > --- a/src/gallium/drivers/r600/r600_shader.c
>> > +++ b/src/gallium/drivers/r600/r600_shader.c
>> > @@ -10587,7 +10587,7 @@ static int tgsi_bgnloop(struct
>> > r600_shader_ctx *ctx)
>> > /* LOOP_START_DX10 ignores the LOOP_CONFIG* registers, so
>> > it is not
>> >  * limited to 4096 iterations, like the other LOOP_*
>> > instructions. */
>> > r600_bytecode_add_cfinst(ctx->bc, CF_OP_LOOP_START_DX10);
>> > -
>> > +   ctx->bc->cf_last->vpm = 1;
>> > fc_pushlevel(ctx, FC_LOOP);
>> >
>> > /* check stack depth */
>> >
>>
>> I think you might get incorrect derivatives afterwards (if some
>> pixels in a quad were invalid)? Or are the lanes in the alu still
>> active (I
>> don't really understand all the vpm stuff...) afterwards?
>>
>> I'm wondering if the tests are just bad? You can get lockups rather
>> easily if you're not extra careful with atomics in loops (because the
>> result of the atomic is undefined for helper invocations, and the hw
>> will never store the result).
>> There was recently some discussion about this on mesa-dev, also see
>> https://bugs.freedesktop.org/show_bug.cgi?id=106902
>
> I might add that I've also played around to get rid of these locks, at
> least to be able to run the gpu test set completely, so I did one
> thing, I limited the number of iterations by using an extra counter,
> and with that this particular test passed, which means that some
> instance of the shader is really running the loop with bogous data.
> This patch fixed the unmodified piglit for me.
>
> Another piglit,
>
> arb_shader_storage_buffer_object/
>execution/ssbo-atomicCompSwap-int.shader_test
>
> still hangs for some time (on barts), but it has an extra protection
> against helper invocations. This test also fails when I put in such a
> savety counter to break the loop after 1000 iterations,  so I guess the
> failure is geniue, but failing this test should not result in a GPU
> lockup. I guess tests that might lockup a GPU are needed to be able to
> debug problems, but IMHO they should not be part of some of these
> general test sets.
>
> Because of these lockups I have no data to compare older runs. With
> this patch and the ssbo test fixed up I got
>
> [26236/26236] skip: 10688, pass: 15118, warn: 13, fail: 412, crash: 5
>
> for the full gpu set on BARTS in single thread mode, on CEDAR I got
> some other, unrelated  GPU lockups.
>
> Looking only at the texture piglits that failed, there were no
> regressions with respect to this patch.
>
> When running piglit multithreaded I still get lockups that bring down
> the graphics card so that it was no longer fully usable and a cold
> restart is needed. In these cases various piglits that run tests with
> atomics are running in parallel, and notable the process running
> arb_compute_shader-local-id could not be killed a all.

I might have sent a patch to hopefully handle deadlock with parallel
atomic counter tests


https://patchwork.freedesktop.org/series/47787/


>
> In any case, this patch looks like an enhacement to me, because it
> makes lockups less likely, and I didn't see regressions, so
>   Tested-By: Gert Wollny 

Thanks, I'm probably going to revise this so only certain loops get vpm
on them,

Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] r600/eg: rework atomic counter emission with flushes

2018-08-06 Thread Dave Airlie
From: Dave Airlie 

With the current code, we didn't do the space checks prior
to atomic counter setup emission, but we also didn't add
atomic counters to the space check so we could get a flush
later as well.

These flushes would be bad, and lead to problems with
parallel tests. We have to ensure the atomic counter copy in,
draw emits and counter copy out are kept in the same command
submission unit.

This reworks the code to drop some useless masks, make the
counting separate to the emits, and make the space checker
handle atomic counter space.
---
 src/gallium/drivers/r600/evergreen_compute.c  | 11 --
 .../drivers/r600/evergreen_hw_context.c   |  2 +-
 src/gallium/drivers/r600/evergreen_state.c| 38 +++
 src/gallium/drivers/r600/r600_hw_context.c|  7 +++-
 src/gallium/drivers/r600/r600_pipe.h  | 14 ---
 src/gallium/drivers/r600/r600_state_common.c  | 13 +--
 6 files changed, 54 insertions(+), 31 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_compute.c 
b/src/gallium/drivers/r600/evergreen_compute.c
index 90eae1e2829..a77f58242e3 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -715,7 +715,6 @@ static void compute_emit_cs(struct r600_context *rctx,
rctx->cmd_buf_is_compute = true;
}
 
-   r600_need_cs_space(rctx, 0, true);
if (rctx->cs_shader_state.shader->ir_type == PIPE_SHADER_IR_TGSI) {
r600_shader_select(>b.b, 
rctx->cs_shader_state.shader->sel, _dirty);
current = rctx->cs_shader_state.shader->sel->current;
@@ -742,16 +741,22 @@ static void compute_emit_cs(struct r600_context *rctx,
}
rctx->cs_block_grid_sizes[3] = rctx->cs_block_grid_sizes[7] = 0;

rctx->driver_consts[PIPE_SHADER_COMPUTE].cs_block_grid_size_dirty = true;
+
+   evergreen_emit_atomic_buffer_setup_count(rctx, current, 
combined_atomics, _used_mask);
+   r600_need_cs_space(rctx, 0, true, 
util_bitcount(atomic_used_mask));
+
if (need_buf_const) {
eg_setup_buffer_constants(rctx, PIPE_SHADER_COMPUTE);
}
r600_update_driver_const_buffers(rctx, true);
 
-   if (evergreen_emit_atomic_buffer_setup(rctx, current, 
combined_atomics, _used_mask)) {
+   evergreen_emit_atomic_buffer_setup(rctx, true, 
combined_atomics, atomic_used_mask);
+   if (atomic_used_mask) {
radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_CS_PARTIAL_FLUSH) 
| EVENT_INDEX(4));
}
-   }
+   } else
+   r600_need_cs_space(rctx, 0, true, 0);
 
/* Initialize all the compute-related registers.
 *
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c 
b/src/gallium/drivers/r600/evergreen_hw_context.c
index d3f3e227c1f..5e0e27b0f16 100644
--- a/src/gallium/drivers/r600/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -109,7 +109,7 @@ void evergreen_cp_dma_clear_buffer(struct r600_context 
*rctx,
 
r600_need_cs_space(rctx,
   10 + (rctx->b.flags ? 
R600_MAX_FLUSH_CS_DWORDS : 0) +
-  R600_MAX_PFP_SYNC_ME_DWORDS, FALSE);
+  R600_MAX_PFP_SYNC_ME_DWORDS, FALSE, 0);
 
/* Flush the caches for the first copy only. */
if (rctx->b.flags) {
diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index 57e81e30c27..cc41e114369 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -4030,7 +4030,6 @@ static void evergreen_set_hw_atomic_buffers(struct 
pipe_context *ctx,
 
if (!buffers || !buffers[idx].buffer) {
pipe_resource_reference(>buffer, NULL);
-   astate->enabled_mask &= ~(1 << i);
continue;
}
buf = [idx];
@@ -4038,7 +4037,6 @@ static void evergreen_set_hw_atomic_buffers(struct 
pipe_context *ctx,
pipe_resource_reference(>buffer, buf->buffer);
abuf->buffer_offset = buf->buffer_offset;
abuf->buffer_size = buf->buffer_size;
-   astate->enabled_mask |= (1 << i);
}
 }
 
@@ -4868,20 +4866,15 @@ static void cayman_write_count_to_gds(struct 
r600_context *rctx,
radeon_emit(cs, reloc);
 }
 
-bool evergreen_emit_atomic_buffer_setup(struct r600_context *rctx,
-   struct r600_pipe_shader *cs_shader,
-   struct r600_shader_atomic 
*combined_atomics,
-   uint8_t *atomic_used_mask_p)
+void 

[Mesa-dev] [PATCH v3 38/48] meson: don't build gallium trivial tests on windows

2018-08-06 Thread Dylan Baker
They require the pipe-loaders, which require xmlconfig, which doesn't
build with msvc.
---
 src/gallium/tests/meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 0ee04350c87..15b9f549647 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -18,7 +18,10 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-subdir('trivial')
+if not with_platform_windows
+  # pipe-loader doesn't build on windows.
+  subdir('trivial')
+endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 34/48] util/tests: Use define instead of VLA

2018-08-06 Thread Dylan Baker
To allow the this test to be built with MSVC, which doesn't support
VLAs.
---
 src/util/tests/hash_table/clear.c | 13 +++--
 src/util/tests/hash_table/delete_management.c | 13 +++--
 src/util/tests/hash_table/insert_many.c   | 11 ++-
 src/util/tests/hash_table/meson.build |  1 +
 src/util/tests/hash_table/random_entry.c  |  7 ---
 src/util/tests/string_buffer/meson.build  |  1 +
 6 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/util/tests/hash_table/clear.c 
b/src/util/tests/hash_table/clear.c
index 526700bfb0f..19494844608 100644
--- a/src/util/tests/hash_table/clear.c
+++ b/src/util/tests/hash_table/clear.c
@@ -23,6 +23,8 @@
 
 #include "hash_table.h"
 
+#define SIZE 1000
+
 static void *make_key(uint32_t i)
 {
   return (void *)(uintptr_t)(1 + i);
@@ -54,13 +56,12 @@ int main()
 {
struct hash_table *ht;
struct hash_entry *entry;
-   const uint32_t size = 1000;
-   bool flags[size];
+   bool flags[SIZE];
uint32_t i;
 
ht = _mesa_hash_table_create(NULL, key_hash, key_equal);
 
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), [i]);
}
@@ -70,19 +71,19 @@ int main()
 
/* Check that delete_function was called and that repopulating the table
 * works. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(flags[i]);
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), [i]);
}
 
/* Check that exactly the right set of entries is in the table. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(_mesa_hash_table_search(ht, make_key(i)));
}
 
hash_table_foreach(ht, entry) {
-  assert(key_id(entry->key) < size);
+  assert(key_id(entry->key) < SIZE);
}
 
_mesa_hash_table_destroy(ht, NULL);
diff --git a/src/util/tests/hash_table/delete_management.c 
b/src/util/tests/hash_table/delete_management.c
index 127d81b3ca9..e3be9fb3d99 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,7 +57,7 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
@@ -69,7 +70,7 @@ main(int argc, char **argv)
}
 
/* Make sure that all our entries were present at the end. */
-   for (i = size - 100; i < size; i++) {
+   for (i = SIZE - 100; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
@@ -79,8 +80,8 @@ main(int argc, char **argv)
for (entry = _mesa_hash_table_next_entry(ht, NULL);
 entry != NULL;
 entry = _mesa_hash_table_next_entry(ht, entry)) {
-  assert(key_value(entry->key) >= size - 100 &&
- key_value(entry->key) < size);
+  assert(key_value(entry->key) >= SIZE - 100 &&
+ key_value(entry->key) < SIZE);
}
assert(ht->entries == 100);
 
diff --git a/src/util/tests/hash_table/insert_many.c 
b/src/util/tests/hash_table/insert_many.c
index b07e40842bf..6bd35d5c0c7 100644
--- a/src/util/tests/hash_table/insert_many.c
+++ b/src/util/tests/hash_table/insert_many.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,18 +57,18 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
}
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
}
-   assert(ht->entries == size);
+   assert(ht->entries == SIZE);
 
_mesa_hash_table_destroy(ht, NULL);
 
diff --git a/src/util/tests/hash_table/meson.build 
b/src/util/tests/hash_table/meson.build
index c7b03f19c56..93605d1e77f 100644
--- a/src/util/tests/hash_table/meson.build
+++ b/src/util/tests/hash_table/meson.build
@@ -27,6 +27,7 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 
'delete_management',
 executable(
  

[Mesa-dev] [PATCH v3 43/48] meson: maintain names of shared API libraries

2018-08-06 Thread Dylan Baker
Mesa uses the lib prefix, and doesn't use a version for it's dynamic
libraries, which meson defaults to.

v2: - this patch
---
 src/mapi/es1api/meson.build   | 2 ++
 src/mapi/es2api/meson.build   | 2 ++
 src/mapi/shared-glapi/meson.build | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 448cf1c73d2..4e4f35df969 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -46,7 +46,9 @@ libglesv1_cm = shared_library(
   include_directories : [inc_src, inc_include, inc_mapi],
   link_with : libglapi,
   dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl],
+  soversion : host_machine.system() == 'windows' ? '' : '1',
   version : '1.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index cb6a70a2e90..a8d032672e2 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -46,7 +46,9 @@ libgles2 = shared_library(
   include_directories : [inc_src, inc_include, inc_mapi],
   link_with : libglapi,
   dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl],
+  soversion : host_machine.system() == 'windows' ? '' : '2',
   version : '2.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
diff --git a/src/mapi/shared-glapi/meson.build 
b/src/mapi/shared-glapi/meson.build
index e1f68691b48..05459a5116e 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -53,7 +53,9 @@ libglapi = shared_library(
   link_args : [ld_args_gc_sections],
   include_directories : [inc_src, inc_include, inc_mapi],
   dependencies : [dep_thread, dep_selinux],
+  soversion : host_machine.system() == 'windows' ? '' : '0',
   version : '0.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 14/48] meson: Make shader-cache a trillean instead of boolean

2018-08-06 Thread Dylan Baker
So that it can be implicitly disabled on windows, where it doesn't
compile.

v2: - Use an auto-option rather than automagic.
- fix shader_cache check (== -> !=)
---
 meson.build   | 16 +---
 meson_options.txt |  5 +++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index 4350e1af810..4dc76732d4a 100644
--- a/meson.build
+++ b/meson.build
@@ -722,9 +722,19 @@ if get_option('buildtype') == 'debug'
   pre_args += '-DDEBUG'
 endif
 
-if get_option('shader-cache')
-  pre_args += '-DENABLE_SHADER_CACHE'
-elif with_amd_vk
+with_shader_cache = false
+_shader_cache = get_option('shader-cache')
+if _shader_cache != 'false'
+  if host_machine.system() == 'windows'
+if _shader_cache == 'true'
+  error('Shader Cache does not currently work on Windows')
+endif
+  else
+pre_args += '-DENABLE_SHADER_CACHE'
+with_shader_cache = true
+  endif
+endif
+if with_amd_vk and not with_shader_cache
   error('Radv requires shader cache support')
 endif
 
diff --git a/meson_options.txt b/meson_options.txt
index b8df253b323..cb21a68f131 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -158,8 +158,9 @@ option(
 )
 option(
   'shader-cache',
-  type : 'boolean',
-  value : true,
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
   description : 'Build with on-disk shader cache support'
 )
 option(
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 37/48] meson: Set visibility and compat args for graw

2018-08-06 Thread Dylan Baker
---
 src/gallium/targets/graw-gdi/meson.build  | 1 +
 src/gallium/targets/graw-null/meson.build | 2 ++
 src/gallium/targets/graw-xlib/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/gallium/targets/graw-gdi/meson.build 
b/src/gallium/targets/graw-gdi/meson.build
index e04b454ab53..b742b0a11a2 100644
--- a/src/gallium/targets/graw-gdi/meson.build
+++ b/src/gallium/targets/graw-gdi/meson.build
@@ -21,6 +21,7 @@
 libgraw_gdi = shared_library(
   'graw',
   'graw_gdi.c',
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
 inc_gallium_winsys_sw,
diff --git a/src/gallium/targets/graw-null/meson.build 
b/src/gallium/targets/graw-null/meson.build
index 8a294f41307..0b7c6ff40e6 100644
--- a/src/gallium/targets/graw-null/meson.build
+++ b/src/gallium/targets/graw-null/meson.build
@@ -21,12 +21,14 @@
 libgraw_util = static_library(
   'graw_util',
   ['graw_util.c'],
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : inc_common,
 )
 
 libgraw_null = shared_library(
   'graw_null',
   ['graw_null.c'],
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : inc_common,
   link_with : [libmesa_util, libgallium],
 )
diff --git a/src/gallium/targets/graw-xlib/meson.build 
b/src/gallium/targets/graw-xlib/meson.build
index aab99ba64c1..13567355d2c 100644
--- a/src/gallium/targets/graw-xlib/meson.build
+++ b/src/gallium/targets/graw-xlib/meson.build
@@ -21,6 +21,7 @@
 libgraw_xlib = shared_library(
   'graw_xlib',
   ['graw_xlib.c'],
+  c_args : [c_vis_args],
   include_directories : [inc_common, inc_gallium_drivers, inc_gallium_winsys],
   link_with : [
 libgraw_util, libmesa_util, libgallium, libws_xlib
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 35/48] meson: Don't build glsl cache_test for windows

2018-08-06 Thread Dylan Baker
v2: - Use new with_shader_cache variable instead of
  host_machine.system() == 'windows'
---
 src/compiler/glsl/tests/meson.build | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index fc7b863a278..a08e9fcb904 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -29,18 +29,19 @@ test(
   )
 )
 
-test(
-  'cache_test',
-  executable(
+if with_shader_cache
+  test(
 'cache_test',
-'cache_test.c',
-c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
-include_directories : [inc_common, inc_glsl],
-link_with : [libglsl],
-dependencies : [dep_clock, dep_thread],
+executable(
+  'cache_test',
+  'cache_test.c',
+  c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
+  include_directories : [inc_common, inc_glsl],
+  link_with : [libglsl],
+  dependencies : [dep_clock, dep_thread],
+)
   )
-)
-
+endif
 
 test(
   'general_ir_test',
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 24/48] util/xmlconfig: include strndup.h for windows

2018-08-06 Thread Dylan Baker
---
 src/util/xmlconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index ba657294c1c..e204e52b71d 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include "strndup.h"
 #include "xmlconfig.h"
 #include "u_process.h"
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 46/48] appveyor: Add support for meson as well as scons

2018-08-06 Thread Dylan Baker
---
 appveyor.yml | 35 ---
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 86440f0d76a..26f50ce2596 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -42,20 +42,29 @@ os: Visual Studio 2015
 environment:
   WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
+  matrix:
+- BUILD_SYSTEM: meson
+- BUILD_SYSTEM: scons
 
 install:
 # Check pip
-- python --version
-- python -m pip --version
+- py -2.7-32 --version
+- py -2.7-32 -m pip --version
+- py -3.7-64 --version
+- py -3.7-64 -m pip --version
 # Install Mako
 - python -m pip install Mako==1.0.6
-# Install pywin32 extensions, needed by SCons
-- python -m pip install pypiwin32
-# Install python wheels, necessary to install SCons via pip
-- python -m pip install wheel
-# Install SCons
-- python -m pip install scons==2.5.1
-- scons --version
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install pypiwin32 wheel
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install scons==2.5.1
+- if "%BUILD_SYSTEM%"=="scons" set Path=C:\Python27\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="scons" scons --version
+- if "%BUILD_SYSTEM%"=="meson" py -2.7-64 -m pip install mako
+- if "%BUILD_SYSTEM%"=="meson" py -3.7-64 -m pip install meson
+- if "%BUILD_SYSTEM%"=="meson" set Path=C:\Python37-x64\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="meson" meson --version
+- if "%BUILD_SYSTEM%"=="meson" cinst -y ninja pkgconfiglite
+- if "%BUILD_SYSTEM%"=="meson" ninja --version
+- if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86_amd64
 # Install flex/bison
 - if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%;
 - 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
@@ -69,10 +78,14 @@ install:
 - set LLVM=%CD%\llvm
 
 build_script:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="meson" meson builddir -Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir
 
 after_build:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1 check
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1 check
+# Doesn't work yet, a large number of tests fail
+#- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir test
 
 
 # It's possible to setup notification here, as described in
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 30/48] meson: disable sse4.1 optimizations with msvc

2018-08-06 Thread Dylan Baker
There isn't an obvious command line switch here, /arch:AVX *might* be
the right thing, but meson doesn't know what to do here either and
leaves the -msse4.1 and -mstackrealign.
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 73a69dc3fc1..aaa7d9990ab 100644
--- a/meson.build
+++ b/meson.build
@@ -876,7 +876,7 @@ else
   endforeach
 endif
 
-if host_machine.cpu_family().startswith('x86')
+if host_machine.cpu_family().startswith('x86') and cc.get_id() != 'msvc'
   pre_args += '-DUSE_SSE41'
   with_sse41 = true
   sse41_args = ['-msse4.1']
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 04/48] meson: add a expat subproject

2018-08-06 Thread Dylan Baker
---
 meson.build|  2 +-
 subprojects/expat.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/expat.wrap

diff --git a/meson.build b/meson.build
index 6960db9e9de..c7dd5ddfec6 100644
--- a/meson.build
+++ b/meson.build
@@ -1064,7 +1064,7 @@ if with_amd_vk or with_gallium_radeonsi or 
with_gallium_r600 or with_gallium_ope
 else
   dep_elf = null_dep
 endif
-dep_expat = dependency('expat')
+dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'])
 # this only exists on linux so either this is linux and it will be found, or
 # its not linux and and wont
 dep_m = cc.find_library('m', required : false)
diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap
new file mode 100644
index 000..0b7c53e54db
--- /dev/null
+++ b/subprojects/expat.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = expat-2.2.5
+
+source_url = 
https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
+source_filename = expat-2.2.5.tar.bz2
+source_hash = d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.5/4/get_zip
+patch_filename = expat-2.2.5-4-wrap.zip
+patch_hash = 25748839be2bbdd2ff586d1a05aa6fc37aeada75c78416df6e8347a6321abaac
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 00/48] Meson for windows

2018-08-06 Thread Dylan Baker
Mostly this is the same thing as before, just rebased on master. A couple of the
patches from v2 have already landed. I've also fix the bad rebase of Erik's
patch to use the python module for finding python, and updated the appveyor
instance to work, and use msbuild instead of ninja.

Dylan Baker (48):
  meson: always define libglapi
  add a git ignore for subprojects
  meson: add a zlib subproject
  meson: add a expat subproject
  gallium: fix ddebug on windows
  glapi: export glapi_destroy_multithread when building shared-glapi on
windows
  glsl: fix general_ir_test with mingw
  meson: fix dl detection on non cygwin windows
  meson: build getopt when using msvc
  meson: Add a platform for windows
  meson: don't build glx or dri by default on windows
  meson: don't allow glvnd on windows
  meson: add windows compiler checks and libraries
  meson: Make shader-cache a trillean instead of boolean
  meson: Add windows defines to glapi
  meson: Add necessary defines for mesa_gallium on windows
  meson: build gallium gdi winsys
  meson: build wgl state tracker
  meson: build libgl-gdi target
  meson: build graw-gdi target
  meson: fix gallium-osmesa to build for windows
  meson: Don't check for posix_memalign on windows
  meson: Add support for wrapping llvm
  util/xmlconfig: include strndup.h for windows
  meson: fix pipe-loader compilation for windows
  meson: don't look for rt on windows
  meson: Add support for using win_flex and win_bison on windows
  meson: make nm binary optional
  meson: for incluse of inttypes.h for glcpp with msvc
  meson: disable sse4.1 optimizations with msvc
  meson: add switches for SWR with MSVC
  meson: don't define GLX_USE_TLS for windows
  meson: Add idep_getopt for tests
  util/tests: Use define instead of VLA
  meson: Don't build glsl cache_test for windows
  glsl/tests: define ssize_t on windows
  meson: Set visibility and compat args for graw
  meson: don't build gallium trivial tests on windows
  meson: Fix gtest linkage on msvc
  meson: disable graw tests on mingw
  meson: don't build or run mesa-sha1 test on windows
  tests/vma: fix build with MSVC
  meson: maintain names of shared API libraries
  meson: Use python module to find python2 on windows
  meson: Add linker arguments for windows
  appveyor: Add support for meson as well as scons
  appveyor: use chocolatey (cinst) to install winflexbison
  use msbuild instead of ninja

 appveyor.yml  |  41 +-
 docs/meson.html   |  66 +++
 meson.build   | 389 --
 meson_options.txt |  12 +-
 src/compiler/glsl/glcpp/meson.build   |  16 +-
 src/compiler/glsl/meson.build |   6 +-
 src/compiler/glsl/tests/blob_test.c   |   4 +
 src/compiler/glsl/tests/general_ir_test.cpp   |  14 +-
 src/compiler/glsl/tests/meson.build   |  21 +-
 src/egl/meson.build   |   2 +-
 src/gallium/auxiliary/meson.build |   6 +
 src/gallium/auxiliary/pipe-loader/meson.build |   9 +-
 src/gallium/drivers/swr/meson.build   |   3 +-
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 src/gallium/meson.build   |  14 +-
 src/gallium/state_trackers/osmesa/meson.build |  12 +-
 .../{osmesa => wgl}/meson.build   |  32 +-
 .../{graw-xlib => graw-gdi}/meson.build   |  21 +-
 src/gallium/targets/graw-null/meson.build |   2 +
 src/gallium/targets/graw-xlib/meson.build |   1 +
 .../{graw-xlib => libgl-gdi}/meson.build  |  30 +-
 src/gallium/targets/osmesa/meson.build|  11 +-
 src/gallium/tests/meson.build |  11 +-
 .../{tests => winsys/sw/gdi}/meson.build  |  12 +-
 src/gbm/meson.build   |   2 +-
 src/{gallium/tests => getopt}/meson.build |  14 +-
 src/gtest/meson.build |   7 +
 src/mapi/es1api/meson.build   |  14 +-
 src/mapi/es2api/meson.build   |  14 +-
 src/mapi/glapi/glapi.h|   2 +-
 src/mapi/glapi/meson.build|  13 +-
 src/mapi/meson.build  |   2 +
 src/mapi/shared-glapi/meson.build |  11 +-
 src/mesa/meson.build  |  12 +-
 src/meson.build   |   5 +
 src/util/meson.build  |  21 +-
 src/util/tests/hash_table/clear.c |  13 +-
 src/util/tests/hash_table/delete_management.c |  13 +-
 src/util/tests/hash_table/insert_many.c   |  11 +-
 src/util/tests/hash_table/meson.build |   1 +
 src/util/tests/hash_table/random_entry.c  |   7 +-
 src/util/tests/string_buffer/meson.build  |   1 +
 src/util/tests/vma/vma_random_test.cpp|   8 +
 src/util/xmlconfig.c  |   1 +
 subprojects/.gitignore|   3 +
 subprojects/expat.wrap|  10 +
 

[Mesa-dev] [PATCH v3 36/48] glsl/tests: define ssize_t on windows

2018-08-06 Thread Dylan Baker
---
 src/compiler/glsl/tests/blob_test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/glsl/tests/blob_test.c 
b/src/compiler/glsl/tests/blob_test.c
index 1cc97236e7e..21b8b1efdc1 100644
--- a/src/compiler/glsl/tests/blob_test.c
+++ b/src/compiler/glsl/tests/blob_test.c
@@ -28,6 +28,10 @@
 #include 
 #include 
 #include 
+#ifdef _MSC_VER
+#include 
+typedef SSIZE_T ssize_t;
+#endif
 
 #include "util/ralloc.h"
 #include "blob.h"
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 39/48] meson: Fix gtest linkage on msvc

2018-08-06 Thread Dylan Baker
We need to add an extra flag (/SUBSYSTEM:CONSOLE) to get the msvc linker
to find main() in a static library.
---
 src/gtest/meson.build | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/gtest/meson.build b/src/gtest/meson.build
index 91a49240416..ed0d6974bd3 100644
--- a/src/gtest/meson.build
+++ b/src/gtest/meson.build
@@ -25,7 +25,14 @@ libgtest = static_library(
   build_by_default : false,
 )
 
+_gtest_link_args = []
+if cpp.get_id() == 'msvc'
+  # required to use main() from a static library
+  _gtest_link_args += '/SUBSYSTEM:CONSOLE'
+endif
+
 idep_gtest = declare_dependency(
   link_with : libgtest,
+  link_args : _gtest_link_args,
   include_directories : include_directories('include', is_system : true),
 )
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 31/48] meson: add switches for SWR with MSVC

2018-08-06 Thread Dylan Baker
---
 src/gallium/drivers/swr/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/swr/meson.build 
b/src/gallium/drivers/swr/meson.build
index b95c8bc1bf8..ec4d80e4bb2 100644
--- a/src/gallium/drivers/swr/meson.build
+++ b/src/gallium/drivers/swr/meson.build
@@ -191,6 +191,7 @@ swr_arch_defines = []
 
 swr_avx_args = cpp.first_supported_argument(
   '-target-cpu=sandybridge', '-mavx', '-march=core-avx', '-tp=sandybridge',
+  '/arch:AVX',
   prefix : '''
 #if !defined(__AVX__)
 # error
@@ -215,7 +216,7 @@ endif
 
 if with_swr_arches.contains('avx2')
   swr_avx2_args = cpp.first_supported_argument(
-'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell',
+'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell', '/arch:AVX2',
 prefix : '''
   #if !defined(__AVX2__)
   # error
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 44/48] meson: Use python module to find python2 on windows

2018-08-06 Thread Dylan Baker
The python installer on Windows installs two `python.exe`, one for
python2 and one for python3 and no `python2.exe` nor `python3.exe`.

This seems utterly broken to me, but luckily for us meson handles this
craziness for us, but only since version 0.46.

This is higher than we require for now, but since we only need this on
Windows, I suggest bumping the required version only on windows, and
leaving all the other OSes as is.

(Note: some future version of Meson (0.48 probably) will handle this
 internally in the find_program() call.)

Reported-by: Alexander Ashevchenko 
Cc: Mathieu Bridon 
Signed-off-by: Eric Engestrom 
Reviewed-by: Dylan Baker 
---
 meson.build | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 100d12f475d..bbfd7c3c73f 100644
--- a/meson.build
+++ b/meson.build
@@ -710,7 +710,15 @@ if with_platform_haiku
   pre_args += '-DHAVE_HAIKU_PLATFORM'
 endif
 
-prog_python2 = find_program('python2')
+if build_machine.system() == 'windows'
+  if meson.version().version_compare('< 0.46')
+error('Windows requires Meson 0.46+; please update and try again.')
+  else
+prog_python2 = import('python').find_installation('python2')
+  endif
+else
+  prog_python2 = find_program('python2')
+endif
 has_mako = run_command(prog_python2, '-c', 'import mako')
 if has_mako.returncode() != 0
   error('Python (2.x) mako module required to build mesa.')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 21/48] meson: fix gallium-osmesa to build for windows

2018-08-06 Thread Dylan Baker
v2: - set so_version to '' (only affects windows)
- always set lib prefix to 'lib', even on msvc
---
 src/gallium/state_trackers/osmesa/meson.build | 12 ++--
 src/gallium/targets/osmesa/meson.build| 11 ++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/osmesa/meson.build 
b/src/gallium/state_trackers/osmesa/meson.build
index 912a6226f74..26ec8084f93 100644
--- a/src/gallium/state_trackers/osmesa/meson.build
+++ b/src/gallium/state_trackers/osmesa/meson.build
@@ -1,4 +1,4 @@
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -18,10 +18,18 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+osmesa_st_c_args = []
+if with_platform_windows
+  osmesa_st_c_args += ['-DBUILD_GL32', '-DWIN32_LEAN_AND_MEAN']
+  if not with_gles1
+osmesa_st_c_args += ['-D_GLAPI_NO_EXPORTS']
+  endif
+endif
+
 libosmesa_st = static_library(
   'osmesa_st',
   'osmesa.c',
-  c_args : ['-DGALLIUM_SOFTPIPE'],
+  c_args : osmesa_st_c_args,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
   ],
diff --git a/src/gallium/targets/osmesa/meson.build 
b/src/gallium/targets/osmesa/meson.build
index b4ae8f4b6ec..d92117988eb 100644
--- a/src/gallium/targets/osmesa/meson.build
+++ b/src/gallium/targets/osmesa/meson.build
@@ -32,12 +32,19 @@ if with_ld_version_script
   osmesa_link_deps += files('osmesa.sym')
 endif
 
+if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
+  osmesa_def = 'osmesa.mingw.def'
+else
+  osmesa_def = 'osmesa.def'
+endif
+
 libosmesa = shared_library(
   osmesa_lib_name,
   'target.c',
   c_args : [c_vis_args],
   cpp_args : cpp_vis_args,
   link_args : [ld_args_gc_sections, osmesa_link_args],
+  vs_module_defs : osmesa_def,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_winsys,
 inc_gallium_drivers,
@@ -48,10 +55,12 @@ libosmesa = shared_library(
 libmesa_gallium, libgallium, libglapi_static, libws_null, osmesa_link_with,
   ],
   dependencies : [
-dep_selinux, dep_thread, dep_clock, dep_unwind,
+dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
 driver_swrast, driver_swr,
   ],
+  soversion : host_machine.system() == 'windows' ? '' : '8',
   version : '8.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 33/48] meson: Add idep_getopt for tests

2018-08-06 Thread Dylan Baker
There are quite a few tests that require getopt, when using MSVC we need
to use the bundled version of getopt since there isn't a system version.
---
 src/compiler/glsl/glcpp/meson.build | 2 +-
 src/compiler/glsl/meson.build   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index 80f51a3e48e..3ab8ddee7f0 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -58,7 +58,7 @@ libglcpp = static_library(
 glcpp = executable(
   'glcpp',
   'glcpp.c',
-  dependencies : [dep_m],
+  dependencies : [dep_m, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglcpp, libglsl_util],
   c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index df1c086671d..4afcfe03611 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -229,7 +229,7 @@ libglsl_standalone = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
   link_with : [libglsl, libglsl_util, libmesa_util],
-  dependencies : [dep_thread],
+  dependencies : [dep_thread, idep_getopt],
   build_by_default : false,
 )
 
@@ -238,7 +238,7 @@ glsl_compiler = executable(
   'main.cpp',
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglsl_standalone],
   build_by_default : with_tools.contains('glsl'),
@@ -252,7 +252,7 @@ glsl_test = executable(
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   link_with : [libglsl, libglsl_standalone, libglsl_util],
   build_by_default : with_tools.contains('glsl'),
   install : with_tools.contains('glsl'),
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 07/48] glsl: fix general_ir_test with mingw

2018-08-06 Thread Dylan Baker
Somewhere down in the depths of the mingw headers 'interface' is
defined, change it to iface like a similar patch did.
---
 src/compiler/glsl/tests/general_ir_test.cpp | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/tests/general_ir_test.cpp 
b/src/compiler/glsl/tests/general_ir_test.cpp
index 57917f33734..c8bc16b7ad0 100644
--- a/src/compiler/glsl/tests/general_ir_test.cpp
+++ b/src/compiler/glsl/tests/general_ir_test.cpp
@@ -34,7 +34,7 @@ TEST(ir_variable_constructor, interface)
   glsl_struct_field(glsl_type::vec(4), "v")
};
 
-   const glsl_type *const interface =
+   const glsl_type *const iface =
   glsl_type::get_interface_instance(f,
 ARRAY_SIZE(f),
 GLSL_INTERFACE_PACKING_STD140,
@@ -44,12 +44,12 @@ TEST(ir_variable_constructor, interface)
static const char name[] = "named_instance";
 
ir_variable *const v =
-  new(mem_ctx) ir_variable(interface, name, ir_var_uniform);
+  new(mem_ctx) ir_variable(iface, name, ir_var_uniform);
 
EXPECT_STREQ(name, v->name);
EXPECT_NE(name, v->name);
-   EXPECT_EQ(interface, v->type);
-   EXPECT_EQ(interface, v->get_interface_type());
+   EXPECT_EQ(iface, v->type);
+   EXPECT_EQ(iface, v->get_interface_type());
 }
 
 TEST(ir_variable_constructor, interface_array)
@@ -60,7 +60,7 @@ TEST(ir_variable_constructor, interface_array)
   glsl_struct_field(glsl_type::vec(4), "v")
};
 
-   const glsl_type *const interface =
+   const glsl_type *const iface =
   glsl_type::get_interface_instance(f,
 ARRAY_SIZE(f),
 GLSL_INTERFACE_PACKING_STD140,
@@ -68,7 +68,7 @@ TEST(ir_variable_constructor, interface_array)
 "simple_interface");
 
const glsl_type *const interface_array =
-  glsl_type::get_array_instance(interface, 2);
+  glsl_type::get_array_instance(iface, 2);
 
static const char name[] = "array_instance";
 
@@ -78,5 +78,5 @@ TEST(ir_variable_constructor, interface_array)
EXPECT_STREQ(name, v->name);
EXPECT_NE(name, v->name);
EXPECT_EQ(interface_array, v->type);
-   EXPECT_EQ(interface, v->get_interface_type());
+   EXPECT_EQ(iface, v->get_interface_type());
 }
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 27/48] meson: Add support for using win_flex and win_bison on windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 39b542730a9..b7d277b7bc0 100644
--- a/meson.build
+++ b/meson.build
@@ -1329,8 +1329,31 @@ endif
 
 # pthread stubs. Lets not and say we didn't
 
-prog_bison = find_program('bison', required : with_any_opengl)
-prog_flex = find_program('flex', required : with_any_opengl)
+if host_machine.system() == 'windows'
+  # Prefer the winflexbison versions, they're much easier to install and have
+  # better windows support.
+
+  prog_flex = find_program('win_flex', required : false)
+  if prog_flex.found()
+# windows compatibility (uses  instead of  and _isatty,
+# _fileno functions)
+prog_flex = [prog_flex, '--wincompat']
+  else
+prog_flex = [find_program('lex', 'flex', required : with_any_opengl)]
+  endif
+  # Force flex to use const keyword in prototypes, as relies on __cplusplus or
+  # __STDC__ macro to determine whether it's safe to use const keyword, but
+  # MSVC never defines __STDC__ unless we disable all MSVC extensions.
+  prog_flex += '-DYY_USE_CONST='
+
+  prog_bison = find_program('win_bison', required : false)
+  if not prog_bison.found()
+prog_bison = find_program('yacc', 'bison', required : with_any_opengl)
+  endif
+else
+  prog_bison = find_program('bison', required : with_any_opengl)
+  prog_flex = find_program('flex', required : with_any_opengl)
+endif
 
 dep_selinux = null_dep
 if get_option('selinux')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 48/48] use msbuild instead of ninja

2018-08-06 Thread Dylan Baker
I think that most windows users probably find using msbuild more
interesting than ninja, even if ninja is faster. I've left the ninja
build in case someone wants to look at it.
---
 appveyor.yml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index bbd7e1cddb0..75ab6056f57 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -60,8 +60,7 @@ install:
 - if "%BUILD_SYSTEM%"=="meson" py -3.7-64 -m pip install meson
 - if "%BUILD_SYSTEM%"=="meson" set Path=C:\Python37-x64\Scripts;%Path%
 - if "%BUILD_SYSTEM%"=="meson" meson --version
-- if "%BUILD_SYSTEM%"=="meson" cinst -y ninja pkgconfiglite
-- if "%BUILD_SYSTEM%"=="meson" ninja --version
+- if "%BUILD_SYSTEM%"=="meson" cinst -y pkgconfiglite
 - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86_amd64
 # Install flex/bison
 - cinst -y winflexbison
@@ -75,8 +74,9 @@ install:
 
 build_script:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
-- if "%BUILD_SYSTEM%"=="meson" meson builddir -Dbuild-tests=true
-- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir
+- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
-Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" cd builddir
+- if "%BUILD_SYSTEM%"=="meson" msbuild mesa.sln
 
 after_build:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1 check
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 25/48] meson: fix pipe-loader compilation for windows

2018-08-06 Thread Dylan Baker
v2: - Add missing D to pound define
- Simply define the variable rather than set it to 1 (mirrors
  android.mk not scons)
---
 src/gallium/auxiliary/pipe-loader/meson.build | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
b/src/gallium/auxiliary/pipe-loader/meson.build
index 32e8188c68b..c5db4e18203 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -27,13 +27,18 @@ files_pipe_loader = files(
 )
 
 libpipe_loader_defines = []
+libpipe_loader_links = []
 
 if dep_libdrm.found()
   files_pipe_loader += files('pipe_loader_drm.c')
+  libpipe_loader_links += libloader
 endif
 if with_gallium_drisw_kms
   libpipe_loader_defines += '-DHAVE_PIPE_LOADER_KMS'
 endif
+if not (with_gallium_st_nine or with_gallium_opencl)
+  libpipe_loader_defines += '-DDROP_PIPE_LOADER_MISC'
+endif
 
 libpipe_loader_static = static_library(
   'pipe_loader_static',
@@ -46,7 +51,7 @@ libpipe_loader_static = static_library(
 c_vis_args, '-DHAVE_PIPE_LOADER_DRI', '-DGALLIUM_STATIC_TARGETS=1',
 libpipe_loader_defines,
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
@@ -64,7 +69,7 @@ libpipe_loader_dynamic = static_library(
   join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe')
 )
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 45/48] meson: Add linker arguments for windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 21 +
 1 file changed, 21 insertions(+)

diff --git a/meson.build b/meson.build
index bbfd7c3c73f..594d3f804fc 100644
--- a/meson.build
+++ b/meson.build
@@ -887,6 +887,27 @@ else
   endforeach
 endif
 
+# set linker arguments
+if host_machine.system() == 'windows'
+  if cc.get_id() == 'msvc'
+add_project_link_arguments(
+  '/fixed:no',
+  '/incremental:no',
+  '/dynamicbase',
+  '/nxcompat',
+  language : ['c', 'cpp'],
+)
+  else
+add_project_link_arguments(
+  '-Wl,--nxcompat',
+  '-Wl,--dynamicbase',
+  '-static-libgcc',
+  '-static-libstdc++',
+  language : ['c', 'cpp'],
+)
+  endif
+endif
+
 if host_machine.cpu_family().startswith('x86') and cc.get_id() != 'msvc'
   pre_args += '-DUSE_SSE41'
   with_sse41 = true
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 42/48] tests/vma: fix build with MSVC

2018-08-06 Thread Dylan Baker
---
 src/util/tests/vma/vma_random_test.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/util/tests/vma/vma_random_test.cpp 
b/src/util/tests/vma/vma_random_test.cpp
index 1f194fcdf92..9246176cbf2 100644
--- a/src/util/tests/vma/vma_random_test.cpp
+++ b/src/util/tests/vma/vma_random_test.cpp
@@ -34,7 +34,15 @@
 #include 
 #include 
 
+#ifndef _WIN32
 #include 
+#else
+#define errx(code, msg, ...) \
+   do {  \
+  fprintf(stderr, msg, __VA_ARGS__); \
+  exit(code);\
+   } while (0);
+#endif
 
 #include "vma.h"
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 19/48] meson: build libgl-gdi target

2018-08-06 Thread Dylan Baker
---
 src/gallium/meson.build   |  1 +
 src/gallium/targets/libgl-gdi/meson.build | 44 +++
 2 files changed, 45 insertions(+)
 create mode 100644 src/gallium/targets/libgl-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a4f28dc4757..5019477788b 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -193,6 +193,7 @@ if with_gallium_st_nine
 endif
 if with_platform_windows
   subdir('state_trackers/wgl')
+  subdir('targets/libgl-gdi')
 endif
 if with_tests
   subdir('targets/graw-null')
diff --git a/src/gallium/targets/libgl-gdi/meson.build 
b/src/gallium/targets/libgl-gdi/meson.build
new file mode 100644
index 000..63cc40b97bc
--- /dev/null
+++ b/src/gallium/targets/libgl-gdi/meson.build
@@ -0,0 +1,44 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+if cc.get_id() == 'gcc' and host_machine.cpu_family() == 'x86_64'
+  ogldef = files('../../state_trackers/wgl/opengl32.mingw.def')[0]
+else
+  ogldef = files('../../state_trackers/wgl/opengl32.def')[0]
+endif
+
+libopengl32 = shared_library(
+  'opengl32',
+  ['libgl_gdi.c'],
+  vs_module_defs : ogldef,
+  include_directories : [
+inc_common, inc_wgl, inc_gallium_winsys_sw, inc_gallium_drivers,
+  ],
+  link_whole : [libwgl],
+  link_with : [
+libmesa_util, libgallium, libglsl, libmesa_gallium, libwsgdi,
+libglapi_static, libglapi
+  ],
+  dependencies : [
+dep_ws2_32, idep_nir, driver_swrast, driver_swr,
+  ],
+  name_prefix : '',  # otherwise mingw will create libopengl32.dll
+  install : true,
+)
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 32/48] meson: don't define GLX_USE_TLS for windows

2018-08-06 Thread Dylan Baker
Because the macros for exporting dll symbols and using TLS are mutually
exclusive.
---
 meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index aaa7d9990ab..100d12f475d 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or 
with_platform_surfaceless)
   endif
 endif
 
-pre_args += '-DGLX_USE_TLS'
+if host_machine.system() != 'windows'
+  # On windows Thread local storage and dll export are mutually exclusive
+  pre_args += '-DGLX_USE_TLS'
+endif
 if with_glx != 'disabled'
   if not (with_platform_x11 and with_any_opengl)
 error('Cannot build GLX support without X11 platform support and at least 
one OpenGL API')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 41/48] meson: don't build or run mesa-sha1 test on windows

2018-08-06 Thread Dylan Baker
It crashes hard (pop-up window and all).
---
 src/util/meson.build | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/util/meson.build b/src/util/meson.build
index 6386d945a22..5e6766fc8ad 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -150,16 +150,19 @@ if with_tests
 )
   )
 
-  test(
-'mesa-sha1',
-executable(
-  'mesa-sha1_test',
-  files('mesa-sha1_test.c'),
-  include_directories : inc_common,
-  link_with : libmesa_util,
-  c_args : [c_msvc_compat_args],
+  if host_machine.system() != 'windows'
+# this test doesn't work on windows
+test(
+  'mesa-sha1',
+  executable(
+'mesa-sha1_test',
+files('mesa-sha1_test.c'),
+include_directories : inc_common,
+link_with : libmesa_util,
+c_args : [c_msvc_compat_args],
+  )
 )
-  )
+  endif
 
   subdir('tests/hash_table')
   subdir('tests/string_buffer')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 26/48] meson: don't look for rt on windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index c8a66942cff..39b542730a9 100644
--- a/meson.build
+++ b/meson.build
@@ -1101,7 +1101,9 @@ elif with_dri_i965 and get_option('shader-cache')
 endif
 
 # Determine whether or not the rt library is needed for time functions
-if cc.has_function('clock_gettime')
+if host_machine.system() == 'windows'
+  dep_clock = null_dep
+elif cc.has_function('clock_gettime')
   dep_clock = null_dep
 else
   dep_clock = cc.find_library('rt')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 09/48] meson: build getopt when using msvc

2018-08-06 Thread Dylan Baker
completely untested
---
 src/getopt/meson.build | 29 +
 src/meson.build|  5 +
 2 files changed, 34 insertions(+)
 create mode 100644 src/getopt/meson.build

diff --git a/src/getopt/meson.build b/src/getopt/meson.build
new file mode 100644
index 000..5e106a6bc60
--- /dev/null
+++ b/src/getopt/meson.build
@@ -0,0 +1,29 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libgetopt = static_library(
+  'getopt',
+  ['getopt_long.c'],
+)
+
+idep_getopt = declare_dependency(
+  link_with : libgetopt,
+  include_directories : include_directories('.', is_system : true),
+)
diff --git a/src/meson.build b/src/meson.build
index 6213b7d8a36..bc0508bce3f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,6 +47,11 @@ sha1_h = custom_target(
 )
 
 subdir('gtest')
+if cc.get_id() == 'msvc'
+  subdir('getopt')
+else
+  idep_getopt = []
+endif
 subdir('util')
 subdir('mapi')
 # TODO: opengl
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 18/48] meson: build wgl state tracker

2018-08-06 Thread Dylan Baker
---
 src/gallium/meson.build|  3 ++
 src/gallium/state_trackers/wgl/meson.build | 50 ++
 2 files changed, 53 insertions(+)
 create mode 100644 src/gallium/state_trackers/wgl/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7754dbdee3c..a4f28dc4757 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -191,6 +191,9 @@ if with_gallium_st_nine
   subdir('state_trackers/nine')
   subdir('targets/d3dadapter9')
 endif
+if with_platform_windows
+  subdir('state_trackers/wgl')
+endif
 if with_tests
   subdir('targets/graw-null')
   if with_glx == 'gallium-xlib'
diff --git a/src/gallium/state_trackers/wgl/meson.build 
b/src/gallium/state_trackers/wgl/meson.build
new file mode 100644
index 000..d78d2b02e83
--- /dev/null
+++ b/src/gallium/state_trackers/wgl/meson.build
@@ -0,0 +1,50 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+inc_wgl = include_directories('.')
+
+libwgl = static_library(
+  'wgl',
+  files(
+'stw_context.c',
+'stw_device.c',
+'stw_ext_context.c',
+'stw_ext_extensionsstring.c',
+'stw_ext_pbuffer.c',
+'stw_ext_pixelformat.c',
+'stw_ext_rendertexture.c',
+'stw_ext_swapinterval.c',
+'stw_framebuffer.c',
+'stw_getprocaddress.c',
+'stw_nopfuncs.c',
+'stw_nopfuncs.h',
+'stw_pixelformat.c',
+'stw_st.c',
+'stw_tls.c',
+'stw_wgl.c',
+  ),
+  c_args : [
+'-D_GDI32_', '-DBUILD_GL32', '-DWIN32_LEAN_AND_MEAN',
+'-D_GLAPI_NO_EXPORTS', # XXX: only without gles
+  ],
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
+  ],
+)
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 16/48] meson: Add necessary defines for mesa_gallium on windows

2018-08-06 Thread Dylan Baker
---
 src/mesa/meson.build | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index 29633691ee7..fa086466443 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -728,11 +728,19 @@ libmesa_classic = static_library(
   build_by_default : false,
 )
 
+_mesa_gallium_args = []
+if with_platform_windows
+  _mesa_gallium_args += ['-D_GDI32_', '-DBUILD_GL32']
+  if not with_gles2
+_mesa_gallium_args += '-D_GLAPI_NO_EXPORTS'
+  endif
+endif
+
 libmesa_gallium = static_library(
   'mesa_gallium',
   [files_libmesa_common, files_libmesa_gallium],
-  c_args : [c_vis_args, c_msvc_compat_args],
-  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
+  c_args : [c_vis_args, c_msvc_compat_args, _mesa_gallium_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _mesa_gallium_args],
   include_directories : [inc_common, inc_libmesa_asm, 
include_directories('main')],
   link_with : [libglsl, libmesa_sse41],
   dependencies : [idep_nir_headers, dep_vdpau],
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 05/48] gallium: fix ddebug on windows

2018-08-06 Thread Dylan Baker
By including the proper headers for getpid and for mkdir.

Signed-off-by: Dylan Baker 
Reviewed-by: Marek Olšák 
---
 src/gallium/auxiliary/meson.build | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 98542d7ef3e..4facaae08d6 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -106,6 +106,12 @@ files_libgallium = files(
   'driver_trace/tr_screen.h',
   'driver_trace/tr_texture.c',
   'driver_trace/tr_texture.h',
+  'driver_ddebug/dd_context.c',
+  'driver_ddebug/dd_draw.c',
+  'driver_ddebug/dd_pipe.h',
+  'driver_ddebug/dd_public.h',
+  'driver_ddebug/dd_screen.c',
+  'driver_ddebug/dd_util.h',
   'hud/font.c',
   'hud/font.h',
   'hud/hud_context.c',
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 10/48] meson: Add a platform for windows

2018-08-06 Thread Dylan Baker
This mirrors the haiku build which uses a platform.

v2: - Fix some rebase problems
---
 meson.build   | 8 ++--
 meson_options.txt | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 788021c05e9..37c07eaa581 100644
--- a/meson.build
+++ b/meson.build
@@ -225,10 +225,12 @@ _platforms = get_option('platforms')
 if _platforms.contains('auto')
   if system_has_kms_drm
 _platforms = ['x11', 'wayland', 'drm', 'surfaceless']
-  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+  elif ['darwin', 'cygwin'].contains(host_machine.system())
 _platforms = ['x11', 'surfaceless']
   elif ['haiku'].contains(host_machine.system())
 _platforms = ['haiku']
+  elif host_machine.system() == 'windows'
+_platforms = ['windows']
   else
 error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
gladly accepted to fix this.')
   endif
@@ -240,6 +242,7 @@ with_platform_wayland = _platforms.contains('wayland')
 with_platform_drm = _platforms.contains('drm')
 with_platform_haiku = _platforms.contains('haiku')
 with_platform_surfaceless = _platforms.contains('surfaceless')
+with_platform_windows = _platforms.contains('windows')
 
 with_platforms = false
 if _platforms.length() != 0 and _platforms != ['']
@@ -375,7 +378,8 @@ if with_any_vk and (with_platform_x11 and not with_dri3)
   error('Vulkan drivers require dri3 for X11 support')
 endif
 if with_dri or with_gallium
-  if with_glx == 'disabled' and not with_egl and not with_platform_haiku
+  if (with_glx == 'disabled' and not with_egl and not with_platform_haiku and
+  not with_platform_windows)
 error('building dri or gallium drivers require at least one window system')
   endif
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 5bb560b61fb..b8df253b323 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,7 @@ option(
   value : ['auto'],
   choices : [
 '', 'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
+'windows',
   ],
   description : 'comma separated list of window systems to support. If this is 
set to auto all platforms applicable to the OS will be enabled.'
 )
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 28/48] meson: make nm binary optional

2018-08-06 Thread Dylan Baker
This makes nm not required, but used if found. In general I imagine that
this means that on windows nm wont be found, and on other platforms it
will.

v2: - fix gbm and egl symbols check tests to only be run if nm is found
- reword commit message to reflect the code change
---
 meson.build | 5 -
 src/egl/meson.build | 2 +-
 src/gbm/meson.build | 2 +-
 src/mapi/es1api/meson.build | 2 +-
 src/mapi/es2api/meson.build | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index b7d277b7bc0..73a69dc3fc1 100644
--- a/meson.build
+++ b/meson.build
@@ -1544,8 +1544,11 @@ endif
 
 pkg = import('pkgconfig')
 
+prog_nm = find_program('nm', required : false)
 env_test = environment()
-env_test.set('NM', find_program('nm').path())
+if prog_nm.found()
+  env_test.set('NM', prog_nm.path())
+endif
 
 subdir('include')
 subdir('bin')
diff --git a/src/egl/meson.build b/src/egl/meson.build
index 89a84fd8908..cf409f207f8 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -194,7 +194,7 @@ pkg.generate(
   extra_cflags : gl_pkgconfig_c_flags,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   if with_glvnd
 # TODO: add glvnd symbol check
   else
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 2e9d380c0b4..97516dfbc6c 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -68,7 +68,7 @@ pkg.generate(
   libraries_private : '-ldl',  # FIXME: autotools lists this a incomplete
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'gbm-symbols-check',
 find_program('gbm-symbols-check'),
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index dcf0aa57492..448cf1c73d2 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'es1-ABI-check',
 find_program('ABI-check'),
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index abd633fbb6b..cb6a70a2e90 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'es2-ABI-check',
 find_program('ABI-check'),
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 15/48] meson: Add windows defines to glapi

2018-08-06 Thread Dylan Baker
These are needed to control the export or symbols due to differences
between the way windows and *nix handle symbol exports.
---
 src/mapi/es1api/meson.build   | 10 +-
 src/mapi/es2api/meson.build   | 10 +-
 src/mapi/glapi/meson.build| 13 -
 src/mapi/shared-glapi/meson.build |  9 -
 4 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 657dc2d9eff..dcf0aa57492 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -27,11 +27,19 @@ es1_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es1_c_args = []
+if with_platform_windows
+  _es1_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libglesv1_cm = shared_library(
   'GLESv1_CM',
   ['../entry.c', es1_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es1_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index da5198ed6e8..abd633fbb6b 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -27,11 +27,19 @@ es2_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es2_c_args = []
+if with_platform_windows
+  _es2_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libgles2 = shared_library(
   'GLESv2',
   ['../entry.c', es2_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es2_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index 2509e19eaa3..9ecc29ece31 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -25,7 +25,7 @@ inc_glapi = include_directories('.')
 static_glapi_files = []
 static_glapi_args = []
 
-if ['apple', 'windows'].contains(with_dri_platform)
+if with_dri and ['apple', 'windows'].contains(with_dri_platform)
   static_glapi_files += [glapi_gentable_c, glapitable_h]
 endif
 
@@ -45,8 +45,19 @@ if with_shared_glapi
 '-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
   ]
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32']
+  endif
 else
   static_glapi_args += '-DMAPI_MODE_UTIL'
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32', '-DKHRONOS_DLL_EXPORTS']
+if with_gles1 or with_gles2
+  static_glapi_args += '-D_GLAPI_DLL_EXPORTS'
+else
+  static_glapi_args += '-D_GLAPI_NO_EXPORTS'
+endif
+  endif
   static_glapi_files += files(
 'glapi_dispatch.c',
 'glapi_entrypoint.c',
diff --git a/src/mapi/shared-glapi/meson.build 
b/src/mapi/shared-glapi/meson.build
index c7d136ced2c..e1f68691b48 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -36,11 +36,18 @@ shared_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_glapi_c_args = []
+if with_platform_windows
+  _glapi_c_args += ['-D_GLAPI_DLL_EXPORTS']
+endif
+
 libglapi = shared_library(
   'glapi',
   [files_mapi_glapi, files_mapi_util, shared_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, '-DMAPI_MODE_GLAPI',
+_glapi_c_args,
+c_msvc_compat_args,
+'-DMAPI_MODE_GLAPI',
 '-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 47/48] appveyor: use chocolatey (cinst) to install winflexbison

2018-08-06 Thread Dylan Baker
v2: - fix typos in commit message
---
 appveyor.yml | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 26f50ce2596..bbd7e1cddb0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -34,13 +34,11 @@ branches:
 clone_depth: 100
 
 cache:
-- win_flex_bison-2.5.9.zip
 - llvm-5.0.1-msvc2015-mtd.7z
 
 os: Visual Studio 2015
 
 environment:
-  WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
   matrix:
 - BUILD_SYSTEM: meson
@@ -66,9 +64,7 @@ install:
 - if "%BUILD_SYSTEM%"=="meson" ninja --version
 - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86_amd64
 # Install flex/bison
-- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%;
-- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
-- set Path=%CD%\winflexbison;%Path%
+- cinst -y winflexbison
 - win_flex --version
 - win_bison --version
 # Download and extract LLVM
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 22/48] meson: Don't check for posix_memalign on windows

2018-08-06 Thread Dylan Baker
There's a mingw bug for this, it exports __builtin_posix_memalign but
not posix_memalign, so the check will succeed, but compiling will fail.
---
 meson.build | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 4dc76732d4a..dfeeab8c11a 100644
--- a/meson.build
+++ b/meson.build
@@ -1014,13 +1014,22 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 
'linux/futex.h', 'endian.h', 'dlfcn.h'
 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
 endforeach
-
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 
'memfd_create']
+foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create']
   if cc.has_function(f)
 pre_args += '-DHAVE_@0@'.format(f.to_upper())
   endif
 endforeach
 
+# MinGW provides a __builtin_posix_memalign function, but not a posix_memalign.
+# This means that this check will succeed, but then compilation will later
+# fail. MSVC doesn't have this function at all, so only check for it on
+# non-windows platforms.
+if host_machine.system() != 'windows'
+  if cc.has_function('posix_memalign')
+pre_args += '-DHAVE_POSIX_MEMALIGN'
+  endif
+endif
+
 # strtod locale support
 if cc.links('''
 #define _GNU_SOURCE
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 40/48] meson: disable graw tests on mingw

2018-08-06 Thread Dylan Baker
I can't figure out why symbols are being exposed that shouldn't.
---
 src/gallium/tests/meson.build | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 15b9f549647..1d08da2ac10 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -25,4 +25,8 @@ endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-subdir('graw')
+if host_machine.system() == 'windows' and cpp.get_id() != 'gcc'
+  # This has linking errors I can't figure out with MinGW. works fine with
+  # MSVC, works fine with GCC on Linux.
+  subdir('graw')
+endif
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 12/48] meson: don't allow glvnd on windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 75f7f1c672d..25de31bfabd 100644
--- a/meson.build
+++ b/meson.build
@@ -356,7 +356,9 @@ endif
 
 with_glvnd = get_option('glvnd')
 if with_glvnd
-  if with_glx == 'xlib' or with_glx == 'gallium-xlib'
+  if with_platform_windows
+error('glvnd cannot be used on Windows')
+  elif with_glx == 'xlib' or with_glx == 'gallium-xlib'
 error('Cannot build glvnd support for GLX that is not DRI based.')
   elif with_glx == 'disabled' and not with_egl
 error('glvnd requires DRI based GLX and/or EGL')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 17/48] meson: build gallium gdi winsys

2018-08-06 Thread Dylan Baker
---
 src/gallium/meson.build   |  6 ++
 src/gallium/winsys/sw/gdi/meson.build | 27 +++
 2 files changed, 33 insertions(+)
 create mode 100644 src/gallium/winsys/sw/gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 561af9d339c..7754dbdee3c 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -21,6 +21,7 @@
 
 inc_gallium_drivers = include_directories('drivers')
 inc_gallium_winsys = include_directories('winsys')
+inc_gallium_winsys_sw = include_directories('winsys/sw')
 
 subdir('auxiliary')
 subdir('auxiliary/pipe-loader')
@@ -35,6 +36,11 @@ if with_gallium_drisw_kms
 else
   libswkmsdri = []
 endif
+if with_platform_windows
+  subdir('winsys/sw/gdi')
+else
+  libwsgdi = []
+endif
 subdir('winsys/sw/wrapper')
 if with_platform_haiku
   subdir('winsys/sw/hgl')
diff --git a/src/gallium/winsys/sw/gdi/meson.build 
b/src/gallium/winsys/sw/gdi/meson.build
new file mode 100644
index 000..ac6c7cf0aa2
--- /dev/null
+++ b/src/gallium/winsys/sw/gdi/meson.build
@@ -0,0 +1,27 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libwsgdi = static_library(
+  'wsgdi',
+  'gdi_sw_winsys.c',
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+  ],
+)
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 11/48] meson: don't build glx or dri by default on windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 37c07eaa581..75f7f1c672d 100644
--- a/meson.build
+++ b/meson.build
@@ -264,8 +264,12 @@ if with_glx == 'auto'
   elif with_platform_haiku
 with_glx = 'disabled'
   elif with_gallium
-# Even when building just gallium drivers the user probably wants dri
-with_glx = 'dri'
+if host_machine.system() == 'windows'
+  with_glx = 'disabled'
+else
+  # Even when building just gallium drivers the user probably wants dri
+  with_glx = 'dri'
+endif
   elif with_platform_x11 and with_any_opengl and not with_any_vk
 # The automatic behavior should not be to turn on xlib based glx when
 # building only vulkan drivers
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 23/48] meson: Add support for wrapping llvm

2018-08-06 Thread Dylan Baker
For building on Windows (when not using cygwin), the assumption is that
LLVM will have to be handled via a binary wrap. In this case the user
wanting to use LLVM is this way will need to create a directory in
subprojects (any name is fine), and pass that name via the -Dllvm-wrap
option (for example, assuming subprojects/llvm, -Dllvm-wrap=llvm), which
must have a meson.build file and the installed LLVM to link with (this
can be either static or dynamic). There is documentation for what this
needs to look like and how to define it.

v2: - Use  in html docs
---
 docs/meson.html   |  66 +
 meson.build   | 131 +++---
 meson_options.txt |   6 +
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 4 files changed, 163 insertions(+), 53 deletions(-)

diff --git a/docs/meson.html b/docs/meson.html
index 29907a60a9c..b64ca2ec35e 100644
--- a/docs/meson.html
+++ b/docs/meson.html
@@ -132,6 +132,72 @@ dependency interface. It will search $PATH 
(or %PATH%
 llvm-config, so using an LLVM from a non-standard path is as easy as
 PATH=/path/with/llvm-config:$PATH meson build.
 
+
+On windows (and in other cases), using llvm-config is either undesirable
+or impossible. Meson's solution for this is a
+http://mesonbuild.com/Wrap-dependency-system-manual.html;>wrap, in
+this case a "binary wrap". Follow the steps below:
+
+Install the binaries and headers into a directory under the 
$mesa_src/subprojects
+Add a meson build.build file to that directory (more on that 
later)
+add -Dllvm-wrap=$directory to your meson configuration 
(where $directory is the the directory under subprojects
+
+
+The wrap file must define the following:
+
+ext_llvm: a declare_dependency() object with 
include_directories, dependencies, and version set)
+
+
+It may also define:
+
+irbuilder_h: a file() object pointing to 
llvm/IR/IRBuilder.h (for SWR)
+
+
+such a meson.build file might look like:
+
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['libLLVMCodeGen', 'libLLVMScalarOpts', 'libLLVMAnalysis',
+ 'libLLVMTransformUtils', 'libLLVMCore', 'libLLVMX86CodeGen',
+ 'libLLVMSelectionDAG', 'libLLVMipo', 'libLLVMAsmPrinter',
+ 'libLLVMInstCombine', 'libLLVMInstrumentation', 'libLLVMMC',
+ 'libLLVMGlobalISel', 'libLLVMObjectYAML', 'libLLVMDebugInfoPDB',
+ 'libLLVMVectorize', 'libLLVMPasses', 'libLLVMSupport',
+ 'libLLVMLTO', 'libLLVMObject', 'libLLVMDebugInfoCodeView',
+ 'libLLVMDebugInfoDWARF', 'libLLVMOrcJIT', 'libLLVMProfileData',
+ 'libLLVMObjCARCOpts', 'libLLVMBitReader', 'libLLVMCoroutines',
+ 'libLLVMBitWriter', 'libLLVMRuntimeDyld', 'libLLVMMIRParser',
+ 'libLLVMX86Desc', 'libLLVMAsmParser', 'libLLVMTableGen',
+ 'libLLVMFuzzMutate', 'libLLVMLinker', 'libLLVMMCParser',
+ 'libLLVMExecutionEngine', 'libLLVMCoverage', 'libLLVMInterpreter',
+ 'libLLVMTarget', 'libLLVMX86AsmParser', 'libLLVMSymbolize',
+ 'libLLVMDebugInfoMSF', 'libLLVMMCJIT', 'libLLVMXRay',
+ 'libLLVMX86AsmPrinter', 'libLLVMX86Disassembler',
+ 'libLLVMMCDisassembler', 'libLLVMOption', 'libLLVMIRReader',
+ 'libLLVMLibDriver', 'libLLVMDlltoolDriver', 'libLLVMDemangle',
+ 'libLLVMBinaryFormat', 'libLLVMLineEditor',
+ 'libLLVMWindowsManifest', 'libLLVMX86Info', 'libLLVMX86Utils']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '6.0.0',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+
+It is very important that version is defined and is accurate, if it is not,
+workarounds for the wrong version of LLVM might be used resulting in build
+failures.
+
+
 
 
 
diff --git a/meson.build b/meson.build
index dfeeab8c11a..c8a66942cff 100644
--- a/meson.build
+++ b/meson.build
@@ -1220,59 +1220,94 @@ else
 endif
 
 _llvm = get_option('llvm')
-if _llvm == 'auto'
-  dep_llvm = dependency(
-'llvm',
-version : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_modules,
-required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
with_gallium_opencl,
-  )
-  with_llvm = dep_llvm.found()
-elif _llvm == 'true'
-  dep_llvm = dependency(
-'llvm',
-version : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_modules,
-  )
-  with_llvm = true
-else
-  dep_llvm = null_dep
-  with_llvm = false
-endif
-if with_llvm
-  _llvm_version = dep_llvm.version().split('.')
-  # Development versions of LLVM have an 'svn' or 'git' suffix, we don't want
-  # that for our version checks.
-  # svn suffixes are stripped by meson as of 

[Mesa-dev] [PATCH v3 03/48] meson: add a zlib subproject

2018-08-06 Thread Dylan Baker
To help windows build
---
 meson.build   |  2 +-
 subprojects/zlib.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/zlib.wrap

diff --git a/meson.build b/meson.build
index cbaee5ceb22..6960db9e9de 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,7 +1050,7 @@ else
 endif
 
 # TODO: some of these may be conditional
-dep_zlib = dependency('zlib', version : '>= 1.2.3')
+dep_zlib = dependency('zlib', version : '>= 1.2.3', fallback : ['zlib', 
'zlib_dep'])
 pre_args += '-DHAVE_ZLIB'
 dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 000..f459463bb59
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.11
+
+source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/2/get_zip
+patch_filename = zlib-1.2.11-2-wrap.zip
+patch_hash = aed811a48707be2a374a230c01e2efa17b385fe7e88f4ac0ee122093766aab2b
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 20/48] meson: build graw-gdi target

2018-08-06 Thread Dylan Baker
---
 src/gallium/meson.build  |  4 ++-
 src/gallium/targets/graw-gdi/meson.build | 36 
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/targets/graw-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 5019477788b..e4e0b88e7fc 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -197,7 +197,9 @@ if with_platform_windows
 endif
 if with_tests
   subdir('targets/graw-null')
-  if with_glx == 'gallium-xlib'
+  if with_platform_windows
+subdir('targets/graw-gdi')
+  elif with_glx == 'gallium-xlib'
 subdir('targets/graw-xlib')
   endif
   subdir('tests')
diff --git a/src/gallium/targets/graw-gdi/meson.build 
b/src/gallium/targets/graw-gdi/meson.build
new file mode 100644
index 000..e04b454ab53
--- /dev/null
+++ b/src/gallium/targets/graw-gdi/meson.build
@@ -0,0 +1,36 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libgraw_gdi = shared_library(
+  'graw',
+  'graw_gdi.c',
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+inc_gallium_winsys_sw,
+  ],
+  link_with : [
+libgraw_util, libmesa_util, libgallium, libwsgdi,
+  ],
+  dependencies : [
+dep_ws2_32, driver_swrast,
+  ],
+)
+
+libgraw = libgraw_gdi
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 29/48] meson: for incluse of inttypes.h for glcpp with msvc

2018-08-06 Thread Dylan Baker
Because we provide a copy if MSVC doesn't, and we need it to make flex
do what we want.
---
 src/compiler/glsl/glcpp/meson.build | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index 09d44ddd687..80f51a3e48e 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -35,13 +35,23 @@ glcpp_lex = custom_target(
   command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
 )
 
+_extra_args = []
+if cpp.get_id() == 'msvc'
+  # Flex relies on __STDC_VERSION__>=199901L to decide when to include C99
+  # inttypes.h.  We always have inttypes.h available with MSVC (either the one
+  # bundled with MSVC 2013, or the one we bundle ourselves), but we can't just
+  # define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully
+  # support C99.  There's also no way to premptively include stdint.
+  _extra_args += '-FIinttypes.h'
+endif
+
 libglcpp = static_library(
   'glcpp',
   [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
   link_with : libmesa_util,
   include_directories : [inc_common],
-  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
-  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
+  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args, 
_extra_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _extra_args],
   build_by_default : false,
 )
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 08/48] meson: fix dl detection on non cygwin windows

2018-08-06 Thread Dylan Baker
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index c7dd5ddfec6..788021c05e9 100644
--- a/meson.build
+++ b/meson.build
@@ -1027,9 +1027,9 @@ endif
 if cc.has_function('dlopen')
   dep_dl = null_dep
 else
-  dep_dl = cc.find_library('dl')
+  dep_dl = cc.find_library('dl', required : host_machine.system() != 'windows')
 endif
-if cc.has_function('dladdr', dependencies : dep_dl)
+if host_machine.system() != 'windows' and cc.has_function('dladdr', 
dependencies : dep_dl)
   # This is really only required for megadrivers
   pre_args += '-DHAVE_DLADDR'
 endif
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 13/48] meson: add windows compiler checks and libraries

2018-08-06 Thread Dylan Baker
---
 meson.build | 129 
 1 file changed, 79 insertions(+), 50 deletions(-)

diff --git a/meson.build b/meson.build
index 25de31bfabd..4350e1af810 100644
--- a/meson.build
+++ b/meson.build
@@ -775,69 +775,96 @@ endif
 # TODO: this is very incomplete
 if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
+elif host_machine.system() == 'windows'
+  pre_args += [
+'-D_WINDOWS', '-D_WIN32_WINNT=0x0601', '-D_WINVER=0x0601',
+'-DPIPE_SUBSYSTEM_WINDOWS_USER',
+'-D_USE_MATH_DEFINES',  # XXX: scons doesn't use this for mingw
+  ]
+  if cc.get_id() == 'msvc'
+pre_args += [
+  '-DVC_EXTRALEAN',
+  '-D_CRT_SECURE_NO_WARNINGS',
+  '-D_CRT_SECURE_NO_DEPRECATE',
+  '-D_SCL_SECURE_NO_WARNINGS',
+  '-D_SCL_SECURE_NO_DEPRECATE',
+  '-D_ALLOW_KEYWORD_MACROS',
+  '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
+]
+  else
+pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+  endif
 endif
 
 # Check for generic C arguments
 c_args = []
-foreach a : ['-Wall', '-Werror=implicit-function-declaration',
- '-Werror=missing-prototypes', '-fno-math-errno',
- '-fno-trapping-math', '-Qunused-arguments']
-  if cc.has_argument(a)
-c_args += a
-  endif
-endforeach
-if cc.has_argument('-Wmissing-field-initializers')
-  c_args += '-Wno-missing-field-initializers'
-endif
-
 c_vis_args = []
-if cc.has_argument('-fvisibility=hidden')
-  c_vis_args += '-fvisibility=hidden'
-endif
-
-# Check for generic C++ arguments
+c_msvc_compat_args = []
+no_override_init_args = []
 cpp_args = []
-foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
- '-Qunused-arguments']
-  if cpp.has_argument(a)
-cpp_args += a
+cpp_vis_args = []
+cpp_msvc_compat_args = []
+if cc.get_id() == 'msvc'
+  foreach a : ['/wd4018', '/wd4056', '/wd4244', '/wd4246', '/wd4305',
+   '/wd4351', '/wd4756', '/wd4800', '/wd4996']
+if cc.has_argument(a)
+  c_args += a
+endif
+if cpp.has_argument(a)
+  cpp_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmicrosoft-enum-value')  # Clang
+c_args += '-Wno-microsoft-enum-value'
+cpp_args += '-Wno-microsoft-enum-value'
   endif
-endforeach
-
-# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
-# option is not supported. Hence, check for -Wfoo instead.
-
-foreach a : ['non-virtual-dtor', 'missing-field-initializers']
-  if cpp.has_argument('-W' + a)
-cpp_args += '-Wno-' + a
+else
+  foreach a : ['-Wall', '-Werror=implicit-function-declaration',
+   '-Werror=missing-prototypes', '-fno-math-errno',
+   '-fno-trapping-math', '-Qunused-arguments']
+if cc.has_argument(a)
+  c_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmissing-field-initializers')
+c_args += '-Wno-missing-field-initializers'
   endif
-endforeach
 
-no_override_init_args = []
-foreach a : ['override-init', 'initializer-overrides']
-  if cc.has_argument('-W' + a)
-no_override_init_args += '-Wno-' + a
+  c_vis_args = []
+  if cc.has_argument('-fvisibility=hidden')
+c_vis_args += '-fvisibility=hidden'
   endif
-endforeach
 
-cpp_vis_args = []
-if cpp.has_argument('-fvisibility=hidden')
-  cpp_vis_args += '-fvisibility=hidden'
-endif
+  # For some reason, the test for -Wno-foo always succeeds with gcc, even if
+  # the option is not supported. Hence, check for -Wfoo instead.
+  foreach a : ['non-virtual-dtor', 'missing-field-initializers']
+if cpp.has_argument('-W' + a)
+  cpp_args += '-Wno-' + a
+endif
+  endforeach
 
-# Check for C and C++ arguments for MSVC2013 compatibility. These are only used
-# in parts of the mesa code base that need to compile with old versions of
-# MSVC, mainly common code
-c_msvc_compat_args = []
-cpp_msvc_compat_args = []
-foreach a : ['-Werror=pointer-arith', '-Werror=vla']
-  if cc.has_argument(a)
-c_msvc_compat_args += a
-  endif
-  if cpp.has_argument(a)
-cpp_msvc_compat_args += a
+  foreach a : ['override-init', 'initializer-overrides']
+if cc.has_argument('-W' + a)
+  no_override_init_args += '-Wno-' + a
+endif
+  endforeach
+
+  if cpp.has_argument('-fvisibility=hidden')
+cpp_vis_args += '-fvisibility=hidden'
   endif
-endforeach
+
+  # Check for C and C++ arguments for MSVC2013 compatibility. These are only
+  # used in parts of the mesa code base that need to compile with old versions
+  # of MSVC, mainly common code
+  foreach a : ['-Werror=pointer-arith', '-Werror=vla']
+if cc.has_argument(a)
+  c_msvc_compat_args += a
+endif
+if cpp.has_argument(a)
+  cpp_msvc_compat_args += a
+endif
+  endforeach
+endif
 
 if host_machine.cpu_family().startswith('x86')
   pre_args += '-DUSE_SSE41'
@@ -896,6 +923,8 @@ if not cc.links('''#include 
   pre_args += '-DMISSING_64_BIT_ATOMICS'
 endif
 
+dep_ws2_32 = cc.find_library('ws2_32', required : with_platform_windows) 
+
 

[Mesa-dev] [PATCH v3 06/48] glapi: export glapi_destroy_multithread when building shared-glapi on windows

2018-08-06 Thread Dylan Baker
Which will allow meson to build a shared glapi build with mingw.
---
 src/mapi/glapi/glapi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index d5d4e0a03a6..cbdef2e4c5a 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -114,7 +114,7 @@ _GLAPI_EXPORT extern void *_glapi_Context;
 #endif /* defined (GLX_USE_TLS) */
 
 
-void
+_GLAPI_EXPORT void
 _glapi_destroy_multithread(void);
 
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 01/48] meson: always define libglapi

2018-08-06 Thread Dylan Baker
This allows the identifier to be used even if shared-glapi isn't build,
which simplifies a bunch of things.
---
 src/mapi/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mapi/meson.build b/src/mapi/meson.build
index 798586bfb0c..0be80047e4d 100644
--- a/src/mapi/meson.build
+++ b/src/mapi/meson.build
@@ -30,6 +30,8 @@ mapi_abi_py = files('mapi_abi.py')
 subdir('glapi')
 if with_shared_glapi
   subdir('shared-glapi')
+else
+  libglapi = []
 endif
 if with_gles1
   subdir('es1api')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3 02/48] add a git ignore for subprojects

2018-08-06 Thread Dylan Baker
---
 subprojects/.gitignore | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 subprojects/.gitignore

diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 000..68a882edba6
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1,3 @@
+*
+!*.wrap
+!.gitignore
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 0/2] virgl: synchronize virgl_hw.h with virglrenderer

2018-08-06 Thread Dave Airlie
On 7 August 2018 at 06:11, Erik Faye-Lund  wrote:
> Ping?
>

Acked-by: Dave Airlie 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107502] Newest libdrm is required by amdgpu, but drm_intel error is emitted

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107502

--- Comment #2 from mirh  ---
Sure, I can see that in the comment. 
But that would make for a hell of headbanging, was I to decide to just disable
X vendor instead of upgrading the whole libdrm.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] main/tests: Add AMD_framebuffer_multisample_advanced

2018-08-06 Thread Ian Romanick
On 08/06/2018 10:02 AM, Dylan Baker wrote:
> Add dispatch_sanity tests
> 
> Fixes: 3d6900d76efaef1ff6e84b7b8785bbe3d8f5b29b
>("glapi: define AMD_framebuffer_multisample_advanced and add its 
> functions")
> Cc: Marek Olšák 
> Cc: Brian Paul 
> Signed-off-by: Dylan Baker 
> ---
> 
> Marek, the XML in mesa and the Khronos XML agree that this works for GLES 2.0,
> but the spec says 3.0. I assume the spec is wrong and should be corrected?

Something more than "just" 2.0 is needed because GLES 2.0 doesn't have
framebuffer objects.  I suspect that's the reason for the 3.0
requirement.  It sounds more like the Khronos XML is wrong.  I already
changed Mesa's XML.

>  src/mesa/main/tests/dispatch_sanity.cpp | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
> b/src/mesa/main/tests/dispatch_sanity.cpp
> index 82eb61dcf73..b395a09e13f 100644
> --- a/src/mesa/main/tests/dispatch_sanity.cpp
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> @@ -1192,6 +1192,10 @@ const struct function 
> common_desktop_functions_possible[] = {
> { "glMultiDrawArraysIndirectCountARB", 11, -1 },
> { "glMultiDrawElementsIndirectCountARB", 11, -1 },
>  
> +   /* GL_AMD_framebuffer_multisample_advanced */
> +   { "glRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
> +   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
> +
> { NULL, 0, -1 }
>  };
>  
> @@ -2497,6 +2501,10 @@ const struct function gles2_functions_possible[] = {
> /* GL_NV_conservative_raster_pre_snap_triangles */
> { "glConservativeRasterParameteriNV", 20, -1 },
>  
> +   /* GL_AMD_framebuffer_multisample_advanced */
> +   { "glRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
> +   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
> +
> { NULL, 0, -1 }
>  };
>  
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107502] Newest libdrm is required by amdgpu, but drm_intel error is emitted

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107502

Dylan Baker  changed:

   What|Removed |Added

   Priority|medium  |lowest
   Severity|normal  |minor

--- Comment #1 from Dylan Baker  ---
This is just a bug with the error message. It's not supported to mix and match
different libdrm_ and libdrm core versions, so what meson does is
checks each vendor's libdrm requirements based on the mesa drivers being built,
then searches for the libdrm version that matches that. I guess we should
probably fix the error message, although that might be no-trivial

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107502] Newest libdrm is required by amdgpu, but drm_intel error is emitted

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107502

Bug ID: 107502
   Summary: Newest libdrm is required by amdgpu, but drm_intel
error is emitted
   Product: Mesa
   Version: git
  Hardware: Other
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: m...@protonmail.ch
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 140986
  --> https://bugs.freedesktop.org/attachment.cgi?id=140986=edit
meson build log

Build options can be seen here
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mesa-git#n44

And build log is of course attached. 

If I change _drm_amdgpu_ver to some fictional version number, drm_intel is
promptly required to be that - so I hypothesize there must be some problem with
the check.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105371] r600_shader_from_tgsi - GPR limit exceeded - shader requires 360 registers

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105371

--- Comment #3 from mirh  ---
This is the newest one
https://patchwork.freedesktop.org/series/44315/

curl 'https://patchwork.freedesktop.org/project/mesa/pwclientrc/' | sed
'7,8s/^#//g' > ~/.pwclientrc && pwclient list -w "Gert Wollny" -s New v4 -f
%{id} | egrep '227' | xargs pwclient git-am

works just fine for me. 
If it still isn't the case for you, check
https://github.com/gerddie/mesa/tree/allfixes

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107488] gl.h:2090: error: redefinition of typedef ‘GLeglImageOES’

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107488

--- Comment #2 from Vinson Lee  ---
(In reply to Brian Paul from comment #1)
> Created attachment 140982 [details] [review]
> proposed fix
> 
> Hmmm, I don't see that issue here.  What is your ./configure command line?
> 
> In any case, does the attached patch fix this?

Yes, the attached patch fixes the build error.

Tested-by: Vinson Lee 

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] virgl: add ARB_shader_clock support

2018-08-06 Thread Erik Faye-Lund

Reviewed-by: Erik Faye-Lund 


On 06. aug. 2018 22:23, Dave Airlie wrote:

From: Dave Airlie 

---
  src/gallium/drivers/virgl/virgl_hw.h | 1 +
  src/gallium/drivers/virgl/virgl_screen.c | 3 ++-
  2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_hw.h 
b/src/gallium/drivers/virgl/virgl_hw.h
index 02cedcd0dc0..978839ad4fd 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -210,6 +210,7 @@ enum virgl_formats {
  #define VIRGL_CAP_FB_NO_ATTACH (1 << 8)
  #define VIRGL_CAP_ROBUST_BUFFER_ACCESS (1 << 9)
  #define VIRGL_CAP_TGSI_FBFETCH (1 << 10)
+#define VIRGL_CAP_SHADER_CLOCK (1 << 11)
  
  #define VIRGL_BIND_DEPTH_STENCIL (1 << 0)

  #define VIRGL_BIND_RENDER_TARGET (1 << 1)
diff --git a/src/gallium/drivers/virgl/virgl_screen.c 
b/src/gallium/drivers/virgl/virgl_screen.c
index e17d257fab1..421fde5249d 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -231,6 +231,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
return vscreen->caps.caps.v2.capability_bits & 
VIRGL_CAP_ROBUST_BUFFER_ACCESS;
 case PIPE_CAP_TGSI_FS_FBFETCH:
return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TGSI_FBFETCH;
+   case PIPE_CAP_TGSI_CLOCK:
+  return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_SHADER_CLOCK;
 case PIPE_CAP_TEXTURE_GATHER_SM5:
 case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
 case PIPE_CAP_FAKE_SW_MSAA:
@@ -274,7 +276,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
 case PIPE_CAP_INT64:
 case PIPE_CAP_INT64_DIVMOD:
 case PIPE_CAP_TGSI_TEX_TXF_LZ:
-   case PIPE_CAP_TGSI_CLOCK:
 case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
 case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
 case PIPE_CAP_TGSI_BALLOT:


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] virgl: add ARB_shader_clock support

2018-08-06 Thread Dave Airlie
From: Dave Airlie 

---
 src/gallium/drivers/virgl/virgl_hw.h | 1 +
 src/gallium/drivers/virgl/virgl_screen.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_hw.h 
b/src/gallium/drivers/virgl/virgl_hw.h
index 02cedcd0dc0..978839ad4fd 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -210,6 +210,7 @@ enum virgl_formats {
 #define VIRGL_CAP_FB_NO_ATTACH (1 << 8)
 #define VIRGL_CAP_ROBUST_BUFFER_ACCESS (1 << 9)
 #define VIRGL_CAP_TGSI_FBFETCH (1 << 10)
+#define VIRGL_CAP_SHADER_CLOCK (1 << 11)
 
 #define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
 #define VIRGL_BIND_RENDER_TARGET (1 << 1)
diff --git a/src/gallium/drivers/virgl/virgl_screen.c 
b/src/gallium/drivers/virgl/virgl_screen.c
index e17d257fab1..421fde5249d 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -231,6 +231,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return vscreen->caps.caps.v2.capability_bits & 
VIRGL_CAP_ROBUST_BUFFER_ACCESS;
case PIPE_CAP_TGSI_FS_FBFETCH:
   return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TGSI_FBFETCH;
+   case PIPE_CAP_TGSI_CLOCK:
+  return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_SHADER_CLOCK;
case PIPE_CAP_TEXTURE_GATHER_SM5:
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
case PIPE_CAP_FAKE_SW_MSAA:
@@ -274,7 +276,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
case PIPE_CAP_INT64:
case PIPE_CAP_INT64_DIVMOD:
case PIPE_CAP_TGSI_TEX_TXF_LZ:
-   case PIPE_CAP_TGSI_CLOCK:
case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
case PIPE_CAP_TGSI_BALLOT:
-- 
2.14.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 0/2] virgl: synchronize virgl_hw.h with virglrenderer

2018-08-06 Thread Erik Faye-Lund

Ping?


On 27. juli 2018 09:18, Erik Faye-Lund wrote:

Here's a few patches to get the delta between our copy of virgl_hw.h and the
copy in the virglrenderer repository as small as possible.

The goal is to make it easier to track this file in the future by simply
copying the new version of the file on top of the old.

Changes since v2:
- Rebased on master
- Dropped "virgl: move bind-flags to virgl_winsys.h" as discussed in
   review.
- Updated "virgl: update virgl_hw.h from virglrenderer" to the latest
   master from virglrenderer.

Erik Faye-Lund (2):
   virgl: rename msaa_sample_positions -> sample_locations
   virgl: update virgl_hw.h from virglrenderer

  src/gallium/drivers/virgl/virgl_context.c |  8 +++
  src/gallium/drivers/virgl/virgl_hw.h  | 29 +--
  2 files changed, 31 insertions(+), 6 deletions(-)



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] nv50/ir: add scalar field to TexInstructions

2018-08-06 Thread Karol Herbst
Signed-off-by: Karol Herbst 
---
 src/gallium/drivers/nouveau/codegen/nv50_ir.h | 2 ++
 src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp | 5 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h 
b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
index 0b220cc48de..b9b88896dde 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
@@ -1032,6 +1032,8 @@ public:
 
   enum TexQuery query;
   const struct ImgFormatDesc *format;
+
+  bool scalar; // for GM107s TEXS, TLDS, TLD4S
} tex;
 
ValueRef dPdx[3];
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
index 57e221df7ad..b9a10b31d19 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
@@ -606,7 +606,10 @@ void Instruction::print() const
   if (asFlow()->target.bb)
  PRINT(" %sBB:%i", colour[TXT_BRA], asFlow()->target.bb->getId());
} else {
-  PRINT("%s ", operationStr[op]);
+  if (asTex())
+ PRINT("%s%s ", operationStr[op], asTex()->tex.scalar ? "s" : "");
+  else
+ PRINT("%s ", operationStr[op]);
   if (op == OP_LINTERP || op == OP_PINTERP)
  PRINT("%s ", interpStr[ipa]);
   switch (op) {
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] nv50/ra: add condenseDef overloads for partial condenses

2018-08-06 Thread Karol Herbst
Signed-off-by: Karol Herbst 
---
 .../drivers/nouveau/codegen/nv50_ir_ra.cpp| 29 ++-
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
index b660fec75c9..0059ecaeb6c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
@@ -261,6 +261,7 @@ private:
   bool insertConstraintMoves();
 
   void condenseDefs(Instruction *);
+  void condenseDefs(Instruction *, const int first, const int last);
   void condenseSrcs(Instruction *, const int first, const int last);
 
   void addHazard(Instruction *i, const ValueRef *src);
@@ -2048,24 +2049,35 @@ RegAlloc::InsertConstraintsPass::addHazard(Instruction 
*i, const ValueRef *src)
 void
 RegAlloc::InsertConstraintsPass::condenseDefs(Instruction *insn)
 {
-   uint8_t size = 0;
int n;
-   for (n = 0; insn->defExists(n) && insn->def(n).getFile() == FILE_GPR; ++n)
-  size += insn->getDef(n)->reg.size;
-   if (n < 2)
+   for (n = 0; insn->defExists(n) && insn->def(n).getFile() == FILE_GPR; ++n);
+   condenseDefs(insn, 0, n - 1);
+}
+
+void
+RegAlloc::InsertConstraintsPass::condenseDefs(Instruction *insn,
+  const int a, const int b)
+{
+   uint8_t size = 0;
+   if (a >= b)
+  return;
+   for (int s = a; s <= b; ++s)
+  size += insn->getDef(s)->reg.size;
+   if (!size)
   return;
+
LValue *lval = new_LValue(func, FILE_GPR);
lval->reg.size = size;
 
Instruction *split = new_Instruction(func, OP_SPLIT, typeOfSize(size));
split->setSrc(0, lval);
-   for (int d = 0; d < n; ++d) {
-  split->setDef(d, insn->getDef(d));
+   for (int d = a; d <= b; ++d) {
+  split->setDef(d - a, insn->getDef(d));
   insn->setDef(d, NULL);
}
-   insn->setDef(0, lval);
+   insn->setDef(a, lval);
 
-   for (int k = 1, d = n; insn->defExists(d); ++d, ++k) {
+   for (int k = a + 1, d = b + 1; insn->defExists(d); ++d, ++k) {
   insn->setDef(k, insn->getDef(d));
   insn->setDef(d, NULL);
}
@@ -2075,6 +2087,7 @@ RegAlloc::InsertConstraintsPass::condenseDefs(Instruction 
*insn)
insn->bb->insertAfter(insn, split);
constrList.push_back(split);
 }
+
 void
 RegAlloc::InsertConstraintsPass::condenseSrcs(Instruction *insn,
   const int a, const int b)
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/4] nv50/ir: print color masks of tex instructions

2018-08-06 Thread Karol Herbst
Signed-off-by: Karol Herbst 
---
 .../drivers/nouveau/codegen/nv50_ir_print.cpp | 29 ++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
index ee3506fbaee..57e221df7ad 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
@@ -353,6 +353,31 @@ static const char *interpStr[16] =
"samp sc"
 };
 
+static const char *texMaskStr[16] =
+{
+   "",
+   "r",
+   "g",
+   "rg",
+   "b",
+   "rb",
+   "gb",
+   "rgb",
+   "a",
+   "ra",
+   "ga",
+   "rga",
+   "ba",
+   "rba",
+   "gba",
+   "rgba",
+};
+
+static const char *gatherCompStr[4] =
+{
+   "r", "g", "b", "a",
+};
+
 #define PRINT(args...)\
do {   \
   pos += snprintf([pos], size - pos, args);   \
@@ -633,8 +658,10 @@ void Instruction::print() const
   if (perPatch)
  PRINT("patch ");
   if (asTex())
- PRINT("%s %s$r%u $s%u %s", asTex()->tex.target.getName(),
+ PRINT("%s %s$r%u $s%u %s %s", asTex()->tex.target.getName(),
colour[TXT_MEM], asTex()->tex.r, asTex()->tex.s,
+   op == OP_TXG ? gatherCompStr[asTex()->tex.gatherComp]
+: texMaskStr[asTex()->tex.mask],
colour[TXT_INSN]);
   if (postFactor)
  PRINT("x2^%i ", postFactor);
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/4] gm107/ir: use scalar tex instructions where possible

2018-08-06 Thread Karol Herbst
TEXS, TLD4 and TLD4S are variants of tex instructions which are more
scalar, which gives RA more freedom and is less likely to insert silly
MOVs to satisfy quad registers.

shader-db changes:
total instructions in shared programs : 5814250 -> 5748182 (-1.14%)
total gprs used in shared programs: 674425 -> 669954 (-0.66%)
total shared used in shared programs  : 548832 -> 548832 (0.00%)
total local used in shared programs   : 21068 -> 21068 (0.00%)
total bytes used in shared programs   : 62111424 -> 61407080 (-1.13%)

local sharedgpr   inst  bytes
helped   0   0285996109610
  hurt   0   0 418 197 197

Signed-off-by: Karol Herbst 
---
 .../nouveau/codegen/nv50_ir_emit_gm107.cpp| 158 -
 .../drivers/nouveau/codegen/nv50_ir_ra.cpp| 162 ++
 2 files changed, 317 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
index 5e8c22cd54b..a2db3f2044b 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
@@ -191,6 +191,7 @@ private:
 
void emitTEXs(int);
void emitTEX();
+   void emitTEXS();
void emitTLD();
void emitTLD4();
void emitTXD();
@@ -2656,6 +2657,103 @@ CodeEmitterGM107::emitTEXs(int pos)
   emitGPR(pos);
 }
 
+static uint8_t
+getTEXSMask(uint8_t mask)
+{
+   switch (mask) {
+   case 0x1: return 0x0;
+   case 0x2: return 0x1;
+   case 0x3: return 0x4;
+   case 0x4: return 0x2;
+   case 0x7: return 0x0;
+   case 0x8: return 0x3;
+   case 0x9: return 0x5;
+   case 0xa: return 0x6;
+   case 0xb: return 0x1;
+   case 0xc: return 0x7;
+   case 0xd: return 0x2;
+   case 0xe: return 0x3;
+   case 0xf: return 0x4;
+   default:
+  assert(!"invalid mask");
+   }
+}
+
+static uint8_t
+getTEXSTarget(const TexInstruction *tex)
+{
+   assert(tex->op == OP_TEX || tex->op == OP_TXL);
+
+   switch (tex->tex.target.getEnum()) {
+   case TEX_TARGET_1D:
+  assert(tex->tex.levelZero);
+  return 0x0;
+   case TEX_TARGET_2D:
+   case TEX_TARGET_RECT:
+  if (tex->tex.levelZero)
+ return 0x2;
+  if (tex->op == OP_TXL)
+ return 0x3;
+  return 0x1;
+   case TEX_TARGET_2D_SHADOW:
+   case TEX_TARGET_RECT_SHADOW:
+  if (tex->tex.levelZero)
+ return 0x6;
+  if (tex->op == OP_TXL)
+ return 0x5;
+  return 0x4;
+   case TEX_TARGET_2D_ARRAY:
+  if (tex->tex.levelZero)
+ return 0x8;
+  return 0x7;
+   case TEX_TARGET_2D_ARRAY_SHADOW:
+  assert(tex->tex.levelZero);
+  return 0x9;
+   case TEX_TARGET_3D:
+  if (tex->tex.levelZero)
+ return 0xb;
+  assert(tex->op != OP_TXL);
+  return 0xa;
+   case TEX_TARGET_CUBE:
+  assert(!tex->tex.levelZero);
+  if (tex->op == OP_TXL)
+ return 0xd;
+  return 0xc;
+   default:
+  assert(false);
+  return 0x0;
+   }
+}
+
+static uint8_t
+getTLDSTarget(const TexInstruction *tex)
+{
+   switch (tex->tex.target.getEnum()) {
+   case TEX_TARGET_1D:
+  if (tex->tex.levelZero)
+ return 0x0;
+  return 0x1;
+   case TEX_TARGET_2D:
+   case TEX_TARGET_RECT:
+  if (tex->tex.levelZero)
+ return tex->tex.useOffsets ? 0x4 : 0x2;
+  return tex->tex.useOffsets ? 0xc : 0x5;
+   case TEX_TARGET_2D_MS:
+  assert(tex->tex.levelZero);
+  return 0x6;
+   case TEX_TARGET_3D:
+  assert(tex->tex.levelZero);
+  return 0x7;
+   case TEX_TARGET_2D_ARRAY:
+  assert(tex->tex.levelZero);
+  return 0x8;
+
+   default:
+  assert(false);
+  return 0x0;
+   }
+}
+
 void
 CodeEmitterGM107::emitTEX()
 {
@@ -2698,6 +2796,49 @@ CodeEmitterGM107::emitTEX()
emitGPR  (0x00, insn->def(0));
 }
 
+void
+CodeEmitterGM107::emitTEXS()
+{
+   const TexInstruction *insn = this->insn->asTex();
+
+   switch (insn->op) {
+   case OP_TEX:
+   case OP_TXL:
+  emitInsn (0xd800);
+  emitField(0x35, 4, getTEXSTarget(insn));
+  emitField(0x32, 3, getTEXSMask(insn->tex.mask));
+  break;
+   case OP_TXF:
+  emitInsn (0xda00);
+  emitField(0x35, 4, getTLDSTarget(insn));
+  emitField(0x32, 3, getTEXSMask(insn->tex.mask));
+  break;
+   case OP_TXG:
+  assert(insn->tex.useOffsets != 4);
+  emitInsn (0xdf00);
+  emitField(0x34, 2, insn->tex.gatherComp);
+  emitField(0x33, 1, insn->tex.useOffsets == 1);
+  emitField(0x32, 1, insn->tex.target.isShadow());
+  break;
+   default:
+  unreachable("unknown op in emitTEXS()");
+  break;
+   }
+
+   emitField(0x31, 1, insn->tex.liveOnly);
+   emitField(0x24, 13, insn->tex.r);
+   if (insn->defExists(1))
+  emitGPR(0x1c, insn->def(1));
+   else
+  emitGPR(0x1c);
+   if (insn->srcExists(1))
+  emitGPR(0x14, insn->getSrc(1));
+   else
+  emitGPR(0x14);
+   emitGPR  

[Mesa-dev] [PATCH 0/4] gm107/ir: add support for TEXS, TLDS and TLD4S

2018-08-06 Thread Karol Herbst
No regressions inside the CTS or piglit. More details in the 4th patch.

Karol Herbst (4):
  nv50/ir: print color masks of tex instructions
  nv50/ra: add condenseDef overloads for partial condenses
  nv50/ir: add scalar field to TexInstructions
  gm107/ir: use scalar tex instructions where possible

 src/gallium/drivers/nouveau/codegen/nv50_ir.h |   2 +
 .../nouveau/codegen/nv50_ir_emit_gm107.cpp| 158 ++-
 .../drivers/nouveau/codegen/nv50_ir_print.cpp |  34 +++-
 .../drivers/nouveau/codegen/nv50_ir_ra.cpp| 191 +-
 4 files changed, 372 insertions(+), 13 deletions(-)

-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 105371] r600_shader_from_tgsi - GPR limit exceeded - shader requires 360 registers

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105371

--- Comment #2 from Guenther Sohler  ---
Hi Gert Wollny,

I see exactly same bug in a software called "curv" .

So I tried to use exact those 2 patches you provided here.
I did

* git clone MESA repository
* git fetch --all
* git am TGSI-split-merge-and-interleave-arrays.mbox
< here come problems, tried to manually patch the sourcecode> and using git am
--continue
* git am
mesa-st-glsl_to_tgsi-Properly-resolve-life-times-for-simple-if-else-use-constructs.mbox
< went without a problem>


However, when i compile MESA then and using with curv, the error is not fixed.
Also, when looking into the patched MESA code, it appears, only a random
selected set of patches is applied. So it appears i have quite some
difficulties to use the patch.

Is this patch already commited into the MESA repo ?
Or is it possible to get a copy of your patched source code ?

Thank you and best regards Guenther

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl_to_tgsi: plumb image writable through to driver

2018-08-06 Thread Erik Faye-Lund
The virgl driver cares about the writable-flag on image definitions,
because it re-emits GLSL from the TGSI. However, so far it was hardcoded
to true in glsl_to_tgsi, which cause problems when virglrenderer is
running on top of GLES 3.1, where not all formats are supported for
writable images.

Signed-off-by: Erik Faye-Lund 
---

This patch is needed for this patch-series in virglrenderer to work
properly:

https://patchwork.freedesktop.org/series/47775/

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp| 19 ++-
 .../state_tracker/st_glsl_to_tgsi_private.h   |  1 +
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index aec5330917..55984ff0c7 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -194,6 +194,7 @@ public:
int images_used;
enum tgsi_texture_type image_targets[PIPE_MAX_SHADER_IMAGES];
enum pipe_format image_formats[PIPE_MAX_SHADER_IMAGES];
+   bool image_wr[PIPE_MAX_SHADER_IMAGES];
bool indirect_addr_consts;
int wpos_transform_const;
 
@@ -3678,7 +3679,8 @@ glsl_to_tgsi_visitor::visit_shared_intrinsic(ir_call *ir)
 static void
 get_image_qualifiers(ir_dereference *ir, const glsl_type **type,
  bool *memory_coherent, bool *memory_volatile,
- bool *memory_restrict, unsigned *image_format)
+ bool *memory_restrict, bool *memory_read_only,
+ unsigned *image_format)
 {
 
switch (ir->ir_type) {
@@ -3694,6 +3696,8 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type 
**type,
  struct_type->fields.structure[fild_idx].memory_volatile;
   *memory_restrict =
  struct_type->fields.structure[fild_idx].memory_restrict;
+  *memory_read_only =
+ struct_type->fields.structure[fild_idx].memory_read_only;
   *image_format =
  struct_type->fields.structure[fild_idx].image_format;
   break;
@@ -3703,7 +3707,7 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type 
**type,
   ir_dereference_array *deref_arr = ir->as_dereference_array();
   get_image_qualifiers((ir_dereference *)deref_arr->array, type,
memory_coherent, memory_volatile, memory_restrict,
-   image_format);
+   memory_read_only, image_format);
   break;
}
 
@@ -3714,6 +3718,7 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type 
**type,
   *memory_coherent = var->data.memory_coherent;
   *memory_volatile = var->data.memory_volatile;
   *memory_restrict = var->data.memory_restrict;
+  *memory_read_only = var->data.memory_read_only;
   *image_format = var->data.image_format;
   break;
}
@@ -3731,12 +3736,13 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir)
ir_dereference *img = (ir_dereference *)param;
const ir_variable *imgvar = img->variable_referenced();
unsigned sampler_array_size = 1, sampler_base = 0;
-   bool memory_coherent = false, memory_volatile = false, memory_restrict = 
false;
+   bool memory_coherent = false, memory_volatile = false,
+memory_restrict = false, memory_read_only = false;
unsigned image_format = 0;
const glsl_type *type = NULL;
 
get_image_qualifiers(img, , _coherent, _volatile,
-_restrict, _format);
+_restrict, _read_only, _format);
 
st_src_reg reladdr;
st_src_reg image(PROGRAM_IMAGE, 0, GLSL_TYPE_UINT);
@@ -3875,6 +3881,7 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir)
inst->tex_target = type->sampler_index();
inst->image_format = st_mesa_format_to_pipe_format(st_context(ctx),
  _mesa_get_shader_image_format(image_format));
+   inst->read_only = memory_read_only;
 
if (memory_coherent)
   inst->buffer_access |= TGSI_MEMORY_COHERENT;
@@ -4675,6 +4682,7 @@ count_resources(glsl_to_tgsi_visitor *v, gl_program *prog)
v->image_targets[idx] =
   st_translate_texture_target(inst->tex_target, false);
v->image_formats[idx] = inst->image_format;
+   v->image_wr[idx] = !inst->read_only;
 }
  }
   }
@@ -6770,7 +6778,8 @@ st_translate_program(
  t->images[i] = ureg_DECL_image(ureg, i,
 program->image_targets[i],
 program->image_formats[i],
-true, false);
+program->image_wr[i],
+false);
   }
}
 
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h 
b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
index fccb7041cf..356d029f47 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
@@ 

Re: [Mesa-dev] [PATCH 13/14] intel: tools: add aubinator viewer

2018-08-06 Thread Rafael Antognolli
This is a really nice tool, and I'm looking forward to see the other
features you teased us with, as well as helping to improve it.

With that said, I don't know much about the imgui API and can't really
do much to help reviewing it yet. But I would like to have it landed
anyway.

Patches 13 and 14 are:

Acked-by: Rafael Antognolli  

On Thu, Aug 02, 2018 at 10:39:25AM +0100, Lionel Landwerlin wrote:
> A graphical user interface version of aubinator.
> Allows you to :
> 
>- simultaneously look at multiple points in the aub file (using all
>  the goodness of the existing decoding in aubinator)
> 
>- edit an aub file
> 
> Signed-off-by: Lionel Landwerlin 
> ---
>  src/intel/tools/aubinator_viewer.cpp | 1173 ++
>  src/intel/tools/aubinator_viewer.h   |   61 +
>  src/intel/tools/aubinator_viewer_decoder.cpp |  849 +
>  src/intel/tools/imgui/imgui_memory_editor.h  |  426 +++
>  src/intel/tools/meson.build  |   13 +
>  5 files changed, 2522 insertions(+)
>  create mode 100644 src/intel/tools/aubinator_viewer.cpp
>  create mode 100644 src/intel/tools/aubinator_viewer.h
>  create mode 100644 src/intel/tools/aubinator_viewer_decoder.cpp
>  create mode 100644 src/intel/tools/imgui/imgui_memory_editor.h
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 12/14] build: new tool option for intel ui tools

2018-08-06 Thread Rafael Antognolli
Ugh, I just replied with the whole message without cutting it out, so in
case it doesn't reach the ML, this is what I wanted to say:

On Mon, Aug 06, 2018 at 11:19:20AM -0700, Rafael Antognolli wrote:
> I would change the commit summary line to make it clear we are importing
> imgui code, instead of just adding a build option.
> 
> With that,
> 
> Acked-by: Rafael Antognolli 
> 
> On Thu, Aug 02, 2018 at 10:39:24AM +0100, Lionel Landwerlin wrote:
> > We want to add a new UI tool to decode aub files. This will use the
> > Dear ImGui library to render its interface.
> > 
> > The main way to use ImGui is to embed its source code at a particular
> > revision. Most embedding projects have to do a bit of integration
> > which is really specific to one's project. In our case the only
> > modification is to include libepoxy instead of gl3w.
> > 
> > The import was done at this commit (https://github.com/ocornut/imgui) :
> > 
> > commit 6211f40f3d903dd9df961256e044029c49793aa3
> > Author: omar 
> > Date:   Fri Jul 27 12:29:33 2018 +0200
> > 
> > Internals: Drag and Drop: default drop preview use a narrower clipping 
> > rectangle (no effect here, but other branches uses a narrow clipping 
> > rectangle that was too small so this is a fix for it) + Comments
> > 
> > Signed-off-by: Lionel Landwerlin 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/7] dri: Define DRI_MutableRenderBuffer extensions

2018-08-06 Thread Chad Versace
On Fri 03 Aug 2018, Tapani Pälli wrote:
> One tiny nit below but for patches 3,4 and 5:
> 
> Reviewed-by: Tapani Pälli 
> 
> Special thanks for the documentation. I want to go through rest of changes
> within Android but I'm currently experiencing some horrible issues with the
> image building. I'm hoping to resolve those soon and get back to business.
> 
> On 07/31/2018 09:18 PM, Chad Versace wrote:
> > Define extensions DRI_MutableRenderBufferDriver and
> > DRI_MutableRenderBufferLoader. These are the two halves for
> > EGL_KHR_mutable_render_buffer.
> > 
> > Outside the DRI code there is one additional change.  Add
> > gl_config::mutableRenderBuffer to match
> > __DRI_ATTRIB_MUTABLE_RENDER_BUFFER. Neither are used yet.
> > ---
> >   include/GL/internal/dri_interface.h| 138 -
> >   src/mesa/drivers/dri/common/dri_util.c |   2 +
> >   src/mesa/drivers/dri/common/dri_util.h |   4 +
> >   src/mesa/drivers/dri/common/utils.c|   1 +
> >   src/mesa/main/mtypes.h |   3 +
> >   5 files changed, 145 insertions(+), 3 deletions(-)



> > @@ -48,6 +48,7 @@ typedef unsigned int drm_drawable_t;
> >   typedef struct drm_clip_rect drm_clip_rect_t;
> >   #endif
> > +#include 
> 
> This does not look necessary change.

Thanks. This was a leftover from an earlier version.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 11/14] intel: tools: aubmem: map gtt data to aub file

2018-08-06 Thread Rafael Antognolli
On Thu, Aug 02, 2018 at 10:39:23AM +0100, Lionel Landwerlin wrote:
> This will allow the aubinator viewer tool to modify the aub data that
> was loaded at a particular gtt address.
> 
> Signed-off-by: Lionel Landwerlin 
> ---
>  src/intel/tools/aub_mem.c | 29 +
>  src/intel/tools/aub_mem.h |  6 ++
>  2 files changed, 35 insertions(+)
> 
> diff --git a/src/intel/tools/aub_mem.c b/src/intel/tools/aub_mem.c
> index 788a2461130..2d29386e57c 100644
> --- a/src/intel/tools/aub_mem.c
> +++ b/src/intel/tools/aub_mem.c
> @@ -55,6 +55,7 @@ struct phys_mem {
> uint64_t fd_offset;
> uint64_t phys_addr;
> uint8_t *data;
> +   const uint8_t *aub_data;
>  };
>  
>  static void
> @@ -220,6 +221,7 @@ aub_mem_phys_write(void *_mem, uint64_t phys_address,
>uint32_t size_this_page = MIN2(to_write, 4096 - offset);
>to_write -= size_this_page;
>memcpy(pmem->data + offset, data, size_this_page);
> +  pmem->aub_data = data - offset;
>data = (const uint8_t *)data + size_this_page;
> }
>  }
> @@ -389,3 +391,30 @@ aub_mem_fini(struct aub_mem *mem)
> close(mem->mem_fd);
> mem->mem_fd = -1;
>  }
> +
> +struct gen_batch_decode_bo
> +aub_mem_get_phys_addr_data(struct aub_mem *mem, uint64_t phys_addr)
> +{
> +   struct phys_mem *page = search_phys_mem(mem, phys_addr);
> +   return page ?
> +  (struct gen_batch_decode_bo) { .map = page->data, .addr = 
> page->phys_addr, .size = 4096 } :

Looks like we are starting to use gen_batch_decode_bo as a generic
address pointer now (to both physical, virtual or aub data memory), so
maybe at some point we might want to change that name.

Doesn't need to be done in this patch, though.

Reviewed-by: Rafael Antognolli 

> +  (struct gen_batch_decode_bo) {};
> +}
> +
> +struct gen_batch_decode_bo
> +aub_mem_get_ppgtt_addr_data(struct aub_mem *mem, uint64_t virt_addr)
> +{
> +   struct phys_mem *page = ppgtt_walk(mem, mem->pml4, virt_addr);
> +   return page ?
> +  (struct gen_batch_decode_bo) { .map = page->data, .addr = virt_addr & 
> ~((1ULL << 12) - 1), .size = 4096 } :
> +  (struct gen_batch_decode_bo) {};
> +}
> +
> +struct gen_batch_decode_bo
> +aub_mem_get_ppgtt_addr_aub_data(struct aub_mem *mem, uint64_t virt_addr)
> +{
> +   struct phys_mem *page = ppgtt_walk(mem, mem->pml4, virt_addr);
> +   return page ?
> +  (struct gen_batch_decode_bo) { .map = page->aub_data, .addr = 
> virt_addr & ~((1ULL << 12) - 1), .size = 4096 } :
> +  (struct gen_batch_decode_bo) {};
> +}
> diff --git a/src/intel/tools/aub_mem.h b/src/intel/tools/aub_mem.h
> index 98e64214b98..1d73d3340f2 100644
> --- a/src/intel/tools/aub_mem.h
> +++ b/src/intel/tools/aub_mem.h
> @@ -65,6 +65,12 @@ void aub_mem_local_write(void *mem, uint64_t virt_address,
>  struct gen_batch_decode_bo aub_mem_get_ggtt_bo(void *mem, uint64_t address);
>  struct gen_batch_decode_bo aub_mem_get_ppgtt_bo(void *mem, uint64_t address);
>  
> +struct gen_batch_decode_bo aub_mem_get_phys_addr_data(struct aub_mem *mem, 
> uint64_t phys_addr);
> +struct gen_batch_decode_bo aub_mem_get_ppgtt_addr_data(struct aub_mem *mem, 
> uint64_t virt_addr);
> +
> +struct gen_batch_decode_bo aub_mem_get_ppgtt_addr_aub_data(struct aub_mem 
> *mem, uint64_t virt_addr);
> +
> +
>  #ifdef __cplusplus
>  }
>  #endif
> -- 
> 2.18.0
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107483] DispatchSanity_test.GL31_CORE regression

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107483

Ian Romanick  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #2 from Ian Romanick  ---
Fixed by the two following commits:

6229ee87c76 mesa: fix make check for AMD_framebuffer_multisample_advanced
b7946f67787 glapi: Fix GLES versioning for AMD_framebuffer_multisample_advanced
functions

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/8] glapi: define AMD_framebuffer_multisample_advanced and add its functions

2018-08-06 Thread Ian Romanick

On 08/06/2018 03:49 AM, Juan A. Suarez Romero wrote:
> On Wed, 2018-08-01 at 19:25 -0400, Marek Olšák wrote:
>> From: Marek Olšák 
>>
>> ---
>>  src/mapi/glapi/gen/gl_API.xml | 27 +++
>>  src/mesa/main/fbobject.c  | 22 ++
>>  src/mesa/main/fbobject.h  | 10 ++
>>  3 files changed, 59 insertions(+)
>>
> 
> 
> Apparently, this patch is causing a break in the mesa tests:
> 
> https://travis-ci.org/mesa3d/mesa/jobs/412504427
> 
> http://paste.debian.net/1036881/

Fix is already on the list.  I'm getting ready to push it now.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 02/13] nvc0/ir: return 0 in imageLoad on incomplete textures

2018-08-06 Thread Karol Herbst
On Mon, Aug 6, 2018 at 6:26 PM, Dylan Baker  wrote:
> Quoting Karol Herbst (2018-07-15 11:15:42)
>> We already guarded all OP_SULDP against out of bound accesses, but those
>> ended up just reusing whatever value was stored in the dest registers.
>>
>> fixes CTS test shader_image_load_store.incomplete_textures
>>
>> v2: fix for loads not ending up with predicates (bindless_texture)
>> v3: fix replacing the def
>>
>> Signed-off-by: Karol Herbst 
>> ---
>>  .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 33 +--
>>  .../nouveau/codegen/nv50_ir_lowering_nvc0.h   |  1 +
>>  2 files changed, 31 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp 
>> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> index 1410cf26c87..743f5bd552b 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> @@ -2151,13 +2151,36 @@ 
>> NVC0LoweringPass::convertSurfaceFormat(TexInstruction *su)
>> }
>>  }
>>
>> +void
>> +NVC0LoweringPass::insertOOBSurfaceOpResult(TexInstruction *su)
>> +{
>> +   if (!su->getPredicate())
>> +  return;
>> +
>> +   bld.setPosition(su, true);
>> +
>> +   for (unsigned i = 0; su->defExists(i); ++i) {
>> +  ValueDef  = su->def(i);
>> +
>> +  Instruction *mov = bld.mkMov(bld.getSSA(), bld.loadImm(NULL, 0));
>> +  assert(su->cc == CC_NOT_P);
>> +  mov->setPredicate(CC_P, su->getPredicate());
>> +  Instruction *uni = bld.mkOp2(OP_UNION, TYPE_U32, bld.getSSA(), NULL, 
>> mov->getDef(0));
>> +
>> +  def.replace(uni->getDef(0), false);
>> +  uni->setSrc(0, def.get());
>> +   }
>> +}
>> +
>>  void
>>  NVC0LoweringPass::handleSurfaceOpNVE4(TexInstruction *su)
>>  {
>> processSurfaceCoordsNVE4(su);
>>
>> -   if (su->op == OP_SULDP)
>> +   if (su->op == OP_SULDP) {
>>convertSurfaceFormat(su);
>> +  insertOOBSurfaceOpResult(su);
>> +   }
>>
>> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>>assert(su->getPredicate());
>> @@ -2267,8 +2290,10 @@ NVC0LoweringPass::handleSurfaceOpNVC0(TexInstruction 
>> *su)
>>
>> processSurfaceCoordsNVC0(su);
>>
>> -   if (su->op == OP_SULDP)
>> +   if (su->op == OP_SULDP) {
>>convertSurfaceFormat(su);
>> +  insertOOBSurfaceOpResult(su);
>> +   }
>>
>> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>>const int dim = su->tex.target.getDim();
>> @@ -2370,8 +2395,10 @@ NVC0LoweringPass::handleSurfaceOpGM107(TexInstruction 
>> *su)
>>  {
>> processSurfaceCoordsGM107(su);
>>
>> -   if (su->op == OP_SULDP)
>> +   if (su->op == OP_SULDP) {
>>convertSurfaceFormat(su);
>> +  insertOOBSurfaceOpResult(su);
>> +   }
>>
>> if (su->op == OP_SUREDP) {
>>Value *def = su->getDef(0);
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h 
>> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
>> index 8724c09afd9..5dbb3e4f009 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
>> @@ -172,6 +172,7 @@ private:
>> void processSurfaceCoordsNVE4(TexInstruction *);
>> void processSurfaceCoordsNVC0(TexInstruction *);
>> void convertSurfaceFormat(TexInstruction *);
>> +   void insertOOBSurfaceOpResult(TexInstruction *);
>> Value *calculateSampleOffset(Value *sampleID);
>>
>>  protected:
>> --
>> 2.17.1
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> Hi Karol,
>
> I had to fix a couple of minor merge conflicts in the 18.1 branch, I've 
> compile
> tested, but could you have a look at the staging/18.1 branch and make sure
> everything looks good?
>
> Thanks,
> Dylan

looks fine, thanks.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] main/tests: Add AMD_framebuffer_multisample_advanced

2018-08-06 Thread Dylan Baker
Add dispatch_sanity tests

Fixes: 3d6900d76efaef1ff6e84b7b8785bbe3d8f5b29b
   ("glapi: define AMD_framebuffer_multisample_advanced and add its 
functions")
Cc: Marek Olšák 
Cc: Brian Paul 
Signed-off-by: Dylan Baker 
---

Marek, the XML in mesa and the Khronos XML agree that this works for GLES 2.0,
but the spec says 3.0. I assume the spec is wrong and should be corrected?

 src/mesa/main/tests/dispatch_sanity.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 82eb61dcf73..b395a09e13f 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1192,6 +1192,10 @@ const struct function 
common_desktop_functions_possible[] = {
{ "glMultiDrawArraysIndirectCountARB", 11, -1 },
{ "glMultiDrawElementsIndirectCountARB", 11, -1 },
 
+   /* GL_AMD_framebuffer_multisample_advanced */
+   { "glRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
+   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2497,6 +2501,10 @@ const struct function gles2_functions_possible[] = {
/* GL_NV_conservative_raster_pre_snap_triangles */
{ "glConservativeRasterParameteriNV", 20, -1 },
 
+   /* GL_AMD_framebuffer_multisample_advanced */
+   { "glRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
+   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] meson: use dependency()+find_program() for wayland-scanner

2018-08-06 Thread Dylan Baker
Quoting Emil Velikov (2018-06-28 07:35:44)
> From: Emil Velikov 
> 
> Helps when the native wayland-scanner is located outside of PATH.
> Inspired by the xserver code ;-)
> 
> Cc: Dylan Baker 
> Cc: Eric Engestrom 
> Signed-off-by: Emil Velikov 
> ---
>  meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index b2722c71e5b..79bac89e7d9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1269,7 +1269,8 @@ endif
>  # TODO: symbol mangling
>  
>  if with_platform_wayland
> -  prog_wl_scanner = find_program('wayland-scanner')
> +  dep_wl_scanner = dependency('wayland-scanner', native: true)
> +  prog_wl_scanner = 
> find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
>dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.8')
>dep_wayland_client = dependency('wayland-client', version : '>=1.11')
>dep_wayland_server = dependency('wayland-server', version : '>=1.11')
> -- 
> 2.18.0
> 

Hey Emil, it doesn't look like this ever landed, is there a reason for that I'm
not seeing in the mailing list discussion?

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] travis: add ubuntu-toolchain-r-test

2018-08-06 Thread Juan A. Suarez Romero
On Mon, 2018-08-06 at 12:17 +0200, Juan A. Suarez Romero wrote:
> LLVM 6.0 requires GCC 4.9, which is not available in main Travis
> repository.
> 
> Fixes: fd1121e8399 ("amd: remove support for LLVM 5.0")
> CC: Marek Olšák 

Cc: Emil Velikov 
Cc: Dylan Baker 


> 
> ---
>  .travis.yml | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/.travis.yml b/.travis.yml
> index fb192ae82a2..f7c2a8da996 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -137,6 +137,8 @@ matrix:
>  apt:
>sources:
>  - llvm-toolchain-trusty-6.0
> +# llvm-6 depends on gcc-4.9 which is not in main repo
> +- ubuntu-toolchain-r-test
>packages:
>  # LLVM packaging is broken and misses these dependencies
>  - libedit-dev
> @@ -378,6 +380,8 @@ matrix:
>  apt:
>sources:
>  - llvm-toolchain-trusty-6.0
> +# llvm-6 depends on gcc-4.9 which is not in main repo
> +- ubuntu-toolchain-r-test
>packages:
>  # LLVM packaging is broken and misses these dependencies
>  - libedit-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 02/13] nvc0/ir: return 0 in imageLoad on incomplete textures

2018-08-06 Thread Dylan Baker
Quoting Karol Herbst (2018-07-15 11:15:42)
> We already guarded all OP_SULDP against out of bound accesses, but those
> ended up just reusing whatever value was stored in the dest registers.
> 
> fixes CTS test shader_image_load_store.incomplete_textures
> 
> v2: fix for loads not ending up with predicates (bindless_texture)
> v3: fix replacing the def
> 
> Signed-off-by: Karol Herbst 
> ---
>  .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 33 +--
>  .../nouveau/codegen/nv50_ir_lowering_nvc0.h   |  1 +
>  2 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> index 1410cf26c87..743f5bd552b 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -2151,13 +2151,36 @@ NVC0LoweringPass::convertSurfaceFormat(TexInstruction 
> *su)
> }
>  }
>  
> +void
> +NVC0LoweringPass::insertOOBSurfaceOpResult(TexInstruction *su)
> +{
> +   if (!su->getPredicate())
> +  return;
> +
> +   bld.setPosition(su, true);
> +
> +   for (unsigned i = 0; su->defExists(i); ++i) {
> +  ValueDef  = su->def(i);
> +
> +  Instruction *mov = bld.mkMov(bld.getSSA(), bld.loadImm(NULL, 0));
> +  assert(su->cc == CC_NOT_P);
> +  mov->setPredicate(CC_P, su->getPredicate());
> +  Instruction *uni = bld.mkOp2(OP_UNION, TYPE_U32, bld.getSSA(), NULL, 
> mov->getDef(0));
> +
> +  def.replace(uni->getDef(0), false);
> +  uni->setSrc(0, def.get());
> +   }
> +}
> +
>  void
>  NVC0LoweringPass::handleSurfaceOpNVE4(TexInstruction *su)
>  {
> processSurfaceCoordsNVE4(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>assert(su->getPredicate());
> @@ -2267,8 +2290,10 @@ NVC0LoweringPass::handleSurfaceOpNVC0(TexInstruction 
> *su)
>  
> processSurfaceCoordsNVC0(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>const int dim = su->tex.target.getDim();
> @@ -2370,8 +2395,10 @@ NVC0LoweringPass::handleSurfaceOpGM107(TexInstruction 
> *su)
>  {
> processSurfaceCoordsGM107(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDP) {
>Value *def = su->getDef(0);
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> index 8724c09afd9..5dbb3e4f009 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> @@ -172,6 +172,7 @@ private:
> void processSurfaceCoordsNVE4(TexInstruction *);
> void processSurfaceCoordsNVC0(TexInstruction *);
> void convertSurfaceFormat(TexInstruction *);
> +   void insertOOBSurfaceOpResult(TexInstruction *);
> Value *calculateSampleOffset(Value *sampleID);
>  
>  protected:
> -- 
> 2.17.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Hi Karol,

I had to fix a couple of minor merge conflicts in the 18.1 branch, I've compile
tested, but could you have a look at the staging/18.1 branch and make sure
everything looks good?

Thanks,
Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] meson, install_megadrivers: Also remove stale symlinks

2018-08-06 Thread Gert Wollny
Am Montag, den 06.08.2018, 16:59 +0100 schrieb Eric Engestrom:
> On Monday, 2018-08-06 09:41:48 +0200, Gert Wollny wrote:
> > os.path.exists doesn't return True for stale symlinks, but they are
> > in
> > the way later, when a link/file with the same name is to be
> > created.
> > For instance it is conceivable that the pointed to file is replaced
> > by
> > a file with a new name, and then the symlink is dead.
> > 
> > To handle this check specifically for all existing symlinks to be
> > removed. (This bugged me for some time with a link libXvMCr600.so
> > always being in the way of installing this file)
> > 
> > v2: use only os.path.lexist and replace all instances
> > of os.path.exist (Dylan Baker)
> > 
> > Fixes: f7f1b30f81e842db6057591470ce3cb6d4fb2795
> >   ("meson: extend install_megadrivers script to handle
> > symmlinking")
> > 
> > Signed-off-by: Gert Wollny 
> > ---
> >  bin/install_megadrivers.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/bin/install_megadrivers.py
> > b/bin/install_megadrivers.py
> > index 8d9ed9c6dc..3a31fddd89 100755
> > --- a/bin/install_megadrivers.py
> > +++ b/bin/install_megadrivers.py
> > @@ -42,14 +42,14 @@ def main():
> >  
> >  master = os.path.join(to, os.path.basename(args.megadriver))
> >  
> > -if not os.path.exists(to):
> > +if not os.path.lexists(to):
> >  os.makedirs(to)

> 
> I'm not convinced on this one: if the `to` destination is a symlink
> but the destination of the symlink doesn't exist, we shouldn't just
> consider that the folder has already been created and is ready for
> use.
You're right, I guess it was too early this morning, so that I just
changed all instances of os.exists mechnically, 


> 
> I think here we should either just ignore that case, or if we want to
> handle it then it should be:
>   if not exists(to):
>   if lexists(to):
>   unlink(to)
>   makedirs(to)
Fixes like this locally. 

best, 
Gert

> 
> The other two below are
> Reviewed-by: Eric Engestrom 
> 
> >  shutil.copy(args.megadriver, master)
> >  
> >  for driver in args.drivers:
> >  abs_driver = os.path.join(to, driver)
> >  
> > -if os.path.exists(abs_driver):
> > +if os.path.lexists(abs_driver):
> >  os.unlink(abs_driver)
> >  print('installing {} to {}'.format(args.megadriver,
> > abs_driver))
> >  os.link(master, abs_driver)
> > @@ -60,7 +60,7 @@ def main():
> >  
> >  name, ext = os.path.splitext(driver)
> >  while ext != '.so':
> > -if os.path.exists(name):
> > +if os.path.lexists(name):
> >  os.unlink(name)
> >  os.symlink(driver, name)
> >  name, ext = os.path.splitext(name)
> > -- 
> > 2.16.4
> > 
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] meson, install_megadrivers: Also remove stale symlinks

2018-08-06 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-06 08:59:00)
> On Monday, 2018-08-06 09:41:48 +0200, Gert Wollny wrote:
> > os.path.exists doesn't return True for stale symlinks, but they are in
> > the way later, when a link/file with the same name is to be created.
> > For instance it is conceivable that the pointed to file is replaced by
> > a file with a new name, and then the symlink is dead.
> > 
> > To handle this check specifically for all existing symlinks to be
> > removed. (This bugged me for some time with a link libXvMCr600.so
> > always being in the way of installing this file)
> > 
> > v2: use only os.path.lexist and replace all instances
> > of os.path.exist (Dylan Baker)
> > 
> > Fixes: f7f1b30f81e842db6057591470ce3cb6d4fb2795
> >   ("meson: extend install_megadrivers script to handle symmlinking")
> > 
> > Signed-off-by: Gert Wollny 
> > ---
> >  bin/install_megadrivers.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
> > index 8d9ed9c6dc..3a31fddd89 100755
> > --- a/bin/install_megadrivers.py
> > +++ b/bin/install_megadrivers.py
> > @@ -42,14 +42,14 @@ def main():
> >  
> >  master = os.path.join(to, os.path.basename(args.megadriver))
> >  
> > -if not os.path.exists(to):
> > +if not os.path.lexists(to):
> >  os.makedirs(to)
> 
> I'm not convinced on this one: if the `to` destination is a symlink but
> the destination of the symlink doesn't exist, we shouldn't just consider
> that the folder has already been created and is ready for use.
> 
> I think here we should either just ignore that case, or if we want to
> handle it then it should be:
>   if not exists(to):
>   if lexists(to):
>   unlink(to)
>   makedirs(to)
> 
> The other two below are
> Reviewed-by: Eric Engestrom 

Good catch, I wasn't paying good enough attention :/

With either Eric's suggestion, or the first hunk removed:

Reviewed-by: Dylan Baker 

> 
> >  shutil.copy(args.megadriver, master)
> >  
> >  for driver in args.drivers:
> >  abs_driver = os.path.join(to, driver)
> >  
> > -if os.path.exists(abs_driver):
> > +if os.path.lexists(abs_driver):
> >  os.unlink(abs_driver)
> >  print('installing {} to {}'.format(args.megadriver, abs_driver))
> >  os.link(master, abs_driver)
> > @@ -60,7 +60,7 @@ def main():
> >  
> >  name, ext = os.path.splitext(driver)
> >  while ext != '.so':
> > -if os.path.exists(name):
> > +if os.path.lexists(name):
> >  os.unlink(name)
> >  os.symlink(driver, name)
> >  name, ext = os.path.splitext(name)
> > -- 
> > 2.16.4
> > 
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] meson, install_megadrivers: Also remove stale symlinks

2018-08-06 Thread Eric Engestrom
On Monday, 2018-08-06 09:41:48 +0200, Gert Wollny wrote:
> os.path.exists doesn't return True for stale symlinks, but they are in
> the way later, when a link/file with the same name is to be created.
> For instance it is conceivable that the pointed to file is replaced by
> a file with a new name, and then the symlink is dead.
> 
> To handle this check specifically for all existing symlinks to be
> removed. (This bugged me for some time with a link libXvMCr600.so
> always being in the way of installing this file)
> 
> v2: use only os.path.lexist and replace all instances
> of os.path.exist (Dylan Baker)
> 
> Fixes: f7f1b30f81e842db6057591470ce3cb6d4fb2795
>   ("meson: extend install_megadrivers script to handle symmlinking")
> 
> Signed-off-by: Gert Wollny 
> ---
>  bin/install_megadrivers.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
> index 8d9ed9c6dc..3a31fddd89 100755
> --- a/bin/install_megadrivers.py
> +++ b/bin/install_megadrivers.py
> @@ -42,14 +42,14 @@ def main():
>  
>  master = os.path.join(to, os.path.basename(args.megadriver))
>  
> -if not os.path.exists(to):
> +if not os.path.lexists(to):
>  os.makedirs(to)

I'm not convinced on this one: if the `to` destination is a symlink but
the destination of the symlink doesn't exist, we shouldn't just consider
that the folder has already been created and is ready for use.

I think here we should either just ignore that case, or if we want to
handle it then it should be:
  if not exists(to):
  if lexists(to):
  unlink(to)
  makedirs(to)

The other two below are
Reviewed-by: Eric Engestrom 

>  shutil.copy(args.megadriver, master)
>  
>  for driver in args.drivers:
>  abs_driver = os.path.join(to, driver)
>  
> -if os.path.exists(abs_driver):
> +if os.path.lexists(abs_driver):
>  os.unlink(abs_driver)
>  print('installing {} to {}'.format(args.megadriver, abs_driver))
>  os.link(master, abs_driver)
> @@ -60,7 +60,7 @@ def main():
>  
>  name, ext = os.path.splitext(driver)
>  while ext != '.so':
> -if os.path.exists(name):
> +if os.path.lexists(name):
>  os.unlink(name)
>  os.symlink(driver, name)
>  name, ext = os.path.splitext(name)
> -- 
> 2.16.4
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107488] gl.h:2090: error: redefinition of typedef ‘GLeglImageOES’

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107488

--- Comment #1 from Brian Paul  ---
Created attachment 140982
  --> https://bugs.freedesktop.org/attachment.cgi?id=140982=edit
proposed fix

Hmmm, I don't see that issue here.  What is your ./configure command line?

In any case, does the attached patch fix this?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] wayland/egl: initialize window surface size to window size

2018-08-06 Thread Juan A. Suarez Romero
On Mon, 2018-08-06 at 16:02 +0100, Daniel Stone wrote:
> Hi Juan,
> 
> On Tue, 5 Jun 2018 at 18:23, Juan A. Suarez Romero  
> wrote:
> > On Tue, 2018-06-05 at 12:41 +0100, Daniel Stone wrote:
> > > > - In Wayland/Mesa, the surface is not resized at the time the native 
> > > > window is
> > > > resized; this is done in *eglSwapBuffers*, following 3.10.1.1.
> > > 
> > > Disagree, given that we are in charge of exactly when the native
> > > window is 'resized'. It's unclear to me what 'resize the surface prior
> > > to copying its pixels to the native window' even means: does this
> > > require we do a scale blit, or a crop blit, or?
> > > 
> > > The semantics Mesa has interpreted until recently is that
> > > wl_egl_resize_window() constitutes a resize _request_, and that the
> > > last submitted request is acted upon and latched at the first draw
> > > call. This then constitutes the native surface size up until the next
> > > first draw call. I think these are good semantics, and we have to be
> > > quite picky about what exactly we implement, since clients rely on
> > > them. Not just cosmetically (atomic resizing of subsurface chains),
> > > but also because if you get your window sizing wrong on the desktop,
> > > you'll catch a fatal error from the compositor (X11 just shrugs and
> > > does nothing).
> > > 
> > > I think these are good semantics (as to exactly when resize takes
> > > effect), but for the moment we only update the EGL_{WIDTH,HEIGHT}
> > > surface query results after the first draw call. I would suggest that
> > > in the period after eglSwapBuffers but before the first draw call, we
> > > also update those values, and that we update them after eglSwapBuffers
> > > has executed as well. This makes the semantics that any native window
> > > resize requests take effect immediately after eglSwapBuffers (or just
> > > immediately, if no swap has ever been executed) and before the first
> > > draw call (or buffer_age query ... cf. 9ca6711faa03) for a given
> > > frame; in between the first draw call and eglSwapBuffers, the native
> > > resize requests will be queued until after eglSwapBuffers.
> > 
> > 
> > I see. The surface size should be updated inmediately, after a window 
> > resize is
> > done, as you said.
> > 
> > I'll send then a new patch version. Actually I'll split this patch in two: 
> > one
> > to correctly initialize the surface size (there is no doubt on this, and 
> > this
> > patch alone will fix the test), and another patch to correctly update the
> > surface size when the window is resized.
> 
> I think the v3 2/2 patch doesn't actually conform to this behaviour,
> as it unconditionally sets the surface width/height from
> wl_egl_window_resize() rather than waiting until the resized buffers
> are actually going to take effect.
> 

Yes, the idea is that any window resize take effect immediately, without
requiring to run eglSwapBuffers() (that is, if window is resized and the surface
size is immediately queried, the new size is returned; only when the buffers are
updated a new buffer with is created).


J.A.




> Cheers,
> Daniel
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] wayland/egl: initialize window surface size to window size

2018-08-06 Thread Daniel Stone
Hi Juan,

On Tue, 5 Jun 2018 at 18:23, Juan A. Suarez Romero  wrote:
> On Tue, 2018-06-05 at 12:41 +0100, Daniel Stone wrote:
> > > - In Wayland/Mesa, the surface is not resized at the time the native 
> > > window is
> > > resized; this is done in *eglSwapBuffers*, following 3.10.1.1.
> >
> > Disagree, given that we are in charge of exactly when the native
> > window is 'resized'. It's unclear to me what 'resize the surface prior
> > to copying its pixels to the native window' even means: does this
> > require we do a scale blit, or a crop blit, or?
> >
> > The semantics Mesa has interpreted until recently is that
> > wl_egl_resize_window() constitutes a resize _request_, and that the
> > last submitted request is acted upon and latched at the first draw
> > call. This then constitutes the native surface size up until the next
> > first draw call. I think these are good semantics, and we have to be
> > quite picky about what exactly we implement, since clients rely on
> > them. Not just cosmetically (atomic resizing of subsurface chains),
> > but also because if you get your window sizing wrong on the desktop,
> > you'll catch a fatal error from the compositor (X11 just shrugs and
> > does nothing).
> >
> > I think these are good semantics (as to exactly when resize takes
> > effect), but for the moment we only update the EGL_{WIDTH,HEIGHT}
> > surface query results after the first draw call. I would suggest that
> > in the period after eglSwapBuffers but before the first draw call, we
> > also update those values, and that we update them after eglSwapBuffers
> > has executed as well. This makes the semantics that any native window
> > resize requests take effect immediately after eglSwapBuffers (or just
> > immediately, if no swap has ever been executed) and before the first
> > draw call (or buffer_age query ... cf. 9ca6711faa03) for a given
> > frame; in between the first draw call and eglSwapBuffers, the native
> > resize requests will be queued until after eglSwapBuffers.
>
>
> I see. The surface size should be updated inmediately, after a window resize 
> is
> done, as you said.
>
> I'll send then a new patch version. Actually I'll split this patch in two: one
> to correctly initialize the surface size (there is no doubt on this, and this
> patch alone will fix the test), and another patch to correctly update the
> surface size when the window is resized.

I think the v3 2/2 patch doesn't actually conform to this behaviour,
as it unconditionally sets the surface width/height from
wl_egl_window_resize() rather than waiting until the resized buffers
are actually going to take effect.

Cheers,
Daniel
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] [rfc] r600: set vpm bit for loop start clause

2018-08-06 Thread Roland Scheidegger
Am 05.08.2018 um 11:47 schrieb Gert Wollny:
> Am Freitag, den 03.08.2018, 06:02 +0200 schrieb Roland Scheidegger:
>> Am 03.08.2018 um 05:10 schrieb Dave Airlie:
>>> From: Dave Airlie 
>>>
>>> This fixes some hangs with the arb_shader_image_load_store-
>>> atomicity tests
>>> on evergreen/cayman GPUs.
>>>
>>> I'm not 100% sure why (VPM hurts my brain), I'm running some piglit
>>> runs to see if it has any bad side effects.
>>> ---
>>>  src/gallium/drivers/r600/r600_shader.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/drivers/r600/r600_shader.c
>>> b/src/gallium/drivers/r600/r600_shader.c
>>> index 2229dc8fab3..1341bf2c48c 100644
>>> --- a/src/gallium/drivers/r600/r600_shader.c
>>> +++ b/src/gallium/drivers/r600/r600_shader.c
>>> @@ -10587,7 +10587,7 @@ static int tgsi_bgnloop(struct
>>> r600_shader_ctx *ctx)
>>> /* LOOP_START_DX10 ignores the LOOP_CONFIG* registers, so
>>> it is not
>>>  * limited to 4096 iterations, like the other LOOP_*
>>> instructions. */
>>> r600_bytecode_add_cfinst(ctx->bc, CF_OP_LOOP_START_DX10);
>>> -
>>> +   ctx->bc->cf_last->vpm = 1;
>>> fc_pushlevel(ctx, FC_LOOP);
>>>  
>>> /* check stack depth */
>>>
>>
>> I think you might get incorrect derivatives afterwards (if some
>> pixels in a quad were invalid)? Or are the lanes in the alu still
>> active (I
>> don't really understand all the vpm stuff...) afterwards?
>>
>> I'm wondering if the tests are just bad? You can get lockups rather
>> easily if you're not extra careful with atomics in loops (because the
>> result of the atomic is undefined for helper invocations, and the hw
>> will never store the result).
>> There was recently some discussion about this on mesa-dev, also see
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D106902data=02%7C01%7Csroland%40vmware.com%7Cd5d0b8ddaa4d41773dc408d5fab881e6%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636690592726947263sdata=7QJv4h8OUfzFaJvTjdAUgUr2WbdBu85SC6Z2h%2FZSCFw%3Dreserved=0
> 
> I might add that I've also played around to get rid of these locks, at
> least to be able to run the gpu test set completely, so I did one
> thing, I limited the number of iterations by using an extra counter,
> and with that this particular test passed, which means that some
> instance of the shader is really running the loop with bogous data.
> This patch fixed the unmodified piglit for me.
> 
> Another piglit, 
> 
> arb_shader_storage_buffer_object/
>execution/ssbo-atomicCompSwap-int.shader_test
> 
> still hangs for some time (on barts), but it has an extra protection
> against helper invocations. This test also fails when I put in such a
> savety counter to break the loop after 1000 iterations,  so I guess the
> failure is geniue, but failing this test should not result in a GPU
> lockup. I guess tests that might lockup a GPU are needed to be able to
> debug problems, but IMHO they should not be part of some of these 
> general test sets.
> 
> Because of these lockups I have no data to compare older runs. With
> this patch and the ssbo test fixed up I got 
> 
> [26236/26236] skip: 10688, pass: 15118, warn: 13, fail: 412, crash: 5
> 
> for the full gpu set on BARTS in single thread mode, on CEDAR I got
> some other, unrelated  GPU lockups.
> 
> Looking only at the texture piglits that failed, there were no
> regressions with respect to this patch. 
My guess would be that there's possibly no texturing tests (using
implicit derivatives) which would test texturing after (or in) loops, so
no regressions wouldn't necessarily mean much, but it's definitely
something which could happen in practice.
(Writing such a test if there isn't any shouldn't be too difficult.)

Roland

> 
> When running piglit multithreaded I still get lockups that bring down
> the graphics card so that it was no longer fully usable and a cold
> restart is needed. In these cases various piglits that run tests with
> atomics are running in parallel, and notable the process running
> arb_compute_shader-local-id could not be killed a all. 
> 
> In any case, this patch looks like an enhacement to me, because it
> makes lockups less likely, and I didn't see regressions, so 
>   Tested-By: Gert Wollny 
> 
> best,
> Gert
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 106187] Vulkan apps run on secondary GPU on multi-GPU system

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106187

--- Comment #12 from Ilia Mirkin  ---
I believe that's the loader (in src/loader) - nothing radv specific. It's
annoying for GL purposes too, with DRI_PRIME=1 picking the *last* GPU instead
of the second.

It used to work this way, but then the logic got changed. I'd be in favor of
fixing the reverse-sort.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 106187] Vulkan apps run on secondary GPU on multi-GPU system

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106187

--- Comment #11 from sher...@amiran.us ---
I have the same problem using DXVK, and there is a similar bug report on
vkmark:
https://github.com/vkmark/vkmark/issues/10

It seems that there is something in the RADV driver that causes GPUs to
enumerate in reverse order as they appear on the PCIe bus.

The simplest fix that would apply to most applications would be such that
sorting of devices presented by the driver should be in the same order as
enumeration on the PCIe bus, which should respect slot number and be pretty
straightforward (if requiring a small hardware modification) for the user to
manage.

It would be even awesome-r if the device name presented could include a unique
number (preferably PCIe slot number, if not just a unique number generated when
enumerated), so that programs that presented the user with a selection could
allow for some clarity when choosing.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: do not emit empty sampler state

2018-08-06 Thread Lionel Landwerlin

Hey Erik,

I don't think this is right, because by not filling out_offset, you're 
leaving it at 0 which makes the entry in the binding table point to a 
dynamic state base address.

I would emit the null surface instead.

-
Lionel

On 06/08/18 14:27, Erik Faye-Lund wrote:

If called with an empty size, brw_emit_buffer_surface_state asserts.
And since doing a zero-size upload is really just a lot of work for
no gain, let's just avoid the call in the first place.

Signed-off-by: Erik Faye-Lund 
---
This fixes an assert that triggers for me when running
dEQP-GLES31.functional.shaders.opaque_type_indexing.ssbo.const_literal_vertex
on top of a debug-build of mesa on top of i965. Since setting up a virgl
setup is rather convoluted, here's a piglit shader-test that reproduce it
directly on top of a debug-build of mesa on i965:

https://gitlab.freedesktop.org/kusma/piglit/tree/ssbo-zero-size

  .../drivers/dri/i965/brw_wm_surface_state.c| 18 ++
  1 file changed, 10 insertions(+), 8 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 9397b637c7..0da7f97218 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1322,14 +1322,16 @@ upload_buffer_surface(struct brw_context *brw,
if (!binding->AutomaticSize)
   size = MIN2(size, binding->Size);
  
-  struct intel_buffer_object *iobj =

- intel_buffer_object(binding->BufferObject);
-  struct brw_bo *bo =
- intel_bufferobj_buffer(brw, iobj, binding->Offset, size,
-(reloc_flags & RELOC_WRITE) != 0);
-
-  brw_emit_buffer_surface_state(brw, out_offset, bo, binding->Offset,
-format, size, 1, reloc_flags);
+  if (size > 0) {
+ struct intel_buffer_object *iobj =
+intel_buffer_object(binding->BufferObject);
+ struct brw_bo *bo =
+intel_bufferobj_buffer(brw, iobj, binding->Offset, size,
+   (reloc_flags & RELOC_WRITE) != 0);
+
+ brw_emit_buffer_surface_state(brw, out_offset, bo, binding->Offset,
+   format, size, 1, reloc_flags);
+  }
 }
  }
  



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965: do not emit empty sampler state

2018-08-06 Thread Erik Faye-Lund
If called with an empty size, brw_emit_buffer_surface_state asserts.
And since doing a zero-size upload is really just a lot of work for
no gain, let's just avoid the call in the first place.

Signed-off-by: Erik Faye-Lund 
---
This fixes an assert that triggers for me when running
dEQP-GLES31.functional.shaders.opaque_type_indexing.ssbo.const_literal_vertex
on top of a debug-build of mesa on top of i965. Since setting up a virgl
setup is rather convoluted, here's a piglit shader-test that reproduce it
directly on top of a debug-build of mesa on i965:

https://gitlab.freedesktop.org/kusma/piglit/tree/ssbo-zero-size

 .../drivers/dri/i965/brw_wm_surface_state.c| 18 ++
 1 file changed, 10 insertions(+), 8 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 9397b637c7..0da7f97218 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1322,14 +1322,16 @@ upload_buffer_surface(struct brw_context *brw,
   if (!binding->AutomaticSize)
  size = MIN2(size, binding->Size);
 
-  struct intel_buffer_object *iobj =
- intel_buffer_object(binding->BufferObject);
-  struct brw_bo *bo =
- intel_bufferobj_buffer(brw, iobj, binding->Offset, size,
-(reloc_flags & RELOC_WRITE) != 0);
-
-  brw_emit_buffer_surface_state(brw, out_offset, bo, binding->Offset,
-format, size, 1, reloc_flags);
+  if (size > 0) {
+ struct intel_buffer_object *iobj =
+intel_buffer_object(binding->BufferObject);
+ struct brw_bo *bo =
+intel_bufferobj_buffer(brw, iobj, binding->Offset, size,
+   (reloc_flags & RELOC_WRITE) != 0);
+
+ brw_emit_buffer_surface_state(brw, out_offset, bo, binding->Offset,
+   format, size, 1, reloc_flags);
+  }
}
 }
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v4 1/2] intel/ppgtt: memory address alignment

2018-08-06 Thread Lionel Landwerlin

On 06/08/18 13:41, Sergii Romantsov wrote:

Kernel (for ppgtt) requires memory address to be
aligned to page size (4096).

-v2: added marking that also fixes initial commit 01058a552294.
-v3: numbers replaced by PAGE_SIZE; buffer-object size is aligned
instead of alignment of offsets (Chris Wilson).
-v4: changes related to PAGE_SIZE moved to separate commit

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106997
Fixes: a363bb2cd0e2 (i965: Allocate VMA in userspace for full-PPGTT systems.)
Fixes: 01058a552294 (i965: Add virtual memory allocator infrastructure to 
brw_bufmgr.)
Signed-off-by: Sergii Romantsov 


Reviewed-by: Lionel Landwerlin 

Thanks!


---
  src/mesa/drivers/dri/i965/brw_bufmgr.c | 7 +++
  1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c 
b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 09d45e3..8274c2e 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -496,7 +496,6 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
uint32_t stride)
  {
 struct brw_bo *bo;
-   unsigned int page_size = getpagesize();
 int ret;
 struct bo_cache_bucket *bucket;
 bool alloc_from_cache;
@@ -522,12 +521,12 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
  * allocation up.
  */
 if (bucket == NULL) {
-  bo_size = size;
-  if (bo_size < page_size)
- bo_size = page_size;
+  unsigned int page_size = getpagesize();
+  bo_size = ALIGN(size, page_size);
 } else {
bo_size = bucket->size;
 }
+   assert(bo_size);
  
 mtx_lock(>lock);

 /* Get a buffer out of the cache if available */



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 99730] Metro Redux game(s) needs override for midshader extension declaration

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99730

--- Comment #8 from vadym  ---
(In reply to Eero Tamminen from comment #7)
> (In reply to vadym from comment #6)
> > I didn't noticed any visual issues (but suppose it should be fixed anyway).
> > Last Night Redux is run with the same binary name (metro) as in case of
> > Metro 2033 redux. So your patch fixes both cases. I re-based and tested your
> > patch and confirm it fixes the issue.
> 
> Thanks for testing!
> 
> As it fixes both, the name attribute in patch should state that too, e.g:
> name="Metro 2033 Redux / Last Light Redux"
> 
> 
> > Can you please send the patch for review ? Or just let me know it you want
> > me to send it.
> 
> Unfortunately I still don't have time for Steam stuff, so if you could
> update the patch and do that, it would be great!
> 
> 
> Patch description should contain:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99730

Patch pushed for review https://patchwork.freedesktop.org/patch/242827/

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] drirc: Allow extension midshader for Metro Redux

2018-08-06 Thread vadym.shovkoplias
This fixes both Metro 2033 Redux and Metro Last Light Redux

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99730
Signed-off-by: Eero Tamminen 
Signed-off-by: Vadym Shovkoplias 
---
 src/util/drirc | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/util/drirc b/src/util/drirc
index 8ece875e34..c4f9e060f3 100644
--- a/src/util/drirc
+++ b/src/util/drirc
@@ -120,6 +120,10 @@ TODO: document the other workarounds.
 
 
 
+
+
+
+
 
 
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] drirc: Allow extension midshader for Metro Redux

2018-08-06 Thread vadym.shovkoplias
This fixes both Metro 2033 Redux and Metro Last Light Redux

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99730
Signed-off-by: Eero Tamminen 
Signed-off-by: Vadym Shovkoplias 
---
 src/util/drirc | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/util/drirc b/src/util/drirc
index 8ece875e34..acf20d11fc 100644
--- a/src/util/drirc
+++ b/src/util/drirc
@@ -88,6 +88,7 @@ TODO: document the other workarounds.
 
 
 
+
 
 
 
@@ -120,6 +121,10 @@ TODO: document the other workarounds.
 
 
 
+
+
+
+
 
 
 
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 1/2] intel/ppgtt: memory address alignment

2018-08-06 Thread Sergii Romantsov
Kernel (for ppgtt) requires memory address to be
aligned to page size (4096).

-v2: added marking that also fixes initial commit 01058a552294.
-v3: numbers replaced by PAGE_SIZE; buffer-object size is aligned
instead of alignment of offsets (Chris Wilson).
-v4: changes related to PAGE_SIZE moved to separate commit

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106997
Fixes: a363bb2cd0e2 (i965: Allocate VMA in userspace for full-PPGTT systems.)
Fixes: 01058a552294 (i965: Add virtual memory allocator infrastructure to 
brw_bufmgr.)
Signed-off-by: Sergii Romantsov 
---
 src/mesa/drivers/dri/i965/brw_bufmgr.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c 
b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 09d45e3..8274c2e 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -496,7 +496,6 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
   uint32_t stride)
 {
struct brw_bo *bo;
-   unsigned int page_size = getpagesize();
int ret;
struct bo_cache_bucket *bucket;
bool alloc_from_cache;
@@ -522,12 +521,12 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
 * allocation up.
 */
if (bucket == NULL) {
-  bo_size = size;
-  if (bo_size < page_size)
- bo_size = page_size;
+  unsigned int page_size = getpagesize();
+  bo_size = ALIGN(size, page_size);
} else {
   bo_size = bucket->size;
}
+   assert(bo_size);
 
mtx_lock(>lock);
/* Get a buffer out of the cache if available */
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 2/2] intel/ppgtt: 4096 replaced by PAGE_SIZE

2018-08-06 Thread Sergii Romantsov
Usage of number 4096 replaced by PAGE_SIZE.

Signed-off-by: Sergii Romantsov 
---
 src/mesa/drivers/dri/i965/brw_bufmgr.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c 
b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 8274c2e..66d7751 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -195,7 +195,7 @@ bo_tile_size(struct brw_bufmgr *bufmgr, uint64_t size, 
uint32_t tiling)
   return size;
 
/* 965+ just need multiples of page size for tiling */
-   return ALIGN(size, 4096);
+   return ALIGN(size, PAGE_SIZE);
 }
 
 /*
@@ -1577,12 +1577,12 @@ init_cache_buckets(struct brw_bufmgr *bufmgr)
 * width/height alignment and rounding of sizes to pages will
 * get us useful cache hit rates anyway)
 */
-   add_bucket(bufmgr, 4096);
-   add_bucket(bufmgr, 4096 * 2);
-   add_bucket(bufmgr, 4096 * 3);
+   add_bucket(bufmgr, PAGE_SIZE);
+   add_bucket(bufmgr, PAGE_SIZE * 2);
+   add_bucket(bufmgr, PAGE_SIZE * 3);
 
/* Initialize the linked lists for BO reuse cache. */
-   for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
+   for (size = 4 * PAGE_SIZE; size <= cache_max_size; size *= 2) {
   add_bucket(bufmgr, size);
 
   add_bucket(bufmgr, size + size * 1 / 4);
@@ -1728,7 +1728,7 @@ brw_bufmgr_init(struct gen_device_info *devinfo, int fd)
  bufmgr->initial_kflags |= EXEC_OBJECT_PINNED;
 
  util_vma_heap_init(>vma_allocator[BRW_MEMZONE_LOW_4G],
-4096, _4GB);
+PAGE_SIZE, _4GB);
  util_vma_heap_init(>vma_allocator[BRW_MEMZONE_OTHER],
 1 * _4GB, gtt_size - 1 * _4GB);
   } else if (devinfo->gen >= 10) {
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/8] glapi: define AMD_framebuffer_multisample_advanced and add its functions

2018-08-06 Thread Juan A. Suarez Romero
On Wed, 2018-08-01 at 19:25 -0400, Marek Olšák wrote:
> From: Marek Olšák 
> 
> ---
>  src/mapi/glapi/gen/gl_API.xml | 27 +++
>  src/mesa/main/fbobject.c  | 22 ++
>  src/mesa/main/fbobject.h  | 10 ++
>  3 files changed, 59 insertions(+)
> 


Apparently, this patch is causing a break in the mesa tests:

https://travis-ci.org/mesa3d/mesa/jobs/412504427

http://paste.debian.net/1036881/


J.A.

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> index 49807e1ea52..81e4ac08cce 100644
> --- a/src/mapi/glapi/gen/gl_API.xml
> +++ b/src/mapi/glapi/gen/gl_API.xml
> @@ -13028,20 +13028,47 @@
>   xmlns:xi="http://www.w3.org/2001/XInclude"/>;
>  
>  
>  
>  
>  
>  
>  
>  
>  
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> + es2="2.0">
> +   
> +   
> +   
> +   
> +   
> +   
> +
> +
> +
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index edafdd011aa..f63902c9dd4 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2485,20 +2485,31 @@ void GLAPIENTRY
>  _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
>   GLenum internalFormat,
>   GLsizei width, GLsizei height)
>  {
> renderbuffer_storage_target(target, internalFormat, width, height,
> samples, samples,
> "glRenderbufferStorageMultisample");
>  }
>  
>  
> +void GLAPIENTRY
> +_mesa_RenderbufferStorageMultisampleAdvancedAMD(
> +  GLenum target, GLsizei samples, GLsizei storageSamples,
> +  GLenum internalFormat, GLsizei width, GLsizei height)
> +{
> +   renderbuffer_storage_target(target, internalFormat, width, height,
> +   samples, storageSamples,
> +   
> "glRenderbufferStorageMultisampleAdvancedAMD");
> +}
> +
> +
>  /**
>   * OpenGL ES version of glRenderBufferStorage.
>   */
>  void GLAPIENTRY
>  _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
> GLsizei width, GLsizei height)
>  {
> switch (internalFormat) {
> case GL_RGB565:
>/* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
> @@ -2529,20 +2540,31 @@ void GLAPIENTRY
>  _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei 
> samples,
>GLenum internalformat,
>GLsizei width, GLsizei height)
>  {
> renderbuffer_storage_named(renderbuffer, internalformat, width, height,
>samples, samples,
>"glNamedRenderbufferStorageMultisample");
>  }
>  
>  
> +void GLAPIENTRY
> +_mesa_NamedRenderbufferStorageMultisampleAdvancedAMD(
> +  GLuint renderbuffer, GLsizei samples, GLsizei storageSamples,
> +  GLenum internalformat, GLsizei width, GLsizei height)
> +{
> +   renderbuffer_storage_named(renderbuffer, internalformat, width, height,
> +  samples, storageSamples,
> +  
> "glNamedRenderbufferStorageMultisampleAdvancedAMD");
> +}
> +
> +
>  static void
>  get_render_buffer_parameteriv(struct gl_context *ctx,
>struct gl_renderbuffer *rb, GLenum pname,
>GLint *params, const char *func)
>  {
> /* No need to flush here since we're just quering state which is
>  * not effected by rendering.
>  */
>  
> switch (pname) {
> diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
> index 0299781b1e5..5cd3c60297f 100644
> --- a/src/mesa/main/fbobject.h
> +++ b/src/mesa/main/fbobject.h
> @@ -166,33 +166,43 @@ _mesa_CreateRenderbuffers(GLsizei n, GLuint 
> *renderbuffers);
>  
>  extern void GLAPIENTRY
>  _mesa_RenderbufferStorage(GLenum target, GLenum internalformat,
>   GLsizei width, GLsizei height);
>  
>  extern void GLAPIENTRY
>  _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
>   GLenum internalformat,
>   GLsizei width, GLsizei height);
>  
> +extern void GLAPIENTRY
> +_mesa_RenderbufferStorageMultisampleAdvancedAMD(
> +  GLenum target, GLsizei samples, GLsizei storageSamples,
> +  GLenum internalFormat, GLsizei width, GLsizei height);
> +
>  extern void GLAPIENTRY
>  _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
>  GLsizei width, GLsizei height);
>  
>  extern void GLAPIENTRY
>  _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
> GLsizei 

[Mesa-dev] [Bug 99730] Metro Redux game(s) needs override for midshader extension declaration

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99730

--- Comment #7 from Eero Tamminen  ---
(In reply to vadym from comment #6)
> I didn't noticed any visual issues (but suppose it should be fixed anyway).
> Last Night Redux is run with the same binary name (metro) as in case of
> Metro 2033 redux. So your patch fixes both cases. I re-based and tested your
> patch and confirm it fixes the issue.

Thanks for testing!

As it fixes both, the name attribute in patch should state that too, e.g:
name="Metro 2033 Redux / Last Light Redux"


> Can you please send the patch for review ? Or just let me know it you want
> me to send it.

Unfortunately I still don't have time for Steam stuff, so if you could update
the patch and do that, it would be great!


Patch description should contain:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99730

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 99730] Metro Redux game(s) needs override for midshader extension declaration

2018-08-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99730

--- Comment #6 from vadym  ---
Hi Euro,

Got the same issue with the Metro Last Light Redux:

: GLSL source for fragment shader 498:
: #version 400
struct vec1 {
float x;
};
struct uvec1 {
uint x;
};
struct ivec1 {
int x;
};
subroutine void SubroutineType();
layout(std140) uniform;
layout(location = 0) out  vec4 PixOutput0;
#define Output0 PixOutput0
#ifdef GL_ARB_conservative_depth
#extension GL_ARB_conservative_depth : enable
layout (depth_greater) out float gl_FragDepth;
#endif
void main()
{
Output0 = vec4(vec4(1.000, 1.000, 1.000,
1.000)).xyzw;
gl_FragDepth = vec4(1.000).x;
return;
}

: Info Log:
0:16(1): error: #extension directive is not allowed in the middle of a shader


I didn't noticed any visual issues (but suppose it should be fixed anyway).
Last Night Redux is run with the same binary name (metro) as in case of Metro
2033 redux. So your patch fixes both cases. I re-based and tested your patch
and confirm it fixes the issue.

Can you please send the patch for review ? Or just let me know it you want me
to send it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


  1   2   >