Re: [Mesa-dev] [PATCH rfc 0/3] Be able to disable EGL/GLX_EXT_buffer_age

2018-07-05 Thread Qiang Yu
On Fri, Jul 6, 2018 at 6:20 AM Eric Anholt wrote: > > Qiang Yu writes: > > > Hi Emil, > > > > On Thu, Jul 5, 2018 at 9:54 PM Emil Velikov > > wrote: > >> > >> On 5 July 2018 at 14:31, Emil Velikov wrote: > >> > Hi Qiang Yu > >> > > >> > On 5 July 2018 at 03:31, Qiang Yu wrote: > >> >> For

Re: [Mesa-dev] [PATCH] anv: Restrict the nuber of color regions to those actually written

2018-07-05 Thread Caio Marcelo de Oliveira Filho
On Wed, Jun 27, 2018 at 07:00:56PM -0700, Jason Ekstrand wrote: > The back-end compiler emits the number of color writes specified by > wm_prog_key::nr_color_regions regardless of what nir_store_outputs we > have. Once we've gone through and figured out which render targets > actually exist and

Re: [Mesa-dev] [PATCH 1/3] i965/fs: Properly handle sign(-abs(x))

2018-07-05 Thread Caio Marcelo de Oliveira Filho
Reviewed-by: Caio Marcelo de Oliveira Filho Tested the patch with the shaders mentioned. Do you think would be worth to have a pass at NIR level to perform these transformations? Thanks, Caio On Wed, Jun 27, 2018 at 07:37:57AM -0700, Ian Romanick wrote: > From: Ian Romanick > > Fixes new

[Mesa-dev] [PATCH] nir: delete not needed for reinserted nir_cf_list

2018-07-05 Thread Caio Marcelo de Oliveira Filho
It wasn't causing problems since there's nothing to delete, but better be consistent with the rest of existing codebase. --- src/compiler/nir/nir_opt_if.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c index

[Mesa-dev] [Bug 106644] [llvmpipe] Mesa 18.1.2 fails lp_test_format, lp_test_arit, lp_test_blend, lp_test_printf, lp_test_conv tests

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106644 --- Comment #27 from Roland Scheidegger --- (In reply to Ben Crocker from comment #25) > According to the Wikipedia article, the 970 is a Power ISA v2.03 (2002-2007) > CPU, > while VSX was not introduced until Power ISA v2.06 (February 2009)

Re: [Mesa-dev] [PATCH 1/3] nir/worklist: Rework the foreach macro

2018-07-05 Thread Caio Marcelo de Oliveira Filho
Reviewed-by: Caio Marcelo de Oliveira Filho On Tue, Jul 03, 2018 at 11:13:07PM -0700, Jason Ekstrand wrote: > This makes the arguments match the (thing, container) pattern used in > other nir_foreach macros and also renames it to make that a bit more > clear. > --- >

Re: [Mesa-dev] [PATCH 1.5/3] nir: Add a nir_instr_move helper

2018-07-05 Thread Caio Marcelo de Oliveira Filho
> > Should we also consider the block-based cursor options here? Moving > > the first instruction of a block before that block > > (nir_cursor_before_block), etc. > > > > That should be fine as-is as nir_instr_insert should do the right thing. > The reason the cursor.instr == instr case is a

Re: [Mesa-dev] [PATCH 3/3] intel/compiler: add an optimization pass for booleans

2018-07-05 Thread Caio Marcelo de Oliveira Filho
(I had to stop reading to go home last Tuesday, so here are the remaining comments.) On Tue, May 15, 2018 at 01:05:21PM +0200, Iago Toral Quiroga wrote: > NIR assumes that all booleans are 32-bit but Intel hardware produces > booleans of the same size as the operands to the CMP instruction, so

[Mesa-dev] [Bug 106644] [llvmpipe] Mesa 18.1.2 fails lp_test_format, lp_test_arit, lp_test_blend, lp_test_printf, lp_test_conv tests

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106644 --- Comment #26 from Ben Crocker --- I'm not seeing any assembly code in the output you posted, and I'm wondering whether the attempt to generate VSX code might be leading to the "Relocation type not implemented" errors and failure to generate

[Mesa-dev] [Bug 106644] [llvmpipe] Mesa 18.1.2 fails lp_test_format, lp_test_arit, lp_test_blend, lp_test_printf, lp_test_conv tests

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106644 --- Comment #25 from Ben Crocker --- According to the Wikipedia article, the 970 is a Power ISA v2.03 (2002-2007) CPU, while VSX was not introduced until Power ISA v2.06 (February 2009) and POWER7. So it seems to me that llc should recognize

Re: [Mesa-dev] [RFC 10/10] glsl: use only copy_propagation_elements

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > Now that the elements version handles both cases, remove the > non-elements version. I made some progress on reviewing the series today. I think this is very worthwhile to pursue, given that it gets rid of one of our GLSL IR passes that felt like nasty

Re: [Mesa-dev] [PATCH] swrast: Fix eglMakeCurrent(dpy, NULL, NULL, ctx)

2018-07-05 Thread Eric Anholt
Adam Jackson writes: > Fixes 14 piglits, mostly in egl_khr_create_context. > > Fixes: https://github.com/anholt/libepoxy/issues/177 > Signed-off-by: Adam Jackson > --- > src/mesa/drivers/dri/swrast/swrast.c | 34 +++- > 1 file changed, 18 insertions(+), 16 deletions(-)

Re: [Mesa-dev] [PATCH rfc 0/3] Be able to disable EGL/GLX_EXT_buffer_age

2018-07-05 Thread Eric Anholt
Qiang Yu writes: > Hi Emil, > > On Thu, Jul 5, 2018 at 9:54 PM Emil Velikov wrote: >> >> On 5 July 2018 at 14:31, Emil Velikov wrote: >> > Hi Qiang Yu >> > >> > On 5 July 2018 at 03:31, Qiang Yu wrote: >> >> For GPU like ARM mali Utgard EGL/GLX_EXT_buffer_age will make >> >> performace worse.

[Mesa-dev] [PATCH] st/dri: fix a crash in server_wait_Sync

2018-07-05 Thread Marek Olšák
From: Marek Olšák Ported from i965 including the comment. This fixes: dEQP-EGL.functional.reusable_sync.valid.wait_server Cc: 18.1 --- src/gallium/state_trackers/dri/dri_helpers.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/state_trackers/dri/dri_helpers.c

Re: [Mesa-dev] [PATCH 04/10] glsl: separate copy propagation state

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > Separate higher level logic of visiting instructions and chosing when > to store and use new copy data from the datastructure holding the copy > propagation information. This will also make easier later patches that > change the structure. > --- >

Re: [Mesa-dev] [PATCH 08/10] glsl: don't let an 'if' then-branch kill copy propagation (elements) for else-branch

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > When handling 'if' in copy propagation elements, if a certain variable > was killed when processing the first branch of the 'if', then the > second would get any propagation from previous nodes. > > x = y; > if (...) { > z = x; // This

Re: [Mesa-dev] [PATCH v2 2/3] nir: Add a discard optimization pass

2018-07-05 Thread Jason Ekstrand
On Thu, Jul 5, 2018 at 2:18 PM, Jason Ekstrand wrote: > On Thu, Jul 5, 2018 at 11:03 AM, Francisco Jerez > wrote: > >> Jason Ekstrand writes: >> >> > On Wed, Jul 4, 2018 at 1:20 PM, Francisco Jerez >> > wrote: >> > >> >> Jason Ekstrand writes: >> >> >> >> > Many fragment shaders do a discard

Re: [Mesa-dev] [PATCH rfc 2/3] gallium: add PIPE_CAP_BUFFER_AGE

2018-07-05 Thread Marek Olšák
Reviewed-by: Marek Olšák Marek On Wed, Jul 4, 2018 at 10:31 PM, Qiang Yu wrote: > For gallium drivers to expose EGL/GLX_EXT_buffer_age. > > Signed-off-by: Qiang Yu > --- > src/gallium/docs/source/screen.rst | 1 + > src/gallium/drivers/etnaviv/etnaviv_screen.c| 1 + >

Re: [Mesa-dev] [PATCH 01/10] glsl: don't let an 'if' then-branch kill const propagation for else-branch

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > When handling 'if' in constant propagation, if a certain variable was > killed when processing the first branch of the 'if', then the second > would get any propagation from previous nodes. This is similar to the > change done for copy propagation code. >

Re: [Mesa-dev] [PATCH v2 2/3] nir: Add a discard optimization pass

2018-07-05 Thread Jason Ekstrand
On Thu, Jul 5, 2018 at 11:03 AM, Francisco Jerez wrote: > Jason Ekstrand writes: > > > On Wed, Jul 4, 2018 at 1:20 PM, Francisco Jerez > > wrote: > > > >> Jason Ekstrand writes: > >> > >> > Many fragment shaders do a discard using relatively little information > >> > but still put the discard

Re: [Mesa-dev] [PATCH 1.5/3] nir: Add a nir_instr_move helper

2018-07-05 Thread Jason Ekstrand
On Thu, Jul 5, 2018 at 12:55 PM, Caio Marcelo de Oliveira Filho < caio.olive...@intel.com> wrote: > On Wed, Jul 04, 2018 at 09:55:26AM -0700, Jason Ekstrand wrote: > > Removes an instruction from one place and inserts it at another while > > working around a weird cursor corner-case. > > Is the

[Mesa-dev] [PATCH 2/2] winsys/amdgpu: remove RADEON_SURF_FMASK leftover

2018-07-05 Thread Marek Olšák
From: Marek Olšák RADEON_SURF_FMASK is never set. --- src/gallium/winsys/amdgpu/drm/amdgpu_surface.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c index

[Mesa-dev] [PATCH 1/2] ac: run LLVM optimization passes only on the final function after inlining

2018-07-05 Thread Marek Olšák
From: Marek Olšák --- src/amd/common/ac_llvm_helper.cpp | 6 ++ src/amd/common/ac_llvm_util.c | 7 +++ src/amd/common/ac_llvm_util.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp index

Re: [Mesa-dev] [PATCH 06/10] util/set: helper to remove entry by key

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > --- This one should be trivial to unit test, with a present and non-present key. signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org

Re: [Mesa-dev] [PATCH 05/10] util/set: add a clone function

2018-07-05 Thread Eric Anholt
Caio Marcelo de Oliveira Filho writes: > --- Could you add a little unit test with it? Maybe make a table with a couple entries and a deleted entry, and verify that the clone has both entries and not the deleted one? I tend to try to create the API in both hash and set at the same time. If I

Re: [Mesa-dev] [PATCH 1.5/3] nir: Add a nir_instr_move helper

2018-07-05 Thread Caio Marcelo de Oliveira Filho
On Wed, Jul 04, 2018 at 09:55:26AM -0700, Jason Ekstrand wrote: > Removes an instruction from one place and inserts it at another while > working around a weird cursor corner-case. Is the weird corner case the move to the same place case? > --- a/src/compiler/nir/nir.c > +++

Re: [Mesa-dev] [PATCH] nir: Apply fragment color clamping to gl_FragData[] as well.

2018-07-05 Thread Eric Anholt
Rob Clark writes: > On Thu, Jul 5, 2018 at 12:49 PM, Eric Anholt wrote: >> From the ARB_color_buffer_float spec: >> >>35. Should the clamping of fragment shader output gl_FragData[n] >>be controlled by the fragment color clamp. >> >>RESOLVED: Since the destination of the

Re: [Mesa-dev] [PATCH] st/nir: Disable varying packing when doing transform feedback.

2018-07-05 Thread Eric Anholt
Timothy Arceri writes: > On 03/07/18 05:51, Eric Anholt wrote: > >> Eric Anholt writes: >> >>> [ Unknown signature status ] >>> Timothy Arceri writes: >>> nir_compact_varyings() is meant to skip over varyings used by xfb: /* We can't repack xfb varyings. */

[Mesa-dev] [PATCH] swrast: Fix eglMakeCurrent(dpy, NULL, NULL, ctx)

2018-07-05 Thread Adam Jackson
Fixes 14 piglits, mostly in egl_khr_create_context. Fixes: https://github.com/anholt/libepoxy/issues/177 Signed-off-by: Adam Jackson --- src/mesa/drivers/dri/swrast/swrast.c | 34 +++- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git

Re: [Mesa-dev] [PATCH 01/26] python: Use the print function

2018-07-05 Thread Mathieu Bridon
On Thu, 2018-07-05 at 08:40 -0700, Dylan Baker wrote: > This is a really big patch that should be mostly mechanical, It's mostly me running `2to3 --fix=print` on all those Python scripts, and adding the `from __future__ import print_function` so that it's compatible with Python 2. In a few rare

[Mesa-dev] [PATCH] i965: don't check ccs_e support if isl_format is ISL_FORMAT_UNSUPPORTED

2018-07-05 Thread Dongwon Kim
'ISL_FORMAT_UNSUPPORTED' shouldn't be passed down for evaluation as it is strictly prohibited in isl code (e.g. format_info_exists). Signed-off-by: Dongwon Kim --- src/mesa/drivers/dri/i965/intel_screen.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git

Re: [Mesa-dev] [PATCH] st/mesa: Only enable depth writes if the function isn't EQUAL.

2018-07-05 Thread Marek Olšák
Reviewed-by: Marek Olšák Marek On Thu, Jul 5, 2018 at 6:00 AM, Kenneth Graunke wrote: > If the depth function is EQUAL, then we'll only write the depth value > when it already matches what's in the buffer, which is pointless. > Skipping these writes can save bandwidth. > > The state tracker

Re: [Mesa-dev] [PATCH v2 2/3] nir: Add a discard optimization pass

2018-07-05 Thread Francisco Jerez
Jason Ekstrand writes: > On Wed, Jul 4, 2018 at 1:20 PM, Francisco Jerez > wrote: > >> Jason Ekstrand writes: >> >> > Many fragment shaders do a discard using relatively little information >> > but still put the discard fairly far down in the shader for no good >> > reason. If the discard is

Re: [Mesa-dev] [PATCH 16/26] python: Explicitly use lists

2018-07-05 Thread Dylan Baker
CC'ing Ian who wrote this code, just to make sure that changing the order is going to be OK. Quoting Dylan Baker (2018-07-05 09:31:30) > Quoting Mathieu Bridon (2018-07-05 06:17:47) > > On Python 2, the builtin functions filter() and zip() would return > > lists. > > > > On Python 3, they return

Re: [Mesa-dev] [PATCH] vma/tests: Fix compilation if limits.h defines PAGE_SIZE

2018-07-05 Thread Jon Turney
On 05/07/2018 16:13, Eric Engestrom wrote: On Thursday, 2018-07-05 15:52:01 +0100, Jon Turney wrote: per POSIX, limits.h may define PAGE_SIZE when the value is not indeterminate "may define" -> don't you need #ifdef around #undef? Annoyingly, I though exactly this, and then forgot :( Patch

[Mesa-dev] [PATCH] vma/tests: Fix compilation if limits.h defines PAGE_SIZE (v2)

2018-07-05 Thread Jon Turney
per POSIX, limits.h may define PAGE_SIZE when the value is not indeterminate v2: just change the variable name, since there's no intended correlation here between this value and the machine's actual page size. Cc: Scott D Phillips Signed-off-by: Jon Turney ---

Re: [Mesa-dev] [PATCH] radv: fix emitting the view index on GFX9

2018-07-05 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen On Thu, Jul 5, 2018 at 6:56 PM, Samuel Pitoiset wrote: > For merged shaders, VS as HS for example. > > Signed-off-by: Samuel Pitoiset > Cc: > --- > src/amd/vulkan/radv_cmd_buffer.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git

[Mesa-dev] [Bug 106644] [llvmpipe] Mesa 18.1.2 fails lp_test_format, lp_test_arit, lp_test_blend, lp_test_printf, lp_test_conv tests

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106644 --- Comment #24 from erhar...@mailbox.org --- Hope this output is helpful to you! I am certainly no expert in this area, but could the problem be the 970 trying to execute vsx instructions? llc -mattr option(s): +altivec,+vsx llc -mcpu option:

[Mesa-dev] [Bug 106644] [llvmpipe] Mesa 18.1.2 fails lp_test_format, lp_test_arit, lp_test_blend, lp_test_printf, lp_test_conv tests

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106644 --- Comment #23 from erhar...@mailbox.org --- Created attachment 140477 --> https://bugs.freedesktop.org/attachment.cgi?id=140477=edit output from lp_test_* (ppc) -- You are receiving this mail because: You are the QA Contact for the bug.

Re: [Mesa-dev] [PATCH 17/26] python: Better check for string types

2018-07-05 Thread Dylan Baker
Quoting Eric Engestrom (2018-07-05 09:55:10) > On Thursday, 2018-07-05 09:33:24 -0700, Dylan Baker wrote: > > I've done enough python 2 -> 3 porting to feel very nervous about this, my > > experience tells me that mixing bytes and unicode always leads to subtle and > > hard to track down bugs. I'd

[Mesa-dev] [PATCH] r600: Add spill output to group only if register or target index changes

2018-07-05 Thread Gert Wollny
The current spill code checks in each instruction of an instruction group whether spliing is needed and if so, it adds spilling for each component as a seperate instruction and it allocates a new temporary for each component and since it takes the write mask from the TGSI representation, all

Re: [Mesa-dev] [PATCH 26/26] meson: Build with Python 3

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:57 +0200, Mathieu Bridon wrote: > Now that all the build scripts are compatible with both Python 2 and 3, > we can flip the switch and tell Meson to use the latter. > > Since Meson already depends on Python 3 anyway, this means we don't need > two different Python

[Mesa-dev] [Bug 106958] Mass Effect Andromeda renders correctly on RX480 POLARIS but BAD ON RX VEGA 64 on wine 3.10 stagingf with DXVK

2018-07-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106958 --- Comment #9 from Samuel Pitoiset --- Can you try this patch https://patchwork.freedesktop.org/series/46024/ please? I'm not really not sure if that will fix your issue (I still don't have a renderdoc capture). -- You are receiving this

Re: [Mesa-dev] [PATCH 22/26] python: Use open(), not file()

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:53 +0200, Mathieu Bridon wrote: > The latter is a constructor for file objects, but when actually opening > a file, using the former is more idiomatic. > > In addition, file() is not a builtin any more in Python 3, so this makes > the script compatible with both

Re: [Mesa-dev] [PATCH 21/26] python: Use key-functions when sorting containers

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 09:38:19 -0700, Dylan Baker wrote: > Quoting Mathieu Bridon (2018-07-05 06:17:52) > > In Python 2, the traditional way to sort containers was to use a > > comparison function (which returned either -1, 0 or 1 when passed two > > objects) and pass that as the "cmp" argument

Re: [Mesa-dev] [PATCH V2] Check if the window is non-NULL before setting swap interval.

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 17:17, Eric Engestrom wrote: > On Thursday, 2018-07-05 14:43:02 +0100, Emil Velikov wrote: >> On 5 July 2018 at 10:53, Eric Engestrom wrote: >> > On Monday, 2018-07-02 14:12:44 +0530, samiuddi wrote: >> >> This fixes crash due to NULL window when swap interval is set >> >> for

Re: [Mesa-dev] [PATCH 19/26] python: Don't abuse hex()

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:50 +0200, Mathieu Bridon wrote: > The hex() builtin returns a string containing the hexa-decimal > representation of an integer. > > When the argument is not an integer, then the function calls that > object's __hex__() method, if one is defined. That method is

Re: [Mesa-dev] [PATCH 20/26] python: Open file in binary mode

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:51 +0200, Mathieu Bridon wrote: > The XML parser wants byte strings, not unicode strings. > > In both Python 2 and 3, opening a file without specifying the mode will > open it for reading in text mode ('r'). > > On Python 2, the read() method of the file object will

Re: [Mesa-dev] [PATCH] nir: Apply fragment color clamping to gl_FragData[] as well.

2018-07-05 Thread Rob Clark
On Thu, Jul 5, 2018 at 12:49 PM, Eric Anholt wrote: > From the ARB_color_buffer_float spec: > >35. Should the clamping of fragment shader output gl_FragData[n] >be controlled by the fragment color clamp. > >RESOLVED: Since the destination of the FragData is a color >

Re: [Mesa-dev] [PATCH 17/26] python: Better check for string types

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 09:33:24 -0700, Dylan Baker wrote: > I've done enough python 2 -> 3 porting to feel very nervous about this, my > experience tells me that mixing bytes and unicode always leads to subtle and > hard to track down bugs. I'd much rather enforce that we're always getting >

[Mesa-dev] [PATCH] radv: fix emitting the view index on GFX9

2018-07-05 Thread Samuel Pitoiset
For merged shaders, VS as HS for example. Signed-off-by: Samuel Pitoiset Cc: --- src/amd/vulkan/radv_cmd_buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index b7519dce49..1ea023a811 100644 ---

Re: [Mesa-dev] [PATCH 18/26] python: Better check for integer types

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 09:34:54 -0700, Dylan Baker wrote: > Quoting Mathieu Bridon (2018-07-05 06:17:49) > > Python 3 lost the long type: now everything is an int, with the right > > size. > > > > This commit makes the script compatible with Python 2 (where we check > > for both int and long)

[Mesa-dev] [PATCH] nir: Apply fragment color clamping to gl_FragData[] as well.

2018-07-05 Thread Eric Anholt
From the ARB_color_buffer_float spec: 35. Should the clamping of fragment shader output gl_FragData[n] be controlled by the fragment color clamp. RESOLVED: Since the destination of the FragData is a color buffer, the fragment color clamp control should apply. Fixes

Re: [Mesa-dev] [PATCH 25/26] python: Explicitly add the 'L' suffix on Python 3

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:56) > Python 2 had two integer types: int and long. Python 3 dropped the > latter, as it made the int type automatically support bigger numbers. > > As a result, Python 3 lost the 'L' suffix on integer litterals. > > This

Re: [Mesa-dev] [PATCH 24/26] python: Use the unicode_escape codec

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:55) > Python 2 had string_escape and unicode_escape codecs. Python 3 only has > the latter. These work the same as far as we're concerned, so let's use > the future-proof one. > > However, the reste of the code expects unicode

Re: [Mesa-dev] [PATCH 22/26] python: Use open(), not file()

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:53) > The latter is a constructor for file objects, but when actually opening > a file, using the former is more idiomatic. > > In addition, file() is not a builtin any more in Python 3, so this makes > the script compatible with

Re: [Mesa-dev] [PATCH 21/26] python: Use key-functions when sorting containers

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:52) > In Python 2, the traditional way to sort containers was to use a > comparison function (which returned either -1, 0 or 1 when passed two > objects) and pass that as the "cmp" argument to the container's sort() > method. > > Python 2.4 introduced

Re: [Mesa-dev] [PATCH 20/26] python: Open file in binary mode

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:51) > The XML parser wants byte strings, not unicode strings. > > In both Python 2 and 3, opening a file without specifying the mode will > open it for reading in text mode ('r'). > > On Python 2, the read() method of the file

Re: [Mesa-dev] [PATCH 19/26] python: Don't abuse hex()

2018-07-05 Thread Dylan Baker
This is nice change in itself, Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:50) > The hex() builtin returns a string containing the hexa-decimal > representation of an integer. > > When the argument is not an integer, then the function calls that > object's __hex__()

Re: [Mesa-dev] [PATCH 18/26] python: Better check for integer types

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:49) > Python 3 lost the long type: now everything is an int, with the right > size. > > This commit makes the script compatible with Python 2 (where we check > for both int and long) and Python 3 (where we only check for int). > > Signed-off-by: Mathieu

Re: [Mesa-dev] [PATCH 17/26] python: Better check for string types

2018-07-05 Thread Dylan Baker
I've done enough python 2 -> 3 porting to feel very nervous about this, my experience tells me that mixing bytes and unicode always leads to subtle and hard to track down bugs. I'd much rather enforce that we're always getting unicode or bytes, but not mixing them. Quoting Mathieu Bridon

Re: [Mesa-dev] [PATCH 16/26] python: Explicitly use lists

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:47) > On Python 2, the builtin functions filter() and zip() would return > lists. > > On Python 3, they return iterators. > > Since we want to use those objects in contexts where we need lists, we > need to explicitly turn them into lists. > > This makes

Re: [Mesa-dev] [PATCH V2] Check if the window is non-NULL before setting swap interval.

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 14:43:02 +0100, Emil Velikov wrote: > On 5 July 2018 at 10:53, Eric Engestrom wrote: > > On Monday, 2018-07-02 14:12:44 +0530, samiuddi wrote: > >> This fixes crash due to NULL window when swap interval is set > >> for pbuffer surface. > >> > >> Test: CtsDisplayTestCases

Re: [Mesa-dev] [PATCH 15/26] python: Specify the template output encoding

2018-07-05 Thread Dylan Baker
Does it make more sense to encode, or to use io.open and open the file in text mode? I've gone back and forth on this myself several times. Quoting Mathieu Bridon (2018-07-05 06:17:46) > We're trying to write a unicode string (i.e decoded) to a file opened > in binary (i.e encoded) mode. > > In

Re: [Mesa-dev] [PATCH 12/26] python: Fix unequality comparisons

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:43) > On Python 3, executing `foo != bar` will first try to call > foo.__ne__(bar), and fallback on the opposite result of foo.__eq__(bar). > > Python 2 does not do that. > > As a result, those __eq__ methods were never called, when we were > testing for

Re: [Mesa-dev] [PATCH 11/26] python: Fix rich comparisons

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:42) > Python 3 lost the cmp() builtin, and doesn't call objects __cmp__() > methods any more to compare them. > > Instead, Python 3 requires implementing the rich comparison methods > explicitly: __eq__(), __ne(), __lt__(), __le__(), __gt__() and __ge__().

Re: [Mesa-dev] [PATCH 10/26] python: Use explicit integer divisions

2018-07-05 Thread Dylan Baker
How about using future division (ala from __future__ import division), which makes division behave like python 3 division, So that >>> 32 / 4 8.0 >>> 32 // 4 8 (I'm really a fan of python 3's explicit integer and float division operators) Quoting Mathieu Bridon (2018-07-05 06:17:41) > In

Re: [Mesa-dev] [PATCH 09/26] python: Use range() instead of xrange()

2018-07-05 Thread Dylan Baker
This has the same python 2 performance issue, so I'd like to either drop python2 support at the end, or do something to make python2 performance not terrible. but, with Eric's comments addressed, Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:40) > Python 2 has a range()

Re: [Mesa-dev] [PATCH 08/26] python: Better use iterators

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:39) > In Python 2, iterators had a .next() method. > > In Python 3, instead they have a .__next__() method, which is > automatically called by the next() builtin. > > In addition, it is better to use the iter() builtin to create

Re: [Mesa-dev] [PATCH 14/26] python: Better get character ordinals

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:45 +0200, Mathieu Bridon wrote: > In Python 2, iterating over a byte-string yields single-byte strings, > and we can pass them to ord() to get the corresponding integer. > > In Python 3, iterating over a byte-string directly yields those > integers. > > Transforming

Re: [Mesa-dev] [PATCH] intel: tools: fix build on old systems

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 16:33, Matt Turner wrote: > On Thu, Jul 5, 2018 at 7:42 AM Lionel Landwerlin > wrote: >> >> Older system might not have support for memfd_create at the kernel >> level. There we won't be able to use aubinator. >> >> We also initially tried to workaround some libc having the >>

Re: [Mesa-dev] meson: Build with Python 3

2018-07-05 Thread Dylan Baker
Dave, Brian, and Jose, IIRC when we discussed migrating piglit to python 3 (and went with a hybrid approach instead), y'all had requirements to run on python 2, and couldn't support python 3. Is that still the case, or would moving to python 3 be acceptable? Quoting Mathieu Bridon (2018-07-05

Re: [Mesa-dev] [RFC 5/5] DEBUG

2018-07-05 Thread Robert Foss
Hey Emil, On 05/07/18 15:13, Emil Velikov wrote: Hi Rob, On 5 July 2018 at 11:07, Robert Foss wrote: @@ -511,7 +515,7 @@ dri2_open_driver(_EGLDisplay *disp) char path[PATH_MAX], *search_paths, *next, *end; char *get_extensions_name; const __DRIextension

Re: [Mesa-dev] [PATCH 06/26] python: Better iterate over dictionaries

2018-07-05 Thread Dylan Baker
I've asked a couple of people who have (in the past at least) had a hard requirement on python 2.x if moving to 3.x will be okay for them. If it's not then we may need to do something else here. I've used six in the past (although I know a lot of other pythonistas don't like six), so that would be

Re: [Mesa-dev] [RFC 1/5] st/dri: Allow kms_swrast to work without a device FD

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 16:25, Robert Foss wrote: > Hey Tomasz, > > > On 05/07/18 15:07, Tomasz Figa wrote: >> >> Hi Emil, Robert, >> >> On Thu, Jul 5, 2018 at 9:57 PM Emil Velikov >> wrote: >>> >>> >>> On 5 July 2018 at 12:32, Robert Foss wrote: Hey Eric! On 05/07/18 12:35, Eric

Re: [Mesa-dev] [PATCH 13/26] python: Explicitly use byte strings

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:44 +0200, Mathieu Bridon wrote: > In both Python 2 and 3, zlib.Compress.compress() takes a byte string, > and returns a byte string as well. > > In Python 2, the script was working because: > > 1. string literalls were byte strings; > 2. opening a file in unicode

Re: [Mesa-dev] [PATCH 05/26] python: Stop using the string module

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:36) > Most functions in the builtin string module also exist as methods of > string objects. > > Since the functions were removed from the string module in Python 3, > using the instance methods directly makes the code compatible

Re: [Mesa-dev] [PATCH 04/26] python: Better check for keys in dicts

2018-07-05 Thread Dylan Baker
With the changes Eric mentioned (moving the two hunks in the wrong patch to the right one), Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:35) > Python 3 lost the dict.has_key() method. Instead it requires using the > "in" operator. > > This is also compatible with Python 2.

Re: [Mesa-dev] [PATCH 03/26] python: Use the Python 3 exception syntax

2018-07-05 Thread Dylan Baker
Quoting Eric Engestrom (2018-07-05 06:57:59) > On Thursday, 2018-07-05 15:17:34 +0200, Mathieu Bridon wrote: > > This is compatible with Python versions >= 2.6. > > > > Signed-off-by: Mathieu Bridon > > --- > > src/mapi/glapi/gen/glX_XML.py | 2 +- > > src/mapi/glapi/gen/gl_XML.py

Re: [Mesa-dev] [PATCH 02/26] python: Use spaces, not tabs

2018-07-05 Thread Dylan Baker
Reviewed-by: Dylan Baker Quoting Mathieu Bridon (2018-07-05 06:17:33) > Python 3 doesn't allow mixing spaces and tabs in a script, contrarily to > Python 2. > > Signed-off-by: Mathieu Bridon > --- > src/mapi/glapi/gen/glX_proto_size.py | 8 > 1 file changed, 4 insertions(+), 4

Re: [Mesa-dev] [PATCH 01/26] python: Use the print function

2018-07-05 Thread Dylan Baker
This is a really big patch that should be mostly mechanical, I skimmed it, but didn't actually read it closely, Acked-by: Dylan Baker signature.asc Description: signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org

Re: [Mesa-dev] [PATCH 1/2] build: Stabilize some script outputs

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-06-27 03:37:38) > In Python, dictionaries and sets are unordered, and as a result their > is no guarantee that running this script twice will produce the same > output. Small nit: in python < 3.7 dicts are unordered. In cpython 3.6 (and pypy since forever?) they are,

Re: [Mesa-dev] [RFC 2/5] egl/android: Add Android property for forcing kms_swrast

2018-07-05 Thread Robert Foss
Hey Tomasz, On 05/07/18 16:16, Tomasz Figa wrote: On Thu, Jul 5, 2018 at 7:07 PM Robert Foss wrote: In order to simplify Android bringup on new devices, provide the property "drm.gpu.force_software" which forces kms_swrast to be used. Signed-off-by: Robert Foss ---

Re: [Mesa-dev] [PATCH] intel: tools: fix build on old systems

2018-07-05 Thread Matt Turner
On Thu, Jul 5, 2018 at 7:42 AM Lionel Landwerlin wrote: > > Older system might not have support for memfd_create at the kernel > level. There we won't be able to use aubinator. > > We also initially tried to workaround some libc having the > memfd_create syscall number defined, but not the

Re: [Mesa-dev] [RFC 1/5] st/dri: Allow kms_swrast to work without a device FD

2018-07-05 Thread Robert Foss
Hey Tomasz, On 05/07/18 15:07, Tomasz Figa wrote: Hi Emil, Robert, On Thu, Jul 5, 2018 at 9:57 PM Emil Velikov wrote: On 5 July 2018 at 12:32, Robert Foss wrote: Hey Eric! On 05/07/18 12:35, Eric Engestrom wrote: On Thursday, 2018-07-05 12:07:36 +0200, Robert Foss wrote: From: Tomeu

Re: [Mesa-dev] [PATCH v2] radv/winsys: make use of radeon_emit()

2018-07-05 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen On Thu, Jul 5, 2018 at 5:07 PM, Samuel Pitoiset wrote: > v2: - do not use it in the chained path (because cdw isn't incremented) > > Signed-off-by: Samuel Pitoiset > --- > src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 23 ++- > 1 file changed,

Re: [Mesa-dev] [PATCH] vma/tests: Fix compilation if limits.h defines PAGE_SIZE

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:52:01 +0100, Jon Turney wrote: > per POSIX, limits.h may define PAGE_SIZE when the value is not indeterminate "may define" -> don't you need #ifdef around #undef? > > Cc: Scott D Phillips > Signed-off-by: Jon Turney > --- > src/util/tests/vma/vma_random_test.cpp |

Re: [Mesa-dev] [PATCH] intel: tools: fix build on old systems

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:40:52 +0100, Lionel Landwerlin wrote: > Older system might not have support for memfd_create at the kernel > level. There we won't be able to use aubinator. > > We also initially tried to workaround some libc having the > memfd_create syscall number defined, but not the

[Mesa-dev] [PATCH v2] radv/winsys: make use of radeon_emit()

2018-07-05 Thread Samuel Pitoiset
v2: - do not use it in the chained path (because cdw isn't incremented) Signed-off-by: Samuel Pitoiset --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 23 ++- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

[Mesa-dev] [PATCH] vma/tests: Fix compilation if limits.h defines PAGE_SIZE

2018-07-05 Thread Jon Turney
per POSIX, limits.h may define PAGE_SIZE when the value is not indeterminate Cc: Scott D Phillips Signed-off-by: Jon Turney --- src/util/tests/vma/vma_random_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/tests/vma/vma_random_test.cpp

Re: [Mesa-dev] [PATCH 10/26] python: Use explicit integer divisions

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:41 +0200, Mathieu Bridon wrote: > In Python 2, divisions return an integer: > > >>> 32 / 4 > 8 > > In Python 3 though, they return floats: > > >>> 32 / 4 > 8.0 > > Explicitly converting to integers make the scripts compatible with both > Python 2

[Mesa-dev] [PATCH] intel: tools: fix build on old systems

2018-07-05 Thread Lionel Landwerlin
Older system might not have support for memfd_create at the kernel level. There we won't be able to use aubinator. We also initially tried to workaround some libc having the memfd_create syscall number defined, but not the memfd_create() function. This change fixes the broken build on the travis

Re: [Mesa-dev] [PATCH rfc 0/3] Be able to disable EGL/GLX_EXT_buffer_age

2018-07-05 Thread Qiang Yu
Hi Emil, On Thu, Jul 5, 2018 at 9:54 PM Emil Velikov wrote: > > On 5 July 2018 at 14:31, Emil Velikov wrote: > > Hi Qiang Yu > > > > On 5 July 2018 at 03:31, Qiang Yu wrote: > >> For GPU like ARM mali Utgard EGL/GLX_EXT_buffer_age will make > >> performace worse. But mesa has no way to disable

Re: [Mesa-dev] [PATCH 09/26] python: Use range() instead of xrange()

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:40 +0200, Mathieu Bridon wrote: > Python 2 has a range() function which returns a list, and an xrange() > one which returns an iterator. > > Python 3 lost the function returning a list, and renamed the function > returning an iterator as range(). > > As a result,

Re: [Mesa-dev] [PATCH 08/26] python: Better use iterators

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:39 +0200, Mathieu Bridon wrote: > In Python 2, iterators had a .next() method. > > In Python 3, instead they have a .__next__() method, which is > automatically called by the next() builtin. > > In addition, it is better to use the iter() builtin to create an >

Re: [Mesa-dev] [PATCH 07/26] python: Better sort dictionary keys/values

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:38 +0200, Mathieu Bridon wrote: > In Python 2, dict.keys() and dict.values() both return a list, which can > be sorted in two ways: > > * l.sort() modifies the list in-place; > * sorted(l) returns a new, sorted list; > > In Python 3, dict.keys() and dict.values() do

Re: [Mesa-dev] [RFC 3/5] platform/android: Enable kms_swrast fallback

2018-07-05 Thread Tomasz Figa
Hi Rob, On Thu, Jul 5, 2018 at 7:07 PM Robert Foss wrote: > > Add support for the ForceSoftware option, which is togglable > on the Android platform through setting the "drm.gpu.force_software" > property to a non-zero value. > > kms_swrast is also enabled as a fallback for when a driver is not

Re: [Mesa-dev] [PATCH rfc 0/3] Be able to disable EGL/GLX_EXT_buffer_age

2018-07-05 Thread Thomas Hellstrom
On 07/05/2018 03:54 PM, Emil Velikov wrote: On 5 July 2018 at 14:31, Emil Velikov wrote: Hi Qiang Yu On 5 July 2018 at 03:31, Qiang Yu wrote: For GPU like ARM mali Utgard EGL/GLX_EXT_buffer_age will make performace worse. But mesa has no way to disable it. This patch series make driver be

Re: [Mesa-dev] [RFC 2/5] egl/android: Add Android property for forcing kms_swrast

2018-07-05 Thread Tomasz Figa
On Thu, Jul 5, 2018 at 7:07 PM Robert Foss wrote: > > In order to simplify Android bringup on new devices, > provide the property "drm.gpu.force_software" which > forces kms_swrast to be used. > > Signed-off-by: Robert Foss > --- > src/egl/main/egldriver.c | 10 ++ > 1 file changed, 10

Re: [Mesa-dev] [PATCH 04/26] python: Better check for keys in dicts

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:35 +0200, Mathieu Bridon wrote: > Python 3 lost the dict.has_key() method. Instead it requires using the > "in" operator. > > This is also compatible with Python 2. > > Signed-off-by: Mathieu Bridon > --- > src/mapi/glapi/gen/glX_XML.py| 2 +- >

  1   2   >