drm/nouveau: Add getparam for current PTIMER time.
authorMarcin Kościelnicki <koriakin@0x04.net>
Sun, 23 May 2010 11:36:04 +0000 (11:36 +0000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 May 2010 06:06:21 +0000 (16:06 +1000)
This will be useful for computing GPU-CPU latency, including
GL_ARB_timer_query extension.

Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_state.c
include/drm/nouveau_drm.h

index e632339c323e5bd03efe592f554875117322b7b1..a2544ffd02cc8ecedea168563e166876dce9bf0f 100644 (file)
@@ -913,6 +913,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
index a6a9f4af5ebd8257d92dcd592551b6fb05f91931..fe917dee723a7357f44c285626189ae7acd5e863 100644 (file)
@@ -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;