Retiring the GitHub mirrors

2023-01-20 Thread Eric Engestrom
Hello everyone,

For many years now, we have maintained mirrors of numerous FDo projects
on GitHub, under the following organisations:
https://github.com/freedesktop
https://github.com/mesa3d
https://github.com/wayland-project

A bit over a month ago, a new security feature in git started preventing
our script from updating these repos, which wasn't noticed right away
due to people being on holiday. The question that has come up as
a result is whether there is any need to keep working on these mirrors,
or whether they should be deleted instead.

Among the people present in this discussion, the consensus was that we
should delete them.

If you need to keep the mirror for your repo alive, you can set up
push mirroring from GitLab [1], and let us know by *February 20th*
that we should not delete your repo.

Cheers,
  Eric, on behalf of the FDo admins

[1] https://docs.gitlab.com/ee/user/project/repository/mirror/push.html


signature.asc
Description: PGP signature


Re: [PATCH libdrm] meson.build: Don't detect header for linux

2020-03-29 Thread Eric Engestrom
On Wednesday, 2020-01-29 09:53:16 +, Eric Engestrom wrote:
> On Friday, 2020-01-10 13:30:41 +0900, Seung-Woo Kim wrote:
> > The  header is not required for Linux and GNU libc
> > 2.30 starts to warn about Linux specific  header
> > deprecation. Don't detect  header for linux.
> > 
> > Signed-off-by: Seung-Woo Kim 
> > ---
> > Fix meson.build script instead of code itself as commented below:
> > https://patchwork.kernel.org/patch/11325345/
> > ---
> >  meson.build |   15 +++
> >  1 files changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 782b1a3..b1c557a 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -183,10 +183,17 @@ else
> >dep_rt = []
> >  endif
> >  dep_m = cc.find_library('m', required : false)
> > -# From Niclas Zeising:
> > -# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> > -# includes when checking for headers.
> > -foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
> > +if not ['linux'].contains(host_machine.system())
> > +  # From Niclas Zeising:
> > +  # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> > +  # includes when checking for headers.
> > +  foreach header : ['sys/sysctl.h']
> > +config.set('HAVE_' + header.underscorify().to_upper(),
> > +  cc.compiles('#include \n#include <@0@>'.format(header), 
> > name : '@0@ works'.format(header)))
> > +  endforeach
> > +endif
> > +endforeach
> 
> Stray `endforeach`.
> 
> Could you post your patch as a Merge Request [1] instead of on the mailing 
> list?
> The automatic testing there means it would instantly catch mistakes like 
> these :)
> 
> [1] https://gitlab.freedesktop.org/mesa/drm/merge_requests
> 
> > +foreach header : ['sys/select.h', 'alloca.h']
> >config.set('HAVE_' + header.underscorify().to_upper(),
> >  cc.compiles('#include \n#include <@0@>'.format(header), 
> > name : '@0@ works'.format(header)))
> 
> Can you drop the `#include \n` now that sys/sysctl.h is
> being split out?
> 
> Note that since https://gitlab.freedesktop.org/mesa/drm/merge_requests/8
> we now use config.set10(), which means you'll need to refactor a tiny
> bit (move the !linux condition inside the config.set10() call).
> 
> The new code block should look like this:
> 
>   # From Niclas Zeising:
>   # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
>   # includes when checking for headers.
>   foreach header : ['sys/sysctl.h']
> config.set10('HAVE_' + header.underscorify().to_upper(),
>not ['linux'].contains(host_machine.system()) and
>cc.compiles('#include \n#include <@0@>'.format(header), 
> name : '@0@ works'.format(header)))
>   endforeach

FYI, I have posted a variant of the above as a merge request:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/53
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 libdrm 2/2] Add drmModeGetFB2

2020-02-11 Thread Eric Engestrom
On Thursday, 2020-02-06 17:46:36 +, Li, Juston wrote:
> On Wed, 2020-02-05 at 23:27 +0000, Eric Engestrom wrote:
> > On Wednesday, 2020-02-05 23:10:21 +, Li, Juston wrote:
> > > On Wed, 2020-02-05 at 22:25 +0000, Eric Engestrom wrote:
> > > > On Friday, 2020-01-31 13:41:09 -0800, Juston Li wrote:
> > > > > From: Daniel Stone 
> > > > >
> > > > > Add a wrapper around the getfb2 ioctl, which returns extended
> > > > > framebuffer information mirroring addfb2, including multiple
> > > > > planes
> > > > > and
> > > > > modifiers.
> > > > >
> > > > > Changes since v3:
> > > > >  - remove unnecessary null check in drmModeFreeFB2 (Daniel
> > > > > Stone)
> > > > >
> > > > > Changes since v2:
> > > > >  - getfb2 ioctl has been merged upstream
> > > > >  - sync include/drm/drm.h in a seperate patch
> > > > >
> > > > > Changes since v1:
> > > > >  - functions should be drm_public
> > > > >  - modifier should be 64 bits
> > > > >  - update ioctl number
> > > > >
> > > > > Signed-off-by: Juston Li 
> > > > > Signed-off-by: Daniel Stone 
> > > > > ---
> > > > >  xf86drmMode.c | 36 
> > > > >  xf86drmMode.h | 15 +++
> > > > >  2 files changed, 51 insertions(+)
> > > > >
> > > > > diff --git a/xf86drmMode.c b/xf86drmMode.c
> > > > > index 0cf7992c6e9a..94dc8ce38a5e 100644
> > > > > --- a/xf86drmMode.c
> > > > > +++ b/xf86drmMode.c
> > > > > @@ -1594,3 +1594,39 @@ drmModeRevokeLease(int fd, uint32_t
> > > > > lessee_id)
> > > > >  return 0;
> > > > >  return -errno;
> > > > >  }
> > > > > +
> > > > > +drm_public drmModeFB2Ptr
> > > > > +drmModeGetFB2(int fd, uint32_t fb_id)
> > > > > +{
> > > > > +struct drm_mode_fb_cmd2 get;
> > > > > +drmModeFB2Ptr ret;
> > > > > +int err;
> > > > > +
> > > > > +memclear(get);
> > > > > +get.fb_id = fb_id;
> > > >
> > > > As mentioned on IRC, could you write it like this instead?
> > > >
> > > > struct drm_mode_fb_cmd2 get = {
> > > > .fb_id = fb_id,
> > > > };
> > > >
> > > > With that, consider this patch
> > > > Reviewed-by: Eric Engestrom 
> > >
> > > Opps I sent v5 before seeing this but my code style differs and is
> > > probably incorrect :) I'll send v6 with the style corrected.
> > >
> > > Thanks for reviewing!
> >
> > Ah, sorry about that, our emails crossed paths.
> >
> > As for the other patch (I mean 1/2), did you follow the instructions
> > in
> > include/drm/README, specifically the section titled "When and how to
> > update these files" ?
> > Your commit message makes it look like you just applied that one
> > change
> > instead of syncing with `make headers_install`.
> >
> > Cheers,
> >   Eric
> 
> Yes, drm.h was copied from 'make headers_install' from drm-misc-next.
> It had been updated fairly recently so GETFB2 is the only delta.
> 
> Sorry, I didn't see the README so the commit message isn't exactly as
> requested.

I kind of expected that this was the case :)

All good then, with the commit message adjusted to make this clear,
patch 1 is:
Acked-by: Eric Engestrom 

> 
> 
> Also, only drm.h was synced, is that preferred or would it be better to
> sync the entire header directory?

Usually people either update their driver's header and core, or just core,
so this is fine :)

I assume DanielS will merge this for you?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 libdrm 2/2] Add drmModeGetFB2

2020-02-05 Thread Eric Engestrom
On Wednesday, 2020-02-05 23:10:21 +, Li, Juston wrote:
> On Wed, 2020-02-05 at 22:25 +0000, Eric Engestrom wrote:
> > On Friday, 2020-01-31 13:41:09 -0800, Juston Li wrote:
> > > From: Daniel Stone 
> > >
> > > Add a wrapper around the getfb2 ioctl, which returns extended
> > > framebuffer information mirroring addfb2, including multiple planes
> > > and
> > > modifiers.
> > >
> > > Changes since v3:
> > >  - remove unnecessary null check in drmModeFreeFB2 (Daniel Stone)
> > >
> > > Changes since v2:
> > >  - getfb2 ioctl has been merged upstream
> > >  - sync include/drm/drm.h in a seperate patch
> > >
> > > Changes since v1:
> > >  - functions should be drm_public
> > >  - modifier should be 64 bits
> > >  - update ioctl number
> > >
> > > Signed-off-by: Juston Li 
> > > Signed-off-by: Daniel Stone 
> > > ---
> > >  xf86drmMode.c | 36 
> > >  xf86drmMode.h | 15 +++
> > >  2 files changed, 51 insertions(+)
> > >
> > > diff --git a/xf86drmMode.c b/xf86drmMode.c
> > > index 0cf7992c6e9a..94dc8ce38a5e 100644
> > > --- a/xf86drmMode.c
> > > +++ b/xf86drmMode.c
> > > @@ -1594,3 +1594,39 @@ drmModeRevokeLease(int fd, uint32_t
> > > lessee_id)
> > >  return 0;
> > >  return -errno;
> > >  }
> > > +
> > > +drm_public drmModeFB2Ptr
> > > +drmModeGetFB2(int fd, uint32_t fb_id)
> > > +{
> > > +struct drm_mode_fb_cmd2 get;
> > > +drmModeFB2Ptr ret;
> > > +int err;
> > > +
> > > +memclear(get);
> > > +get.fb_id = fb_id;
> >
> > As mentioned on IRC, could you write it like this instead?
> >
> > struct drm_mode_fb_cmd2 get = {
> > .fb_id = fb_id,
> > };
> >
> > With that, consider this patch
> > Reviewed-by: Eric Engestrom 
> 
> Opps I sent v5 before seeing this but my code style differs and is
> probably incorrect :) I'll send v6 with the style corrected.
> 
> Thanks for reviewing!

Ah, sorry about that, our emails crossed paths.

As for the other patch (I mean 1/2), did you follow the instructions in
include/drm/README, specifically the section titled "When and how to
update these files" ?
Your commit message makes it look like you just applied that one change
instead of syncing with `make headers_install`.

Cheers,
  Eric
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 libdrm 2/2] Add drmModeGetFB2

2020-02-05 Thread Eric Engestrom
On Friday, 2020-01-31 13:41:09 -0800, Juston Li wrote:
> From: Daniel Stone 
> 
> Add a wrapper around the getfb2 ioctl, which returns extended
> framebuffer information mirroring addfb2, including multiple planes and
> modifiers.
> 
> Changes since v3:
>  - remove unnecessary null check in drmModeFreeFB2 (Daniel Stone)
> 
> Changes since v2:
>  - getfb2 ioctl has been merged upstream
>  - sync include/drm/drm.h in a seperate patch
> 
> Changes since v1:
>  - functions should be drm_public
>  - modifier should be 64 bits
>  - update ioctl number
> 
> Signed-off-by: Juston Li 
> Signed-off-by: Daniel Stone 
> ---
>  xf86drmMode.c | 36 
>  xf86drmMode.h | 15 +++
>  2 files changed, 51 insertions(+)
> 
> diff --git a/xf86drmMode.c b/xf86drmMode.c
> index 0cf7992c6e9a..94dc8ce38a5e 100644
> --- a/xf86drmMode.c
> +++ b/xf86drmMode.c
> @@ -1594,3 +1594,39 @@ drmModeRevokeLease(int fd, uint32_t lessee_id)
>   return 0;
>   return -errno;
>  }
> +
> +drm_public drmModeFB2Ptr
> +drmModeGetFB2(int fd, uint32_t fb_id)
> +{
> + struct drm_mode_fb_cmd2 get;
> + drmModeFB2Ptr ret;
> + int err;
> +
> + memclear(get);
> + get.fb_id = fb_id;

As mentioned on IRC, could you write it like this instead?

    struct drm_mode_fb_cmd2 get = {
.fb_id = fb_id,
};

With that, consider this patch
Reviewed-by: Eric Engestrom 

> +
> + err = DRM_IOCTL(fd, DRM_IOCTL_MODE_GETFB2, &get);
> + if (err != 0)
> + return NULL;
> +
> + ret = drmMalloc(sizeof(drmModeFB2));
> + if (!ret)
> + return NULL;
> +
> + ret->fb_id = fb_id;
> + ret->width = get.width;
> + ret->height = get.height;
> + ret->pixel_format = get.pixel_format;
> + ret->flags = get.flags;
> + ret->modifier = get.modifier[0];
> + memcpy(ret->handles, get.handles, sizeof(uint32_t) * 4);
> + memcpy(ret->pitches, get.pitches, sizeof(uint32_t) * 4);
> + memcpy(ret->offsets, get.offsets, sizeof(uint32_t) * 4);
> +
> + return ret;
> +}
> +
> +drm_public void drmModeFreeFB2(drmModeFB2Ptr ptr)
> +{
> + drmFree(ptr);
> +}
> diff --git a/xf86drmMode.h b/xf86drmMode.h
> index 159a39937240..fc0bbd8dcb67 100644
> --- a/xf86drmMode.h
> +++ b/xf86drmMode.h
> @@ -225,6 +225,19 @@ typedef struct _drmModeFB {
>   uint32_t handle;
>  } drmModeFB, *drmModeFBPtr;
>  
> +typedef struct _drmModeFB2 {
> + uint32_t fb_id;
> + uint32_t width, height;
> + uint32_t pixel_format; /* fourcc code from drm_fourcc.h */
> + uint64_t modifier; /* applies to all buffers */
> + uint32_t flags;
> +
> + /* per-plane GEM handle; may be duplicate entries for multiple planes */
> + uint32_t handles[4];
> + uint32_t pitches[4]; /* bytes */
> + uint32_t offsets[4]; /* bytes */
> +} drmModeFB2, *drmModeFB2Ptr;
> +
>  typedef struct drm_clip_rect drmModeClip, *drmModeClipPtr;
>  
>  typedef struct _drmModePropertyBlob {
> @@ -343,6 +356,7 @@ typedef struct _drmModePlaneRes {
>  extern void drmModeFreeModeInfo( drmModeModeInfoPtr ptr );
>  extern void drmModeFreeResources( drmModeResPtr ptr );
>  extern void drmModeFreeFB( drmModeFBPtr ptr );
> +extern void drmModeFreeFB2( drmModeFB2Ptr ptr );
>  extern void drmModeFreeCrtc( drmModeCrtcPtr ptr );
>  extern void drmModeFreeConnector( drmModeConnectorPtr ptr );
>  extern void drmModeFreeEncoder( drmModeEncoderPtr ptr );
> @@ -362,6 +376,7 @@ extern drmModeResPtr drmModeGetResources(int fd);
>   * Retrieve information about framebuffer bufferId
>   */
>  extern drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId);
> +extern drmModeFB2Ptr drmModeGetFB2(int fd, uint32_t bufferId);
>  
>  /**
>   * Creates a new framebuffer with an buffer object as its scanout buffer.
> -- 
> 2.21.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] meson.build: Don't detect header for linux

2020-01-29 Thread Eric Engestrom
On Friday, 2020-01-10 13:30:41 +0900, Seung-Woo Kim wrote:
> The  header is not required for Linux and GNU libc
> 2.30 starts to warn about Linux specific  header
> deprecation. Don't detect  header for linux.
> 
> Signed-off-by: Seung-Woo Kim 
> ---
> Fix meson.build script instead of code itself as commented below:
> https://patchwork.kernel.org/patch/11325345/
> ---
>  meson.build |   15 +++
>  1 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 782b1a3..b1c557a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -183,10 +183,17 @@ else
>dep_rt = []
>  endif
>  dep_m = cc.find_library('m', required : false)
> -# From Niclas Zeising:
> -# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> -# includes when checking for headers.
> -foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
> +if not ['linux'].contains(host_machine.system())
> +  # From Niclas Zeising:
> +  # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> +  # includes when checking for headers.
> +  foreach header : ['sys/sysctl.h']
> +config.set('HAVE_' + header.underscorify().to_upper(),
> +  cc.compiles('#include \n#include <@0@>'.format(header), 
> name : '@0@ works'.format(header)))
> +  endforeach
> +endif
> +endforeach

Stray `endforeach`.

Could you post your patch as a Merge Request [1] instead of on the mailing list?
The automatic testing there means it would instantly catch mistakes like these 
:)

[1] https://gitlab.freedesktop.org/mesa/drm/merge_requests

> +foreach header : ['sys/select.h', 'alloca.h']
>config.set('HAVE_' + header.underscorify().to_upper(),
>  cc.compiles('#include \n#include <@0@>'.format(header), 
> name : '@0@ works'.format(header)))

Can you drop the `#include \n` now that sys/sysctl.h is
being split out?

Note that since https://gitlab.freedesktop.org/mesa/drm/merge_requests/8
we now use config.set10(), which means you'll need to refactor a tiny
bit (move the !linux condition inside the config.set10() call).

The new code block should look like this:

  # From Niclas Zeising:
  # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
  # includes when checking for headers.
  foreach header : ['sys/sysctl.h']
config.set10('HAVE_' + header.underscorify().to_upper(),
   not ['linux'].contains(host_machine.system()) and
   cc.compiles('#include \n#include <@0@>'.format(header), 
name : '@0@ works'.format(header)))
  endforeach

With that:
Reviewed-by: Eric Engestrom 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] intel: drm_intel_bo_gem_create_from_* on platforms w/o HW tiling

2020-01-21 Thread Eric Engestrom
On Monday, 2020-01-20 18:43:43 +0200, Imre Deak wrote:
> Platforms without a HW detiler doesn't support the get_tiling IOCTL.
> Fix the drm_intel_bo_gem_create_from_* functions assuming the default
> no-tiling, no-swizzling setting for the GEM buffer in this case.
> 
> Signed-off-by: Imre Deak 
> ---
>  intel/intel_bufmgr_gem.c | 42 +---
>  1 file changed, 26 insertions(+), 16 deletions(-)
> 
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index fbf48730..fc249ef1 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -1069,6 +1069,27 @@ check_bo_alloc_userptr(drm_intel_bufmgr *bufmgr,
> tiling_mode, stride, size, flags);
>  }
>  
> +static int get_tiling_mode(drm_intel_bufmgr_gem *bufmgr_gem,
> +uint32_t gem_handle,
> +uint32_t *tiling_mode,
> +uint32_t *swizzle_mode)
> +{
> + struct drm_i915_gem_get_tiling get_tiling;
> + int ret;
> +
> + memclear(get_tiling);
> + ret = drmIoctl(bufmgr_gem->fd,
> +DRM_IOCTL_I915_GEM_GET_TILING,
> +&get_tiling);

You're missing `get_tiling.handle = gem_handle;`

Or better yet, just initialise `get_tiling` and get rid of the memclear():
  struct drm_i915_gem_get_tiling get_tiling = {
.handle = gem_handle,
  };

With either fix:
Reviewed-by: Eric Engestrom 

FYI, I've posted the following MR for the equivalent Mesa changes:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3497

> + if (ret != 0 && errno != EOPNOTSUPP)
> + return ret;
> +
> + *tiling_mode = get_tiling.tiling_mode;
> + *swizzle_mode = get_tiling.swizzle_mode;
> +
> + return 0;
> +}
> +
>  /**
>   * Returns a drm_intel_bo wrapping the given buffer object handle.
>   *
> @@ -1084,7 +1105,6 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr 
> *bufmgr,
>   drm_intel_bo_gem *bo_gem;
>   int ret;
>   struct drm_gem_open open_arg;
> - struct drm_i915_gem_get_tiling get_tiling;
>  
>   /* At the moment most applications only have a few named bo.
>* For instance, in a DRI client only the render buffers passed
> @@ -1146,16 +1166,11 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr 
> *bufmgr,
>   HASH_ADD(name_hh, bufmgr_gem->name_table,
>global_name, sizeof(bo_gem->global_name), bo_gem);
>  
> - memclear(get_tiling);
> - get_tiling.handle = bo_gem->gem_handle;
> - ret = drmIoctl(bufmgr_gem->fd,
> -DRM_IOCTL_I915_GEM_GET_TILING,
> -&get_tiling);
> + ret = get_tiling_mode(bufmgr_gem, bo_gem->gem_handle,
> +   &bo_gem->tiling_mode, &bo_gem->swizzle_mode);
>   if (ret != 0)
>   goto err_unref;
>  
> - bo_gem->tiling_mode = get_tiling.tiling_mode;
> - bo_gem->swizzle_mode = get_tiling.swizzle_mode;
>   /* XXX stride is unknown */
>   drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem, 0);
>   DBG("bo_create_from_handle: %d (%s)\n", handle, bo_gem->name);
> @@ -2634,7 +2649,6 @@ drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr 
> *bufmgr, int prime_fd, int s
>   int ret;
>   uint32_t handle;
>   drm_intel_bo_gem *bo_gem;
> - struct drm_i915_gem_get_tiling get_tiling;
>  
>   pthread_mutex_lock(&bufmgr_gem->lock);
>   ret = drmPrimeFDToHandle(bufmgr_gem->fd, prime_fd, &handle);
> @@ -2688,15 +2702,11 @@ drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr 
> *bufmgr, int prime_fd, int s
>   bo_gem->has_error = false;
>   bo_gem->reusable = false;
>  
> - memclear(get_tiling);
> - get_tiling.handle = bo_gem->gem_handle;
> - if (drmIoctl(bufmgr_gem->fd,
> -  DRM_IOCTL_I915_GEM_GET_TILING,
> -  &get_tiling))
> + ret = get_tiling_mode(bufmgr_gem, handle,
> +   &bo_gem->tiling_mode, &bo_gem->swizzle_mode);
> + if (ret)
>   goto err;
>  
> - bo_gem->tiling_mode = get_tiling.tiling_mode;
> - bo_gem->swizzle_mode = get_tiling.swizzle_mode;
>   /* XXX stride is unknown */
>   drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem, 0);
>  
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: Requesting commit access to libdrm

2019-12-29 Thread Eric Engestrom
On Monday, 2019-12-16 16:51:28 +, Souza, Jose wrote:
> Hello
> 
> I have being contributing to i915 for the past 2 years and part of my
> work is update the PCI ids of Intel devices in libdrm.
> Being able to push my reviewed patches would be really helpful, please
> consider this request.

This is somewhat orthogonal to your access request, but libdrm now uses
Merge Requests (https://gitlab.freedesktop.org/mesa/drm/merge_requests),
which means if you post a change and it's been reviewed, any one of the
100+ members can click the "merge" button for you, so not having access
yourself shouldn't be an issue, especially with the number of Intel devs
who do have access.

(It also means changes are tested (although mostly build-tested for now)
before they are merged, which reduces the frequency of breakages,
especially subtle ones.)

You can still request access if you want by opening an issue
(https://gitlab.freedesktop.org/mesa/drm/issues/new), but since you have
very few commits you'll need approval from another member; I suggest you
cc Lucas (@demarchi) & Rodrigo (@vivijim) by tagging them in your issue.

Hope this helps :)

Cheers,
  Eric
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm v4] modetest: Use floating vrefresh while dumping mode

2019-12-05 Thread Eric Engestrom
On Tuesday, 2019-12-03 06:37:36 -0800, Devarsh Thakkar wrote:
> Add function to derive floating value of vertical
> refresh rate from drm mode using pixel clock,
> horizontal total size and vertical total size.
> 
> Use this function to find suitable mode having vrefresh
> value which is matching with user provided vrefresh value.
> 
> If user doesn't provide any vrefresh value in args then
> update vertical refresh rate value in pipe args using this
> function.
> 
> Also use this function for printing floating vrefresh while
> dumping all available modes.
> 
> This will give more accurate picture to user for available modes
> differentiated by floating vertical refresh rate and help user
> select more appropriate mode using suitable refresh rate value.

Any chance you could use the merge requests infra instead of patches on
the mailing list? :)
https://gitlab.freedesktop.org/mesa/drm/merge_requests

This will allow much easier reviews of the patch's revisions and
build-test your changes automatically.

Can I also suggest you split the unrelated changes into individual
commits?

> 
> V4:
> 1) While setting mode, print mode name and vrefresh using struct
>drmModeModeInfo instead of struct pipe_args.
> 2) Revert back to using a float value instead of float *
>for vrefresh arg in connector_find_mode().
> 
> V3:
> 1) Change name of function used to derive refresh rate.
> 
> V2:
> 1) Don't use inline function for deriving refresh rate from mode.
> 2) If requested mode not found, print refresh rate only
>if user had provided it in args.
> 
> Signed-off-by: Devarsh Thakkar 
> Reviewed-by: Neil Armstrong 
> ---
>  tests/modetest/modetest.c | 35 +++
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index b4edfcb..e998e8e 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c
> @@ -133,6 +133,12 @@ static inline int64_t U642I64(uint64_t val)
>   return (int64_t)*((int64_t *)&val);
>  }
>  
> +static float mode_vrefresh(drmModeModeInfo *mode)
> +{
> + return  mode->clock * 1000.00
> + / (mode->htotal * mode->vtotal);
> +}
> +
>  #define bit_name_fn(res) \
>  const char * res##_str(int type) {   \
>   unsigned int i; \
> @@ -210,9 +216,9 @@ static void dump_encoders(struct device *dev)
>  
>  static void dump_mode(drmModeModeInfo *mode)
>  {
> - printf("  %s %d %d %d %d %d %d %d %d %d %d",
> + printf("  %s %.2f %d %d %d %d %d %d %d %d %d",
>  mode->name,
> -mode->vrefresh,
> +mode_vrefresh(mode),
>  mode->hdisplay,
>  mode->hsync_start,
>  mode->hsync_end,
> @@ -828,7 +834,6 @@ connector_find_mode(struct device *dev, uint32_t con_id, 
> const char *mode_str,
>   drmModeConnector *connector;
>   drmModeModeInfo *mode;
>   int i;
> - float mode_vrefresh;
>  
>   connector = get_connector_by_id(dev, con_id);
>   if (!connector || !connector->count_modes)
> @@ -837,15 +842,14 @@ connector_find_mode(struct device *dev, uint32_t 
> con_id, const char *mode_str,
>   for (i = 0; i < connector->count_modes; i++) {
>   mode = &connector->modes[i];
>   if (!strcmp(mode->name, mode_str)) {
> - /* If the vertical refresh frequency is not specified 
> then return the
> -  * first mode that match with the name. Else, return 
> the mode that match
> -  * the name and the specified vertical refresh 
> frequency.
> + /* If the vertical refresh frequency is not specified
> +  * then return the first mode that match with the name.
> +  * Else, return the mode that match the name and
> +  * the specified vertical refresh frequency.
>*/
> - mode_vrefresh = mode->clock * 1000.00
> - / (mode->htotal * mode->vtotal);
>   if (vrefresh == 0)
>   return mode;
> - else if (fabs(mode_vrefresh - vrefresh) < 0.005)
> + else if (fabs(mode_vrefresh(mode) - vrefresh) < 0.005)
>   return mode;
>   }
>   }
> @@ -911,7 +915,13 @@ static int pipe_find_crtc_and_mode(struct device *dev, 
> struct pipe_arg *pipe)
>   mode = connector_find_mode(dev, pipe->con_ids[i],
>  pipe->mode_str, pipe->vrefresh);
>   if (mode == NULL) {
> - fprintf(stderr,
> + if (pipe->vrefresh)
> + fprintf(stderr,
> + "failed to find mode "
> + "\"%s-%.2fHz\"

Re: [PATCH] drm: Fix comment doc for format_modifiers

2019-10-04 Thread Eric Engestrom
On Thursday, 2019-10-03 16:53:18 +0300, Ville Syrjälä wrote:
> On Thu, Oct 03, 2019 at 09:51:18AM +0200, Andrzej Pietrasiewicz wrote:
> > To human readers
> 
> The commit message is always for human readers, no need to point that
> out...
> 
> > 
> > "array of struct drm_format modifiers" is almost indistinguishable from
> > "array of struct drm_format_modifiers", especially given that
> > struct drm_format_modifier does exist.
> 
> ..but this paragraph still manages to 100% confuse this particular human.

There's an underscore instead of a space on the second line
(s/drm_format modifiers/drm_format_modifiers/).

It should definitely be reworded to be much clearer.

> 
> The actual code changes lgtm, so with the commit message reworded
> this patch is
> Reviewed-by: Ville Syrjälä 
> 
> > 
> > And indeed the parameter passes an array of uint64_t rather than an array
> > of structs, but the first words of the comment suggest that it passes
> > 
> > Signed-off-by: Andrzej Pietrasiewicz 
> > ---
> >  drivers/gpu/drm/drm_plane.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> > index d6ad60ab0d38..0d4f9172c0dd 100644
> > --- a/drivers/gpu/drm/drm_plane.c
> > +++ b/drivers/gpu/drm/drm_plane.c
> > @@ -160,7 +160,7 @@ static int create_in_format_blob(struct drm_device 
> > *dev, struct drm_plane *plane
> >   * @funcs: callbacks for the new plane
> >   * @formats: array of supported formats (DRM_FORMAT\_\*)
> >   * @format_count: number of elements in @formats
> > - * @format_modifiers: array of struct drm_format modifiers terminated by
> > + * @format_modifiers: array of format modifiers terminated by
> >   *DRM_FORMAT_MOD_INVALID
> >   * @type: type of plane (overlay, primary, cursor)
> >   * @name: printf style format string for the plane name, or NULL for 
> > default name
> > -- 
> > 2.17.1
> > 
> > ___
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 


Re: [PATCH v3] drm/print: add drm_debug_enabled()

2019-10-01 Thread Eric Engestrom
On Tuesday, 2019-10-01 17:06:14 +0300, Jani Nikula wrote:
> Add helper to check if a drm debug category is enabled. Convert drm core
> to use it. No functional changes.
> 
> v2: Move unlikely() to drm_debug_enabled() (Eric)
> 
> v3: Keep unlikely() when combined with other conditions (Eric)
> 
> Cc: Eric Engestrom 

Reviewed-by: Eric Engestrom 

> Acked-by: Alex Deucher 
> Signed-off-by: Jani Nikula 
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
>  drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++---
>  drivers/gpu/drm/drm_edid.c| 2 +-
>  drivers/gpu/drm/drm_edid_load.c   | 2 +-
>  drivers/gpu/drm/drm_mipi_dbi.c| 4 ++--
>  drivers/gpu/drm/drm_print.c   | 4 ++--
>  drivers/gpu/drm/drm_vblank.c  | 6 +++---
>  include/drm/drm_print.h   | 5 +
>  8 files changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
> b/drivers/gpu/drm/drm_atomic_uapi.c
> index 7a26bfb5329c..0d466d3b0809 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1405,7 +1405,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
>   } else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
>   ret = drm_atomic_nonblocking_commit(state);
>   } else {
> - if (unlikely(drm_debug & DRM_UT_STATE))
> + if (drm_debug_enabled(DRM_UT_STATE))
>   drm_atomic_print_state(state);
>  
>   ret = drm_atomic_commit(state);
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index e6801db54d0f..6b14b63b8d62 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1179,7 +1179,7 @@ static int drm_dp_mst_wait_tx_reply(struct 
> drm_dp_mst_branch *mstb,
>   }
>   }
>  out:
> - if (unlikely(ret == -EIO && drm_debug & DRM_UT_DP)) {
> + if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> @@ -2322,7 +2322,7 @@ static int process_single_tx_qlock(struct 
> drm_dp_mst_topology_mgr *mgr,
>   idx += tosend + 1;
>  
>   ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx);
> - if (unlikely(ret && drm_debug & DRM_UT_DP)) {
> + if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_printf(&p, "sideband msg failed to send\n");
> @@ -2389,7 +2389,7 @@ static void drm_dp_queue_down_tx(struct 
> drm_dp_mst_topology_mgr *mgr,
>   mutex_lock(&mgr->qlock);
>   list_add_tail(&txmsg->next, &mgr->tx_msg_downq);
>  
> - if (unlikely(drm_debug & DRM_UT_DP)) {
> + if (drm_debug_enabled(DRM_UT_DP)) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 3c9703b08491..0552175313cb 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1651,7 +1651,7 @@ static void connector_bad_edid(struct drm_connector 
> *connector,
>  {
>   int i;
>  
> - if (connector->bad_edid_counter++ && !(drm_debug & DRM_UT_KMS))
> + if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS))
>   return;
>  
>   dev_warn(connector->dev->dev,
> diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
> index d38b3b255926..37d8ba3ddb46 100644
> --- a/drivers/gpu/drm/drm_edid_load.c
> +++ b/drivers/gpu/drm/drm_edid_load.c
> @@ -175,7 +175,7 @@ static void *edid_load(struct drm_connector *connector, 
> const char *name,
>   u8 *edid;
>   int fwsize, builtin;
>   int i, valid_extensions = 0;
> - bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & 
> DRM_UT_KMS);
> + bool print_bad_edid = !connector->bad_edid_counter || 
> drm_debug_enabled(DRM_UT_KMS);
>  
>   builtin = match_string(generic_edid_name, GENERIC_EDIDS, name);
>   if (builtin >= 0) {
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index f8154316a3b0..ccfb5b33c5e3 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -783,7 +783,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *dbi, 
> int dc,
>   int i, ret;
>   u8 *dst;
>  
> - i

Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()

2019-10-01 Thread Eric Engestrom
On Tuesday, 2019-10-01 14:03:55 +0300, Jani Nikula wrote:
> On Thu, 26 Sep 2019, Eric Engestrom  wrote:
> > On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote:
> >> Hi all, v2 of [1], a little refactoring around drm_debug access to
> >> abstract it better. There shouldn't be any functional changes.
> >> 
> >> I'd appreciate acks for merging the lot via drm-misc. If there are any
> >> objections to that, we'll need to postpone the last patch until
> >> everything has been merged and converted in drm-next.
> >> 
> >> BR,
> >> Jani.
> >> 
> >> Cc: Eric Engestrom 
> >> Cc: Alex Deucher 
> >> Cc: Christian König 
> >> Cc: David (ChunMing) Zhou 
> >> Cc: amd-...@lists.freedesktop.org
> >> Cc: Ben Skeggs 
> >> Cc: nouv...@lists.freedesktop.org
> >> Cc: Rob Clark 
> >> Cc: Sean Paul 
> >> Cc: linux-arm-...@vger.kernel.org
> >> Cc: freedr...@lists.freedesktop.org
> >> Cc: Francisco Jerez 
> >> Cc: Lucas Stach 
> >> Cc: Russell King 
> >> Cc: Christian Gmeiner 
> >> Cc: etna...@lists.freedesktop.org
> >> 
> >> 
> >> [1] cover.1568375189.git.jani.nikula@intel.com">http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com
> >> 
> >> Jani Nikula (9):
> >>   drm/print: move drm_debug variable to drm_print.[ch]
> >>   drm/print: add drm_debug_enabled()
> >>   drm/i915: use drm_debug_enabled() to check for debug categories
> >>   drm/print: rename drm_debug to __drm_debug to discourage use
> >
> > The above four patches are:
> > Reviewed-by: Eric Engestrom 
> >
> > Did you check to make sure the `unlikely()` is propagated correctly
> > outside the `drm_debug_enabled()` call?
> 
> I did now.
> 
> Having drm_debug_enabled() as a macro vs. as an inline function does not
> seem to make a difference, so I think the inline is clearly preferrable.

Agreed :)

> 
> However, for example
> 
>   unlikely(foo && drm_debug & DRM_UT_DP)
> 
> does produce code different from
> 
>   (foo && drm_debug_enabled(DRM_UT_DP))
> 
> indicating that the unlikely() within drm_debug_enabled() does not
> propagate to the whole condition. It's possible to retain the same
> assembly output with
> 
>   (unlikely(foo) && drm_debug_enabled(DRM_UT_DP))
> 
> but it's unclear to me whether this is really worth it, either
> readability or performance wise.
> 
> Thoughts?

That kind of code only happens 2 times, both in
drivers/gpu/drm/drm_dp_mst_topology.c (in patch 2/9), right?

I think your suggestion is the right thing to do here:

-   if (unlikely(ret && drm_debug & DRM_UT_DP)) {
+   if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) {

It doesn't really cost much in readability (especially compared to what
it was before), and whether it's important performance wise I couldn't
tell, but I think it's best to keep the code optimised as it was before
unless there's a reason to drop it.

Lyude might know more since she wrote 2f015ec6eab69301fdcf5, if you want
to ping her?

> 
> BR,
> Jani.
> 
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()

2019-09-26 Thread Eric Engestrom
On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote:
> Hi all, v2 of [1], a little refactoring around drm_debug access to
> abstract it better. There shouldn't be any functional changes.
> 
> I'd appreciate acks for merging the lot via drm-misc. If there are any
> objections to that, we'll need to postpone the last patch until
> everything has been merged and converted in drm-next.
> 
> BR,
> Jani.
> 
> Cc: Eric Engestrom 
> Cc: Alex Deucher 
> Cc: Christian König 
> Cc: David (ChunMing) Zhou 
> Cc: amd-...@lists.freedesktop.org
> Cc: Ben Skeggs 
> Cc: nouv...@lists.freedesktop.org
> Cc: Rob Clark 
> Cc: Sean Paul 
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedr...@lists.freedesktop.org
> Cc: Francisco Jerez 
> Cc: Lucas Stach 
> Cc: Russell King 
> Cc: Christian Gmeiner 
> Cc: etna...@lists.freedesktop.org
> 
> 
> [1] cover.1568375189.git.jani.nikula@intel.com">http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com
> 
> Jani Nikula (9):
>   drm/print: move drm_debug variable to drm_print.[ch]
>   drm/print: add drm_debug_enabled()
>   drm/i915: use drm_debug_enabled() to check for debug categories
>   drm/print: rename drm_debug to __drm_debug to discourage use

The above four patches are:
Reviewed-by: Eric Engestrom 

Did you check to make sure the `unlikely()` is propagated correctly
outside the `drm_debug_enabled()` call?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] libdrm: Convert to Android.mk to Android.bp

2019-09-25 Thread Eric Engestrom
On Tuesday, 2019-09-24 23:09:08 -0700, John Stultz wrote:
> On Tue, Sep 24, 2019 at 4:30 PM John Stultz  wrote:
> > On Tue, Sep 24, 2019 at 3:24 PM Rob Herring  wrote:
> > > Trying to maintain something that works across more than 3 releases or
> > > so is painful. I don't think android-x86 folks have the bandwidth to
> > > maintain things older than that *and* update to newer versions. So I
> > > think only supporting the n latest releases is good.
> > >
> > > Are .bp files for master/Q compatible back to N (or O)? IIRC, at least
> > > for the first couple of releases with .bp files, they seemed to have
> > > incompatible changes.
> >
> > I think there have possibly been some incompatible changes, as I know
> > early w/ bp files things were more in flux. That said, there haven't
> > been many changes to the libdrm bp files since the conversion was
> > first done in 2017 (so Android O). I'll checkout N and validate so I
> > can provide a more concrete assurance.
> 
> Ah. Crud. You're right. The bp syntax has shifted enough over time to
> cause problems w/ the current file when building against older Android
> releases.   N falls over pretty hard, and O and even P have issues w/
> "recovery_available: ", and "prebuilt_etc" syntax.  So my proposed
> commit message mischaracterizes the state of older builds. Apologies!
> 
> I'll try to reach out to the android devs to see if there's any sort
> of compat magic that can be done to keep things working on older
> versions. That said, I'm still torn, as without this the current
> libdrm/master code is broken with AOSP/master and Q.  Its frustrating
> we have to have this seemingly exclusive trade off.
> 
> I'm curious if folks might be willing to consider something like an
> upstream branch to preserve the build bits that work with prior
> Android releases? Or any other ideas?

Is _not_ deleting Android.mk an option?

That would have the obvious cost of duplicating the build system
maintenance effort, but if that's the only way to not drop support for
everything before Q...

(fwiw, my ack only applies with "reasonable" support of previous
versions :] )
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 2/9] drm/print: add drm_debug_enabled()

2019-09-20 Thread Eric Engestrom
On Monday, 2019-09-16 16:23:13 +0300, Jani Nikula wrote:
> On Mon, 16 Sep 2019, Eric Engestrom  wrote:
> > On Monday, 2019-09-16 11:53:24 +0300, Jani Nikula wrote:
> >> On Fri, 13 Sep 2019, Eric Engestrom  wrote:
> >> > On Friday, 2019-09-13 14:51:39 +0300, Jani Nikula wrote:
> >> >> Add helper to check if a drm debug category is enabled. Convert drm core
> >> >> to use it. No functional changes.
> >> >> 
> >> >> Signed-off-by: Jani Nikula 
> >> >> ---
> >> >>  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
> >> >>  drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++---
> >> >>  drivers/gpu/drm/drm_edid.c| 2 +-
> >> >>  drivers/gpu/drm/drm_edid_load.c   | 2 +-
> >> >>  drivers/gpu/drm/drm_mipi_dbi.c| 4 ++--
> >> >>  drivers/gpu/drm/drm_print.c   | 4 ++--
> >> >>  drivers/gpu/drm/drm_vblank.c  | 6 +++---
> >> >>  include/drm/drm_print.h   | 5 +
> >> >>  8 files changed, 18 insertions(+), 13 deletions(-)
> >> >> 
> >> >> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
> >> >> b/drivers/gpu/drm/drm_atomic_uapi.c
> >> >> index 5a5b42db6f2a..6576cd997cbd 100644
> >> >> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> >> >> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> >> >> @@ -1406,7 +1406,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> >> >> } else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
> >> >> ret = drm_atomic_nonblocking_commit(state);
> >> >> } else {
> >> >> -   if (unlikely(drm_debug & DRM_UT_STATE))
> >> >> +   if (unlikely(drm_debug_enabled(DRM_UT_STATE)))
> >> >> drm_atomic_print_state(state);
> >> >>  
> >> >> ret = drm_atomic_commit(state);
> >> >> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> >> >> b/drivers/gpu/drm/drm_dp_mst_topology.c
> >> >> index 97216099a718..f47c5b6b51f7 100644
> >> >> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> >> >> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> >> >> @@ -1180,7 +1180,7 @@ static int drm_dp_mst_wait_tx_reply(struct 
> >> >> drm_dp_mst_branch *mstb,
> >> >> }
> >> >> }
> >> >>  out:
> >> >> -   if (unlikely(ret == -EIO && drm_debug & DRM_UT_DP)) {
> >> >> +   if (unlikely(ret == -EIO && drm_debug_enabled(DRM_UT_DP))) {
> >> >> struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >> >>  
> >> >> drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> >> >> @@ -2321,7 +2321,7 @@ static int process_single_tx_qlock(struct 
> >> >> drm_dp_mst_topology_mgr *mgr,
> >> >> idx += tosend + 1;
> >> >>  
> >> >> ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx);
> >> >> -   if (unlikely(ret && drm_debug & DRM_UT_DP)) {
> >> >> +   if (unlikely(ret && drm_debug_enabled(DRM_UT_DP))) {
> >> >> struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >> >>  
> >> >> drm_printf(&p, "sideband msg failed to send\n");
> >> >> @@ -2388,7 +2388,7 @@ static void drm_dp_queue_down_tx(struct 
> >> >> drm_dp_mst_topology_mgr *mgr,
> >> >> mutex_lock(&mgr->qlock);
> >> >> list_add_tail(&txmsg->next, &mgr->tx_msg_downq);
> >> >>  
> >> >> -   if (unlikely(drm_debug & DRM_UT_DP)) {
> >> >> +   if (unlikely(drm_debug_enabled(DRM_UT_DP))) {
> >> >> struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >> >>  
> >> >> drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> >> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> >> index 12c783f4d956..58dad4d24cd4 100644
> >> >> --- a/drivers/gpu/drm/drm_edid.c
> >> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> >> @@ -1551,7 +1551,7 @@ static void connector_bad_edid(struct 
> >> >> drm_connector *connector,
> >> >>  {
> >> >

Re: [RFC][PATCH] libdrm: Convert to Android.mk to Android.bp

2019-09-18 Thread Eric Engestrom
On Tuesday, 2019-09-17 19:15:36 +, John Stultz wrote:
> This patch removes the deprecated Android.mk files and replaces
> them with Android.bp files.
> 
> This is needed in order to build libdrm/master against recent
> Android releases and AOSP/master, as some of the Treble build
> options required since Android O cannot be expressed in
> Andorid.mk files.
> 
> Patch originally by Dan Willemsen with fixes folded in by:
>  Jerry Zhang, Eliott Hughes and myself.
> 
> With this change, the only patches carried by Android for libdrm
> would be the gerrit OWNERS meta-data file.
> 
> Cc: Mauro Rossi 
> Cc: Chih-Wei Huang 
> Cc: Robert Foss 
> Cc: Tapani Pälli 
> Cc: Chih-Wei Huang 
> Cc: Emil Velikov 
> Cc: Sean Paul 
> Cc: Rob Clark 
> Cc: Eric Anholt 
> Cc: Jiyong Park 
> Cc: Alistair Strachan 
> Cc: Dan Willemsen 
> Cc: Sumit Semwal 
> Cc: Vishal Bhoj 
> Signed-off-by: John Stultz 
> ---
> I know last time this was proposed, there was some concern about
> maintaining support for old AOSP releases - and while we could
> still support both with Android.mk that was a fair concern.
> 
> However, now that it is a requirement for newer releases, I'd
> contend that being able to build/test libdrm/master against
> AOSP/master and recent releases is more valuable then soley
> maintaining support for old and unsupported Android releases.

Acked-by: Eric Engestrom 

But to be clear, what's the earliest android version that supports
blueprint? (might be worth adding that to the commit message)

> 
> So I wanted to submit this again for discussion.
> 
> thanks
> -john
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/ioctl: Add a ioctl to label GEM objects

2019-09-16 Thread Eric Engestrom
On Monday, 2019-09-16 12:35:41 +0200, Rohan Garg wrote:
> DRM_IOCTL_BO_SET_LABEL lets you label GEM objects, making it
> easier to debug issues in userspace applications.
> 
> Signed-off-by: Rohan Garg 
> ---
>  drivers/gpu/drm/drm_gem.c  | 51 ++
>  drivers/gpu/drm/drm_internal.h |  2 ++
>  drivers/gpu/drm/drm_ioctl.c|  1 +
>  include/drm/drm_gem.h  |  7 +
>  include/uapi/drm/drm.h | 18 
>  5 files changed, 79 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 6854f5867d51..c116b242d679 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -941,6 +941,52 @@ drm_gem_release(struct drm_device *dev, struct drm_file 
> *file_private)
>   idr_destroy(&file_private->object_idr);
>  }
>  
> +/**
> + * drm_gem_label - label a given GEM object
> + * @dev: drm_device which is being closed by userspace
> + * @data: drm_label_bo struct with a label, label length and any relevant 
> flags
> + * @file_private: drm file-private structure to clean up
> + */
> +
> +int drm_gem_label(struct drm_device *dev, void *data,
> +struct drm_file *file_priv)
> +{
> + struct drm_label_object *args = data;
> + struct drm_gem_object *gem_obj;
> + int err = 0;
> +
> + if (!args->len || !args->name)
> + return -EINVAL;
> +
> + gem_obj = drm_gem_object_lookup(file_priv, args->handle);
> + if (!gem_obj) {
> + DRM_ERROR("Failed to look up GEM BO %d\n", args->handle);
> + err = -ENOENT;
> + goto err;
> + }
> +
> + if ((args->len == 0 && args->name == NULL) || gem_obj->label) {
> + kfree(gem_obj->label);
> + gem_obj->label = NULL;
> + }
> +
> + gem_obj->label = strndup_user(u64_to_user_ptr(args->name), args->len);
> +
> + drm_gem_object_put_unlocked(gem_obj);
> +
> + if (IS_ERR(gem_obj->label)) {
> + err = PTR_ERR(gem_obj->label);
> + goto err;
> + }
> +
> +err:
> + if (err != 0)
> + args->flags = err;
> +
> + return err;
> +}
> +
> +
>  /**
>   * drm_gem_object_release - release GEM buffer object resources
>   * @obj: GEM buffer object
> @@ -958,6 +1004,11 @@ drm_gem_object_release(struct drm_gem_object *obj)
>  
>   dma_resv_fini(&obj->_resv);
>   drm_gem_free_mmap_offset(obj);
> +
> + if (obj->label) {
> + kfree(obj->label);
> + obj->label = NULL;
> + }
>  }
>  EXPORT_SYMBOL(drm_gem_object_release);
>  
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 51a2055c8f18..c9854b237fb6 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -137,6 +137,8 @@ int drm_gem_pin(struct drm_gem_object *obj);
>  void drm_gem_unpin(struct drm_gem_object *obj);
>  void *drm_gem_vmap(struct drm_gem_object *obj);
>  void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr);
> +int drm_gem_label(struct drm_device *dev, void *data,
> +struct drm_file *file_priv);
>  
>  /* drm_debugfs.c drm_debugfs_crc.c */
>  #if defined(CONFIG_DEBUG_FS)
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index f675a3bb2c88..7b6f4b7dadb9 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -709,6 +709,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
>   DRM_IOCTL_DEF(DRM_IOCTL_MODE_LIST_LESSEES, drm_mode_list_lessees_ioctl, 
> DRM_MASTER),
>   DRM_IOCTL_DEF(DRM_IOCTL_MODE_GET_LEASE, drm_mode_get_lease_ioctl, 
> DRM_MASTER),
>   DRM_IOCTL_DEF(DRM_IOCTL_MODE_REVOKE_LEASE, drm_mode_revoke_lease_ioctl, 
> DRM_MASTER),
> + DRM_IOCTL_DEF(DRM_IOCTL_BO_SET_LABEL, drm_gem_label, DRM_RENDER_ALLOW),
>  };
>  
>  #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index 6aaba14f5972..f801c054e972 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -237,6 +237,13 @@ struct drm_gem_object {
>*/
>   int name;
>  
> + /**
> +  * @label:
> +  *
> +  * Label for this object, should be a human readable string.
> +  */
> + char *label;
> +
>   /**
>* @dma_buf:
>*
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 8a5b2f8f8eb9..286167f880de 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -626,6 +626,23 @@ struct drm_gem_open {
>   __u64 size;
>  };
>  
> +/** struct drm_label_object - ioctl argument for labelling BOs.
> + *
> + * This label's a BO with a userspace label
> + *
> + */
> +struct drm_label_object {
> + /** Handle for the object being labelled. */
> + __u32 handle;
> +
> + /** Label and label length. */
> + __u32 len;
> + __u64 name;

Might be worth mentioning in the comment here that `len` includes the
trailing NULL.

I have no opinion on the

Re: [PATCH 2/9] drm/print: add drm_debug_enabled()

2019-09-16 Thread Eric Engestrom
On Monday, 2019-09-16 11:53:24 +0300, Jani Nikula wrote:
> On Fri, 13 Sep 2019, Eric Engestrom  wrote:
> > On Friday, 2019-09-13 14:51:39 +0300, Jani Nikula wrote:
> >> Add helper to check if a drm debug category is enabled. Convert drm core
> >> to use it. No functional changes.
> >> 
> >> Signed-off-by: Jani Nikula 
> >> ---
> >>  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
> >>  drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++---
> >>  drivers/gpu/drm/drm_edid.c| 2 +-
> >>  drivers/gpu/drm/drm_edid_load.c   | 2 +-
> >>  drivers/gpu/drm/drm_mipi_dbi.c| 4 ++--
> >>  drivers/gpu/drm/drm_print.c   | 4 ++--
> >>  drivers/gpu/drm/drm_vblank.c  | 6 +++---
> >>  include/drm/drm_print.h   | 5 +
> >>  8 files changed, 18 insertions(+), 13 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
> >> b/drivers/gpu/drm/drm_atomic_uapi.c
> >> index 5a5b42db6f2a..6576cd997cbd 100644
> >> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> >> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> >> @@ -1406,7 +1406,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> >>} else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
> >>ret = drm_atomic_nonblocking_commit(state);
> >>} else {
> >> -  if (unlikely(drm_debug & DRM_UT_STATE))
> >> +  if (unlikely(drm_debug_enabled(DRM_UT_STATE)))
> >>drm_atomic_print_state(state);
> >>  
> >>ret = drm_atomic_commit(state);
> >> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> >> b/drivers/gpu/drm/drm_dp_mst_topology.c
> >> index 97216099a718..f47c5b6b51f7 100644
> >> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> >> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> >> @@ -1180,7 +1180,7 @@ static int drm_dp_mst_wait_tx_reply(struct 
> >> drm_dp_mst_branch *mstb,
> >>}
> >>}
> >>  out:
> >> -  if (unlikely(ret == -EIO && drm_debug & DRM_UT_DP)) {
> >> +  if (unlikely(ret == -EIO && drm_debug_enabled(DRM_UT_DP))) {
> >>struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >>  
> >>drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> >> @@ -2321,7 +2321,7 @@ static int process_single_tx_qlock(struct 
> >> drm_dp_mst_topology_mgr *mgr,
> >>idx += tosend + 1;
> >>  
> >>ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx);
> >> -  if (unlikely(ret && drm_debug & DRM_UT_DP)) {
> >> +  if (unlikely(ret && drm_debug_enabled(DRM_UT_DP))) {
> >>struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >>  
> >>drm_printf(&p, "sideband msg failed to send\n");
> >> @@ -2388,7 +2388,7 @@ static void drm_dp_queue_down_tx(struct 
> >> drm_dp_mst_topology_mgr *mgr,
> >>mutex_lock(&mgr->qlock);
> >>list_add_tail(&txmsg->next, &mgr->tx_msg_downq);
> >>  
> >> -  if (unlikely(drm_debug & DRM_UT_DP)) {
> >> +  if (unlikely(drm_debug_enabled(DRM_UT_DP))) {
> >>struct drm_printer p = drm_debug_printer(DBG_PREFIX);
> >>  
> >>drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> index 12c783f4d956..58dad4d24cd4 100644
> >> --- a/drivers/gpu/drm/drm_edid.c
> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> @@ -1551,7 +1551,7 @@ static void connector_bad_edid(struct drm_connector 
> >> *connector,
> >>  {
> >>int i;
> >>  
> >> -  if (connector->bad_edid_counter++ && !(drm_debug & DRM_UT_KMS))
> >> +  if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS))
> >>return;
> >>  
> >>dev_warn(connector->dev->dev,
> >> diff --git a/drivers/gpu/drm/drm_edid_load.c 
> >> b/drivers/gpu/drm/drm_edid_load.c
> >> index d38b3b255926..37d8ba3ddb46 100644
> >> --- a/drivers/gpu/drm/drm_edid_load.c
> >> +++ b/drivers/gpu/drm/drm_edid_load.c
> >> @@ -175,7 +175,7 @@ static void *edid_load(struct drm_connector 
> >> *connector, const char *name,
> >>u8 *edid;
> >>int fwsize, builtin;
> >>int i, valid_extensions = 0;
> >> -  bool print_bad_edid = !connector->bad_edid_counter |

Re: [PATCH libdrm] meson: Fix sys/mkdev.h detection on Solaris

2019-09-14 Thread Eric Engestrom
On Friday, 2019-09-13 16:26:55 -0700, Alan Coopersmith wrote:
> On 9/10/19 5:55 AM, Eric Engestrom wrote:
> > On Monday, 2019-09-09 16:51:16 -0700, Alan Coopersmith wrote:
> > > On Solaris, sys/sysmacros.h has long-deprecated copies of major() & 
> > > minor()
> > > but not makedev().  sys/mkdev.h has all three and is the preferred choice.
> > > 
> > > So we check for sys/mkdev.h first, as autoconf's AC_HEADER_MAJOR does.
> > 
> > Reviewed-by: Eric Engestrom 
> > 
> > Alternatively, how about this?
> > ---8<---
> > diff --git a/meson.build b/meson.build
> > index bc5cfc588d0c621a9725..263f691ab2b9107f5be1 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -183,9 +183,14 @@ foreach header : ['sys/sysctl.h', 'sys/select.h', 
> > 'alloca.h']
> > config.set('HAVE_' + header.underscorify().to_upper(),
> >   cc.compiles('#include <@0@>'.format(header), name : '@0@ 
> > works'.format(header)))
> >   endforeach
> > -if cc.has_header_symbol('sys/sysmacros.h', 'major')
> > +if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
> > +  cc.has_header_symbol('sys/sysmacros.h', 'minor') and
> > +  cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
> > config.set10('MAJOR_IN_SYSMACROS', true)
> > -elif cc.has_header_symbol('sys/mkdev.h', 'major')
> > +endif
> > +if (cc.has_header_symbol('sys/mkdev.h', 'major') and
> > +  cc.has_header_symbol('sys/mkdev.h', 'minor') and
> > +  cc.has_header_symbol('sys/mkdev.h', 'makedev'))
> > config.set10('MAJOR_IN_MKDEV', true)
> >   endif
> >   config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
> > --->8---
> > 
> > Makes both checks independent and represent the reality of what's wanted
> > more accurately (despite the historical name of the macro).
> 
> That works:
> 
> Header  has symbol "major" : YES (cached)
> Header  has symbol "minor" : YES
> Header  has symbol "makedev" : NO
> Header  has symbol "major" : YES
> Header  has symbol "minor" : YES
> Header  has symbol "makedev" : YES
> 
> Would you like me to resubmit with that, or do you want to submit it?
> 
> If you want to go ahead, then:
> 
> Reviewed-by: Alan Coopersmith 
> Tested-by: Alan Coopersmith 

Just pushed it as 827a2a2042359ac93a9b082ee9584b43baa1a3f7; thanks for
testing it!

I've also tagged you on a Mesa MR to the same effect, in case you want
to give it a go :)

> 
> -- 
>   -Alan Coopersmith-   alan.coopersm...@oracle.com
>Oracle Solaris Engineering - https://blogs.oracle.com/alanc
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 2/9] drm/print: add drm_debug_enabled()

2019-09-13 Thread Eric Engestrom
On Friday, 2019-09-13 14:51:39 +0300, Jani Nikula wrote:
> Add helper to check if a drm debug category is enabled. Convert drm core
> to use it. No functional changes.
> 
> Signed-off-by: Jani Nikula 
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
>  drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++---
>  drivers/gpu/drm/drm_edid.c| 2 +-
>  drivers/gpu/drm/drm_edid_load.c   | 2 +-
>  drivers/gpu/drm/drm_mipi_dbi.c| 4 ++--
>  drivers/gpu/drm/drm_print.c   | 4 ++--
>  drivers/gpu/drm/drm_vblank.c  | 6 +++---
>  include/drm/drm_print.h   | 5 +
>  8 files changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
> b/drivers/gpu/drm/drm_atomic_uapi.c
> index 5a5b42db6f2a..6576cd997cbd 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1406,7 +1406,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
>   } else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
>   ret = drm_atomic_nonblocking_commit(state);
>   } else {
> - if (unlikely(drm_debug & DRM_UT_STATE))
> + if (unlikely(drm_debug_enabled(DRM_UT_STATE)))
>   drm_atomic_print_state(state);
>  
>   ret = drm_atomic_commit(state);
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 97216099a718..f47c5b6b51f7 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1180,7 +1180,7 @@ static int drm_dp_mst_wait_tx_reply(struct 
> drm_dp_mst_branch *mstb,
>   }
>   }
>  out:
> - if (unlikely(ret == -EIO && drm_debug & DRM_UT_DP)) {
> + if (unlikely(ret == -EIO && drm_debug_enabled(DRM_UT_DP))) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> @@ -2321,7 +2321,7 @@ static int process_single_tx_qlock(struct 
> drm_dp_mst_topology_mgr *mgr,
>   idx += tosend + 1;
>  
>   ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx);
> - if (unlikely(ret && drm_debug & DRM_UT_DP)) {
> + if (unlikely(ret && drm_debug_enabled(DRM_UT_DP))) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_printf(&p, "sideband msg failed to send\n");
> @@ -2388,7 +2388,7 @@ static void drm_dp_queue_down_tx(struct 
> drm_dp_mst_topology_mgr *mgr,
>   mutex_lock(&mgr->qlock);
>   list_add_tail(&txmsg->next, &mgr->tx_msg_downq);
>  
> - if (unlikely(drm_debug & DRM_UT_DP)) {
> + if (unlikely(drm_debug_enabled(DRM_UT_DP))) {
>   struct drm_printer p = drm_debug_printer(DBG_PREFIX);
>  
>   drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 12c783f4d956..58dad4d24cd4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1551,7 +1551,7 @@ static void connector_bad_edid(struct drm_connector 
> *connector,
>  {
>   int i;
>  
> - if (connector->bad_edid_counter++ && !(drm_debug & DRM_UT_KMS))
> + if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS))
>   return;
>  
>   dev_warn(connector->dev->dev,
> diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
> index d38b3b255926..37d8ba3ddb46 100644
> --- a/drivers/gpu/drm/drm_edid_load.c
> +++ b/drivers/gpu/drm/drm_edid_load.c
> @@ -175,7 +175,7 @@ static void *edid_load(struct drm_connector *connector, 
> const char *name,
>   u8 *edid;
>   int fwsize, builtin;
>   int i, valid_extensions = 0;
> - bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & 
> DRM_UT_KMS);
> + bool print_bad_edid = !connector->bad_edid_counter || 
> drm_debug_enabled(DRM_UT_KMS);
>  
>   builtin = match_string(generic_edid_name, GENERIC_EDIDS, name);
>   if (builtin >= 0) {
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index f8154316a3b0..ccfb5b33c5e3 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -783,7 +783,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *dbi, 
> int dc,
>   int i, ret;
>   u8 *dst;
>  
> - if (drm_debug & DRM_UT_DRIVER)
> + if (drm_debug_enabled(DRM_UT_DRIVER))
>   pr_debug("[drm:%s] dc=%d, max_chunk=%zu, transfers:\n",
>__func__, dc, max_chunk);
>  
> @@ -907,7 +907,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, 
> int dc,
>   max_chunk = dbi->tx_buf9_len;
>   dst16 = dbi->tx_buf9;
>  
> - if (drm_debug & DRM_UT_DRIVER)
> + if (drm_debug_enabled(DRM_UT_DRIVER))
>   pr_debug("[drm:%s] dc=%d, max_chunk=%zu, transfers:\n",
>__func__, dc, max_chunk);
>  
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index c9

Re: [PATCH libdrm] meson: Fix sys/mkdev.h detection on Solaris

2019-09-10 Thread Eric Engestrom
On Monday, 2019-09-09 16:51:16 -0700, Alan Coopersmith wrote:
> On Solaris, sys/sysmacros.h has long-deprecated copies of major() & minor()
> but not makedev().  sys/mkdev.h has all three and is the preferred choice.
> 
> So we check for sys/mkdev.h first, as autoconf's AC_HEADER_MAJOR does.

Reviewed-by: Eric Engestrom 

Alternatively, how about this?
---8<---
diff --git a/meson.build b/meson.build
index bc5cfc588d0c621a9725..263f691ab2b9107f5be1 100644
--- a/meson.build
+++ b/meson.build
@@ -183,9 +183,14 @@ foreach header : ['sys/sysctl.h', 'sys/select.h', 
'alloca.h']
   config.set('HAVE_' + header.underscorify().to_upper(),
 cc.compiles('#include <@0@>'.format(header), name : '@0@ 
works'.format(header)))
 endforeach
-if cc.has_header_symbol('sys/sysmacros.h', 'major')
+if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
+  cc.has_header_symbol('sys/sysmacros.h', 'minor') and
+  cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
   config.set10('MAJOR_IN_SYSMACROS', true)
-elif cc.has_header_symbol('sys/mkdev.h', 'major')
+endif
+if (cc.has_header_symbol('sys/mkdev.h', 'major') and
+  cc.has_header_symbol('sys/mkdev.h', 'minor') and
+  cc.has_header_symbol('sys/mkdev.h', 'makedev'))
   config.set10('MAJOR_IN_MKDEV', true)
 endif
 config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
--->8---

Makes both checks independent and represent the reality of what's wanted
more accurately (despite the historical name of the macro).

> 
> Fixes build failure with error:
> ../xf86drm.c: In function ‘drmOpenMinor’:
> ../xf86drm.c:454:30: error: implicit declaration of function ‘makedev’ 
> [-Werror=implicit-function-declaration]
>   454 | return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
>   |  ^~~
> 
> Signed-off-by: Alan Coopersmith 
> ---
>  meson.build | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index bc5cfc58..a3363c32 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -183,10 +183,10 @@ foreach header : ['sys/sysctl.h', 'sys/select.h', 
> 'alloca.h']
>config.set('HAVE_' + header.underscorify().to_upper(),
>  cc.compiles('#include <@0@>'.format(header), name : '@0@ 
> works'.format(header)))
>  endforeach
> -if cc.has_header_symbol('sys/sysmacros.h', 'major')
> -  config.set10('MAJOR_IN_SYSMACROS', true)
> -elif cc.has_header_symbol('sys/mkdev.h', 'major')
> +if cc.has_header_symbol('sys/mkdev.h', 'major')
>config.set10('MAJOR_IN_MKDEV', true)
> +elif cc.has_header_symbol('sys/sysmacros.h', 'major')
> +  config.set10('MAJOR_IN_SYSMACROS', true)
>  endif
>  config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
>  
> -- 
> 2.15.2
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] xf86drm: open correct render node on non-linux

2019-07-03 Thread Eric Engestrom
On Monday, 2019-05-13 02:52:04 +1000, Jonathan Gray wrote:
> drm render nodes have the same major as drm primary devices but offset
> the minor by a base of 128.
> 
> I expected the name of the device to have numbering starting at 0 when
> these non-linux codepaths were added (before OpenBSD had render nodes).
> 
> Signed-off-by: Jonathan Gray 

I didn't check that OpenBSD is the way you say, but the libdrm code here
matches with that, so this patch is
Acked-by: Eric Engestrom 
and pushed :)

> ---
>  xf86drm.c | 24 ++--
>  1 file changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 42022cac..0763fd26 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -2931,7 +2931,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
>  char buf[PATH_MAX + 1];
>  const char *dev_name;
>  unsigned int maj, min;
> -int n, base;
> +int n;
>  
>  if (fstat(fd, &sbuf))
>  return NULL;
> @@ -2956,11 +2956,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
>  return NULL;
>  };
>  
> -base = drmGetMinorBase(type);
> -if (base < 0)
> -return NULL;
> -
> -n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min - base);
> +n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min);
>  if (n == -1 || n >= sizeof(buf))
>  return NULL;
>  
> @@ -3854,7 +3850,7 @@ drm_public int drmGetDevice2(int fd, uint32_t flags, 
> drmDevicePtr *device)
>  char node[PATH_MAX + 1];
>  const char  *dev_name;
>  int  node_type, subsystem_type;
> -int  maj, min, n, ret, base;
> +int  maj, min, n, ret;
>  
>  if (fd == -1 || device == NULL)
>  return -EINVAL;
> @@ -3886,11 +3882,7 @@ drm_public int drmGetDevice2(int fd, uint32_t flags, 
> drmDevicePtr *device)
>  return -EINVAL;
>  };
>  
> -base = drmGetMinorBase(node_type);
> -if (base < 0)
> -return -EINVAL;
> -
> -n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min - base);
> +n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min);
>  if (n == -1 || n >= PATH_MAX)
>return -errno;
>  if (stat(node, &sbuf))
> @@ -4110,7 +4102,7 @@ drm_public char *drmGetDeviceNameFromFd2(int fd)
>  char node[PATH_MAX + 1];
>  const char  *dev_name;
>  int  node_type;
> -int  maj, min, n, base;
> +int  maj, min, n;
>  
>  if (fstat(fd, &sbuf))
>  return NULL;
> @@ -4139,11 +4131,7 @@ drm_public char *drmGetDeviceNameFromFd2(int fd)
>  return NULL;
>  };
>  
> -base = drmGetMinorBase(node_type);
> -if (base < 0)
> -return NULL;
> -
> -n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min - base);
> +n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min);
>  if (n == -1 || n >= PATH_MAX)
>return NULL;
>  
> -- 
> 2.21.0
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] xf86drm: test for render nodes before primary nodes

2019-07-03 Thread Eric Engestrom
On Monday, 2019-05-13 02:50:49 +1000, Jonathan Gray wrote:
> Unlike Linux the OpenBSD primary "drm" device name is substring of the
> "drmR" render node device name and strncmp() tests resulted in render
> nodes being flagged as primary nodes.
> 
> Signed-off-by: Jonathan Gray 

Reviewed-by: Eric Engestrom 
and pushed!
Sorry it got forgotten for so long.

> ---
>  xf86drm.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 2858d826..42022cac 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3168,10 +3168,6 @@ drm_public int drmDevicesEqual(drmDevicePtr a, 
> drmDevicePtr b)
>  
>  static int drmGetNodeType(const char *name)
>  {
> -if (strncmp(name, DRM_PRIMARY_MINOR_NAME,
> -sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0)
> -return DRM_NODE_PRIMARY;
> -
>  if (strncmp(name, DRM_CONTROL_MINOR_NAME,
>  sizeof(DRM_CONTROL_MINOR_NAME ) - 1) == 0)
>  return DRM_NODE_CONTROL;
> @@ -3180,6 +3176,10 @@ static int drmGetNodeType(const char *name)
>  sizeof(DRM_RENDER_MINOR_NAME) - 1) == 0)
>  return DRM_NODE_RENDER;
>  
> +if (strncmp(name, DRM_PRIMARY_MINOR_NAME,
> +sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0)
> +return DRM_NODE_PRIMARY;
> +
>  return -EINVAL;
>  }
>  
> -- 
> 2.21.0
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/todo: Update drm_gem_object_funcs todo even more

2019-06-18 Thread Eric Engestrom
On Tuesday, 2019-06-18 16:02:41 +0200, Daniel Vetter wrote:
> I rushed merging this a bit too much, and Noralf pointed out that
> we're a lot better already and have made great progress.
> 
> Let's try again.
> 
> Fixes: 42dbbb4b54a3 ("drm/todo: Add new debugfs todo")
> Cc: Greg Kroah-Hartman 
> Cc: Daniel Vetter 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Sean Paul 
> Cc: Thomas Zimmermann 
> Cc: Gerd Hoffmann 
> Cc: Rob Herring 
> Cc: Noralf Trønnes 
> Cc: Eric Anholt 
> Cc: Gerd Hoffmann 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/todo.rst | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 25878dd048fd..66c123737c3d 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -212,9 +212,11 @@ struct drm_gem_object_funcs
>  GEM objects can now have a function table instead of having the callbacks on 
> the
>  DRM driver struct. This is now the preferred way and drivers can be moved 
> over.
>  
> -Unfortunately some of the recently added GEM helpers are going in the wrong
> -direction by adding OPS macros that use the old, deprecated hooks. See
> -DRM_GEM_CMA_VMAP_DRIVER_OPS, DRM_GEM_SHMEM_DRIVER_OPS, and 
> DRM_GEM_VRAM_DRIVER_PRIME.
> +DRM_GEM_CMA_VMAP_DRIVER_OPS, DRM_GEM_SHMEM_DRIVER_OPS already support this, 
> but
> +DRM_GEM_VRAM_DRIVER_PRIME does not yet and needs to be aligend with the 
> previous

s/aligend/aligned/

> +two. We also need a 2nd version of the CMA define that doesn't require the
> +vmapping to be present (different hook for prime importing). Plus this needs 
> to
> +be rolled out to all drivers using their own implementations, too.
>  
>  Use DRM_MODESET_LOCK_ALL_* helpers instead of boilerplate
>  -
> -- 
> 2.20.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm v2 4/4] meson.build: Fix meson script on FreeBSD

2019-06-17 Thread Eric Engestrom
On Monday, 2019-06-17 11:20:43 +0200, Niclas Zeising wrote:
> On 2019-06-17 11:14, Eric Engestrom wrote:
> > On Sunday, 2019-06-16 14:23:43 +0100, Emil Velikov wrote:
> > > From: Niclas Zeising 
> > > 
> > > FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> > > includes when checking for headers.
> > > Instead of splitting out the check for sys/sysctl.h from the other
> > > header checks, just add sys/types.h to all header checks.
> > > 
> > > v2 [Emil]
> > >   - add inline comment
> > >   - drop bash/sh hunk
> > > 
> > > Signed-off-by: Emil Velikov 
> > 
> > Series is:
> > Reviewed-by: Eric Engestrom 
> > 
> > But I agree with Emil, it's a FreeBSD bug for it to not include
> > a required header, this should also be fixed upstream.
> 
> I'm not sure if my e-mails are getting to the mailing list.

They are :)

You can check the archive if you're not sure:
https://lists.freedesktop.org/archives/dri-devel/2019-June/thread.html

> This is the way
> it's documented in FreeBSD, and there is a lot of legacy reasons it is this
> way.  I doubt it will change, and even if it does, there will be about 5
> years of transition period before all supported releases has the change,
> most likely.
> 
> This is the first time, to my knowledge, this issue has come up.
> 
> (I'm not saying I disagree with you, just saying it's probably easier to
> patch here rather than try to change upstream.)
> 
> Regards
> -- 
> Niclas

If think we both agree then ;)
I definitely agree with should have the workaround downstream, all
I meant is that it's worth pushing upstream to fix the bug so that
*eventually* not all downstream users needs to have the workaround (but
yeah, that will take years to reach).
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm v2 4/4] meson.build: Fix meson script on FreeBSD

2019-06-17 Thread Eric Engestrom
On Sunday, 2019-06-16 14:23:43 +0100, Emil Velikov wrote:
> From: Niclas Zeising 
> 
> FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> includes when checking for headers.
> Instead of splitting out the check for sys/sysctl.h from the other
> header checks, just add sys/types.h to all header checks.
> 
> v2 [Emil]
>  - add inline comment
>  - drop bash/sh hunk
> 
> Signed-off-by: Emil Velikov 

Series is:
Reviewed-by: Eric Engestrom 

But I agree with Emil, it's a FreeBSD bug for it to not include
a required header, this should also be fixed upstream.

> ---
>  meson.build | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index ed407009..14f82b1f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -179,9 +179,12 @@ else
>dep_rt = []
>  endif
>  dep_m = cc.find_library('m', required : false)
> +# From Niclas Zeising:
> +# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
> +# includes when checking for headers.
>  foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
>config.set('HAVE_' + header.underscorify().to_upper(),
> -cc.compiles('#include <@0@>'.format(header), name : '@0@ 
> works'.format(header)))
> +cc.compiles('#include \n#include <@0@>'.format(header), 
> name : '@0@ works'.format(header)))
>  endforeach
>  if cc.has_header_symbol('sys/sysmacros.h', 'major')
>config.set10('MAJOR_IN_SYSMACROS', true)
> -- 
> 2.21.0
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm: Fix drm.h uapi header for GNU/kFreeBSD

2019-05-16 Thread Eric Engestrom
On Thursday, 2019-05-16 09:37:40 -0700, Eric Anholt wrote:
> Eric Anholt  writes:
> 
> > [ Unknown signature status ]
> > James Clarke  writes:
> >
> >> Like GNU/Linux, GNU/kFreeBSD's sys/types.h does not define the uintX_t
> >> types, which differs from the BSDs' headers. Thus we should include
> >> stdint.h to ensure we have all the required integer types.
> >>
> >> Signed-off-by: James Clarke 
> >
> > Reviewed-by: Eric Anholt 
> 
> And pushed to drm-misc-next now.

Thanks Eric!

James, that means you can now sync libdrm to get the fix there as well :)

See include/drm/README for details
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] xf86drm: Fix possible memory leak with drmModeGetPropertyPtr()

2019-05-03 Thread Eric Engestrom
On Monday, 2019-04-29 18:10:52 +0900, Seung-Woo Kim wrote:
> In drmModeGetPropertyPtr(), from upper error path, it calls free
> but with just next error path, it does not call. Fix the possible
> memory leak.
> 
> Signed-off-by: Seung-Woo Kim 

Reviewed-by: Eric Engestrom 
and pushed, thanks!

> ---
>  xf86drmMode.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/xf86drmMode.c b/xf86drmMode.c
> index c878d9e..207d7be 100644
> --- a/xf86drmMode.c
> +++ b/xf86drmMode.c
> @@ -650,7 +650,7 @@ drm_public drmModePropertyPtr drmModeGetProperty(int fd, 
> uint32_t property_id)
>   }
>  
>   if (!(r = drmMalloc(sizeof(*r
> - return NULL;
> + goto err_allocs;
>  
>   r->prop_id = prop.prop_id;
>   r->count_values = prop.count_values;
> -- 
> 1.7.4.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] headers: Sync with drm-next

2019-04-10 Thread Eric Engestrom
On Wednesday, 2019-04-10 21:49:33 -0400, Rob Clark wrote:
> On Tue, Apr 9, 2019 at 8:27 AM Eric Engestrom  
> wrote:
> > > > diff --git a/include/drm/msm_drm.h b/include/drm/msm_drm.h
> > > > index c06d0a5..91a16b3 100644
> > > > --- a/include/drm/msm_drm.h
> > > > +++ b/include/drm/msm_drm.h
> > > > @@ -105,14 +105,24 @@ struct drm_msm_gem_new {
> > > > __u32 handle; /* out */
> > > >  };
> > > >
> > > > -#define MSM_INFO_IOVA  0x01
> > > > -
> > > > -#define MSM_INFO_FLAGS (MSM_INFO_IOVA)
> > > > +/* Get or set GEM buffer info.  The requested value can be passed
> > > > + * directly in 'value', or for data larger than 64b 'value' is a
> > > > + * pointer to userspace buffer, with 'len' specifying the number of
> > > > + * bytes copied into that buffer.  For info returned by pointer,
> > > > + * calling the GEM_INFO ioctl with null 'value' will return the
> > > > + * required buffer size in 'len'
> > > > + */
> > > > +#define MSM_INFO_GET_OFFSET0x00   /* get mmap() offset, 
> > > > returned by value */
> > > > +#define MSM_INFO_GET_IOVA  0x01   /* get iova, returned by value */
> > > > +#define MSM_INFO_SET_NAME  0x02   /* set the debug name (by pointer) */
> > > > +#define MSM_INFO_GET_NAME  0x03   /* get debug name, returned by 
> > > > pointer */
> > > >
> > > >  struct drm_msm_gem_info {
> > > > __u32 handle; /* in */
> > > > -   __u32 flags;  /* in - combination of MSM_INFO_* flags */
> > > > -   __u64 offset; /* out, mmap() offset or iova */
> > > > +   __u32 info;   /* in - one of MSM_INFO_* */
> > > > +   __u64 value;  /* in or out */
> > > > +   __u32 len;/* in or out */
> > > > +   __u32 pad;
> >
> > freedreno/msm/msm_bo.c needs to be updated to reflect those changes.
> 
> 
> I think you can just rename flags->info and offset->value, the rest of
> the struct should be zero-initialized.. if in doubt you can check
> $mesa/src/freedreno/drm/msm_bo.c
> 
> side-note:  the libdrm_freedreno code was folded into mesa in 19.0, so
> at *some* point we can probably disable libdrm_freedreno build by
> default.

Right now, freedreno's `auto` enables it by default on arm and disables it on
everything else.

I always enable everything to at least build-test it, but Ayan was using
the defaults which is why he didn't see this issue at first.

Btw, the GitLab CI builds everything, so it hopefully won't bitrot unnoticed.

> (I'd kinda still like to keep the code around for some misc
> standalone tools I have, but that is the sort of thing where I can fix
> libdrm if it gets broken).  When to switch to disabled by default I
> guess comes down to how long we want to support mesa 18.x with latest
> libdrm??  Maybe after 19.1, since (selfishly motivated) that gives me
> a long enough window back in case I find myself needing to bisect for
> some regression..
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] headers: Sync with drm-next

2019-04-09 Thread Eric Engestrom
On Tuesday, 2019-04-09 12:59:13 +0100, Eric Engestrom wrote:
> On Tuesday, 2019-04-09 11:35:14 +, Ayan Halder wrote:
> > Generated using make headers_install from the drm-next
> > tree - git://anongit.freedesktop.org/drm/drm
> > branch - drm-next
> > commit - 14d2bd53a47a7e1cb3e03d00a6b952734cf90f3f
> > 
> > The changes were as follows :-
> > 
> > core: (drm.h, drm_fourcc.h, drm_mode.h)
> > - Added 'struct drm_syncobj_transfer', 'struct drm_syncobj_timeline_wait' 
> > and 'struct drm_syncobj_timeline_array'
> > - Added various DRM_IOCTL_SYNCOBJ_ ioctls
> > - Added some new RGB and YUV formats
> > - Added 'DRM_FORMAT_MOD_VENDOR_ALLWINNER'
> > - Added 'SAMSUNG' and Arm's 'AFBC' and 'ALLWINNER' format modifiers
> > - Added 'struct drm_mode_rect'
> > 
> > i915:
> > - Added struct 'struct i915_user_extension' and various 'struct 
> > drm_i915_gem_context_'
> > - Added different modes of per-process Graphics Translation Table
> > 
> > msm:
> > - Added various get or set GEM buffer info flags
> > - Added some MSM_SUBMIT_BO_ macros
> > - Modified 'struct drm_msm_gem_info'
> > 
> > Signed-off-by: Ayan Kumar halder 
> 
> This looks sane, and applies cleanly :)
> Acked-by: Eric Engestrom 

Actually, revoking that, as this patch breaks the build; see below.

> 
> > ---
> >  include/drm/drm.h|  36 +++
> >  include/drm/drm_fourcc.h | 136 +++
> >  include/drm/drm_mode.h   |  23 -
> >  include/drm/i915_drm.h   | 237 
> > ---
> >  include/drm/msm_drm.h|  25 +++--
> >  5 files changed, 415 insertions(+), 42 deletions(-)
> > 
[snip]
> > diff --git a/include/drm/msm_drm.h b/include/drm/msm_drm.h
> > index c06d0a5..91a16b3 100644
> > --- a/include/drm/msm_drm.h
> > +++ b/include/drm/msm_drm.h
> > @@ -105,14 +105,24 @@ struct drm_msm_gem_new {
> > __u32 handle; /* out */
> >  };
> >  
> > -#define MSM_INFO_IOVA  0x01
> > -
> > -#define MSM_INFO_FLAGS (MSM_INFO_IOVA)
> > +/* Get or set GEM buffer info.  The requested value can be passed
> > + * directly in 'value', or for data larger than 64b 'value' is a
> > + * pointer to userspace buffer, with 'len' specifying the number of
> > + * bytes copied into that buffer.  For info returned by pointer,
> > + * calling the GEM_INFO ioctl with null 'value' will return the
> > + * required buffer size in 'len'
> > + */
> > +#define MSM_INFO_GET_OFFSET0x00   /* get mmap() offset, returned 
> > by value */
> > +#define MSM_INFO_GET_IOVA  0x01   /* get iova, returned by value */
> > +#define MSM_INFO_SET_NAME  0x02   /* set the debug name (by pointer) */
> > +#define MSM_INFO_GET_NAME  0x03   /* get debug name, returned by pointer */
> >  
> >  struct drm_msm_gem_info {
> > __u32 handle; /* in */
> > -   __u32 flags;  /* in - combination of MSM_INFO_* flags */
> > -   __u64 offset; /* out, mmap() offset or iova */
> > +   __u32 info;   /* in - one of MSM_INFO_* */
> > +   __u64 value;  /* in or out */
> > +   __u32 len;/* in or out */
> > +   __u32 pad;

freedreno/msm/msm_bo.c needs to be updated to reflect those changes.

> >  };
> >  
> >  #define MSM_PREP_READ0x01
> > @@ -188,8 +198,11 @@ struct drm_msm_gem_submit_cmd {
> >   */
> >  #define MSM_SUBMIT_BO_READ 0x0001
> >  #define MSM_SUBMIT_BO_WRITE0x0002
> > +#define MSM_SUBMIT_BO_DUMP 0x0004
> >  
> > -#define MSM_SUBMIT_BO_FLAGS(MSM_SUBMIT_BO_READ | 
> > MSM_SUBMIT_BO_WRITE)
> > +#define MSM_SUBMIT_BO_FLAGS(MSM_SUBMIT_BO_READ | \
> > +   MSM_SUBMIT_BO_WRITE | \
> > +   MSM_SUBMIT_BO_DUMP)
> >  
> >  struct drm_msm_gem_submit_bo {
> > __u32 flags;  /* in, mask of MSM_SUBMIT_BO_x */
> > -- 
> > 2.7.4
> > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] headers: Sync with drm-next

2019-04-09 Thread Eric Engestrom
On Tuesday, 2019-04-09 11:35:14 +, Ayan Halder wrote:
> Generated using make headers_install from the drm-next
> tree - git://anongit.freedesktop.org/drm/drm
> branch - drm-next
> commit - 14d2bd53a47a7e1cb3e03d00a6b952734cf90f3f
> 
> The changes were as follows :-
> 
> core: (drm.h, drm_fourcc.h, drm_mode.h)
> - Added 'struct drm_syncobj_transfer', 'struct drm_syncobj_timeline_wait' and 
> 'struct drm_syncobj_timeline_array'
> - Added various DRM_IOCTL_SYNCOBJ_ ioctls
> - Added some new RGB and YUV formats
> - Added 'DRM_FORMAT_MOD_VENDOR_ALLWINNER'
> - Added 'SAMSUNG' and Arm's 'AFBC' and 'ALLWINNER' format modifiers
> - Added 'struct drm_mode_rect'
> 
> i915:
> - Added struct 'struct i915_user_extension' and various 'struct 
> drm_i915_gem_context_'
> - Added different modes of per-process Graphics Translation Table
> 
> msm:
> - Added various get or set GEM buffer info flags
> - Added some MSM_SUBMIT_BO_ macros
> - Modified 'struct drm_msm_gem_info'
> 
> Signed-off-by: Ayan Kumar halder 

This looks sane, and applies cleanly :)
Acked-by: Eric Engestrom 

> ---
>  include/drm/drm.h|  36 +++
>  include/drm/drm_fourcc.h | 136 +++
>  include/drm/drm_mode.h   |  23 -
>  include/drm/i915_drm.h   | 237 
> ---
>  include/drm/msm_drm.h|  25 +++--
>  5 files changed, 415 insertions(+), 42 deletions(-)
> 
> diff --git a/include/drm/drm.h b/include/drm/drm.h
> index 85c685a..c893f3b 100644
> --- a/include/drm/drm.h
> +++ b/include/drm/drm.h
> @@ -729,8 +729,18 @@ struct drm_syncobj_handle {
>   __u32 pad;
>  };
>  
> +struct drm_syncobj_transfer {
> + __u32 src_handle;
> + __u32 dst_handle;
> + __u64 src_point;
> + __u64 dst_point;
> + __u32 flags;
> + __u32 pad;
> +};
> +
>  #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
>  #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
> +#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time 
> point to become available */
>  struct drm_syncobj_wait {
>   __u64 handles;
>   /* absolute timeout */
> @@ -741,12 +751,33 @@ struct drm_syncobj_wait {
>   __u32 pad;
>  };
>  
> +struct drm_syncobj_timeline_wait {
> + __u64 handles;
> + /* wait on specific timeline point for every handles*/
> + __u64 points;
> + /* absolute timeout */
> + __s64 timeout_nsec;
> + __u32 count_handles;
> + __u32 flags;
> + __u32 first_signaled; /* only valid when not waiting all */
> + __u32 pad;
> +};
> +
> +
>  struct drm_syncobj_array {
>   __u64 handles;
>   __u32 count_handles;
>   __u32 pad;
>  };
>  
> +struct drm_syncobj_timeline_array {
> + __u64 handles;
> + __u64 points;
> + __u32 count_handles;
> + __u32 pad;
> +};
> +
> +
>  /* Query current scanout sequence number */
>  struct drm_crtc_get_sequence {
>   __u32 crtc_id;  /* requested crtc_id */
> @@ -903,6 +934,11 @@ extern "C" {
>  #define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct 
> drm_mode_get_lease)
>  #define DRM_IOCTL_MODE_REVOKE_LEASE  DRM_IOWR(0xC9, struct 
> drm_mode_revoke_lease)
>  
> +#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT  DRM_IOWR(0xCA, struct 
> drm_syncobj_timeline_wait)
> +#define DRM_IOCTL_SYNCOBJ_QUERY  DRM_IOWR(0xCB, struct 
> drm_syncobj_timeline_array)
> +#define DRM_IOCTL_SYNCOBJ_TRANSFER   DRM_IOWR(0xCC, struct 
> drm_syncobj_transfer)
> +#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNALDRM_IOWR(0xCD, struct 
> drm_syncobj_timeline_array)
> +
>  /**
>   * Device specific ioctls should only be in their respective headers
>   * The device specific ioctl range is from 0x40 to 0x9f.
> diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> index 139632b..3feeaa3 100644
> --- a/include/drm/drm_fourcc.h
> +++ b/include/drm/drm_fourcc.h
> @@ -144,6 +144,17 @@ extern "C" {
>  #define DRM_FORMAT_RGBA1010102   fourcc_code('R', 'A', '3', '0') /* 
> [31:0] R:G:B:A 10:10:10:2 little endian */
>  #define DRM_FORMAT_BGRA1010102   fourcc_code('B', 'A', '3', '0') /* 
> [31:0] B:G:R:A 10:10:10:2 little endian */
>  
> +/*
> + * Floating point 64bpp RGB
> + * IEEE 754-2008 binary16 half-precision float
> + * [15:0] sign:exponent:mantissa 1:5:10
> + */
> +#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H')

Re: [PATCH libdrm] headers: Sync with drm-next

2019-04-08 Thread Eric Engestrom
On Monday, 2019-04-08 13:44:17 +, Ayan Halder wrote:
> Generated using make headers_install from the drm-next
> tree - git://anongit.freedesktop.org/drm/drm
> branch - drm-next
> commit - 14d2bd53a47a7e1cb3e03d00a6b952734cf90f3f
> 
> The changes were as follows :-
> 
> core: (drm.h, drm_fourcc.h, drm_mode.h)
> - Added 'struct drm_syncobj_transfer', 'struct drm_syncobj_timeline_wait' and 
> 'struct drm_syncobj_timeline_array'
> - Added various DRM_IOCTL_SYNCOBJ_ ioctls
> - Added some new RGB and YUV formats
> - Added 'DRM_FORMAT_MOD_VENDOR_ALLWINNER'
> - Added 'SAMSUNG' and Arm's 'AFBC' and 'ALLWINNER' format modifiers
> - Added 'struct drm_mode_rect'
> 
> i915:
> - Added struct 'struct i915_user_extension' and various 'struct 
> drm_i915_gem_context_'
> - Added different modes of per-process Graphics Translation Table
> 
> msm:
> - Added various get or set GEM buffer info flags
> - Added some MSM_SUBMIT_BO_ macros
> - Modified 'struct drm_msm_gem_info'
> 
> Signed-off-by: Ayan Kumar halder 
> ---
>  include/drm/drm.h|  36 +++
>  include/drm/drm_fourcc.h | 136 +++
>  include/drm/drm_mode.h   |  23 -
>  include/drm/i915_drm.h   | 237 
> ---
>  include/drm/msm_drm.h|  25 +++--
>  5 files changed, 415 insertions(+), 42 deletions(-)
> 
> diff --git a/include/drm/drm.h b/include/drm/drm.h
> index 85c685a..c893f3b 100644
> --- a/include/drm/drm.h
> +++ b/include/drm/drm.h
> @@ -729,8 +729,18 @@ struct drm_syncobj_handle {
>  __u32 pad;

All the tabs have been deleted, making this patch inapplicable and even
if it applied it would produce invalid code :)

Could you try again, maybe with a different MTA?

>  };
> 
> +struct drm_syncobj_transfer {
> +__u32 src_handle;
> +__u32 dst_handle;
> +__u64 src_point;
> +__u64 dst_point;
> +__u32 flags;
> +__u32 pad;
> +};
> +
>  #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
>  #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
> +#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time 
> point to become available */
>  struct drm_syncobj_wait {
>  __u64 handles;
>  /* absolute timeout */
> @@ -741,12 +751,33 @@ struct drm_syncobj_wait {
>  __u32 pad;
>  };
> 
> +struct drm_syncobj_timeline_wait {
> +__u64 handles;
> +/* wait on specific timeline point for every handles*/
> +__u64 points;
> +/* absolute timeout */
> +__s64 timeout_nsec;
> +__u32 count_handles;
> +__u32 flags;
> +__u32 first_signaled; /* only valid when not waiting all */
> +__u32 pad;
> +};
> +
> +
>  struct drm_syncobj_array {
>  __u64 handles;
>  __u32 count_handles;
>  __u32 pad;
>  };
> 
> +struct drm_syncobj_timeline_array {
> +__u64 handles;
> +__u64 points;
> +__u32 count_handles;
> +__u32 pad;
> +};
> +
> +
>  /* Query current scanout sequence number */
>  struct drm_crtc_get_sequence {
>  __u32 crtc_id;/* requested crtc_id */
> @@ -903,6 +934,11 @@ extern "C" {
>  #define DRM_IOCTL_MODE_GET_LEASEDRM_IOWR(0xC8, struct drm_mode_get_lease)
>  #define DRM_IOCTL_MODE_REVOKE_LEASEDRM_IOWR(0xC9, struct 
> drm_mode_revoke_lease)
> 
> +#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAITDRM_IOWR(0xCA, struct 
> drm_syncobj_timeline_wait)
> +#define DRM_IOCTL_SYNCOBJ_QUERYDRM_IOWR(0xCB, struct 
> drm_syncobj_timeline_array)
> +#define DRM_IOCTL_SYNCOBJ_TRANSFERDRM_IOWR(0xCC, struct drm_syncobj_transfer)
> +#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNALDRM_IOWR(0xCD, struct 
> drm_syncobj_timeline_array)
> +
>  /**
>   * Device specific ioctls should only be in their respective headers
>   * The device specific ioctl range is from 0x40 to 0x9f.
> diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> index 139632b..3feeaa3 100644
> --- a/include/drm/drm_fourcc.h
> +++ b/include/drm/drm_fourcc.h
> @@ -144,6 +144,17 @@ extern "C" {
>  #define DRM_FORMAT_RGBA1010102fourcc_code('R', 'A', '3', '0') /* [31:0] 
> R:G:B:A 10:10:10:2 little endian */
>  #define DRM_FORMAT_BGRA1010102fourcc_code('B', 'A', '3', '0') /* [31:0] 
> B:G:R:A 10:10:10:2 little endian */
> 
> +/*
> + * Floating point 64bpp RGB
> + * IEEE 754-2008 binary16 half-precision float
> + * [15:0] sign:exponent:mantissa 1:5:10
> + */
> +#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] 
> x:R:G:B 16:16:16:16 little endian */
> +#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] 
> x:B:G:R 16:16:16:16 little endian */
> +
> +#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] 
> A:R:G:B 16:16:16:16 little endian */
> +#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] 
> A:B:G:R 16:16:16:16 little endian */
> +
>  /* packed YCbCr */
>  #define DRM_FORMAT_YUYVfourcc_code('Y', 'U', 'Y', 'V') /* [31:0] 
> Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */
>  #define DRM_FORMAT_YVYUfourcc_code('Y', 'V', 'Y', 'U') /* [31:0] 
> Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */
> @@ -151,6 +162,52 @@ extern "C" {
>  #define DRM_FORMAT_VYUYfourcc_code('V', 'Y', 'U', 'Y') /* [31:0] 
>

Re: [PATCH v2] drm/vkms: Add overlay plane support

2019-03-06 Thread Eric Engestrom
On Tuesday, 2019-03-05 21:54:47 +0530, Mamta Shukla wrote:
> Add overlay plane support in vkms aligned with cursor and primary
> plane with module option 'enable_overlay' to enable/disable overlay
> plane while testing.
> 
> This currently passes plane-position-covered-pipe-A-plane subtest
> from IGT kms_plane test.
> 
> Signed-off-by: Mamta Shukla 
> ---
> change in v2:
> -Fix warning: return makes pointer from integer without a cast using
>  ERR_PTR
> 
>  drivers/gpu/drm/vkms/vkms_crc.c   | 36 +++
>  drivers/gpu/drm/vkms/vkms_drv.c   |  4 
>  drivers/gpu/drm/vkms/vkms_drv.h   |  8 +++
>  drivers/gpu/drm/vkms/vkms_plane.c | 36 ++-
>  4 files changed, 79 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c
> index 4dd6c155363d..ac3ed863cf34 100644
> --- a/drivers/gpu/drm/vkms/vkms_crc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crc.c
> @@ -109,6 +109,25 @@ static void blend(void *vaddr_dst, void *vaddr_src,
>   }
>  }
>  
> +static void compose_overlay(struct vkms_crc_data *overlay_crc,
> + struct vkms_crc_data *primary_crc, void *vaddr_out) 
> {
> + struct drm_gem_object *overlay_obj;
> + struct vkms_gem_object  *overlay_vkms_obj;
> +
> + overlay_obj = drm_gem_fb_get_obj(&overlay_crc->fb, 0);
> + overlay_vkms_obj = drm_gem_to_vkms_gem(overlay_obj);
> + mutex_lock(&overlay_vkms_obj->pages_lock);
> + if(!overlay_vkms_obj->vaddr){
> + DRM_WARN("overlay palne vaddr is NULL");

s/palne/plane/

> + goto out;
> + }
> +
> + blend(vaddr_out, overlay_vkms_obj->vaddr, primary_crc, overlay_crc);
> +
> +out:
> + mutex_unlock(&overlay_vkms_obj->pages_lock);
> +}
> +
>  static void compose_cursor(struct vkms_crc_data *cursor_crc,
>  struct vkms_crc_data *primary_crc, void *vaddr_out)
>  {
> @@ -131,7 +150,8 @@ static void compose_cursor(struct vkms_crc_data 
> *cursor_crc,
>  }
>  
>  static uint32_t _vkms_get_crc(struct vkms_crc_data *primary_crc,
> -   struct vkms_crc_data *cursor_crc)
> +   struct vkms_crc_data *cursor_crc,
> +   struct vkms_crc_data *overlay_crc)
>  {
>   struct drm_framebuffer *fb = &primary_crc->fb;
>   struct drm_gem_object *gem_obj = drm_gem_fb_get_obj(fb, 0);
> @@ -154,6 +174,8 @@ static uint32_t _vkms_get_crc(struct vkms_crc_data 
> *primary_crc,
>   memcpy(vaddr_out, vkms_obj->vaddr, vkms_obj->gem.size);
>   mutex_unlock(&vkms_obj->pages_lock);
>  
> + if (overlay_crc)
> + compose_overlay(overlay_crc, primary_crc, vaddr_out);
>   if (cursor_crc)
>   compose_cursor(cursor_crc, primary_crc, vaddr_out);
>  
> @@ -184,6 +206,7 @@ void vkms_crc_work_handle(struct work_struct *work)
>   output);
>   struct vkms_crc_data *primary_crc = NULL;
>   struct vkms_crc_data *cursor_crc = NULL;
> + struct vkms_crc_data *overlay_crc = NULL;
>   struct drm_plane *plane;
>   u32 crc32 = 0;
>   u64 frame_start, frame_end;
> @@ -210,12 +233,17 @@ void vkms_crc_work_handle(struct work_struct *work)
>  
>   if (plane->type == DRM_PLANE_TYPE_PRIMARY)
>   primary_crc = crc_data;
> - else
> +
> + if (plane->type == DRM_PLANE_TYPE_CURSOR)
>   cursor_crc = crc_data;
> +
> + if (plane->type == DRM_PLANE_TYPE_OVERLAY)
> + overlay_crc = crc_data;

Maybe turn that into a switch() ?

>   }
>  
> - if (primary_crc)
> - crc32 = _vkms_get_crc(primary_crc, cursor_crc);
> + if (primary_crc){
> + crc32 = _vkms_get_crc(primary_crc, cursor_crc, overlay_crc);
> + }
>  
>   frame_end = drm_crtc_accurate_vblank_count(crtc);
>  
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 738dd6206d85..b08ad6f95675 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -29,6 +29,10 @@ bool enable_cursor;
>  module_param_named(enable_cursor, enable_cursor, bool, 0444);
>  MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support");
>  
> +bool enable_overlay;
> +module_param_named(enable_overlay, enable_overlay, bool, 0444);
> +MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
> +
>  static const struct file_operations vkms_driver_fops = {
>   .owner  = THIS_MODULE,
>   .open   = drm_open,
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index 81f1cfbeb936..81dceadfde62 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -20,6 +20,8 @@
>  
>  extern bool enable_cursor;
>  
> +extern bool enable_overlay;
> +
>  static const u32 vkms_formats[] = {
>   DRM_FORMAT_XRGB,
>  };
> @@ -28,6 +30,10

Re: [PATCH libdrm] libkms: update list of intel_drivers for Android build

2019-03-04 Thread Eric Engestrom
On Monday, 2019-03-04 08:28:25 +0200, Tapani Pälli wrote:
> ping!

Reviewed-by: Eric Engestrom 

> 
> On 2/21/19 8:56 AM, Tapani Pälli wrote:
> > Add new iris driver, remove deprecated ilo driver.
> > 
> > Signed-off-by: Tapani Pälli 
> > ---
> >   libkms/Android.mk | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libkms/Android.mk b/libkms/Android.mk
> > index 0be72054..a8b9489f 100644
> > --- a/libkms/Android.mk
> > +++ b/libkms/Android.mk
> > @@ -1,6 +1,6 @@
> >   DRM_GPU_DRIVERS := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS)))
> > -intel_drivers := i915 i965 i915g ilo
> > +intel_drivers := i915 i965 i915g iris
> >   radeon_drivers := r300g r600g radeonsi
> >   nouveau_drivers := nouveau
> >   virgl_drivers := virgl
> > 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [RESEND][PATCH libdrm] configure.ac fix build error for config.h in autotools

2019-02-26 Thread Eric Engestrom
On Tuesday, 2019-02-26 10:00:56 +0900, Seung-Woo Kim wrote:
> After the commit 0926f0af54d6 ("meson,configure: include config.h
> automatically"), there is build error for autotools because
> config.h is not included. Fix the error by adding "-include
> config.h" to CPPFLAGS instead of CFLAGS from configure.ac.

Thanks!

Reviewed-by: Eric Engestrom 
Fixes: 0926f0af54d654b1a958 "meson,configure: include config.h automatically"

I'll push it in moment.

> 
> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=106561
> Signed-off-by: Seung-Woo Kim 
> ---
> It looks like missed from mailing list, so I resend.
> ---
>  configure.ac |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 7e7c8d3..d72e84a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -541,7 +541,7 @@ else
>  AC_DEFINE(HAVE_VISIBILITY, 0)
>  fi
>  
> -CFLAGS="$CFLAGS -include config.h"
> +CPPFLAGS="$CPPFLAGS -include config.h"
>  
>  AC_SUBST(WARN_CFLAGS)
>  AC_CONFIG_FILES([
> -- 
> 1.7.4.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: freedreno header uses not installed xf86atomic.h

2019-02-19 Thread Eric Engestrom
On Tuesday, 2019-02-19 11:56:21 +, Emil Velikov wrote:
> On Tue, 19 Feb 2019 at 10:08, Eric Engestrom  wrote:
> >
> > On Friday, 2019-02-15 15:08:22 +, Emil Velikov via dri-devel wrote:
> > > On Fri, 15 Feb 2019 at 15:06, Rob Clark via dri-devel
> > >  wrote:
> > > >
> > > > On Fri, Feb 15, 2019 at 8:42 AM Eric Engestrom 
> > > >  wrote:
> > > > >
> > > > > On Friday, 2019-02-15 13:36:39 +, Eric Engestrom wrote:
> > > > > > On Friday, 2019-02-15 07:11:55 -0500, Rob Clark wrote:
> > > > > > > On Fri, Feb 15, 2019 at 3:55 AM Daniel Drake  
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Using libdrm-2.4.97, mesa fails to build on ARM with:
> > > > > > > >
> > > > > > > > [  456s] In file included from
> > > > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_util.h:33,
> > > > > > > > [  456s]  from
> > > > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_batch.h:34,
> > > > > > > > [  456s]  from
> > > > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_context.h:39,
> > > > > > > > [  456s]  from
> > > > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_program.c:33:
> > > > > > > > [  456s] /usr/include/freedreno/freedreno_ringbuffer.h:32:10: 
> > > > > > > > fatal
> > > > > > > > error: xf86atomic.h: No such file or directory
> > > > > > > >
> > > > > > > > The freedreno headers were recently modified to use 
> > > > > > > > xf86atomic.h:
> > > > > > > > https://gitlab.freedesktop.org/mesa/drm/commit/b541d21a0a908bf98d44375720f4430297720743
> > > > > > > >
> > > > > > >
> > > > > > > oh, that union/ifdef hack was specifically to avoid this issue..
> > > > > > > probably the patch removing it should be reverted.
> > > > > >
> > > > > > Right, I messed up with that commit, I didn't realise 
> > > > > > freedreno_ringbuffer.h
> > > > > > was installed. We need to remove that include.
> > > > > >
> > > > > > That said, I'm confused as to how freedreno_ringbuffer.h users in 
> > > > > > Mesa
> > > > > > knows whether it's safe to use refcnt from that union?
> > > > > > It doesn't check for HAS_ATOMIC_OPS, so it can't know whether it
> > > > > > contains garbage padding or a refcount, can it?
> > > > >
> > > > > No, that wouldn't even compile?
> > > > >
> > > > > (with the code before my messed up commit:)
> > > > > Mesa includes freedreno_ringbuffer.h but doesn't define 
> > > > > HAS_ATOMIC_OPS,
> > > > > so fd_ringbuffer::refcnt doesn't get compiled in (but the padding is
> > > > > still there), so code in mesa can't use ->refcnt because the compiler
> > > > > wouldn't know what that is.
> > > > >
> > > > > I must be missing something, how did this ever compile?
> > > >
> > > > So, these days, mesa has it's own copy of the libdrm code,
> > > > libdrm_freedreno really only exists so that you can still build old
> > > > mesa with new libdrm.  And for a handful of small standalone utilities
> > > > (fdperf, and some test code I use to poke the hw standalone)..
> > > >
> > > > But the way it works is that mesa never needs to access the refcnt, it
> > > > mostly only needs to access cur/end (and it wants to do that in a way
> > > > that can be inlined, not fxn call into a different dso, since that is
> > > > a hot path).  The only code that accesses the refcnt is in the libdrm
> > > > code itself.  Hence this ugly union hack, just to make the struct the
> > > > same size both for mesa and for libdrm.
> > > >
> > > Ouch, I did not see the header was installed either.
> > >
> > > Just skimmed through Mesa prior to the libdrm_freedreno merge - there
> > > are no refe

Re: [PATCH libdrm] RELEASING: update instructions to use meson instead of autotools

2019-02-19 Thread Eric Engestrom
On Tuesday, 2019-02-19 13:53:25 +0100, Daniel Vetter wrote:
> On Tue, Feb 19, 2019 at 12:57 PM Emil Velikov  
> wrote:
> >
> > On Mon, 18 Feb 2019 at 17:42, Eric Engestrom  
> > wrote:
> > >
> > > On Thursday, 2018-12-20 11:53:11 -0800, Dylan Baker wrote:
> > > > Quoting Eric Engestrom (2018-12-19 08:23:40)
> > > > > Signed-off-by: Eric Engestrom 
> > > > > ---
> > > > >  RELEASING | 27 ---
> > > > >  1 file changed, 8 insertions(+), 19 deletions(-)
> > > > >
> > > > > diff --git a/RELEASING b/RELEASING
> > > > > index 7e03e3b9acb1cbfb261a..d1ad8e3b4ad16d4ca14f 100644
> > > > > --- a/RELEASING
> > > > > +++ b/RELEASING
> > > > > @@ -9,25 +9,14 @@ However, this is up to whoever is driving the 
> > > > > feature in question.
> > > > >
> > > > >  Follow these steps to release a new version of libdrm:
> > > > >
> > > > > -  1) Bump the version number in configure.ac and meson.build. We seem
> > > > > - to have settled for 2.4.x as the versioning scheme for libdrm, 
> > > > > so
> > > > > - just bump the  micro version.
> > > > > -
> > > > > -  2) Run autoconf and then re-run ./configure so the build system
> > > > > - picks up the new version number.
> > > > > -
> > > > > -  3) Verify that the code passes "make distcheck".  Running "make
> > > > > - distcheck" should result in no warnings or errors and end with a
> > > > > - message of the form:
> > > > > -
> > > > > -   =
> > > > > -   libdrm-X.Y.Z archives ready for distribution:
> > > > > -   libdrm-X.Y.Z.tar.gz
> > > > > -   libdrm-X.Y.Z.tar.bz2
> > > > > -   =
> > > > > -
> > > > > - Make sure that the version number reported by distcheck and in
> > > > > - the tarball names matches the number you bumped to in 
> > > > > configure.ac.
> > > > > +  1) Bump the version number in meson.build. We seem to have settled 
> > > > > for
> > > > > + 2.4.x as the versioning scheme for libdrm, so just bump the 
> > > > > micro
> > > > > + version.
> > > > > +
> > > > > +  2) Run `ninja -C builddir/ dist` to generate the tarballs.
> > > > > + Make sure that the version number of the tarball name in
> > > > > + builddir/meson-dist/ matches the number you bumped to. Move that
> > > > > + tarball to the libdrm repo root for the release script to pick 
> > > > > up.
> > > > >
> > > > >4) Push the updated master branch with the bumped version number:
> > >
> > > Just noticed I forgot to decrement item 4 & 5 :]
> > >
> > > > >
> > > > > --
> > > > > Cheers,
> > > > >   Eric
> > > > >
> > > >
> > > > Acked-by: Dylan Baker 
> > > >
> > > > But you should probably get someone other than just me to look at this.
> > >
> > > There is no "libdrm maintainer", which makes everyone a libdrm
> > > maintainer :]
> > >
> > > If nobody object, I'll push this in a few weeks (there's really no rush,
> > > but I want to make that move at some point, we have no reason to stay
> > > dependant on autotools now that we have better tools).
> >
> > Must admit I'm not the biggest fan. I can see this being cool for the
> > maintainer, if autotools was was present on their system.
> > The unfortunate reality is - it's there for the foreseeable future.
> > If anything it makes it more annoying for those using autotools/make -
> > regardless if they like doing so or not.
> >
> > So that's a nack from me :-\
> 
> Not really following what's the downside is of using meson to cut the
> release tarball? Resulting tarball should still be able to build fine
> with automake. If the concern is that automake will bitrot, then I
> think a much better solution is to add a few automake targets to the
> gitlab ci autobuilder stuff. That's what we've done for igt at least,
> works neatly.

Agreed, and to me using meson has a huge upside: it packages what's in git,
unlike autotools which packages whatever was on your machine at the time.
This makes it much less likely to accidentally send files with local
modifications or add/remove files without meaning to.

Like I said though, there's no rush, so let's make sure issues are
addressed first.

I'll add a CI job to run `make distcheck` on releases (libdrm-* tags).

Emil, would that be enough, or was your concern something else?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: freedreno header uses not installed xf86atomic.h

2019-02-19 Thread Eric Engestrom
On Friday, 2019-02-15 15:08:22 +, Emil Velikov via dri-devel wrote:
> On Fri, 15 Feb 2019 at 15:06, Rob Clark via dri-devel
>  wrote:
> >
> > On Fri, Feb 15, 2019 at 8:42 AM Eric Engestrom  
> > wrote:
> > >
> > > On Friday, 2019-02-15 13:36:39 +, Eric Engestrom wrote:
> > > > On Friday, 2019-02-15 07:11:55 -0500, Rob Clark wrote:
> > > > > On Fri, Feb 15, 2019 at 3:55 AM Daniel Drake  
> > > > > wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Using libdrm-2.4.97, mesa fails to build on ARM with:
> > > > > >
> > > > > > [  456s] In file included from
> > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_util.h:33,
> > > > > > [  456s]  from
> > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_batch.h:34,
> > > > > > [  456s]  from
> > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_context.h:39,
> > > > > > [  456s]  from
> > > > > > ../../../../../src/gallium/drivers/freedreno/freedreno_program.c:33:
> > > > > > [  456s] /usr/include/freedreno/freedreno_ringbuffer.h:32:10: fatal
> > > > > > error: xf86atomic.h: No such file or directory
> > > > > >
> > > > > > The freedreno headers were recently modified to use xf86atomic.h:
> > > > > > https://gitlab.freedesktop.org/mesa/drm/commit/b541d21a0a908bf98d44375720f4430297720743
> > > > > >
> > > > >
> > > > > oh, that union/ifdef hack was specifically to avoid this issue..
> > > > > probably the patch removing it should be reverted.
> > > >
> > > > Right, I messed up with that commit, I didn't realise 
> > > > freedreno_ringbuffer.h
> > > > was installed. We need to remove that include.
> > > >
> > > > That said, I'm confused as to how freedreno_ringbuffer.h users in Mesa
> > > > knows whether it's safe to use refcnt from that union?
> > > > It doesn't check for HAS_ATOMIC_OPS, so it can't know whether it
> > > > contains garbage padding or a refcount, can it?
> > >
> > > No, that wouldn't even compile?
> > >
> > > (with the code before my messed up commit:)
> > > Mesa includes freedreno_ringbuffer.h but doesn't define HAS_ATOMIC_OPS,
> > > so fd_ringbuffer::refcnt doesn't get compiled in (but the padding is
> > > still there), so code in mesa can't use ->refcnt because the compiler
> > > wouldn't know what that is.
> > >
> > > I must be missing something, how did this ever compile?
> >
> > So, these days, mesa has it's own copy of the libdrm code,
> > libdrm_freedreno really only exists so that you can still build old
> > mesa with new libdrm.  And for a handful of small standalone utilities
> > (fdperf, and some test code I use to poke the hw standalone)..
> >
> > But the way it works is that mesa never needs to access the refcnt, it
> > mostly only needs to access cur/end (and it wants to do that in a way
> > that can be inlined, not fxn call into a different dso, since that is
> > a hot path).  The only code that accesses the refcnt is in the libdrm
> > code itself.  Hence this ugly union hack, just to make the struct the
> > same size both for mesa and for libdrm.
> >
> Ouch, I did not see the header was installed either.
> 
> Just skimmed through Mesa prior to the libdrm_freedreno merge - there
> are no references of fd_ringbuffer::refcnt.
> So a simple revert will do the job. To avoid repeating this mistake,
> we want to add an inline comment.

Reverting the commits now, and I went to add a comment and saw that
there was already one that I blindly missed last time around:

  /* This is a bit gross, but we can't use atomic_t in exported
   * headers.  OTOH, we don't need the refcnt to be publicly
   * visible.  The only reason that this struct is exported is
   * because fd_ringbuffer_emit needs to be something that can
   * be inlined for performance reasons.
   */

I just pushed the revert:
e09f327765902f3b7d31 "freedreno: revert bad freedreno/atomic_ops commits"

Emil, I'd like to release libdrm-2.4.98 today/tomorrow, I assume you're
ok with that (since you got your MODALIAS change in there as well, which
you wanted for your mesa series)?
The drmIsMaster() issue also got fixed, so I think we're good to have
a better release than the previous one :]

Should I send an MR blacklisting libdrm-2.4.97 in mesa/freedreno?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] RELEASING: update instructions to use meson instead of autotools

2019-02-18 Thread Eric Engestrom
On Thursday, 2018-12-20 11:53:11 -0800, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-12-19 08:23:40)
> > Signed-off-by: Eric Engestrom 
> > ---
> >  RELEASING | 27 ---
> >  1 file changed, 8 insertions(+), 19 deletions(-)
> > 
> > diff --git a/RELEASING b/RELEASING
> > index 7e03e3b9acb1cbfb261a..d1ad8e3b4ad16d4ca14f 100644
> > --- a/RELEASING
> > +++ b/RELEASING
> > @@ -9,25 +9,14 @@ However, this is up to whoever is driving the feature in 
> > question.
> >  
> >  Follow these steps to release a new version of libdrm:
> >  
> > -  1) Bump the version number in configure.ac and meson.build. We seem
> > - to have settled for 2.4.x as the versioning scheme for libdrm, so
> > - just bump the  micro version.
> > -
> > -  2) Run autoconf and then re-run ./configure so the build system
> > - picks up the new version number.
> > -
> > -  3) Verify that the code passes "make distcheck".  Running "make
> > - distcheck" should result in no warnings or errors and end with a
> > - message of the form:
> > -
> > -   =
> > -   libdrm-X.Y.Z archives ready for distribution:
> > -   libdrm-X.Y.Z.tar.gz
> > -   libdrm-X.Y.Z.tar.bz2
> > -   =
> > -
> > - Make sure that the version number reported by distcheck and in
> > - the tarball names matches the number you bumped to in configure.ac.
> > +  1) Bump the version number in meson.build. We seem to have settled for
> > + 2.4.x as the versioning scheme for libdrm, so just bump the micro
> > + version.
> > +
> > +  2) Run `ninja -C builddir/ dist` to generate the tarballs.
> > + Make sure that the version number of the tarball name in
> > + builddir/meson-dist/ matches the number you bumped to. Move that
> > + tarball to the libdrm repo root for the release script to pick up.
> >  
> >4) Push the updated master branch with the bumped version number:

Just noticed I forgot to decrement item 4 & 5 :]

> >  
> > -- 
> > Cheers,
> >   Eric
> > 
> 
> Acked-by: Dylan Baker 
> 
> But you should probably get someone other than just me to look at this.

There is no "libdrm maintainer", which makes everyone a libdrm
maintainer :]

If nobody object, I'll push this in a few weeks (there's really no rush,
but I want to make that move at some point, we have no reason to stay
dependant on autotools now that we have better tools).
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm 1/3] xf86drm: dedupe `#define`s

2019-02-18 Thread Eric Engestrom
On Wednesday, 2018-12-19 17:08:01 +, Eric Engestrom wrote:
> Adapted from a local patch carried by DragonFlyBSD:
> https://github.com/DragonFlyBSD/DPorts/blob/bc056f88f7e4d468d8c9751f831a47b5ae1326e3/graphics/libdrm/files/patch-xf86drm.h
> 
> Patch is sadly uncredited (a bot authored the commit), so I can't credit
> the author here either.
> 
> Signed-off-by: Eric Engestrom 

Ping? :)

> ---
>  xf86drm.c | 10 --
>  xf86drm.h | 16 ++--
>  2 files changed, 10 insertions(+), 16 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 377ddf917d2cb902899a..07425b19897d00a19e8a 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -71,16 +71,6 @@
>  
>  #include "util_math.h"
>  
> -#ifdef __OpenBSD__
> -#define DRM_PRIMARY_MINOR_NAME  "drm"
> -#define DRM_CONTROL_MINOR_NAME  "drmC"
> -#define DRM_RENDER_MINOR_NAME   "drmR"
> -#else
> -#define DRM_PRIMARY_MINOR_NAME  "card"
> -#define DRM_CONTROL_MINOR_NAME  "controlD"
> -#define DRM_RENDER_MINOR_NAME   "renderD"
> -#endif
> -
>  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
> defined(__DragonFly__)
>  #define DRM_MAJOR 145
>  #endif
> diff --git a/xf86drm.h b/xf86drm.h
> index 7773d71a803084e86920..18668ff3d40d7db55c95 100644
> --- a/xf86drm.h
> +++ b/xf86drm.h
> @@ -78,17 +78,21 @@ extern "C" {
>  
>  #ifdef __OpenBSD__
>  #define DRM_DIR_NAME  "/dev"
> -#define DRM_DEV_NAME  "%s/drm%d"
> -#define DRM_CONTROL_DEV_NAME  "%s/drmC%d"
> -#define DRM_RENDER_DEV_NAME  "%s/drmR%d"
> +#define DRM_PRIMARY_MINOR_NAME  "drm"
> +#define DRM_CONTROL_MINOR_NAME  "drmC"
> +#define DRM_RENDER_MINOR_NAME   "drmR"
>  #else
>  #define DRM_DIR_NAME  "/dev/dri"
> -#define DRM_DEV_NAME  "%s/card%d"
> -#define DRM_CONTROL_DEV_NAME  "%s/controlD%d"
> -#define DRM_RENDER_DEV_NAME  "%s/renderD%d"
> +#define DRM_PRIMARY_MINOR_NAME  "card"
> +#define DRM_CONTROL_MINOR_NAME  "controlD"
> +#define DRM_RENDER_MINOR_NAME   "renderD"
>  #define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
>  #endif
>  
> +#define DRM_DEV_NAME  "%s/" DRM_PRIMARY_MINOR_NAME "%d"
> +#define DRM_CONTROL_DEV_NAME  "%s/" DRM_CONTROL_MINOR_NAME "%d"
> +#define DRM_RENDER_DEV_NAME   "%s/" DRM_RENDER_MINOR_NAME  "%d"
> +
>  #define DRM_ERR_NO_DEVICE  (-1001)
>  #define DRM_ERR_NO_ACCESS  (-1002)
>  #define DRM_ERR_NOT_ROOT   (-1003)
> -- 
> Cheers,
>   Eric
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: freedreno header uses not installed xf86atomic.h

2019-02-15 Thread Eric Engestrom via dri-devel
On Friday, 2019-02-15 07:11:55 -0500, Rob Clark wrote:
> On Fri, Feb 15, 2019 at 3:55 AM Daniel Drake  wrote:
> >
> > Hi,
> >
> > Using libdrm-2.4.97, mesa fails to build on ARM with:
> >
> > [  456s] In file included from
> > ../../../../../src/gallium/drivers/freedreno/freedreno_util.h:33,
> > [  456s]  from
> > ../../../../../src/gallium/drivers/freedreno/freedreno_batch.h:34,
> > [  456s]  from
> > ../../../../../src/gallium/drivers/freedreno/freedreno_context.h:39,
> > [  456s]  from
> > ../../../../../src/gallium/drivers/freedreno/freedreno_program.c:33:
> > [  456s] /usr/include/freedreno/freedreno_ringbuffer.h:32:10: fatal
> > error: xf86atomic.h: No such file or directory
> >
> > The freedreno headers were recently modified to use xf86atomic.h:
> > https://gitlab.freedesktop.org/mesa/drm/commit/b541d21a0a908bf98d44375720f4430297720743
> >
> 
> oh, that union/ifdef hack was specifically to avoid this issue..
> probably the patch removing it should be reverted.

Right, I messed up with that commit, I didn't realise freedreno_ringbuffer.h
was installed. We need to remove that include.

That said, I'm confused as to how freedreno_ringbuffer.h users in Mesa
knows whether it's safe to use refcnt from that union?
It doesn't check for HAS_ATOMIC_OPS, so it can't know whether it
contains garbage padding or a refcount, can it?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: freedreno header uses not installed xf86atomic.h

2019-02-15 Thread Eric Engestrom via dri-devel
On Friday, 2019-02-15 13:36:39 +, Eric Engestrom wrote:
> On Friday, 2019-02-15 07:11:55 -0500, Rob Clark wrote:
> > On Fri, Feb 15, 2019 at 3:55 AM Daniel Drake  wrote:
> > >
> > > Hi,
> > >
> > > Using libdrm-2.4.97, mesa fails to build on ARM with:
> > >
> > > [  456s] In file included from
> > > ../../../../../src/gallium/drivers/freedreno/freedreno_util.h:33,
> > > [  456s]  from
> > > ../../../../../src/gallium/drivers/freedreno/freedreno_batch.h:34,
> > > [  456s]  from
> > > ../../../../../src/gallium/drivers/freedreno/freedreno_context.h:39,
> > > [  456s]  from
> > > ../../../../../src/gallium/drivers/freedreno/freedreno_program.c:33:
> > > [  456s] /usr/include/freedreno/freedreno_ringbuffer.h:32:10: fatal
> > > error: xf86atomic.h: No such file or directory
> > >
> > > The freedreno headers were recently modified to use xf86atomic.h:
> > > https://gitlab.freedesktop.org/mesa/drm/commit/b541d21a0a908bf98d44375720f4430297720743
> > >
> > 
> > oh, that union/ifdef hack was specifically to avoid this issue..
> > probably the patch removing it should be reverted.
> 
> Right, I messed up with that commit, I didn't realise freedreno_ringbuffer.h
> was installed. We need to remove that include.
> 
> That said, I'm confused as to how freedreno_ringbuffer.h users in Mesa
> knows whether it's safe to use refcnt from that union?
> It doesn't check for HAS_ATOMIC_OPS, so it can't know whether it
> contains garbage padding or a refcount, can it?

No, that wouldn't even compile?

(with the code before my messed up commit:)
Mesa includes freedreno_ringbuffer.h but doesn't define HAS_ATOMIC_OPS,
so fd_ringbuffer::refcnt doesn't get compiled in (but the padding is
still there), so code in mesa can't use ->refcnt because the compiler
wouldn't know what that is.

I must be missing something, how did this ever compile?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH libdrm] xf86drm: fix return type for drmIsMaster()

2019-02-08 Thread Eric Engestrom
On Friday, 2019-02-08 16:50:44 +, Emil Velikov wrote:
> On Fri, 8 Feb 2019 at 16:51, Daniel Stone  wrote:
> >
> > Hi Eric,
> >
> > On Fri, 8 Feb 2019 at 15:03, Eric Engestrom  
> > wrote:
> > > Xserver has struct members named `bool`, which means the last commit
> > > breaks its build with errors like this:
> > >
> > >   error: two or more data types in declaration specifiers
> > >   Bool bool;
> > >^
> > >
> > > Fix this by making it return a 0/1 integer, with the same semantic as
> > > the boolean it was before.
> >
> > Don't you need to drop the stdbool.h include for this to fix compilation?

Ahem... /me looks for his brown paper bag :]

> >
> Thanks Eric. With Dan's comment
> Reviewed-by: Emil Velikov 
> 
> I really wonder if we cannot fix these trivial X nuisances? As-is
> every project used has to either work around X mistakes :-(
> Wrt libdrm that is fine, yet other projects might be less happy.

Agreed :/

The issue is that you still won't be able to have bools in libdrm,
because a new libdrm might be used with an old xserver...

> 
> Thanks
> -Emil
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] xf86drm: fix return type for drmIsMaster()

2019-02-08 Thread Eric Engestrom
Xserver has struct members named `bool`, which means the last commit
breaks its build with errors like this:

  error: two or more data types in declaration specifiers
  Bool bool;
   ^

Fix this by making it return a 0/1 integer, with the same semantic as
the boolean it was before.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109587
Fixes: 17dfe3ac93217b43f93b "xf86drm: Add drmIsMaster()"
Cc: Christopher James Halse Rogers 
Cc: Emil Velikov 
Signed-off-by: Eric Engestrom 
---
 xf86drm.c | 2 +-
 xf86drm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 54695fcd5d1967574b00..05331c6d15bdd15b4be5 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2724,7 +2724,7 @@ drm_public int drmDropMaster(int fd)
 return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
 }
 
-drm_public bool drmIsMaster(int fd)
+drm_public int drmIsMaster(int fd)
 {
 /* Detect master by attempting something that requires master.
  *
diff --git a/xf86drm.h b/xf86drm.h
index b31ec9b5673a717bd6f3..9666a12c36bf28996157 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -746,7 +746,7 @@ extern void drmMsg(const char *format, ...) 
DRM_PRINTFLIKE(1, 2);
 
 extern int drmSetMaster(int fd);
 extern int drmDropMaster(int fd);
-extern bool drmIsMaster(int fd);
+extern int drmIsMaster(int fd);
 
 #define DRM_EVENT_CONTEXT_VERSION 4
 
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/doc: Task to rename CMA helpers

2019-01-29 Thread Eric Engestrom
On Tuesday, 2019-01-29 14:21:53 +0100, Daniel Vetter wrote:
> I'm kinda fed up explaining why the have a confusing name :-)
> 
> Cc: Noralf Trønnes 
> Cc: Laurent Pinchart 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/todo.rst | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede1221..17f1cde6adab 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,16 @@ As a reference, take a look at the conversions already 
> completed in drm core.
>  
>  Contact: Sean Paul, respective driver maintainers
>  
> +Rename CMA helpers to DMA helpers
> +-
> +
> +CMA (standing for contiguous memory allocator) is really a bit an accident of
> +what these were used for first, a much better name would be DMA helpers. In 
> the
> +text these should even be called coherent DMA memory helpers (so maybd CDM, 
> but
> +no one knows what that means) since underneath they just use 
> dma_alloc_coherent.

s/maybd/maybe/

> +
> +Contact: Laurent Pinchart, Daniel Vetter
> +
>  Core refactorings
>  =
>  
> -- 
> 2.20.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 2/2] xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus, Device}Info

2019-01-25 Thread Eric Engestrom
On Wednesday, 2019-01-23 10:45:18 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> The functions are virtually identical, fold them up.
> 
> Signed-off-by: Emil Velikov 

Assuming patch 1 is OK, and `foo` gets renamed to something better:
Reviewed-by: Eric Engestrom 

I don't know enough to review patch 1 though.

> ---
>  xf86drm.c | 98 +--
>  1 file changed, 15 insertions(+), 83 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 374734eb..18c9693a 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3508,7 +3508,7 @@ free_device:
>  return ret;
>  }
>  
> -static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr 
> info)
> +static int drmParseOFBusInfo(int maj, int min, char *fullname)
>  {
>  #ifdef __linux__
>  char path[PATH_MAX + 1], *name, *foo;
> @@ -3532,19 +3532,18 @@ static int drmParsePlatformBusInfo(int maj, int min, 
> drmPlatformBusInfoPtr info)
>  foo++;
>  }
>  
> -strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
> -info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
> +strncpy(fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
> +fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
>  free(name);
>  
>  return 0;
>  #else
> -#warning "Missing implementation of drmParsePlatformBusInfo"
> +#warning "Missing implementation of drmParseOFBusInfo"
>  return -EINVAL;
>  #endif
>  }
>  
> -static int drmParsePlatformDeviceInfo(int maj, int min,
> -  drmPlatformDeviceInfoPtr info)
> +static int drmParseOFDeviceInfo(int maj, int min, char ***compatible)
>  {
>  #ifdef __linux__
>  char path[PATH_MAX + 1], *value, *foo;
> @@ -3562,8 +3561,8 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
>  count = 1;
>  }
>  
> -info->compatible = calloc(count + 1, sizeof(*info->compatible));
> -if (!info->compatible)
> +*compatible = calloc(count + 1, sizeof(char *));
> +if (!*compatible)
>  return -ENOMEM;
>  
>  for (i = 0; i < count; i++) {
> @@ -3587,19 +3586,19 @@ static int drmParsePlatformDeviceInfo(int maj, int 
> min,
>  free(value);
>  }
>  
> -info->compatible[i] = foo;
> +*compatible[i] = foo;
>  }
>  
>  return 0;
>  
>  free:
>  while (i--)
> -free(info->compatible[i]);
> +free(*compatible[i]);
>  
> -free(info->compatible);
> +free(*compatible);
>  return err;
>  #else
> -#warning "Missing implementation of drmParsePlatformDeviceInfo"
> +#warning "Missing implementation of drmParseOFDeviceInfo"
>  return -EINVAL;
>  #endif
>  }
> @@ -3622,7 +3621,7 @@ static int drmProcessPlatformDevice(drmDevicePtr 
> *device,
>  
>  dev->businfo.platform = (drmPlatformBusInfoPtr)ptr;
>  
> -ret = drmParsePlatformBusInfo(maj, min, dev->businfo.platform);
> +ret = drmParseOFBusInfo(maj, min, dev->businfo.platform->fullname);
>  if (ret < 0)
>  goto free_device;
>  
> @@ -3630,7 +3629,7 @@ static int drmProcessPlatformDevice(drmDevicePtr 
> *device,
>  ptr += sizeof(drmPlatformBusInfo);
>  dev->deviceinfo.platform = (drmPlatformDeviceInfoPtr)ptr;
>  
> -ret = drmParsePlatformDeviceInfo(maj, min, dev->deviceinfo.platform);
> +ret = drmParseOFDeviceInfo(maj, min, 
> &dev->deviceinfo.platform->compatible);
>  if (ret < 0)
>  goto free_device;
>  }
> @@ -3644,73 +3643,6 @@ free_device:
>  return ret;
>  }
>  
> -static int drmParseHost1xBusInfo(int maj, int min, drmHost1xBusInfoPtr info)
> -{
> -#ifdef __linux__
> -char path[PATH_MAX + 1], *name;
> -
> -snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
> -
> -name = sysfs_uevent_get(path, "OF_FULLNAME");
> -if (!name)
> -return -ENOENT;
> -
> -strncpy(info->fullname, name, DRM_HOST1X_DEVICE_NAME_LEN);
> -info->fullname[DRM_HOST1X_DEVICE_NAME_LEN - 1] = '\0';
> -free(name);
> -
> -return 0;
> -#else
> -#warning "Missing implementation of drmParseHost1xBusInfo"
> -return -EINVAL;
> -#endif
> -}
> -
> -static int drmParseHost1xDeviceInfo(int maj, int min,
> -drmHost1xDeviceInfoPtr info)
> -{
> -#ifdef __linux__
> -char path[PATH_MAX + 1], *value;
> -unsigned int count, i;
> -int err;
> -
> -   

Re: [PATCH libdrm 1/2] xf86drm: fallback to MODALIAS for OF less platform devices

2019-01-23 Thread Eric Engestrom
On Wednesday, 2019-01-23 10:45:17 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Some devices can lack OF data or it may not be available in the uevent
> file. Fallback to the MODALIAS data in those cases.
> 
> We strip any leading "MODALIAS=.*:" thus the resulting information is
> compatible with existing code in Mesa.
> 
> Signed-off-by: Emil Velikov 
> ---
>  xf86drm.c | 55 ++-
>  1 file changed, 42 insertions(+), 13 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 10df682b..374734eb 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3511,15 +3511,28 @@ free_device:
>  static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr 
> info)
>  {
>  #ifdef __linux__
> -char path[PATH_MAX + 1], *name;
> +char path[PATH_MAX + 1], *name, *foo;

I assume you didn't mean to send this patch yet? :P

>  
>  snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
>  
>  name = sysfs_uevent_get(path, "OF_FULLNAME");
> -if (!name)
> -return -ENOENT;
> +foo = name;
> +if (!name) {
> +/* If the device lacks OF data, pick the MODALIAS info */
> +name = sysfs_uevent_get(path, "MODALIAS");
> +if (!name)
> +return -ENOENT;
> +
> +/* .. and strip the MODALIAS=[platform,usb...]: part. */
> +foo = strrchr(name, ':');
> +if (!foo) {
> +free(name);
> +return -ENOENT;
> +}
> +foo++;
> +}
>  
> -strncpy(info->fullname, name, DRM_PLATFORM_DEVICE_NAME_LEN);
> +strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
>  info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
>  free(name);
>  
> @@ -3534,18 +3547,20 @@ static int drmParsePlatformDeviceInfo(int maj, int 
> min,
>drmPlatformDeviceInfoPtr info)
>  {
>  #ifdef __linux__
> -char path[PATH_MAX + 1], *value;
> +char path[PATH_MAX + 1], *value, *foo;
>  unsigned int count, i;
>  int err;
>  
>  snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
>  
>  value = sysfs_uevent_get(path, "OF_COMPATIBLE_N");
> -if (!value)
> -return -ENOENT;
> -
> -sscanf(value, "%u", &count);
> -free(value);
> +if (value) {
> +sscanf(value, "%u", &count);
> +free(value);
> +} else {
> +/* Assume one entry if the device lack OF data */
> +count = 1;
> +}
>  
>  info->compatible = calloc(count + 1, sizeof(*info->compatible));
>  if (!info->compatible)
> @@ -3553,12 +3568,26 @@ static int drmParsePlatformDeviceInfo(int maj, int 
> min,
>  
>  for (i = 0; i < count; i++) {
>  value = sysfs_uevent_get(path, "OF_COMPATIBLE_%u", i);
> +foo = value;
>  if (!value) {
> -err = -ENOENT;
> -goto free;
> +/* If the device lacks OF data, pick the MODALIAS info */
> +value = sysfs_uevent_get(path, "MODALIAS");
> +if (!value) {
> +err = -ENOENT;
> +goto free;
> +}
> +
> +/* .. and strip the MODALIAS=[platform,usb...]: part. */
> +foo = strrchr(value, ':');
> +if (!foo) {
> +free(value);
> +return -ENOENT;
> +}
> +foo = strdup(foo + 1);
> +free(value);
>  }
>  
> -info->compatible[i] = value;
> +info->compatible[i] = foo;
>  }
>  
>  return 0;
> -- 
> 2.20.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 1/3] xf86drm: dedupe `#define`s

2018-12-19 Thread Eric Engestrom
Adapted from a local patch carried by DragonFlyBSD:
https://github.com/DragonFlyBSD/DPorts/blob/bc056f88f7e4d468d8c9751f831a47b5ae1326e3/graphics/libdrm/files/patch-xf86drm.h

Patch is sadly uncredited (a bot authored the commit), so I can't credit
the author here either.

Signed-off-by: Eric Engestrom 
---
 xf86drm.c | 10 --
 xf86drm.h | 16 ++--
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 377ddf917d2cb902899a..07425b19897d00a19e8a 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -71,16 +71,6 @@
 
 #include "util_math.h"
 
-#ifdef __OpenBSD__
-#define DRM_PRIMARY_MINOR_NAME  "drm"
-#define DRM_CONTROL_MINOR_NAME  "drmC"
-#define DRM_RENDER_MINOR_NAME   "drmR"
-#else
-#define DRM_PRIMARY_MINOR_NAME  "card"
-#define DRM_CONTROL_MINOR_NAME  "controlD"
-#define DRM_RENDER_MINOR_NAME   "renderD"
-#endif
-
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
defined(__DragonFly__)
 #define DRM_MAJOR 145
 #endif
diff --git a/xf86drm.h b/xf86drm.h
index 7773d71a803084e86920..18668ff3d40d7db55c95 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -78,17 +78,21 @@ extern "C" {
 
 #ifdef __OpenBSD__
 #define DRM_DIR_NAME  "/dev"
-#define DRM_DEV_NAME  "%s/drm%d"
-#define DRM_CONTROL_DEV_NAME  "%s/drmC%d"
-#define DRM_RENDER_DEV_NAME  "%s/drmR%d"
+#define DRM_PRIMARY_MINOR_NAME  "drm"
+#define DRM_CONTROL_MINOR_NAME  "drmC"
+#define DRM_RENDER_MINOR_NAME   "drmR"
 #else
 #define DRM_DIR_NAME  "/dev/dri"
-#define DRM_DEV_NAME  "%s/card%d"
-#define DRM_CONTROL_DEV_NAME  "%s/controlD%d"
-#define DRM_RENDER_DEV_NAME  "%s/renderD%d"
+#define DRM_PRIMARY_MINOR_NAME  "card"
+#define DRM_CONTROL_MINOR_NAME  "controlD"
+#define DRM_RENDER_MINOR_NAME   "renderD"
 #define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
 #endif
 
+#define DRM_DEV_NAME  "%s/" DRM_PRIMARY_MINOR_NAME "%d"
+#define DRM_CONTROL_DEV_NAME  "%s/" DRM_CONTROL_MINOR_NAME "%d"
+#define DRM_RENDER_DEV_NAME   "%s/" DRM_RENDER_MINOR_NAME  "%d"
+
 #define DRM_ERR_NO_DEVICE  (-1001)
 #define DRM_ERR_NO_ACCESS  (-1002)
 #define DRM_ERR_NOT_ROOT   (-1003)
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 2/3] xf86drm: use max size of drm node name instead of arbitrary size

2018-12-19 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 xf86drm.c | 4 ++--
 xf86drm.h | 8 
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 07425b19897d00a19e8a..95854e153ec7e9d264bc 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -317,7 +317,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
 {
 stat_t  st;
 const char  *dev_name;
-charbuf[64];
+charbuf[DRM_NODE_NAME_MAX];
 int fd;
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
 gid_t   serv_group;
@@ -445,7 +445,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
 static int drmOpenMinor(int minor, int create, int type)
 {
 int  fd;
-char buf[64];
+char buf[DRM_NODE_NAME_MAX];
 const char *dev_name;
 
 if (create)
diff --git a/xf86drm.h b/xf86drm.h
index 18668ff3d40d7db55c95..00fbdb35a9a8fb5e9f27 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -93,6 +93,14 @@ extern "C" {
 #define DRM_CONTROL_DEV_NAME  "%s/" DRM_CONTROL_MINOR_NAME "%d"
 #define DRM_RENDER_DEV_NAME   "%s/" DRM_RENDER_MINOR_NAME  "%d"
 
+#define DRM_NODE_NAME_MAX \
+(sizeof(DRM_DIR_NAME) + 1 /* slash */ \
+ + MAX3(sizeof(DRM_PRIMARY_MINOR_NAME), \
+sizeof(DRM_CONTROL_MINOR_NAME), \
+sizeof(DRM_RENDER_MINOR_NAME)) \
+ + sizeof("64") /* highest possible node number */ \
+ + 1) /* NULL-terminator */
+
 #define DRM_ERR_NO_DEVICE  (-1001)
 #define DRM_ERR_NO_ACCESS  (-1002)
 #define DRM_ERR_NOT_ROOT   (-1003)
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 3/3] xf86drm: dedupe drmGetDeviceName() logic

2018-12-19 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 xf86drm.c | 86 +++
 1 file changed, 23 insertions(+), 63 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 95854e153ec7e9d264bc..f8e4d11b8c6886d6a6b8 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -300,6 +300,19 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
 }
 #endif
 
+static const char *drmGetDeviceName(int type)
+{
+switch (type) {
+case DRM_NODE_PRIMARY:
+return DRM_DEV_NAME;
+case DRM_NODE_CONTROL:
+return DRM_CONTROL_DEV_NAME;
+case DRM_NODE_RENDER:
+return DRM_RENDER_DEV_NAME;
+}
+return NULL;
+}
+
 /**
  * Open the DRM device, creating it if necessary.
  *
@@ -316,7 +329,7 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
 static int drmOpenDevice(dev_t dev, int minor, int type)
 {
 stat_t  st;
-const char  *dev_name;
+const char  *dev_name = drmGetDeviceName(type);
 charbuf[DRM_NODE_NAME_MAX];
 int fd;
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
@@ -327,19 +340,8 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
 gid_t   group   = DRM_DEV_GID;
 #endif
 
-switch (type) {
-case DRM_NODE_PRIMARY:
-dev_name = DRM_DEV_NAME;
-break;
-case DRM_NODE_CONTROL:
-dev_name = DRM_CONTROL_DEV_NAME;
-break;
-case DRM_NODE_RENDER:
-dev_name = DRM_RENDER_DEV_NAME;
-break;
-default:
+if (!dev_name)
 return -EINVAL;
-};
 
 sprintf(buf, dev_name, DRM_DIR_NAME, minor);
 drmMsg("drmOpenDevice: node name is %s\n", buf);
@@ -446,24 +448,13 @@ static int drmOpenMinor(int minor, int create, int type)
 {
 int  fd;
 char buf[DRM_NODE_NAME_MAX];
-const char *dev_name;
+const char *dev_name = drmGetDeviceName(type);
 
 if (create)
 return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
 
-switch (type) {
-case DRM_NODE_PRIMARY:
-dev_name = DRM_DEV_NAME;
-break;
-case DRM_NODE_CONTROL:
-dev_name = DRM_CONTROL_DEV_NAME;
-break;
-case DRM_NODE_RENDER:
-dev_name = DRM_RENDER_DEV_NAME;
-break;
-default:
+if (!dev_name)
 return -EINVAL;
-};
 
 sprintf(buf, dev_name, DRM_DIR_NAME, minor);
 if ((fd = open(buf, O_RDWR | O_CLOEXEC, 0)) >= 0)
@@ -2874,7 +2865,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
 #else
 struct stat sbuf;
 char buf[PATH_MAX + 1];
-const char *dev_name;
+const char *dev_name = drmGetDeviceName(type);
 unsigned int maj, min;
 int n, base;
 
@@ -2887,19 +2878,8 @@ static char *drmGetMinorNameForFD(int fd, int type)
 if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
 return NULL;
 
-switch (type) {
-case DRM_NODE_PRIMARY:
-dev_name = DRM_DEV_NAME;
-break;
-case DRM_NODE_CONTROL:
-dev_name = DRM_CONTROL_DEV_NAME;
-break;
-case DRM_NODE_RENDER:
-dev_name = DRM_RENDER_DEV_NAME;
-break;
-default:
+if (!dev_name)
 return NULL;
-};
 
 base = drmGetMinorBase(type);
 if (base < 0)
@@ -3856,19 +3836,9 @@ drm_public int drmGetDevice2(int fd, uint32_t flags, 
drmDevicePtr *device)
 if (node_type == -1)
 return -ENODEV;
 
-switch (node_type) {
-case DRM_NODE_PRIMARY:
-dev_name = DRM_DEV_NAME;
-break;
-case DRM_NODE_CONTROL:
-dev_name = DRM_CONTROL_DEV_NAME;
-break;
-case DRM_NODE_RENDER:
-dev_name = DRM_RENDER_DEV_NAME;
-break;
-default:
+dev_name = drmGetDeviceName(node_type);
+if (!dev_name)
 return -EINVAL;
-};
 
 base = drmGetMinorBase(node_type);
 if (base < 0)
@@ -4109,19 +4079,9 @@ drm_public char *drmGetDeviceNameFromFd2(int fd)
 if (node_type == -1)
 return NULL;
 
-switch (node_type) {
-case DRM_NODE_PRIMARY:
-dev_name = DRM_DEV_NAME;
-break;
-case DRM_NODE_CONTROL:
-dev_name = DRM_CONTROL_DEV_NAME;
-break;
-case DRM_NODE_RENDER:
-dev_name = DRM_RENDER_DEV_NAME;
-break;
-default:
+dev_name = drmGetDeviceName(node_type);
+if (!dev_name)
 return NULL;
-};
 
 base = drmGetMinorBase(node_type);
 if (base < 0)
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] amdgpu/tests: drop unused local vars

2018-12-19 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 tests/amdgpu/vce_tests.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c
index b9e15ee97148ee3b38d4..0026826ea58bd9d9dd8b 100644
--- a/tests/amdgpu/vce_tests.c
+++ b/tests/amdgpu/vce_tests.c
@@ -648,12 +648,10 @@ static void check_mv_result(struct amdgpu_vce_encode *enc)
 {
uint64_t sum;
uint32_t s = 140790;
-   uint32_t *ptr, size;
-   int i, j, r;
+   int j, r;
 
r = amdgpu_bo_cpu_map(enc->fb[0].handle, (void **)&enc->fb[0].ptr);
CU_ASSERT_EQUAL(r, 0);
-   ptr = (uint32_t *)enc->fb[0].ptr;
r = amdgpu_bo_cpu_unmap(enc->fb[0].handle);
CU_ASSERT_EQUAL(r, 0);
r = amdgpu_bo_cpu_map(enc->mvb.handle, (void **)&enc->mvb.ptr);
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] RELEASING: update instructions to use meson instead of autotools

2018-12-19 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 RELEASING | 27 ---
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/RELEASING b/RELEASING
index 7e03e3b9acb1cbfb261a..d1ad8e3b4ad16d4ca14f 100644
--- a/RELEASING
+++ b/RELEASING
@@ -9,25 +9,14 @@ However, this is up to whoever is driving the feature in 
question.
 
 Follow these steps to release a new version of libdrm:
 
-  1) Bump the version number in configure.ac and meson.build. We seem
- to have settled for 2.4.x as the versioning scheme for libdrm, so
- just bump the  micro version.
-
-  2) Run autoconf and then re-run ./configure so the build system
- picks up the new version number.
-
-  3) Verify that the code passes "make distcheck".  Running "make
- distcheck" should result in no warnings or errors and end with a
- message of the form:
-
-   =
-   libdrm-X.Y.Z archives ready for distribution:
-   libdrm-X.Y.Z.tar.gz
-   libdrm-X.Y.Z.tar.bz2
-   =
-
- Make sure that the version number reported by distcheck and in
- the tarball names matches the number you bumped to in configure.ac.
+  1) Bump the version number in meson.build. We seem to have settled for
+ 2.4.x as the versioning scheme for libdrm, so just bump the micro
+ version.
+
+  2) Run `ninja -C builddir/ dist` to generate the tarballs.
+ Make sure that the version number of the tarball name in
+ builddir/meson-dist/ matches the number you bumped to. Move that
+ tarball to the libdrm repo root for the release script to pick up.
 
   4) Push the updated master branch with the bumped version number:
 
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] fix various typos

2018-12-19 Thread Eric Engestrom
Saw a couple of typos fixes in the patch DragonFlyBSD carries [1], so
I ran codespell (a spell checker for code) on the whole repo.

[1] 
https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c

Signed-off-by: Eric Engestrom 
---
I discarded the fixes in include/drm/ though, as those should come from
upstream.

Leaving them here if anyone wants to send those to the kernel:
8<
diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index 1ceec56de0157671c6a4..e0f071d36f0849309815 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -204,9 +204,9 @@ union drm_amdgpu_bo_list {
 /* unknown cause */
 #define AMDGPU_CTX_UNKNOWN_RESET   3

-/* indicate gpu reset occured after ctx created */
+/* indicate gpu reset occurred after ctx created */
 #define AMDGPU_CTX_QUERY2_FLAGS_RESET(1<<0)
-/* indicate vram lost occured after ctx created */
+/* indicate vram lost occurred after ctx created */
 #define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1<<1)
 /* indicate some job from this context once cause gpu hang */
 #define AMDGPU_CTX_QUERY2_FLAGS_GUILTY   (1<<2)
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index 139632b871816f9e3dad..15c6892980519ca9d8c9 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -294,7 +294,7 @@ extern "C" {
  * This is a tiled layout using 4Kb tiles in row-major layout.
  * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
  * are arranged in four groups (two wide, two high) with column-major layout.
- * Each group therefore consits out of four 256 byte units, which are also laid
+ * Each group therefore consists out of four 256 byte units, which are also 
laid
  * out as 2x2 column-major.
  * 256 byte units are made out of four 64 byte blocks of pixels, producing
  * either a square block or a 2:1 unit.
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index d3e0fe31efc55351573b..e61edf48ff76843e6b95 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -403,7 +403,7 @@ struct drm_mode_get_connector {
 /* the PROP_ATOMIC flag is used to hide properties from userspace that
  * is not aware of atomic properties.  This is mostly to work around
  * older userspace (DDX drivers) that read/write each prop they find,
- * witout being aware that this could be triggering a lengthy modeset.
+ * without being aware that this could be triggering a lengthy modeset.
  */
 #define DRM_MODE_PROP_ATOMIC0x8000

diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 268b585f8a4b5e8b39a2..3539f9b3ef02c1e7d1cb 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -485,7 +485,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_FENCE   44

 /* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
- * user specified bufffers for post-mortem debugging of GPU hangs. See
+ * user specified buffers for post-mortem debugging of GPU hangs. See
  * EXEC_OBJECT_CAPTURE.
  */
 #define I915_PARAM_HAS_EXEC_CAPTURE 45
@@ -1180,7 +1180,7 @@ struct drm_i915_gem_caching {
__u32 handle;

/**
-* Cacheing level to apply or return value
+* Caching level to apply or return value
 *
 * bits0-15 are for generic caching control (i.e. the above defined
 * values). bits16-31 are reserved for platform-specific variations
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h
index 0bc784f5e0dbe15bc8d1..2b8d47ea3c7b61a2145e 100644
--- a/include/drm/vmwgfx_drm.h
+++ b/include/drm/vmwgfx_drm.h
@@ -361,7 +361,7 @@ struct drm_vmw_fence_rep {
  * Allocate a DMA buffer that is visible also to the host.
  * NOTE: The buffer is
  * identified by a handle and an offset, which are private to the guest, but
- * useable in the command stream. The guest kernel may translate these
+ * usable in the command stream. The guest kernel may translate these
  * and patch up the command stream accordingly. In the future, the offset may
  * be zero at all times, or it may disappear from the interface before it is
  * fixed.
@@ -446,7 +446,7 @@ struct drm_vmw_unref_dmabuf_arg {
  *
  * This IOCTL controls the overlay units of the svga device.
  * The SVGA overlay units does not work like regular hardware units in
- * that they do not automaticaly read back the contents of the given dma
+ * that they do not automatically read back the contents of the given dma
  * buffer. But instead only read back for each call to this ioctl, and
  * at any point between this call being made and a following call that
  * either changes the buffer or disables the stream.
@@ -1035,7 +1035,7 @@ union drm_vmw_gb_surface_reference_arg {
  * for read-only.
  * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
  * referencing this buffer.
- * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
+ * @drm_vmw_synccpu_don

Re: [PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly

2018-12-19 Thread Eric Engestrom
On Tuesday, 2018-12-18 20:11:27 +0100, Francois Tigeot wrote:
> On Mon, Dec 17, 2018 at 06:09:47PM +, Emil Velikov wrote:
> > On Tue, 11 Dec 2018 at 22:15, François Tigeot  wrote:
> > >
> > > * There is no way to check if a device name is really a drm device
> > >   by looking it up in a virtual filesystem like on Linux
> > >
> > > * The major device number is also dynamically allocated from a pool,
> > >   comparing it to a constant makes no sense
> > >
> > > * In the absence of better ideas, just assume the device name really
> > >   points to a drm device and always return true
> > >
> > I guess one could use the sysfs path, although that may require a few
> > extra lines to the linux emulation layer.
> 
> We currently have such a thing living in local patches and it's a source
> of pain; it regularly breaks for one reason or another.
> It's not using sysfs but a hw.dri sysctl mechanism originating from FreeBSD.
> Some of the patches are visible here:
> https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c

I'm going through those right now, and I'll send patches for those that
make sense upstream. Apologies in advance for the rebase pains :]

> 
> > What's the reason behind the dynamic allocation of the major? FWIW
> > some userspace requires a fixed DRM_MAJOR - they will need patching to
> > run :-(
> 
> Major/minor numbers were required when device files had to be created on
> regular filesystem like UFS but when a devfs filesystem was implemented
> for DragonFly almost a decade ago, nobody thought it was important anymore.
> 
> There have been no fixed major numbers on DragonFly since 2009 or so.

Fwiw, this `if dragonfly return true` patch is:
Acked-by: Eric Engestrom 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 2/2] drm: Attempt to parse SPI devices as platform bus devices.

2018-11-15 Thread Eric Engestrom
On Thursday, 2018-11-15 21:18:43 -0800, Eric Anholt wrote:
> For ARM systems with tinydrm displays attached to SPI, the bus name is
> /spi but we have platform device info for the rest.  Fixes
> eglInitialize() failures on hx8357d since the EGL_EXT_device_drm
> changes.

Acked-by: Eric Engestrom 

> ---
>  xf86drm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 60fbc49b3d35..71ad54baa5c8 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -2993,6 +2993,7 @@ static int drmParseSubsystemType(int maj, int min)
>  { "/pci", DRM_BUS_PCI },
>  { "/usb", DRM_BUS_USB },
>  { "/platform", DRM_BUS_PLATFORM },
> +{ "/spi", DRM_BUS_PLATFORM },
>  { "/host1x", DRM_BUS_HOST1X },
>  { "/virtio", DRM_BUS_VIRTIO },
>  };
> -- 
> 2.19.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/2] Avoid hardcoded strlens in drmParseSubsystemType().

2018-11-15 Thread Eric Engestrom
On Thursday, 2018-11-15 21:18:42 -0800, Eric Anholt wrote:
> Having people count characters is error-prone, when we could just have
> a computer do it.

Reviewed-by: Eric Engestrom 

> ---
>  xf86drm.c | 31 ---
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 10df682b7870..60fbc49b3d35 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -59,6 +59,8 @@
>  #endif
>  #include 
>  
> +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
> +
>  /* Not all systems have MAP_FAILED defined */
>  #ifndef MAP_FAILED
>  #define MAP_FAILED ((void *)-1)
> @@ -2984,6 +2986,16 @@ static int drmParseSubsystemType(int maj, int min)
>  char path[PATH_MAX + 1];
>  char link[PATH_MAX + 1] = "";
>  char *name;
> +struct {
> +const char *name;
> +int bus_type;
> +} bus_types[] = {
> +{ "/pci", DRM_BUS_PCI },
> +{ "/usb", DRM_BUS_USB },
> +{ "/platform", DRM_BUS_PLATFORM },
> +{ "/host1x", DRM_BUS_HOST1X },
> +{ "/virtio", DRM_BUS_VIRTIO },
> +};
>  
>  snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/subsystem",
>   maj, min);
> @@ -2995,20 +3007,10 @@ static int drmParseSubsystemType(int maj, int min)
>  if (!name)
>  return -EINVAL;
>  
> -if (strncmp(name, "/pci", 4) == 0)
> -return DRM_BUS_PCI;
> -
> -if (strncmp(name, "/usb", 4) == 0)
> -return DRM_BUS_USB;
> -
> -if (strncmp(name, "/platform", 9) == 0)
> -return DRM_BUS_PLATFORM;
> -
> -if (strncmp(name, "/host1x", 7) == 0)
> -return DRM_BUS_HOST1X;
> -
> -if (strncmp(name, "/virtio", 7) == 0)
> -return DRM_BUS_VIRTIO;
> +for (unsigned i = 0; i < ARRAY_SIZE(bus_types); i++) {
> +if (strncmp(name, bus_types[i].name, strlen(bus_types[i].name)) == 0)
> +return bus_types[i].bus_type;
> +}
>  
>  return -EINVAL;
>  #elif defined(__OpenBSD__)
> @@ -3149,7 +3151,6 @@ static int parse_separate_sysfs_files(int maj, int min,
>drmPciDeviceInfoPtr device,
>bool ignore_revision)
>  {
> -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
>  static const char *attrs[] = {
>"revision", /* Older kernels are missing the file, so check for it 
> first */
>"vendor",
> -- 
> 2.19.1
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] tests: skip drmdevice test if the machine doesn't have any drm device

2018-11-09 Thread Eric Engestrom
Error message was invalid too, negative values aren't the number of
devices, they're errno error codes.

Signed-off-by: Eric Engestrom 
---
This fixes the Gitlab CI; goes from:
https://gitlab.freedesktop.org/mesa/drm/-/jobs/42061
to:
https://gitlab.freedesktop.org/eric/libdrm/-/jobs/42099
---
 tests/drmdevice.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/drmdevice.c b/tests/drmdevice.c
index cdf6e8deaf121899bcbc..f1c1cd3a0338d912f60c 100644
--- a/tests/drmdevice.c
+++ b/tests/drmdevice.c
@@ -115,8 +115,9 @@ main(void)
 max_devices = drmGetDevices2(0, NULL, 0);
 
 if (max_devices <= 0) {
-printf("drmGetDevices2() has returned %d\n", max_devices);
-return -1;
+printf("drmGetDevices2() has not found any devices (errno=%d)\n",
+   -max_devices);
+return 77;
 }
 printf("--- Devices reported %d ---\n", max_devices);
 
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] README: reflow the project description to improve readability

2018-11-07 Thread Eric Engestrom
Also, move the sentence about "who would use libdrm" into its own paragraph,
as it is something people discovering libdrm will want to know.

Signed-off-by: Eric Engestrom 
---
 README.rst | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/README.rst b/README.rst
index f3df9ac193018f6a63e9..e47cb241b119d09b642d 100644
--- a/README.rst
+++ b/README.rst
@@ -1,15 +1,17 @@
 libdrm - userspace library for drm
+--
 
-This  is libdrm,  a userspace  library for  accessing the  DRM, direct
-rendering  manager, on  Linux,  BSD and  other  operating systems that
-support the  ioctl interface.  The library  provides wrapper functions
-for the  ioctls to avoid  exposing the kernel interface  directly, and
-for chipsets with drm memory manager, support for tracking relocations
-and  buffers.   libdrm  is  a  low-level library,  typically  used  by
-graphics drivers  such as the Mesa  DRI drivers, the  X drivers, libva
-and  similar projects.  New  functionality in  the kernel  DRM drivers
-typically requires  a new  libdrm, but a  new libdrm will  always work
-with an older kernel.
+This is libdrm, a userspace library for accessing the DRM, direct rendering
+manager, on Linux, BSD and other operating systems that support the ioctl
+interface.
+The library provides wrapper functions for the ioctls to avoid exposing the
+kernel interface directly, and for chipsets with drm memory manager, support
+for tracking relocations and buffers.
+New functionality in the kernel DRM drivers typically requires a new libdrm,
+but a new libdrm will always work with an older kernel.
+
+libdrm is a low-level library, typically used by graphics drivers such as
+the Mesa drivers, the X drivers, libva and similar projects.
 
 
 Compiling
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 2/2] xf86atomic: #undef internal define

2018-11-07 Thread Eric Engestrom
Thanks to the #error just above, any file including this header can only
see one state for this macro: defined, with the value `1`.
Let's just #undef it once we're done using it in here so that other
files don't misconstrue any meaning to it.

Signed-off-by: Eric Engestrom 
---
 xf86atomic.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xf86atomic.h b/xf86atomic.h
index 2d733bd53eea3868259c..e268d274f75b0d7e66f2 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -101,6 +101,8 @@ typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
 #error libdrm requires atomic operations, please define them for your 
CPU/compiler.
 #endif
 
+#undef HAS_ATOMIC_OPS
+
 static inline int atomic_add_unless(atomic_t *v, int add, int unless)
 {
int c, old;
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 1/2] freedreno: remove always-defined #ifdef

2018-11-07 Thread Eric Engestrom
While at it, let's include xf86atomic.h explicitly, instead of relying
on some other file accidentally including it before including this file.

Signed-off-by: Eric Engestrom 
---
 freedreno/freedreno_ringbuffer.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h
index bc41a31cd8c5c10a3536..1a1e8425926d0647e358 100644
--- a/freedreno/freedreno_ringbuffer.h
+++ b/freedreno/freedreno_ringbuffer.h
@@ -29,6 +29,7 @@
 #ifndef FREEDRENO_RINGBUFFER_H_
 #define FREEDRENO_RINGBUFFER_H_
 
+#include 
 #include 
 
 /* the ringbuffer object is not opaque so that OUT_RING() type stuff
@@ -83,9 +84,7 @@ struct fd_ringbuffer {
 * be inlined for performance reasons.
 */
union {
-#ifdef HAS_ATOMIC_OPS
atomic_t refcnt;
-#endif
uint64_t __pad;
};
 };
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] meson: fix typo in compiler flag

2018-11-07 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 49bf2f740fb3627f2948..5ef17fc11fee25f98b3d 100644
--- a/meson.build
+++ b/meson.build
@@ -192,7 +192,7 @@ config.set10('HAVE_OPEN_MEMSTREAM', 
cc.has_function('open_memstream'))
 
 warn_c_args = []
 foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',
- '-Werror-implicit-function-declaration', '-Wpointer-arith',
+ '-Werror=implicit-function-declaration', '-Wpointer-arith',
  '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes',
  '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
  '-Wswitch-enum', '-Wmissing-format-attribute',
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] xf86drmHash: remove unused loop variable

2018-11-07 Thread Eric Engestrom
Reported-by: Jan Vesely 
Signed-off-by: Eric Engestrom 
---
 xf86drmHash.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xf86drmHash.c b/xf86drmHash.c
index 891b732632c36d373ac9..2cf2b80ed9e02310f0ff 100644
--- a/xf86drmHash.c
+++ b/xf86drmHash.c
@@ -105,7 +105,6 @@ static unsigned long HashHash(unsigned long key)
 drm_public void *drmHashCreate(void)
 {
 HashTablePtr table;
-int  i;
 
 table   = drmMalloc(sizeof(*table));
 if (!table) return NULL;
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/2] symbol-check: ignore platform symbols

2018-10-24 Thread Eric Engestrom
On Wednesday, 2018-10-24 17:53:51 +0100, Eric Engestrom wrote:
> Fixes the tests on ARM, but more importantly this makes it much easier
> to maintain.

BTW I have a wip to replace all of those with a python script that will
be more thorough in its checks, but until that lands this is already
a good step.
(Just mentioning it so that someone else doesn't see this as an
opportunity to start the same project again.)

> 
> Signed-off-by: Eric Engestrom 
> ---
>  amdgpu/amdgpu-symbol-check   |  7 +--
>  etnaviv/etnaviv-symbol-check |  7 +--
>  exynos/exynos-symbol-check   |  7 +--
>  freedreno/freedreno-symbol-check |  7 +--
>  intel/intel-symbol-check |  7 +--
>  libkms/kms-symbol-check  |  7 +--
>  nouveau/nouveau-symbol-check |  7 +--
>  omap/omap-symbol-check   |  7 +--
>  radeon/radeon-symbol-check   |  7 +--
>  tegra/tegra-symbol-check | 11 +--
>  10 files changed, 10 insertions(+), 64 deletions(-)
> 
> diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
> index 6f5e0f95b7faf4bd86da..d97f702e6baa653e2fff 100755
> --- a/amdgpu/amdgpu-symbol-check
> +++ b/amdgpu/amdgpu-symbol-check
> @@ -5,13 +5,8 @@ set -u
>  # The following symbols (past the first five) are taken from the public 
> headers.
>  # A list of the latter should be available 
> Makefile.am/libdrm_amdgpuinclude_HEADERS
>  
> -FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk 
> '{print $3}' | while read func; do
> +FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | 
> grep -o "T .*" | cut -c 3- | while read func; do
>  ( grep -q "^$func$" || echo $func )  < -__bss_start
> -_edata
> -_end
> -_fini
> -_init
>  amdgpu_bo_alloc
>  amdgpu_bo_cpu_map
>  amdgpu_bo_cpu_unmap
> diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbol-check
> index 1891068891ae673b14ff..fa043f65bc7309fe1a8c 100755
> --- a/etnaviv/etnaviv-symbol-check
> +++ b/etnaviv/etnaviv-symbol-check
> @@ -5,13 +5,8 @@ set -u
>  # The following symbols (past the first five) are taken from the public 
> headers.
>  # A list of the latter should be available 
> Makefile.sources/LIBDRM_ETNAVIV_H_FILES
>  
> -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_etnaviv.so} | awk 
> '{print $3}'| while read func; do
> +FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_etnaviv.so} | 
> grep -o "T .*" | cut -c 3- | while read func; do
>  ( grep -q "^$func$" || echo $func )  < -__bss_start
> -_edata
> -_end
> -_fini
> -_init
>  etna_device_new
>  etna_device_new_dup
>  etna_device_ref
> diff --git a/exynos/exynos-symbol-check b/exynos/exynos-symbol-check
> index 49d611e6b9b4fc1db6c6..861a6f88af641fb21f49 100755
> --- a/exynos/exynos-symbol-check
> +++ b/exynos/exynos-symbol-check
> @@ -5,13 +5,8 @@ set -u
>  # The following symbols (past the first five) are taken from the public 
> headers.
>  # A list of the latter should be available Makefile.am/libdrm_exynos*_HEADERS
>  
> -FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk 
> '{print $3}'| while read func; do
> +FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | 
> grep -o "T .*" | cut -c 3- | while read func; do
>  ( grep -q "^$func$" || echo $func )  < -__bss_start
> -_edata
> -_end
> -_fini
> -_init
>  exynos_bo_create
>  exynos_bo_destroy
>  exynos_bo_from_name
> diff --git a/freedreno/freedreno-symbol-check 
> b/freedreno/freedreno-symbol-check
> index 978026c09d511b82e9bd..0b9bffee864051b567e1 100755
> --- a/freedreno/freedreno-symbol-check
> +++ b/freedreno/freedreno-symbol-check
> @@ -5,13 +5,8 @@ set -u
>  # The following symbols (past the first five) are taken from the public 
> headers.
>  # A list of the latter should be available 
> Makefile.sources/LIBDRM_FREEDRENO_H_FILES
>  
> -FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | 
> awk '{print $3}'| while read func; do
> +FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | 
> grep -o "T .*" | cut -c 3- | while read func; do
>  ( grep -q "^$func$" || echo $func )  < -__bss_start
> -_edata
> -_end
> -_fini
> -_init
>  fd_bo_cpu_fini
>  fd_bo_cpu_prep
>  fd_bo_del
> diff --git a/intel/intel-symbol-check b/intel/intel-symbol-check
> index de377bef1377c57d8fe0..917acbc1dd7aa92fba53 100755
> --- a/intel/intel-symbol-check
> +++ b/intel/intel-symbol-check
> @@ -5,13 +5,8 @@ set -u
>  # The following symbols (past the first

[PATCH libdrm 2/2] gitlab-ci: add arm builds

2018-10-24 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 .gitlab-ci.yml | 60 ++
 1 file changed, 60 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a0edfdff43d24743586d..cbac993dd8227421be50 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -157,3 +157,63 @@ oldest-autotools:
 - export 
PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
 - export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
   script: *autotools-build
+
+aarch64-meson:
+  stage: build
+  image: toendeavour/archlinux:aarch64
+  before_script:
+- pacman -Syu --noconfirm --needed
+base-devel
+meson
+libpciaccess
+libxslt docbook-xsl
+valgrind
+libatomic_ops
+cairo cunit
+  script: *meson-build
+
+aarch64-autotools:
+  stage: build
+  image: toendeavour/archlinux:aarch64
+  artifacts: *artifacts-autotools
+  before_script:
+- pacman -Syu --noconfirm --needed
+base-devel
+libpciaccess
+libxslt docbook-xsl
+valgrind
+libatomic_ops
+cairo cunit
+xorg-util-macros
+git # autogen.sh depends on git
+  script: *autotools-build
+
+armv7h-meson:
+  stage: build
+  image: toendeavour/archlinux:armv7h
+  before_script:
+- pacman -Syu --noconfirm --needed
+base-devel
+meson
+libpciaccess
+libxslt docbook-xsl
+valgrind
+libatomic_ops
+cairo cunit
+  script: *meson-build
+
+armv7h-autotools:
+  stage: build
+  image: toendeavour/archlinux:armv7h
+  artifacts: *artifacts-autotools
+  before_script:
+- pacman -Syu --noconfirm --needed
+base-devel
+libpciaccess
+libxslt docbook-xsl
+valgrind
+libatomic_ops
+cairo cunit
+xorg-util-macros
+git # autogen.sh depends on git
+  script: *autotools-build
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 1/2] symbol-check: ignore platform symbols

2018-10-24 Thread Eric Engestrom
Fixes the tests on ARM, but more importantly this makes it much easier
to maintain.

Signed-off-by: Eric Engestrom 
---
 amdgpu/amdgpu-symbol-check   |  7 +--
 etnaviv/etnaviv-symbol-check |  7 +--
 exynos/exynos-symbol-check   |  7 +--
 freedreno/freedreno-symbol-check |  7 +--
 intel/intel-symbol-check |  7 +--
 libkms/kms-symbol-check  |  7 +--
 nouveau/nouveau-symbol-check |  7 +--
 omap/omap-symbol-check   |  7 +--
 radeon/radeon-symbol-check   |  7 +--
 tegra/tegra-symbol-check | 11 +--
 10 files changed, 10 insertions(+), 64 deletions(-)

diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index 6f5e0f95b7faf4bd86da..d97f702e6baa653e2fff 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbol-check
@@ -5,13 +5,8 @@ set -u
 # The following symbols (past the first five) are taken from the public 
headers.
 # A list of the latter should be available 
Makefile.am/libdrm_amdgpuinclude_HEADERS
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk 
'{print $3}' | while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | grep 
-o "T .*" | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 2/2] gitignore: add _build

2018-10-16 Thread Eric Engestrom
On Tuesday, 2018-10-16 08:24:02 -0700, Lucas De Marchi wrote:
> On 10/16/18 4:26 AM, Eric Engestrom wrote:
> > On Monday, 2018-10-15 16:48:07 -0700, Lucas De Marchi wrote:
> > > This is the directory used by meson/autotools (at least in the
> > > .gitlab-ci configuration) so ignore the whole dir.
> > 
> > This is extremely specific to this one case; what does this change for
> > the gitlab ci?
> 
> In order to test locally my changes I always copy and paste the line from
> the CI configuration. And there we are using _build.

I understand better now, thanks :)

> Maybe we
> should be using build there and add it to gitignore? We ignore .o, .lo,
> .libs, .deps and build-aux dir. IMO we should ignore the whole build dir now
> that we build out of tree - and _build (or build) dir is the most common to
> use.

Those were autotools-generated files with partially-predictable names
that were scattered across the source directory; this is considered bad
practice nowadays and modern build systems don't do that anymore,
instead letting the user choose a directory and putting everything in
there. We could add all of these scattered generated files to the
.gitignore, because we knew what the filenames looked like.

With the new method, each user puts their build in their chosen folder,
and while most of us usually chose something with "build" in the name,
there is no structure to this anymore. It's best to simply add your
preferred build-dir-naming-scheme to your clone's ignore list
(.git/info/exclude), which I think is what most of us do (mine has
a /build-*/ line for instance). You can also look at core.excludesfile
if you want to add a global .gitignore for your machine.

That said, adding one more line to this file doesn't hurt, so you can do
that if you want, I'm not nack'ing it, but we just can't open the door
to everyone adding their own personal naming scheme to the upstream
.gitignore :)

> 
> And it looks like I forgot one patch adding patches/ to the gitignore as
> well (it was what made me look into the gitignore in the first place) :-/.
> Same reason as why  it was applied to igt for example: it's common to have a
> patches/ directory to maintain wip patches.
> 
> Lucas De Marchi
> 
> > 
> > > 
> > > Signed-off-by: Lucas De Marchi 
> > > ---
> > >   .gitignore | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/.gitignore b/.gitignore
> > > index 49cced50..54365c7c 100644
> > > --- a/.gitignore
> > > +++ b/.gitignore
> > > @@ -24,6 +24,7 @@
> > >   Makefile
> > >   Makefile.in
> > >   TAGS
> > > +_build
> > >   aclocal.m4
> > >   autom4te.cache
> > >   bsd-core/*/@
> > > -- 
> > > 2.19.1.1.g8c3cf03f71
> > > 
> > > ___
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 2/2] gitignore: add _build

2018-10-16 Thread Eric Engestrom
On Monday, 2018-10-15 16:48:07 -0700, Lucas De Marchi wrote:
> This is the directory used by meson/autotools (at least in the
> .gitlab-ci configuration) so ignore the whole dir.

This is extremely specific to this one case; what does this change for
the gitlab ci?

> 
> Signed-off-by: Lucas De Marchi 
> ---
>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 49cced50..54365c7c 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -24,6 +24,7 @@
>  Makefile
>  Makefile.in
>  TAGS
> +_build
>  aclocal.m4
>  autom4te.cache
>  bsd-core/*/@
> -- 
> 2.19.1.1.g8c3cf03f71
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/2] gitignore: sort file

2018-10-16 Thread Eric Engestrom
On Monday, 2018-10-15 16:48:06 -0700, Lucas De Marchi wrote:
> LANG=C sort -u .gitignore | sponge .gitignore
> 
> This way it's easier to keep track of the entries.
> 
> Signed-off-by: Lucas De Marchi 

Sure, why not:
Acked-by: Eric Engestrom 

> ---
>  .gitignore | 56 +++---
>  1 file changed, 28 insertions(+), 28 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index d51e619b..49cced50 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,6 +1,3 @@
> -bsd-core/*/@
> -bsd-core/*/machine
> -*~
>  *.1
>  *.3
>  *.5
> @@ -17,17 +14,20 @@ bsd-core/*/machine
>  *.o.cmd
>  *.sw?
>  *.trs
> +*~
> +.*check*
> +.*install*
>  .depend
>  .deps
>  .libs
>  .tmp_versions
> -.*check*
> -.*install*
>  Makefile
>  Makefile.in
>  TAGS
>  aclocal.m4
>  autom4te.cache
> +bsd-core/*/@
> +bsd-core/*/machine
>  build-aux
>  bus_if.h
>  compile
> @@ -47,21 +47,22 @@ drm_pciids.h
>  export_syms
>  i915.kld
>  install-sh
> -libdrm/config.h.in
>  libdrm.pc
> +libdrm/config.h.in
> +libdrm_amdgpu.pc
> +libdrm_etnaviv.pc
> +libdrm_exynos.pc
> +libdrm_freedreno.pc
>  libdrm_intel.pc
>  libdrm_nouveau.pc
> -libdrm_radeon.pc
>  libdrm_omap.pc
> -libdrm_exynos.pc
> -libdrm_freedreno.pc
> -libdrm_amdgpu.pc
> +libdrm_radeon.pc
>  libdrm_vc4.pc
> -libdrm_etnaviv.pc
>  libkms.pc
>  libtool
>  ltmain.sh
>  mach64.kld
> +man/*.3
>  man/.man_fixup
>  mga.kld
>  missing
> @@ -74,35 +75,34 @@ savage.kld
>  sis.kld
>  stamp-h1
>  tdfx.kld
> -via.kld
> -tests/auth
>  tests/amdgpu/amdgpu_test
> +tests/auth
>  tests/dristat
>  tests/drmdevice
>  tests/drmsl
>  tests/drmstat
> +tests/etnaviv/etnaviv_2d_test
> +tests/etnaviv/etnaviv_bo_cache_test
> +tests/etnaviv/etnaviv_cmd_stream_test
> +tests/exynos/exynos_fimg2d_event
> +tests/exynos/exynos_fimg2d_perf
> +tests/exynos/exynos_fimg2d_test
>  tests/getclient
>  tests/getstats
>  tests/getversion
>  tests/hash
> +tests/kms/kms-steal-crtc
> +tests/kms/kms-universal-planes
> +tests/kmstest/kmstest
>  tests/lock
> -tests/openclose
> -tests/random
> -tests/setversion
> -tests/updatedraw
>  tests/modeprint/modeprint
>  tests/modetest/modetest
>  tests/name_from_fd
> +tests/openclose
>  tests/proptest/proptest
> -tests/kms/kms-steal-crtc
> -tests/kms/kms-universal-planes
> -tests/kmstest/kmstest
> -tests/vbltest/vbltest
>  tests/radeon/radeon_ttm
> -tests/exynos/exynos_fimg2d_event
> -tests/exynos/exynos_fimg2d_perf
> -tests/exynos/exynos_fimg2d_test
> -tests/etnaviv/etnaviv_2d_test
> -tests/etnaviv/etnaviv_cmd_stream_test
> -tests/etnaviv/etnaviv_bo_cache_test
> -man/*.3
> +tests/random
> +tests/setversion
> +tests/updatedraw
> +tests/vbltest/vbltest
> +via.kld
> -- 
> 2.19.1.1.g8c3cf03f71
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [RFC] Allow fd.o to join forces with X.Org

2018-10-15 Thread Eric Engestrom
On October 15, 2018 2:50:13 PM UTC, Harry Wentland  
wrote:
> The leadership of freedesktop.org (fd.o) has recently expressed
> interest
> in having an elected governing body. Given the tight connection
> between
> fd.o and X.Org and the fact that X.Org has such a governing body it
> seemed obvious to consider extending X.Org's mandate to fd.o.
> 
> Quite a bit of background on fd.o leading up to this has been covered
> by
> Daniel Stone at XDC 2018 and was covered really well by Jake Edge of
> LWN [1].

If you'd like to watch Daniel's presentation, the recording is available on 
YouTube:
https://youtu.be/s22B3E7rUTs

The slides are linked in the description.

> 
> One question that is briefly addressed in the LWN article and was
> thoroughly discussed by members of the X.Org boards, Daniel Stone, and
> others in hallway discussions is the question of whether to extend the
> X.Org membership to projects hosted on fd.o but outside the purpose of
> the X.Org foundation as enacted in its bylaws.
> 
> Most people I talked to would prefer not to dilute X.Org's mission and
> extend membership only to contributors of projects that follow X.Org's
> purpose as enacted in its bylaws. Other projects can continue to be
> hosted on fd.o but won't receive X.Org membership for the mere reason
> of
> being hosted on fd.o.

With my member hat on, I think this is the best choice.
Acked-by: Eric Engestrom 

> 
> [1] https://lwn.net/Articles/767258/
> 
> v2:
>  - Subject line that better describes the intention
>  - Briefly describe reasons behind this change
>  - Drop expanding membership eligibility
> ---
> 
> We're looking for feedback and comments on this patch. If it's not
> widely controversial the final version of the patch will be put to a
> vote at the 2019 X.Org elections.
> 
> The patch applies to the X.Org bylaws git repo, which can be found at
> https://gitlab.freedesktop.org/xorgfoundation/bylaws
> 
> Happy commenting.
> 
> Harry
> 
> bylaws.tex | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/bylaws.tex b/bylaws.tex
> index 4ab35a4f7745..44ff4745963b 100644
> --- a/bylaws.tex
> +++ b/bylaws.tex
> @@ -14,7 +14,7 @@ BE IT ENACTED AND IT IS HEREBY ENACTED as a By-law
> of the X.Org Foundation
>  
>  The purpose of the X.Org Foundation shall be to:
>  \begin{enumerate}[(i)\hspace{.2cm}]
> - \item Research, develop, support, organize, administrate,
> standardize,
> + \item \label{1} Research, develop, support, organize, administrate,
> standardize,
>   promote, and defend a free and open accelerated graphics stack. This
>   includes, but is not limited to, the following projects: DRM, Mesa,
>   Wayland and the X Window System,
> @@ -24,6 +24,11 @@ The purpose of the X.Org Foundation shall be to:
>  
>   \item Support and educate the general community of users of this
>   graphics stack.
> +
> + \item Support free and open source projects through the
> freedesktop.org
> + infrastructure. For projects outside the scope of item (\ref{1})
> support
> + extends to project hosting only.
> +
>  \end{enumerate}
>  
>  \article{INTERPRETATION}
> -- 
> 2.19.1
> 
> ___
> memb...@foundation.x.org: X.Org Foundation Members
> Archives: https://foundation.x.org/cgi-bin/mailman/private/members
> Info: https://foundation.x.org/cgi-bin/mailman/listinfo/members
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [Mesa-dev] [PATCH libdrm] xf86drmHash: remove redundant zero init

2018-10-12 Thread Eric Engestrom
On Thursday, 2018-10-11 19:18:10 -0400, mesa-dev-boun...@lists.freedesktop.org 
wrote:
> From: Rob Clark 
> 
> drmMalloc() is already calloc()

Sounds very much like an implementation detail, but everything relies on
it already, so...

Reviewed-by: Eric Engestrom 

> 
> Signed-off-by: Rob Clark 
> ---
> Small micro-optimization that I noticed while doing some perf work..
> I should probably look at promoting amdgpu's handle_table to core
> libdrm and replacing a couple of libdrm_freedreno's xf86drmHash
> tables over to that.  There is still at least one hashtable (in
> some libdrm_freedreno patches I'm working on finalizing) where
> handle_table would not be appropriate (ie. key is a ptr).. but the
> answer there might be importing a better hashtable implementation
> into libdrm.
> 
> Related note, once I land a libdrm_freedreno patchset (hopefully
> tomorrow or over the weekend), I'll have interest in making a
> libdrm release so I can start landing mesa patches that will
> depend on that.. so if anyone else wants me to wait a few days
> so they can push something before the next libdrm release, please
> let me know.
> 
>  xf86drmHash.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/xf86drmHash.c b/xf86drmHash.c
> index b2fa414e..39900e7e 100644
> --- a/xf86drmHash.c
> +++ b/xf86drmHash.c
> @@ -109,12 +109,7 @@ void *drmHashCreate(void)
>  table   = drmMalloc(sizeof(*table));
>  if (!table) return NULL;
>  table->magic= HASH_MAGIC;
> -table->entries  = 0;
> -table->hits = 0;
> -table->partials = 0;
> -table->misses   = 0;
>  
> -for (i = 0; i < HASH_SIZE; i++) table->buckets[i] = NULL;
>  return table;
>  }
>  
> -- 
> 2.17.1
> 
> ___
> mesa-dev mailing list
> mesa-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 20/21] drm/todo: Add some cleanup tasks

2018-10-05 Thread Eric Engestrom
On Friday, 2018-10-05 12:07:26 -0400, Harry Wentland wrote:
> On 2018-10-04 04:24 PM, Daniel Vetter wrote:
> > Motivated by review comments from Ville&Sean.
> > 
> > Cc: Ville Syrjälä 
> > Cc: Sean Paul 
> > Signed-off-by: Daniel Vetter 
> 
> Acked-by: Harry Wentland 
> 
> Harry
> 
> > ---
> >  Documentation/gpu/todo.rst | 10 ++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> > index 77c2b3c25565..5c9d86c962af 100644
> > --- a/Documentation/gpu/todo.rst
> > +++ b/Documentation/gpu/todo.rst
> > @@ -339,6 +339,16 @@ Some of these date from the very introduction of KMS 
> > in 2008 ...
> >leftovers from older (never merged into upstream) KMS designs where modes
> >where set using their ID, including support to add/remove modes.
> >  
> > +- Make ->funcs and ->helper_private vtables optional. There's a bunch of 
> > empty
> > +  function tables in drivers, but before we can remove them we need to 
> > make sure
> > +  that all the users in helpers and drivers do correctly check for a NULL
> > +  vtable.
> > +
> > +- Cleanup up the various ->destroy callbacks. A lot of them just wrapt the

small typo: s/wrapt/wrap/

> > +  drm_*_cleanup implementations and can be removed. Some tack a kfree() at 
> > the
> > +  end, for which we could add drm_*_cleanup_kfree(). And then there's the 
> > (for
> > +  historical reasons) misnamed drm_primary_helper_destroy() function.
> > +
> >  Better Testing
> >  ==
> >  
> > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] gitlab-ci: pass the correct toggles to configure

2018-09-25 Thread Eric Engestrom
On Tuesday, 2018-09-25 16:20:14 +0100, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Trivial typos - s/admgpu/amdgpu/;s/vmwfgx/vmwgfx/

Oops... Thanks :)

Reviewed-by: Eric Engestrom 

> 
> Fixes: 4a9030dc8b7 ("add gitlab-ci builds of libdrm")
> Cc: Eric Engestrom 
> Cc: Brian Starkey 
> Reported-by: Brian Starkey 
> Signed-off-by: Emil Velikov 
> ---
>  .gitlab-ci.yml | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 1dc434a5..86363f0b 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -28,9 +28,9 @@
>--enable-libkms
>--enable-intel
>--enable-radeon
> -  --enable-admgpu
> +  --enable-amdgpu
>--enable-nouveau
> -  --enable-vmwfgx
> +  --enable-vmwgfx
>--enable-omap-experimental-api
>--enable-exynos-experimental-api
>--enable-freedreno
> -- 
> 2.19.0
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] meson: honor -Detnaviv=auto

2018-09-24 Thread Eric Engestrom
On Friday, 2018-09-21 17:30:42 +0200, Guido Günther wrote:
> We support that value so it should work as expected. This does not make
> 'auto' the default since the API is still marked as experimental.
> ---
>  meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 75c7bdff..8001a9cc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -142,11 +142,11 @@ endif
>  
>  with_etnaviv = false
>  _etnaviv = get_option('etnaviv')
> -if _etnaviv == 'true'
> +if _etnaviv != 'false'
>if not with_atomics
>  error('libdrm_etnaviv requires atomics.')

We shouldn't error out in the 'auto' case; please modify the `with_atomic`
if above to add `_etnaviv == 'true' and ...`. With that, the patch is:
Reviewed-by: Eric Engestrom 

>endif
> -  with_etnaviv = true
> +  with_etnaviv = _etnaviv == 'true' or ['arm', 
> 'aarch64'].contains(host_machine.cpu_family())

That said, I have no idea if enabling it by default on ARM is the right
thing, so I'll let Lucas and/or Christian decide this :)

(You should wait for their reply before sending your v2)

>  endif
>  
>  with_exynos = get_option('exynos') == 'true'
> -- 
> 2.18.0
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 3/3] radeon: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 18:21:41 +0100, Eric Engestrom wrote:
> On Thursday, 2018-09-20 18:09:41 +0200, Michel Dänzer wrote:
> > On 2018-09-20 5:58 p.m., Eric Engestrom wrote:
> > > Fixes: 9f45264815eff6ebeba3 "radeon: annotate public functions"
> > > Cc: Lucas De Marchi 
> > > Cc: Mark Janes 
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > > Signed-off-by: Eric Engestrom 
> > > ---
> > >  radeon/radeon_bo.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c
> > > index cd06c26ee152d68f893d..91929532d5bf6e0daca8 100644
> > > --- a/radeon/radeon_bo.c
> > > +++ b/radeon/radeon_bo.c
> > > @@ -67,13 +67,13 @@ drm_public struct radeon_bo *radeon_bo_unref(struct 
> > > radeon_bo *bo)
> > >  return boi->bom->funcs->bo_unref(boi);
> > >  }
> > >  
> > > -int radeon_bo_map(struct radeon_bo *bo, int write)
> > > +drm_public int radeon_bo_map(struct radeon_bo *bo, int write)
> > >  {
> > >  struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
> > >  return boi->bom->funcs->bo_map(boi, write);
> > >  }
> > >  
> > > -int radeon_bo_unmap(struct radeon_bo *bo)
> > > +drm_public int radeon_bo_unmap(struct radeon_bo *bo)
> > >  {
> > >  struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
> > >  return boi->bom->funcs->bo_unmap(boi);
> > > 
> > 
> > Reviewed-by: Michel Dänzer 
> > Tested-by: Michel Dänzer 
> 
> Thanks!
> 
> radeon_cs_space_check was also missing, but my grep didn't catch it
> because radeon_cs_space_check_with_bo matched my weak grep skills...
> 
> I added drm_public to it too, can I still apply your tags, or do you
> want a v2?

I ended up pushing it with your r-b and t-b, because I'm going home and
would rather not have left it like that too long :)

Thanks again!

> 
> 8<
> diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c
> index 08093300827e287f3c0d..039b0414af30c1967fb7 100644
> --- a/radeon/radeon_cs_space.c
> +++ b/radeon/radeon_cs_space.c
> @@ -227,7 +227,7 @@ radeon_cs_space_check_with_bo(struct radeon_cs *cs, 
> struct radeon_bo *bo,
>  return ret;
>  }
>  
> -int radeon_cs_space_check(struct radeon_cs *cs)
> +drm_public int radeon_cs_space_check(struct radeon_cs *cs)
>  {
>  struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
>  return radeon_cs_check_space_internal(csi, NULL);
> >8
> 
> > 
> > Thanks Eric!
> > 
> > 
> > -- 
> > Earthling Michel Dänzer   |   http://www.amd.com
> > Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/3] intel: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 11:12:49 -0700, Lucas De Marchi wrote:
> On Thu, Sep 20, 2018 at 06:12:59PM +0100, Eric Engestrom wrote:
> > On Thursday, 2018-09-20 09:46:48 -0700, Lucas De Marchi wrote:
> > > On Thu, Sep 20, 2018 at 04:58:32PM +0100, Eric Engestrom wrote:
> > > > Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
> > > > Cc: Lucas De Marchi 
> > > > Cc: Mark Janes 
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > > > Signed-off-by: Eric Engestrom 
> > > 
> > > Reviewed-by: Lucas De Marchi 
> > > 
> > > But for the series, I went to check what went wrong. It seems my script
> > > missed the cases in which we had more than one symbol with the same
> > > name (yes, we do have some static functions that have the same name
> > > of an exported symbol) and cases in which for some reason
> > > cscope didn't return the location of the symbold definition.
> > > 
> > > So... I decided to double check if we are now exporting all symbols
> > > that we were previously. My check is with:
> > > 
> > > $ git checkout 473e2d2
> > > $ flags="-D amdgpu=true -D cairo-tests=true -D etnaviv=true -D exynos=true
> > >  -D freedreno=true -D freedreno-kgsl=true -D intel=true -D 
> > > libkms=true
> > >  -D man-pages=true -D nouveau=true -D omap=true -D radeon=true
> > >  -D tegra=true -D udev=true -D valgrind=true -D vc4=true -D 
> > > vmwgfx=true"
> > > $ meson _buildold
> > > $ ninja -C _buildold
> > > $ git checkout master
> > > $ ls /tmp/patches/
> > > 0001-intel-add-missing-drm-public-exports.patch
> > > 0003-radeon-add-missing-drm-public-exports.patch
> > > 0002-nouveau-add-missing-drm-public-exports.patch
> > > $ git am /tmp/patches/*
> > > $ meson _buildnew
> > > $ ninja -C _buildnew
> > > $ find _buildnew/ -name '*.so' | while read f; do
> > > fold=${f/_buildnew/_buildold}
> > > nm --dynamic --defined-only $f | grep -i " T " | cut -d' ' -f3 | sort 
> > > -u > /tmp/new.txt
> > > nm --dynamic --defined-only $fold | grep -i " T " | cut -d' ' -f3 | 
> > > sort -u > /tmp/old.txt
> > > git diff /tmp/old.txt /tmp/new.txt
> > > done
> > > 
> > > So.. we still have the following symbols missing.
> > > 
> > > diff --git a/tmp/old.txt b/tmp/new.txt
> > > index 799b63d8..dd0c30c2 100644
> > > --- a/tmp/old.txt
> > > +++ b/tmp/new.txt
> > > @@ -29,7 +29,6 @@ radeon_cs_need_flush
> > >  radeon_cs_print
> > >  radeon_cs_set_limit
> > >  radeon_cs_space_add_persistent_bo
> > > -radeon_cs_space_check
> > 
> > Ha, I missed that one because my grep found the one with the `_with_bo`
> > suffix which was properly exported... :eyeroll:
> > I'll send a v2 in a bit with that added.
> > 
> > >  radeon_cs_space_check_with_bo
> > >  radeon_cs_space_reset_bos
> > >  radeon_cs_space_set_flush
> > > diff --git a/tmp/old.txt b/tmp/new.txt
> > > index d846faf0..e08eac77 100644
> > > --- a/tmp/old.txt
> > > +++ b/tmp/new.txt
> > > @@ -4,13 +4,9 @@ omap_bo_cpu_fini
> > >  omap_bo_cpu_prep
> > >  omap_bo_del
> > >  omap_bo_dmabuf
> > > -omap_bo_from_dmabuf
> > > -omap_bo_from_name
> > >  omap_bo_get_name
> > >  omap_bo_handle
> > >  omap_bo_map
> > > -omap_bo_new
> > > -omap_bo_new_tiled
> > >  omap_bo_ref
> > >  omap_bo_size
> > >  omap_device_del
> > 
> > These ones actually do have the drm_public annotation, although it was
> > not written the "normal way", which might be why it's not working?
> > 
> > For example:
> > 
> >   struct omap_bo *
> >   drm_public omap_bo_from_name(struct omap_device *dev, uint32_t name)
> >   {
> >   ...
> > 
> > I guess from your script above that they are actually not exported?
> > Could you double-check, and send a patch for these omap ones? Thanks :)
> 
> I double checked everything. With your patches applied (including the omap 
> one and the
> radeon_cs_space_check) and the additional drm_public in fd_bo_from_fbdev, then
> it passes the symbol check I did with before vs after.

OK, I pushed everything (including the freedreno one, which was technically
not reviewed, but I'm going home and I&

Re: [PATCH libdrm 1/3] intel: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 18:30:54 +0100, Emil Velikov wrote:
> On 20 September 2018 at 16:58, Eric Engestrom  
> wrote:
> > Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
> > Cc: Lucas De Marchi 
> > Cc: Mark Janes 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > Signed-off-by: Eric Engestrom 
> > ---
> >  intel/intel_bufmgr_fake.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> This indicated my earlier concern it's not an issue of drm_public vs
> drm_private - people simply forget to run make check.

Actually, this is a limitation of the current symbol check system: it
only checks that nothing is exported when it shouldn't be, but it doesn't
check that what should be exported actually is.
My symbols check series fixes that and would've caught these; I really
need to find the time to finish it :/

> As said earlier - if you want this in Intel sure, but don't push it onto 
> others.

Intel or not isn't the issue here, but I understand your concern.
If someone using one of those broken compilers raises a bug, we might
have to reconsider and revert it, but for now let's just try to fix it :)

> 
> Thanks
> Emil
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] omap: fix symbol annotations

2018-09-20 Thread Eric Engestrom
Fixes: f3f7266d94e0354bfd97 "omap: annotate public functions"
Cc: Lucas De Marchi 
Signed-off-by: Eric Engestrom 
---
 omap/omap_drm.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index 3136e04e4170ac3bb94d..3aed4e0a2f65a9aec6f5 100644
--- a/omap/omap_drm.c
+++ b/omap/omap_drm.c
@@ -128,8 +128,8 @@ drm_public void omap_device_del(struct omap_device *dev)
free(dev);
 }
 
-int
-drm_public omap_get_param(struct omap_device *dev, uint64_t param, uint64_t 
*value)
+drm_public int
+omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
 {
struct drm_omap_param req = {
.param = param,
@@ -146,8 +146,8 @@ drm_public omap_get_param(struct omap_device *dev, uint64_t 
param, uint64_t *val
return 0;
 }
 
-int
-drm_public omap_set_param(struct omap_device *dev, uint64_t param, uint64_t 
value)
+drm_public int
+omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value)
 {
struct drm_omap_param req = {
.param = param,
@@ -226,8 +226,8 @@ static struct omap_bo * omap_bo_new_impl(struct omap_device 
*dev,
 
 
 /* allocate a new (un-tiled) buffer object */
-struct omap_bo *
-drm_public omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
+drm_public struct omap_bo *
+omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
 {
union omap_gem_size gsize = {
.bytes = size,
@@ -239,8 +239,8 @@ drm_public omap_bo_new(struct omap_device *dev, uint32_t 
size, uint32_t flags)
 }
 
 /* allocate a new buffer object */
-struct omap_bo *
-drm_public omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
+drm_public struct omap_bo *
+omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
  uint32_t height, uint32_t flags)
 {
union omap_gem_size gsize = {
@@ -281,8 +281,8 @@ static int get_buffer_info(struct omap_bo *bo)
 }
 
 /* import a buffer object from DRI2 name */
-struct omap_bo *
-drm_public omap_bo_from_name(struct omap_device *dev, uint32_t name)
+drm_public struct omap_bo *
+omap_bo_from_name(struct omap_device *dev, uint32_t name)
 {
struct omap_bo *bo = NULL;
struct drm_gem_open req = {
@@ -315,8 +315,8 @@ drm_public omap_bo_from_name(struct omap_device *dev, 
uint32_t name)
  * fd so caller should close() the fd when it is otherwise done
  * with it (even if it is still using the 'struct omap_bo *')
  */
-struct omap_bo *
-drm_public omap_bo_from_dmabuf(struct omap_device *dev, int fd)
+drm_public struct omap_bo *
+omap_bo_from_dmabuf(struct omap_device *dev, int fd)
 {
struct omap_bo *bo = NULL;
struct drm_prime_handle req = {
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/3] intel: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 18:12:59 +0100, Eric Engestrom wrote:
> On Thursday, 2018-09-20 09:46:48 -0700, Lucas De Marchi wrote:
> > On Thu, Sep 20, 2018 at 04:58:32PM +0100, Eric Engestrom wrote:
> > > Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
> > > Cc: Lucas De Marchi 
> > > Cc: Mark Janes 
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > > Signed-off-by: Eric Engestrom 
> > 
> > Reviewed-by: Lucas De Marchi 
> > 
> > But for the series, I went to check what went wrong. It seems my script
> > missed the cases in which we had more than one symbol with the same
> > name (yes, we do have some static functions that have the same name
> > of an exported symbol) and cases in which for some reason
> > cscope didn't return the location of the symbold definition.
> > 
> > So... I decided to double check if we are now exporting all symbols
> > that we were previously. My check is with:
> > 
> > $ git checkout 473e2d2
> > $ flags="-D amdgpu=true -D cairo-tests=true -D etnaviv=true -D exynos=true
> >  -D freedreno=true -D freedreno-kgsl=true -D intel=true -D 
> > libkms=true
> >  -D man-pages=true -D nouveau=true -D omap=true -D radeon=true
> >  -D tegra=true -D udev=true -D valgrind=true -D vc4=true -D 
> > vmwgfx=true"
> > $ meson _buildold
> > $ ninja -C _buildold
> > $ git checkout master
> > $ ls /tmp/patches/
> > 0001-intel-add-missing-drm-public-exports.patch
> > 0003-radeon-add-missing-drm-public-exports.patch
> > 0002-nouveau-add-missing-drm-public-exports.patch
> > $ git am /tmp/patches/*
> > $ meson _buildnew
> > $ ninja -C _buildnew
> > $ find _buildnew/ -name '*.so' | while read f; do
> > fold=${f/_buildnew/_buildold}
> > nm --dynamic --defined-only $f | grep -i " T " | cut -d' ' -f3 | sort 
> > -u > /tmp/new.txt
> > nm --dynamic --defined-only $fold | grep -i " T " | cut -d' ' -f3 | 
> > sort -u > /tmp/old.txt
> > git diff /tmp/old.txt /tmp/new.txt
> > done
> > 
> > So.. we still have the following symbols missing.
> > 
> > diff --git a/tmp/old.txt b/tmp/new.txt
> > index 799b63d8..dd0c30c2 100644
> > --- a/tmp/old.txt
> > +++ b/tmp/new.txt
> > @@ -29,7 +29,6 @@ radeon_cs_need_flush
> >  radeon_cs_print
> >  radeon_cs_set_limit
> >  radeon_cs_space_add_persistent_bo
> > -radeon_cs_space_check
> 
> Ha, I missed that one because my grep found the one with the `_with_bo`
> suffix which was properly exported... :eyeroll:
> I'll send a v2 in a bit with that added.
> 
> >  radeon_cs_space_check_with_bo
> >  radeon_cs_space_reset_bos
> >  radeon_cs_space_set_flush
> > diff --git a/tmp/old.txt b/tmp/new.txt
> > index d846faf0..e08eac77 100644
> > --- a/tmp/old.txt
> > +++ b/tmp/new.txt
> > @@ -4,13 +4,9 @@ omap_bo_cpu_fini
> >  omap_bo_cpu_prep
> >  omap_bo_del
> >  omap_bo_dmabuf
> > -omap_bo_from_dmabuf
> > -omap_bo_from_name
> >  omap_bo_get_name
> >  omap_bo_handle
> >  omap_bo_map
> > -omap_bo_new
> > -omap_bo_new_tiled
> >  omap_bo_ref
> >  omap_bo_size
> >  omap_device_del
> 
> These ones actually do have the drm_public annotation, although it was
> not written the "normal way", which might be why it's not working?
> 
> For example:
> 
>   struct omap_bo *
>   drm_public omap_bo_from_name(struct omap_device *dev, uint32_t name)
>   {
>   ...
> 
> I guess from your script above that they are actually not exported?
> Could you double-check, and send a patch for these omap ones? Thanks :)

Actually, I went ahead and did that patch anyway, sending it in
a minute.

> 
> > diff --git a/tmp/old.txt b/tmp/new.txt
> > index fe0dbf39..40a459ad 100644
> > --- a/tmp/old.txt
> > +++ b/tmp/new.txt
> > @@ -3,7 +3,6 @@ fd_bo_cpu_prep
> >  fd_bo_del
> >  fd_bo_dmabuf
> >  fd_bo_from_dmabuf
> > -fd_bo_from_fbdev
> 
> This one is actually all good:
> 
>   drm_public struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, 
> uint32_t size)
> 
> It is hidden behind `!HAVE_FREEDRENO_KGSL` which is itself controlled by
> `-D freedreno-kgsl=false` on meson; make sure you're using the same
> config for your before/after comparison :)
> 
> >  fd_bo_from_handle
> >  fd_bo_from_name
> >  fd_bo_get_iova
> > 
> > I hope I'm covering everything now.
> > 
> > Thanks
> > L

Re: [PATCH libdrm 3/3] radeon: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 18:09:41 +0200, Michel Dänzer wrote:
> On 2018-09-20 5:58 p.m., Eric Engestrom wrote:
> > Fixes: 9f45264815eff6ebeba3 "radeon: annotate public functions"
> > Cc: Lucas De Marchi 
> > Cc: Mark Janes 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > Signed-off-by: Eric Engestrom 
> > ---
> >  radeon/radeon_bo.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c
> > index cd06c26ee152d68f893d..91929532d5bf6e0daca8 100644
> > --- a/radeon/radeon_bo.c
> > +++ b/radeon/radeon_bo.c
> > @@ -67,13 +67,13 @@ drm_public struct radeon_bo *radeon_bo_unref(struct 
> > radeon_bo *bo)
> >  return boi->bom->funcs->bo_unref(boi);
> >  }
> >  
> > -int radeon_bo_map(struct radeon_bo *bo, int write)
> > +drm_public int radeon_bo_map(struct radeon_bo *bo, int write)
> >  {
> >  struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
> >  return boi->bom->funcs->bo_map(boi, write);
> >  }
> >  
> > -int radeon_bo_unmap(struct radeon_bo *bo)
> > +drm_public int radeon_bo_unmap(struct radeon_bo *bo)
> >  {
> >  struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
> >  return boi->bom->funcs->bo_unmap(boi);
> > 
> 
> Reviewed-by: Michel Dänzer 
> Tested-by: Michel Dänzer 

Thanks!

radeon_cs_space_check was also missing, but my grep didn't catch it
because radeon_cs_space_check_with_bo matched my weak grep skills...

I added drm_public to it too, can I still apply your tags, or do you
want a v2?

8<
diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c
index 08093300827e287f3c0d..039b0414af30c1967fb7 100644
--- a/radeon/radeon_cs_space.c
+++ b/radeon/radeon_cs_space.c
@@ -227,7 +227,7 @@ radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct 
radeon_bo *bo,
 return ret;
 }
 
-int radeon_cs_space_check(struct radeon_cs *cs)
+drm_public int radeon_cs_space_check(struct radeon_cs *cs)
 {
 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
 return radeon_cs_check_space_internal(csi, NULL);
>8

> 
> Thanks Eric!
> 
> 
> -- 
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/3] intel: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
On Thursday, 2018-09-20 09:46:48 -0700, Lucas De Marchi wrote:
> On Thu, Sep 20, 2018 at 04:58:32PM +0100, Eric Engestrom wrote:
> > Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
> > Cc: Lucas De Marchi 
> > Cc: Mark Janes 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
> > Signed-off-by: Eric Engestrom 
> 
> Reviewed-by: Lucas De Marchi 
> 
> But for the series, I went to check what went wrong. It seems my script
> missed the cases in which we had more than one symbol with the same
> name (yes, we do have some static functions that have the same name
> of an exported symbol) and cases in which for some reason
> cscope didn't return the location of the symbold definition.
> 
> So... I decided to double check if we are now exporting all symbols
> that we were previously. My check is with:
> 
> $ git checkout 473e2d2
> $ flags="-D amdgpu=true -D cairo-tests=true -D etnaviv=true -D exynos=true
>  -D freedreno=true -D freedreno-kgsl=true -D intel=true -D libkms=true
>  -D man-pages=true -D nouveau=true -D omap=true -D radeon=true
>  -D tegra=true -D udev=true -D valgrind=true -D vc4=true -D 
> vmwgfx=true"
> $ meson _buildold
> $ ninja -C _buildold
> $ git checkout master
> $ ls /tmp/patches/
> 0001-intel-add-missing-drm-public-exports.patch
> 0003-radeon-add-missing-drm-public-exports.patch
> 0002-nouveau-add-missing-drm-public-exports.patch
> $ git am /tmp/patches/*
> $ meson _buildnew
> $ ninja -C _buildnew
> $ find _buildnew/ -name '*.so' | while read f; do
> fold=${f/_buildnew/_buildold}
> nm --dynamic --defined-only $f | grep -i " T " | cut -d' ' -f3 | sort -u 
> > /tmp/new.txt
> nm --dynamic --defined-only $fold | grep -i " T " | cut -d' ' -f3 | sort 
> -u > /tmp/old.txt
> git diff /tmp/old.txt /tmp/new.txt
> done
> 
> So.. we still have the following symbols missing.
> 
> diff --git a/tmp/old.txt b/tmp/new.txt
> index 799b63d8..dd0c30c2 100644
> --- a/tmp/old.txt
> +++ b/tmp/new.txt
> @@ -29,7 +29,6 @@ radeon_cs_need_flush
>  radeon_cs_print
>  radeon_cs_set_limit
>  radeon_cs_space_add_persistent_bo
> -radeon_cs_space_check

Ha, I missed that one because my grep found the one with the `_with_bo`
suffix which was properly exported... :eyeroll:
I'll send a v2 in a bit with that added.

>  radeon_cs_space_check_with_bo
>  radeon_cs_space_reset_bos
>  radeon_cs_space_set_flush
> diff --git a/tmp/old.txt b/tmp/new.txt
> index d846faf0..e08eac77 100644
> --- a/tmp/old.txt
> +++ b/tmp/new.txt
> @@ -4,13 +4,9 @@ omap_bo_cpu_fini
>  omap_bo_cpu_prep
>  omap_bo_del
>  omap_bo_dmabuf
> -omap_bo_from_dmabuf
> -omap_bo_from_name
>  omap_bo_get_name
>  omap_bo_handle
>  omap_bo_map
> -omap_bo_new
> -omap_bo_new_tiled
>  omap_bo_ref
>  omap_bo_size
>  omap_device_del

These ones actually do have the drm_public annotation, although it was
not written the "normal way", which might be why it's not working?

For example:

  struct omap_bo *
  drm_public omap_bo_from_name(struct omap_device *dev, uint32_t name)
  {
  ...

I guess from your script above that they are actually not exported?
Could you double-check, and send a patch for these omap ones? Thanks :)

> diff --git a/tmp/old.txt b/tmp/new.txt
> index fe0dbf39..40a459ad 100644
> --- a/tmp/old.txt
> +++ b/tmp/new.txt
> @@ -3,7 +3,6 @@ fd_bo_cpu_prep
>  fd_bo_del
>  fd_bo_dmabuf
>  fd_bo_from_dmabuf
> -fd_bo_from_fbdev

This one is actually all good:

  drm_public struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, 
uint32_t size)

It is hidden behind `!HAVE_FREEDRENO_KGSL` which is itself controlled by
`-D freedreno-kgsl=false` on meson; make sure you're using the same
config for your before/after comparison :)

>  fd_bo_from_handle
>  fd_bo_from_name
>  fd_bo_get_iova
> 
> I hope I'm covering everything now.
> 
> Thanks
> Lucas De Marchi
> 
> > ---
> >  intel/intel_bufmgr_fake.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c
> > index 57cbc5365b9f0779dd5a..0cec51f5b836d26e57e0 100644
> > --- a/intel/intel_bufmgr_fake.c
> > +++ b/intel/intel_bufmgr_fake.c
> > @@ -241,7 +241,7 @@ FENCE_LTE(unsigned a, unsigned b)
> > return 0;
> >  }
> >  
> > -void
> > +drm_public void
> >  drm_intel_bufmgr_fake_set_fence_callback(drm_intel_bufmgr *bufmgr,
> >  unsigned int (*emit) (void *priv),
> >  void (*wait) (uns

[PATCH libdrm 3/3] radeon: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
Fixes: 9f45264815eff6ebeba3 "radeon: annotate public functions"
Cc: Lucas De Marchi 
Cc: Mark Janes 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom 
---
 radeon/radeon_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c
index cd06c26ee152d68f893d..91929532d5bf6e0daca8 100644
--- a/radeon/radeon_bo.c
+++ b/radeon/radeon_bo.c
@@ -67,13 +67,13 @@ drm_public struct radeon_bo *radeon_bo_unref(struct 
radeon_bo *bo)
 return boi->bom->funcs->bo_unref(boi);
 }
 
-int radeon_bo_map(struct radeon_bo *bo, int write)
+drm_public int radeon_bo_map(struct radeon_bo *bo, int write)
 {
 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
 return boi->bom->funcs->bo_map(boi, write);
 }
 
-int radeon_bo_unmap(struct radeon_bo *bo)
+drm_public int radeon_bo_unmap(struct radeon_bo *bo)
 {
 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
 return boi->bom->funcs->bo_unmap(boi);
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 2/3] nouveau: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
Fixes: d7320bfcddc596f23fa2 "nouveau: annotate public functions"
Cc: Lucas De Marchi 
Cc: Mark Janes 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom 
---
 nouveau/nouveau.c | 2 +-
 nouveau/pushbuf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 5be0611e0e79451112c6..f18d1426bd419e3c 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -856,7 +856,7 @@ nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access,
return ret;
 }
 
-int
+drm_public int
 nouveau_bo_map(struct nouveau_bo *bo, uint32_t access,
   struct nouveau_client *client)
 {
diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c
index 856ae7ee169b58bffd78..e5f73f0d74c178939c91 100644
--- a/nouveau/pushbuf.c
+++ b/nouveau/pushbuf.c
@@ -728,7 +728,7 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct 
nouveau_bo *bo,
}
 }
 
-int
+drm_public int
 nouveau_pushbuf_refn(struct nouveau_pushbuf *push,
 struct nouveau_pushbuf_refn *refs, int nr)
 {
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm 1/3] intel: add missing drm_public exports

2018-09-20 Thread Eric Engestrom
Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
Cc: Lucas De Marchi 
Cc: Mark Janes 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom 
---
 intel/intel_bufmgr_fake.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c
index 57cbc5365b9f0779dd5a..0cec51f5b836d26e57e0 100644
--- a/intel/intel_bufmgr_fake.c
+++ b/intel/intel_bufmgr_fake.c
@@ -241,7 +241,7 @@ FENCE_LTE(unsigned a, unsigned b)
return 0;
 }
 
-void
+drm_public void
 drm_intel_bufmgr_fake_set_fence_callback(drm_intel_bufmgr *bufmgr,
 unsigned int (*emit) (void *priv),
 void (*wait) (unsigned int fence,
@@ -955,7 +955,7 @@ drm_intel_fake_bo_unreference(drm_intel_bo *bo)
  * Set the buffer as not requiring backing store, and instead get the callback
  * invoked whenever it would be set dirty.
  */
-void
+drm_public void
 drm_intel_bo_fake_disable_backing_store(drm_intel_bo *bo,
void (*invalidate_cb) (drm_intel_bo *bo,
   void *ptr),
@@ -1409,7 +1409,7 @@ drm_intel_bo_fake_post_submit(drm_intel_bo *bo)
bo_fake->write_domain = 0;
 }
 
-void
+drm_public void
 drm_intel_bufmgr_fake_set_exec_callback(drm_intel_bufmgr *bufmgr,
 int (*exec) (drm_intel_bo *bo,
  unsigned int used,
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] android: make symbols hidden by default

2018-09-20 Thread Eric Engestrom
On Wednesday, 2018-09-19 23:05:48 -0700, Lucas De Marchi wrote:
> Signed-off-by: Lucas De Marchi 

Reviewed-by: Eric Engestrom 

But it'd be good to have a confirmation from Rob that it actually works:
Cc: Rob Herring 

> ---
>  Android.common.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Android.common.mk b/Android.common.mk
> index e3de1069..d0e5d559 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -2,6 +2,7 @@
>  LOCAL_CFLAGS += \
>   -DMAJOR_IN_SYSMACROS=1 \
>   -DHAVE_VISIBILITY=1 \
> + -fvisibility=hidden \
>   -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
>  
>  LOCAL_CFLAGS += \
> -- 
> 2.17.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm v3] CONTRIBUTING: clarify how to request a Developer role

2018-09-20 Thread Eric Engestrom
On Wednesday, 2018-09-19 22:54:40 -0700, Lucas De Marchi wrote:
> While requesting a Developer role I was pointed to this url and check
> those with "owner" role. So add it to our documentation.
> 
> v2: rollback previous text, but add a link to gitlab's page
> showing project members.
> v3: reprhase paragraph adding link to members page
> 
> Signed-off-by: Lucas De Marchi 

Looks good to me; thanks!
Reviewed-by: Eric Engestrom 

> ---
>  CONTRIBUTING | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/CONTRIBUTING b/CONTRIBUTING
> index 96f1e4fb..1c42750f 100644
> --- a/CONTRIBUTING
> +++ b/CONTRIBUTING
> @@ -79,8 +79,9 @@ below criteria:
>criteria, tools, and processes.
>  
>  To apply for commit rights ("Developer" role in gitlab) send a mail to
> -dri-devel@lists.freedesktop.org and please ping the maintainers if your 
> request
> -is stuck.
> +dri-devel@lists.freedesktop.org and if your request is stuck ping any member
> +with "owner" role in
> +https://gitlab.freedesktop.org/mesa/drm/project_members?sort=access_level_desc
>  
>  Committers are encouraged to request their commit rights get removed when 
> they
>  no longer contribute to the project. Commit rights will be reinstated when 
> they
> -- 
> 2.17.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/2] i915: rename modifiers to follow the naming convention

2018-09-18 Thread Eric Engestrom
$ sed -i s/I915_FORMAT_MOD_/DRM_FORMAT_MOD_INTEL_/g $(git grep -l 
I915_FORMAT_MOD_)
$ git checkout include/uapi/drm/drm_fourcc.h

Signed-off-by: Eric Engestrom 
---
 drivers/gpu/drm/i915/intel_atomic_plane.c |  12 +-
 drivers/gpu/drm/i915/intel_display.c  | 128 +++---
 drivers/gpu/drm/i915/intel_pm.c   |  26 ++---
 drivers/gpu/drm/i915/intel_sprite.c   |  58 +-
 4 files changed, 112 insertions(+), 112 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c 
b/drivers/gpu/drm/i915/intel_atomic_plane.c
index fa7df5fe154bf06bdfc5..c26f0b25afa2dc8c3a3c 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -126,8 +126,8 @@ int intel_plane_atomic_check_with_state(const struct 
intel_crtc_state *old_crtc_
if (state->fb && drm_rotation_90_or_270(state->rotation)) {
struct drm_format_name_buf format_name;
 
-   if (state->fb->modifier != I915_FORMAT_MOD_Y_TILED &&
-   state->fb->modifier != I915_FORMAT_MOD_Yf_TILED) {
+   if (state->fb->modifier != DRM_FORMAT_MOD_INTEL_Y_TILED &&
+   state->fb->modifier != DRM_FORMAT_MOD_INTEL_Yf_TILED) {
DRM_DEBUG_KMS("Y/Yf tiling required for 90/270!\n");
return -EINVAL;
}
@@ -169,10 +169,10 @@ int intel_plane_atomic_check_with_state(const struct 
intel_crtc_state *old_crtc_
 */
if (state->fb && INTEL_GEN(dev_priv) >= 9 && crtc_state->base.enable &&
adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
-   if (state->fb->modifier == I915_FORMAT_MOD_Y_TILED ||
-   state->fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
-   state->fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
-   state->fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) {
+   if (state->fb->modifier == DRM_FORMAT_MOD_INTEL_Y_TILED ||
+   state->fb->modifier == DRM_FORMAT_MOD_INTEL_Yf_TILED ||
+   state->fb->modifier == DRM_FORMAT_MOD_INTEL_Y_TILED_CCS ||
+   state->fb->modifier == DRM_FORMAT_MOD_INTEL_Yf_TILED_CCS) {
DRM_DEBUG_KMS("Y/Yf tiling not supported in IF-ID 
mode\n");
return -EINVAL;
}
diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index b2bab57cd113f2293850..087302d655f9a146846a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -69,7 +69,7 @@ static const uint32_t i965_primary_formats[] = {
 };
 
 static const uint64_t i9xx_format_modifiers[] = {
-   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_INTEL_X_TILED,
DRM_FORMAT_MOD_LINEAR,
DRM_FORMAT_MOD_INVALID
 };
@@ -106,19 +106,19 @@ static const uint32_t skl_pri_planar_formats[] = {
 };
 
 static const uint64_t skl_format_modifiers_noccs[] = {
-   I915_FORMAT_MOD_Yf_TILED,
-   I915_FORMAT_MOD_Y_TILED,
-   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_INTEL_Yf_TILED,
+   DRM_FORMAT_MOD_INTEL_Y_TILED,
+   DRM_FORMAT_MOD_INTEL_X_TILED,
DRM_FORMAT_MOD_LINEAR,
DRM_FORMAT_MOD_INVALID
 };
 
 static const uint64_t skl_format_modifiers_ccs[] = {
-   I915_FORMAT_MOD_Yf_TILED_CCS,
-   I915_FORMAT_MOD_Y_TILED_CCS,
-   I915_FORMAT_MOD_Yf_TILED,
-   I915_FORMAT_MOD_Y_TILED,
-   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_INTEL_Yf_TILED_CCS,
+   DRM_FORMAT_MOD_INTEL_Y_TILED_CCS,
+   DRM_FORMAT_MOD_INTEL_Yf_TILED,
+   DRM_FORMAT_MOD_INTEL_Y_TILED,
+   DRM_FORMAT_MOD_INTEL_X_TILED,
DRM_FORMAT_MOD_LINEAR,
DRM_FORMAT_MOD_INVALID
 };
@@ -1925,25 +1925,25 @@ intel_tile_width_bytes(const struct drm_framebuffer 
*fb, int plane)
switch (fb->modifier) {
case DRM_FORMAT_MOD_LINEAR:
return cpp;
-   case I915_FORMAT_MOD_X_TILED:
+   case DRM_FORMAT_MOD_INTEL_X_TILED:
if (IS_GEN2(dev_priv))
return 128;
else
return 512;
-   case I915_FORMAT_MOD_Y_TILED_CCS:
+   case DRM_FORMAT_MOD_INTEL_Y_TILED_CCS:
if (plane == 1)
return 128;
/* fall through */
-   case I915_FORMAT_MOD_Y_TILED:
+   case DRM_FORMAT_MOD_INTEL_Y_TILED:
if (IS_GEN2(dev_priv) || HAS_128_BYTE_Y_TILING(dev_priv))
return 128;
else
return 512;
-   case I915_FORMAT_MOD_Yf_TILED_CCS:
+   case DRM_FORMAT_MOD_INTEL_Yf_TILED_CCS:
if (plane == 1)
return 128;
/* fall through */
-   case I915_F

[PATCH 1/2] drm/fourcc: rename Intel modifiers to follow the naming convention

2018-09-18 Thread Eric Engestrom
All the other vendors use the format
DRM_FORMAT_MOD_{SAMSUNG,QCOM,VIVANTE,NVIDIA,BROADCOM,ARM}_* for their
modifiers, except Intel.

Suggested-by: Gerd Hoffmann 
Signed-off-by: Eric Engestrom 
---
 include/uapi/drm/drm_fourcc.h | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 139632b871816f9e3dad..170a562223387687592a 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -271,7 +271,8 @@ extern "C" {
  * sharing. It exists since on a given platform it does uniquely identify the
  * layout in a simple way for i915-specific userspace.
  */
-#define I915_FORMAT_MOD_X_TILEDfourcc_mod_code(INTEL, 1)
+#define DRM_FORMAT_MOD_INTEL_X_TILED   fourcc_mod_code(INTEL, 1)
+#define I915_FORMAT_MOD_X_TILEDDRM_FORMAT_MOD_INTEL_X_TILED
 
 /*
  * Intel Y-tiling layout
@@ -286,7 +287,8 @@ extern "C" {
  * sharing. It exists since on a given platform it does uniquely identify the
  * layout in a simple way for i915-specific userspace.
  */
-#define I915_FORMAT_MOD_Y_TILEDfourcc_mod_code(INTEL, 2)
+#define DRM_FORMAT_MOD_INTEL_Y_TILED   fourcc_mod_code(INTEL, 2)
+#define I915_FORMAT_MOD_Y_TILEDDRM_FORMAT_MOD_INTEL_Y_TILED
 
 /*
  * Intel Yf-tiling layout
@@ -301,7 +303,8 @@ extern "C" {
  * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the 
width
  * in pixel depends on the pixel depth.
  */
-#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
+#define DRM_FORMAT_MOD_INTEL_Yf_TILED fourcc_mod_code(INTEL, 3)
+#define I915_FORMAT_MOD_Yf_TILED DRM_FORMAT_MOD_INTEL_Yf_TILED
 
 /*
  * Intel color control surface (CCS) for render compression
@@ -320,8 +323,10 @@ extern "C" {
  * But that fact is not relevant unless the memory is accessed
  * directly.
  */
-#define I915_FORMAT_MOD_Y_TILED_CCSfourcc_mod_code(INTEL, 4)
-#define I915_FORMAT_MOD_Yf_TILED_CCS   fourcc_mod_code(INTEL, 5)
+#define DRM_FORMAT_MOD_INTEL_Y_TILED_CCS   fourcc_mod_code(INTEL, 4)
+#define I915_FORMAT_MOD_Y_TILED_CCSDRM_FORMAT_MOD_INTEL_Y_TILED_CCS
+#define DRM_FORMAT_MOD_INTEL_Yf_TILED_CCS  fourcc_mod_code(INTEL, 5)
+#define I915_FORMAT_MOD_Yf_TILED_CCS   DRM_FORMAT_MOD_INTEL_Yf_TILED_CCS
 
 /*
  * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] headers/README: fix/add link to drm-next

2018-09-18 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 include/drm/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/README b/include/drm/README
index 521630db8b4c52749188..ea2320cc9e7728a9c08b 100644
--- a/include/drm/README
+++ b/include/drm/README
@@ -71,7 +71,7 @@ Note: One should not do _any_ changes to the files apart from 
the steps below.
 
 In order to update the files do the following:
  - Switch to a Linux kernel tree/branch which is not rebased.
-For example: airlied/drm-next
+   For example: drm-next (https://cgit.freedesktop.org/drm/drm)
  - Install the headers via `make headers_install' to a separate location.
  - Copy the drm header[s] + git add + git commit.
  - Note: Your commit message must include:
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 1/2] drm: Add library for shmem backed GEM objects

2018-09-14 Thread Eric Engestrom
On Wednesday, 2018-09-12 20:33:32 -0500, David Lechner wrote:
> On 09/11/2018 07:43 AM, Noralf Trønnes wrote:
> > This adds a library for shmem backed GEM objects with the necessary
> > drm_driver callbacks.
> > 
> > Signed-off-by: Noralf Trønnes 
> > ---
> > 
> 
> ...
> 
> > +static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem)
> > +{
> > +   struct drm_gem_object *obj = &shmem->base;
> > +   int ret;
> > +
> > +   if (shmem->vmap_use_count++ > 0)
> > +   return 0;
> > +
> > +   ret = drm_gem_shmem_get_pages(shmem);
> > +   if (ret)
> > +   goto err_zero_use;
> > +
> > +   if (obj->import_attach) {
> > +   shmem->vaddr = dma_buf_vmap(obj->import_attach->dmabuf);
> > +   } else {
> > +   pgprot_t prot;
> > +
> > +   switch (shmem->cache_mode) {
> > +   case DRM_GEM_SHMEM_BO_UNKNOWN:
> > +   DRM_DEBUG_KMS("Can't vmap cache mode is unknown\n");
> > +   ret = -EINVAL;
> > +   goto err_put_pages;
> > +
> > +   case DRM_GEM_SHMEM_BO_WRITECOMBINED:
> > +   prot = pgprot_writecombine(PAGE_KERNEL);
> > +   break;
> > +
> > +   case DRM_GEM_SHMEM_BO_UNCACHED:
> > +   prot = pgprot_noncached(PAGE_KERNEL);
> > +   break;
> > +
> > +   case DRM_GEM_SHMEM_BO_CACHED:
> > +   prot = PAGE_KERNEL;
> > +   break;
> > +   }
> > +
> > +   shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT, 
> > VM_MAP, prot);
> 
> I get a gcc warning here:
> 
> /home/david/work/ev3dev2/ev3dev-kernel/drivers/gpu/drm/drm_gem_shmem_helper.c:220:18:
>  warning: ‘prot’ may be used uninitialized in this function 
> [-Wmaybe-uninitialized]
>shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT, VM_MAP, prot);
>   ^
> /home/david/work/ev3dev2/ev3dev-kernel/drivers/gpu/drm/drm_gem_shmem_helper.c:199:12:
>  note: ‘prot’ was declared here
>pgprot_t prot;
> ^~~~

This warning is saying that the vmap could be reached without hitting
any cases in the switch, which is technically true if one sets the
cache_mode to some garbage, but not if only existing enums from `enum
drm_gem_shmem_cache_mode` are used.

I think we should just add a `default:` next to the
DRM_GEM_SHMEM_BO_UNKNOWN case.

> 
> ---
> 
> And since I am making a comment anyway, it is not clear to me
> what BO means in the enum names. I didn't see any hints in the
> doc comments either.

Buffer Object, but yeah I guess it's not necessary in the enum names.

> 
> 
> > +   }
> > +
> > +   if (!shmem->vaddr) {
> > +   DRM_DEBUG_KMS("Failed to vmap pages\n");
> > +   ret = -ENOMEM;
> > +   goto err_put_pages;
> > +   }
> > +
> > +   return 0;
> > +
> > +err_put_pages:
> > +   drm_gem_shmem_put_pages(shmem);
> > +err_zero_use:
> > +   shmem->vmap_use_count = 0;
> > +
> > +   return ret;
> > +}
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm v2 00/13] hide library symbols by default

2018-09-14 Thread Eric Engestrom
On Thursday, 2018-09-13 16:57:11 -0700, Lucas De Marchi wrote:
> Rely on -fvisibility=hidden to hide the symbols. Previous version of
> this series applying only to drm_intel.so is
> 
>   Reviewed-by: Eric Engestrom 
> 
> but it's not included here since I changed the approach for the build
> system change.

Patches 1 (intel), 5 (libdrm) and 12 (meson) are:
Reviewed-by: Eric Engestrom 

The rest of the series is:
Acked-by: Eric Engestrom 

You can also add the same change to Android:
8<
diff --git a/Android.common.mk b/Android.common.mk
index e3de1069dfad4277347c..d0e5d559da1a73cf9fa1 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -2,6 +2,7 @@
 LOCAL_CFLAGS += \
-DMAJOR_IN_SYSMACROS=1 \
-DHAVE_VISIBILITY=1 \
+   -fvisibility=hidden \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
 LOCAL_CFLAGS += \
>8

After that, the `drm_private` macro is ready to be removed :)

> 
> drm_private can also be removed from other symbols but it proved to be
> a lot of manual work to re-align all the fields, so I decided to leave
> it to be done on top as a cleanup.
> 
> There were lots of changes to param alignement that had to be done
> manually, I may have missed some.
> 
> Changes from v1:
>   - Include changes for all other sub-libraries
>   - Include changes to autotools
>   - Make main Makefil.am and meson.build define the required
> flag
> 
> This is build-tested locally and on gitlab:
> https://gitlab.freedesktop.org/demarchi/drm/pipelines/4339
> 
> Lucas De Marchi (13):
>   intel: annotate public functions
>   libkms: annotate public functions
>   nouveau: annotate public functions
>   libkms: annotate public functions
>   libdrm: annotate public functions
>   etnaviv: annotate public functions
>   freedreno: annotate public functions
>   omap: annotate public functions
>   radeon: annotate public functions
>   tegra: annotate public functions
>   exynos: annotate public functions
>   meson: make symbols hidden by default
>   autotools: make symbols hidden by default
> 
>  Makefile.am  |   1 +
>  amdgpu/Makefile.am   |   1 +
>  amdgpu/amdgpu_bo.c   | 104 ++--
>  amdgpu/amdgpu_cs.c   | 137 +++
>  amdgpu/amdgpu_device.c   |  19 ++-
>  amdgpu/amdgpu_gpu_info.c |  51 +++---
>  amdgpu/amdgpu_vamgr.c|  24 +--
>  amdgpu/amdgpu_vm.c   |   5 +-
>  amdgpu/meson.build   |   2 +-
>  etnaviv/Makefile.am  |   1 +
>  etnaviv/etnaviv_bo.c |  25 +--
>  etnaviv/etnaviv_cmd_stream.c |  21 ++-
>  etnaviv/etnaviv_device.c |  10 +-
>  etnaviv/etnaviv_gpu.c|   6 +-
>  etnaviv/etnaviv_perfmon.c|   8 +-
>  etnaviv/etnaviv_pipe.c   |   8 +-
>  etnaviv/meson.build  |   2 +-
>  exynos/Makefile.am   |   1 +
>  exynos/exynos_drm.c  |  30 ++--
>  exynos/exynos_fimg2d.c   |  20 +--
>  exynos/meson.build   |   2 +-
>  freedreno/Makefile.am|   1 +
>  freedreno/freedreno_bo.c |  32 ++--
>  freedreno/freedreno_device.c |  12 +-
>  freedreno/freedreno_pipe.c   |  14 +-
>  freedreno/freedreno_ringbuffer.c |  40 ++---
>  freedreno/meson.build|   2 +-
>  intel/Makefile.am|   1 +
>  intel/intel_bufmgr.c |  64 +++
>  intel/intel_bufmgr_fake.c|  10 +-
>  intel/intel_bufmgr_gem.c |  73 
>  intel/intel_decode.c |  14 +-
>  intel/meson.build|   4 +-
>  libdrm_macros.h  |   2 +
>  libkms/Makefile.am   |   1 +
>  libkms/api.c |  16 +-
>  libkms/meson.build   |   2 +-
>  meson.build  |   5 +-
>  nouveau/Makefile.am  |   1 +
>  nouveau/bufctx.c |  10 +-
>  nouveau/meson.build  |   2 +-
>  nouveau/nouveau.c|  50 +++---
>  nouveau/pushbuf.c|  18 +-
>  omap/Makefile.am |   1 +
>  omap/meson.build |   2 +-
>  omap/omap_drm.c  |  36 ++--
>  radeon/Makefile.am   |   1 +
>  radeon/meson.build   |   2 +-
>  radeon/radeon_bo.c   |  24 +--
>  radeon/radeon_bo_gem.c   |  16 +-
>  radeon/radeon_cs.c   |  24 +--
>  radeon/radeon_cs_gem.c   |   4 +-
>  radeon/radeon_cs_space.c |   6 +-
>  radeon/radeon_surface.c  |   8 +-
>  tegra/Makefile.am|   3 +-
>  tegra/meson.build|   2 +-
>  tegra/tegra.c|  26 +--
>  tests/Makefile

Re: [PATCH 0/2] intel: hide library symbols by default

2018-09-13 Thread Eric Engestrom
On Thursday, 2018-09-13 21:11:18 +0100, Eric Engestrom wrote:
> On Thursday, 2018-09-13 12:43:53 -0700, Lucas De Marchi wrote:
> > On 9/13/18 1:03 AM, Eric Engestrom wrote:
> > > On Wednesday, 2018-09-12 14:05:34 -0700, Lucas De Marchi wrote:
> > > > Rely on -fvisibility=hidden to hide the symbols. This only applies to
> > > > drm_intel.so sice there's no point in extending this if it receives a
> > > > nack for some reason. For the same reason, only done on meson as well.
> > > > 
> > > > drm_private can also be removed from other symbols. If this passes a
> > > > smoke test I'll add a patch on v2 doing so.
> > > 
> > > Series is
> > > Reviewed-by: Eric Engestrom 
> > > 
> > > but yeah, without that 3rd patch to remove drm_private it isn't all that
> > > useful :P
> > 
> > It actually is. It already closes the door for leaking internal symbols. the
> > drm_internal becomes a nop to be removed. I will include it in v2.
> 
> Ha, you're right, my bad :)
> You could land it as it then, and remove drm_private in a follow up patch.

Also: remember that before removing drm_private, you'll need to change
all the build systems to -fvisibility=hidden.

> 
> > 
> > > 
> > > Do you plan on converting the rest of libdrm if/when this gets accepted?
> > > It looks like you already got all the scripts ready to go ;)
> > 
> > I will take a look on including them for v2 already. I just wish I
> > remembered how to use coccinelle for source code transformation like this.
> > The commands above work ok, but there's some manual work to adapt for things
> > like "int\nfoo() { }" vs "int foo() { }".
> 
> Thanks!
> 
> > 
> > Lucas De Marchi
> > 
> > > 
> > > > 
> > > >  From git log archeology and mention in another thread we used to pass
> > > > -fvisibility=hidden, but reverted to the contrary due to bug in obscure
> > > > toolchain some years ago (see 0f8da82500ec542e269092c0718479e25eaff5f6).
> > > > I think it's time to revisit that decision: we have plenty of other
> > > > projects doing that nowadays without problem.
> > > > 
> > > > Lucas De Marchi (2):
> > > >intel: annotate public functions
> > > >meson: intel: make symbols hidden by default
> > > > 
> > > >   intel/intel_bufmgr.c  | 64 +-
> > > >   intel/intel_bufmgr_fake.c | 10 +++---
> > > >   intel/intel_bufmgr_gem.c  | 73 +++
> > > >   intel/intel_decode.c  | 14 
> > > >   intel/meson.build |  4 ++-
> > > >   libdrm_macros.h   |  2 ++
> > > >   6 files changed, 85 insertions(+), 82 deletions(-)
> > > > 
> > > > -- 
> > > > 2.17.1
> > > > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 0/2] intel: hide library symbols by default

2018-09-13 Thread Eric Engestrom
On Thursday, 2018-09-13 12:43:53 -0700, Lucas De Marchi wrote:
> On 9/13/18 1:03 AM, Eric Engestrom wrote:
> > On Wednesday, 2018-09-12 14:05:34 -0700, Lucas De Marchi wrote:
> > > Rely on -fvisibility=hidden to hide the symbols. This only applies to
> > > drm_intel.so sice there's no point in extending this if it receives a
> > > nack for some reason. For the same reason, only done on meson as well.
> > > 
> > > drm_private can also be removed from other symbols. If this passes a
> > > smoke test I'll add a patch on v2 doing so.
> > 
> > Series is
> > Reviewed-by: Eric Engestrom 
> > 
> > but yeah, without that 3rd patch to remove drm_private it isn't all that
> > useful :P
> 
> It actually is. It already closes the door for leaking internal symbols. the
> drm_internal becomes a nop to be removed. I will include it in v2.

Ha, you're right, my bad :)
You could land it as it then, and remove drm_private in a follow up patch.

> 
> > 
> > Do you plan on converting the rest of libdrm if/when this gets accepted?
> > It looks like you already got all the scripts ready to go ;)
> 
> I will take a look on including them for v2 already. I just wish I
> remembered how to use coccinelle for source code transformation like this.
> The commands above work ok, but there's some manual work to adapt for things
> like "int\nfoo() { }" vs "int foo() { }".

Thanks!

> 
> Lucas De Marchi
> 
> > 
> > > 
> > >  From git log archeology and mention in another thread we used to pass
> > > -fvisibility=hidden, but reverted to the contrary due to bug in obscure
> > > toolchain some years ago (see 0f8da82500ec542e269092c0718479e25eaff5f6).
> > > I think it's time to revisit that decision: we have plenty of other
> > > projects doing that nowadays without problem.
> > > 
> > > Lucas De Marchi (2):
> > >intel: annotate public functions
> > >meson: intel: make symbols hidden by default
> > > 
> > >   intel/intel_bufmgr.c  | 64 +-
> > >   intel/intel_bufmgr_fake.c | 10 +++---
> > >   intel/intel_bufmgr_gem.c  | 73 +++
> > >   intel/intel_decode.c  | 14 
> > >   intel/meson.build |  4 ++-
> > >   libdrm_macros.h   |  2 ++
> > >   6 files changed, 85 insertions(+), 82 deletions(-)
> > > 
> > > -- 
> > > 2.17.1
> > > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] intel: annotate the intel genx helpers as private

2018-09-13 Thread Eric Engestrom
On Thursday, 2018-09-13 10:43:04 -0700, Rodrigo Vivi wrote:
> On Thu, Sep 13, 2018 at 09:45:47AM +0100, Eric Engestrom wrote:
> > On Thursday, 2018-09-13 15:19:00 +0800, Chih-Wei Huang wrote:
> > > Note this patch breaks drm_gralloc:
> > > 
> > > FAILED: 
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/LINKED/libgralloc_drm.so
> > > /bin/bash -c "prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++
> > > -nostdlib -Wl,-soname,libgralloc_drm.so -Wl,--gc-sections -shared
> > > out/target/product/x86_64/obj_x86/lib/crtbegin_so.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_kms.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_intel.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_radeon.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_nouveau.o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_pipe.o
> > > -Wl,--whole-archive  -Wl,--no-whole-archive
> > > out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/libcompiler_rt-extras.a
> > >   
> > > out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libatomic_intermediates/libatomic.a
> > > out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libgcc_intermediates/libgcc.a
> > > -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5
> > > -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--gc-sections
> > > -Wl,--hash-style=gnu -Wl,--no-undefined-version -m32  -target
> > > i686-linux-android
> > > -Bprebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin
> > > -Wl,--no-undefined out/target/product/x86_64/obj_x86/lib/libdrm.so
> > > out/target/product/x86_64/obj_x86/lib/liblog.so
> > > out/target/product/x86_64/obj_x86/lib/libcutils.so
> > > out/target/product/x86_64/obj_x86/lib/libhardware_legacy.so
> > > out/target/product/x86_64/obj_x86/lib/libdrm_intel.so
> > > out/target/product/x86_64/obj_x86/lib/libdrm_radeon.so
> > > out/target/product/x86_64/obj_x86/lib/libdrm_nouveau.so
> > > out/target/product/x86_64/obj_x86/lib/libc++.so
> > > out/target/product/x86_64/obj_x86/lib/libc.so
> > > out/target/product/x86_64/obj_x86/lib/libm.so
> > > out/target/product/x86_64/obj_x86/lib/libdl.so -o
> > > out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/LINKED/libgralloc_drm.so
> > > out/target/product/x86_64/obj_x86/lib/crtend_so.o"
> > > external/drm_gralloc/gralloc_drm_intel.c:631: error: undefined
> > > reference to 'intel_is_genx'
> > > external/drm_gralloc/gralloc_drm_intel.c:630: error: undefined
> > > reference to 'intel_get_genx'
> > > clang.real: error: linker command failed with exit code 1 (use -v to
> > > see invocation)
> > > 
> > > 
> > > That's because drm_gralloc use the IS_GEN9 macro
> > > (and other IS_GEN{n} macros) directly.
> > 
> > Yeah, I thought some other stuff used the IS_GEN* macros ¯\_(ツ)_/¯
> > 
> > I assume my other patch ("intel: use drm namespace for exported functions",
> > https://patchwork.kernel.org/patch/10590653/) works fine with drm_gralloc?
> 
> What a castle of cards we have here
> 
> We should pick one build system and support only this one build system.

Deprecating autotools in libdrm is a worthwhile discussion, but it
should probably be its own thread, otherwise most people will miss it.

As for Android.mk, it isn't going anywhere in the near future; it would
require AOSP to support meson in their build system, or someone to write
a compatibility layer. There's already a thread somewhere on mesa-dev@
about this.

> 
> And the default build all should include tests. We shouldn't need a web
> remote CI to inform us that we could be breaking the build.

The CI runs the same tests you have locally ;)

> 
> When I pushed the first series I build locally using autotools and meson
> and everything passed locally.

`meson test` wouldn't have passed, but there is a bug in the autotools
test scripts that Emil has identified that made them not actually run...

> 
> But then gitlab CI warned that ninja buildir test fail...
> 
> Than Daniel requested to use gitlab fork to make sure we pass CI
> and here I 

Re: [PATCH libdrm] intel: annotate the intel genx helpers as private

2018-09-13 Thread Eric Engestrom
On Thursday, 2018-09-13 15:19:00 +0800, Chih-Wei Huang wrote:
> Note this patch breaks drm_gralloc:
> 
> FAILED: 
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/LINKED/libgralloc_drm.so
> /bin/bash -c "prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++
> -nostdlib -Wl,-soname,libgralloc_drm.so -Wl,--gc-sections -shared
> out/target/product/x86_64/obj_x86/lib/crtbegin_so.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_kms.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_intel.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_radeon.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_nouveau.o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/gralloc_drm_pipe.o
> -Wl,--whole-archive  -Wl,--no-whole-archive
> out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/libcompiler_rt-extras.a
>   
> out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libatomic_intermediates/libatomic.a
> out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libgcc_intermediates/libgcc.a
> -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5
> -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--gc-sections
> -Wl,--hash-style=gnu -Wl,--no-undefined-version -m32  -target
> i686-linux-android
> -Bprebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin
> -Wl,--no-undefined out/target/product/x86_64/obj_x86/lib/libdrm.so
> out/target/product/x86_64/obj_x86/lib/liblog.so
> out/target/product/x86_64/obj_x86/lib/libcutils.so
> out/target/product/x86_64/obj_x86/lib/libhardware_legacy.so
> out/target/product/x86_64/obj_x86/lib/libdrm_intel.so
> out/target/product/x86_64/obj_x86/lib/libdrm_radeon.so
> out/target/product/x86_64/obj_x86/lib/libdrm_nouveau.so
> out/target/product/x86_64/obj_x86/lib/libc++.so
> out/target/product/x86_64/obj_x86/lib/libc.so
> out/target/product/x86_64/obj_x86/lib/libm.so
> out/target/product/x86_64/obj_x86/lib/libdl.so -o
> out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libgralloc_drm_intermediates/LINKED/libgralloc_drm.so
> out/target/product/x86_64/obj_x86/lib/crtend_so.o"
> external/drm_gralloc/gralloc_drm_intel.c:631: error: undefined
> reference to 'intel_is_genx'
> external/drm_gralloc/gralloc_drm_intel.c:630: error: undefined
> reference to 'intel_get_genx'
> clang.real: error: linker command failed with exit code 1 (use -v to
> see invocation)
> 
> 
> That's because drm_gralloc use the IS_GEN9 macro
> (and other IS_GEN{n} macros) directly.

Yeah, I thought some other stuff used the IS_GEN* macros ¯\_(ツ)_/¯

I assume my other patch ("intel: use drm namespace for exported functions",
https://patchwork.kernel.org/patch/10590653/) works fine with drm_gralloc?

> 
> Since IS_GEN{n} are public APIs, I don't see
> the rationale of this change.
> Unless you are going to privatize all IS_GEN{n} macros.
> (are you?)
> 
> 
> 2018-09-13 0:03 GMT+08:00 Rodrigo Vivi :
> > On Wed, Sep 12, 2018 at 08:50:54AM -0700, Rodrigo Vivi wrote:
> >> From: Emil Velikov 
> >>
> >> They're used internally and never meant to be part of the API.
> >> Add the drm_private notation, which should resolve that.
> >>
> >> v2: (Rodrigo) Add missing include.
> >> v3: (Rodrigo) Keep includes grouped per Eric suggestion.
> >>
> >> Cc: Eric Engestrom 
> >> Cc: Lucas De Marchi 
> >> Cc: Chris Wilson 
> >> Cc: Rodrigo Vivi 
> >> Fixes: 4e81d4f9c9b ("intel: add generic functions to check PCI ID")
> >> Signed-off-by: Emil Velikov 
> >> Acked-by: Lucas De Marchi 
> >> Signed-off-by: Rodrigo Vivi 
> >> Reviewed-by: Eric Engestrom 
> >
> > And pushed...
> > thanks for patch, ack and review ;)
> >
> >> ---
> >>  intel/intel_chipset.c | 4 ++--
> >>  intel/intel_chipset.h | 5 +++--
> >>  2 files changed, 5 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
> >> index d5c33cc5..5aa4a2f2 100644
> >> --- a/intel/intel_chipset.c
> >> +++ b/intel/intel_chipset.c
> >> @@ -44,7 +44,7 @@ static const struct pci_device {
> >>   INTEL_SKL_IDS(9),
> >>  };
> >>
> >> -bool intel_is_genx(unsigned int devid, int gen)
> >> +drm_private bool intel_is_genx(unsigned int devid, in

Re: [PATCH 0/2] intel: hide library symbols by default

2018-09-13 Thread Eric Engestrom
On Wednesday, 2018-09-12 14:05:34 -0700, Lucas De Marchi wrote:
> Rely on -fvisibility=hidden to hide the symbols. This only applies to
> drm_intel.so sice there's no point in extending this if it receives a
> nack for some reason. For the same reason, only done on meson as well.
> 
> drm_private can also be removed from other symbols. If this passes a
> smoke test I'll add a patch on v2 doing so.

Series is
Reviewed-by: Eric Engestrom 

but yeah, without that 3rd patch to remove drm_private it isn't all that
useful :P

Do you plan on converting the rest of libdrm if/when this gets accepted?
It looks like you already got all the scripts ready to go ;)

> 
> From git log archeology and mention in another thread we used to pass
> -fvisibility=hidden, but reverted to the contrary due to bug in obscure
> toolchain some years ago (see 0f8da82500ec542e269092c0718479e25eaff5f6).
> I think it's time to revisit that decision: we have plenty of other
> projects doing that nowadays without problem.
> 
> Lucas De Marchi (2):
>   intel: annotate public functions
>   meson: intel: make symbols hidden by default
> 
>  intel/intel_bufmgr.c  | 64 +-
>  intel/intel_bufmgr_fake.c | 10 +++---
>  intel/intel_bufmgr_gem.c  | 73 +++
>  intel/intel_decode.c  | 14 
>  intel/meson.build |  4 ++-
>  libdrm_macros.h   |  2 ++
>  6 files changed, 85 insertions(+), 82 deletions(-)
> 
> -- 
> 2.17.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] intel: annotate the intel genx helpers as private

2018-09-12 Thread Eric Engestrom
On Tuesday, 2018-09-11 14:22:24 -0700, Rodrigo Vivi wrote:
> From: Emil Velikov 
> 
> They're used internally and never meant to be part of the API.
> Add the drm_private notation, which should resolve that.
> 
> v2: (Rodrigo) Add missing include.
> 
> Cc: Eric Engestrom 
> Cc: Lucas De Marchi 
> Cc: Chris Wilson 
> Cc: Rodrigo Vivi 
> Fixes: 4e81d4f9c9b ("intel: add generic functions to check PCI ID")
> Signed-off-by: Emil Velikov 
> Acked-by: Lucas De Marchi 
> Signed-off-by: Rodrigo Vivi 
> ---
>  intel/intel_chipset.c | 4 ++--
>  intel/intel_chipset.h | 6 --
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
> index d5c33cc5..5aa4a2f2 100644
> --- a/intel/intel_chipset.c
> +++ b/intel/intel_chipset.c
> @@ -44,7 +44,7 @@ static const struct pci_device {
>   INTEL_SKL_IDS(9),
>  };
>  
> -bool intel_is_genx(unsigned int devid, int gen)
> +drm_private bool intel_is_genx(unsigned int devid, int gen)
>  {
>   const struct pci_device *p,
> *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
> @@ -66,7 +66,7 @@ bool intel_is_genx(unsigned int devid, int gen)
>   return false;
>  }
>  
> -bool intel_get_genx(unsigned int devid, int *gen)
> +drm_private bool intel_get_genx(unsigned int devid, int *gen)
>  {
>   const struct pci_device *p,
> *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
> diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
> index 9b1e64f1..990a81e8 100644
> --- a/intel/intel_chipset.h
> +++ b/intel/intel_chipset.h
> @@ -28,6 +28,8 @@
>  #ifndef _INTEL_CHIPSET_H
>  #define _INTEL_CHIPSET_H
>  
> +#include 

Good catch on the missing #include :)
Might want to move it to keep it grouped with the other #include below,
but other than that:
Reviewed-by: Eric Engestrom 

> +
>  #define PCI_CHIP_I8100x7121
>  #define PCI_CHIP_I810_DC100  0x7123
>  #define PCI_CHIP_I810_E  0x7125
> @@ -330,8 +332,8 @@
>  /* New platforms use kernel pci ids */
>  #include 
>  
> -bool intel_is_genx(unsigned int devid, int gen);
> -bool intel_get_genx(unsigned int devid, int *gen);
> +drm_private bool intel_is_genx(unsigned int devid, int gen);
> +drm_private bool intel_get_genx(unsigned int devid, int *gen);
>  
>  #define IS_GEN9(devid) intel_is_genx(devid, 9)
>  #define IS_GEN10(devid) intel_is_genx(devid, 10)
> -- 
> 2.17.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm 1/2] automake: set NM before running the tests

2018-09-06 Thread Eric Engestrom
On Thursday, 2018-09-06 15:53:33 +0100, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Set/export the NM variable since it may not be set already.
> 
> Fixes: 4f08bfe96da ("*-symbol-check: Don't hard-code nm executable")
> Cc: Heiko Becker 
> Cc: Eric Engestrom 
> Signed-off-by: Emil Velikov 
> ---
>  amdgpu/Makefile.am| 1 +
>  etnaviv/Makefile.am   | 1 +
>  exynos/Makefile.am| 1 +
>  freedreno/Makefile.am | 1 +
>  intel/Makefile.am | 1 +
>  libkms/Makefile.am| 1 +
>  nouveau/Makefile.am   | 1 +
>  omap/Makefile.am  | 1 +
>  radeon/Makefile.am| 1 +
>  tegra/Makefile.am | 1 +
>  10 files changed, 10 insertions(+)
> 
> diff --git a/amdgpu/Makefile.am b/amdgpu/Makefile.am
> index a1b0d05c..1a8538f5 100644
> --- a/amdgpu/Makefile.am
> +++ b/amdgpu/Makefile.am
> @@ -47,5 +47,6 @@ libdrm_amdgpuinclude_HEADERS = $(LIBDRM_AMDGPU_H_FILES)
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_amdgpu.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'

I thought only double-quotes worked for this?
If this works, series is:
Reviewed-by: Eric Engestrom 

>  TESTS = amdgpu-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/etnaviv/Makefile.am b/etnaviv/Makefile.am
> index be96ba86..38ed1717 100644
> --- a/etnaviv/Makefile.am
> +++ b/etnaviv/Makefile.am
> @@ -22,5 +22,6 @@ libdrm_etnavivinclude_HEADERS = $(LIBDRM_ETNAVIV_H_FILES)
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_etnaviv.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = etnaviv-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/exynos/Makefile.am b/exynos/Makefile.am
> index f99f8981..c1dda663 100644
> --- a/exynos/Makefile.am
> +++ b/exynos/Makefile.am
> @@ -23,5 +23,6 @@ libdrm_exynosinclude_HEADERS = exynos_drmif.h
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_exynos.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = exynos-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am
> index cbb0d031..f4f0bafe 100644
> --- a/freedreno/Makefile.am
> +++ b/freedreno/Makefile.am
> @@ -27,5 +27,6 @@ libdrm_freedrenocommoninclude_HEADERS = 
> $(LIBDRM_FREEDRENO_H_FILES)
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_freedreno.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = freedreno-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/intel/Makefile.am b/intel/Makefile.am
> index c52e8c08..acedb795 100644
> --- a/intel/Makefile.am
> +++ b/intel/Makefile.am
> @@ -56,6 +56,7 @@ BATCHES = \
>   tests/gen7-2d-copy.batch \
>   tests/gen7-3d.batch
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = \
>   $(BATCHES:.batch=.batch.sh) \
>   intel-symbol-check
> diff --git a/libkms/Makefile.am b/libkms/Makefile.am
> index 461fc35b..cd273fa7 100644
> --- a/libkms/Makefile.am
> +++ b/libkms/Makefile.am
> @@ -39,5 +39,6 @@ libkmsinclude_HEADERS = $(LIBKMS_H_FILES)
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libkms.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = kms-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/nouveau/Makefile.am b/nouveau/Makefile.am
> index 344a8445..9f61491b 100644
> --- a/nouveau/Makefile.am
> +++ b/nouveau/Makefile.am
> @@ -29,5 +29,6 @@ libdrm_nouveaunvifinclude_HEADERS = nvif/class.h \
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_nouveau.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = nouveau-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/omap/Makefile.am b/omap/Makefile.am
> index 599bb9de..56257c89 100644
> --- a/omap/Makefile.am
> +++ b/omap/Makefile.am
> @@ -20,5 +20,6 @@ libdrm_omapinclude_HEADERS = omap_drmif.h
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_omap.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = omap-symbol-check
>  EXTRA_DIST = $(TESTS)
> diff --git a/radeon/Makefile.am b/radeon/Makefile.am
> index e2415314..0f5f94a1 100644
> --- a/radeon/Makefile.am
> +++ b/radeon/Makefile.am
> @@ -43,5 +43,6 @@ libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES)
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_radeon.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = radeon-symbol-check
>  EXTRA_DIST = $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
> diff --git a/tegra/Makefile.am b/tegra/Makefile.am
> index fb40be55..92b2ce2a 100644
> --- a/tegra/Makefile.am
> +++ b/tegra/Makefile.am
> @@ -21,5 +21,6 @@ libdrm_tegrainclude_HEADERS = tegra.h
>  pkgconfigdir = @pkgconfigdir@
>  pkgconfig_DATA = libdrm_tegra.pc
>  
> +AM_TESTS_ENVIRONMENT = NM='$(NM)'
>  TESTS = tegra-symbol-check
>  EXTRA_DIST = $(TESTS)
> -- 
> 2.18.0
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH libdrm] gitlab-ci: use variables to deduplicate the build commands

2018-09-06 Thread Eric Engestrom
On Thursday, 2018-09-06 16:01:15 +0100, Emil Velikov wrote:
> On 6 September 2018 at 14:40, Eric Engestrom  wrote:
> > Signed-off-by: Eric Engestrom 
> > ---
> >  .gitlab-ci.yml | 129 ++---
> >  1 file changed, 47 insertions(+), 82 deletions(-)
> >
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index eee6abfcdd7de2839660..1dc434a5d359b3b077e7 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -1,3 +1,46 @@
> > +.meson-build: &meson-build
> 
> Gitlab calls these templates, not variables. With that fixed
> Reviewed-by: Emil Velikov 

Thanks, I should've looked that up :]
Fixed and pushed.

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


[PATCH libdrm] intel: use drm namespace for exported functions

2018-09-06 Thread Eric Engestrom
And add them to the list of exported function to fix the tests.

Fixes: 4e81d4f9c9b7fd6510cf "intel: add generic functions to check PCI ID"
Cc: Lucas De Marchi 
Cc: Rodrigo Vivi 
Signed-off-by: Eric Engestrom 
---
Lucas, I'm assuming you meant to export those functions (and macros,
like `IS_GEN11()`), right?
If so, you need to namespace them, and add them to the list of allowed
exports.
---
 intel/intel-symbol-check |  2 ++
 intel/intel_bufmgr_gem.c |  2 +-
 intel/intel_chipset.c|  4 ++--
 intel/intel_chipset.h| 12 ++--
 intel/intel_decode.c |  2 +-
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/intel/intel-symbol-check b/intel/intel-symbol-check
index 4d30a4b15feb94e9523d..339240a1bce7f9673cd3 100755
--- a/intel/intel-symbol-check
+++ b/intel/intel-symbol-check
@@ -87,11 +87,13 @@ drm_intel_gem_context_destroy
 drm_intel_gem_context_get_id
 drm_intel_get_aperture_sizes
 drm_intel_get_eu_total
+drm_intel_get_genx
 drm_intel_get_min_eu_in_pool
 drm_intel_get_pipe_from_crtc_id
 drm_intel_get_pooled_eu
 drm_intel_get_reset_stats
 drm_intel_get_subslice_total
+drm_intel_is_genx
 drm_intel_reg_read
 EOF
 done)
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index d6587b76ac004aa4a5a5..3190cb249acda0ae19ab 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3656,7 +3656,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
bufmgr_gem->gen = 7;
else if (IS_GEN8(bufmgr_gem->pci_device))
bufmgr_gem->gen = 8;
-   else if (!intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
+   else if (!drm_intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) 
{
free(bufmgr_gem);
bufmgr_gem = NULL;
goto exit;
diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
index d5c33cc59002e1f150e8..89f69ed9e6ed67d8c3fc 100644
--- a/intel/intel_chipset.c
+++ b/intel/intel_chipset.c
@@ -44,7 +44,7 @@ static const struct pci_device {
INTEL_SKL_IDS(9),
 };
 
-bool intel_is_genx(unsigned int devid, int gen)
+bool drm_intel_is_genx(unsigned int devid, int gen)
 {
const struct pci_device *p,
  *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
@@ -66,7 +66,7 @@ bool intel_is_genx(unsigned int devid, int gen)
return false;
 }
 
-bool intel_get_genx(unsigned int devid, int *gen)
+bool drm_intel_get_genx(unsigned int devid, int *gen)
 {
const struct pci_device *p,
  *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 9b1e64f1f4bd19b3cf38..01488be2fb34fd08a876 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -330,12 +330,12 @@
 /* New platforms use kernel pci ids */
 #include 
 
-bool intel_is_genx(unsigned int devid, int gen);
-bool intel_get_genx(unsigned int devid, int *gen);
+bool drm_intel_is_genx(unsigned int devid, int gen);
+bool drm_intel_get_genx(unsigned int devid, int *gen);
 
-#define IS_GEN9(devid) intel_is_genx(devid, 9)
-#define IS_GEN10(devid) intel_is_genx(devid, 10)
-#define IS_GEN11(devid) intel_is_genx(devid, 11)
+#define IS_GEN9(devid) drm_intel_is_genx(devid, 9)
+#define IS_GEN10(devid) drm_intel_is_genx(devid, 10)
+#define IS_GEN11(devid) drm_intel_is_genx(devid, 11)
 
 #define IS_9XX(dev)(IS_GEN3(dev) || \
 IS_GEN4(dev) || \
@@ -343,6 +343,6 @@ bool intel_get_genx(unsigned int devid, int *gen);
 IS_GEN6(dev) || \
 IS_GEN7(dev) || \
 IS_GEN8(dev) || \
-intel_get_genx(dev, NULL))
+drm_intel_get_genx(dev, NULL))
 
 #endif /* _INTEL_CHIPSET_H */
diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index 0ff095bc6285d03f4fed..4a493cbfa8f84591b994 100644
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
@@ -3823,7 +3823,7 @@ drm_intel_decode_context_alloc(uint32_t devid)
ctx->devid = devid;
ctx->out = stdout;
 
-   if (intel_get_genx(devid, &ctx->gen))
+   if (drm_intel_get_genx(devid, &ctx->gen))
;
else if (IS_GEN8(devid))
ctx->gen = 8;
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH libdrm] gitlab-ci: use variables to deduplicate the build commands

2018-09-06 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 .gitlab-ci.yml | 129 ++---
 1 file changed, 47 insertions(+), 82 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eee6abfcdd7de2839660..1dc434a5d359b3b077e7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,46 @@
+.meson-build: &meson-build
+  - meson _build
+  -D amdgpu=true
+  -D cairo-tests=true
+  -D etnaviv=true
+  -D exynos=true
+  -D freedreno=true
+  -D freedreno-kgsl=true
+  -D intel=true
+  -D libkms=true
+  -D man-pages=true
+  -D nouveau=true
+  -D omap=true
+  -D radeon=true
+  -D tegra=true
+  -D udev=true
+  -D valgrind=true
+  -D vc4=true
+  -D vmwgfx=true
+  - ninja -C _build
+  - ninja -C _build test
+
+.autotools-build: &autotools-build
+  - mkdir _build
+  - cd _build
+  - ../autogen.sh
+  --enable-udev
+  --enable-libkms
+  --enable-intel
+  --enable-radeon
+  --enable-admgpu
+  --enable-nouveau
+  --enable-vmwfgx
+  --enable-omap-experimental-api
+  --enable-exynos-experimental-api
+  --enable-freedreno
+  --enable-freedreno-kgsl
+  --enable-tegra-experimental-api
+  --enable-vc4
+  --enable-etnaviv-experimental-api
+  - make
+  - make check
+
 latest-meson:
   stage: build
   image: base/archlinux:latest
@@ -10,27 +53,7 @@ latest-meson:
 valgrind
 libatomic_ops
 cairo cunit
-  script:
-- meson _build
--D amdgpu=true
--D cairo-tests=true
--D etnaviv=true
--D exynos=true
--D freedreno=true
--D freedreno-kgsl=true
--D intel=true
--D libkms=true
--D man-pages=true
--D nouveau=true
--D omap=true
--D radeon=true
--D tegra=true
--D udev=true
--D valgrind=true
--D vc4=true
--D vmwgfx=true
-- ninja -C _build
-- ninja -C _build test
+  script: *meson-build
 
 latest-autotools:
   stage: build
@@ -45,26 +68,7 @@ latest-autotools:
 cairo cunit
 xorg-util-macros
 git # autogen.sh depends on git
-  script:
-- mkdir _build
-- cd _build
-- ../autogen.sh
---enable-udev
---enable-libkms
---enable-intel
---enable-radeon
---enable-admgpu
---enable-nouveau
---enable-vmwfgx
---enable-omap-experimental-api
---enable-exynos-experimental-api
---enable-freedreno
---enable-freedreno-kgsl
---enable-tegra-experimental-api
---enable-vc4
---enable-etnaviv-experimental-api
-- make
-- make check
+  script: *autotools-build
 
 oldest-meson:
   stage: build
@@ -98,29 +102,9 @@ oldest-meson:
   (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make 
install)
 - pip3 install wheel setuptools
 - pip3 install meson==0.43
-  script:
 - export 
PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
 - export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
-- meson _build
--D amdgpu=true
--D cairo-tests=true
--D etnaviv=true
--D exynos=true
--D freedreno=true
--D freedreno-kgsl=true
--D intel=true
--D libkms=true
--D man-pages=true
--D nouveau=true
--D omap=true
--D radeon=true
--D tegra=true
--D udev=true
--D valgrind=true
--D vc4=true
--D vmwgfx=true
-- ninja -C _build
-- ninja -C _build test
+  script: *meson-build
 
 oldest-autotools:
   stage: build
@@ -155,25 +139,6 @@ oldest-autotools:
   wget --no-check-certificate 
https://xorg.freedesktop.org/releases/individual/lib/$LIBPCIACCESS_VERSION.tar.bz2
 &&
   tar -jxvf $LIBPCIACCESS_VERSION.tar.bz2 &&
   (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make 
install)
-  script:
 - export 
PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
 - export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
-- mkdir _build
-- cd _build
-- ../autogen.sh
---enable-udev
---enable-libkms
---enable-intel
---enable-radeon
---enable-admgpu
---enable-nouveau
---enable-vmwfgx
---enable-omap-experimental-api
---enable-exynos-experimental-api
---enable-freedreno
---enable-freedreno-kgsl
---enable-tegra-experimental-api
---enable-vc4
---enable-etnaviv-experimental-api
-- make
-- make check
+  script: *autotools-build
-- 
Cheers,
  Eric

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   3   4   5   >