summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_hwsq.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-11-09 20:22:25 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 19:01:44 +1000
commitc8b9641a9146b13d34824f99c3d22c8c0c3a06bd (patch)
tree3b4280f3757ab9f9e82a4feaaec0336b38040a03 /drivers/gpu/drm/nouveau/nouveau_hwsq.h
parenteeb7a50bddb281d7beecb0ad73c9f1233e9932c2 (diff)
drm/nouveau/hwsq: remove some magic, give proper opcode names
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_hwsq.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_hwsq.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_hwsq.h b/drivers/gpu/drm/nouveau/nouveau_hwsq.h
index d59a3b3ff64..697687593a8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwsq.h
+++ b/drivers/gpu/drm/nouveau/nouveau_hwsq.h
@@ -57,9 +57,26 @@ hwsq_fini(struct hwsq_ucode *hwsq)
}
static inline void
-hwsq_unkn(struct hwsq_ucode *hwsq, u8 v0)
+hwsq_usec(struct hwsq_ucode *hwsq, u8 usec)
{
- *hwsq->ptr.u08++ = v0;
+ u32 shift = 0;
+ while (usec & ~3) {
+ usec >>= 2;
+ shift++;
+ }
+
+ *hwsq->ptr.u08++ = (shift << 2) | usec;
+}
+
+static inline void
+hwsq_setf(struct hwsq_ucode *hwsq, u8 flag, int val)
+{
+ flag += 0x80;
+ if (val >= 0)
+ flag += 0x20;
+ if (val >= 1)
+ flag += 0x20;
+ *hwsq->ptr.u08++ = flag;
}
static inline void