[Mesa-dev] [RFC 0/5] Android kms_swrast support

2018-07-05 Thread Robert Foss
This series is an early draft a kms_swrast implementation for the Android platform. It's available here: https://gitlab.collabora.com/robertfoss/mesa/tree/kms_swrast_rfc The current state isn't entirely functional, but the driver loading and initialization does seem to work. As to why the

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

2018-07-05 Thread Robert Foss
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 insertions(+) diff --git a/src/egl/main/egldriver.c

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

2018-07-05 Thread Robert Foss
Signed-off-by: Robert Foss --- src/egl/drivers/dri2/egl_dri2.c | 29 +++ src/egl/drivers/dri2/platform_android.c | 27 + src/egl/main/egldriver.c | 8 - src/gallium/auxiliary/Android.mk | 5

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

2018-07-05 Thread Robert Foss
From: Tomeu Vizoso A KMS device isn't strictly needed for the kms_swrast to work, so stop failing to init if the FD is -1. Also don't call DRM_IOCTL_GET_CAP in that case. This allows the driver to be used in machines where no KMS device at all is present. Signed-off-by: Tomeu Vizoso ---

[Mesa-dev] [RFC 4/5] android: Build kms_swrast for the Android platform

2018-07-05 Thread Robert Foss
From: Rob Herring Signed-off-by: Rob Herring Signed-off-by: Robert Foss --- src/gallium/Android.mk | 2 +- src/gallium/auxiliary/pipe-loader/Android.mk | 1 + src/gallium/drivers/softpipe/Android.mk | 4 +-- src/gallium/state_trackers/dri/Android.mk| 1 +

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

2018-07-05 Thread Robert Foss
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 able to be loaded for for a drm node that was opened. Signed-off-by:

Re: [Mesa-dev] [PATCH] gm107/ir: combine 32-bit constant loads into 64-bit ones

2018-07-05 Thread Ilia Mirkin
Loads require barriers, while movs don't. I believe that's why the blob prefers 32-bit loads, and we do too. Why change it? On Thu, Jul 5, 2018, 06:21 Rhys Perry wrote: > Seems to increase GPR count by a few in some shaders, but also decreases > instruction count by a bit. > > This should only

[Mesa-dev] [PATCH] Util: fix msvc build

2018-07-05 Thread Benedikt Schemmer
The MSVC preprocessor doesnt understand #warning --- src/util/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/process.c b/src/util/process.c index 449c7fa77c2..6e6376986f3 100644 --- a/src/util/process.c +++ b/src/util/process.c @@ -107,7 +107,7 @@

Re: [Mesa-dev] [PATCH] radv: optimize vkCmd{Set, Reset}Event() a little bit

2018-07-05 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen On Thu, 28 Jun 2018, 12:20 Samuel Pitoiset, wrote: > Always emitting a bottom-of-pipe event is quite dumb. Instead, > start to optimize these functions by syncing PFP for the > top-of-pipe and syncing ME for the post-index-fetch event. > > This can still be

Re: [Mesa-dev] [PATCH] radv: optimize radv_CmdWaitEvents()

2018-07-05 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen On Wed, 27 Jun 2018, 14:14 Samuel Pitoiset, wrote: > This introduces radv_barrier() (same as the draw/dispatch codepath). > This helper is used for merging the code from CmdWaitEvents() and > CmdPipelineBarrier because it's quite similar. > > We do ignore the

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

2018-07-05 Thread Kenneth Graunke
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 can easily take care of this, so all drivers benefit. --- src/mesa/state_tracker/st_atom_depth.c | 3

[Mesa-dev] [PATCH] gm107/ir: combine 32-bit constant loads into 64-bit ones

2018-07-05 Thread Rhys Perry
Seems to increase GPR count by a few in some shaders, but also decreases instruction count by a bit. This should only combine them when a mov can not be used (when the load is indirect). total instructions in shared programs : 5804448 -> 5754102 (-0.87%) total gprs used in shared programs:

Re: [Mesa-dev] [PATCH] build: Fix string matching

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 12:43:04 +0200, Mathieu Bridon wrote: > Commit f69bc797e15fe6beb9e439009fab55f7fae0b7f9 did the following: > > -if format.layout in ('bptc', 'astc'): > +if format.layout in ('astc'): > > The intention was to go from matching either 'bptc' or 'astc' to >

[Mesa-dev] [PATCH 1/3] i965: silence android build warning

2018-07-05 Thread Lionel Landwerlin
mesa/drivers/dri/i965/genX_state_upload.c:2983:46: warning: implicit conversion from enumeration type 'enum gl_logicop_mode' to different enumeration type 'enum GEN4_3D_Logic_Op_Function' [-Wenum-conversion] Introduced by 0c69db895f790a ("i965: Use the translated color logic op from the

[Mesa-dev] [PATCH 3/3] intel: compiler: silence compiler warning

2018-07-05 Thread Lionel Landwerlin
src/intel/compiler/brw_fs.cpp:5752:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Lionel Landwerlin --- src/intel/compiler/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs.cpp

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

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 12:07:36 +0200, Robert Foss wrote: > From: Tomeu Vizoso > > A KMS device isn't strictly needed for the kms_swrast to work, so stop > failing to init if the FD is -1. Also don't call DRM_IOCTL_GET_CAP in > that case. > > This allows the driver to be used in machines where

[Mesa-dev] [PATCH 1/2] raddv: only flush DB meta in pipeline image barriers when needed

2018-07-05 Thread Samuel Pitoiset
If the given image doesn't have HTILE, that's useless to flush DB metadata. Signed-off-by: Samuel Pitoiset --- src/amd/vulkan/radv_cmd_buffer.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c

[Mesa-dev] [PATCH 2/2] radv: only flush CB meta in pipeline image barriers when needed

2018-07-05 Thread Samuel Pitoiset
If the given image doesn't enable CMASK, FMASK or DCC that's useless to flush CB metadata. Signed-off-by: Samuel Pitoiset --- src/amd/vulkan/radv_cmd_buffer.c | 6 -- src/amd/vulkan/radv_private.h| 11 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git

Re: [Mesa-dev] [PATCH 2/2] egl: set EGL_BAD_NATIVE_PIXMAP in the copy_buffers fallback

2018-07-05 Thread Eric Engestrom
On Wednesday, 2018-06-27 20:11:18 +0100, Emil Velikov wrote: > From: Emil Velikov > > As the spec says: > > EGL_BAD_NATIVE_PIXMAP is generated if the implementation > does not support native pixmaps. > > Signed-off-by: Emil Velikov Series is Reviewed-by: Eric Engestrom > --- > Strictly

[Mesa-dev] [PATCH] build: Fix string matching

2018-07-05 Thread Mathieu Bridon
Commit f69bc797e15fe6beb9e439009fab55f7fae0b7f9 did the following: -if format.layout in ('bptc', 'astc'): +if format.layout in ('astc'): The intention was to go from matching either 'bptc' or 'astc' to matching only 'astc'. But the new code doesn't respect this intention any

Re: [Mesa-dev] Make the output of the Python build scripts more reproducible

2018-07-05 Thread Eric Engestrom
On Wednesday, 2018-06-27 12:37:37 +0200, Mathieu Bridon wrote: > I ported the Mesa build system to Python 3. > > The result of this work can be seen on my fork: > > https://gitlab.freedesktop.org/bochecha/mesa/tree/python3 > > When porting, I tried to ensure that the generated files are

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

2018-07-05 Thread Eric Engestrom
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 pass > > Signed-off-by: samiuddi > --- > > Kindly ignore this patch >

[Mesa-dev] [PATCH 2/3] util: u_queue: fix android build error

2018-07-05 Thread Lionel Landwerlin
mesa/src/util/u_queue.c:242:15: error: address of array 'queue->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] Signed-off-by: Lionel Landwerlin --- src/util/u_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/u_queue.c

Re: [Mesa-dev] [PATCH 0/3] Rectify KHR_partial_update extension implementation

2018-07-05 Thread Qiang Yu
Series is: Reviewed-by: Qiang Yu Regards, Qiang On Wed, Jul 4, 2018 at 8:58 PM Harish Krupo wrote: > > Based on the discussion in the thread starting at: > https://lists.freedesktop.org/archives/mesa-dev/2018-June/198846.html > it was identified that the implementation of the KHR_partial_update

[Mesa-dev] [PATCH] util/tests/rb_tree: add unit test

2018-07-05 Thread Lionel Landwerlin
Test written by Jason : https://github.com/jekstrand/rb-tree Signed-off-by: Lionel Landwerlin --- src/util/Makefile.am | 1 + src/util/meson.build | 1 + src/util/tests/rb_tree/Makefile.am| 39 ++ src/util/tests/rb_tree/meson.build| 29

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

2018-07-05 Thread Daniel Stone
Hi Qiang, On Thu, 5 Jul 2018 at 03:32, 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 able to disable it and add a > gallium pipe cap for gallium driver usage. Due to

Re: [Mesa-dev] [PATCH] gm107/ir: combine 32-bit constant loads into 64-bit ones

2018-07-05 Thread Rhys Perry
movs don't work with indirect loads such as c[r0+5]. This should only combine indirect loads, since they can't be movs. On Thu, Jul 5, 2018 at 12:04 PM, Ilia Mirkin wrote: > Loads require barriers, while movs don't. I believe that's why the blob > prefers 32-bit loads, and we do too. Why change

Re: [Mesa-dev] [PATCH 2/2] radv: only flush CB meta in pipeline image barriers when needed

2018-07-05 Thread Bas Nieuwenhuizen
On Thu, Jul 5, 2018 at 12:54 PM, Samuel Pitoiset wrote: > If the given image doesn't enable CMASK, FMASK or DCC that's > useless to flush CB metadata. > > Signed-off-by: Samuel Pitoiset > --- > src/amd/vulkan/radv_cmd_buffer.c | 6 -- > src/amd/vulkan/radv_private.h| 11 +++ >

Re: [Mesa-dev] [PATCH 2/2] radv: only flush CB meta in pipeline image barriers when needed

2018-07-05 Thread Samuel Pitoiset
On 07/05/2018 01:36 PM, Bas Nieuwenhuizen wrote: On Thu, Jul 5, 2018 at 12:54 PM, Samuel Pitoiset wrote: If the given image doesn't enable CMASK, FMASK or DCC that's useless to flush CB metadata. According to RadeonSI and AMDVLK, it seems like DCC is included in the CB metadata, so we

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

2018-07-05 Thread Emil Velikov
Hi Rob, On 5 July 2018 at 11:07, 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 > able

Re: [Mesa-dev] [PATCH] Util: fix msvc build

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 08:49, Benedikt Schemmer wrote: > The MSVC preprocessor doesnt understand #warning > Fixes: 2e1e6511f76 ("util: extract get_process_name from xmlconfig.c") Reviewed-by: Emil Velikov and pushed to master. Thanks Emil ___ mesa-dev

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

Re: [Mesa-dev] [PATCH 2/3] util: u_queue: fix android build error

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 12:14:00 +0100, Lionel Landwerlin wrote: > mesa/src/util/u_queue.c:242:15: error: address of array 'queue->name' > will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] > > Signed-off-by: Lionel Landwerlin Fixes: b238e33bc9d48b814370 "kutil/queue: add a

Re: [Mesa-dev] [RFC 4/5] android: Build kms_swrast for the Android platform

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 11:07, Robert Foss wrote: > From: Rob Herring > > Signed-off-by: Rob Herring > Signed-off-by: Robert Foss Reviewed-by: Emil Velikov -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org

Re: [Mesa-dev] [PATCH 2/2] radv: only flush CB meta in pipeline image barriers when needed

2018-07-05 Thread Bas Nieuwenhuizen
On Thu, Jul 5, 2018 at 1:51 PM, Samuel Pitoiset wrote: > > > On 07/05/2018 01:36 PM, Bas Nieuwenhuizen wrote: >> >> On Thu, Jul 5, 2018 at 12:54 PM, Samuel Pitoiset >> wrote: >>> >>> If the given image doesn't enable CMASK, FMASK or DCC that's >>> useless to flush CB metadata. > > > According to

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 Reviewed-by: Eric Engestrom > --- >

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 +- >

Re: [Mesa-dev] [PATCH] util/tests/rb_tree: add unit test

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 12:00:15 +0100, Lionel Landwerlin wrote: > Test written by Jason : > >https://github.com/jekstrand/rb-tree > > Signed-off-by: Lionel Landwerlin > --- > src/util/Makefile.am | 1 + > src/util/meson.build | 1 + >

[Mesa-dev] [PATCH] mesa/main: clean only first LOD when the texture is rectangular or extern

2018-07-05 Thread Gert Wollny
Rectangular and extern textures don't support mip-maps, but when a texture allocation fails, then clear_texture_fields tried to clean all LOSs, which would fire an assertion further down the call chain in set_tex_image. Therefore, restrict the number of LODs to be cleaned to just level 0 for these

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

2018-07-05 Thread Emil Velikov
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 **(*get_extensions)(void); > - > + ALOGE("%s() 1 driver_name=%s",

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 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 pass >> >> Signed-off-by: samiuddi >> --- >> >> Kindly ignore this patch

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

2018-07-05 Thread Emil Velikov
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 able to disable it and add a >>

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

[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] [RFC 1/5] st/dri: Allow kms_swrast to work without a device FD

2018-07-05 Thread Robert Foss
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 Vizoso A KMS device isn't strictly needed for the kms_swrast to work, so stop failing to init if the FD is -1. Also don't call DRM_IOCTL_GET_CAP in that case. This

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 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 Vizoso >>> >>> A KMS device isn't strictly needed for the kms_swrast to work, so stop >>> failing to init if

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

2018-07-05 Thread Tomasz Figa
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 Vizoso > >>> > >>> A

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

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:33 +0200, Mathieu Bridon wrote: > Python 3 doesn't allow mixing spaces and tabs in a script, contrarily to > Python 2. > > Signed-off-by: Mathieu Bridon Reviewed-by: Eric Engestrom > --- > src/mapi/glapi/gen/glX_proto_size.py | 8 > 1 file changed, 4

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

2018-07-05 Thread Mathieu Bridon
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 stacks to build Mesa. Signed-off-by: Mathieu Bridon --- meson.build

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

2018-07-05 Thread Mathieu Bridon
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 the code compatible with both Python 2 and Python 3.

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

2018-07-05 Thread Mathieu Bridon
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 strings, so we need to decode them again. Signed-off-by: Mathieu Bridon ---

[Mesa-dev] [PATCH 23/26] python: Rework bytes/unicode string handling

2018-07-05 Thread Mathieu Bridon
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 a file object opened in mode 'r' will return byte strings, while on Python 3 it will return unicode strings. Explicitly specifying the binary mode

Re: [Mesa-dev] [PATCH] Util: fix msvc build

2018-07-05 Thread Roland Scheidegger
Am 05.07.2018 um 09:49 schrieb Benedikt Schemmer: > The MSVC preprocessor doesnt understand #warning > > --- > src/util/process.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/util/process.c b/src/util/process.c > index 449c7fa77c2..6e6376986f3 100644 > ---

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

2018-07-05 Thread Eric Engestrom
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| 6 +++--- > src/mapi/glapi/gen/gl_marshal.py| 2 +- >

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

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:37 +0200, Mathieu Bridon wrote: > In Python 2, dictionaries have 2 sets of methods to iterate over their > keys and values: keys()/values()/items() and > iterkeys()/itervalues()/iteritems(). > > The former return lists while the latter return iterators. > > Python

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] [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,

[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

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

2018-07-05 Thread Mathieu Bridon
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__(). Fortunately those are trivial to implement by just

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

2018-07-05 Thread Mathieu Bridon
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 supposed to return a string. While that's not explicitly documented, that

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

2018-07-05 Thread Mathieu Bridon
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 key-functions, which instead only operate on a given item,

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

2018-07-05 Thread Mathieu Bridon
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 Python 2 and Python 3. Signed-off-by: Mathieu Bridon ---

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

2018-07-05 Thread Mathieu Bridon
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 return byte strings, while on Python 3 it will return unicode strings.

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

2018-07-05 Thread Mathieu Bridon
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 the byte string into a bytearray gives us a list of the integers

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

2018-07-05 Thread Mathieu Bridon
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 Bridon --- src/compiler/nir/nir_algebraic.py |

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

2018-07-05 Thread Mathieu Bridon
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 probably doesn't make much difference when compiling the generated C code, but adding it

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

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:36 +0200, Mathieu Bridon wrote: > 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 with both

Re: [Mesa-dev] [PATCH 1/2] raddv: only flush DB meta in pipeline image barriers when needed

2018-07-05 Thread Bas Nieuwenhuizen
If you fix the typo in the title, this patch is Reviewed-by: Bas Nieuwenhuizen On Thu, Jul 5, 2018 at 12:54 PM, Samuel Pitoiset wrote: > If the given image doesn't have HTILE, that's useless to flush > DB metadata. > > Signed-off-by: Samuel Pitoiset > --- > src/amd/vulkan/radv_cmd_buffer.c |

Re: [Mesa-dev] [RFC 0/5] Android kms_swrast support

2018-07-05 Thread Robert Foss
+ Wu Zhen On 05/07/18 12:07, Robert Foss wrote: This series is an early draft a kms_swrast implementation for the Android platform. It's available here: https://gitlab.collabora.com/robertfoss/mesa/tree/kms_swrast_rfc The current state isn't entirely functional, but the driver loading and

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

2018-07-05 Thread Emil Velikov
On 5 July 2018 at 11:07, 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. > s/kms_swrast/software rendering/ > Signed-off-by: Robert Foss Reviewed-by: Emil Velikov -Emil

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

2018-07-05 Thread Mathieu Bridon
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 deletions(-) diff --git a/src/mapi/glapi/gen/glX_proto_size.py

[Mesa-dev] meson: Build with Python 3

2018-07-05 Thread Mathieu Bridon
This patch series allows building Mesa with Python 3. The build scripts are kept compatible with Python 2 as well, for those platforms which don't have Python 3 yet. In fact, only the Meson build system is moved to Python 3, since it is the only one I'm 100% sure has Python 3 available. (Meson

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

2018-07-05 Thread Mathieu Bridon
In Python 2, dictionaries have 2 sets of methods to iterate over their keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems(). The former return lists while the latter return iterators. Python 3 dropped the method which return lists, and renamed the methods returning

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

2018-07-05 Thread Mathieu Bridon
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 with both Python 2 and Python 3. Signed-off-by: Mathieu Bridon ---

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

2018-07-05 Thread Mathieu Bridon
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, using range() makes the scripts compatible with both Python versions 2 and 3.

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

2018-07-05 Thread Mathieu Bridon
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 mode, reading from it, then passing the unicode string to compress() would

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

2018-07-05 Thread Mathieu Bridon
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 iterator, rather than calling its __iter__() method. These were also introduced

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

2018-07-05 Thread Mathieu Bridon
We're trying to write a unicode string (i.e decoded) to a file opened in binary (i.e encoded) mode. In Python 2 this works, because of the automatic conversion between byte and unicode strings. In Python 3 this fails though, as no automatic conversion is attempted. This change makes the scripts

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

2018-07-05 Thread Mathieu Bridon
Python 2 byte strings were called "str", and its unicode strings were called "unicode". In Python 3, they are called "bytes" and "str". This commit makes the script compatible with Python 2 and Python 3, checking for the right types on both. Signed-off-by: Mathieu Bridon ---

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

2018-07-05 Thread Mathieu Bridon
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 not return lists any more, but iterators. Iterators do not have a .sort()

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

2018-07-05 Thread Mathieu Bridon
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 inequality. Expliclty adding the __ne__ methods fixes this

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

2018-07-05 Thread Mathieu Bridon
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 and 3. Signed-off-by: Mathieu Bridon --- src/gallium/auxiliary/util/u_format_pack.py

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

2018-07-05 Thread Mathieu Bridon
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| 6 +++--- src/mapi/glapi/gen/gl_marshal.py| 2 +- src/mapi/glapi/gen/gl_marshal_h.py | 2 +-

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

2018-07-05 Thread Mathieu Bridon
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 +- src/mapi/glapi/gen/glX_proto_send.py | 2 +- src/mapi/glapi/gen/glX_proto_size.py | 18

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

2018-07-05 Thread Emil Velikov
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 able to disable it and add a > gallium pipe cap for gallium driver usage. Due to

[Mesa-dev] [AppVeyor] mesa master #8071 completed

2018-07-05 Thread AppVeyor
Build mesa 8071 completed Commit 93a5c9bc99 by Benedikt Schemmer on 7/5/2018 7:49 AM: Util: fix msvc build\n\nThe MSVC preprocessor doesnt understand #warning\n\nFixes: 2e1e6511f76 ("util: extract get_process_name from xmlconfig.c")\nReviewed-by: Roland

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 >

[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

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

[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] 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

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

  1   2   >