Marcin KoĆcielnicki
2010-May-23 11:36 UTC
[Nouveau] [PATCH v2] drm/nouveau: Add getparam for current PTIMER time.
This will be useful for computing GPU-CPU latency, including GL_ARB_timer_query extension. Signed-off-by: Marcin Ko?cielnicki <koriakin at 0x04.net> --- drivers/gpu/drm/nouveau/nouveau_state.c | 3 +++ include/drm/nouveau_drm.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index e171064..b793880 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -859,6 +859,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, case NOUVEAU_GETPARAM_VM_VRAM_BASE: getparam->value = dev_priv->vm_vram_base; break; + case NOUVEAU_GETPARAM_PTIMER_TIME: + getparam->value = dev_priv->engine.timer.read(dev); + break; case NOUVEAU_GETPARAM_GRAPH_UNITS: /* NV40 and NV50 versions are quite different, but register * address is the same. User is supposed to know the card diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index 5792feb..6589261 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h @@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free { #define NOUVEAU_GETPARAM_CHIPSET_ID 11 #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 +#define NOUVEAU_GETPARAM_PTIMER_TIME 14 struct drm_nouveau_getparam { uint64_t param; uint64_t value; -- 1.7.0.2
Ben Skeggs
2010-May-24 02:02 UTC
[Nouveau] [PATCH v2] drm/nouveau: Add getparam for current PTIMER time.
On Sun, 2010-05-23 at 11:36 +0000, Marcin Ko?cielnicki wrote:> This will be useful for computing GPU-CPU latency, including > GL_ARB_timer_query extension.Looks fine, just a quick question as to whether this is necessary? I seem to recall that on nv40, the QUERY methods actually return timestamps in the "notifier" that one would assume are from PTIMER. Is there some way to do this on G80+ also? Ben.> > Signed-off-by: Marcin Ko?cielnicki <koriakin at 0x04.net> > --- > drivers/gpu/drm/nouveau/nouveau_state.c | 3 +++ > include/drm/nouveau_drm.h | 1 + > 2 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c > index e171064..b793880 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_state.c > +++ b/drivers/gpu/drm/nouveau/nouveau_state.c > @@ -859,6 +859,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, > case NOUVEAU_GETPARAM_VM_VRAM_BASE: > getparam->value = dev_priv->vm_vram_base; > break; > + case NOUVEAU_GETPARAM_PTIMER_TIME: > + getparam->value = dev_priv->engine.timer.read(dev); > + break; > case NOUVEAU_GETPARAM_GRAPH_UNITS: > /* NV40 and NV50 versions are quite different, but register > * address is the same. User is supposed to know the card > diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h > index 5792feb..6589261 100644 > --- a/include/drm/nouveau_drm.h > +++ b/include/drm/nouveau_drm.h > @@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free { > #define NOUVEAU_GETPARAM_CHIPSET_ID 11 > #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 > #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 > +#define NOUVEAU_GETPARAM_PTIMER_TIME 14 > struct drm_nouveau_getparam { > uint64_t param; > uint64_t value;