public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [RFC] libdrm_intel: Add support for userptr objects
Date: Mon, 5 May 2014 11:35:11 +0200	[thread overview]
Message-ID: <20140505093511.GI20800@phenom.ffwll.local> (raw)
In-Reply-To: <20140502171527.GB11639@bwidawsk.net>

On Fri, May 02, 2014 at 10:15:30AM -0700, Ben Widawsky wrote:
> On Fri, May 02, 2014 at 11:27:45AM +0100, Tvrtko Ursulin wrote:
> > 
> > On 05/01/2014 07:47 PM, Ben Widawsky wrote:
> > >On Wed, Feb 26, 2014 at 04:41:41PM +0000, Tvrtko Ursulin wrote:
> > >>From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > >>
> > >>Allow userptr objects to be created and used via libdrm_intel.
> > >>
> > >>At the moment tiling and mapping to GTT aperture is not supported
> > >>due hardware limitations across different generations and uncertainty
> > >>about its usefulness.
> > >>
> > >>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > >>---
> > >>  include/drm/i915_drm.h    |  16 +++++
> > >>  intel/intel_bufmgr.c      |  13 ++++
> > >>  intel/intel_bufmgr.h      |   5 ++
> > >>  intel/intel_bufmgr_gem.c  | 154 +++++++++++++++++++++++++++++++++++++++++++++-
> > >>  intel/intel_bufmgr_priv.h |  12 +++-
> > >>  5 files changed, 198 insertions(+), 2 deletions(-)
> > >>
> > >>diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
> > >>index 2f4eb8c..d32ef99 100644
> > >>--- a/include/drm/i915_drm.h
> > >>+++ b/include/drm/i915_drm.h
> > >>@@ -223,6 +223,7 @@ typedef struct _drm_i915_sarea {
> > >>  #define DRM_I915_GEM_GET_CACHING	0x30
> > >>  #define DRM_I915_REG_READ		0x31
> > >>  #define DRM_I915_GET_RESET_STATS	0x32
> > >>+#define DRM_I915_GEM_USERPTR		0x34
> > >>
> > >>  #define DRM_IOCTL_I915_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
> > >>  #define DRM_IOCTL_I915_FLUSH		DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
> > >>@@ -273,6 +274,7 @@ typedef struct _drm_i915_sarea {
> > >>  #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
> > >>  #define DRM_IOCTL_I915_REG_READ			DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
> > >>  #define DRM_IOCTL_I915_GET_RESET_STATS		DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
> > >>+#define DRM_IOCTL_I915_GEM_USERPTR	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR,  struct drm_i915_gem_userptr)
> > >>
> > >>  /* Allow drivers to submit batchbuffers directly to hardware, relying
> > >>   * on the security mechanisms provided by hardware.
> > >>@@ -498,6 +500,20 @@ struct drm_i915_gem_mmap_gtt {
> > >>  	__u64 offset;
> > >>  };
> > >>
> > >>+struct drm_i915_gem_userptr {
> > >>+	__u64 user_ptr;
> > >>+	__u64 user_size;
> > >
> > >Adding alignment might be a safe bet.
> > 
> > Hmmmm, at first I thought you are raising a good point. But then I don't
> > understand why I don't see any aligned types in
> > linux/include/uapi/drm/i915_drm.h ?
> 
> I meant an alignment field. I was thinking if some buffers have weird
> alignment requirements for the GPU (but not the CPU) making that info
> available to the kernel would be important.

We have a flags param and we can always extend the ioctl at the end, so
imo no need to preemptively add stuff we don't need yet.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-05-05  9:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 16:41 [RFC] libdrm_intel: Add support for userptr objects Tvrtko Ursulin
2014-05-01 18:47 ` Ben Widawsky
2014-05-02 10:27   ` Tvrtko Ursulin
2014-05-02 17:15     ` Ben Widawsky
2014-05-05  9:35       ` Daniel Vetter [this message]
2014-05-07 10:33       ` Tvrtko Ursulin
2014-05-09  0:10 ` Ben Widawsky
2014-05-09  5:30   ` Chris Wilson
2014-05-12 16:00     ` Daniel Vetter
2014-06-19 11:13 ` Damien Lespiau
2014-06-19 11:27   ` Damien Lespiau
2014-07-09 13:08   ` Tvrtko Ursulin
2014-07-09 13:16     ` Damien Lespiau
2014-07-09 14:25       ` Daniel Vetter
2014-07-09 14:47         ` Chris Wilson
2014-06-19 14:52 ` [PATCH] intel: " Tvrtko Ursulin
2014-09-17 11:26   ` Damien Lespiau

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=20140505093511.GI20800@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=ben@bwidawsk.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox