Permalink
Browse files

move away from libdrm's BEGIN_RING (and variants) macros

subchan auto-assignment is now gone.
  • Loading branch information...
1 parent b6cfdc0 commit 3d2a752ca8aafee5e1e94dabfd7deec439890e95 @skeggsb committed Dec 1, 2011
Showing with 768 additions and 740 deletions.
  1. +0 −1 src/nouveau_exa.c
  2. +88 −0 src/nouveau_local.h
  3. +5 −6 src/nouveau_xv.c
  4. +34 −42 src/nv04_exa.c
  5. +10 −12 src/nv04_xv_blit.c
  6. +83 −90 src/nv10_exa.c
  7. +57 −63 src/nv30_exa.c
  8. +10 −15 src/nv30_shaders.c
  9. +16 −19 src/nv30_xv_tex.c
  10. +49 −55 src/nv40_exa.c
  11. +11 −14 src/nv40_xv_tex.c
  12. +57 −57 src/nv50_accel.c
  13. +4 −7 src/nv50_accel.h
  14. +55 −58 src/nv50_exa.c
  15. +24 −27 src/nv50_xv.c
  16. +68 −71 src/nv_accel_common.c
  17. +100 −96 src/nvc0_accel.c
  18. +7 −10 src/nvc0_accel.h
  19. +56 −59 src/nvc0_exa.c
  20. +34 −38 src/nvc0_xv.c
View
@@ -21,7 +21,6 @@
*/
#include "nv_include.h"
-#include "nv04_pushbuf.h"
#include "exa.h"
#include "hwdefs/nv_m2mf.xml.h"
View
@@ -26,6 +26,8 @@
#include "compiler.h"
#include "xf86_OSproc.h"
+#include "nouveau_pushbuf.h"
+
/* Debug output */
#define NOUVEAU_MSG(fmt,args...) ErrorF(fmt, ##args)
#define NOUVEAU_ERR(fmt,args...) \
@@ -83,4 +85,90 @@ static inline int round_down_pow2(int x)
(y) = __z; \
} while (0)
+static inline void
+BEGIN_NV04(struct nouveau_channel *chan, int subc, int mthd, int size)
+{
+ WAIT_RING(chan, size + 1);
+ OUT_RING (chan, 0x00000000 | (size << 18) | (subc << 13) | mthd);
+}
+
+static inline void
+BEGIN_NI04(struct nouveau_channel *chan, int subc, int mthd, int size)
+{
+ WAIT_RING(chan, size + 1);
+ OUT_RING (chan, 0x40000000 | (size << 18) | (subc << 13) | mthd);
+}
+
+static inline void
+BEGIN_NVC0(struct nouveau_channel *chan, int subc, int mthd, int size)
+{
+ WAIT_RING(chan, size + 1);
+ OUT_RING (chan, 0x20000000 | (size << 16) | (subc << 13) | (mthd >> 2));
+}
+
+static inline void
+BEGIN_NIC0(struct nouveau_channel *chan, int subc, int mthd, int size)
+{
+ WAIT_RING(chan, size + 1);
+ OUT_RING (chan, 0x60000000 | (size << 16) | (subc << 13) | (mthd >> 2));
+}
+
+static inline void
+BEGIN_IMC0(struct nouveau_channel *chan, int subc, int mthd, int data)
+{
+ WAIT_RING(chan, 1);
+ OUT_RING (chan, 0x80000000 | (data << 16) | (subc << 13) | (mthd >> 2));
+}
+
+static inline void
+BEGIN_1IC0(struct nouveau_channel *chan, int subc, int mthd, int size)
+{
+ WAIT_RING(chan, size + 1);
+ OUT_RING (chan, 0xa0000000 | (size << 16) | (subc << 13) | (mthd >> 2));
+}
+
+/* subchannel assignment */
+#define SUBC_M2MF(mthd) 0, (mthd) /* nv04: */
+#define NV03_M2MF(mthd) SUBC_M2MF(NV03_M2MF_##mthd)
+#define NV50_M2MF(mthd) SUBC_M2MF(NV50_M2MF_##mthd)
+#define NVC0_M2MF(mthd) SUBC_M2MF(NVC0_M2MF_##mthd)
+#define SUBC_NVSW(mthd) 1, (mthd)
+#define SUBC_SF2D(mthd) 2, (mthd) /* nv04:nv50 */
+#define SUBC_2D(mthd) 2, (mthd) /* nv50: */
+#define NV04_SF2D(mthd) SUBC_SF2D(NV04_SURFACE_2D_##mthd)
+#define NV10_SF2D(mthd) SUBC_SF2D(NV10_SURFACE_2D_##mthd)
+#define NV50_2D(mthd) SUBC_2D(NV50_2D_##mthd)
+#define NVC0_2D(mthd) SUBC_2D(NVC0_2D_##mthd)
+#define SUBC_RECT(mthd) 3, (mthd) /* nv04:nv50 */
+#define NV04_RECT(mthd) SUBC_RECT(NV04_GDI_##mthd)
+#define SUBC_BLIT(mthd) 4, (mthd) /* nv04:nv50 */
+#define NV01_BLIT(mthd) SUBC_BLIT(NV01_BLIT_##mthd)
+#define NV04_BLIT(mthd) SUBC_BLIT(NV04_BLIT_##mthd)
+#define NV15_BLIT(mthd) SUBC_BLIT(NV15_BLIT_##mthd)
+#define SUBC_IFC(mthd) 5, (mthd) /* nv04:nv50 */
+#define NV01_IFC(mthd) SUBC_IFC(NV01_IFC_##mthd)
+#define NV04_IFC(mthd) SUBC_IFC(NV04_IFC_##mthd)
+#define SUBC_MISC(mthd) 6, (mthd) /* nv04:nv50 */
+#define NV03_SIFM(mthd) SUBC_MISC(NV03_SIFM_##mthd)
+#define NV05_SIFM(mthd) SUBC_MISC(NV05_SIFM_##mthd)
+#define NV01_BETA(mthd) SUBC_MISC(NV01_BETA_##mthd)
+#define NV04_BETA4(mthd) SUBC_MISC(NV04_BETA4_##mthd)
+#define NV01_PATT(mthd) SUBC_MISC(NV01_PATTERN_##mthd)
+#define NV04_PATT(mthd) SUBC_MISC(NV04_PATTERN_##mthd)
+#define NV01_ROP(mthd) SUBC_MISC(NV01_ROP_##mthd)
+#define NV01_CLIP(mthd) SUBC_MISC(NV01_CLIP_##mthd)
+#define SUBC_3D(mthd) 7, (mthd) /* nv10: */
+#define NV10_3D(mthd) SUBC_3D(NV10_3D_##mthd)
+#define NV30_3D(mthd) SUBC_3D(NV30_3D_##mthd)
+#define NV40_3D(mthd) SUBC_3D(NV40_3D_##mthd)
+#define NV50_3D(mthd) SUBC_3D(NV50_3D_##mthd)
+#define NVC0_3D(mthd) SUBC_3D(NVC0_3D_##mthd)
+
+#define NV01_SUBC(subc, mthd) SUBC_##subc((NV01_SUBCHAN_##mthd))
+#define NV11_SUBC(subc, mthd) SUBC_##subc((NV11_SUBCHAN_##mthd))
+
+#define NV04_GRAPH(subc, mthd) SUBC_##subc((NV04_GRAPH_##mthd))
+#define NV50_GRAPH(subc, mthd) SUBC_##subc((NV50_GRAPH_##mthd))
+#define NVC0_GRAPH(subc, mthd) SUBC_##subc((NVC0_GRAPH_##mthd))
+
#endif
View
@@ -35,7 +35,6 @@
#include "nv_include.h"
#include "nv_dma.h"
-#include "nv04_pushbuf.h"
#include "vl_hwmc.h"
@@ -1122,15 +1121,15 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x,
if (MARK_RING(chan, 64, 4))
return FALSE;
- BEGIN_RING(chan, m2mf, NV03_M2MF_DMA_BUFFER_IN, 2);
+ BEGIN_NV04(chan, NV03_M2MF(DMA_BUFFER_IN), 2);
OUT_RING (chan, pNv->chan->gart->handle);
OUT_RING (chan, pNv->chan->vram->handle);
if (pNv->Architecture >= NV_ARCH_50) {
- BEGIN_RING(chan, m2mf, NV50_M2MF_LINEAR_IN, 1);
+ BEGIN_NV04(chan, NV50_M2MF(LINEAR_IN), 1);
OUT_RING (chan, 1);
- BEGIN_RING(chan, m2mf, NV50_M2MF_LINEAR_OUT, 7);
+ BEGIN_NV04(chan, NV50_M2MF(LINEAR_OUT), 7);
OUT_RING (chan, 0);
OUT_RING (chan, destination_buffer->tile_mode << 4);
OUT_RING (chan, dstPitch);
@@ -1145,7 +1144,7 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x,
!(action_flags & CONVERT_TO_YUY2)) {
/* we start the color plane transfer separately */
- BEGIN_RING(chan, m2mf, NV03_M2MF_OFFSET_IN, 8);
+ BEGIN_NV04(chan, NV03_M2MF(OFFSET_IN), 8);
if (OUT_RELOCl(chan, destination_buffer,
line_len * nlines,
NOUVEAU_BO_GART | NOUVEAU_BO_RD) ||
@@ -1163,7 +1162,7 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x,
OUT_RING (chan, 0);
}
- BEGIN_RING(chan, m2mf, NV03_M2MF_OFFSET_IN, 8);
+ BEGIN_NV04(chan, NV03_M2MF(OFFSET_IN), 8);
if (OUT_RELOCl(chan, destination_buffer, 0,
NOUVEAU_BO_GART | NOUVEAU_BO_RD) ||
OUT_RELOCl(chan, pPriv->video_mem, offset,
Oops, something went wrong.

0 comments on commit 3d2a752

Please sign in to comment.