All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Cc: Thomas Hellstrom <thellstrom@vmware.com>,
	"moderated list:ARM/S5P EXYNOS AR..."
	<linux-samsung-soc@vger.kernel.org>,
	Emil Velikov <emil.l.velikov@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH 2/5] exynos: add EXYNOS_G2D_EVENT to drmHandleEvent
Date: Sun, 29 Mar 2015 20:02:39 -0400	[thread overview]
Message-ID: <CAF6AEGsZdV3CrdnNUVEeaNyxq6H6ZUdCte17-NRSHhS7kZL2tQ@mail.gmail.com> (raw)
In-Reply-To: <1426890348-12807-3-git-send-email-tjakobi@math.uni-bielefeld.de>

so, iirc, vmwgfx also has some custom events..  not really sure if
they have their own hand-rolled drmHandleEvent() or if they have
another way of catching those.

Maybe we need some more flexible way to register handlers for driver
custom events?  But everyone adding their own thing to
drmHandleEvent() doesn't really seem so nice..  that said, I'm not
sure how much to care.  If it is just exynos and vmwgfx, then telling
them to use there own version of of drmHandleEvent() might be ok.  But
if driver custom events somehow become more popular, maybe we want a
better solution..

BR,
-R

On Fri, Mar 20, 2015 at 6:25 PM, Tobias Jakobi
<tjakobi@math.uni-bielefeld.de> wrote:
> This event is specific to Exynos G2D DRM driver. Only
> process it when Exynos support is enabled.
>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  exynos/exynos_drm.h | 12 ++++++++++++
>  xf86drm.h           |  7 ++++++-
>  xf86drmMode.c       | 18 ++++++++++++++++++
>  3 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/exynos/exynos_drm.h b/exynos/exynos_drm.h
> index 256c02f..c3af0ac 100644
> --- a/exynos/exynos_drm.h
> +++ b/exynos/exynos_drm.h
> @@ -157,4 +157,16 @@ struct drm_exynos_g2d_exec {
>  #define DRM_IOCTL_EXYNOS_G2D_EXEC              DRM_IOWR(DRM_COMMAND_BASE + \
>                 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
>
> +/* EXYNOS specific events */
> +#define DRM_EXYNOS_G2D_EVENT           0x80000000
> +
> +struct drm_exynos_g2d_event {
> +       struct drm_event        base;
> +       __u64                           user_data;
> +       __u32                           tv_sec;
> +       __u32                           tv_usec;
> +       __u32                           cmdlist_no;
> +       __u32                           reserved;
> +};
> +
>  #endif
> diff --git a/xf86drm.h b/xf86drm.h
> index 40c55c9..6b1c9b4 100644
> --- a/xf86drm.h
> +++ b/xf86drm.h
> @@ -719,7 +719,7 @@ extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2);
>  extern int drmSetMaster(int fd);
>  extern int drmDropMaster(int fd);
>
> -#define DRM_EVENT_CONTEXT_VERSION 2
> +#define DRM_EVENT_CONTEXT_VERSION 3
>
>  typedef struct _drmEventContext {
>
> @@ -739,6 +739,11 @@ typedef struct _drmEventContext {
>                                   unsigned int tv_usec,
>                                   void *user_data);
>
> +       void (*g2d_event_handler)(int fd,
> +                                 unsigned int cmdlist_no,
> +                                 unsigned int tv_sec,
> +                                 unsigned int tv_usec,
> +                                 void *user_data);
>  } drmEventContext, *drmEventContextPtr;
>
>  extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
> diff --git a/xf86drmMode.c b/xf86drmMode.c
> index 61d5e01..d9f2898 100644
> --- a/xf86drmMode.c
> +++ b/xf86drmMode.c
> @@ -53,6 +53,10 @@
>  #include <unistd.h>
>  #include <errno.h>
>
> +#ifdef HAVE_EXYNOS
> +#include <exynos/exynos_drm.h>
> +#endif
> +
>  #ifdef HAVE_VALGRIND
>  #include <valgrind.h>
>  #include <memcheck.h>
> @@ -846,6 +850,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
>         int len, i;
>         struct drm_event *e;
>         struct drm_event_vblank *vblank;
> +       struct drm_exynos_g2d_event *g2d;
>
>         /* The DRM read semantics guarantees that we always get only
>          * complete events. */
> @@ -882,6 +887,19 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
>                                                  vblank->tv_usec,
>                                                  U642VOID (vblank->user_data));
>                         break;
> +#ifdef HAVE_EXYNOS
> +               case DRM_EXYNOS_G2D_EVENT:
> +                       if (evctx->version < 3 ||
> +                           evctx->g2d_event_handler == NULL)
> +                               break;
> +                       g2d = (struct drm_exynos_g2d_event *) e;
> +                       evctx->g2d_event_handler(fd,
> +                                                g2d->cmdlist_no,
> +                                                g2d->tv_sec,
> +                                                g2d->tv_usec,
> +                                                U642VOID (g2d->user_data));
> +                       break;
> +#endif
>                 default:
>                         break;
>                 }
> --
> 2.0.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-03-30  0:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 22:25 drm/exynos: add async G2D execution to libdrm Tobias Jakobi
2015-03-20 22:25 ` [PATCH 1/5] tests/exynos: add fimg2d performance analysis Tobias Jakobi
2015-03-22 15:36   ` Emil Velikov
2015-03-22 16:35     ` Tobias Jakobi
2015-03-25 18:27       ` Tobias Jakobi
2015-03-26 15:16         ` Emil Velikov
2015-03-20 22:25 ` [PATCH 2/5] exynos: add EXYNOS_G2D_EVENT to drmHandleEvent Tobias Jakobi
2015-03-22 15:41   ` Emil Velikov
2015-03-22 16:29     ` Tobias Jakobi
2015-03-23 11:03       ` Emil Velikov
2015-03-30  0:02   ` Rob Clark [this message]
2015-03-30 11:37     ` Tobias Jakobi
2015-03-30 13:04     ` Tobias Jakobi
2015-04-21 18:14       ` Emil Velikov
2015-04-23 12:04         ` Tobias Jakobi
2015-03-20 22:25 ` [PATCH 3/5] exynos/fimg2d: add g2d_config_event Tobias Jakobi
2015-03-21 14:03 ` drm/exynos: add async G2D execution to libdrm Tobias Jakobi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAF6AEGsZdV3CrdnNUVEeaNyxq6H6ZUdCte17-NRSHhS7kZL2tQ@mail.gmail.com \
    --to=robdclark@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=thellstrom@vmware.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.