Re: [Mesa-dev] Make Jordan an Owner of the mesa project?

2018-12-03 Thread David Airlie
On Tue, Dec 4, 2018 at 10:49 AM Jason Ekstrand  wrote:
>
> Jordan has requested to be made an Owner of the mesa project.  As much as I 
> may be the guy who pushed to get everything set up, I don't want to do this 
> sort of thing on my own.  As such, I'm asking for some ACKs.  If I can get 5 
> ACKs (at least 2 non-intel) from other Owners and no NAKs, I'll click the 
> button.
>
> Personally, I think the answer here is absurdly obvious.  Jordan is one of 
> the most involved people in the community. :-D
>
> As a side-note, does this seem like a reasonable process for adding people as 
> Owners?

Ack and yes until we get issues I suppose and we can just thumbs up.

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


Re: [Mesa-dev] [PATCH 0/4] virgil: fix crash when mapping ms-texture

2018-09-06 Thread David Airlie
On Thu, Sep 6, 2018 at 7:58 PM, Erik Faye-Lund
 wrote:
> Here's a series of patches to address a crash when mapping multisampled
> textures in piglit. The crash can easily be reproduce using the
> following command:
>
> bin/copyteximage 2D -samples=2 -auto
>
> However, it's not clear to me if this is the right fix or not; the
> resource creation code and the resource mapping code is inconsistent in
> dealing with backing-storage. I decided to go for the widest definition
> here, but it's possible the narrower one would be more appropriate.
>
> The first three patches are smaller cleanups that were noticed while
> debugging this, and not directly related to the crash.
>
> It's also worth mentioning that the test doesn't pass after this
> either, but at least it doesn't crash. The non-multisample versions of
> this test doesn't pass either, so I think the failure is unrelated to
> the presence of backing-store.
>
> Dave, what are your thoughts here? It seems you introduced this
> inconsistency in the very first commit to virgl. Was there some
> expectation of some third, non-depth handling case here that just didn't
> get noticed until now?

Mapping multisample texture doesn't make sense, since what is in the
mapping is undefined, and since we can't ever directly access multisample
textures on the host side, we don't bother creating a backing store.

I've looked into this before but I'm not remembering quite why this fails,
these patches are good enough to stop the crashing, but I'd have
to redig into what would fix it properly.

For the series:
Reviewed-by: Dave Airlie 
>
> Erik Faye-Lund (4):
>   virgl: free trans on map-error
>   virgl: drop needless return-code
>   virgl: remove dead code
>   virgl: do not map zero-sized resource
>
>  src/gallium/drivers/virgl/virgl_texture.c | 13 -
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> --
> 2.17.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] drisw: Fix build on Android Nougat, which lacks shm (v2)

2018-08-02 Thread David Airlie
On Tue, Jul 31, 2018 at 1:17 PM, Chad Versace 
wrote:

> In commit cf54bd5e8, dri_sw_winsys.c began using  to support
> the new functions putImageShm, getImageShm in DRI_SWRastLoader. But
> Android began supporting System V shared memory only in Oreo. Nougat has
> no shm headers.
>
> Fix the build by ifdef'ing out the shm code on Nougat.


> Fixes: cf54bd5e8 "drisw: use shared memory when possible"
> Cc: Marc-André Lureau 
> Cc: Dave Airlie 
> ---
>
> Dave, is this what you had in mind?
>

Yeah that seems a lot more acceptable.

Reviewed-by: Dave Airlie 

>
> I considered putting a check in configure.ac for HAVE_SHM, but decided
> against it because (1) another Autoconf check would slow down everyone's
> build for a niche case that only a few people care about, and (2) it
> only affected this file.
>
>  src/gallium/winsys/sw/dri/dri_sw_winsys.c | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> index 40007200a5d..d519bcfedd3 100644
> --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> @@ -26,8 +26,12 @@
>   *
>   
> **/
>
> +#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
> +/* Android's libc began supporting shm in Oreo */
> +#define HAVE_SHM
>  #include 
>  #include 
> +#endif
>
>  #include "pipe/p_compiler.h"
>  #include "pipe/p_format.h"
> @@ -83,6 +87,7 @@ dri_sw_is_displaytarget_format_supported( struct
> sw_winsys *ws,
> return TRUE;
>  }
>
> +#ifdef HAVE_SHM
>  static char *
>  alloc_shm(struct dri_sw_displaytarget *dri_sw_dt, unsigned size)
>  {
> @@ -101,6 +106,7 @@ alloc_shm(struct dri_sw_displaytarget *dri_sw_dt,
> unsigned size)
>
> return addr;
>  }
> +#endif
>
>  static struct sw_displaytarget *
>  dri_sw_displaytarget_create(struct sw_winsys *winsys,
> @@ -131,8 +137,11 @@ dri_sw_displaytarget_create(struct sw_winsys *winsys,
> size = dri_sw_dt->stride * nblocksy;
>
> dri_sw_dt->shmid = -1;
> +
> +#ifdef HAVE_SHM
> if (ws->lf->put_image_shm)
>dri_sw_dt->data = alloc_shm(dri_sw_dt, size);
> +#endif
>
> if(!dri_sw_dt->data)
>dri_sw_dt->data = align_malloc(size, alignment);
> @@ -156,8 +165,10 @@ dri_sw_displaytarget_destroy(struct sw_winsys *ws,
> struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
>
> if (dri_sw_dt->shmid >= 0) {
> +#ifdef HAVE_SHM
>shmdt(dri_sw_dt->data);
>shmctl(dri_sw_dt->shmid, IPC_RMID, 0);
> +#endif
> } else {
>align_free(dri_sw_dt->data);
> }
> --
> 2.18.0.345.g5c9ce644c3-goog
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] drisw: Fix build on Android Nougat

2018-07-24 Thread David Airlie
On Thu, Jul 19, 2018 at 10:43 AM, Chad Versace 
wrote:

> In commit cf54bd5e8, dri_sw_winsys.c began using  to support
> the new functions putImageShm, getImageShm in DRI_SWRastLoader. But
> Android began supporting System V shared memory only in Oreo. Nougat has
> no shm headers.
>
> Fix the build by ifdef'ing out the shm code on Nougat.
>

No that's horrible. At least make a HAVE_IPC define or something so
the if android horror can be hidden a bit out of the way at the top of the
file
or the build system.

Dave.


> Fixes: cf54bd5e8 "drisw: use shared memory when possible"
> Cc: Marc-André Lureau  Cc: Dave Airlie 
> ---
>  src/gallium/winsys/sw/dri/dri_sw_winsys.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> index 40007200a5d..147e0f7c430 100644
> --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> @@ -26,8 +26,10 @@
>   *
>   
> **/
>
> +#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
>  #include 
>  #include 
> +#endif
>
>  #include "pipe/p_compiler.h"
>  #include "pipe/p_format.h"
> @@ -83,6 +85,7 @@ dri_sw_is_displaytarget_format_supported( struct
> sw_winsys *ws,
> return TRUE;
>  }
>
> +#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
>  static char *
>  alloc_shm(struct dri_sw_displaytarget *dri_sw_dt, unsigned size)
>  {
> @@ -101,6 +104,7 @@ alloc_shm(struct dri_sw_displaytarget *dri_sw_dt,
> unsigned size)
>
> return addr;
>  }
> +#endif
>
>  static struct sw_displaytarget *
>  dri_sw_displaytarget_create(struct sw_winsys *winsys,
> @@ -131,8 +135,11 @@ dri_sw_displaytarget_create(struct sw_winsys *winsys,
> size = dri_sw_dt->stride * nblocksy;
>
> dri_sw_dt->shmid = -1;
> +
> +#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
> if (ws->lf->put_image_shm)
>dri_sw_dt->data = alloc_shm(dri_sw_dt, size);
> +#endif
>
> if(!dri_sw_dt->data)
>dri_sw_dt->data = align_malloc(size, alignment);
> @@ -156,8 +163,10 @@ dri_sw_displaytarget_destroy(struct sw_winsys *ws,
> struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
>
> if (dri_sw_dt->shmid >= 0) {
> +#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
>shmdt(dri_sw_dt->data);
>shmctl(dri_sw_dt->shmid, IPC_RMID, 0);
> +#endif
> } else {
>align_free(dri_sw_dt->data);
> }
> --
> 2.18.0.233.g985f88cf7e-goog
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v4] virgl: Add support for glGetMultisample

2018-07-10 Thread David Airlie
On Tue, Jul 10, 2018 at 4:44 PM, Gert Wollny 
wrote:

> Am Dienstag, den 10.07.2018, 09:19 +1000 schrieb Dave Airlie:
> >
> > Just FYI in future please don't push mesa patches until the renderer
> > side patch has landed, this is to avoid the abi accidentally
> > diverging around the caps.
> Sure, I'll keep that in mind, and sorry for rushing to push this.
>
> However, this actually points to a bigger problem: Given that the
> mesa/virgl driver is completely separate from the host virglrenderer,
> how do we ensure in a real world application that host and guest agree
> on the abi? There is this 'version' in the
> vrend_renderer_fill_caps_common and the 'max_version' in the caps, but
> the first one is not used at all, and the second is not used beyond
> signalling the availability of caps set 2. Maybe we should define some
> algorithm to bump that latter number so the client can see what values
> in the caps were actually filled by the host?
>
>
We already deal with ABI at runtime. The problem is diverging the
virgl_hw.h file.

One copy of that file needs to be master and we only add to the end of the
caps v2
struct, but the version that is the master copy is the one in
virglrenderer. So if
we end up pushing patches to mesa first, and someone pushes another change
to virglrenderer we get incompatible overlap.

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


Re: [Mesa-dev] [PATCH 1/1] drisw: Fix invalid pointer arithmetic

2018-06-07 Thread David Airlie
On Fri, Jun 8, 2018 at 9:59 AM, Jan Vesely  wrote:

> Use of void * in pointer arithmetic is illegal, use char * instead.
> Fixes: cf54bd5e8381dba18d52fe438acda20cc1685bf3 ("drisw: use shared
> memory when possible")
>
> Signed-off-by: Jan Vesely 
>

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


Re: [Mesa-dev] [PATCH 1/4] gallium: Add integer 64 capability

2017-01-26 Thread David Airlie


- Original Message -
> From: "Marek Olšák" 
> To: "Nicolai Hähnle" 
> Cc: "Ilia Mirkin" , mesa-dev@lists.freedesktop.org, 
> "Dave Airlie" 
> Sent: Friday, 27 January, 2017 6:18:32 AM
> Subject: Re: [Mesa-dev] [PATCH 1/4] gallium: Add integer 64 capability
> 
> On Thu, Jan 26, 2017 at 9:04 PM, Nicolai Hähnle  wrote:
> > On 26.01.2017 20:23, Ilia Mirkin wrote:
> >>
> >> I have no serious preference, but for doubles, we use a shader cap.
> >
> >
> > I think this:
> >
> >> On Thu, Jan 26, 2017 at 2:09 PM, Nicolai Hähnle 
> >> wrote:
> >>>
> >>> v1.1: move to using a normal CAP. (Marek)
> >
> >
> > ... suggests that this has already gone back and forth :)
> >
> > Pragmatically, is there hardware that can do 64 bit ints only in some of
> > the
> > shader stages?
> 
> I'll give you a different answer: I think the double cap and other
> shader caps can be changed to normal caps if there is no reason for
> them to be shader caps.
> 

I think the doubles cap should be non-shader now, but not so motivated to write 
a patch.

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


Re: [Mesa-dev] [PATCH] glsl: remove specical case subroutine type counting

2015-08-30 Thread David Airlie

 On Sun, 2015-08-09 at 16:25 +1000, Timothy Arceri wrote:
  Unlike samplers we can get the correct value for subroutines from
  component_slots()

Reviewed-by: Dave Airlie airl...@redhat.com
  ---
   src/glsl/link_uniforms.cpp | 5 ++---
   1 file changed, 2 insertions(+), 3 deletions(-)
  
  diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
  index 4757fd5..3c6930a 100644
  --- a/src/glsl/link_uniforms.cpp
  +++ b/src/glsl/link_uniforms.cpp
  @@ -47,10 +47,9 @@
   static unsigned
   values_for_type(const glsl_type *type)
   {
  -   if (type-is_sampler() || type-is_subroutine()) {
  +   if (type-is_sampler()) {
 return 1;
  -   } else if (type-is_array()  (type-fields.array-is_sampler() ||
  -   type-fields.array-is_subroutine())) {
  +   } else if (type-is_array()  type-fields.array-is_sampler()) {
 return type-array_size();
  } else {
 return type-component_slots();
 
 Bumping and Cc: Dave
 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev