All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tiago Vignatti <tiago.vignatti@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org, daniel.thompson@linaro.org,
	daniel.vetter@ffwll.ch, thellstrom@vmware.com,
	jglisse@redhat.com, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 3/6] dma-buf: Add ioctls to allow userspace to flush
Date: Thu, 27 Aug 2015 16:58:40 -0300	[thread overview]
Message-ID: <55DF6BF0.7030904@intel.com> (raw)
In-Reply-To: <20150827080355.GL17184@nuc-i3427.alporthouse.com>

On 08/27/2015 05:03 AM, Chris Wilson wrote:
> On Wed, Aug 26, 2015 at 08:29:15PM -0300, Tiago Vignatti wrote:
>> +#ifndef _DMA_BUF_UAPI_H_
>> +#define _DMA_BUF_UAPI_H_
>> +
>> +enum dma_buf_sync_flags {
>> +	DMA_BUF_SYNC_READ = (1 << 0),
>> +	DMA_BUF_SYNC_WRITE = (2 << 0),
>> +	DMA_BUF_SYNC_RW = (3 << 0),
>> +	DMA_BUF_SYNC_START = (0 << 2),
>> +	DMA_BUF_SYNC_END = (1 << 2),
>> +
>> +	DMA_BUF_SYNC_VALID_FLAGS_MASK = DMA_BUF_SYNC_RW |
>> +		DMA_BUF_SYNC_END
>> +};
>> +
>> +/* begin/end dma-buf functions used for userspace mmap. */
>> +struct dma_buf_sync {
>> +	enum dma_buf_sync_flags flags;
>
> It is better to use explicitly sized types. And since this is not 64b
> padded, probably best to add that padding now.

ahh, I've changed it to use enum instead. If I rollback to use defines 
then do you think works better? Like this:

struct dma_buf_sync {
   __u64 flags;
};

#define DMA_BUF_SYNC_READ      (1 << 0)
#define DMA_BUF_SYNC_WRITE     (2 << 0)
#define DMA_BUF_SYNC_RW        (3 << 0)
#define DMA_BUF_SYNC_START     (0 << 2)
#define DMA_BUF_SYNC_END       (1 << 2)
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
   (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)

#define DMA_BUF_BASE    'b'
#define DMA_BUF_IOCTL_SYNC  _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-08-27 19:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 23:29 [PATCH v5] mmap on the dma-buf directly Tiago Vignatti
2015-08-26 23:29 ` [PATCH 1/6] drm: prime: Honour O_RDWR during prime-handle-to-fd Tiago Vignatti
2015-08-27 16:36   ` Emil Velikov
2015-08-27 18:19     ` Tiago Vignatti
2015-08-26 23:29 ` [PATCH 2/6] dma-buf: Remove range-based flush Tiago Vignatti
2015-08-26 23:29 ` [PATCH 3/6] dma-buf: Add ioctls to allow userspace to flush Tiago Vignatti
2015-08-27  8:03   ` Chris Wilson
2015-08-27 19:58     ` Tiago Vignatti [this message]
2015-08-27 12:06   ` Hwang, Dongseong
2015-08-27 19:53     ` Tiago Vignatti
2015-08-26 23:29 ` [PATCH 4/6] dma-buf: DRAFT: Make SYNC mandatory when userspace mmap Tiago Vignatti
2015-08-26 23:29 ` [PATCH 5/6] drm/i915: Implement end_cpu_access Tiago Vignatti
2015-08-26 23:29 ` [PATCH 6/6] drm/i915: Use CPU mapping for userspace dma-buf mmap() Tiago Vignatti

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=55DF6BF0.7030904@intel.com \
    --to=tiago.vignatti@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.thompson@linaro.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --cc=thellstrom@vmware.com \
    /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.