diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2010-05-23 07:36:04 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-05-28 02:06:21 -0400 |
commit | 7fc74f17e6c9b4d86371c3a947afc32bd6bc9691 (patch) | |
tree | 3658c270bd5c45a408779040e2db181e5fca855b | |
parent | b334f2b3b68c35fd86a0cbc90ecee40e63ba2f37 (diff) |
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@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 3 | ||||
-rw-r--r-- | 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 e632339c323e..a2544ffd02cc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -913,6 +913,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, | |||
913 | case NOUVEAU_GETPARAM_VM_VRAM_BASE: | 913 | case NOUVEAU_GETPARAM_VM_VRAM_BASE: |
914 | getparam->value = dev_priv->vm_vram_base; | 914 | getparam->value = dev_priv->vm_vram_base; |
915 | break; | 915 | break; |
916 | case NOUVEAU_GETPARAM_PTIMER_TIME: | ||
917 | getparam->value = dev_priv->engine.timer.read(dev); | ||
918 | break; | ||
916 | case NOUVEAU_GETPARAM_GRAPH_UNITS: | 919 | case NOUVEAU_GETPARAM_GRAPH_UNITS: |
917 | /* NV40 and NV50 versions are quite different, but register | 920 | /* NV40 and NV50 versions are quite different, but register |
918 | * address is the same. User is supposed to know the card | 921 | * 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 a6a9f4af5ebd..fe917dee723a 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
@@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free { | |||
79 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 | 79 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 |
80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | 81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 |
82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 | ||
82 | struct drm_nouveau_getparam { | 83 | struct drm_nouveau_getparam { |
83 | uint64_t param; | 84 | uint64_t param; |
84 | uint64_t value; | 85 | uint64_t value; |