aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_hwsq.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-11-09 05:22:25 -0500
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 04:01:44 -0500
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 d59a3b3ff644..697687593a81 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)
57} 57}
58 58
59static inline void 59static inline void
60hwsq_unkn(struct hwsq_ucode *hwsq, u8 v0) 60hwsq_usec(struct hwsq_ucode *hwsq, u8 usec)
61{ 61{
62 *hwsq->ptr.u08++ = v0; 62 u32 shift = 0;
63 while (usec & ~3) {
64 usec >>= 2;
65 shift++;
66 }
67
68 *hwsq->ptr.u08++ = (shift << 2) | usec;
69}
70
71static inline void
72hwsq_setf(struct hwsq_ucode *hwsq, u8 flag, int val)
73{
74 flag += 0x80;
75 if (val >= 0)
76 flag += 0x20;
77 if (val >= 1)
78 flag += 0x20;
79 *hwsq->ptr.u08++ = flag;
63} 80}
64 81
65static inline void 82static inline void