From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH v2] drm/i915: add register read IOCTL Date: Wed, 18 Jul 2012 10:22:01 -0700 Message-ID: <20120718102201.3d1b0b57@bwidawsk.net> References: <1342051656-32481-1-git-send-email-ben@bwidawsk.net> <1342116066-12164-1-git-send-email-ben@bwidawsk.net> <87pq7txa7t.fsf@eliezer.anholt.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 63C549E76D for ; Wed, 18 Jul 2012 10:22:12 -0700 (PDT) In-Reply-To: <87pq7txa7t.fsf@eliezer.anholt.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Eric Anholt Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 18 Jul 2012 10:14:46 -0700 Eric Anholt wrote: > Ben Widawsky writes: > > > The interface's immediate purpose is to do synchronous timestamp queries > > as required by GL_TIMESTAMP. The GPU has a register for reading the > > timestamp but because that would normally require root access through > > libpciaccess, the IOCTL can provide this service instead. > > > > Currently the implementation whitelists only the render ring timestamp > > register, because that is the only thing we need to expose at this time. > > > > v2: make size implicit based on the register offset > > Add a generation check > > > diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h > > index 8cc7083..fbe7757 100644 > > --- a/include/drm/i915_drm.h > > +++ b/include/drm/i915_drm.h > > @@ -203,6 +203,7 @@ typedef struct _drm_i915_sarea { > > #define DRM_I915_GEM_WAIT 0x2c > > #define DRM_I915_GEM_CONTEXT_CREATE 0x2d > > #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e > > +#define DRM_I915_REG_READ 0x30 > > Is 0x2f some other outstanding ioctl? > I was saving it for some yet to be realized context ioctl. We can use 0x2f, I don't care. Daniel - feel free to change it or not as you please when/if you suck it in. > Other than that, > > Reviewed-by: Eric Anholt > > Note: we have requests both by Arjan and by Valve for the functionality > that this patch will allow. -- Ben Widawsky, Intel Open Source Technology Center