Re: [Mesa-dev] [PATCH mesa] meson/configure: detect endian.h instead of trying to guess when it's available

2018-03-21 Thread Eric Engestrom
On Wednesday, 2018-03-21 10:45:35 -0700, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-03-21 10:09:17)
> > Cc: Maxin B. John <maxin.j...@gmail.com>
> > Cc: Khem Raj <raj.k...@gmail.com>
> > Suggested-by: Jon Turney <jon.tur...@dronecode.org.uk>
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> >  configure.ac| 1 +
> >  meson.build | 2 +-
> >  src/util/u_endian.h | 2 +-
> >  3 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 29d3c3457a7cdaefc36a..36c56da787e4fab5a355 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -865,6 +865,7 @@ fi
> >  AC_HEADER_MAJOR
> >  AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
> >  AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
> > +AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"])
> >  AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
> >  AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
> >  AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
> > diff --git a/meson.build b/meson.build
> > index 88518ec0f0e9b81759a7..1132b4bd37075d8c9d21 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -904,7 +904,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
> >pre_args += '-DMAJOR_IN_MKDEV'
> >  endif
> >  
> > -foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
> > +foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h']
> >if cc.compiles('#include <@0@>'.format(h), name : '@0@ works'.format(h))
> >  pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
> >endif
> > diff --git a/src/util/u_endian.h b/src/util/u_endian.h
> > index 22d011ec0086ee77e11c..e11b381588dbc960e8c3 100644
> > --- a/src/util/u_endian.h
> > +++ b/src/util/u_endian.h
> > @@ -27,7 +27,7 @@
> >  #ifndef U_ENDIAN_H
> >  #define U_ENDIAN_H
> >  
> > -#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
> > +#ifdef HAVE_ENDIAN_H
> 
> is it really safe to remove the `defined(ANDROID)` check here?

I'm clearly too tired to do this...

Cc'ing Rob; can you tell us if defining HAVE_ENDIAN_H unconditionally in
Android.mk seems reasonable? Or is there a way to detect headers on Android?

I also forgot to add the check in scons; I just added this to the commit
locally:
8<
diff --git a/scons/gallium.py b/scons/gallium.py
index 75200b89c1fe6d751980..6cb20efcbf4b8c997f60 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -354,6 +354,9 @@ def generate(env):
 if check_header(env, 'xlocale.h'):
 cppdefines += ['HAVE_XLOCALE_H']
 
+if check_header(env, 'endian.h'):
+cppdefines += ['HAVE_ENDIAN_H']
+
 if check_functions(env, ['strtod_l', 'strtof_l']):
 cppdefines += ['HAVE_STRTOD_L']
 
>8

> 
> >  #include 
> >  
> >  #if __BYTE_ORDER == __LITTLE_ENDIAN
> > -- 
> > Cheers,
> >   Eric
> > 
> > ___
> > 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] u_endian.h: make endianness check libc agnostic

2018-03-21 Thread Eric Engestrom
On Wednesday, 2018-03-21 10:11:55 -0700, Dylan Baker wrote:
> Quoting Jon Turney (2018-03-21 09:47:23)
> > On 21/03/2018 15:09, Emil Velikov wrote:
> > > Hi Maxin,
> > > 
> > > Welcome back ;-)
> > > 
> > > On 21 March 2018 at 14:52,   wrote:
> > >> From: Khem Raj 
> > >>
> > >> endianness check is OS wide and not specific to libc.
> > >> Fixes build with musl libc
> > >>
> > >> Signed-off-by: Khem Raj 
> > >> Signed-off-by: Maxin B. John 
> > >> ---
> > >>   src/util/u_endian.h | 2 +-
> > >>   1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> diff --git a/src/util/u_endian.h b/src/util/u_endian.h
> > >> index 22d011e..4d5b4f4 100644
> > >> --- a/src/util/u_endian.h
> > >> +++ b/src/util/u_endian.h
> > >> @@ -27,7 +27,7 @@
> > >>   #ifndef U_ENDIAN_H
> > >>   #define U_ENDIAN_H
> > >>
> > >> -#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
> > >> +#if defined(__linux__)
> > > 
> > > Fairly sure that glibc, musl and android define __linux__, although
> > > I'm having doubts about Cygwin.
> > > Which platforms did you test this patch on?
> > 
> > Yes, I have a hard time believing these two lines are equivalent.
> > 
> > I don't know why this isn't an autoconf check for endian.h etc.
> > 
> > > Jon, will this confirm if this will work on your end, or we'll need to
> > > add the __CYGWIN__ hunk back?
> 
> What about haiku? I think they use glibc as well.
> 
> While we're down this road and Jon brought it up, why don't we just do this
> check in the build system(s)? That seems much more reliable.

I just did :)
https://patchwork.freedesktop.org/patch/211859/

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


[Mesa-dev] [PATCH mesa] meson/configure: detect endian.h instead of trying to guess when it's available

2018-03-21 Thread Eric Engestrom
Cc: Maxin B. John <maxin.j...@gmail.com>
Cc: Khem Raj <raj.k...@gmail.com>
Suggested-by: Jon Turney <jon.tur...@dronecode.org.uk>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 configure.ac| 1 +
 meson.build | 2 +-
 src/util/u_endian.h | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 29d3c3457a7cdaefc36a..36c56da787e4fab5a355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -865,6 +865,7 @@ fi
 AC_HEADER_MAJOR
 AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
 AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
+AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"])
 AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
 AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
 AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
diff --git a/meson.build b/meson.build
index 88518ec0f0e9b81759a7..1132b4bd37075d8c9d21 100644
--- a/meson.build
+++ b/meson.build
@@ -904,7 +904,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
   pre_args += '-DMAJOR_IN_MKDEV'
 endif
 
-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
+foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h']
   if cc.compiles('#include <@0@>'.format(h), name : '@0@ works'.format(h))
 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
diff --git a/src/util/u_endian.h b/src/util/u_endian.h
index 22d011ec0086ee77e11c..e11b381588dbc960e8c3 100644
--- a/src/util/u_endian.h
+++ b/src/util/u_endian.h
@@ -27,7 +27,7 @@
 #ifndef U_ENDIAN_H
 #define U_ENDIAN_H
 
-#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
+#ifdef HAVE_ENDIAN_H
 #include 
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] docs: fix typo in 17.3.6 release notes

2018-03-21 Thread Eric Engestrom
On Wednesday, 2018-03-21 17:33:36 +0100, Juan A. Suarez Romero wrote:
> Title is about 17.3.5, when it must be about 17.3.6.
> 
> CC: Emil Velikov <emil.l.veli...@gmail.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  docs/relnotes/17.3.6.html | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/relnotes/17.3.6.html b/docs/relnotes/17.3.6.html
> index 0dd1097975..de8518aacd 100644
> --- a/docs/relnotes/17.3.6.html
> +++ b/docs/relnotes/17.3.6.html
> @@ -14,7 +14,7 @@
>  
>  
>  
> -Mesa 17.3.5 Release Notes / February 19, 2018
> +Mesa 17.3.6 Release Notes / February 27, 2018
>  
>  
>  Mesa 17.3.6 is a bug fix release which fixes bugs found since the 17.3.5 
> release.
> -- 
> 2.14.3
> 
> ___
> 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] vulkan: autotools: build Wayland part conditionally

2018-03-21 Thread Eric Engestrom
On Wednesday, 2018-03-21 14:10:57 +0100, Juan A. Suarez Romero wrote:
> Eric, can I get this R-b by you?

This looks sensible, but I don't know enough about how/when the wayland
bits are built, especially under autotools

Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> 
>   J.A.
> 
> On Tue, 2018-03-20 at 15:53 +0100, Juan A. Suarez Romero wrote:
> > Build vulkan/wsi/wayland if Wayland platform is enabled.
> > 
> > v2: fix comparison with default fallback (Eric)
> > 
> > CC: Daniel Stone <dani...@collabora.com>
> > Fixes: bfa22266cd4d ("vulkan/wsi/wayland: Add support for zwp_dmabuf")
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105211
> > Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> > 
> > squash! vulkan: autotools: build Wayland part conditionally
> > ---
> >  configure.ac   | 7 +--
> >  src/vulkan/Makefile.am | 4 
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 15f315ce93c..42e6af9e889 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -1790,6 +1790,11 @@ PKG_CHECK_MODULES([WAYLAND_SCANNER], 
> > [wayland-scanner],
> >  if test "x$WAYLAND_SCANNER" = x; then
> >  AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
> >  fi
> > +AM_CONDITIONAL(HAVE_WAYLAND_SCANNER, test "x$WAYLAND_SCANNER" != "x:")
> > +
> > +WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir 
> > wayland-protocols`
> > +AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
> > +AM_CONDITIONAL(HAVE_WAYLAND_PROTOCOLS_DATADIR, test -n 
> > "$WAYLAND_PROTOCOLS_DATADIR")
> >  
> >  # Do per platform setups and checks
> >  platforms=`IFS=', '; echo $with_platforms`
> > @@ -1800,7 +1805,6 @@ for plat in $platforms; do
> >  PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 
> > $WAYLAND_REQUIRED])
> >  PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server >= 
> > $WAYLAND_REQUIRED])
> >  PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 
> > $WAYLAND_PROTOCOLS_REQUIRED])
> > -WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir 
> > wayland-protocols`
> >  
> >  if test "x$WAYLAND_SCANNER" = "x:"; then
> >  AC_MSG_ERROR([wayland-scanner is needed to compile the 
> > wayland platform])
> > @@ -1839,7 +1843,6 @@ for plat in $platforms; do
> >  ;;
> >  esac
> >  done
> > -AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
> >  
> >  if test "x$enable_glx" != xno; then
> >  if ! echo "$platforms" | grep -q 'x11'; then
> > diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am
> > index e6d4277f92f..7444b9907a4 100644
> > --- a/src/vulkan/Makefile.am
> > +++ b/src/vulkan/Makefile.am
> > @@ -62,6 +62,7 @@ CLEANFILES = $(BUILT_SOURCES)
> >  
> >  WL_DRM_XML = $(top_srcdir)/src/egl/wayland/wayland-drm/wayland-drm.xml
> >  
> > +if HAVE_WAYLAND_SCANNER
> >  wsi/wayland-drm-protocol.c : $(WL_DRM_XML)
> > $(MKDIR_GEN)
> > $(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
> > @@ -70,6 +71,7 @@ wsi/wayland-drm-client-protocol.h : $(WL_DRM_XML)
> > $(MKDIR_GEN)
> > $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
> >  
> > +if HAVE_WAYLAND_PROTOCOLS_DATADIR
> >  WL_DMABUF_XML = 
> > $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
> >  
> >  wsi/linux-dmabuf-unstable-v1-protocol.c : $(WL_DMABUF_XML)
> > @@ -79,6 +81,8 @@ wsi/linux-dmabuf-unstable-v1-protocol.c : $(WL_DMABUF_XML)
> >  wsi/linux-dmabuf-unstable-v1-client-protocol.h : $(WL_DMABUF_XML)
> > $(MKDIR_GEN)
> > $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
> > +endif
> > +endif
> >  
> >  if HAVE_PLATFORM_WAYLAND
> >  wsi/linux-dmabuf-unstable-v1-protocol.lo: 
> > wsi/linux-dmabuf-unstable-v1-client-protocol.h
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/tiled_memcpy: realign rgba8_copy_aligned_dst stack in 32-bit builds

2018-03-21 Thread Eric Engestrom
On Tuesday, 2018-03-20 13:39:25 -0700, Scott D Phillips wrote:
> When building intel_tiled_memcpy for i686, the stack will only be
> 4-byte aligned. This isn't sufficient for SSE temporaries which
> require 16-byte alignment.  Use the force_align_arg_pointer
> function attribute in that case to ensure sufficient alignment.
> ---
>  src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c 
> b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> index 69306828d72..bd8bafbd2d7 100644
> --- a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> +++ b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> @@ -42,6 +42,12 @@
>  #include 
>  #endif
>  
> +#if defined(__GNUC__) && defined(__i386__) && (defined(__SSSE3__) || 
> defined(__SSE2__))

Is that a typo?  s/SSSE3/SSE3/ ?

> +#define REALIGN __attribute__((force_align_arg_pointer))
> +#else
> +#define REALIGN
> +#endif
> +
>  #define FILE_DEBUG_FLAG DEBUG_TEXTURE
>  
>  #define ALIGN_DOWN(a, b) ROUND_DOWN_TO(a, b)
> @@ -156,7 +162,7 @@ rgba8_copy_16_aligned_src(void *dst, const void *src)
>  /**
>   * Copy RGBA to BGRA - swap R and B, with the destination 16-byte aligned.
>   */
> -static inline void *
> +static REALIGN inline void *
>  rgba8_copy_aligned_dst(void *dst, const void *src, size_t bytes)
>  {
> assert(bytes == 0 || !(((uintptr_t)dst) & 0xf));
> -- 
> 2.14.3
> 
> ___
> 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 kmscube] cube-tex: make use of modifiers

2018-03-20 Thread Eric Engestrom
On Tuesday, 2018-03-20 19:02:00 +0100, Christian Gmeiner wrote:
> Fixes rendering issues with mode rgba on etnaviv. I have applied
> the same change for nv12 variants but they are not supported on
> etnaviv.
> 
> Signed-off-by: Christian Gmeiner <christian.gmei...@gmail.com>

LGTM!
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  cube-tex.c | 32 
>  1 file changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/cube-tex.c b/cube-tex.c
> index 9e38ae8..dba19ff 100644
> --- a/cube-tex.c
> +++ b/cube-tex.c
> @@ -213,7 +213,7 @@ static const char *fragment_shader_source_2img =
>  
>  static const uint32_t texw = 512, texh = 512;
>  
> -static int get_fd_rgba(uint32_t *pstride)
> +static int get_fd_rgba(uint32_t *pstride, uint64_t *modifier)
>  {
>   struct gbm_bo *bo;
>   void *map_data = NULL;
> @@ -234,6 +234,7 @@ static int get_fd_rgba(uint32_t *pstride)
>   gbm_bo_unmap(bo, map_data);
>  
>   fd = gbm_bo_get_fd(bo);
> + *modifier = gbm_bo_get_modifier(bo);
>  
>   /* we have the fd now, no longer need the bo: */
>   gbm_bo_destroy(bo);
> @@ -243,7 +244,7 @@ static int get_fd_rgba(uint32_t *pstride)
>   return fd;
>  }
>  
> -static int get_fd_y(uint32_t *pstride)
> +static int get_fd_y(uint32_t *pstride, uint64_t *modifier)
>  {
>   struct gbm_bo *bo;
>   void *map_data = NULL;
> @@ -264,6 +265,7 @@ static int get_fd_y(uint32_t *pstride)
>   gbm_bo_unmap(bo, map_data);
>  
>   fd = gbm_bo_get_fd(bo);
> + *modifier = gbm_bo_get_modifier(bo);
>  
>   /* we have the fd now, no longer need the bo: */
>   gbm_bo_destroy(bo);
> @@ -273,7 +275,7 @@ static int get_fd_y(uint32_t *pstride)
>   return fd;
>  }
>  
> -static int get_fd_uv(uint32_t *pstride)
> +static int get_fd_uv(uint32_t *pstride, uint64_t *modifier)
>  {
>   struct gbm_bo *bo;
>   void *map_data = NULL;
> @@ -294,6 +296,7 @@ static int get_fd_uv(uint32_t *pstride)
>   gbm_bo_unmap(bo, map_data);
>  
>   fd = gbm_bo_get_fd(bo);
> + *modifier = gbm_bo_get_modifier(bo);
>  
>   /* we have the fd now, no longer need the bo: */
>   gbm_bo_destroy(bo);
> @@ -306,7 +309,8 @@ static int get_fd_uv(uint32_t *pstride)
>  static int init_tex_rgba(void)
>  {
>   uint32_t stride;
> - int fd = get_fd_rgba();
> + uint64_t modifier;
> + int fd = get_fd_rgba(, );
>   const EGLint attr[] = {
>   EGL_WIDTH, texw,
>   EGL_HEIGHT, texh,
> @@ -314,6 +318,8 @@ static int init_tex_rgba(void)
>   EGL_DMA_BUF_PLANE0_FD_EXT, fd,
>   EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
>   EGL_DMA_BUF_PLANE0_PITCH_EXT, stride,
> + EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, modifier & 0x,
> + EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier >> 32,
>   EGL_NONE
>   };
>   EGLImage img;
> @@ -339,8 +345,9 @@ static int init_tex_rgba(void)
>  static int init_tex_nv12_2img(void)
>  {
>   uint32_t stride_y, stride_uv;
> - int fd_y = get_fd_y(_y);
> - int fd_uv = get_fd_uv(_uv);
> + uint64_t modifier_y, modifier_uv;
> + int fd_y = get_fd_y(_y, _y);
> + int fd_uv = get_fd_uv(_uv, _uv);
>   const EGLint attr_y[] = {
>   EGL_WIDTH, texw,
>   EGL_HEIGHT, texh,
> @@ -348,6 +355,8 @@ static int init_tex_nv12_2img(void)
>   EGL_DMA_BUF_PLANE0_FD_EXT, fd_y,
>   EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
>   EGL_DMA_BUF_PLANE0_PITCH_EXT, stride_y,
> + EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, modifier_y & 0x,
> + EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier_y >> 32,
>   EGL_NONE
>   };
>   const EGLint attr_uv[] = {
> @@ -357,6 +366,8 @@ static int init_tex_nv12_2img(void)
>   EGL_DMA_BUF_PLANE0_FD_EXT, fd_uv,
>   EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
>   EGL_DMA_BUF_PLANE0_PITCH_EXT, stride_uv,
> + EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, modifier_uv & 0x,
> + EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier_uv >> 32,
>   EGL_NONE
>   };
>   EGLImage img_y, img_uv;
> @@ -397,8 +408,9 @@ static int init_tex_nv12_2img(void)
>  static int init_tex_nv12_1img(void)
>  {
>   uint32_t stride_y, stride_uv;
> - int fd_y = get_fd_y(_y);
> - int fd_uv = get_fd_uv(_uv);
> + uint64_t modifier_y, modifier_uv;
> + int fd_y = get_fd_y(_y, _y);
> + int fd_uv = get_fd_uv(_uv, _uv);
>   const EGLint attr[] = {
>   

Re: [Mesa-dev] [PATCH 2/8] vulkan: autotools: build Wayland part conditionally

2018-03-20 Thread Eric Engestrom
On Monday, 2018-03-19 18:49:05 +0100, Juan A. Suarez Romero wrote:
> Build vulkan/wsi/wayland if Wayland platform is enabled.
> 
> CC: Daniel Stone 
> Fixes: bfa22266cd4d ("vulkan/wsi/wayland: Add support for zwp_dmabuf")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105211
> ---
>  configure.ac   | 7 +--
>  src/vulkan/Makefile.am | 4 
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 15f315ce93c..7f6858633b0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1790,6 +1790,11 @@ PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
>  if test "x$WAYLAND_SCANNER" = x; then
>  AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
>  fi
> +AM_CONDITIONAL(HAVE_WAYLAND_SCANNER, test -n "$WAYLAND_SCANNER")

Isn't that always going to be true? $WAYLAND_SCANNER is `:` in the
fallback case, so maybe this should be
  test "$WAYLAND_SCANNER" = ":"

> +
> +WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir 
> wayland-protocols`
> +AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
> +AM_CONDITIONAL(HAVE_WAYLAND_PROTOCOLS_DATADIR, test -n 
> "$WAYLAND_PROTOCOLS_DATADIR")
>  
>  # Do per platform setups and checks
>  platforms=`IFS=', '; echo $with_platforms`
> @@ -1800,7 +1805,6 @@ for plat in $platforms; do
>  PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 
> $WAYLAND_REQUIRED])
>  PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server >= 
> $WAYLAND_REQUIRED])
>  PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 
> $WAYLAND_PROTOCOLS_REQUIRED])
> -WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir 
> wayland-protocols`
>  
>  if test "x$WAYLAND_SCANNER" = "x:"; then
>  AC_MSG_ERROR([wayland-scanner is needed to compile the 
> wayland platform])
> @@ -1839,7 +1843,6 @@ for plat in $platforms; do
>  ;;
>  esac
>  done
> -AC_SUBST([WAYLAND_PROTOCOLS_DATADIR])
>  
>  if test "x$enable_glx" != xno; then
>  if ! echo "$platforms" | grep -q 'x11'; then
> diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am
> index e6d4277f92f..7444b9907a4 100644
> --- a/src/vulkan/Makefile.am
> +++ b/src/vulkan/Makefile.am
> @@ -62,6 +62,7 @@ CLEANFILES = $(BUILT_SOURCES)
>  
>  WL_DRM_XML = $(top_srcdir)/src/egl/wayland/wayland-drm/wayland-drm.xml
>  
> +if HAVE_WAYLAND_SCANNER
>  wsi/wayland-drm-protocol.c : $(WL_DRM_XML)
>   $(MKDIR_GEN)
>   $(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
> @@ -70,6 +71,7 @@ wsi/wayland-drm-client-protocol.h : $(WL_DRM_XML)
>   $(MKDIR_GEN)
>   $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
>  
> +if HAVE_WAYLAND_PROTOCOLS_DATADIR
>  WL_DMABUF_XML = 
> $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
>  
>  wsi/linux-dmabuf-unstable-v1-protocol.c : $(WL_DMABUF_XML)
> @@ -79,6 +81,8 @@ wsi/linux-dmabuf-unstable-v1-protocol.c : $(WL_DMABUF_XML)
>  wsi/linux-dmabuf-unstable-v1-client-protocol.h : $(WL_DMABUF_XML)
>   $(MKDIR_GEN)
>   $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
> +endif
> +endif
>  
>  if HAVE_PLATFORM_WAYLAND
>  wsi/linux-dmabuf-unstable-v1-protocol.lo: 
> wsi/linux-dmabuf-unstable-v1-client-protocol.h
> -- 
> 2.14.3
> 
> ___
> 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 2/2] meson: Don't build svga on ARM/AArch64

2018-03-20 Thread Eric Engestrom
On Tuesday, 2018-03-20 08:54:25 +, Daniel Stone wrote:
> VMware has no (published) support for Arm-architecture guests.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>

I would s/Don't build svga/Don't build svga by default/ in the commit
title, but other than that nit, the series is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 88e90fe8119..24cad58c61e 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -151,7 +151,7 @@ if _drivers == 'auto'
>  if ['x86', 'x86_64'].contains(host_machine.cpu_family())
>_drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
>  elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
> -  _drivers = 
> 'pl111,vc4,vc5,freedreno,etnaviv,imx,nouveau,tegra,virgl,svga,swrast'
> +  _drivers = 
> 'pl111,vc4,vc5,freedreno,etnaviv,imx,nouveau,tegra,virgl,swrast'
>  else
>error('Unknown architecture. Please pass -Dgallium-drivers to set 
> driver options. Patches gladly accepted to fix this.')
>  endif
> -- 
> 2.16.2
> 
> ___
> 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 mesa 1/3] egl: add Ozone section to eglplatform.h

2018-03-16 Thread Eric Engestrom


On March 16, 2018 5:49:12 PM UTC, Emil Velikov <emil.l.veli...@gmail.com> wrote:
> On 16 March 2018 at 15:58, Eric Engestrom <eric.engest...@imgtec.com>
> wrote:
> > This pulls in commit a93f559e9c11fa53fb5f1cc255b8f75433f85d2a "Add
> Ozone
> > section to eglplatform.h" from Khronos [1] added by Brian Anderson
> [2]
> > a few months ago.
> >
> > [1]
> https://github.com/KhronosGroup/EGL-Registry/commit/a93f559e9c11fa53fb5f1cc255b8f75433f85d2a
> > [2] https://github.com/KhronosGroup/EGL-Registry/pull/26
> >
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> >  include/EGL/eglplatform.h | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
> > index bf9ec0bf5f4fbf7105cd..8a78a9eaddd2f47ff2c0 100644
> > --- a/include/EGL/eglplatform.h
> > +++ b/include/EGL/eglplatform.h
> > @@ -104,6 +104,12 @@ typedef struct ANativeWindow*  
> EGLNativeWindowType;
> >  typedef struct egl_native_pixmap_t* EGLNativePixmapType;
> >  typedef void*   EGLNativeDisplayType;
> >
> > +#elif defined(USE_OZONE)
> > +
> > +typedef intptr_t EGLNativeDisplayType;
> > +typedef intptr_t EGLNativeWindowType;
> > +typedef intptr_t EGLNativePixmapType;
> > +
> Eek, that looks nasty - signed intptr_t insteaf of the default void* +
> uintptr_t.

Yeah, I don't like it either, but it's what Google chose to push.

> 
> Which reminds me - need to join the EGL WG meetings and get
> EGL_USE_PLATFORM_* sorted [1].

Oh, I remember that series, why did you not land it? (The first part of it 
anyway)
Looking forward to "seeing" you on these calls :)

> Until then, the series looks good and is
> 
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>

Thanks!

> 
> -Emil
> 
> [1] https://patchwork.freedesktop.org/series/12778/
> ___
> 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] [PATCH mesa 3/3] egl: pull update from Khronos and drop local define

2018-03-16 Thread Eric Engestrom
Added in Khronos in 2b6bb4ee45cc46c89d4a "EGL_MESA_drm_image: add
EGL_DRM_BUFFER_USE_CURSOR_MESA to egl.xml" [1] as part of PR #36 [2].

[1] 
https://github.com/KhronosGroup/EGL-Registry/commit/2b6bb4ee45cc46c89d4a4349f2ca94e80d77cd97
[2] https://github.com/KhronosGroup/EGL-Registry/pull/36

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 include/EGL/eglext.h | 1 +
 include/EGL/eglmesaext.h | 7 ---
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
index f7dc66884ee9a673041e..2f990cc54d6d8202176e 100644
--- a/include/EGL/eglext.h
+++ b/include/EGL/eglext.h
@@ -933,6 +933,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI 
(EGLDisplay dpy, EGLConfi
 #define EGL_DRM_BUFFER_STRIDE_MESA0x31D4
 #define EGL_DRM_BUFFER_USE_SCANOUT_MESA   0x0001
 #define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
+#define EGL_DRM_BUFFER_USE_CURSOR_MESA0x0004
 typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay 
dpy, const EGLint *attrib_list);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay 
dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
 #ifdef EGL_EGLEXT_PROTOTYPES
diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h
index 5bf6306a38e1904da1d8..f4332b279f879197d914 100644
--- a/include/EGL/eglmesaext.h
+++ b/include/EGL/eglmesaext.h
@@ -34,13 +34,6 @@ extern "C" {
 
 #include 
 
-#ifdef EGL_MESA_drm_image
-/* Mesa's extension to EGL_MESA_drm_image... */
-#ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
-#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
-#endif
-#endif
-
 #ifndef EGL_WL_bind_wayland_display
 #define EGL_WL_bind_wayland_display 1
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 1/3] egl: add Ozone section to eglplatform.h

2018-03-16 Thread Eric Engestrom
This pulls in commit a93f559e9c11fa53fb5f1cc255b8f75433f85d2a "Add Ozone
section to eglplatform.h" from Khronos [1] added by Brian Anderson [2]
a few months ago.

[1] 
https://github.com/KhronosGroup/EGL-Registry/commit/a93f559e9c11fa53fb5f1cc255b8f75433f85d2a
[2] https://github.com/KhronosGroup/EGL-Registry/pull/26

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 include/EGL/eglplatform.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
index bf9ec0bf5f4fbf7105cd..8a78a9eaddd2f47ff2c0 100644
--- a/include/EGL/eglplatform.h
+++ b/include/EGL/eglplatform.h
@@ -104,6 +104,12 @@ typedef struct ANativeWindow*   
EGLNativeWindowType;
 typedef struct egl_native_pixmap_t* EGLNativePixmapType;
 typedef void*   EGLNativeDisplayType;
 
+#elif defined(USE_OZONE)
+
+typedef intptr_t EGLNativeDisplayType;
+typedef intptr_t EGLNativeWindowType;
+typedef intptr_t EGLNativePixmapType;
+
 #elif defined(__unix__) || defined(__APPLE__)
 
 #if defined(MESA_EGL_NO_X11_HEADERS)
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 2/3] egl: align the formatting of Haiku section of eglplatform.h with Khronos'

2018-03-16 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 include/EGL/eglplatform.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
index 8a78a9eaddd2f47ff2c0..b0541d52aed6584c63f2 100644
--- a/include/EGL/eglplatform.h
+++ b/include/EGL/eglplatform.h
@@ -130,11 +130,13 @@ typedef Window   EGLNativeWindowType;
 
 #endif /* MESA_EGL_NO_X11_HEADERS */
 
-#elif __HAIKU__
+#elif defined(__HAIKU__)
+
 #include 
-typedef void   *EGLNativeDisplayType;
-typedef khronos_uintptr_t   EGLNativePixmapType;
-typedef khronos_uintptr_t   EGLNativeWindowType;
+
+typedef void  *EGLNativeDisplayType;
+typedef khronos_uintptr_t  EGLNativePixmapType;
+typedef khronos_uintptr_t  EGLNativeWindowType;
 
 #else
 #error "Platform not recognized"
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] egl/dri2: move wayland header inclusion where applicable

2018-03-15 Thread Eric Engestrom
On Wednesday, 2018-03-14 17:42:16 +, Emil Velikov wrote:
> From: Emil Velikov <emil.veli...@collabora.com>
> 
> Instead of indirectly pulling the wayland headers everywhere, use
> forward declarations and #include only as needed.
> 
> Should effectively fix build errors like the following:
> 
> make[5]: Entering directory
> '/.../src/gallium/state_trackers/omx/tizonia'
>CC   h264dprc.lo
> In file included from h264dprc.c:45:0:
> .../src/egl/drivers/dri2/egl_dri2.h:47:10: fatal error:
> wayland/wayland-egl/wayland-egl-backend.h: No such file or directory
>   #include "wayland/wayland-egl/wayland-egl-backend.h"
> 
> Cc: Andy Furniss <adf.li...@gmail.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>
> Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
> ---
> Dylan had epiphany a minute after I hit Send. Sorry about that.
> 
> Gents this should remove the need of any the following patches.
> Please you give them a try, manually reverting the meson fix.
> 
> Thanks!
> 
> https://patchwork.freedesktop.org/patch/208770/
> https://patchwork.freedesktop.org/patch/208306/
> https://patchwork.freedesktop.org/patch/208322/
> ---
>  src/egl/drivers/dri2/egl_dri2.c |  1 +
>  src/egl/drivers/dri2/egl_dri2.h | 12 +---
>  src/egl/drivers/dri2/platform_wayland.c |  2 ++
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 864f7eb0c68..535806e4bfe 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -48,6 +48,7 @@
>  #include 
>  
>  #ifdef HAVE_WAYLAND_PLATFORM
> +#include 
>  #include "wayland-drm.h"
>  #include "wayland-drm-client-protocol.h"
>  #include "linux-dmabuf-unstable-v1-client-protocol.h"
> diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
> index bd637f73c9d..adabc527f85 100644
> --- a/src/egl/drivers/dri2/egl_dri2.h
> +++ b/src/egl/drivers/dri2/egl_dri2.h
> @@ -43,9 +43,15 @@
>  #endif
>  
>  #ifdef HAVE_WAYLAND_PLATFORM
> -#include 
> -#include "wayland/wayland-egl/wayland-egl-backend.h"
> -/* forward declarations of protocol elements */
> +/* forward declarations to avoid pulling wayland headers everywhere */
> +struct wl_egl_window;
> +struct wl_event_queue;
> +struct wl_callback;
> +struct wl_display;
> +struct wl_drm;
> +struct wl_registry;
> +struct wl_shm;
> +struct wl_surface;

Haven't verified this list, so no r-b, but ack on the idea:
Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

>  struct zwp_linux_dmabuf_v1;
>  #endif
>  
> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
> b/src/egl/drivers/dri2/platform_wayland.c
> index 877f7933b9a..94f7defa657 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -49,6 +49,8 @@
>  #include "wayland-drm-client-protocol.h"
>  #include "linux-dmabuf-unstable-v1-client-protocol.h"
>  
> +#include "wayland/wayland-egl/wayland-egl-backend.h"
> +
>  #ifndef DRM_FORMAT_MOD_INVALID
>  #define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
>  #endif
> -- 
> 2.16.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


Re: [Mesa-dev] [PATCH] meson: fix pipe-loaders after omx changes

2018-03-15 Thread Eric Engestrom
On Tuesday, 2018-03-13 16:05:18 -0700, Dylan Baker wrote:
> with_gallium_omx used to be a boolean, but now it's a string. That means
> it needs to be compared to 'disabled' instead of false.
> 
> CC: Rob Clark <robdcl...@gmail.com>
> Fixes: 34e852d5b50772199797ea839fc8d6b3805633ff
>("meson: Re-add auto option for omx")
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

And a quick grep confirms this was the only place that was still using
`with_gallium_omx` as a bool.

> ---
>  src/gallium/targets/pipe-loader/meson.build | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/targets/pipe-loader/meson.build 
> b/src/gallium/targets/pipe-loader/meson.build
> index 25b26a34cac..7466d98f2d4 100644
> --- a/src/gallium/targets/pipe-loader/meson.build
> +++ b/src/gallium/targets/pipe-loader/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
> @@ -27,13 +27,14 @@ pipe_loader_incs = [
>inc_gallium_winsys, inc_gallium_aux,
>  ]
>  
> -if (with_gallium_va or with_gallium_vdpau or with_gallium_omx or
> +if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' 
> or
>  with_gallium_xvmc or with_dri)
>pipe_loader_link_with += libgalliumvl
>  else
>pipe_loader_link_with += libgalliumvl_stubs
>  endif
> -if with_gallium_va or with_gallium_vdpau or with_gallium_omx or 
> with_gallium_xvmc
> +if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' 
> or
> +with_gallium_xvmc)
>pipe_loader_link_with += libgalliumvlwinsys
>  endif
>  
> -- 
> 2.16.2
> 
> ___
> 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 2/3] meson: Use the same version for all libdrm checks

2018-03-15 Thread Eric Engestrom
On Tuesday, 2018-03-13 11:52:48 -0700, Dylan Baker wrote:
> Currently each driver specifies it's own version, and core libdrm
> specifies a version. In the most common case this is fine, since there
> will be exactly one libdrm installed on a system, but if there are more
> than one it's possible that mesa will be linked against different
> versions of libdrm. There is also the possibility that the current
> approach makes the pkg-config files we generate incorrect, since there
> could be #defines that use newer features if they're available.
> 
> This patch corrects all of that. All of the versions are still set by
> driver (along with a default core version). Then all of the drivers that
> are enabled have their versions compared and the highest version is
> selected, then all libdrm checks are made with that version.
> 
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>

Makes sense, and looks cleaner than my earlier variant :)

Series is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

(small nit below)

> ---
>  meson.build | 67 +-
>  1 file changed, 46 insertions(+), 21 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index e747d99..6019008 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1015,35 +1015,60 @@ dep_expat = dependency('expat')
>  # its not linux and and wont
>  dep_m = cc.find_library('m', required : false)
>  
> +# Check for libdrm. various drivers have different libdrm version 
> requirements,
> +# but we always want to use the same version for all libdrm modules. That 
> means
> +# even if driver foo requires 2.4.0 and driver bar requires 2.4.3, if foo and
> +# bar are both on use 2.4.3 for both of them
>  dep_libdrm_amdgpu = []
>  dep_libdrm_radeon = []
>  dep_libdrm_nouveau = []
>  dep_libdrm_etnaviv = []
>  dep_libdrm_freedreno = []
>  dep_libdrm_intel = []
> -if with_dri_i915 or with_gallium_i915
> -  dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
> -endif
> -if with_amd_vk or with_gallium_radeonsi
> -  dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.90')
> -endif
> -if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
> -with_gallium_r300 or with_gallium_r600)
> -  dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
> -endif
> -if with_gallium_nouveau or with_dri_nouveau
> -  dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
> -endif
> -if with_gallium_etnaviv
> -  dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= 2.4.82')
> -endif
> -if with_gallium_freedreno
> -  dep_libdrm_freedreno = dependency('libdrm_freedreno', version : '>= 
> 2.4.91')
> -endif
> +
> +_drm_amdgpu_ver = '2.4.90'
> +_drm_radeon_ver = '2.4.71'
> +_drm_nouveau_ver = '2.4.66'
> +_drm_etnaviv_ver = '2.4.82'
> +_drm_freedreno_ver = '2.4.91'
> +_drm_intel_ver = '2.4.75'
> +_drm_ver = '2.4.75'
> +
> +_libdrm_checks = [
> +  [with_dri_i915 or with_gallium_i915, 'intel'],
> +  [with_amd_vk or with_gallium_radeonsi, 'amdgpu'],
> +  [(with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
> +   with_gallium_r300 or with_gallium_r600),
> +   'radeon'],
> +  [(with_gallium_nouveau or with_dri_nouveau), 'nouveau'],
> +  [with_gallium_etnaviv, 'etnaviv'],
> +  [with_gallium_freedreno, 'freedreno'],

I think this list would be easier to read if the driver name came first.

> +]
> +
> +# Loop over the enables versions and get the highest libdrm requirement for 
> all
> +# active drivers.
> +foreach d : _libdrm_checks
> +  ver = get_variable('_drm_@0@_ver'.format(d[1]))
> +  if d[0] and ver.version_compare('>' + _drm_ver)
> +_drm_ver = ver
> +  endif
> +endforeach
> +
> +# Then get each libdrm module
> +foreach d : _libdrm_checks
> +  if d[0]
> +set_variable(
> +  'dep_libdrm_' + d[1],
> +  dependency('libdrm_' + d[1], version : '>=' + _drm_ver)
> +)
> +  endif
> +endforeach
>  
>  with_gallium_drisw_kms = false
> -dep_libdrm = dependency('libdrm', version : '>= 2.4.75',
> -required : with_dri2 or with_dri3)
> +dep_libdrm = dependency(
> +  'libdrm', version : '>=' + _drm_ver,
> +  required : with_dri2 or with_dri3
> +)
>  if dep_libdrm.found()
>pre_args += '-DHAVE_LIBDRM'
>if with_dri_platform == 'drm' and with_dri
> -- 
> git-series 0.9.1
> ___
> 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] meson: don't use compiler.has_header

2018-03-13 Thread Eric Engestrom
On Monday, 2018-03-12 11:23:23 -0700, Dylan Baker wrote:
> Meson's compiler.has_header is completely useless, it only checks that a
> header exists, not whether it's usable. This creates problems if a
> header contains a conditional #error declaration, like so:
> 
> > #if __x86_64__
> > # error "Doesn't work with x86_64!"
> > #endif
> 
> Compiler.has_header will return true in this case, even when compiling
> for x86_64. This is useless.
> 
> Instead, we'll do a compile check so that any #error declarations will
> be treated as errors, and compilation will work.
> 
> Fixes compilation on x32 architecture.
> 
> Gentoo Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=649746
> meson bug: https://github.com/mesonbuild/meson/issues/2246
> CC: Matt Turner <matts...@gmail.com>
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

I'll include the same change in a libdrm patch I'll send in a minute.

> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 3c63f384381..51b470253f5 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -912,7 +912,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
>  endif
>  
>  foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
> -  if cc.has_header(h)
> +  if cc.compiles('#include <@0@>'.format(h), name : '@0@ works'.format(h))
>  pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
>endif
>  endforeach
> -- 
> 2.16.2
> 
> ___
> 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 mesa] omx: always define ENABLE_ST_OMX_{BELLAGIO, TIZONIA}

2018-03-12 Thread Eric Engestrom
On Monday, 2018-03-12 10:19:49 -0700, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-03-12 07:33:27)
> > We're trying to be -Wundef clean so that we can turn it on (and
> > eventually make it an error).
> > 
> > Note that the OMX code already used `#if ENABLE_ST_OMX_BELLAGIO` instead
> > of #ifdef; I could've changed these, but the point of -Wundef is to
> > catch typos, so we might as well make the change the right way.
> > 
> > Fixes: 83d4a5d5aea5a8a05be2 "st/omx/tizonia: Add H.264 decoder"
> > Fixes: b2f2236dc565dd1460f0 "st/omx/tizonia: Add H.264 encoder"
> > Fixes: c62cf1f165919bc74296 "st/omx/tizonia/h264d: Add EGLImage support"
> > Cc: Gurkirpal Singh <gurkirpal...@gmail.com>
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> > The meson hunk doesn't look pretty at all, but I'm planning on replacing
> > all the `pre_args` with a configuration_data(), which will allow to
> > simplify a lot of this #defines code.
> > ---
> >  configure.ac |  4 
> >  meson.build  | 11 +--
> >  2 files changed, 13 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 1553ce99da44bca4e826..6de4ceb2fb715505120e 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -2281,6 +2281,8 @@ if test "x$enable_omx_bellagio" = xyes; then
> >  PKG_CHECK_MODULES([OMX_BELLAGIO], [libomxil-bellagio >= 
> > $LIBOMXIL_BELLAGIO_REQUIRED])
> >  gallium_st="$gallium_st omx_bellagio"
> >  AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 1, [Use Bellagio for OMX IL])
> > +else
> > +AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 0)
> >  fi
> >  AM_CONDITIONAL(HAVE_ST_OMX_BELLAGIO, test "x$enable_omx_bellagio" = xyes)
> >  
> > @@ -2294,6 +2296,8 @@ if test "x$enable_omx_tizonia" = xyes; then
> > libtizplatform >= $LIBOMXIL_TIZONIA_REQUIRED])
> >  gallium_st="$gallium_st omx_tizonia"
> >  AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 1, [Use Tizoina for OMX IL])
> > +else
> > +AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 0)
> >  fi
> >  AM_CONDITIONAL(HAVE_ST_OMX_TIZONIA, test "x$enable_omx_tizonia" = xyes)
> >  
> > diff --git a/meson.build b/meson.build
> > index b6e9692f192c528520e7..b9f7cd2aff5fc49e0d93 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -504,7 +504,7 @@ if with_gallium_omx == 'bellagio' or with_gallium_omx 
> > == 'auto'
> >  'libomxil-bellagio', required : with_gallium_omx == 'bellagio'
> >)
> >if dep_omx.found()
> > -pre_args += '-DENABLE_ST_OMX_BELLAGIO'
> > +pre_args += '-DENABLE_ST_OMX_BELLAGIO=1'
> >  with_gallium_omx = 'bellagio'
> >endif
> >  endif
> > @@ -525,7 +525,7 @@ if with_gallium_omx == 'tizonia' or with_gallium_omx == 
> > 'auto'
> >dependency('tizilheaders', required : with_gallium_omx == 'tizonia'),
> >  ]
> >  if dep_omx.found() and dep_omx_other[0].found() and 
> > dep_omx_other[1].found()
> > -  pre_args += '-DENABLE_ST_OMX_TIZONIA'
> > +  pre_args += '-DENABLE_ST_OMX_TIZONIA=1'
> >with_gallium_omx = 'tizonia'
> >  else
> >with_gallium_omx = 'disabled'
> > @@ -533,6 +533,13 @@ if with_gallium_omx == 'tizonia' or with_gallium_omx 
> > == 'auto'
> >endif
> >  endif
> >  
> > +if with_gallium_omx != 'bellagio'
> > +  pre_args += '-DENABLE_ST_OMX_BELLAGIO=0'
> > +endif
> > +if with_gallium_omx != 'tizonia'
> > +  pre_args += '-DENABLE_ST_OMX_TIZONIA=0'
> > +endif
> > +
> 
> This is fine as-is, but if you wanted to clean it up a little, you could do
> something like:
> 
> pre_args += [
>   '-DENABLE_ST_OMX_BELLAGIO=' + with_gallium_omx == 'bellagio ? '1' : '0',
>   '-DENABLE_ST_OMX_TIZONIA=' + with_gallium_omx == 'tizonia ? '1' : '0',
> ]

That's what I was looking for but too tired to figure out :]
Thanks, I'll send a v2 with that tomorrow!

> 
> and take the pre_args out of the block above altogether.
> 
> either way,
> 
> Reviewed-by: Dylan Baker <dy...@pnwbakers.com>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] meson: simplify omx logic

2018-03-12 Thread Eric Engestrom
and let's make sure `with_gallium_omx` is never 'auto' and can only be
one of [bellagio, tizonia, disabled].

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 34 --
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/meson.build b/meson.build
index 6a4d2aded7c72bbb1029..0923b86fac8dfd6ad51a 100644
--- a/meson.build
+++ b/meson.build
@@ -496,42 +496,40 @@ elif not (with_gallium_r600 or with_gallium_radeonsi or 
with_gallium_nouveau)
 error('OMX state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
   endif
 endif
-with_gallium_omx = _omx
 dep_omx = []
 dep_omx_other = []
-if with_gallium_omx == 'bellagio' or with_gallium_omx == 'auto'
+if ['auto', 'bellagio'].contains(_omx)
   dep_omx = dependency(
-'libomxil-bellagio', required : with_gallium_omx == 'bellagio'
+'libomxil-bellagio', required : _omx == 'bellagio'
   )
   if dep_omx.found()
 pre_args += '-DENABLE_ST_OMX_BELLAGIO=1'
-with_gallium_omx = 'bellagio'
+_omx = 'bellagio'
   endif
 endif
-if with_gallium_omx == 'tizonia' or with_gallium_omx == 'auto'
-  if not (with_dri and with_egl)
-if with_gallium_omx == 'tizonia'
-  error('OMX-Tizonia state tracker requires dri and egl')
-else
-  with_gallium_omx == 'disabled'
-endif
-  else
+if ['auto', 'tizonia'].contains(_omx)
+  if with_dri and with_egl
 dep_omx = dependency(
   'libtizonia', version : '>= 0.10.0',
-  required : with_gallium_omx == 'tizonia',
+  required : _omx == 'tizonia',
 )
 dep_omx_other = [
-  dependency('libtizplatform', required : with_gallium_omx == 'tizonia'),
-  dependency('tizilheaders', required : with_gallium_omx == 'tizonia'),
+  dependency('libtizplatform', required : _omx == 'tizonia'),
+  dependency('tizilheaders', required : _omx == 'tizonia'),
 ]
 if dep_omx.found() and dep_omx_other[0].found() and 
dep_omx_other[1].found()
   pre_args += '-DENABLE_ST_OMX_TIZONIA=1'
-  with_gallium_omx = 'tizonia'
-else
-  with_gallium_omx = 'disabled'
+  _omx = 'tizonia'
 endif
+  elif _omx == 'tizonia'
+error('OMX-Tizonia state tracker requires dri and egl')
   endif
 endif
+if _omx == 'auto'
+  with_gallium_omx = 'disabled'
+else
+  with_gallium_omx = _omx
+endif
 
 if with_gallium_omx != 'bellagio'
   pre_args += '-DENABLE_ST_OMX_BELLAGIO=0'
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check

2018-03-12 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
Dylan, was there any reason to have -Werror=missing-prototypes and
-Werror=implicit-function-declaration in C but not C++?
Both sound to me like something we always want.
---
 meson.build | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index b9f7cd2aff5fc49e0d93..6a4d2aded7c72bbb1029 100644
--- a/meson.build
+++ b/meson.build
@@ -766,7 +766,9 @@ if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
 endif
 
-# Check for generic C arguments
+# Check for generic C/C++ arguments
+cpp = meson.get_compiler('cpp')
+cpp_args = []
 c_args = []
 foreach a : ['-Wall', '-Werror=implicit-function-declaration',
  '-Werror=missing-prototypes', '-fno-math-errno',
@@ -774,22 +776,15 @@ foreach a : ['-Wall', 
'-Werror=implicit-function-declaration',
   if cc.has_argument(a)
 c_args += a
   endif
+  if cpp.has_argument(a)
+cpp_args += a
+  endif
 endforeach
 c_vis_args = []
 if cc.has_argument('-fvisibility=hidden')
   c_vis_args += '-fvisibility=hidden'
 endif
 
-# Check for generic C++ arguments
-cpp = meson.get_compiler('cpp')
-cpp_args = []
-foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
- '-Qunused-arguments']
-  if cpp.has_argument(a)
-cpp_args += a
-  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.
 if cpp.has_argument('-Wnon-virtual-dtor')
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] omx: always define ENABLE_ST_OMX_{BELLAGIO, TIZONIA}

2018-03-12 Thread Eric Engestrom
We're trying to be -Wundef clean so that we can turn it on (and
eventually make it an error).

Note that the OMX code already used `#if ENABLE_ST_OMX_BELLAGIO` instead
of #ifdef; I could've changed these, but the point of -Wundef is to
catch typos, so we might as well make the change the right way.

Fixes: 83d4a5d5aea5a8a05be2 "st/omx/tizonia: Add H.264 decoder"
Fixes: b2f2236dc565dd1460f0 "st/omx/tizonia: Add H.264 encoder"
Fixes: c62cf1f165919bc74296 "st/omx/tizonia/h264d: Add EGLImage support"
Cc: Gurkirpal Singh <gurkirpal...@gmail.com>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
The meson hunk doesn't look pretty at all, but I'm planning on replacing
all the `pre_args` with a configuration_data(), which will allow to
simplify a lot of this #defines code.
---
 configure.ac |  4 
 meson.build  | 11 +--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1553ce99da44bca4e826..6de4ceb2fb715505120e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2281,6 +2281,8 @@ if test "x$enable_omx_bellagio" = xyes; then
 PKG_CHECK_MODULES([OMX_BELLAGIO], [libomxil-bellagio >= 
$LIBOMXIL_BELLAGIO_REQUIRED])
 gallium_st="$gallium_st omx_bellagio"
 AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 1, [Use Bellagio for OMX IL])
+else
+AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 0)
 fi
 AM_CONDITIONAL(HAVE_ST_OMX_BELLAGIO, test "x$enable_omx_bellagio" = xyes)
 
@@ -2294,6 +2296,8 @@ if test "x$enable_omx_tizonia" = xyes; then
libtizplatform >= $LIBOMXIL_TIZONIA_REQUIRED])
 gallium_st="$gallium_st omx_tizonia"
 AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 1, [Use Tizoina for OMX IL])
+else
+AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 0)
 fi
 AM_CONDITIONAL(HAVE_ST_OMX_TIZONIA, test "x$enable_omx_tizonia" = xyes)
 
diff --git a/meson.build b/meson.build
index b6e9692f192c528520e7..b9f7cd2aff5fc49e0d93 100644
--- a/meson.build
+++ b/meson.build
@@ -504,7 +504,7 @@ if with_gallium_omx == 'bellagio' or with_gallium_omx == 
'auto'
 'libomxil-bellagio', required : with_gallium_omx == 'bellagio'
   )
   if dep_omx.found()
-pre_args += '-DENABLE_ST_OMX_BELLAGIO'
+pre_args += '-DENABLE_ST_OMX_BELLAGIO=1'
 with_gallium_omx = 'bellagio'
   endif
 endif
@@ -525,7 +525,7 @@ if with_gallium_omx == 'tizonia' or with_gallium_omx == 
'auto'
   dependency('tizilheaders', required : with_gallium_omx == 'tizonia'),
 ]
 if dep_omx.found() and dep_omx_other[0].found() and 
dep_omx_other[1].found()
-  pre_args += '-DENABLE_ST_OMX_TIZONIA'
+  pre_args += '-DENABLE_ST_OMX_TIZONIA=1'
   with_gallium_omx = 'tizonia'
 else
   with_gallium_omx = 'disabled'
@@ -533,6 +533,13 @@ if with_gallium_omx == 'tizonia' or with_gallium_omx == 
'auto'
   endif
 endif
 
+if with_gallium_omx != 'bellagio'
+  pre_args += '-DENABLE_ST_OMX_BELLAGIO=0'
+endif
+if with_gallium_omx != 'tizonia'
+  pre_args += '-DENABLE_ST_OMX_TIZONIA=0'
+endif
+
 if with_gallium_omx != 'disabled'
   omx_drivers_path = get_option('omx-libs-path')
   # Figure out where to put the omx driver.
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] gallium: Use struct gl_array_attributes* as st_pipe_vertex_format argument.

2018-03-12 Thread Eric Engestrom
On Monday, 2018-03-12 07:52:49 +0100, mathias.froehl...@gmx.net wrote:
> From: Mathias Fröhlich <mathias.froehl...@web.de>
> 
> Hi Brian,
> 
> As requested in the past review, change the argument
> of st_pipe_vertex_format to something more concise.
> 
> Please review
> best
> Mathias
> 
> 
> Signed-off-by: Mathias Fröhlich <mathias.froehl...@web.de>

Looks good to me!
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/mesa/state_tracker/st_atom.h  |  3 +--
>  src/mesa/state_tracker/st_atom_array.c| 25 +
>  src/mesa/state_tracker/st_draw_feedback.c |  7 +--
>  3 files changed, 11 insertions(+), 24 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_atom.h 
> b/src/mesa/state_tracker/st_atom.h
> index 68388a5674..2567ad30df 100644
> --- a/src/mesa/state_tracker/st_atom.h
> +++ b/src/mesa/state_tracker/st_atom.h
> @@ -55,8 +55,7 @@ void st_validate_state( struct st_context *st, enum 
> st_pipeline pipeline );
>  GLuint st_compare_func_to_pipe(GLenum func);
>  
>  enum pipe_format
> -st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
> -  GLboolean normalized, GLboolean integer);
> +st_pipe_vertex_format(const struct gl_array_attributes *attrib);
>  
>  
>  /* Define ST_NEW_xxx_INDEX */
> diff --git a/src/mesa/state_tracker/st_atom_array.c 
> b/src/mesa/state_tracker/st_atom_array.c
> index ff7a5d0746..2fd67e8d84 100644
> --- a/src/mesa/state_tracker/st_atom_array.c
> +++ b/src/mesa/state_tracker/st_atom_array.c
> @@ -237,13 +237,18 @@ static const uint16_t vertex_formats[][4][4] = {
>   * Return a PIPE_FORMAT_x for the given GL datatype and size.
>   */
>  enum pipe_format
> -st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
> -  GLboolean normalized, GLboolean integer)
> +st_pipe_vertex_format(const struct gl_array_attributes *attrib)
>  {
> +   const GLubyte size = attrib->Size;
> +   const GLenum16 format = attrib->Format;
> +   const bool normalized = attrib->Normalized;
> +   const bool integer = attrib->Integer;
> +   GLenum16 type = attrib->Type;
> unsigned index;
>  
> assert(size >= 1 && size <= 4);
> assert(format == GL_RGBA || format == GL_BGRA);
> +   assert(attrib->_ElementSize == _mesa_bytes_per_vertex_attrib(size, type));
>  
> switch (type) {
> case GL_HALF_FLOAT_OES:
> @@ -532,14 +537,8 @@ setup_interleaved_attribs(struct st_context *st,
>ptr = _mesa_vertex_attrib_address(attrib, binding);
>  
>src_offset = (unsigned) (ptr - low_addr);
> -  assert(attrib->_ElementSize ==
> - _mesa_bytes_per_vertex_attrib(attrib->Size, attrib->Type));
>  
> -  src_format = st_pipe_vertex_format(attrib->Type,
> - attrib->Size,
> - attrib->Format,
> - attrib->Normalized,
> - attrib->Integer);
> +  src_format = st_pipe_vertex_format(attrib);
>  
>init_velement_lowered(vp, velements, src_offset, src_format,
>  binding->InstanceDivisor, 0,
> @@ -623,8 +622,6 @@ setup_non_interleaved_attribs(struct st_context *st,
>attrib = array->VertexAttrib;
>stride = binding->Stride;
>bufobj = binding->BufferObj;
> -  assert(attrib->_ElementSize ==
> - _mesa_bytes_per_vertex_attrib(attrib->Size, attrib->Type));
>  
>if (_mesa_is_bufferobj(bufobj)) {
>   /* Attribute data is in a VBO.
> @@ -688,11 +685,7 @@ setup_non_interleaved_attribs(struct st_context *st,
>/* common-case setup */
>vbuffer[bufidx].stride = stride; /* in bytes */
>  
> -  src_format = st_pipe_vertex_format(attrib->Type,
> - attrib->Size,
> - attrib->Format,
> - attrib->Normalized,
> - attrib->Integer);
> +  src_format = st_pipe_vertex_format(attrib);
>  
>init_velement_lowered(vp, velements, 0, src_format,
>  binding->InstanceDivisor, bufidx,
> diff --git a/src/mesa/state_tracker/st_draw_feedback.c 
> b/src/mesa/state_tracker/st_draw_feedback.c
> index 46a12848c0..fa96b4e2e2 100644
> --- a/src/mesa/state_tracker/st_draw_feedback.c
> +++ b/src/mesa/state_tracker/st_draw_feedback.c
> @@ -240,12 +240,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
>vbuffers[attr].stride = binding-&

Re: [Mesa-dev] [PATCH 1/2] egl/wayland: Add 10bpc BGR configs

2018-03-09 Thread Eric Engestrom
On Thursday, 2018-03-08 17:36:39 +, Daniel Stone wrote:
> Add support for XBGR2101010 and ABGR2101010.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> Cc: Ilia Mirkin <imir...@alum.mit.edu>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/egl/drivers/dri2/platform_wayland.c | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
> b/src/egl/drivers/dri2/platform_wayland.c
> index 877f7933b9a..7a32491974e 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -81,6 +81,18 @@ static const struct dri2_wl_visual {
>   __DRI_IMAGE_FORMAT_ARGB2101010, 32,
>   { 0x3ff0, 0x000ffc00, 0x03ff, 0xc000 }
> },
> +   {
> + "XBGR2101010",
> + WL_DRM_FORMAT_XBGR2101010, WL_SHM_FORMAT_XBGR2101010,
> + __DRI_IMAGE_FORMAT_XBGR2101010, 32,
> + { 0x03ff, 0x000ffc00, 0x3ff0, 0x }
> +   },
> +   {
> + "ABGR2101010",
> + WL_DRM_FORMAT_ABGR2101010, WL_SHM_FORMAT_ABGR2101010,
> + __DRI_IMAGE_FORMAT_ABGR2101010, 32,
> + { 0x03ff, 0x000ffc00, 0x3ff0, 0xc000 }
> +   },
> {
>   "XRGB",
>   WL_DRM_FORMAT_XRGB, WL_SHM_FORMAT_XRGB,
> -- 
> 2.14.3
> 
> ___
> 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] vulkan: simplify VK_USE_PLATFORM_*_KHR handling

2018-03-09 Thread Eric Engestrom
On Friday, 2018-03-09 15:24:18 +, Emil Velikov wrote:
> From: Emil Velikov <emil.veli...@collabora.com>
> 
> Instead of having multiple guards littered through the code, simply
> introduce static inline no-op functions when the respective macros are
> not set.
> 
> Inspired by the same convention from the kernel.

Oh right, I didn't get what you meant at first, but this makes sense. As
the number of supported platform increases, this will be much cleaner.

> 
> Cc: Eric Engestrom <eric.engest...@imgtec.com>
> Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
> ---
> Here is an example of my earlier suggestion.
> NOTE: not even compile tested!
> ---
>  src/vulkan/wsi/wsi_common.c |  8 
>  src/vulkan/wsi/wsi_common_private.h | 27 +++
>  2 files changed, 27 insertions(+), 8 deletions(-)
> 
> diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
> index fe262b4968d..c91075325b9 100644
> --- a/src/vulkan/wsi/wsi_common.c
> +++ b/src/vulkan/wsi/wsi_common.c
> @@ -79,17 +79,13 @@ wsi_device_init(struct wsi_device *wsi,
> WSI_GET_CB(WaitForFences);
>  #undef WSI_GET_CB
>  
> -#ifdef VK_USE_PLATFORM_XCB_KHR
> result = wsi_x11_init_wsi(wsi, alloc);
> if (result != VK_SUCCESS)
>goto fail;
> -#endif
>  
> -#ifdef VK_USE_PLATFORM_WAYLAND_KHR
> result = wsi_wl_init_wsi(wsi, alloc, pdevice);
> if (result != VK_SUCCESS)
>goto fail;
> -#endif
>  
> return VK_SUCCESS;
>  
> @@ -102,12 +98,8 @@ void
>  wsi_device_finish(struct wsi_device *wsi,
>const VkAllocationCallbacks *alloc)
>  {
> -#ifdef VK_USE_PLATFORM_WAYLAND_KHR
> wsi_wl_finish_wsi(wsi, alloc);
> -#endif
> -#ifdef VK_USE_PLATFORM_XCB_KHR
> wsi_x11_finish_wsi(wsi, alloc);
> -#endif
>  }
>  
>  VkResult
> diff --git a/src/vulkan/wsi/wsi_common_private.h 
> b/src/vulkan/wsi/wsi_common_private.h
> index b608119b969..501bbf0498e 100644
> --- a/src/vulkan/wsi/wsi_common_private.h
> +++ b/src/vulkan/wsi/wsi_common_private.h
> @@ -129,16 +129,43 @@ struct wsi_interface {
>  struct wsi_swapchain **swapchain);
>  };
>  
> +#ifdef VK_USE_PLATFORM_XCB_KHR
>  VkResult wsi_x11_init_wsi(struct wsi_device *wsi_device,
>const VkAllocationCallbacks *alloc);
>  void wsi_x11_finish_wsi(struct wsi_device *wsi_device,
>  const VkAllocationCallbacks *alloc);
> +#else
> +static inline
> +VkResult wsi_x11_init_wsi(struct wsi_device *wsi_device,
> +  const VkAllocationCallbacks *alloc)
> +{
> +   return VK_SUCCESS;
> +}
> +
> +static inline
> +void wsi_x11_finish_wsi(struct wsi_device *wsi_device,
> +const VkAllocationCallbacks *alloc) { }

Nit: can we have all the `{` and `}` on their own lines, just like the
`init` stub above?

Provided you compile-test :P
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> +#endif
> +
> +#ifdef VK_USE_PLATFORM_WAYLAND_KHR
>  VkResult wsi_wl_init_wsi(struct wsi_device *wsi_device,
>   const VkAllocationCallbacks *alloc,
>   VkPhysicalDevice physical_device);
>  void wsi_wl_finish_wsi(struct wsi_device *wsi_device,
> const VkAllocationCallbacks *alloc);
> +#else
> +static inline
> +VkResult wsi_wl_init_wsi(struct wsi_device *wsi_device,
> + const VkAllocationCallbacks *alloc,
> + VkPhysicalDevice physical_device);
> +{
> +   return VK_SUCCESS;
> +}
>  
> +static inline
> +void wsi_wl_finish_wsi(struct wsi_device *wsi_device,
> +   const VkAllocationCallbacks *alloc) {}
> +#endif
>  
>  #define WSI_DEFINE_NONDISP_HANDLE_CASTS(__wsi_type, __VkType)  \
> \
> -- 
> 2.16.0
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Add moduledir to d3d.pc

2018-03-09 Thread Eric Engestrom
On Friday, 2018-03-09 08:32:29 -0800, Dylan Baker wrote:
> This is required to build wine with the nine patchset
> 
> Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
>("meson: build gallium nine state_tracker")
> Reported-by: Mike Lothian <m...@fireburn.co.uk>
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/gallium/targets/d3dadapter9/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/targets/d3dadapter9/meson.build 
> b/src/gallium/targets/d3dadapter9/meson.build
> index fd608be9bf6..e3f4ae58f53 100644
> --- a/src/gallium/targets/d3dadapter9/meson.build
> +++ b/src/gallium/targets/d3dadapter9/meson.build
> @@ -72,4 +72,5 @@ pkg.generate(
>description : 'Native D3D driver modules',
>version : '.'.join(nine_version),
>requires_private : 'libdrm >= 2.4.75',
> +  variables : ['moduledir=${prefix}/@0@'.format(d3d_drivers_path)],
>  )
> -- 
> 2.16.2
> 
> ___
> 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 mesa] vulkan/wsi: clean up cleanup path

2018-03-09 Thread Eric Engestrom
On Thursday, 2018-03-08 18:16:11 +, Emil Velikov wrote:
> On 26 February 2018 at 13:51, Eric Engestrom <eric.engest...@imgtec.com> 
> wrote:
> > Cc: Keith Packard <kei...@keithp.com>
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> > This will make Keith's addition much cleaner as well :)
> 
> Hey, every little helps. Fwiw
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>

Thanks; pushed

> 
> Another idea - make the wsi_*_{init,fini}_wsi kernel style stubs ;-)

I'm not sure what you mean by that?

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


Re: [Mesa-dev] [PATCH mesa 01/21] vulkan: Add KHR_display extension using DRM [v4]

2018-03-09 Thread Eric Engestrom
On Thursday, 2018-03-08 10:04:03 -0800, Keith Packard wrote:
> Eric Engestrom <eric.engest...@imgtec.com> writes:
> 
> > I'm still slightly bothered by the build options inconsistency between
> > autotools: reuse --with-platform=drm
> > meson: new   -D platform=display
> >
> > I'd be happy with either one being used everywhere, but from what you
> > said last time I think you'd prefer to reuse `platform=drm`; can we
> > drop the meson hunks above and use `with_platform_drm` in
> > src/vulkan/wsi/meson.build?
> 
> Thanks for the reminder; I got totally bound up in Jason's code fixes
> and rebasing onto current master that I just forgot. I've got three tiny
> patches on my drm-lease-v2 branch which does this (one for core, one for
> anv, one for radv).
> 
> > About that hunk, have you looked at my patch?
> > https://patchwork.freedesktop.org/patch/206818/
> 
> Yeah, that definitely looks nicer. I've reviewed it to make sure calling
> the various finish functions is harmless when called before the matching
> init function. If it gets applied before my series, I'll adapt :-)

I just pushed it; your `if (result != VK_SUCCESS)` should now just be
`goto fail;` :)

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


Re: [Mesa-dev] [PATCH mesa 01/21] vulkan: Add KHR_display extension using DRM [v4]

2018-03-08 Thread Eric Engestrom
On Wednesday, 2018-03-07 23:24:59 -0800, Keith Packard wrote:
> This adds support for the KHR_display extension support to the vulkan
> WSI layer. Driver support will be added separately.
> 
> v2:
>   * fix double ;; in wsi_common_display.c
> 
>   * Move mode list from wsi_display to wsi_display_connector
> 
>   * Fix scope for wsi_display_mode andwsi_display_connector
>   allocs
> 
>   * Switch all allocations to vk_zalloc instead of vk_alloc.
> 
>   * Fix DRM failure in
>   wsi_display_get_physical_device_display_properties
> 
> When DRM fails, or when we don't have a master fd
> (presumably due to application errors), just return 0
> properties from this function, which is at least a valid
> response.
> 
>   * Use vk_outarray for all property queries
> 
> This is a bit less error-prone than open-coding the same
> stuff.
> 
>   * Remove VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR from surface caps
> 
> Until we have multi-plane support, we shouldn't pretend to
> have any multi-plane semantics, even if undefined.
> 
>   Suggested-by: Jason Ekstrand <ja...@jlekstrand.net>
> 
>   * Simplify addition of VK_USE_PLATFORM_DISPLAY_KHR to
>   vulkan_wsi_args
> 
>   Suggested-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> v3:
>   Add separate 'display_fd' and 'render_fd' arguments to
>   wsi_device_init API. This allows drivers to use different FDs
>   for the different aspects of the device.
> 
>   Use largest mode as display size when no preferred mode.
> 
>   If the display doesn't provide a preferred mode, we'll assume
>   that the largest supported mode is the "physical size" of the
>   device and report that.
> 
> v4:
>   Make wsi_image_state enumeration values uppercase.
>   Follow more common mesa conventions.
> 
>   Remove 'render_fd' from wsi_device_init API.  The
>   wsi_common_display code doesn't use this fd at all, so stop
>   passing it in. This avoids any potential confusion over which
>   fd to use when creating display-relative object handles.
> 
>   Remove call to wsi_create_prime_image which would never have
>   been reached as the necessary condition (use_prime_blit) is
>   never set.
> 
>   whitespace cleanups in wsi_common_display.c
> 
>   Suggested-by: Jason Ekstrand <ja...@jlekstrand.net>
> 
>   Add depth/bpp info to available surface formats.  Instead of
>   hard-coding depth 24 bpp 32 in the drmModeAddFB call, use the
>   requested format to find suitable values.
> 
>   Destroy kernel buffers and FBs when swapchain is destroyed. We
>   were leaking both of these kernel objects across swapchain
>   destruction.
> 
>   Note that wsi_display_wait_for_event waits for anything to
>   happen.  wsi_display_wait_for_event is simply a yield so that
>   the caller can then check to see if the desired state change
>   has occurred.
> 
>   Record swapchain failures in chain for later return. If some
>   asynchronous swapchain activity fails, we need to tell the
>   application eventually. Record the failure in the swapchain
>   and report it at the next acquire_next_image or queue_present
>   call.
> 
>   Fix error returns from wsi_display_setup_connector.  If a
>   malloc failed, then the result should be
>   VK_ERROR_OUT_OF_HOST_MEMORY. Otherwise, the associated ioctl
>   failed and we're either VT switched away, or our lease has
>   been revoked, in which case we should return
>   VK_ERROR_OUT_OF_DATE_KHR.
> 
>   Make sure both sides of if/else brace use matches
> 
>   Note that we assume drmModeSetCrtc is synchronous. Add a
>   comment explaining why we can idle any previous displayed
>   image as soon as the mode set returns.
> 
>   Note that EACCES from drmModePageFlip means VT inactive.  When
>   vt switched away drmModePageFlip returns EACCES. Poll once a
>   second waiting until we get some other return value back.
> 
>   Clean up after alloc failure in
>   wsi_display_surface_create_swapchain. Destroy any created
>   images, free the swapchain.
> 
>   Remove physical_device from wsi_display_init_wsi. We never
>   need this value, so remove it from the API and from the
>   internal wsi_display structure.
> 
>   Use drmModeAddFB2 in wsi_display_image_init.  This takes a drm
>   format instead of depth/bpp, which provides more control over
>   the format of the data.
> 
> Signe

Re: [Mesa-dev] [PATCH 3/5] meson: Re-add auto option for omx

2018-03-07 Thread Eric Engestrom
On Tuesday, 2018-03-06 11:57:14 -0800, Dylan Baker wrote:
> This re-adds the auto option for omx, without it we default to tizonia
> and the build fails almost immediately, this is especially obnoxious
> those building a driver that doesn't support the OMX state tracker to
> begin with.
> 
> CC: Gurkirpal Singh 
> Fixes: bb5e27fab6087a5c1528a5faf507acce700e883c
>("st/omx/bellagio: Rename st and target directories")
> Signed-off-by: Dylan Baker 
> ---
>  meson.build| 67 
> --
>  meson_options.txt  |  4 +-
>  src/gallium/meson.build|  2 +-
>  src/gallium/state_trackers/omx/meson.build | 18 
>  4 files changed, 56 insertions(+), 35 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index dd2fa603829..c85afdecee9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -464,42 +464,63 @@ endif
>  
>  _omx = get_option('gallium-omx')
>  if not system_has_kms_drm
> -  if _omx != 'disabled'
> -error('OMX state tracker can only be built on unix-like OSes.')
> -  else
> +  if ['auto', 'disabled'].contains(_omx)
>  _omx = 'disabled'
> +  else
> +error('OMX state tracker can only be built on unix-like OSes.')
>endif
>  elif not (with_platform_x11 or with_platform_drm)
> -  if _omx != 'disabled'
> -error('OMX state tracker requires X11 or drm platform support.')
> -  else
> +  if ['auto', 'disabled'].contains(_omx)
>  _omx = 'disabled'
> +  else
> +error('OMX state tracker requires X11 or drm platform support.')
>endif
>  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
> -  if _omx != 'disabled'
> -error('OMX state tracker requires at least one of the following gallium 
> drivers: r600, radeonsi, nouveau.')
> -  else
> +  if ['auto', 'disabled'].contains(_omx)
>  _omx = 'disabled'
> +  else
> +error('OMX state tracker requires at least one of the following gallium 
> drivers: r600, radeonsi, nouveau.')
>endif
>  endif
> -with_gallium_omx = _omx != 'disabled'
> -gallium_omx = _omx
> +with_gallium_omx = _omx
>  dep_omx = []
>  dep_omx_other = []
> -if gallium_omx == 'bellagio'
> +if with_gallium_omx == 'bellagio' or with_gallium_omx == 'auto'
>pre_args += '-DENABLE_ST_OMX_BELLAGIO'

I didn't quite get what Julien was saying at first, but he's right: the
above line should be moved ...

> -  dep_omx = dependency('libomxil-bellagio')
> -elif gallium_omx == 'tizonia'
> -  pre_args += '-DENABLE_ST_OMX_TIZONIA'
> -  dep_omx = dependency('libtizonia', version : '>= 0.10.0')
> -  dep_omx_other = [
> -dependency('libtizplatform'),
> -dependency('tizilheaders')
> -  ]
> +  dep_omx = dependency(
> +'libomxil-bellagio', required : with_gallium_omx == 'bellagio'
> +  )
> +  if dep_omx.found()
> +with_gallium_omx = 'bellagio'

... here

> +  endif
> +endif
> +if with_gallium_omx == 'tizonia' or with_gallium_omx == 'auto'
> +  if not (with_dri and with_egl)
> +if with_gallium_omx == 'tizonia'
> +  error('OMX-Tizonia state tracker requires dri and egl')
> +else
> +  with_gallium_omx == 'disabled'
> +endif
> +  else
> +pre_args += '-DENABLE_ST_OMX_TIZONIA'

same with this one, it should be moved ...

> +dep_omx = dependency(
> +  'libtizonia', version : '>= 0.10.0',
> +  required : with_gallium_omx == 'tizonia',
> +)
> +dep_omx_other = [
> +  dependency('libtizplatform', required : with_gallium_omx == 'tizonia'),
> +  dependency('tizilheaders', required : with_gallium_omx == 'tizonia'),
> +]
> +if dep_omx.found() and dep_omx_other[0].found() and 
> dep_omx_other[1].found()
> +  with_gallium_omx = 'tizonia'

... here

With these two fixes, r-b stands :)

(Note, kind of a nit, but I'd prefer for _omx to be used until it's
fully defined, ie. `with_gallium_omx` should never be 'auto' imho)

> +else
> +  with_gallium_omx = 'disabled'
> +endif
> +  endif
>  endif
>  
>  omx_drivers_path = get_option('omx-libs-path')
> -if with_gallium_omx
> +if with_gallium_omx != 'disabled'
># Figure out where to put the omx driver.
># FIXME: this could all be vastly simplified by adding a 'defined_variable'
># argument to meson's get_pkgconfig_variable method.
> @@ -1193,8 +1214,8 @@ if with_platform_x11
>  dep_xxf86vm = dependency('xxf86vm', required : false)
>endif
>if (with_any_vk or with_glx == 'dri' or
> -   (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
> -with_gallium_xa))
> +   (with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or
> +with_gallium_omx != 'disabled'))
>  dep_xcb = dependency('xcb')
>  dep_x11_xcb = dependency('x11-xcb')
>endif
> diff --git a/meson_options.txt b/meson_options.txt
> index 50ae19685e7..a573290b774 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -90,8 +90,8 @@ option(
>  option(
>  

Re: [Mesa-dev] [PATCH 0/5] Fix meson omx compilation

2018-03-07 Thread Eric Engestrom
On Tuesday, 2018-03-06 11:57:11 -0800, Dylan Baker wrote:
> This fixes a couple of problems with the meson build support for the
> recent omx tizonia integration, namely that it breaks a lot of
> previously working meson configurations.

Thanks! Series is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> The biggest change in here is the reintroduction of the 'auto' flag to
> -Dgallium-omx. This allows configurations that lack tizonia, or that
> otherwise can't build the omx tracker (i965, and gallium drivers other
> than r600, radeon, or nouveau) to build without intervention.
> 
> This also fixes some style things, but those are pretty trivial.
> 
> Dylan Baker (5):
>   meson: combine state trackers and target if blocks
>   meson: fix tizonia compilation
>   meson: Re-add auto option for omx
>   meson: Use include directory variables instead of traversing
>   meson: Fix indent in omx meson.build
> 
>  meson.build| 67 +++--
>  meson_options.txt  |  4 +-
>  src/egl/meson.build|  5 ++-
>  src/gallium/meson.build| 30 -
>  src/gallium/state_trackers/dri/meson.build |  2 +
>  src/gallium/state_trackers/omx/meson.build | 69 
> +++---
>  src/gbm/meson.build|  2 +-
>  7 files changed, 95 insertions(+), 84 deletions(-)
> 
> -- 
> 2.16.2
> 
> ___
> 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 RFC] radeonsi: Disable IEEE_MODE.

2018-03-06 Thread Eric Engestrom
On Monday, 2018-03-05 14:07:24 -0500, Jan Vesely wrote:
> On Mon, 2018-03-05 at 10:04 +0000, Eric Engestrom wrote:
> > On Saturday, 2018-03-03 18:35:02 -0500, Jan Vesely wrote:
> > > Neither GL nor CL nor SPIRV needs the IEEE handling of sNaNs.
> > > 
> > > Signed-off-by: Jan Vesely <jan.ves...@rutgers.edu>
> > > ---
> > > This is the 3rd way to handle broken fmin/fmax in clover CL.
> > > It can be worked around in libclc (to not use
> > > llvm.fminnum/llvm.fmaxnum)[0]
> > > LLVM can be patched to not use IEEE_MODE[1]
> > > Or it can be fixed in the config reg in mesa.
> > > 
> > > The third option is arguably the worst (changes semantics of compiled
> > > code), but since the first two efforts have been stalled for months.
> > > Here's the third one.
> > > 
> > > Jan
> > > 
> > > [0] 
> > > http://lists.llvm.org/pipermail/libclc-dev/2017-November/thread.html#2692
> > > [1] https://reviews.llvm.org/D40514
> > > 
> > > 
> > >  src/gallium/drivers/radeonsi/si_compute.c | 8 
> > >  src/gallium/drivers/radeonsi/si_shader.c  | 6 +-
> > >  2 files changed, 13 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/src/gallium/drivers/radeonsi/si_compute.c 
> > > b/src/gallium/drivers/radeonsi/si_compute.c
> > > index 41927988cf..d0fcba485b 100644
> > > --- a/src/gallium/drivers/radeonsi/si_compute.c
> > > +++ b/src/gallium/drivers/radeonsi/si_compute.c
> > > @@ -70,6 +70,10 @@ static void code_object_to_config(const 
> > > amd_kernel_code_t *code_object,
> > > struct si_shader_config *out_config) {
> > >  
> > >   uint32_t rsrc1 = code_object->compute_pgm_resource_registers;
> > > + /* Disable IEEE mode. IEEE_MODE determines sNaN handling by fmin/fmax
> > > +  * instructions. Nothing wants the IEEE rules here.
> > > +  * Ideally LLVM would not emit this configuration. */
> > > + rsrc1 &= C_00B848_IEEE_MODE;
> > 
> > I don't know anything about this code, but this bit op looks odd to me;
> > I would expect to see either:
> > rsrc1 &= ~C_00B848_IEEE_MODE;
> 
> C_00B848_IEEE_MODE is defined as 0xFF7F, so it's already bit-
> negated.

Alright, looks reasonable then :)

> 
> Jan
> 
> > or:
> > rsrc1 |= C_00B848_IEEE_MODE;
> > 
> > >   uint32_t rsrc2 = code_object->compute_pgm_resource_registers >> 32;
> > >   out_config->num_sgprs = code_object->wavefront_sgpr_count;
> > >   out_config->num_vgprs = code_object->workitem_vgpr_count;
> > > @@ -137,6 +141,10 @@ static void si_create_compute_state_async(void *job, 
> > > int thread_index)
> > >   S_00B848_SGPRS((shader->config.num_sgprs - 1) / 8) |
> > >   S_00B848_DX10_CLAMP(1) |
> > >   S_00B848_FLOAT_MODE(shader->config.float_mode);
> > > + /* Disable IEEE mode. IEEE_MODE determines sNaN handling by
> > > +  * fmin/fmax instructions. Nothing wants the IEEE rules.
> > > +  * Ideally LLVM would not emit this configuration. */
> > > + shader->config.rsrc1 &= C_00B848_IEEE_MODE;
> > >  
> > >   shader->config.rsrc2 =
> > >   S_00B84C_USER_SGPR(user_sgprs) |
> > > diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
> > > b/src/gallium/drivers/radeonsi/si_shader.c
> > > index 2a50b266f6..01bad71a4e 100644
> > > --- a/src/gallium/drivers/radeonsi/si_shader.c
> > > +++ b/src/gallium/drivers/radeonsi/si_shader.c
> > > @@ -5178,7 +5178,11 @@ void si_shader_binary_read_config(struct 
> > > ac_shader_binary *binary,
> > >   conf->num_sgprs = MAX2(conf->num_sgprs, 
> > > (G_00B028_SGPRS(value) + 1) * 8);
> > >   conf->num_vgprs = MAX2(conf->num_vgprs, 
> > > (G_00B028_VGPRS(value) + 1) * 4);
> > >   conf->float_mode =  G_00B028_FLOAT_MODE(value);
> > > - conf->rsrc1 = value;
> > > + /* Disable IEEE mode. IEEE_MODE determines sNaN
> > > +  * handling by fmin/fmax instructions.
> > > +  * Nothing wants the IEEE rules here.
> > > +  * Ideally LLVM would not emit this configuration. */
> > > + conf->rsrc1 = value & C_00B848_IEEE_MODE;
> > >   break;
> > >   case R_00B02C_SPI_SHADER_PGM_RSRC2_PS:
> > >   conf->lds_size = MAX2(conf->lds_size, 
> > > G_00B02C_EXTRA_LDS_SIZE(value));
> > > -- 
> > > 2.14.3
> > > 
> > > ___
> > > 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] freedreno: bump required libdrm version

2018-03-06 Thread Eric Engestrom
On Tuesday, 2018-03-06 12:00:52 +, Emil Velikov wrote:
> On 6 March 2018 at 09:34, Christian Gmeiner <christian.gmei...@gmail.com> 
> wrote:
> > Fixes: 26a9321d0a "freedreno: add global_bindings state"
> >
> > Signed-off-by: Christian Gmeiner <christian.gmei...@gmail.com>
> > ---
> >  configure.ac | 2 +-
> >  meson.build  | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> Should cover the slip-up that Eric noticed yesterday [1].

Indeed :)
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> 
> -Emil
> 
> [1] https://lists.freedesktop.org/archives/mesa-dev/2018-March/187673.html
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure: remove unused AM_CONDITIONAL

2018-03-06 Thread Eric Engestrom
On Monday, 2018-03-05 18:15:24 +, Emil Velikov wrote:
> From: Emil Velikov <emil.veli...@collabora.com>
> 
> Signed-off-by: Emil Velikov <emil.veli...@collabora.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  configure.ac | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index d8093597dd0..0cfb0f7d851 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -451,7 +451,6 @@ if test "x$GCC_ATOMIC_BUILTINS_SUPPORTED" = x1; then
>  LIBATOMIC_LIBS="-latomic"
>  fi
>  fi
> -AM_CONDITIONAL([GCC_ATOMIC_BUILTINS_SUPPORTED], [test 
> x$GCC_ATOMIC_BUILTINS_SUPPORTED = x1])
>  AC_SUBST([LIBATOMIC_LIBS])
>  
>  dnl Check if host supports 64-bit atomics
> -- 
> 2.16.0
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] freedreno: add missing include

2018-03-05 Thread Eric Engestrom
Fixes: 26a9321d0ae819f2a49d7 "freedreno: add global_bindings state"
Cc: Rob Clark <robdcl...@gmail.com>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/gallium/drivers/freedreno/freedreno_state.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/freedreno/freedreno_state.c 
b/src/gallium/drivers/freedreno/freedreno_state.c
index 05717da95995e5cec6a5..907653e64af244bcc364 100644
--- a/src/gallium/drivers/freedreno/freedreno_state.c
+++ b/src/gallium/drivers/freedreno/freedreno_state.c
@@ -40,6 +40,8 @@
 #include "freedreno_query_hw.h"
 #include "freedreno_util.h"
 
+#include 
+
 /* All the generic state handling.. In case of CSO's that are specific
  * to the GPU version, when the bind and the delete are common they can
  * go in here.
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] travis: keep meson version below 0.45.0

2018-03-05 Thread Eric Engestrom
On Monday, 2018-03-05 17:25:36 +0200, Andres Gomez wrote:
> Recently Meson upgraded to 0.45.0 and it needs python 3.5+, which is
> not available in Trusty.

I was looking at this issue right now, thanks for beating me to it :)
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> Cc: Eric Engestrom <eric.engest...@imgtec.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Cc: Jon Turney <jon.tur...@dronecode.org.uk>
> Signed-off-by: Andres Gomez <ago...@igalia.com>
> ---
>  .travis.yml | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 823111ca539..dcd150b482b 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -460,10 +460,11 @@ before_install:
>  install:
>- pip2 install --user mako
>  
> -  # Install the latest meson from pip, since the version in the ubuntu repos 
> is
> -  # often quite old.
> +  # Install a more modern meson from pip, since the version in the
> +  # ubuntu repos is often quite old. Avoid >=0.45.0 as it needs python
> +  # 3.5+
>- if test "x$BUILD" = xmeson; then
> -  pip3 install --user meson;
> +  pip3 install --user "meson<0.45.0";
>  fi
>  
># Since libdrm gets updated in configure.ac regularly, try to pick up the
> -- 
> 2.16.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] gbm: give a name to rgba fields

2018-03-05 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
Note: `gbm_dri_visuals_table` doesn't need any modification, as the
channel order doesn't change, so `rgba_mask = { r, g, b, a }` still
works.
---
 src/egl/drivers/dri2/platform_drm.c | 16 
 src/gbm/backends/dri/gbm_driint.h   |  7 ++-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 0121e1fc27dfe14fd9c7..fe1138441617a7ab5785 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -118,10 +118,10 @@ dri2_drm_config_is_compatible(struct dri2_egl_display 
*dri2_dpy,
if (i == dri2_dpy->gbm_dri->num_visuals)
   return false;
 
-   if (red != visual->rgba_masks[0] ||
-   green != visual->rgba_masks[1] ||
-   blue != visual->rgba_masks[2] ||
-   (alpha && visual->rgba_masks[3] && alpha != visual->rgba_masks[3])) {
+   if (red != visual->rgba_masks.red ||
+   green != visual->rgba_masks.green ||
+   blue != visual->rgba_masks.blue ||
+   (alpha && visual->rgba_masks.alpha && alpha != 
visual->rgba_masks.alpha)) {
   return false;
}
 
@@ -638,10 +638,10 @@ drm_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay 
*disp)
   for (unsigned j = 0; j < num_visuals; j++) {
  struct dri2_egl_config *dri2_conf;
 
- if (visuals[j].rgba_masks[0] != red ||
- visuals[j].rgba_masks[1] != green ||
- visuals[j].rgba_masks[2] != blue ||
-visuals[j].rgba_masks[3] != alpha)
+ if (visuals[j].rgba_masks.red != red ||
+ visuals[j].rgba_masks.green != green ||
+ visuals[j].rgba_masks.blue != blue ||
+ visuals[j].rgba_masks.alpha != alpha)
 continue;
 
  const EGLint attr_list[] = {
diff --git a/src/gbm/backends/dri/gbm_driint.h 
b/src/gbm/backends/dri/gbm_driint.h
index 84a98533c7946b986d1f..8497be3e8f6dd976838a 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -43,7 +43,12 @@ struct gbm_dri_bo;
 struct gbm_dri_visual {
uint32_t gbm_format;
int dri_image_format;
-   uint32_t rgba_masks[4];
+   struct {
+  uint32_t red;
+  uint32_t green;
+  uint32_t blue;
+  uint32_t alpha;
+   } rgba_masks;
 };
 
 struct gbm_dri_device {
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] disk cache: Link with -latomic if necessary

2018-03-05 Thread Eric Engestrom
On Sunday, 2018-03-04 00:20:16 +, Mike Lothian wrote:
> Hi
> 
> Sorry to be a pain again
> 
> I've just tested this with clang and the 32bit build still fails without
> -latomic

This fix was for meson, and you're using make here; does it work if you
build using meson? First thing is to figure out if it's an issue with
your setup or the build system.

> 
> libtool: link: /bin/true glsl/.libs/libstandalone.a
> libtool: link: rm -fr glsl/.libs/libstandalone.lax
> glsl/.libs/libstandalone.lax
> libtool: link: ( cd "glsl/.libs" && rm -f "libstandalone.la" && ln -s "../
> libstandalone.la" "libstandalone.la" )
> /bin/sh ../../libtool  --tag=CXX   --mode=link clang++ -m32
> -fvisibility=hidden -Werror=pointer-arith -Werror=vla -O3 -march=native
> -pipe -flto=thin -Wall -fno-math-errno -fno-trapping-math
> -Qunused-arguments   -O3 -march=native -pipe -flto=thin -o glsl_
> compiler glsl/main.o glsl/libstandalone.la
> libtool: link: clang++ -m32 -fvisibility=hidden -Werror=pointer-arith
> -Werror=vla -O3 -march=native -pipe -flto=thin -Wall -fno-math-errno
> -fno-trapping-math -Qunused-arguments -O3 -march=native -pipe -flto=thin -o
> glsl_compiler glsl/main.o  glsl/.libs/l
> ibstandalone.a -lz -lpthread -pthread
> /var/tmp/portage/media-libs/mesa-/temp/lto-llvm-4efaa5.o:disk_cache.c:function
> disk_cache_remove: error: undefined reference to '__atomic_fetch_add_8'
> clang-7.0: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[4]: *** [Makefile:2364: glsl_compiler] Error 1
> make[4]: Leaving directory
> '/var/tmp/portage/media-libs/mesa-/work/mesa--abi_x86_32.x86/src/compiler'
> 
> make[3]: *** [Makefile:1793: all] Error 2
> make[3]: Leaving directory
> '/var/tmp/portage/media-libs/mesa-/work/mesa--abi_x86_32.x86/src/compiler'
> 
> make[2]: *** [Makefile:875: all-recursive] Error 1
> make[2]: Leaving directory
> '/var/tmp/portage/media-libs/mesa-/work/mesa--abi_x86_32.x86/src'
> make[1]: *** [Makefile:660: all] Error 2
> make[1]: Leaving directory
> '/var/tmp/portage/media-libs/mesa-/work/mesa--abi_x86_32.x86/src'
> make: *** [Makefile:668: all-recursive] Error 1
> * ERROR: media-libs/mesa-::gentoo failed (compile phase):
> *   emake failed
> *
> * If you need support, post the output of `emerge --info
> '=media-libs/mesa-::gentoo'`,
> * the complete build log and the output of `emerge -pqv
> '=media-libs/mesa-::gentoo'`.
> * The complete build log is located at
> '/var/tmp/portage/media-libs/mesa-/temp/build.log'.
> * The ebuild environment file is located at
> '/var/tmp/portage/media-libs/mesa-/temp/environment'.
> * Working directory:
> '/var/tmp/portage/media-libs/mesa-/work/mesa--abi_x86_32.x86'
> * S: '/var/tmp/portage/media-libs/mesa-/work/mesa-'
> 
> If I pass -latomic in with the LDFLAGS it builds fine
> 
> On Tue, 27 Feb 2018 at 20:22 Matt Turner  wrote:
> 
> > On Tue, Feb 27, 2018 at 2:26 AM, Thierry Reding
> >  wrote:
> > > On Mon, Feb 26, 2018 at 11:14:05AM -0800, Matt Turner wrote:
> > >> On Fri, Feb 23, 2018 at 5:18 AM, Thierry Reding
> > >>  wrote:
> > >> > From: Thierry Reding 
> > >> >
> > >> > The disk cache implementation uses 64-bit atomic operations. For some
> > >> > architectures, such as 32-bit ARM, GCC will not be able to translate
> > >> > these operations into lock-free instructions and will instead rely on
> > >>
> > >> Here, and in the comment in meson.build, I think you mean "atomic"
> > >> rather than "lock-free" instructions? It's at least confusing, since
> > >> on x86 atomic instructions have a "lock" prefix.
> > >
> > > This uses the terminology used by the GCC documentation, see:
> > >
> > > https://gcc.gnu.org/wiki/Atomic/GCCMM
> > >
> > > I think the GCC terms merely mean that you don't need any explicit
> > > locking for these operations to be atomic.
> > >
> > > How about this instead:
> > >
> > > "... operations into atomic, lock-free instructions..."
> > >
> > > ?
> >
> > Ah, I see. Thanks, that works for me.
> > ___
> > 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 mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH RFC] radeonsi: Disable IEEE_MODE.

2018-03-05 Thread Eric Engestrom
On Saturday, 2018-03-03 18:35:02 -0500, Jan Vesely wrote:
> Neither GL nor CL nor SPIRV needs the IEEE handling of sNaNs.
> 
> Signed-off-by: Jan Vesely 
> ---
> This is the 3rd way to handle broken fmin/fmax in clover CL.
> It can be worked around in libclc (to not use
> llvm.fminnum/llvm.fmaxnum)[0]
> LLVM can be patched to not use IEEE_MODE[1]
> Or it can be fixed in the config reg in mesa.
> 
> The third option is arguably the worst (changes semantics of compiled
> code), but since the first two efforts have been stalled for months.
> Here's the third one.
> 
> Jan
> 
> [0] http://lists.llvm.org/pipermail/libclc-dev/2017-November/thread.html#2692
> [1] https://reviews.llvm.org/D40514
> 
> 
>  src/gallium/drivers/radeonsi/si_compute.c | 8 
>  src/gallium/drivers/radeonsi/si_shader.c  | 6 +-
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c 
> b/src/gallium/drivers/radeonsi/si_compute.c
> index 41927988cf..d0fcba485b 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -70,6 +70,10 @@ static void code_object_to_config(const amd_kernel_code_t 
> *code_object,
> struct si_shader_config *out_config) {
>  
>   uint32_t rsrc1 = code_object->compute_pgm_resource_registers;
> + /* Disable IEEE mode. IEEE_MODE determines sNaN handling by fmin/fmax
> +  * instructions. Nothing wants the IEEE rules here.
> +  * Ideally LLVM would not emit this configuration. */
> + rsrc1 &= C_00B848_IEEE_MODE;

I don't know anything about this code, but this bit op looks odd to me;
I would expect to see either:
rsrc1 &= ~C_00B848_IEEE_MODE;
or:
rsrc1 |= C_00B848_IEEE_MODE;

>   uint32_t rsrc2 = code_object->compute_pgm_resource_registers >> 32;
>   out_config->num_sgprs = code_object->wavefront_sgpr_count;
>   out_config->num_vgprs = code_object->workitem_vgpr_count;
> @@ -137,6 +141,10 @@ static void si_create_compute_state_async(void *job, int 
> thread_index)
>   S_00B848_SGPRS((shader->config.num_sgprs - 1) / 8) |
>   S_00B848_DX10_CLAMP(1) |
>   S_00B848_FLOAT_MODE(shader->config.float_mode);
> + /* Disable IEEE mode. IEEE_MODE determines sNaN handling by
> +  * fmin/fmax instructions. Nothing wants the IEEE rules.
> +  * Ideally LLVM would not emit this configuration. */
> + shader->config.rsrc1 &= C_00B848_IEEE_MODE;
>  
>   shader->config.rsrc2 =
>   S_00B84C_USER_SGPR(user_sgprs) |
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
> b/src/gallium/drivers/radeonsi/si_shader.c
> index 2a50b266f6..01bad71a4e 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -5178,7 +5178,11 @@ void si_shader_binary_read_config(struct 
> ac_shader_binary *binary,
>   conf->num_sgprs = MAX2(conf->num_sgprs, 
> (G_00B028_SGPRS(value) + 1) * 8);
>   conf->num_vgprs = MAX2(conf->num_vgprs, 
> (G_00B028_VGPRS(value) + 1) * 4);
>   conf->float_mode =  G_00B028_FLOAT_MODE(value);
> - conf->rsrc1 = value;
> + /* Disable IEEE mode. IEEE_MODE determines sNaN
> +  * handling by fmin/fmax instructions.
> +  * Nothing wants the IEEE rules here.
> +  * Ideally LLVM would not emit this configuration. */
> + conf->rsrc1 = value & C_00B848_IEEE_MODE;
>   break;
>   case R_00B02C_SPI_SHADER_PGM_RSRC2_PS:
>   conf->lds_size = MAX2(conf->lds_size, 
> G_00B02C_EXTRA_LDS_SIZE(value));
> -- 
> 2.14.3
> 
> ___
> 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] r600/egd_tables.py: make the script python 2+3 compatible

2018-03-02 Thread Eric Engestrom
On Friday, 2018-03-02 13:03:02 +, Stefan Dirsch wrote:
> On Fri, Mar 02, 2018 at 01:39:40PM +0100, Gustaw Smolarczyk wrote:
> > 2018-03-02 12:59 GMT+01:00 Stefan Dirsch <sndir...@suse.de>:
> > 
> > On Fri, Mar 02, 2018 at 11:47:57AM +, Eric Engestrom wrote:
> > > On Friday, 2018-03-02 12:25:11 +0100, Stefan Dirsch wrote:
> > > > On Fri, Mar 02, 2018 at 11:03:53AM +, Eric Engestrom wrote:
> > > > > On Friday, 2018-03-02 11:41:00 +0100, Stefan Dirsch wrote:
> > > > > > Patch by "Tomas Chvatal" <tchva...@suse.com> with modifications
> > > > > > by "Michal Srb" <m...@suse.com> to not break python 2.
> > > > > >
> > > > > > https://bugzilla.suse.com/show_bug.cgi?id=1082303
> > > > > >
> > > > > > v2:
> > > > > > - no longer try to encode a unicode
> > > > > > - make use of 'from __future__ import print_function', so 
> > semantics
> > > > > >   of print statements in python2 are closer to print functions 
> > in
> > python3
> > > > > >
> > > > > > https://lists.freedesktop.org/archives/mesa-dev/2018-February/
> > 187056.html
> > > > > >
> > > > > > Signed-off-by: Stefan Dirsch <sndir...@suse.de>
> > > > > > Reviewed-by: Tomas Chvatal <tchva...@suse.com>
> > > > > > ---
> > > > > >  src/gallium/drivers/r600/egd_tables.py | 53
> > +-
> > > > > >  1 file changed, 27 insertions(+), 26 deletions(-)
> > > > > >
> > > > > > diff --git a/src/gallium/drivers/r600/egd_tables.py 
> > b/src/gallium/
> > drivers/r600/egd_tables.py
> > > > > > index d7b78c7fb1..4796456330 100644
> > > > > > --- a/src/gallium/drivers/r600/egd_tables.py
> > > > > > +++ b/src/gallium/drivers/r600/egd_tables.py
> > > > > > @@ -1,3 +1,4 @@
> > > > > > +from __future__ import print_function
> > > > > >
> > > > > >  CopyRight = '''
> > > > > >  /*
> > > > > > @@ -60,7 +61,7 @@ class StringTable:
> > > > > >          """
> > > > > >          fragments = [
> > > > > >              '"%s\\0" /* %s */' % (
> > > > > > -                te[0].encode('string_escape'),
> > > > > > +                te[0],
> > 
> > 
> > Hi,
> > 
> > I am not an expert in Python 3, but I have found the following answer
> > experimentally.
> > 
> > I think the original version is semi-correct, but the encode() method 
> > returns a
> > bytes object which we need to convert to unicode. I think the following 
> > would
> > be fine:
> > 
> > te[0].encode('unicode_escape').decode('utf-8')
> 
> Looks good. And still the same output with python2 and python3. :-) If Dylan
> and Eric agree I'll send a revised patch.

Sure; you can add my:
Reviewed-by: Eric Engestrom <e...@engestrom.ch>

> 
> Thanks,
> Stefan
> 
> Public Key available
> --
> Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
> Tel: 0911-740 53 0Maxfeldstraße 5
> FAX: 0911-740 53 479  D-90409 Nürnberg
> http://www.suse.deGermany 
> ---
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
> Norton, HRB 21284 (AG Nürnberg)
> ---
> ___
> 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] Update the documentation for meson

2018-03-02 Thread Eric Engestrom
On Thursday, 2018-03-01 11:34:18 -0800, Dylan Baker wrote:
> Meson is pretty well tested and works in most configurations now, so we
> can remove the warning about it being unsuited for actual use.
> 
> It's also worth documenting that meson 0.42.0 or greater is required.
> 
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  docs/meson.html | 34 +-
>  1 file changed, 21 insertions(+), 13 deletions(-)
> 
> diff --git a/docs/meson.html b/docs/meson.html
> index 77f89b0c6c7..782cc198649 100644
> --- a/docs/meson.html
> +++ b/docs/meson.html
> @@ -18,11 +18,20 @@
>  
>  1. Basic Usage
>  
> -The Meson build system for Mesa is still under active development,
> -and should not be used in production environments.
> +The Meson build system is generally considered stable and ready
> +for production
>  
> -The meson build is currently only tested on linux, and is known to not 
> work
> -on macOS, Windows, and haiku. This will be fixed.
> +The meson build is currently known to work on Linux, macOS, Cygwin, Haiku,
> +FreeBSD, DragonflyBSD, and NetBSD, it is believed to work on OpenBSD.
> +
> +Mesa requires Meson >= 0.42.0 to build in general.
> +
> +Additionaly, to build the Clover OpenCL state tracker or the OpenSWR driver
> +meson 0.44.0 or greater is required.
> +
> +Some older versions of meson do not check that they are too old and will 
> error
> +out in odd ways.
> +
>  
>  
>  The meson program is used to configure the source directory and generates
> @@ -122,12 +131,11 @@ llvm-config, so using an LLVM from a non-standard path 
> is as easy as
>  PKG_CONFIG_PATH
>  The
>  pkg-config utility is a hard requirement for configuring and
> -building Mesa on Linux and *BSD. It is used to search for external libraries
> -on the system. This environment variable is used to control the search
> -path for pkg-config. For instance, setting
> -PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig will search for
> -package metadata in /usr/X11R6 before the standard
> -directories.
> +building Mesa on Unix-like systems. It is used to search for external 
> libraries
> +on the system. This environment variable is used to control the search path 
> for
> +pkg-config. For instance, setting
> +PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig will search for package
> +metadata in /usr/X11R6 before the standard directories.
>  
>  
>  
> @@ -151,9 +159,9 @@ may interfer with debbugging as some code and validation 
> will be optimized
>  away.
>  
>  
> - For those wishing to pass their own -O option, use the "plain" buildtype,
> -which cuases meson to inject no additional compiler arguments, only those in
> -the C/CXXFLAGS and those that mesa itself defines.
> + For those wishing to pass their own optimization flags, use the "plain"
> +buildtype, which causes meson to inject no additional compiler arguments, 
> only
> +those in the C/CXXFLAGS and those that mesa itself defines.
>  
>  
>  
> -- 
> 2.16.2
> 
> ___
> 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] egl: remove redundant initialization

2018-03-02 Thread Eric Engestrom
On Friday, 2018-03-02 13:28:28 +0200, Andres Gomez wrote:
> Found by inspection.
> 
> Cc: Ian Romanick <ian.d.roman...@intel.com>
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Cc: Eric Engestrom <eric.engest...@imgtec.com>
> Signed-off-by: Andres Gomez <ago...@igalia.com>
> ---
>  src/egl/main/eglcontext.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
> index 18c1bc59acc..3e5d8ad97bf 100644
> --- a/src/egl/main/eglcontext.c
> +++ b/src/egl/main/eglcontext.c
> @@ -594,7 +594,6 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, 
> _EGLConfig *conf,

For reviewers: the line removed is a duplicate of the line literally
just above the context being printed here.

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ctx->ClientMajorVersion = 1; /* the default, per EGL spec */
> ctx->ClientMinorVersion = 0;
> ctx->Flags = 0;
> -   ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
> ctx->ResetNotificationStrategy = EGL_NO_RESET_NOTIFICATION_KHR;
> ctx->ContextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
> ctx->ReleaseBehavior = EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR;
> -- 
> 2.15.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] r600/egd_tables.py: make the script python 2+3 compatible

2018-03-02 Thread Eric Engestrom
On Friday, 2018-03-02 12:25:11 +0100, Stefan Dirsch wrote:
> On Fri, Mar 02, 2018 at 11:03:53AM +0000, Eric Engestrom wrote:
> > On Friday, 2018-03-02 11:41:00 +0100, Stefan Dirsch wrote:
> > > Patch by "Tomas Chvatal" <tchva...@suse.com> with modifications
> > > by "Michal Srb" <m...@suse.com> to not break python 2.
> > > 
> > > https://bugzilla.suse.com/show_bug.cgi?id=1082303
> > > 
> > > v2:
> > > - no longer try to encode a unicode
> > > - make use of 'from __future__ import print_function', so semantics
> > >   of print statements in python2 are closer to print functions in python3
> > > 
> > > https://lists.freedesktop.org/archives/mesa-dev/2018-February/187056.html
> > > 
> > > Signed-off-by: Stefan Dirsch <sndir...@suse.de>
> > > Reviewed-by: Tomas Chvatal <tchva...@suse.com>
> > > ---
> > >  src/gallium/drivers/r600/egd_tables.py | 53 
> > > +-
> > >  1 file changed, 27 insertions(+), 26 deletions(-)
> > > 
> > > diff --git a/src/gallium/drivers/r600/egd_tables.py 
> > > b/src/gallium/drivers/r600/egd_tables.py
> > > index d7b78c7fb1..4796456330 100644
> > > --- a/src/gallium/drivers/r600/egd_tables.py
> > > +++ b/src/gallium/drivers/r600/egd_tables.py
> > > @@ -1,3 +1,4 @@
> > > +from __future__ import print_function
> > >  
> > >  CopyRight = '''
> > >  /*
> > > @@ -60,7 +61,7 @@ class StringTable:
> > >  """
> > >  fragments = [
> > >  '"%s\\0" /* %s */' % (
> > > -te[0].encode('string_escape'),
> > > +te[0],
> > 
> > I think you still need to escape the string here.
> 
> I don't know how to address this. :-( At least the output of
> 
>   python2 egd_tables.py evergreend.h
>   python3 egd_tables.py evergreend.h
> 
> is now identical. Surely this may change with changes in content of
> evergreend.h. :-( Ok. I've tried my best.

I think you should already land the print() changes, leaving this line
as is for now. Won't be valid python3 yet, but this will be the last
thing to fix, which someone else might pick up :)

With the string escape hunk left out, this patch is
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> > The rest of the patch looks good to me :)
> 
> Thanks,
> Stefan
> 
> Public Key available
> --
> Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
> Tel: 0911-740 53 0Maxfeldstraße 5
> FAX: 0911-740 53 479  D-90409 Nürnberg
> http://www.suse.deGermany 
> ---
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
> Norton, HRB 21284 (AG Nürnberg)
> ---
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] r600/egd_tables.py: make the script python 2+3 compatible

2018-03-02 Thread Eric Engestrom
On Friday, 2018-03-02 11:41:00 +0100, Stefan Dirsch wrote:
> Patch by "Tomas Chvatal"  with modifications
> by "Michal Srb"  to not break python 2.
> 
> https://bugzilla.suse.com/show_bug.cgi?id=1082303
> 
> v2:
> - no longer try to encode a unicode
> - make use of 'from __future__ import print_function', so semantics
>   of print statements in python2 are closer to print functions in python3
> 
> https://lists.freedesktop.org/archives/mesa-dev/2018-February/187056.html
> 
> Signed-off-by: Stefan Dirsch 
> Reviewed-by: Tomas Chvatal 
> ---
>  src/gallium/drivers/r600/egd_tables.py | 53 
> +-
>  1 file changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/egd_tables.py 
> b/src/gallium/drivers/r600/egd_tables.py
> index d7b78c7fb1..4796456330 100644
> --- a/src/gallium/drivers/r600/egd_tables.py
> +++ b/src/gallium/drivers/r600/egd_tables.py
> @@ -1,3 +1,4 @@
> +from __future__ import print_function
>  
>  CopyRight = '''
>  /*
> @@ -60,7 +61,7 @@ class StringTable:
>  """
>  fragments = [
>  '"%s\\0" /* %s */' % (
> -te[0].encode('string_escape'),
> +te[0],

I think you still need to escape the string here.

The rest of the patch looks good to me :)

>  ', '.join(str(idx) for idx in te[2])
>  )
>  for te in self.table
> @@ -217,10 +218,10 @@ def write_tables(regs, packets):
>  strings = StringTable()
>  strings_offsets = IntTable("int")
>  
> -print '/* This file is autogenerated by egd_tables.py from evergreend.h. 
> Do not edit directly. */'
> -print
> -print CopyRight.strip()
> -print '''
> +print('/* This file is autogenerated by egd_tables.py from evergreend.h. 
> Do not edit directly. */')
> +print('')
> +print(CopyRight.strip())
> +print('''
>  #ifndef EG_TABLES_H
>  #define EG_TABLES_H
>  
> @@ -242,20 +243,20 @@ struct eg_packet3 {
>  unsigned name_offset;
>  unsigned op;
>  };
> -'''
> +''')
>  
> -print 'static const struct eg_packet3 packet3_table[] = {'
> +print('static const struct eg_packet3 packet3_table[] = {')
>  for pkt in packets:
> -print '\t{%s, %s},' % (strings.add(pkt[5:]), pkt)
> -print '};'
> -print
> +print('\t{%s, %s},' % (strings.add(pkt[5:]), pkt))
> +print('};')
> +print('')
>  
> -print 'static const struct eg_field egd_fields_table[] = {'
> +print('static const struct eg_field egd_fields_table[] = {')
>  
>  fields_idx = 0
>  for reg in regs:
>  if len(reg.fields) and reg.own_fields:
> -print '\t/* %s */' % (fields_idx)
> +print('\t/* %s */' % (fields_idx))
>  
>  reg.fields_idx = fields_idx
>  
> @@ -266,34 +267,34 @@ struct eg_packet3 {
>  while value[1] >= len(values_offsets):
>  values_offsets.append(-1)
>  values_offsets[value[1]] = 
> strings.add(strip_prefix(value[0]))
> -print '\t{%s, %s(~0u), %s, %s},' % (
> +print('\t{%s, %s(~0u), %s, %s},' % (
>  strings.add(field.name), field.s_name,
> -len(values_offsets), 
> strings_offsets.add(values_offsets))
> +len(values_offsets), 
> strings_offsets.add(values_offsets)))
>  else:
> -print '\t{%s, %s(~0u)},' % (strings.add(field.name), 
> field.s_name)
> +print('\t{%s, %s(~0u)},' % (strings.add(field.name), 
> field.s_name))
>  fields_idx += 1
>  
> -print '};'
> -print
> +print('};')
> +print('')
>  
> -print 'static const struct eg_reg egd_reg_table[] = {'
> +print('static const struct eg_reg egd_reg_table[] = {')
>  for reg in regs:
>  if len(reg.fields):
> -print '\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
> -len(reg.fields), reg.fields_idx if reg.own_fields else 
> reg.fields_owner.fields_idx)
> +print('\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
> +len(reg.fields), reg.fields_idx if reg.own_fields else 
> reg.fields_owner.fields_idx))
>  else:
> -print '\t{%s, %s},' % (strings.add(reg.name), reg.r_name)
> -print '};'
> -print
> +print('\t{%s, %s},' % (strings.add(reg.name), reg.r_name))
> +print('};')
> +print('')
>  
>  strings.emit(sys.stdout, "egd_strings")
>  
> -print
> +print('')
>  
>  strings_offsets.emit(sys.stdout, "egd_strings_offsets")
>  
> -print
> -print '#endif'
> +print('')
> +print('#endif')
>  
>  
>  def main():
> -- 
> 2.13.6
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> 

Re: [Mesa-dev] [PATCH] loader: Add support for platform and host1x busses

2018-03-01 Thread Eric Engestrom


On March 1, 2018 1:31:53 PM UTC, Thierry Reding <thierry.red...@gmail.com> 
wrote:
> From: Thierry Reding <tred...@nvidia.com>
> 
> ARM SoCs usually have their DRM/KMS devices on the platform bus, so
> add
> support for this bus in order to allow use of the DRI_PRIME
> environment
> variable with those devices.
> 
> While at it, also support the host1x bus, which is effectively the
> same
> but uses an additional layer in the bus hierarchy.
> 
> Note that it isn't enough to support the bus that has the rendering
> GPU
> because the loader code will also try to construct an ID path tag for
> a
> scanout-only device if it is the default that is being opened.
> 
> The ID path tag for a device can be obtained by running udevadm info
> on
> the device node:
> 
>   $ udevadm info /dev/dri/card0
> 
> and looking up the ID_PATH_TAG entry in the output.
> 
> Signed-off-by: Thierry Reding <tred...@nvidia.com>
> ---
>  src/loader/loader.c | 27 +++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/src/loader/loader.c b/src/loader/loader.c
> index 92b4c5204b19..ca578b8cd232 100644
> --- a/src/loader/loader.c
> +++ b/src/loader/loader.c
> @@ -120,6 +120,33 @@ static char
> *drm_construct_id_path_tag(drmDevicePtr device)
> device->businfo.pci->func) < 0) {
>   return NULL;
>}
> +   } else if (device->bustype == DRM_BUS_PLATFORM ||
> +  device->bustype == DRM_BUS_HOST1X) {
> +  char *fullname, *name, *address;
> +
> +  if (device->bustype == DRM_BUS_PLATFORM)
> + fullname = device->businfo.platform->fullname;
> +  else
> + fullname = device->businfo.host1x->fullname;
> +
> +  name = strrchr(fullname, '/');
> +  if (!name)
> + name = strdup(fullname);
> +  else
> + name = strdup(++name);

Looks like UB to me; how about this instead?

  name = strdup(name + 1);

With that:
Reviewed-by: Eric Engestrom <e...@engestrom.ch>

> +
> +  address = strchr(name, '@');
> +  if (address) {
> + *address++ = '\0';
> +
> + if (asprintf(, "platform-%s_%s", address, name) < 0)
> +tag = NULL;
> +  } else {
> + if (asprintf(, "platform-%s", name) < 0)
> +tag = NULL;
> +  }
> +
> +  free(name);
> }
> return tag;
>  }
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: fix LLVM version detection when <= 3.4

2018-03-01 Thread Eric Engestrom


On February 28, 2018 8:30:14 PM UTC, Andres Gomez <ago...@igalia.com> wrote:
> On Wed, 2018-02-28 at 17:12 +0000, Eric Engestrom wrote:
> > On Wednesday, 2018-02-28 17:08:41 +, Eric Engestrom wrote:
> > > On Wednesday, 2018-02-28 17:02:50 +, Eric Engestrom wrote:
> > > > On Wednesday, 2018-02-28 17:52:05 +0200, Andres Gomez wrote:
> > > > > 3 digits versions in LLVM only started from 3.4.1 on. Hence,
> if you
> > > > > have installed 3.4 or below, meson will fail even when we may
> not make
> > > > > use of LLVM.
> > > > > 
> > > > > Cc: Dylan Baker <dy...@pnwbakers.com>
> > > > > Cc: Eric Engestrom <eric.engest...@imgtec.com>
> > > > > Signed-off-by: Andres Gomez <ago...@igalia.com>
> > > > > ---
> > > > >  meson.build | 13 -
> > > > >  1 file changed, 12 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/meson.build b/meson.build
> > > > > index 308f64cf811..b8c0b04893c 100644
> > > > > --- a/meson.build
> > > > > +++ b/meson.build
> > > > > @@ -1037,7 +1037,18 @@ if with_llvm
> > > > ># that for our version checks.
> > > > ># svn suffixes are stripped by meson as of 0.43, and git
> suffixes are
> > > > ># strippped as of 0.44, but we support older meson
> versions.
> > > > > -  _llvm_patch = _llvm_version[2]
> > > > > +
> > > > > +  # 3 digits versions in LLVM only started from 3.4.1 on
> > > > > +  if dep_llvm.version() <= '3.3'
> > > > 
> > > > The correct 'meson way' to compare version strings is
> > > >   if dep_llvm.version().version_compare('<= 3.3')
> > > > 
> > > > > +_llvm_patch = _llvm_version[1]
> > > > > +  elif dep_llvm.version() >= '3.5'
> > > > > +_llvm_patch = _llvm_version[2]
> > > > > +  elif dep_llvm.version().startswith('3.4.1') or
> dep_llvm.version().startswith('3.4.2')
> > > > > +_llvm_patch = _llvm_version[2]
> > > > > +  else
> > > > > +_llvm_patch = _llvm_version[1]
> > > > > +  endif
> > > > 
> > > > This whole logic seems overly complicated, and I don't think
> duplicating
> > > > the minor version as the patch version is the right thing
> either.
> 
> Ouch! Right, minor version should be 0 in those cases.
> 
> > > > How about this instead?
> > > > 
> > > >   if dep_llvm.version().version_compare('>= 3.4.1')
> > > > _llvm_patch = _llvm_version[2]
> > > >   else
> > > > _llvm_patch = '0'
> > > > endif
> > > 
> > > Actually, do we still support llvm < 3.4? Didn't we just bump the
> > > minimum to 4.0?
> > > I think we did, in which case this patch is not necessary at all
> :)
> > 
> > Correction: the minimum is 3.9, which is still >= 3.4, so NAK on
> this
> > patch, it would be dead code anyway :)
> 
> The purpose of this patch is not to provide support for older versions
> of LLVM but avoiding meson to fail when an older version is present in
> the system.
> 
> In other words, you can perfectly build with an old LLVM (< 3.4.1) in
> the system while not needing LLVM at all (auto). When passing through
> this detection code, meson will fail when accessing "_llvm_version[2]"
> due to:
> 
> "Index 2 out of bounds of array of size 2."

Oh, my apologies, I didn't think about that!
Can you add that paragraph in the commit message so it's clearer?
(I know there was already a mention of that, but I had not understood it the 
first time around)

> 
> You can see an example of this error at:
> https://travis-ci.org/Igalia/release-mesa/builds/347267445
> 
> 
> I'll send a new version following your snippet. Thanks! ☺

You can add my r-b on that patch :)

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


Re: [Mesa-dev] [PATCH 1/2] meson: fix LLVM version detection when <= 3.4

2018-02-28 Thread Eric Engestrom
On Wednesday, 2018-02-28 17:08:41 +, Eric Engestrom wrote:
> On Wednesday, 2018-02-28 17:02:50 +0000, Eric Engestrom wrote:
> > On Wednesday, 2018-02-28 17:52:05 +0200, Andres Gomez wrote:
> > > 3 digits versions in LLVM only started from 3.4.1 on. Hence, if you
> > > have installed 3.4 or below, meson will fail even when we may not make
> > > use of LLVM.
> > > 
> > > Cc: Dylan Baker <dy...@pnwbakers.com>
> > > Cc: Eric Engestrom <eric.engest...@imgtec.com>
> > > Signed-off-by: Andres Gomez <ago...@igalia.com>
> > > ---
> > >  meson.build | 13 -
> > >  1 file changed, 12 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 308f64cf811..b8c0b04893c 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -1037,7 +1037,18 @@ if with_llvm
> > ># that for our version checks.
> > ># svn suffixes are stripped by meson as of 0.43, and git suffixes are
> > ># strippped as of 0.44, but we support older meson versions.
> > > -  _llvm_patch = _llvm_version[2]
> > > +
> > > +  # 3 digits versions in LLVM only started from 3.4.1 on
> > > +  if dep_llvm.version() <= '3.3'
> > 
> > The correct 'meson way' to compare version strings is
> >   if dep_llvm.version().version_compare('<= 3.3')
> > 
> > > +_llvm_patch = _llvm_version[1]
> > > +  elif dep_llvm.version() >= '3.5'
> > > +_llvm_patch = _llvm_version[2]
> > > +  elif dep_llvm.version().startswith('3.4.1') or 
> > > dep_llvm.version().startswith('3.4.2')
> > > +_llvm_patch = _llvm_version[2]
> > > +  else
> > > +_llvm_patch = _llvm_version[1]
> > > +  endif
> > 
> > This whole logic seems overly complicated, and I don't think duplicating
> > the minor version as the patch version is the right thing either.
> > How about this instead?
> > 
> >   if dep_llvm.version().version_compare('>= 3.4.1')
> > _llvm_patch = _llvm_version[2]
> >   else
> > _llvm_patch = '0'
> > endif
> 
> Actually, do we still support llvm < 3.4? Didn't we just bump the
> minimum to 4.0?
> I think we did, in which case this patch is not necessary at all :)

Correction: the minimum is 3.9, which is still >= 3.4, so NAK on this
patch, it would be dead code anyway :)

> 
> > 
> > > +
> > >if _llvm_patch.endswith('svn')
> > >  _llvm_patch = _llvm_patch.split('s')[0]
> > >elif _llvm_patch.contains('git')
> > > -- 
> > > 2.15.1
> > > 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: fix LLVM version detection when <= 3.4

2018-02-28 Thread Eric Engestrom
On Wednesday, 2018-02-28 17:02:50 +, Eric Engestrom wrote:
> On Wednesday, 2018-02-28 17:52:05 +0200, Andres Gomez wrote:
> > 3 digits versions in LLVM only started from 3.4.1 on. Hence, if you
> > have installed 3.4 or below, meson will fail even when we may not make
> > use of LLVM.
> > 
> > Cc: Dylan Baker <dy...@pnwbakers.com>
> > Cc: Eric Engestrom <eric.engest...@imgtec.com>
> > Signed-off-by: Andres Gomez <ago...@igalia.com>
> > ---
> >  meson.build | 13 -
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 308f64cf811..b8c0b04893c 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -1037,7 +1037,18 @@ if with_llvm
> ># that for our version checks.
> ># svn suffixes are stripped by meson as of 0.43, and git suffixes are
> ># strippped as of 0.44, but we support older meson versions.
> > -  _llvm_patch = _llvm_version[2]
> > +
> > +  # 3 digits versions in LLVM only started from 3.4.1 on
> > +  if dep_llvm.version() <= '3.3'
> 
> The correct 'meson way' to compare version strings is
>   if dep_llvm.version().version_compare('<= 3.3')
> 
> > +_llvm_patch = _llvm_version[1]
> > +  elif dep_llvm.version() >= '3.5'
> > +_llvm_patch = _llvm_version[2]
> > +  elif dep_llvm.version().startswith('3.4.1') or 
> > dep_llvm.version().startswith('3.4.2')
> > +_llvm_patch = _llvm_version[2]
> > +  else
> > +_llvm_patch = _llvm_version[1]
> > +  endif
> 
> This whole logic seems overly complicated, and I don't think duplicating
> the minor version as the patch version is the right thing either.
> How about this instead?
> 
>   if dep_llvm.version().version_compare('>= 3.4.1')
> _llvm_patch = _llvm_version[2]
>   else
> _llvm_patch = '0'
>   endif

Actually, do we still support llvm < 3.4? Didn't we just bump the
minimum to 4.0?
I think we did, in which case this patch is not necessary at all :)

> 
> > +
> >if _llvm_patch.endswith('svn')
> >  _llvm_patch = _llvm_patch.split('s')[0]
> >elif _llvm_patch.contains('git')
> > -- 
> > 2.15.1
> > 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: fix LLVM version detection when <= 3.4

2018-02-28 Thread Eric Engestrom
On Wednesday, 2018-02-28 17:52:05 +0200, Andres Gomez wrote:
> 3 digits versions in LLVM only started from 3.4.1 on. Hence, if you
> have installed 3.4 or below, meson will fail even when we may not make
> use of LLVM.
> 
> Cc: Dylan Baker <dy...@pnwbakers.com>
> Cc: Eric Engestrom <eric.engest...@imgtec.com>
> Signed-off-by: Andres Gomez <ago...@igalia.com>
> ---
>  meson.build | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 308f64cf811..b8c0b04893c 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1037,7 +1037,18 @@ if with_llvm
># that for our version checks.
># svn suffixes are stripped by meson as of 0.43, and git suffixes are
># strippped as of 0.44, but we support older meson versions.
> -  _llvm_patch = _llvm_version[2]
> +
> +  # 3 digits versions in LLVM only started from 3.4.1 on
> +  if dep_llvm.version() <= '3.3'

The correct 'meson way' to compare version strings is
  if dep_llvm.version().version_compare('<= 3.3')

> +_llvm_patch = _llvm_version[1]
> +  elif dep_llvm.version() >= '3.5'
> +_llvm_patch = _llvm_version[2]
> +  elif dep_llvm.version().startswith('3.4.1') or 
> dep_llvm.version().startswith('3.4.2')
> +_llvm_patch = _llvm_version[2]
> +  else
> +_llvm_patch = _llvm_version[1]
> +  endif

This whole logic seems overly complicated, and I don't think duplicating
the minor version as the patch version is the right thing either.
How about this instead?

  if dep_llvm.version().version_compare('>= 3.4.1')
_llvm_patch = _llvm_version[2]
  else
_llvm_patch = '0'
endif

> +
>if _llvm_patch.endswith('svn')
>  _llvm_patch = _llvm_patch.split('s')[0]
>elif _llvm_patch.contains('git')
> -- 
> 2.15.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] travis: make Meson find the proper llvm-config

2018-02-28 Thread Eric Engestrom
On Wednesday, 2018-02-28 17:52:06 +0200, Andres Gomez wrote:
> Travis CI has moved to LLVM 5.0, and meson is detecting automatically
> the available version in /usr/local/bin based on the PATH env variable
> order preference.
> 
> As for 0.44.x, Meson cannot receive the path to the llvm-config binary
> as a configuration parameter. See
> https://github.com/mesonbuild/meson/issues/2887 and
> https://github.com/dcbaker/meson/commit/7c8b6ee3fa42f43c9ac7dcacc61a77eca3f1bcef
> 
> We want to use the custom (APT) installed version. Therefore, let's
> make Meson find our wanted version sooner than the one at
> /usr/local/bin
> 
> Once this is corrected, we would still need a patch similar to:
> https://lists.freedesktop.org/archives/mesa-dev/2017-December/180217.html
> 
> Cc: Eric Engestrom <eric.engest...@imgtec.com>

Reviewed-and-Tested-by: Eric Engestrom <eric.engest...@imgtec.com>

> Cc: Dylan Baker <dy...@pnwbakers.com>
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Cc: Juan A. Suarez Romero <jasua...@igalia.com>
> Cc: Gert Wollny <gw.foss...@gmail.com>
> Cc: Jon Turney <jon.tur...@dronecode.org.uk>
> Signed-off-by: Andres Gomez <ago...@igalia.com>
> ---
>  .travis.yml | 28 
>  1 file changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 0ec08e5bff7..5081bfc5d28 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -573,8 +573,28 @@ script:
>scons $SCONS_TARGET && eval $SCONS_CHECK_COMMAND;
>  fi
>  
> -  - if test "x$BUILD" = xmeson; then
> -  export CFLAGS="$CFLAGS -isystem`pwd`";
> -  meson _build $MESON_OPTIONS;
> -  ninja -C _build;
> +  - |
> +if test "x$BUILD" = xmeson; then
> +
> +  # Travis CI has moved to LLVM 5.0, and meson is detecting
> +  # automatically the available version in /usr/local/bin based on
> +  # the PATH env variable order preference.
> +  #
> +  # As for 0.44.x, Meson cannot receive the path to the
> +  # llvm-config binary as a configuration parameter. See
> +  # https://github.com/mesonbuild/meson/issues/2887 and
> +  # 
> https://github.com/dcbaker/meson/commit/7c8b6ee3fa42f43c9ac7dcacc61a77eca3f1bcef
> +  #
> +  # We want to use the custom (APT) installed version. Therefore,
> +  # let's make Meson find our wanted version sooner than the one
> +  # at /usr/local/bin
> +  #
> +  # Once this is corrected, we would still need a patch similar
> +  # to:
> +  # 
> https://lists.freedesktop.org/archives/mesa-dev/2017-December/180217.html
> +  test -f /usr/bin/llvm-config && ln -s /usr/bin/llvm-config 
> $HOME/prefix/bin
> +
> +  export CFLAGS="$CFLAGS -isystem`pwd`"
> +  meson _build $MESON_OPTIONS
> +  ninja -C _build
>  fi
> -- 
> 2.15.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 1/2] meson: Add default DRI drivers for ARM/AArch64

2018-02-28 Thread Eric Engestrom
On Wednesday, 2018-02-28 09:36:51 +, Daniel Stone wrote:
> Hi,
> 
> On 28 February 2018 at 09:33, Eric Engestrom <eric.engest...@imgtec.com> 
> wrote:
> > On Tuesday, 2018-02-27 18:01:11 +, Daniel Stone wrote:
> >> On all Arm architectures (ARMv7 and below as 'arm', ARMv8 and above as
> >> 'aarch64'), only build swrast for DRI drivers.
> >
> > The commit message and the code don't align anymore in v2; which one was
> > intended?
> 
> The code was intended. At the moment I'm waiting for Dylan to send out
> a fix so you can have a build without X11, without classic DRI
> drivers, but with Gallium DRI drivers and with EGL. When that's out
> I'll trivially rebase this on top, but until then it won't actually
> work (and needs a fixup for Vulkan drivers to be more useful).

Alright then, with the commit message amended:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

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


Re: [Mesa-dev] [PATCH] radeonsi: fix radeon create encoder return

2018-02-28 Thread Eric Engestrom
On Tuesday, 2018-02-27 17:43:56 -0500, boyuan.zh...@amd.com wrote:
> From: Boyuan Zhang <boyuan.zh...@amd.com>
> 
> Previous patch missed a "return" when trying to modify the create encoder
> function, which made the whole logic fail. Therefore, add the return back.
> 
> Signed-off-by: Boyuan Zhang <boyuan.zh...@amd.com>

Fixes: b38b208ff8886e799d6a2 "radeonsi:create uvd hevc enc entry"
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/gallium/drivers/radeonsi/si_uvd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_uvd.c 
> b/src/gallium/drivers/radeonsi/si_uvd.c
> index 3906bbd..b6cb4cb 100644
> --- a/src/gallium/drivers/radeonsi/si_uvd.c
> +++ b/src/gallium/drivers/radeonsi/si_uvd.c
> @@ -150,7 +150,7 @@ struct pipe_video_codec *si_uvd_create_decoder(struct 
> pipe_context *context,
>  
>   if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
>   if (vcn) {
> - radeon_create_encoder(context, templ, ctx->b.ws, 
> si_vce_get_buffer);
> + return radeon_create_encoder(context, templ, ctx->b.ws, 
> si_vce_get_buffer);
>   } else {
>   if (u_reduce_video_profile(templ->profile) == 
> PIPE_VIDEO_FORMAT_HEVC)
>   return radeon_uvd_create_encoder(context, 
> templ, ctx->b.ws, si_vce_get_buffer);
> -- 
> 2.7.4
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 1/2] meson: Add default DRI drivers for ARM/AArch64

2018-02-28 Thread Eric Engestrom
On Tuesday, 2018-02-27 18:01:11 +, Daniel Stone wrote:
> On all Arm architectures (ARMv7 and below as 'arm', ARMv8 and above as
> 'aarch64'), only build swrast for DRI drivers.

The commit message and the code don't align anymore in v2; which one was
intended?

> The only classic drivers
> which could be used are r200 and NV20 cards, which seems unlikely enough
> that it shouldn't be the default.
> 
> Signed-off-by: Daniel Stone 
> Reported-by: Javier Jardón 
> Cc: Dylan Baker 
> ---
>  meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 6f2615f9d17..c349e9e5f85 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -100,6 +100,8 @@ if _drivers == 'auto'
>  # TODO: PPC, Sparc
>  if ['x86', 'x86_64'].contains(host_machine.cpu_family())
>_drivers = 'i915,i965,r100,r200,nouveau'
> +elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
> +  _drivers = ''
>  else
>error('Unknown architecture. Please pass -Ddri-drivers to set driver 
> options. Patches gladly accepted to fix this.')
>  endif
> -- 
> 2.14.3
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC PATCH mesa 5/5] WIP - meson: add a message block at the end of the configuration stage

2018-02-27 Thread Eric Engestrom
On Friday, 2018-02-23 16:49:14 -0800, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-02-23 10:08:48)
> > The messages are basically the same as the ones in configure.ac
> > 
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> > Sent out because it's as much as I could do before the weekend, and
> > before I try to figure out the last bits I'd love some confirmation that
> > this is what we want :)
> > ---
> >  meson.build | 128 
> > 
> >  src/gallium/meson.build |  13 +
> >  2 files changed, 141 insertions(+)
> > 
> > diff --git a/meson.build b/meson.build
> > index 770fdc7e50653bcfa7c2..0c84d09c02322ed7a80b 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -1263,3 +1263,131 @@ env_test.set('NM', find_program('nm').path())
> >  subdir('include')
> >  subdir('bin')
> >  subdir('src')
> > +
> > +
> > +#
> > +# Output some configuration info for the user
> > +#
> > +message('')
> > +message('prefix:  ' + get_option('prefix'))
> > +message('libdir:  ' + join_paths(get_option('prefix'), 
> > get_option('libdir')))
> > +message('includedir:  ' + join_paths(get_option('prefix'), 
> > get_option('includedir')))
> 
> I'd really like to avoid having millions of message() calls, what about:
> messsage('''
> 
> prefix: @0@
> libdir: @1@
> includedir: @2@
> 
> ...
> 
> '''.format(
>  ...
> ))

I'll group where possible, but there's a lot of logic that can't be
cleanly put into .format()

I'll apply all your other comments and send the actual patches when I'm
done; thanks for the feedback :)

> 
> Dylan
> 
> > +
> > +# API info
> > +message('')
> > +message('OpenGL:  @0@ (ES1: @1@ ES2: 
> > @2@)'.format(with_opengl, with_gles1, with_gles2))
> > +
> > +# Driver info
> > +message('')
> > +if with_osmesa == 'gallium'
> > +  message('OSMesa:  lib@0@ 
> > (Gallium)'.format(osmesa_lib_name))
> > +elif with_osmesa == 'classic'
> > +  message('OSMesa:  lib@0@'.format(osmesa_lib_name))
> > +elif with_osmesa == 'none'
> > +  message('OSMesa:  no')
> > +endif
> > +
> > +message('')
> > +if with_dri
> > +  message('DRI platform:' + with_dri_platform)
> > +  if false #DRI_DIRS
> > +message('DRI drivers: no')
> > +  else
> > +message('DRI drivers: ' + _dri_drivers)
> > +  endif
> > +  message('DRI driver dir:  ' + join_paths(get_option('prefix'), 
> > dri_drivers_path))
> > +endif
> > +
> > +if with_glx == 'dri'
> > +message('GLX: DRI-based')
> > +elif with_glx == 'xlib'
> > +message('GLX: Xlib-based')
> > +elif with_glx == 'gallium-xlib'
> > +message('GLX: Xlib-based (Gallium)')
> > +else
> > +message('GLX: @0@'.format(with_glx))
> > +endif
> > +
> > +# EGL
> > +message('')
> > +message('EGL: @0@'.format(with_egl))
> > +if with_egl
> > +  #message('EGL drivers: @0@ @1@'.format(
> > +#with_dri  ? 'builtin:egl_dri2' : '',
> > +#with_dri3 ? 'builtin:egl_dri3' : ''))
> > +endif
> > +message('GBM: @0@'.format(with_gbm))
> > +
> > +message('EGL/Vulkan/VL platforms:   @0@'.format(_platforms))
> > +
> > +# Vulkan
> > +message('')
> > +if with_any_vk
> > +  message('Vulkan drivers:  ' + _vulkan_drivers)
> > +  message('Vulkan ICD dir:  ' + join_paths(get_option('prefix'), 
> > with_vulkan_icd_dir))
> > +else
> > +  message('Vulkan drivers:  no')
> > +endif
> > +
> > +message('')
> > +if with_llvm
> > +  message('llvm:yes')
> > +# message('llvm-config: ' + _llvm_config) #TODO
> > +  message('llvm-version:' + '.'.join(_llvm_version))
> > +else
> > +  message('llvm:no')
> > +endif
> > +
> > +message('')
> > +if with_gallium
> > +  message('Gallium drivers: ' + _gallium_drivers)
> > +  message('Gallium st:  ' + ','.join(with_st))
> > +else
> > +  message('Gallium: no')
> > +endif
&

Re: [Mesa-dev] [PATCH] meson: Add default DRI drivers for ARM/AArch64

2018-02-27 Thread Eric Engestrom
On Tuesday, 2018-02-27 10:08:29 +, Daniel Stone wrote:
> On all Arm architectures (ARMv7 and below as 'arm', ARMv8 and above as
> 'aarch64'), only build swrast for DRI drivers. The only classic drivers
> which could be used are r200 and NV20 cards, which seems unlikely enough
> that it shouldn't be the default.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> Reported-by: Javier Jardón <jjar...@gnome.org>
> Cc: Dylan Baker <dy...@pnwbakers.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 6f2615f9d17..96c4e663baf 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -100,6 +100,8 @@ if _drivers == 'auto'
>  # TODO: PPC, Sparc
>  if ['x86', 'x86_64'].contains(host_machine.cpu_family())
>_drivers = 'i915,i965,r100,r200,nouveau'
> +elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
> +  _drivers = 'swrast'
>  else
>error('Unknown architecture. Please pass -Ddri-drivers to set driver 
> options. Patches gladly accepted to fix this.')
>  endif
> -- 
> 2.14.3
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix building without GL

2018-02-26 Thread Eric Engestrom
On Monday, 2018-02-26 16:56:46 +, Eric Engestrom wrote:
> On Monday, 2018-02-26 08:46:54 -0800, Dylan Baker wrote:
> > libgl will be undefined if with_glx == 'disabled', so move that check
> > inside the `if with_glx == 'disabled'` block immediately after that
> typo: s/==/!=/^^
> 
> Acked-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> > check.

actually, that sentence looks off; I suggest dropping the words after "block" :)

> > 
> > Fixes: 5c460337fd9c109 ("meson: Fix GL and EGL pkg-config files with glvnd")
> > Reported-by: Jason Ekstrand <jason.ekstr...@intel.com>
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > CC: Daniel Stone <dani...@collabora.com>
> > CC: Jason Ekstrand <jason.ekstr...@intel.com>
> > ---
> >  src/meson.build | 19 ++-
> >  1 file changed, 10 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/meson.build b/src/meson.build
> > index b2c045fce10..19005271d73 100644
> > --- a/src/meson.build
> > +++ b/src/meson.build
> > @@ -82,18 +82,19 @@ if with_gallium
> >subdir('gallium')
> >  endif
> >  
> > -# If using glvnd the pkg-config header should not point to GL_mesa, it 
> > should
> > -# point to GL. glvnd is only available on unix like platforms so adding -l
> > -# should be safe here
> > -# TODO: in the glvnd case glvnd itself should really be providing this.
> > -if with_glvnd
> > -  _gl = '-L${libdir} -lGL'
> > -else
> > -  _gl = libgl
> > -endif
> >  # This must be after at least mesa, glx, and gallium, since libgl will be
> >  # defined in one of those subdirs depending on the glx provider.
> >  if with_glx != 'disabled'
> > +  # If using glvnd the pkg-config header should not point to GL_mesa, it 
> > should
> > +  # point to GL. glvnd is only available on unix like platforms so adding 
> > -l
> > +  # should be safe here
> > +  # TODO: in the glvnd case glvnd itself should really be providing this.
> > +  if with_glvnd
> > +_gl = '-L${libdir} -lGL'
> > +  else
> > +_gl = libgl
> > +  endif
> > +
> >pkg.generate(
> >  name : 'gl',
> >  description : 'Mesa OpenGL Library',
> > -- 
> > 2.16.2
> > 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix building without GL

2018-02-26 Thread Eric Engestrom
On Monday, 2018-02-26 08:46:54 -0800, Dylan Baker wrote:
> libgl will be undefined if with_glx == 'disabled', so move that check
> inside the `if with_glx == 'disabled'` block immediately after that
typo: s/==/!=/^^

Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

> check.
> 
> Fixes: 5c460337fd9c109 ("meson: Fix GL and EGL pkg-config files with glvnd")
> Reported-by: Jason Ekstrand <jason.ekstr...@intel.com>
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> CC: Daniel Stone <dani...@collabora.com>
> CC: Jason Ekstrand <jason.ekstr...@intel.com>
> ---
>  src/meson.build | 19 ++-
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/src/meson.build b/src/meson.build
> index b2c045fce10..19005271d73 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -82,18 +82,19 @@ if with_gallium
>subdir('gallium')
>  endif
>  
> -# If using glvnd the pkg-config header should not point to GL_mesa, it should
> -# point to GL. glvnd is only available on unix like platforms so adding -l
> -# should be safe here
> -# TODO: in the glvnd case glvnd itself should really be providing this.
> -if with_glvnd
> -  _gl = '-L${libdir} -lGL'
> -else
> -  _gl = libgl
> -endif
>  # This must be after at least mesa, glx, and gallium, since libgl will be
>  # defined in one of those subdirs depending on the glx provider.
>  if with_glx != 'disabled'
> +  # If using glvnd the pkg-config header should not point to GL_mesa, it 
> should
> +  # point to GL. glvnd is only available on unix like platforms so adding -l
> +  # should be safe here
> +  # TODO: in the glvnd case glvnd itself should really be providing this.
> +  if with_glvnd
> +_gl = '-L${libdir} -lGL'
> +  else
> +_gl = libgl
> +  endif
> +
>pkg.generate(
>  name : 'gl',
>  description : 'Mesa OpenGL Library',
> -- 
> 2.16.2
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] swr/rast: Fix macOS macro.

2018-02-26 Thread Eric Engestrom
On Saturday, 2018-02-24 23:55:21 +, Vinson Lee wrote:
> Fixes: a25093de7188 ("swr/rast: Implement JIT shader caching to disk")
> Signed-off-by: Vinson Lee <v...@freedesktop.org>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp 
> b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
> index ab7c6eb15b09..0cefa43529fc 100644
> --- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
> @@ -47,7 +47,7 @@
>  #define JITTER_OUTPUT_DIR SWR_OUTPUT_DIR "\\Jitter"
>  #endif // _WIN32
>  
> -#if defined(__APPLE) || defined(FORCE_LINUX) || defined(__linux__) || 
> defined(__gnu_linux__)
> +#if defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || 
> defined(__gnu_linux__)
>  #include 
>  #include 
>  #endif
> @@ -532,7 +532,7 @@ static inline uint32_t ComputeModuleCRC(const 
> llvm::Module* M)
>  /// constructor
>  JitCache::JitCache()
>  {
> -#if defined(__APPLE) || defined(FORCE_LINUX) || defined(__linux__) || 
> defined(__gnu_linux__)
> +#if defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || 
> defined(__gnu_linux__)
>  if (strncmp(KNOB_JIT_CACHE_DIR.c_str(), "~/", 2) == 0) {
>  char *homedir;
>  if (!(homedir = getenv("HOME"))) {
> -- 
> 2.16.2
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Killing broken configure toggles and fixing autotools gl.pc

2018-02-26 Thread Eric Engestrom
On Friday, 2018-02-23 19:31:59 +, Emil Velikov wrote:
> Hi all,
> 
> While fixing a gl.pc + glvnd bug (well sort of), I noticed the 
> following:
> 
> With GLVND, we started abusing GL_LIB a lot more. Currently autotools 
> can do a) custom libGL name, b) mangled GL and 
> c) GLVND.
> 
> Turns out that a + b was broken, since b was introduced. There is very 
> limited reason why a would exist and since it's broken I'm just nuking 
> it.
> 
> OSMesa was in the same a/b shape so it gets the same axe.
> 
> Note: now configure will error out if anyone explicitly touches the 
> toggles.
> Note: the whole series should be applicable for stable - I will check 
> the exact commits/branches and annotate accordingly
> 
> WARNINING: The series isn't even build tested, but I'm sending it out 
> for feedback since the topic be a bit ...
> 
> Any feedback, even a general ACK will be appreciated.
> Emil
> 
> Cc: Brian Paul <bri...@vmware.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>
> 

3 & 4 are:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

and the rest of the series is:
Acked-by: Eric Engestrom <eric.engest...@imgtec.com>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] vulkan/wsi: clean up cleanup path

2018-02-26 Thread Eric Engestrom
Cc: Keith Packard <kei...@keithp.com>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
This will make Keith's addition much cleaner as well :)
---
 src/vulkan/wsi/wsi_common.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index edba13a13de1a9493ecb..fe262b4968d3e45fa538 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -82,20 +82,20 @@ wsi_device_init(struct wsi_device *wsi,
 #ifdef VK_USE_PLATFORM_XCB_KHR
result = wsi_x11_init_wsi(wsi, alloc);
if (result != VK_SUCCESS)
-  return result;
+  goto fail;
 #endif
 
 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
result = wsi_wl_init_wsi(wsi, alloc, pdevice);
-   if (result != VK_SUCCESS) {
-#ifdef VK_USE_PLATFORM_XCB_KHR
-  wsi_x11_finish_wsi(wsi, alloc);
-#endif
-  return result;
-   }
+   if (result != VK_SUCCESS)
+  goto fail;
 #endif
 
return VK_SUCCESS;
+
+fail:
+   wsi_device_finish(wsi, alloc);
+   return result;
 }
 
 void
-- 
Cheers,
  Eric

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


[Mesa-dev] [RFC PATCH mesa 3/5] meson: avoid changing types for the dri3 option

2018-02-23 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 28d068742ff914a623f6..6c22601f9e8864f08e08 100644
--- a/meson.build
+++ b/meson.build
@@ -380,11 +380,11 @@ if with_vulkan_icd_dir == ''
 endif
 
 with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
-with_dri3 = get_option('dri3')
-if with_dri3 == 'auto'
+_dri3 = get_option('dri3')
+if _dri3 == 'auto'
   with_dri3 = system_has_kms_drm and with_dri2
 else
-  with_dri3 = with_dri3 == 'true'
+  with_dri3 = _dri3 == 'true'
 endif
 
 if with_any_vk and (with_platform_x11 and not with_dri3)
-- 
Cheers,
  Eric

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


[Mesa-dev] [RFC PATCH mesa 1/5] meson: give different names to the vars containing dri drivers vs gallium drivers

2018-02-23 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/meson.build b/meson.build
index e470e62074da9a46767c..2d474b140373292e49e7 100644
--- a/meson.build
+++ b/meson.build
@@ -108,24 +108,24 @@ with_dri_r100 = false
 with_dri_r200 = false
 with_dri_nouveau = false
 with_dri_swrast = false
-_drivers = get_option('dri-drivers')
-if _drivers == 'auto'
+_dri_drivers = get_option('dri-drivers')
+if _dri_drivers == 'auto'
   if host_machine.system() == 'linux'
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'i915,i965,r100,r200,nouveau'
+  _dri_drivers = 'i915,i965,r100,r200,nouveau'
 else
   error('Unknown architecture. Please pass -Ddri-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
   elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system())
 # only swrast would make sense here, but gallium swrast is a much better 
default
-_drivers = ''
+_dri_drivers = ''
   else
 error('Unknown OS. Please pass -Ddri-drivers to set driver options. 
Patches gladly accepted to fix this.')
   endif
 endif
-if _drivers != ''
-  _split = _drivers.split(',')
+if _dri_drivers != ''
+  _split = _dri_drivers.split(',')
   with_dri_i915 = _split.contains('i915')
   with_dri_i965 = _split.contains('i965')
   with_dri_r100 = _split.contains('r100')
@@ -151,25 +151,25 @@ with_gallium_i915 = false
 with_gallium_svga = false
 with_gallium_virgl = false
 with_gallium_swr = false
-_drivers = get_option('gallium-drivers')
-if _drivers == 'auto'
+_gallium_drivers = get_option('gallium-drivers')
+if _gallium_drivers == 'auto'
   if host_machine.system() == 'linux'
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
+  _gallium_drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,virgl,svga,swrast'
+  _gallium_drivers = 
'pl111,vc4,vc5,freedreno,etnaviv,imx,virgl,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
   elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system())
-_drivers = 'swrast'
+_gallium_drivers = 'swrast'
   else
 error('Unknown OS. Please pass -Dgallium-drivers to set driver options. 
Patches gladly accepted to fix this.')
   endif
 endif
-if _drivers != ''
-  _split = _drivers.split(',')
+if _gallium_drivers != ''
+  _split = _gallium_drivers.split(',')
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
   with_gallium_r300 = _split.contains('r300')
-- 
Cheers,
  Eric

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


[Mesa-dev] [RFC PATCH mesa 4/5] meson: store the result of whether we have gallium-extra-hud and lmsensors

2018-02-23 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 4 
 1 file changed, 4 insertions(+)

diff --git a/meson.build b/meson.build
index 6c22601f9e8864f08e08..770fdc7e50653bcfa7c2 100644
--- a/meson.build
+++ b/meson.build
@@ -1187,15 +1187,19 @@ if with_platform_x11
   endif
 endif
 
+with_gallium_extra_hud = false
 if get_option('gallium-extra-hud')
   pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1'
+  with_gallium_extra_hud = true
 endif
 
 _sensors = get_option('lmsensors')
+with_lmsensors = false
 if _sensors != 'false'
   dep_lmsensors = cc.find_library('libsensors', required : _sensors == 'true')
   if dep_lmsensors.found()
 pre_args += '-DHAVE_LIBSENSORS=1'
+with_lmsensors = true
   endif
 else
   dep_lmsensors = []
-- 
Cheers,
  Eric

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


[Mesa-dev] [RFC PATCH mesa 5/5] WIP - meson: add a message block at the end of the configuration stage

2018-02-23 Thread Eric Engestrom
The messages are basically the same as the ones in configure.ac

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
Sent out because it's as much as I could do before the weekend, and
before I try to figure out the last bits I'd love some confirmation that
this is what we want :)
---
 meson.build | 128 
 src/gallium/meson.build |  13 +
 2 files changed, 141 insertions(+)

diff --git a/meson.build b/meson.build
index 770fdc7e50653bcfa7c2..0c84d09c02322ed7a80b 100644
--- a/meson.build
+++ b/meson.build
@@ -1263,3 +1263,131 @@ env_test.set('NM', find_program('nm').path())
 subdir('include')
 subdir('bin')
 subdir('src')
+
+
+#
+# Output some configuration info for the user
+#
+message('')
+message('prefix:  ' + get_option('prefix'))
+message('libdir:  ' + join_paths(get_option('prefix'), 
get_option('libdir')))
+message('includedir:  ' + join_paths(get_option('prefix'), 
get_option('includedir')))
+
+# API info
+message('')
+message('OpenGL:  @0@ (ES1: @1@ ES2: @2@)'.format(with_opengl, 
with_gles1, with_gles2))
+
+# Driver info
+message('')
+if with_osmesa == 'gallium'
+  message('OSMesa:  lib@0@ (Gallium)'.format(osmesa_lib_name))
+elif with_osmesa == 'classic'
+  message('OSMesa:  lib@0@'.format(osmesa_lib_name))
+elif with_osmesa == 'none'
+  message('OSMesa:  no')
+endif
+
+message('')
+if with_dri
+  message('DRI platform:' + with_dri_platform)
+  if false #DRI_DIRS
+message('DRI drivers: no')
+  else
+message('DRI drivers: ' + _dri_drivers)
+  endif
+  message('DRI driver dir:  ' + join_paths(get_option('prefix'), 
dri_drivers_path))
+endif
+
+if with_glx == 'dri'
+message('GLX: DRI-based')
+elif with_glx == 'xlib'
+message('GLX: Xlib-based')
+elif with_glx == 'gallium-xlib'
+message('GLX: Xlib-based (Gallium)')
+else
+message('GLX: @0@'.format(with_glx))
+endif
+
+# EGL
+message('')
+message('EGL: @0@'.format(with_egl))
+if with_egl
+  #message('EGL drivers: @0@ @1@'.format(
+#with_dri  ? 'builtin:egl_dri2' : '',
+#with_dri3 ? 'builtin:egl_dri3' : ''))
+endif
+message('GBM: @0@'.format(with_gbm))
+
+message('EGL/Vulkan/VL platforms:   @0@'.format(_platforms))
+
+# Vulkan
+message('')
+if with_any_vk
+  message('Vulkan drivers:  ' + _vulkan_drivers)
+  message('Vulkan ICD dir:  ' + join_paths(get_option('prefix'), 
with_vulkan_icd_dir))
+else
+  message('Vulkan drivers:  no')
+endif
+
+message('')
+if with_llvm
+  message('llvm:yes')
+# message('llvm-config: ' + _llvm_config) #TODO
+  message('llvm-version:' + '.'.join(_llvm_version))
+else
+  message('llvm:no')
+endif
+
+message('')
+if with_gallium
+  message('Gallium drivers: ' + _gallium_drivers)
+  message('Gallium st:  ' + ','.join(with_st))
+else
+  message('Gallium: no')
+endif
+
+message('')
+message('HUD extra stats: @0@'.format(with_gallium_extra_hud))
+message('HUD lmsensors:   @0@'.format(with_lmsensors))
+
+if with_gallium_swr
+  message('')
+  if false # TODO: with_swr_builtin
+message('SWR archs:   @0@ 
(builtin)'.format(get_option('swr-arches')))
+  else
+message('SWR archs:   @0@'.format(get_option('swr-arches')))
+  endif
+endif
+
+# Libraries
+message('')
+#message('Shared libs: @0@'.format(with_shared)) #TODO
+#message('Static libs: @0@'.format(with_static)) #TODO
+message('Shared-glapi:@0@'.format(with_shared_glapi))
+
+# Compiler options
+message('')
+message('CFLAGS:  ' + ' '.join(c_args))
+message('CXXFLAGS:' + ' '.join(cpp_args))
+#message('LDFLAGS: ' + ' '.join(c_link_args)) #XXX: doesn't 
really make sense in meson
+message('Macros:  ' + ' '.join(pre_args))
+message('')
+
+if with_llvm and false #TODO
+  message('LLVM_CFLAGS: $LLVM_CFLAGS')
+  message('LLVM_CXXFLAGS:   $LLVM_CXXFLAGS')
+  message('LLVM_CPPFLAGS:   $LLVM_CPPFLAGS')
+  message('LLVM_LDFLAGS:$LLVM_LDFLAGS')
+  message('')
+endif
+
+message('PYTHON2: @0@'.format(prog_python2.path()))
+
+message('')
+if meson.backend() == 'ninja'
+  message('Run `ninja` to build Mesa')
+else
+  message('You can now build Mesa using @0@'.format(meson.backend()))
+endif
+
+message('')
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 320fc0176e9ab6f95322..d0d542fd526a76c5d0f0 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -22,6

[Mesa-dev] [RFC PATCH mesa 2/5] meson: simplify the gbm option code, and avoid changing types

2018-02-23 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/meson.build b/meson.build
index 2d474b140373292e49e7..28d068742ff914a623f6 100644
--- a/meson.build
+++ b/meson.build
@@ -303,16 +303,14 @@ if not (with_dri or with_gallium or with_glx == 'xlib' or 
with_glx == 'gallium-x
   with_shared_glapi = false
 endif
 
-with_gbm = get_option('gbm')
-if with_gbm == 'auto' and with_dri  # TODO: or gallium
-  with_gbm = system_has_kms_drm
-elif with_gbm == 'true'
-  if not system_has_kms_drm
-error('GBM only supports DRM/KMS platforms')
-  endif
-  with_gbm = true
+_gbm = get_option('gbm')
+if _gbm == 'auto'
+  with_gbm = system_has_kms_drm and with_dri  # TODO: or gallium
 else
-  with_gbm = false
+  with_gbm = _gbm == 'true'
+endif
+if with_gbm and not system_has_kms_drm
+  error('GBM only supports DRM/KMS platforms')
 endif
 
 _egl = get_option('egl')
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] *-symbol-check: use correct `nm` path when cross-compiling

2018-02-23 Thread Eric Engestrom
Inspired-by: a similar patch for libdrm by Heiko Becker
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 configure.ac  | 1 +
 meson.build   | 3 +++
 src/egl/egl-symbols-check | 2 +-
 src/egl/meson.build   | 1 +
 src/egl/wayland/wayland-egl/meson.build   | 1 +
 src/egl/wayland/wayland-egl/wayland-egl-symbols-check | 2 +-
 src/gbm/gbm-symbols-check | 3 +--
 src/gbm/meson.build   | 1 +
 src/mapi/es1api/ABI-check | 2 +-
 src/mapi/es1api/meson.build   | 1 +
 src/mapi/es2api/ABI-check | 2 +-
 src/mapi/es2api/meson.build   | 1 +
 12 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8a9172690a87d68714f7..324f28c70170c5830087 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,6 +116,7 @@ dnl other CC/CXX flags related help
 AC_ARG_VAR([CXX11_CXXFLAGS], [Compiler flag to enable C++11 support (only 
needed if not
   enabled by default and different  from 
-std=c++11)])
 AM_PROG_CC_C_O
+AC_PROG_NM
 AM_PROG_AS
 AX_CHECK_GNU_MAKE
 AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
diff --git a/meson.build b/meson.build
index 8eb1e472098d7110d58f..e470e62074da9a46767c 100644
--- a/meson.build
+++ b/meson.build
@@ -1255,6 +1255,9 @@ endif
 
 pkg = import('pkgconfig')
 
+env_test = environment()
+env_test.set('NM', find_program('nm').path())
+
 subdir('include')
 subdir('bin')
 subdir('src')
diff --git a/src/egl/egl-symbols-check b/src/egl/egl-symbols-check
index ae867d04bca91f22b070..460e61a357c7ab6d02c3 100755
--- a/src/egl/egl-symbols-check
+++ b/src/egl/egl-symbols-check
@@ -8,7 +8,7 @@ then
   exit 1
 fi
 
-FUNCS=$(nm -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read 
func; do
+FUNCS=$($NM -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read 
func; do
 ( grep -q "^$func$" || echo $func )  <https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/dri2: fix segfault when display initialisation fails

2018-02-22 Thread Eric Engestrom
On Thursday, 2018-02-22 13:37:54 +, Frank Binns wrote:
> dri2_display_destroy() is called when platform specific display
> initialisation fails. However, this would typically lead to a
> segfault due to the dri2_egl_display vbtl not having been set up.
> 
> Fixes: 2db95482964 ("loader_dri3/glx/egl: Optionally use a blit
> context for blitting operations")
> Signed-off-by: Frank Binns <francisbi...@gmail.com>

Error paths are basically never tested...
You're entirely right, thanks for catching this!

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/egl/drivers/dri2/egl_dri2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 17b646e..c06a0ca 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -973,7 +973,7 @@ dri2_display_destroy(_EGLDisplay *disp)
> struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
>  
> if (dri2_dpy->own_dri_screen) {
> -  if (dri2_dpy->vtbl->close_screen_notify)
> +  if (dri2_dpy->vtbl && dri2_dpy->vtbl->close_screen_notify)
>   dri2_dpy->vtbl->close_screen_notify(disp);
>dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
> }
> -- 
> 2.7.4
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glx: Properly handle cases where screen creation fails

2018-02-21 Thread Eric Engestrom
On Wednesday, 2018-02-21 09:48:54 -0500, Chuck Atkins wrote:
> > > -   if (xmdpy->smapi->destroy)
> > > -  xmdpy->smapi->destroy(xmdpy->smapi);
> > > -   free(xmdpy->smapi);
> > > +   if (xmdpy->smapi)
> > > +   {
> > > +  if (xmdpy->smapi->destroy)
> > > + xmdpy->smapi->destroy(xmdpy->smapi);
> > > +  free(xmdpy->smapi);
> > > +   }
> >
> > I don't know this code so I don't know if the patch is right, but just
> > pointing out this hunk could be written as a simple one-line change:
> >
> > -   if (xmdpy->smapi->destroy)
> > +   if (xmdpy->smapi && xmdpy->smapi->destroy)
> >
> 
> Combining the two would cause  xmdpy->smapi to leak when the
> xmdpy->smapi->destroy callback is null.  This way, destroy get's called
> when it's set but xmdpy->smapi always gets freed.

I think you may have misunderstood me: my "one line change" is *instead
of* your hunk, not *on top of* it. If you don't touch anything else (in
that hunk) then free() is always called :)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v11 12/15] x11/dri3: Don't open-code ARRAY_SIZE

2018-02-21 Thread Eric Engestrom
On Wednesday, 2018-02-21 14:05:56 +, Daniel Stone wrote:
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> ---
>  src/loader/loader_dri3_helper.c | 5 +++--
>  src/loader/meson.build  | 2 +-

Assuming automake already has the right include path,
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
> index 30ea133f7e5..cb947c58728 100644
> --- a/src/loader/loader_dri3_helper.c
> +++ b/src/loader/loader_dri3_helper.c
> @@ -33,6 +33,7 @@
>  #include 
>  
>  #include "loader_dri3_helper.h"
> +#include "util/macros.h"
>  
>  /* From xmlpool/options.h, user exposed so should be stable */
>  #define DRI_CONF_VBLANK_NEVER 0
> @@ -233,7 +234,7 @@ loader_dri3_drawable_fini(struct loader_dri3_drawable 
> *draw)
>  
> draw->ext->core->destroyDrawable(draw->dri_drawable);
>  
> -   for (i = 0; i < LOADER_DRI3_NUM_BUFFERS; i++) {
> +   for (i = 0; i < ARRAY_SIZE(draw->buffers); i++) {
>if (draw->buffers[i])
>   dri3_free_render_buffer(draw, draw->buffers[i]);
> }
> @@ -392,7 +393,7 @@ dri3_handle_present_event(struct loader_dri3_drawable 
> *draw,
>xcb_present_idle_notify_event_t *ie = (void *) ge;
>int b;
>  
> -  for (b = 0; b < sizeof(draw->buffers) / sizeof(draw->buffers[0]); b++) 
> {
> +  for (b = 0; b < ARRAY_SIZE(draw->buffers); b++) {
>   struct loader_dri3_buffer *buf = draw->buffers[b];
>  
>   if (buf && buf->pixmap == ie->pixmap)
> diff --git a/src/loader/meson.build b/src/loader/meson.build
> index e4455e9a72b..2693970182f 100644
> --- a/src/loader/meson.build
> +++ b/src/loader/meson.build
> @@ -25,7 +25,7 @@ if with_platform_x11 and with_dri3
>  'loader_dri3_helper',
>  ['loader_dri3_helper.c', 'loader_dri3_helper.h'],
>  c_args : c_vis_args,
> -include_directories : inc_include,
> +include_directories : [inc_include, inc_src],
>  dependencies : [
>dep_libdrm, dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, dep_xshmfence,
>  ],
> -- 
> 2.14.3
> 
> ___
> 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 v11 13/15] x11/dri3: Store raw present completion mode

2018-02-21 Thread Eric Engestrom
On Wednesday, 2018-02-21 14:05:57 +, Daniel Stone wrote:
> The DRI3 drawable info struct currently stores a boolean for whether the
> last completed operation was a flip or not. As we need to track the full
> completion mode for handling suboptimal returns, change the 'flipping'
> field to the raw present completion mode from the server.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/loader/loader_dri3_helper.c | 12 +++-
>  src/loader/loader_dri3_helper.h |  2 +-
>  2 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
> index cb947c58728..426966a786a 100644
> --- a/src/loader/loader_dri3_helper.c
> +++ b/src/loader/loader_dri3_helper.c
> @@ -196,7 +196,7 @@ dri3_fence_await(xcb_connection_t *c, struct 
> loader_dri3_drawable *draw,
>  static void
>  dri3_update_num_back(struct loader_dri3_drawable *draw)
>  {
> -   if (draw->flipping)
> +   if (draw->last_present_mode == XCB_PRESENT_COMPLETE_MODE_FLIP)
>draw->num_back = 3;
> else
>draw->num_back = 2;
> @@ -369,14 +369,8 @@ dri3_handle_present_event(struct loader_dri3_drawable 
> *draw,
>   draw->recv_sbc = (draw->send_sbc & 0xLL) | 
> ce->serial;
>   if (draw->recv_sbc > draw->send_sbc)
>  draw->recv_sbc -= 0x1;
> - switch (ce->mode) {
> - case XCB_PRESENT_COMPLETE_MODE_FLIP:
> -draw->flipping = true;
> -break;
> - case XCB_PRESENT_COMPLETE_MODE_COPY:
> -draw->flipping = false;
> -break;
> - }
> +
> + draw->last_present_mode = ce->mode;
>  
>   if (draw->vtable->show_fps)
>  draw->vtable->show_fps(draw, ce->ust);
> diff --git a/src/loader/loader_dri3_helper.h b/src/loader/loader_dri3_helper.h
> index 839cba30df0..5caf214b372 100644
> --- a/src/loader/loader_dri3_helper.h
> +++ b/src/loader/loader_dri3_helper.h
> @@ -116,7 +116,6 @@ struct loader_dri3_drawable {
> uint8_t have_back;
> uint8_t have_fake_front;
> uint8_t is_pixmap;
> -   uint8_t flipping;
>  
> /* Information about the GPU owning the buffer */
> __DRIscreen *dri_screen;
> @@ -157,6 +156,7 @@ struct loader_dri3_drawable {
>  
> unsigned int swap_method;
> unsigned int back_format;
> +   xcb_present_complete_mode_t last_present_mode;
>  
> /* Currently protects the following fields:
>  * event_cnd, has_event_waiter,
> -- 
> 2.14.3
> 
> ___
> 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] glx: Properly handle cases where screen creation fails

2018-02-21 Thread Eric Engestrom
On Wednesday, 2018-02-21 09:26:34 -0500, Chuck Atkins wrote:
> This fixes a segfault exposed by a29d63ecf7 which occurs when swr is
> used on an unsupported architecture.
> 
> Signed-off-by: Chuck Atkins 
> Cc: mesa-sta...@lists.freedesktop.org
> Cc: George Kyriazis 
> Cc: Bruce Cherniak 
> ---
>  src/gallium/state_trackers/glx/xlib/xm_api.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c 
> b/src/gallium/state_trackers/glx/xlib/xm_api.c
> index 934c0aba11..3aec57e85d 100644
> --- a/src/gallium/state_trackers/glx/xlib/xm_api.c
> +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
> @@ -182,9 +182,12 @@ xmesa_close_display(Display *display)
>  * }
>  */
>  
> -   if (xmdpy->smapi->destroy)
> -  xmdpy->smapi->destroy(xmdpy->smapi);
> -   free(xmdpy->smapi);
> +   if (xmdpy->smapi)
> +   {
> +  if (xmdpy->smapi->destroy)
> + xmdpy->smapi->destroy(xmdpy->smapi);
> +  free(xmdpy->smapi);
> +   }

I don't know this code so I don't know if the patch is right, but just
pointing out this hunk could be written as a simple one-line change:

-   if (xmdpy->smapi->destroy)
+   if (xmdpy->smapi && xmdpy->smapi->destroy)

>  
> XFree((char *) info);
>  }
> @@ -767,7 +770,7 @@ XMesaVisual XMesaCreateVisual( Display *display,
> XMesaVisual v;
> GLint red_bits, green_bits, blue_bits, alpha_bits;
>  
> -   if (!xmdpy)
> +   if (!xmdpy || !xmdpy->screen)
>return NULL;
>  
> /* For debugging only */
> -- 
> 2.14.3
> 
> ___
> 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] [PATCH mesa] docs: fix patent url

2018-02-20 Thread Eric Engestrom
Reported-by: Pierre Moreau <pierre.mor...@free.fr>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 docs/patents.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/patents.txt b/docs/patents.txt
index b20a045d4b579cba36c3..91c5757d14dc8c7fdec9 100644
--- a/docs/patents.txt
+++ b/docs/patents.txt
@@ -27,5 +27,5 @@ ARB_texture_float:
 enable this extension.
 
 
-[1] https://www.google.com/patents/about?id=mIIOEBAJ=6650327
+[1] https://patents.google.com/patent/US6650327B1
 [2] https://www.opengl.org/registry/specs/ARB/texture_float.txt
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH] configure.ac: pthread-stubs not present on OpenBSD

2018-02-20 Thread Eric Engestrom
On Tuesday, 2018-02-20 17:38:00 +1100, Jonathan Gray wrote:
> pthread-stubs is no longer required on OpenBSD and has been removed.
> libpthread parts involved moved to libc.

Similarly to the libdrm patch, I went to look for the meson.build
equivalent to fix it, but it seems to be missing...

*BSD people, can you confirm whether pthread-stubs is still needed on
FreeBSD, DragonflyBSD and NetBSD?
Either Mesa is missing this code, or libdrm doesn't need it anymore.

This patch itself is
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> Signed-off-by: Jonathan Gray <j...@jsg.id.au>
> Cc: 17.3 18.0 <mesa-sta...@lists.freedesktop.org>
> ---
>  configure.ac | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 89c5e74127..30a3377582 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -967,10 +967,10 @@ dnl In practise that should be sufficient for all 
> platforms, since any
>  dnl platforms build with GCC and Clang support the flag.
>  PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
>  
> -dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the
> +dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of 
> the
>  dnl project. Even then there's a notable issue as described in the project 
> README
>  case "$host_os" in
> -linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu*)
> +linux* | cygwin* | darwin* | solaris* | *-gnu* | gnu* | openbsd*)
>  pthread_stubs_possible="no"
>  ;;
>  * )
> -- 
> 2.16.0
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Add Haiku platform support v4

2018-02-19 Thread Eric Engestrom
On Monday, 2018-02-19 11:20:37 +, Eric Engestrom wrote:
> On Friday, 2018-02-16 14:27:03 -0600, Alexander von Gluck IV wrote:
> > ---
> >  include/meson.build|  8 +
> >  meson.build| 16 +++---
> >  src/egl/meson.build| 36 +++---
> >  src/gallium/meson.build|  9 ++
> >  src/gallium/state_trackers/hgl/meson.build | 41 
> > ++
> >  src/gallium/targets/haiku-softpipe/meson.build | 40 
> > +
> >  src/gallium/winsys/sw/hgl/meson.build  | 29 ++
> >  src/hgl/meson.build| 36 ++
> >  src/mapi/es1api/meson.build|  2 +-
> >  src/mapi/es2api/meson.build|  2 +-
> >  src/meson.build|  7 -
> >  11 files changed, 209 insertions(+), 17 deletions(-)
> >  create mode 100644 src/gallium/state_trackers/hgl/meson.build
> >  create mode 100644 src/gallium/targets/haiku-softpipe/meson.build
> >  create mode 100644 src/gallium/winsys/sw/hgl/meson.build
> >  create mode 100644 src/hgl/meson.build
> > 
> > diff --git a/include/meson.build b/include/meson.build
> > index 1cbc68182c..28ffb33215 100644
> > --- a/include/meson.build
> > +++ b/include/meson.build
> > @@ -22,6 +22,7 @@ inc_drm_uapi = include_directories('drm-uapi')
> >  inc_vulkan = include_directories('vulkan')
> >  inc_d3d9 = include_directories('D3D9')
> >  inc_gl_internal = include_directories('GL/internal')
> > +inc_haikugl = include_directories('HaikuGL')
> >  
> >  if with_gles1
> >install_headers(
> > @@ -80,6 +81,13 @@ if with_gallium_st_nine
> >)
> >  endif
> >  
> > +if with_platform_haiku
> > +  install_headers(
> > +'HaikuGL/GLRenderer.h', 'HaikuGL/GLView.h', 'HaikuGL/OpenGLKit.h',
> > +subdir : 'opengl',
> > +  )
> > +endif
> > +
> >  # Only install the headers if we are building a stand alone implementation 
> > and
> >  # not an ICD enabled implementation
> >  if with_gallium_opencl and not with_opencl_icd
> > diff --git a/meson.build b/meson.build
> > index d6ffa30d9e..120042fb24 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -99,7 +99,7 @@ if _drivers == 'auto'
> >  else
> >error('Unknown architecture. Please pass -Ddri-drivers to set driver 
> > options. Patches gladly accepted to fix this.')
> >  endif
> > -  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
> > +  elif ['darwin', 'windows', 'cygwin', 
> > 'haiku'].contains(host_machine.system())
> >  # only swrast would make sense here, but gallium swrast is a much 
> > better default
> >  _drivers = ''
> >else
> > @@ -144,7 +144,7 @@ if _drivers == 'auto'
> >  else
> >error('Unknown architecture. Please pass -Dgallium-drivers to set 
> > driver options. Patches gladly accepted to fix this.')
> >  endif
> > -  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
> > +  elif ['darwin', 'windows', 'cygwin', 
> > 'haiku'].contains(host_machine.system())
> >  _drivers = 'swrast'
> >else
> >  error('Unknown OS. Please pass -Dgallium-drivers to set driver 
> > options. Patches gladly accepted to fix this.')
> > @@ -181,7 +181,7 @@ if _vulkan_drivers == 'auto'
> >  else
> >error('Unknown architecture. Please pass -Dvulkan-drivers to set 
> > driver options. Patches gladly accepted to fix this.')
> >  endif
> > -  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
> > +  elif ['darwin', 'windows', 'cygwin', 
> > 'haiku'].contains(host_machine.system())
> >  # No vulkan driver supports windows or macOS currently
> >  _vulkan_drivers = ''
> >else
> > @@ -242,6 +242,8 @@ if _platforms == 'auto'
> >  _platforms = 'x11,wayland,drm,surfaceless'
> >elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
> >  _platforms = 'x11,surfaceless'
> > +  elif ['haiku'].contains(host_machine.system())
> > +_platforms = 'haiku'
> >else
> >  error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
> > gladly accepted to fix this.')
> >endif
> > @@ -252,6 +254,7 @@ if _platforms != ''
> >with_platform_x11 = _split.contains('x11')
> >with_platform_wayland = _split

Re: [Mesa-dev] [PATCH] meson: Add Haiku platform support v4

2018-02-19 Thread Eric Engestrom
 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.
> +
> +libswhgl = static_library(
> +  'swhgl',
> +  files('hgl_sw_winsys.c'),
> +  c_args : c_vis_args,
> +  include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux,
> +include_directories('../../../state_trackers/hgl')
> +  ],
> +  build_by_default : false,
> +)
> diff --git a/src/hgl/meson.build b/src/hgl/meson.build
> new file mode 100644
> index 00..ec06272eda
> --- /dev/null
> +++ b/src/hgl/meson.build
> @@ -0,0 +1,36 @@
> +# Copyright © 2017 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.
> +
> +libgl = shared_library(
> +  'GL',
> +  files(
> +'GLView.cpp', 'GLRenderer.cpp', 'GLRendererRoster.cpp', 
> 'GLDispatcher.cpp',
> +  ),
> +  link_args : [ld_args_bsymbolic, ld_args_gc_sections],
> +  include_directories : [
> +inc_src, inc_mapi, inc_mesa, inc_include, inc_glapi, inc_haikugl,
> +inc_gl_internal, include_directories('/system/develop/headers/private')
> +  ],
> +  link_with : [libglapi_static, libglapi],
> +  dependencies : cpp.find_library('be'),
> +  install : true,
> +)
> +
> +# TODO: We need some tests here

Looks good to me:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

Can make one request though? Split this into 4 patches:
- the gl_priv_libs and glx fixes in the hunks below; cc: stable on those
- the split out of the `if with_dri2` blocks from the common code
- the new `if with_platform_haiku` blocks and new meson.build files

> diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
> index ea14654d2c..38a5747e9a 100644
> --- a/src/mapi/es1api/meson.build
> +++ b/src/mapi/es1api/meson.build
> @@ -48,7 +48,7 @@ pkg.generate(
>description : 'Mesa OpenGL ES 1.1 CM library',
>version : meson.project_version(),
>libraries : libglesv1_cm,
> -  libraries_private : '-lm -ldl -lpthread -pthread',
> +  libraries_private : gl_priv_libs,
>  )
>  
>  if with_tests
> diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
> index de8a29bb6b..9f4770a738 100644
> --- a/src/mapi/es2api/meson.build
> +++ b/src/mapi/es2api/meson.build
> @@ -48,7 +48,7 @@ pkg.generate(
>description : 'Mesa OpenGL ES 2.0 library',
>version : meson.project_version(),
>libraries : libgles2,
> -  libraries_private : '-lm -ldl -lpthread -pthread',
> +  libraries_private : gl_priv_libs,
>  )
>  
>  if with_tests
> diff --git a/src/meson.build b/src/meson.build
> index 730b2ff6e4..4d5637f0aa 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -64,7 +64,12 @@ if with_dri_i965 or with_intel_vk
>  endif
>  subdir('mesa')
>  subdir('loader')
> -subdir('glx')
> +if with_platform_haiku
> +  subdir('hgl')
> +endif
> +if with_glx != 'disabled'
> +  subdir('glx')
> +endif
>  if with_gbm
>subdir('gbm')
>  else
> -- 
> 2.14.3
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa v2] egl/wayland: check for invalid format index

2018-02-15 Thread Eric Engestrom
v2: just tell the compiler to assume the format will always be found, as
it comes from the table itself to begin with.

CID: 1429516
Fixes: d32b23f3830099a328b91 "egl/wayland: Add bpp to visual map"
Cc: Daniel Stone <dani...@collabora.com>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/egl/drivers/dri2/platform_wayland.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index 20e47a5f6c15129d4fd8..cbe4a8edbc4b0486fffa 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1294,6 +1294,8 @@ dri2_wl_swrast_get_stride_for_format(int format, int w)
 {
int visual_idx = dri2_wl_visual_idx_from_shm_format(format);
 
+   assume(visual_idx != -1);
+
return w * (dri2_wl_visuals[visual_idx].bpp / 8);
 }
 
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH mesa] egl/wayland: check for invalid format index

2018-02-15 Thread Eric Engestrom
On Thursday, 2018-02-15 11:25:33 +, Daniel Stone wrote:
> Hi Eric,
> 
> On 15 February 2018 at 11:17, Eric Engestrom <eric.engest...@imgtec.com> 
> wrote:
> > Daniel, `w` seemed like the "least bad" thing to return in this case;
> > would you prefer `0`?
> 
> I guess Coverity doesn't know it can never be invalid. We look up a
> visual in the table using dri2_surf->format, whcih is only ever set
> from the table itself when creating a surface. assert(visual_idx ==
> -1) should be enough to please Coverity there I think.

(I assume you meant `!=`)

Sounds like assume() might be better than assert() though, if it's
actually impossible (barring internal bug), so that the compiler can
drop the `== -1` paths.
Sending a v2 in a minute :)

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


[Mesa-dev] [PATCH mesa] egl/wayland: check for invalid format index

2018-02-15 Thread Eric Engestrom
CID: 1429516
Fixes: d32b23f3830099a328b91 "egl/wayland: Add bpp to visual map"
Cc: Daniel Stone <dani...@collabora.com>
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
Daniel, `w` seemed like the "least bad" thing to return in this case;
would you prefer `0`?
---
 src/egl/drivers/dri2/platform_wayland.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index 20e47a5f6c15129d4fd8..73b29c96e5b83ff184d9 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1294,6 +1294,11 @@ dri2_wl_swrast_get_stride_for_format(int format, int w)
 {
int visual_idx = dri2_wl_visual_idx_from_shm_format(format);
 
+   if (visual_idx == -1) {
+  assert(!"unknown format");
+  return w;
+   }
+
return w * (dri2_wl_visuals[visual_idx].bpp / 8);
 }
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] glsl: fix sizeof(pointer) bug

2018-02-15 Thread Eric Engestrom
Doesn't really change anything to the test though ¯\_(ツ)_/¯

CID: 1429511
Fixes: e8495646afb06a9dd7786 "glsl/tests: changes to test_disk_cache_create 
test"
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/compiler/glsl/tests/cache_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/tests/cache_test.c 
b/src/compiler/glsl/tests/cache_test.c
index 3edd88b06a158d8c4b46..9d7bde2834c827a10757 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -186,7 +186,7 @@ static void *
 cache_exists(struct disk_cache *cache)
 {
uint8_t dummy_key[20];
-   char *data = "some test data";
+   char data[] = "some test data";
 
if (!cache)
   return NULL;
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH 07/15] util/bitset: Add C++ wrapper for static-size bitsets.

2018-02-15 Thread Eric Engestrom
On Wednesday, 2018-02-14 13:18:29 -0800, Francisco Jerez wrote:
> ---
>  src/util/bitset.h | 114 
> ++
>  1 file changed, 114 insertions(+)
> 
> diff --git a/src/util/bitset.h b/src/util/bitset.h
> index 2404ce7f630..7bb5f3c83cf 100644
> --- a/src/util/bitset.h
> +++ b/src/util/bitset.h
> @@ -132,4 +132,118 @@ __bitset_next_set(unsigned i, BITSET_WORD *tmp,
> for (__tmp = *(__set), __i = 0; \
>  (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
>  
> +#ifdef __cplusplus
> +
> +/**
> + * Simple C++ wrapper of a bitset type of static size, with value semantics
> + * and basic bitwise arithmetic operators.  The operators defined below are
> + * expected to have the same semantics as the same operator applied to other
> + * fundamental integer types.  T is the name of the struct to instantiate
> + * it as, and N is the number of bits in the bitset.
> + */

Any reason not to use std::bitset for this?
http://en.cppreference.com/w/cpp/utility/bitset

> +#define DECLARE_BITSET_T(T, N) struct T {   \
> +  /* XXX - Replace this with an implicitly-defined  \
> +   * constructor when support for C++11 defaulted   \
> +   * constructors can be assumed (available on GCC 4.4 and  \
> +   * later) in order to make the object trivially   \
> +   * constructible like a fundamental integer type for  \
> +   * convenience.   \
> +   */   \
> +  T()   \
> +  { \
> +  } \
> +\
> +  T(BITSET_WORD x)  \
> +  { \
> + for (unsigned i = 0; i < BITSET_WORDS(N); i++, x = 0)  \
> +words[i] = x;   \
> +  } \
> +\
> +  EXPLICIT_CONVERSION   \
> +  operator bool() const \
> +  { \
> + for (unsigned i = 0; i < BITSET_WORDS(N); i++) \
> +if (words[i])   \
> +   return true; \
> + return false;  \
> +  } \
> +\
> +  friend bool   \
> +  operator==(const T , const T )\
> +  { \
> + return BITSET_EQUAL(b.words, c.words); \
> +  } \
> +\
> +  friend bool   \
> +  operator!=(const T , const T )\
> +  { \
> + return !(b == c);  \
> +  } \
> +\
> +  friend T  \
> +  operator~(const T ) \
> +  { \
> + T c;   \
> + for (unsigned i = 0; i < BITSET_WORDS(N); i++) \
> +c.words[i] = ~b.words[i];   \
> + return c;  \
> +  } \
> +\
> +  T &   \
> +  operator|=(const T )\
> +  { \
> + for (unsigned i = 0; i < BITSET_WORDS(N); i++) \
> +words[i] |= b.words[i]; \
> + return *this;  \
> +  } \
> +\
> +  friend T  \
> +  operator|(const T , const T )   

Re: [Mesa-dev] [PATCH mesa] dri: use a supported API in driCreateNewContext

2018-02-15 Thread Eric Engestrom
On Wednesday, 2018-02-14 09:06:41 -0500, Ilia Mirkin wrote:
> On Feb 14, 2018 7:38 AM, "Eric Engestrom" <eric.engest...@imgtec.com> wrote:
> 
> From: Brendan King <brendan.k...@imgtec.com>
> 
> Don't assume the screen supports OpenGL when creating a new context,
> use an API that the screen supports.
> 
> Signed-off-by: Brendan King <brendan.k...@imgtec.com>
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> [Eric: rebased on current git HEAD]
> Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> ---
>  src/mesa/drivers/dri/common/dri_util.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/common/dri_util.c
> b/src/mesa/drivers/dri/common/dri_util.c
> index e6a7d2391a78c45d45a1..3f32b34132e75228e0e0 100644
> --- a/src/mesa/drivers/dri/common/dri_util.c
> +++ b/src/mesa/drivers/dri/common/dri_util.c
> @@ -49,6 +49,7 @@
>  #include "main/debug_output.h"
>  #include "main/errors.h"
>  #include "main/macros.h"
> +#include "util/bitscan.h"
> 
>  const char __dri2ConfigOptions[] =
> DRI_CONF_BEGIN
> @@ -325,7 +326,11 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
> mesa_api = API_OPENGLES;
> break;
>  case __DRI_API_GLES2:
> +   ctx_config.major_version = 2;
> +   mesa_api = API_OPENGLES2;
> +   break;
>  case __DRI_API_GLES3:
> +   ctx_config.major_version = 3;
> 
> 
> Are you sure about this change? Doesn't seem related, and I'm about 20%
> sure there was some reason for the current thing.

I take the point that these are two separate bugs, and I'll split the
change and re-send, but I don't see the "reason for the current thing".
I'm betting on the 80% :P

Without this `major_version` being set, validate_context_version()
further down could accept a gles3 context when only gles2 is supported,
because `major_version` would be 1 for both and never `>2` or `>3`.

This is normally be hidden by the fact an attribute list with
__DRI_CTX_ATTRIB_MAJOR_VERSION would be passed, but
driCreateNewContextForAPI() doesn't pass an attribute list, which was in
turn hidden by driCreateNewContext() always requesting OPENGL, for which
1.0 is valid, if you support OpenGL (which a lot of dri drivers do, but
we don't anymore).

> 
> mesa_api = API_OPENGLES2;
> break;
>  case __DRI_API_OPENGL_CORE:
> @@ -514,7 +519,14 @@ static __DRIcontext *
>  driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
>  __DRIcontext *shared, void *data)
>  {
> -return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,
> +int apifs;
> +
> +apifs = ffs(screen->api_mask);
> +
> +if (!apifs)
> +return NULL;
> +
> +return driCreateNewContextForAPI(screen, apifs - 1,
>   config, shared, data);
>  }
> 
> --
> Cheers,
>   Eric
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] dri: use a supported API in driCreateNewContext

2018-02-14 Thread Eric Engestrom
From: Brendan King <brendan.k...@imgtec.com>

Don't assume the screen supports OpenGL when creating a new context,
use an API that the screen supports.

Signed-off-by: Brendan King <brendan.k...@imgtec.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
[Eric: rebased on current git HEAD]
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/mesa/drivers/dri/common/dri_util.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index e6a7d2391a78c45d45a1..3f32b34132e75228e0e0 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -49,6 +49,7 @@
 #include "main/debug_output.h"
 #include "main/errors.h"
 #include "main/macros.h"
+#include "util/bitscan.h"
 
 const char __dri2ConfigOptions[] =
DRI_CONF_BEGIN
@@ -325,7 +326,11 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
mesa_api = API_OPENGLES;
break;
 case __DRI_API_GLES2:
+   ctx_config.major_version = 2;
+   mesa_api = API_OPENGLES2;
+   break;
 case __DRI_API_GLES3:
+   ctx_config.major_version = 3;
mesa_api = API_OPENGLES2;
break;
 case __DRI_API_OPENGL_CORE:
@@ -514,7 +519,14 @@ static __DRIcontext *
 driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
 __DRIcontext *shared, void *data)
 {
-return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,
+int apifs;
+
+apifs = ffs(screen->api_mask);
+
+if (!apifs)
+return NULL;
+
+return driCreateNewContextForAPI(screen, apifs - 1,
  config, shared, data);
 }
 
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH 07/21] vulkan: Add EXT_acquire_xlib_display

2018-02-14 Thread Eric Engestrom
on_options.txt
> index 7fafe2deaac..d38c9aa6149 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -286,3 +286,10 @@ option(
>value : '',
>description : 'Comma delimited list of tools to build. choices : 
> freedreno,glsl,intel,nir,nouveau or all'
>  )
> +option(
> +  'xlib-lease',
> +  type : 'combo',
> +  value : 'auto',
> +  choices : ['auto', 'true', 'false'],
> +  description : 'Enable VK_EXT_acquire_xlib_display.'
> +)
> diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am
> index c33ac5758f7..e96ef68972c 100644
> --- a/src/vulkan/Makefile.am
> +++ b/src/vulkan/Makefile.am
> @@ -64,6 +64,11 @@ AM_CPPFLAGS += \
>  VULKAN_WSI_SOURCES += $(VULKAN_WSI_DISPLAY_FILES)
>  endif
>  
> +if HAVE_XLIB_LEASE
> +AM_CPPFLAGS += \
> + -DVK_USE_PLATFORM_XLIB_XRANDR_EXT
> +endif
> +
>  BUILT_SOURCES += $(VULKAN_WSI_WAYLAND_GENERATED_FILES)
>  CLEANFILES = $(BUILT_SOURCES)
>  
> diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
> index 743631a6113..5e3d43a2748 100644
> --- a/src/vulkan/wsi/meson.build
> +++ b/src/vulkan/wsi/meson.build
> @@ -67,6 +67,13 @@ if with_platform_display
>)
>  endif
>  
> +if with_xlib_lease
> +  vulkan_wsi_deps += dep_xcb_xrandr
> +  vulkan_wsi_args += [
> +'-DVK_USE_PLATFORM_XLIB_XRANDR_EXT',
> +  ]

vulkan_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'

with that, the meson part of this is
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> +endif
> +
>  libvulkan_wsi = static_library(
>'vulkan_wsi',
>files_vulkan_wsi,
> diff --git a/src/vulkan/wsi/wsi_common_display.c 
> b/src/vulkan/wsi/wsi_common_display.c
> index 5c123e6465e..29d64b21aff 100644
> --- a/src/vulkan/wsi/wsi_common_display.c
> +++ b/src/vulkan/wsi/wsi_common_display.c
> @@ -32,6 +32,10 @@
>  #include 
>  #include 
>  #include 
> +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
> +#include 
> +#include 
> +#endif
>  #include "util/hash_table.h"
>  #include "util/list.h"
>  
> @@ -73,6 +77,9 @@ typedef struct wsi_display_connector {
> bool active;
> wsi_display_mode *current_mode;
> drmModeModeInfo  current_drm_mode;
> +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
> +   xcb_randr_output_t   output;
> +#endif
>  } wsi_display_connector;
>  
>  struct wsi_display {
> @@ -1381,5 +1388,470 @@ wsi_release_display(VkPhysicalDevice
> physical_device,
>close(wsi->master_fd);
>wsi->master_fd = -1;
> }
> +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
> +   wsi_display_connector_from_handle(display)->output = None;
> +#endif
> +
> return VK_SUCCESS;
>  }
> +
> +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
> +
> +static struct wsi_display_connector *
> +wsi_display_find_output(struct wsi_device   *wsi_device,
> +RROutputoutput)
> +{
> +   struct wsi_display   *wsi = (struct wsi_display *) 
> wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
> +   struct wsi_display_connector *connector;
> +
> +   connector = NULL;
> +   LIST_FOR_EACH_ENTRY(connector, >connectors, list) {
> +  if (connector->output == output)
> + return connector;
> +   }
> +
> +   return NULL;
> +}
> +
> +/*
> + * Given a RandR output, find the associated kernel connector_id by
> + * looking at the CONNECTOR_ID property provided by the X server
> + */
> +
> +static uint32_t
> +wsi_display_output_to_connector_id(xcb_connection_t *connection,
> +   xcb_atom_t   *connector_id_atom_p,
> +   RROutput output)
> +{
> +   uint32_t connector_id = 0;
> +   xcb_atom_t   connector_id_atom = *connector_id_atom_p;
> +
> +   if (connector_id_atom == 0) {
> +   /* Go dig out the CONNECTOR_ID property */
> +  xcb_intern_atom_cookie_t ia_c = xcb_intern_atom(connection,
> +  true,
> +  12,
> +  "CONNECTOR_ID");
> +  xcb_intern_atom_reply_t  *ia_r = xcb_intern_atom_reply(connection,
> + ia_c,
> + NULL);
> +  if (ia_r) {
> + *connector_id_atom_p = connector_id_atom = ia_r->atom;
> + free(ia_r);
> +  }
> +   }
> +
> +   /* If there's an CONNECTOR_ID atom in th

Re: [Mesa-dev] [PATCH] mesa: add missing switch case for EXTRA_VERSION_40 in check_extra()

2018-02-13 Thread Eric Engestrom
On Tuesday, 2018-02-13 09:29:26 -0700, Brian Paul wrote:
> The EXTRA_VERSION_40 predicate is tested as part of
> extra_gl40_ARB_sample_shading but there was no switch case for it.

Fixes: 77b440e42d8e7247c2295 "mesa: Add new functions and enums required
  by GL_ARB_sample_shading"
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/mesa/main/get.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 2188017..57a2118 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -1224,6 +1224,11 @@ check_extra(struct gl_context *ctx, const char *func, 
> const struct value_desc *d
>   if (version >= 32)
>  api_found = GL_TRUE;
>   break;
> +  case EXTRA_VERSION_40:
> + api_check = GL_TRUE;
> + if (version >= 40)
> +api_found = GL_TRUE;
> + break;
>case EXTRA_NEW_FRAG_CLAMP:
>   if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
>  _mesa_update_state(ctx);
> -- 
> 2.7.4
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v4 02/12] meson: add libswdri and libswkmsdri tolink_with unconditionally

2018-02-13 Thread Eric Engestrom
On Tuesday, 2018-02-13 10:29:08 +0100, Marc Dietrich wrote:
> Hi Dylan,
> 
> Am Montag, 12. Februar 2018, 20:27:42 CET schrieb Dylan Baker:
> > Fixes: 6b4c7047d571 ("meson: build gallium nine state_tracker")
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > ---
> >  src/gallium/targets/d3dadapter9/meson.build | 13 +++--
> >  1 file changed, 3 insertions(+), 10 deletions(-)
> > 
> > diff --git a/src/gallium/targets/d3dadapter9/meson.build
> > b/src/gallium/targets/d3dadapter9/meson.build index 5476e80..f1b68fd 100644
> > --- a/src/gallium/targets/d3dadapter9/meson.build
> > +++ b/src/gallium/targets/d3dadapter9/meson.build
> > @@ -1,4 +1,5 @@
> >  # Copyright © 2017 Dylan Baker
> > +# 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 @@ -31,20 +32,12 @@ gallium_nine_c_args = [
> >  ]
> >  gallium_nine_ld_args = []
> >  gallium_nine_link_depends = []
> > -gallium_nine_link_with = []
> > 
> >  if with_ld_version_script
> >gallium_nine_ld_args += ['-Wl,--version-script',
> > join_paths(meson.current_source_dir(), 'd3dadapter9.sym')]
> > gallium_nine_link_depends += files('d3dadapter9.sym')
> >  endif
> > 
> > -if with_dri
> > -  gallium_nine_link_with += libswdri
> > -endif
> > -if with_gallium_drisw_kms
> > -  gallium_nine_link_with += libswkmsdri
> > -endif
> > -
> >  libgallium_nine = shared_library(
> >'d3dadapter9',
> >[files('description.c', 'getproc.c', 'drm.c'), xmlpool_options_h],
> > @@ -60,8 +53,8 @@ libgallium_nine = shared_library(
> >link_depends : gallium_nine_link_depends,
> >link_with : [
> >  libgalliumvl_stub, libgallium, libnine_st, libmesa_util, libddebug,
> > -librbug, libtrace, libpipe_loader_static, libws_null, libwsw,
> > -gallium_nine_link_with,
> > +librbug, libtrace, libpipe_loader_static, libws_null, libwsw, libswdi,
> 
> libswdri

Good catch!
With that fixed, v4 of the series is:
Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> > +libswkmsdri,
> >],
> >dependencies : [
> >  dep_selinux, dep_expat, dep_libdrm, dep_llvm,
> 
> Marc
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 09/17] spirv: Silence compiler warning about undefined srcs[0]

2018-02-13 Thread Eric Engestrom
On Monday, 2018-02-12 13:52:23 -0800, Ian Romanick wrote:
> On 02/10/2018 08:33 AM, Eric Anholt wrote:
> > It doesn't know that elems >= 1.
> 
> Does adding assume(elems >= 1) help?

Indeed, I was going to reply this too; I think a number of "let's
always initialise to shut the compiler up" patches in this series
should actually be "let's tell the compiler this isn't possible
because `elems > 0`"

> 
> > Cc: Jason Ekstrand 
> > ---
> >  src/compiler/spirv/spirv_to_nir.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/compiler/spirv/spirv_to_nir.c 
> > b/src/compiler/spirv/spirv_to_nir.c
> > index c6df764682ec..f86d45511df8 100644
> > --- a/src/compiler/spirv/spirv_to_nir.c
> > +++ b/src/compiler/spirv/spirv_to_nir.c
> > @@ -2923,7 +2923,7 @@ vtn_handle_composite(struct vtn_builder *b, SpvOp 
> > opcode,
> > case SpvOpCompositeConstruct: {
> >unsigned elems = count - 3;
> >if (glsl_type_is_vector_or_scalar(type)) {
> > - nir_ssa_def *srcs[4];
> > + nir_ssa_def *srcs[4] = { NULL };
> >   for (unsigned i = 0; i < elems; i++)
> >  srcs[i] = vtn_ssa_value(b, w[3 + i])->def;
> >   val->ssa->def =
> > 
> 
> ___
> 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 08/17] loader: Fix compiler warnings about truncating the PCI ID path.

2018-02-13 Thread Eric Engestrom
On Saturday, 2018-02-10 16:33:01 +, Eric Anholt wrote:
> My build was producing:
> 
> ../src/loader/loader.c:121:67: warning: ‘%1u’ directive output may be 
> truncated writing between 1 and 3 bytes into a region of size 2 
> [-Wformat-truncation=]
> 
> and we can avoid this careful calculation by just using asprintf (as we do
> elsewhere in the file).
> 
> Cc: Eric Engestrom <eric.engest...@imgtec.com>

That is indeed better, thanks!
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/loader/loader.c | 15 +++
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/src/loader/loader.c b/src/loader/loader.c
> index 913b3dcac032..92b4c5204b19 100644
> --- a/src/loader/loader.c
> +++ b/src/loader/loader.c
> @@ -110,17 +110,16 @@ static char *loader_get_dri_config_device_id(void)
>  
>  static char *drm_construct_id_path_tag(drmDevicePtr device)
>  {
> -#define PCI_ID_PATH_TAG_LENGTH sizeof("pci-_xx_xx_x")
> char *tag = NULL;
>  
> if (device->bustype == DRM_BUS_PCI) {
> -tag = calloc(PCI_ID_PATH_TAG_LENGTH, sizeof(char));
> -if (tag == NULL)
> -return NULL;
> -
> -snprintf(tag, PCI_ID_PATH_TAG_LENGTH, "pci-%04x_%02x_%02x_%1u",
> - device->businfo.pci->domain, device->businfo.pci->bus,
> - device->businfo.pci->dev, device->businfo.pci->func);
> +  if (asprintf(, "pci-%04x_%02x_%02x_%1u",
> +   device->businfo.pci->domain,
> +   device->businfo.pci->bus,
> +   device->businfo.pci->dev,
> +   device->businfo.pci->func) < 0) {
> + return NULL;
> +  }
> }
> return tag;
>  }
> -- 
> 2.15.0
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] How to know which exact llvm version to build/link against?

2018-02-13 Thread Eric Engestrom
On Tuesday, 2018-02-13 01:44:53 -0800, Andrew A. wrote:
> On Wed, Feb 7, 2018 at 1:37 AM, Michel Dänzer  wrote:
> > For a non-current snapshot of Mesa Git master, one may have to find an
> > LLVM SVN snapshot from around the same time.
> 
> Just so I understand, a statement like "Try repro'ing the bug in svn
> commit x of mesa from last year" doesn't wind up being very precise,
> since the llvm version used by the author of commit x was never
> documented/codified anywhere. Do you suppose there could be value in
> codifying this a bit more? Perhaps some kind of client-side pre-commit
> hook could notate the llvm version/commit/tag somewhere in the mesa
> checkin...
> 
> I realize the same criticism could be made of not tracking version
> numbers of other dependencies (e.g. "By that logic, everything is
> imprecise, and all dependencies should be tracked in this manner,
> including glibc, binutils, etc! A bit ridiculous!"), but as you
> mention llvm is uniquely very unstable as an API, so there may be more
> value in tracking it than other kinds of deps.
> 
> As a relatively infrequent user of mesa git checkouts, I can only say
> that finding the correct llvm version to build against can be a bit of
> a pain. As mentioned, I usually have to try several different llvm
> checkouts before finding the right one. Even when I do get it working,
> I still have no idea if that's the llvm version that the author of the
> mesa commit was using (which I'd really prefer). Is this somehow not a
> regular problem for mesa developers? Wondering if I'm blowing it out
> of proportion.

If you're not developing something specific to the llvm version
currently in development, you probably don't need a git/svn checkout of
llvm, you should just use one of the llvm releases. If you encounter
build issues using a released llvm, you should report that, as they are
all supposed to work (with a minumum, currently at 3.9/4.0 depending on
what you include in your build).

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


Re: [Mesa-dev] [PATCH 1/7] vulkan: Add KHR_display extension to anv and radv using DRM

2018-02-12 Thread Eric Engestrom
On Friday, 2018-02-09 20:45:10 -0800, Keith Packard wrote:
> This adds support for the KHR_display extension to the anv and radv
> Vulkan drivers. The drivers now attempt to open the master DRM node
> when the KHR_display extension is requested so that the common winsys
> code can perform the necessary operations.
> 
> Signed-off-by: Keith Packard 
> ---
>  configure.ac   |1 +
>  meson.build|4 +-
>  src/amd/vulkan/Makefile.am |8 +
>  src/amd/vulkan/Makefile.sources|3 +
>  src/amd/vulkan/meson.build |7 +
>  src/amd/vulkan/radv_device.c   |   28 +-
>  src/amd/vulkan/radv_extensions.py  |7 +-
>  src/amd/vulkan/radv_private.h  |2 +
>  src/amd/vulkan/radv_wsi.c  |3 +-
>  src/amd/vulkan/radv_wsi_display.c  |  143 
>  src/intel/Makefile.sources |3 +
>  src/intel/Makefile.vulkan.am   |7 +
>  src/intel/vulkan/anv_device.c  |   18 +-
>  src/intel/vulkan/anv_extensions.py |1 +
>  src/intel/vulkan/anv_extensions_gen.py |5 +-
>  src/intel/vulkan/anv_wsi.c |3 +-
>  src/intel/vulkan/anv_wsi_display.c |  129 +++
>  src/intel/vulkan/meson.build   |7 +
>  src/vulkan/Makefile.am |7 +
>  src/vulkan/Makefile.sources|4 +
>  src/vulkan/wsi/meson.build |   10 +
>  src/vulkan/wsi/wsi_common.c|   19 +-
>  src/vulkan/wsi/wsi_common.h|5 +-
>  src/vulkan/wsi/wsi_common_display.c| 1368 
> 
>  src/vulkan/wsi/wsi_common_display.h|   72 ++
>  src/vulkan/wsi/wsi_common_private.h|   10 +
>  26 files changed, 1858 insertions(+), 16 deletions(-)
>  create mode 100644 src/amd/vulkan/radv_wsi_display.c
>  create mode 100644 src/intel/vulkan/anv_wsi_display.c
>  create mode 100644 src/vulkan/wsi/wsi_common_display.c
>  create mode 100644 src/vulkan/wsi/wsi_common_display.h
> 
> diff --git a/configure.ac b/configure.ac
> index 8ed606c7694..46318365603 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1849,6 +1849,7 @@ fi
>  AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
>  AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$platforms" | grep -q 'wayland')
>  AM_CONDITIONAL(HAVE_PLATFORM_DRM, echo "$platforms" | grep -q 'drm')
> +AM_CONDITIONAL(HAVE_PLATFORM_DISPLAY, echo "$platforms" | grep -q 'drm')

copy/paste error: s/drm/display/

>  AM_CONDITIONAL(HAVE_PLATFORM_SURFACELESS, echo "$platforms" | grep -q 
> 'surfaceless')
>  AM_CONDITIONAL(HAVE_PLATFORM_ANDROID, echo "$platforms" | grep -q 'android')
>  
> diff --git a/meson.build b/meson.build
> index b39e2f8ab96..aeb7f5e2917 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -239,11 +239,12 @@ with_platform_wayland = false
>  with_platform_x11 = false
>  with_platform_drm = false
>  with_platform_surfaceless = false
> +with_platform_display = false
>  egl_native_platform = ''
>  _platforms = get_option('platforms')
>  if _platforms == 'auto'
>if system_has_kms_drm
> -_platforms = 'x11,wayland,drm,surfaceless'
> +_platforms = 'x11,wayland,drm,surfaceless,display'
>elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
>  _platforms = 'x11,surfaceless'
>else
> @@ -257,6 +258,7 @@ if _platforms != ''
>with_platform_wayland = _split.contains('wayland')
>with_platform_drm = _split.contains('drm')
>with_platform_surfaceless = _split.contains('surfaceless')
> +  with_platform_display = _split.contains('display')
>egl_native_platform = _split[0]
>  endif
>  
> diff --git a/src/amd/vulkan/Makefile.am b/src/amd/vulkan/Makefile.am
> index 61025968942..061b8144b88 100644
> --- a/src/amd/vulkan/Makefile.am
> +++ b/src/amd/vulkan/Makefile.am
> @@ -76,6 +76,14 @@ VULKAN_LIB_DEPS = \
>   $(DLOPEN_LIBS) \
>   -lm
>  
> +if HAVE_PLATFORM_DISPLAY
> +AM_CPPFLAGS += \
> + -DVK_USE_PLATFORM_DISPLAY_KHR
> +
> +VULKAN_SOURCES += $(VULKAN_WSI_DISPLAY_FILES)
> +
> +endif
> +
>  if HAVE_PLATFORM_X11
>  AM_CPPFLAGS += \
>   $(XCB_DRI3_CFLAGS) \
> diff --git a/src/amd/vulkan/Makefile.sources b/src/amd/vulkan/Makefile.sources
> index a510d88d965..618a6cdaed0 100644
> --- a/src/amd/vulkan/Makefile.sources
> +++ b/src/amd/vulkan/Makefile.sources
> @@ -78,6 +78,9 @@ VULKAN_WSI_WAYLAND_FILES := \
>  VULKAN_WSI_X11_FILES := \
>   radv_wsi_x11.c
>  
> +VULKAN_WSI_DISPLAY_FILES := \
> + radv_wsi_display.c
> +
>  VULKAN_GENERATED_FILES := \
>   radv_entrypoints.c \
>   radv_entrypoints.h \
> diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build
> index 0a7b7c0bf3c..b7bb1075e7d 100644
> --- a/src/amd/vulkan/meson.build
> +++ b/src/amd/vulkan/meson.build
> @@ -112,6 +112,13 @@ if with_platform_wayland
>libradv_files += files('radv_wsi_wayland.c')
>  endif
>  
> +if with_platform_display
> +  radv_flags += [
> +

Re: [Mesa-dev] [PATCH] i965: perf: ensure reading config IDs from sysfs isn't interrupted

2018-02-09 Thread Eric Engestrom
On Friday, 2018-02-09 10:03:53 +, Lionel Landwerlin wrote:
> Fixes: 458468c136e "i965: Expose OA counters via INTEL_performance_query"
> Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
> Cc: "18.0" <mesa-sta...@lists.freedesktop.org>

The Fixes: tag with a commit which is in 18.0 already nominates it for
backporting to that branch, you don't need to manually Cc: 18.0 :)

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/mesa/drivers/dri/i965/brw_performance_query.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c 
> b/src/mesa/drivers/dri/i965/brw_performance_query.c
> index c0bb4442bec..613e61653fe 100644
> --- a/src/mesa/drivers/dri/i965/brw_performance_query.c
> +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
> @@ -1720,7 +1720,8 @@ read_file_uint64(const char *file, uint64_t *val)
>  fd = open(file, 0);
>  if (fd < 0)
>   return false;
> -n = read(fd, buf, sizeof (buf) - 1);
> +while ((n = read(fd, buf, sizeof (buf) - 1)) < 0 &&
> +   errno == EINTR);
>  close(fd);
>  if (n < 0)
>   return false;
> -- 
> 2.16.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH demos 4/4] egl: Install eglinfo binary

2018-02-09 Thread Eric Engestrom
On Friday, 2018-02-09 10:09:01 +0100, Andreas Boll wrote:
> Signed-off-by: Andreas Boll <andreas.boll@gmail.com>
> ---
> I'd like to ship eglinfo inside Debian's mesa-utils-extra package and I 
> thought
> other distributions could be interested in this patch as well.

Yes please :)

Btw, I already pointed out 2/4 during its review, I guess Brian forgot
to fix it :P

Series is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
>  src/egl/opengl/Makefile.am | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
> index b745573a..6d184ff6 100644
> --- a/src/egl/opengl/Makefile.am
> +++ b/src/egl/opengl/Makefile.am
> @@ -56,8 +56,9 @@ endif
>  endif
>  
>  if HAVE_EGL
> +bin_PROGRAMS = \
> + eglinfo
>  noinst_PROGRAMS = \
> - eglinfo \
>   peglgears \
>   $(EGL_DRM_DEMOS) \
>   $(EGL_X11_DEMOS) \
> -- 
> 2.11.0
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] r200: remove left over dead code

2018-02-09 Thread Eric Engestrom
0aaa27f29187ffb739c7 removed the references to this array without
removing the array itself

Cc: Ian Romanick <ian.d.roman...@intel.com>
Fixes: 0aaa27f29187ffb739c7 "mesa: Pass the translated color logic op 
dd_function_table::LogicOpcode"
Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/mesa/drivers/dri/r200/r200_state.c | 20 
 1 file changed, 20 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_state.c 
b/src/mesa/drivers/dri/r200/r200_state.c
index 33b696347a3d2218a92e..d53225d63abe9409e0ef 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -1626,26 +1626,6 @@ static void r200RenderMode( struct gl_context *ctx, 
GLenum mode )
FALLBACK( rmesa, R200_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
 }
 
-
-static GLuint r200_rop_tab[] = {
-   R200_ROP_CLEAR,
-   R200_ROP_AND,
-   R200_ROP_AND_REVERSE,
-   R200_ROP_COPY,
-   R200_ROP_AND_INVERTED,
-   R200_ROP_NOOP,
-   R200_ROP_XOR,
-   R200_ROP_OR,
-   R200_ROP_NOR,
-   R200_ROP_EQUIV,
-   R200_ROP_INVERT,
-   R200_ROP_OR_REVERSE,
-   R200_ROP_COPY_INVERTED,
-   R200_ROP_OR_INVERTED,
-   R200_ROP_NAND,
-   R200_ROP_SET,
-};
-
 static void r200LogicOpCode(struct gl_context *ctx, enum gl_logicop_mode 
opcode)
 {
r200ContextPtr rmesa = R200_CONTEXT(ctx);
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH 01/18] egl/wayland: Fix ARGB/XRGB transposition in config map

2018-02-08 Thread Eric Engestrom


On February 8, 2018 2:06:23 PM UTC, Daniel Stone <dani...@collabora.com> wrote:
> When 0b2b7191214eb moved from an if tree to a struct to map between
> wl_drm formats and EGLConfigs, it transposed the mapping between XRGB
> and ARGB. Luckily, everyone exposes both formats, so this is harmless.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> Fixes: 0b2b7191214eb ("egl/wayland: introduce
> dri2_wl_add_configs_for_visuals() helper")
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Cc: Eric Engestrom <e...@engestrom.ch>

Reviewed-by: Eric Engestrom <e...@engestrom.ch>

(On my phone and you cc'ed me, but I'll also review the rest of the series 
tomorrow)

> ---
>  src/egl/drivers/dri2/platform_wayland.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c
> b/src/egl/drivers/dri2/platform_wayland.c
> index 24b99075397..6a1e6ecf9af 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -1271,8 +1271,8 @@ dri2_wl_add_configs_for_visuals(_EGLDriver *drv,
> _EGLDisplay *disp)
> } visuals[] = {
> { "XRGB2101010", HAS_XRGB2101010, { 0x3ff0, 0xffc00, 0x3ff, 0 } },
> { "ARGB2101010", HAS_ARGB2101010, { 0x3ff0, 0xffc00, 0x3ff,
> 0xc000 } },
> -  { "XRGB", HAS_XRGB, { 0xff, 0xff00, 0x00ff,
> 0xff00 } },
> -  { "ARGB", HAS_ARGB, { 0xff, 0xff00, 0x00ff, 0 } },
> +  { "XRGB", HAS_XRGB, { 0xff, 0xff00, 0x00ff, 0 } },
> +  { "ARGB", HAS_ARGB, { 0xff, 0xff00, 0x00ff,
> 0xff00 } },
>{ "RGB565",   HAS_RGB565,   { 0x00f800, 0x07e0, 0x001f, 0 } },

One note though, the prefixing 0s are very inconsistent in this table, might be 
worth cleaning that up too?

> };
> unsigned int format_count[ARRAY_SIZE(visuals)] = { 0 };
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Add build option for tools

2018-02-08 Thread Eric Engestrom
On Thursday, 2018-02-08 01:30:04 -0800, Jordan Justen wrote:
> On 2018-02-07 16:55:24, Scott D Phillips wrote:
> > diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
> > index b0c0de810a6..6c46e466c96 100644
> > --- a/src/compiler/glsl/meson.build
> > +++ b/src/compiler/glsl/meson.build
> > @@ -230,7 +230,8 @@ glsl_compiler = executable(
> >dependencies : [dep_clock, dep_thread],
> >include_directories : [inc_common],
> >link_with : [libglsl_standalone],
> > -  build_by_default : false,
> > +  build_by_default : with_tools.contains('glsl'),
> > +  install : true,
> 
> Thanks for looking at this!
> 
> I found that the install will still be attempted even if it isn't
> built, so you should add with_tools.contains('foo') to the install
> lines as well.

I was about to say that, good thing I read the replies first :)

> With that:
> 
> Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH kmscube] formats: use weston's egl config matching logic, move format defines up

2018-02-08 Thread Eric Engestrom
On Wednesday, 2018-02-07 23:17:48 -0500, Ilia Mirkin wrote:
> The GBM surface format has to match the DRM mode. Both are used in a
> couple of places, so move the defines to a common place so that they can
> be adjusted easily.
> 
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
> ---
> 
> Tested with both RGB565 and ARGB2101010. Predictably the RGB565 cube has
> a lot of artifacts, while the 10bpc one avoids the occasional artifacts
> that show up at 8bpc.
> 
>  common.c | 76 
> 
>  common.h |  3 +++
>  drm-common.c |  4 ++--
>  3 files changed, 76 insertions(+), 7 deletions(-)
> 
> diff --git a/common.c b/common.c
> index b76c994..2ee3b85 100644
> --- a/common.c
> +++ b/common.c
> @@ -54,7 +54,7 @@ const struct gbm * init_gbm(int drm_fd, int w, int h, 
> uint64_t modifier)
>   return NULL;
>   }
>   gbm.surface = gbm_surface_create(gbm.dev, w, h,
> - GBM_FORMAT_XRGB,
> + GBM_FORMAT,
>   GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
>  #else
>   uint64_t *mods;
> @@ -66,7 +66,7 @@ const struct gbm * init_gbm(int drm_fd, int w, int h, 
> uint64_t modifier)
>   count = get_modifiers();
>   }
>   gbm.surface = gbm_surface_create_with_modifiers(gbm.dev, w, h,
> - GBM_FORMAT_XRGB, mods, count);
> + GBM_FORMAT, mods, count);
>  #endif
>  
>   if (!gbm.surface) {
> @@ -100,9 +100,75 @@ static bool has_ext(const char *extension_list, const 
> char *ext)
>   }
>  }
>  
> +static int
> +match_config_to_visual(EGLDisplay egl_display,
> +EGLint visual_id,
> +EGLConfig *configs,
> +int count)
> +{
> + int i;
> +
> + for (i = 0; i < count; ++i) {
> + EGLint id;
> +
> + if (!eglGetConfigAttrib(egl_display,
> + configs[i], EGL_NATIVE_VISUAL_ID,
> + ))
> + continue;
> +
> + if (id == visual_id)
> + return i;
> + }
> +
> + return -1;
> +}
> +
> +static int
> +egl_choose_config(struct egl *egl, const EGLint *attribs, EGLint visual_id,

`display` is the only member of `egl` used; pass `egl->display` directly?

> +   EGLConfig *config_out)
> +{
> + EGLint count = 0;
> + EGLint matched = 0;
> + EGLConfig *configs;
> + int config_index = -1;
> +
> + if (!eglGetConfigs(egl->display, NULL, 0, ) || count < 1) {
> + printf("No EGL configs to choose from.\n");
> + return -1;
> + }
> + configs = calloc(count, sizeof *configs);

Nit: no need to calloc, malloc is enough; we'll never read past
how many configs eglChooseConfig() says it returned, and barring
any implementation bug, that should mean all indices up to `matched`
are initialised.

> + if (!configs)
> + return -1;
> +
> + if (!eglChooseConfig(egl->display, attribs, configs,
> +   count, ) || !matched) {
> + printf("No EGL configs with appropriate attributes.\n");
> + goto out;
> + }
> +
> + if (!visual_id)
> + config_index = 0;
> +
> + if (config_index == -1)
> + config_index = match_config_to_visual(egl->display,
> +   visual_id,
> +   configs,
> +       matched);
> +
> + if (config_index != -1)
> + *config_out = configs[config_index];
> +
> +out:
> + free(configs);
> + if (config_index == -1)
> + return -1;
> +
> + return 0;

can we make that `return true/false` ?

Other than these nit-picks, lgtm:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> +}
> +
>  int init_egl(struct egl *egl, const struct gbm *gbm)
>  {
> - EGLint major, minor, n;
> + EGLint major, minor;
>  
>   static const EGLint context_attribs[] = {
>   EGL_CONTEXT_CLIENT_VERSION, 2,
> @@ -174,8 +240,8 @@ int init_egl(struct egl *egl, const struct gbm *gbm)
>   return -1;
>   }
>  
> - if (!eglChooseConfig(egl->display, config_attribs, >config, 1, ) 
> || n != 1) {
> - printf("failed to choose config: %d\n", n);
> + if (egl_choose_config(egl, config_attribs, GBM_FORMAT, >config)) {
> + printf("failed t

Re: [Mesa-dev] [PATCH] glxinfo/wglinfo: query/print more GL limits

2018-02-07 Thread Eric Engestrom
On Wednesday, 2018-02-07 10:23:06 -0700, Brian Paul wrote:
> On 02/07/2018 10:12 AM, Eric Engestrom wrote:
> > On Wednesday, 2018-02-07 08:48:06 -0700, Brian Paul wrote:
> > > Query/print limits for GL 3.0 through GL 4.6, plus
> > > GL_ARB_transform_feedback3.  Also, print the GL extension or GL version
> > > for each set of queries to make it more readable.
> > > ---
> > >   src/xdemos/glinfo_common.c | 127 
> > > -
> > >   1 file changed, 125 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
> > > index bd25462..07af989 100644
> > > --- a/src/xdemos/glinfo_common.c
> > > +++ b/src/xdemos/glinfo_common.c
> > > @@ -610,12 +610,127 @@ print_limits(const char *extensions, const char 
> > > *oglstring, int version,
> > > { 1, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, 
> > > "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", "GL_ARB_vertex_attrib_binding" },
> > > { 1, GL_MAX_VERTEX_ATTRIB_BINDINGS, 
> > > "GL_MAX_VERTEX_ATTRIB_BINDINGS", "GL_ARB_vertex_attrib_binding" },
> > >   #endif
> > > +#if defined(GL_VERSION_3_0)
> > > +  { 1, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, 
> > > "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "3.0" },
> > > +  { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 
> > > "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "3.0" },
> > > +  { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, 
> > > "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", "3.0" },
> > > +#endif
> > > +#if defined(GL_VERSION_3_1)
> > > +      { 1, GL_MAX_TEXTURE_BUFFER_SIZE, "GL_MAX_TEXTURE_BUFFER_SIZE", 
> > > "3.1" },
> > > +  { 1, GL_MAX_RECTANGLE_TEXTURE_SIZE, 
> > > "GL_MAX_RECTANGLE_TEXTURE_SIZE", "3.1" },
> > > +#endif
> > > +#if defined(GL_VERISON_3_2)
> > 
> > typo
> 
> Thanks.  I'll fix before pushing.  R-b?

I don't know this code at all, but this all looks reasonable :)
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

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


Re: [Mesa-dev] [PATCH] glxinfo/wglinfo: query/print more GL limits

2018-02-07 Thread Eric Engestrom
On Wednesday, 2018-02-07 08:48:06 -0700, Brian Paul wrote:
> Query/print limits for GL 3.0 through GL 4.6, plus
> GL_ARB_transform_feedback3.  Also, print the GL extension or GL version
> for each set of queries to make it more readable.
> ---
>  src/xdemos/glinfo_common.c | 127 
> -
>  1 file changed, 125 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
> index bd25462..07af989 100644
> --- a/src/xdemos/glinfo_common.c
> +++ b/src/xdemos/glinfo_common.c
> @@ -610,12 +610,127 @@ print_limits(const char *extensions, const char 
> *oglstring, int version,
>{ 1, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, 
> "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", "GL_ARB_vertex_attrib_binding" },
>{ 1, GL_MAX_VERTEX_ATTRIB_BINDINGS, "GL_MAX_VERTEX_ATTRIB_BINDINGS", 
> "GL_ARB_vertex_attrib_binding" },
>  #endif
> +#if defined(GL_VERSION_3_0)
> +  { 1, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, 
> "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "3.0" },
> +  { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 
> "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "3.0" },
> +  { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, 
> "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", "3.0" },
> +#endif
> +#if defined(GL_VERSION_3_1)
> +  { 1, GL_MAX_TEXTURE_BUFFER_SIZE, "GL_MAX_TEXTURE_BUFFER_SIZE", "3.1" },
> +  { 1, GL_MAX_RECTANGLE_TEXTURE_SIZE, "GL_MAX_RECTANGLE_TEXTURE_SIZE", 
> "3.1" },
> +#endif
> +#if defined(GL_VERISON_3_2)

typo

> +  { 1, GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, 
> "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS", "3.2" },
> +  { 1, GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, 
> "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_GEOMETRY_OUTPUT_VERTICES, 
> "GL_MAX_GEOMETRY_OUTPUT_VERTICES", "3.2" },
> +  { 1, GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, 
> "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_VERTEX_OUTPUT_COMPONENTS, 
> "GL_MAX_VERTEX_OUTPUT_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_GEOMETRY_INPUT_COMPONENTS, 
> "GL_MAX_GEOMETRY_INPUT_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, 
> "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_FRAGMENT_INPUT_COMPONENTS, 
> "GL_MAX_FRAGMENT_INPUT_COMPONENTS", "3.2" },
> +  { 1, GL_MAX_SERVER_WAIT_TIMEOUT, "GL_MAX_SERVER_WAIT_TIMEOUT", "3.2" },
> +  { 1, GL_MAX_SAMPLE_MASK_WORDS, "GL_MAX_SAMPLE_MASK_WORDS", "3.2" },
> +  { 1, GL_MAX_COLOR_TEXTURE_SAMPLES, "GL_MAX_COLOR_TEXTURE_SAMPLES", 
> "3.2" },
> +  { 1, GL_MAX_DEPTH_TEXTURE_SAMPLES, "GL_MAX_DEPTH_TEXTURE_SAMPLES", 
> "3.2" },
> +  { 1, GL_MAX_INTEGER_SAMPLES, "GL_MAX_INTEGER_SAMPLES", "3.2" },
> +#endif
> +#if defined(GL_VERSION_3_3)
> +  { 1, GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, 
> "GL_MAX_DUAL_SOURCE_DRAW_BUFFERS", "3.3" },
> +#endif
> +#if defined(GL_VERSION_4_0)
> +  { 1, GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, 
> "GL_MAX_TRANSFORM_FEEDBACK_BUFFERS", "4.0" },
> +#endif
> +#if defined(GL_VERSION_4_1)
> +  { 1, GL_MAX_VERTEX_UNIFORM_VECTORS, "GL_MAX_VERTEX_UNIFORM_VECTORS", 
> "4.1" },
> +  { 1, GL_MAX_VARYING_VECTORS, "GL_MAX_VARYING_VECTORS", "4.1" },
> +  { 1, GL_MAX_FRAGMENT_UNIFORM_VECTORS, 
> "GL_MAX_FRAGMENT_UNIFORM_VECTORS", "4.1" },
> +#endif
> +#if defined(GL_VERSION_4_2)
> +  { 1, GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS, 
> "GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", "4.2" },
> +  { 1, GL_MAX_VERTEX_ATOMIC_COUNTERS, "GL_MAX_VERTEX_ATOMIC_COUNTERS", 
> "4.2" },
> +  { 1, GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS, 
> "GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS", "4.2" },
> +  { 1, GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS, 
> "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS", "4.2" },
> +  { 1, GL_MAX_GEOMETRY_ATOMIC_COUNTERS, 
> "GL_MAX_GEOMETRY_ATOMIC_COUNTERS", "4.2" },
> +  { 1, GL_MAX_FRAGMENT_ATOMIC_COUNTERS, 
> "GL_MAX_FRAGMENT_ATOMIC_COUNTERS", "4.2" },
> +  { 1, GL_MAX_COMBINED_ATOMIC_COUNTERS, 
> "GL_MAX_COMBINED_ATOMIC_COUNTERS", "4.2" },
> +  { 1, GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, 
> "GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE", "4.2" },
> +  { 1, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, 
> "GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", "4.2" },
> +  { 1, GL_MAX_IMAGE_UNITS, "GL_MAX_IMAGE_UNITS", "4.2" },
> +  { 1, GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS, 
> 

Re: [Mesa-dev] [PATCH 1/2] mesa: simplify _mesa_get_compressed_formats()

2018-02-06 Thread Eric Engestrom
 formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x4x3_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x4x4_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x4x4_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x5x4_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x5x5_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x5x5_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x6x5_OES;
> - formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x6x6_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES;
> -  }
> -  else {
> - n += 20;
> -  }
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_3x3x3_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x3x3_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x4x3_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_4x4x4_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x4x4_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x5x4_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_5x5x5_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x5x5_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x6x5_OES;
> +  formats[n++] = GL_COMPRESSED_RGBA_ASTC_6x6x6_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES;
> +  formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES;
> }
>  
> +   assert(n <= ARRAY_SIZE(discard_formats));

I got thrown off by this and thought it should be `n < ARRAY_SIZE()`,
but `n` is post-incremented, which means it will be one above what's
actually used by the time it's checked here, so it's all fine :)

Series is
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> +
> return n;
>  }
>  
> -- 
> 2.7.4
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: ensure xmlpool/options.h is generated for libgallium

2018-02-06 Thread Eric Engestrom
On Monday, 2018-02-05 21:58:33 +, Jon Turney wrote:
> In file included from ../src/gallium/targets/dri/target.c:1:
> In file included from ../src/gallium/auxiliary/target-helpers/drm_helper.h:8:
> ../src/util/xmlpool.h:103:10: fatal error: 'xmlpool/options.h' file not found
> 
> See also 26bde1e3.
> 
> Signed-off-by: Jon Turney <jon.tur...@dronecode.org.uk>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/gallium/targets/dri/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/targets/dri/meson.build 
> b/src/gallium/targets/dri/meson.build
> index 30368c2152..75ce94ab2c 100644
> --- a/src/gallium/targets/dri/meson.build
> +++ b/src/gallium/targets/dri/meson.build
> @@ -51,7 +51,7 @@ endif
>  
>  libgallium_dri = shared_library(
>'gallium_dri',
> -  files('target.c'),
> +  [files('target.c'), xmlpool_options_h],
>include_directories : [
>  inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
>  inc_gallium_winsys, include_directories('../../state_trackers/dri'),
> -- 
> 2.16.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radeonsi: set indent_size in .editorconfig

2018-02-06 Thread Eric Engestrom
On Sunday, 2018-02-04 00:19:33 +0200, Grazvydas Ignotas wrote:
> At least with vim, this is needed to actually get tab instead of
> 3 spaces after hitting the tab key.

Are you sure?

The doc [1] says:

> indent_size:
> [...]
> When set to tab, the value of tab_width (if specified) will be used.

> tab_width:
> a whole number defining the number of columns used to represent a tab
> character. This defaults to the value of indent_size and doesn't
> usually need to be specified.

This sounds to me like `indent_size=tab` means that you want to indent
with `tab_width` spaces?

[1] http://editorconfig.org/#supported-properties

> ---
>  src/gallium/drivers/radeonsi/.editorconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/drivers/radeonsi/.editorconfig 
> b/src/gallium/drivers/radeonsi/.editorconfig
> index cc8e11f..21a3c7d 100644
> --- a/src/gallium/drivers/radeonsi/.editorconfig
> +++ b/src/gallium/drivers/radeonsi/.editorconfig
> @@ -1,2 +1,3 @@
>  [*.{c,h}]
>  indent_style = tab
> +indent_size = tab
> -- 
> 2.7.4
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/6] glx/apple: include util/debug.h for env_var_as_boolean prototype

2018-02-02 Thread Eric Engestrom
On Sunday, 2018-01-28 14:18:27 +, Jon Turney wrote:
> mesa/src/glx/glxcmds.c:1295:21: error: implicit declaration of function 
> 'env_var_as_boolean' is invalid in C99 
> [-Werror,-Wimplicit-function-declaration]
> mesa/src/glx/apple/apple_visual.c:85:28: error: implicit declaration of 
> function 'env_var_as_boolean' is invalid in C99 
> [-Werror,-Wimplicit-function-declaration]

Oops, these are mine :(

Fixes: 3fdbc46b42dcfd3af52d8 "glx: turn LIBGL_DUMP_VISUALID into a boolean"
Fixes: d2768a397d6fb8a094765 "glx: turn LIBGL_PROFILE_CORE into a boolean"
Fixes: 5c68ea29f31283768c8e1 "egl+glx: turn LIBGL_ALWAYS_SOFTWARE into a 
boolean"
Fixes: 43e2d58698f76b96b36ff "glx: turn LIBGL_ALLOW_SOFTWARE into a boolean"
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/glx/apple/apple_visual.c | 1 +
>  src/glx/glxcmds.c| 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
> index d482bfc4e71..4a90d77c3a5 100644
> --- a/src/glx/apple/apple_visual.c
> +++ b/src/glx/apple/apple_visual.c
> @@ -32,6 +32,7 @@
>  #include 
>  #include 
>  #include 
> +#include 

Nit: use "" instead of <> for local includes :)

>  
>  /*  */
>  #define glTexImage1D glTexImage1D_OSX
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index eee45d962d7..943b81754f3 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -43,6 +43,7 @@
>  #ifdef GLX_USE_APPLEGL
>  #include "apple/apple_glx_context.h"
>  #include "apple/apple_glx.h"
> +#include "util/debug.h"
>  #else
>  #include 
>  #ifdef XF86VIDMODE
> -- 
> 2.15.1
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


<    5   6   7   8   9   10   11   12   13   14   >