Ilia Mirkin
2015-Mar-21 15:53 UTC
[Nouveau] [PATCH] use defined method names where available
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Would be nice if someone could glance at this... I suppose I could also compare object files. Yeah, I should probably do that. src/nv10_exa.c | 8 ++++---- src/nv30_exa.c | 20 ++++++++++---------- src/nv40_exa.c | 8 ++++---- src/nv50_accel.c | 6 +++--- src/nv50_accel.h | 1 + src/nv50_exa.c | 8 ++++---- src/nv50_xv.c | 2 +- src/nv_accel_common.c | 6 +++--- src/nvc0_accel.c | 4 ++-- src/nvc0_exa.c | 2 +- 10 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/nv10_exa.c b/src/nv10_exa.c index 78bc739..7daa281 100644 --- a/src/nv10_exa.c +++ b/src/nv10_exa.c @@ -697,9 +697,9 @@ NVAccelInitNV10TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0); } - BEGIN_NV04(push, SUBC_3D(0x290), 1); + BEGIN_NV04(push, NV10_3D(UNK0290), 1); PUSH_DATA (push, (0x10<<16)|1); - BEGIN_NV04(push, SUBC_3D(0x3f4), 1); + BEGIN_NV04(push, NV10_3D(UNK03F4), 1); PUSH_DATA (push, 0); BEGIN_NV04(push, NV04_GRAPH(3D, NOP), 1); @@ -707,12 +707,12 @@ NVAccelInitNV10TCL(ScrnInfoPtr pScrn) if (class != NV10_3D_CLASS) { /* For nv11, nv17 */ - BEGIN_NV04(push, SUBC_3D(0x120), 3); + BEGIN_NV04(push, SUBC_3D(NV15_3D_FLIP_SET_READ), 3); PUSH_DATA (push, 0); PUSH_DATA (push, 1); PUSH_DATA (push, 2); - BEGIN_NV04(push, SUBC_BLIT(0x120), 3); + BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3); PUSH_DATA (push, 0); PUSH_DATA (push, 1); PUSH_DATA (push, 2); diff --git a/src/nv30_exa.c b/src/nv30_exa.c index 21586e9..9d63119 100644 --- a/src/nv30_exa.c +++ b/src/nv30_exa.c @@ -644,16 +644,16 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0); } - BEGIN_NV04(push, SUBC_3D(0x220), 1); + BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1); PUSH_DATA (push, 1); - BEGIN_NV04(push, SUBC_3D(0x03b0), 1); - PUSH_DATA (push, 0x00100000); - BEGIN_NV04(push, SUBC_3D(0x1454), 1); + BEGIN_NV04(push, NV40_3D(MIPMAP_ROUNDING), 1); + PUSH_DATA (push, NV40_3D_MIPMAP_ROUNDING_MODE_DOWN); + BEGIN_NV04(push, NV30_3D(FLATSHADE_FIRST), 1); PUSH_DATA (push, 0); BEGIN_NV04(push, SUBC_3D(0x1d80), 1); PUSH_DATA (push, 3); - BEGIN_NV04(push, SUBC_3D(0x1450), 1); + BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1); PUSH_DATA (push, 0x00030004); /* NEW */ @@ -670,17 +670,17 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_3D(0x120), 3); + BEGIN_NV04(push, NV30_3D(FLIP_SET_READ), 3); PUSH_DATA (push, 0); PUSH_DATA (push, 1); PUSH_DATA (push, 2); - BEGIN_NV04(push, SUBC_BLIT(0x120), 3); + BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3); PUSH_DATA (push, 0); PUSH_DATA (push, 1); PUSH_DATA (push, 2); - BEGIN_NV04(push, SUBC_3D(0x1d88), 1); + BEGIN_NV04(push, NV30_3D(COORD_CONVENTIONS), 1); PUSH_DATA (push, 0x00001200); BEGIN_NV04(push, NV30_3D(MULTISAMPLE_CONTROL), 1); @@ -742,7 +742,7 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) * it's not needed between nouveau restarts - which suggests that * the 3D context (wherever it's stored?) survives somehow. */ - //BEGIN_NV04(push, SUBC_3D(0x1d60),1); + //BEGIN_NV04(push, NV30_3D(FP_CONTROL),1); //PUSH_DATA (push, 0x03008000); int w=4096; @@ -756,7 +756,7 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0x0); BEGIN_NV04(push, NV30_3D(VIEWPORT_TX_ORIGIN), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_3D(0x0a00), 2); + BEGIN_NV04(push, NV30_3D(VIEWPORT_HORIZ), 2); PUSH_DATA (push, (w<<16) | 0); PUSH_DATA (push, (h<<16) | 0); BEGIN_NV04(push, NV30_3D(VIEWPORT_CLIP_HORIZ(0)), 2); diff --git a/src/nv40_exa.c b/src/nv40_exa.c index c9e99e0..8a1e2b5 100644 --- a/src/nv40_exa.c +++ b/src/nv40_exa.c @@ -633,13 +633,13 @@ NVAccelInitNV40TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0x0020ffff); BEGIN_NV04(push, SUBC_3D(0x1d64), 1); PUSH_DATA (push, 0x00d30000); - BEGIN_NV04(push, SUBC_3D(0x1e94), 1); - PUSH_DATA (push, 0x00000001); + BEGIN_NV04(push, NV30_3D(ENGINE), 1); + PUSH_DATA (push, NV30_3D_ENGINE_FP); /* This removes the the stair shaped tearing that i get. */ /* Verified on one G70 card that it doesn't cause regressions for people without the problem. */ /* The blob sets this up by default for NV43. */ - BEGIN_NV04(push, SUBC_3D(0x1450), 1); + BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1); PUSH_DATA (push, 0x0000000F); BEGIN_NV04(push, NV30_3D(VIEWPORT_TRANSLATE_X), 8); @@ -690,7 +690,7 @@ NVAccelInitNV40TCL(ScrnInfoPtr pScrn) PUSH_DATA (push, 0); } - BEGIN_NV04(push, SUBC_3D(0x1d78), 1); + BEGIN_NV04(push, NV30_3D(DEPTH_CONTROL), 1); PUSH_DATA (push, 0x110); BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1); diff --git a/src/nv50_accel.c b/src/nv50_accel.c index b27f67a..5efbd19 100644 --- a/src/nv50_accel.c +++ b/src/nv50_accel.c @@ -110,13 +110,13 @@ NVAccelInit2D_NV50(ScrnInfoPtr pScrn) /* Magics from nv, no clue what they do, but at least some * of them are needed to avoid crashes. */ - BEGIN_NV04(push, SUBC_2D(0x0260), 1); + BEGIN_NV04(push, NV50_2D(UNK260), 1); PUSH_DATA (push, 1); BEGIN_NV04(push, NV50_2D(CLIP_ENABLE), 1); PUSH_DATA (push, 1); BEGIN_NV04(push, NV50_2D(COLOR_KEY_ENABLE), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_2D(0x058c), 1); + BEGIN_NV04(push, NV50_2D(UNK58C), 1); PUSH_DATA (push, 0x111); pNv->currentRop = 0xfffffffa; @@ -205,7 +205,7 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) BEGIN_NV04(push, NV50_3D(VIEWPORT_TRANSFORM_EN), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_3D(0x0f90), 1); + BEGIN_NV04(push, NV50_3D(COLOR_MASK_COMMON), 1); PUSH_DATA (push, 1); BEGIN_NV04(push, NV50_3D(TIC_ADDRESS_HIGH), 3); diff --git a/src/nv50_accel.h b/src/nv50_accel.h index 87c88a3..9b06e38 100644 --- a/src/nv50_accel.h +++ b/src/nv50_accel.h @@ -8,6 +8,7 @@ #include "hwdefs/nv50_texture.h" #include "hwdefs/nv_3ddefs.xml.h" #include "hwdefs/nv_m2mf.xml.h" +#include "hwdefs/nv_object.xml.h" /* subchannel assignments - graphics channel */ #define SUBC_M2MF(mthd) 0, (mthd) diff --git a/src/nv50_exa.c b/src/nv50_exa.c index 7b12985..221160d 100644 --- a/src/nv50_exa.c +++ b/src/nv50_exa.c @@ -286,9 +286,9 @@ NV50EXACopy(PixmapPtr pdpix, int srcX , int srcY, if (!PUSH_SPACE(push, 32)) return; - BEGIN_NV04(push, SUBC_2D(0x0110), 1); + BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_2D(0x088c), 1); + BEGIN_NV04(push, NV50_2D(BLIT_CONTROL), 1); PUSH_DATA (push, 0); BEGIN_NV04(push, NV50_2D(BLIT_DST_X), 12); PUSH_DATA (push, dstX); @@ -837,7 +837,7 @@ NV50EXAPrepareComposite(int op, PUSH_RESET(push); PUSH_REFN (push, pNv->scratch, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR); - BEGIN_NV04(push, SUBC_2D(0x0110), 1); + BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); PUSH_DATA (push, 0); if (!NV50EXARenderTarget(pdpix, pdpict)) @@ -875,7 +875,7 @@ NV50EXAPrepareComposite(int op, PUSH_DATA (push, PFP_S); } - BEGIN_NV04(push, SUBC_3D(0x1334), 1); + BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1); PUSH_DATA (push, 0); BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1); diff --git a/src/nv50_xv.c b/src/nv50_xv.c index 3ac9e44..b2541b9 100644 --- a/src/nv50_xv.c +++ b/src/nv50_xv.c @@ -206,7 +206,7 @@ nv50_xv_image_put(ScrnInfoPtr pScrn, BEGIN_NV04(push, NV50_3D(FP_START_ID), 1); PUSH_DATA (push, PFP_NV12); - BEGIN_NV04(push, SUBC_3D(0x1334), 1); + BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1); PUSH_DATA (push, 0); BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1); diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c index f0c2d62..9361ce8 100644 --- a/src/nv_accel_common.c +++ b/src/nv_accel_common.c @@ -145,13 +145,13 @@ NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box) head = drmmode_head(crtc); - BEGIN_NV04(push, SUBC_BLIT(0x0000012C), 1); + BEGIN_NV04(push, NV15_BLIT(FLIP_INCR_WRITE), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_BLIT(0x00000134), 1); + BEGIN_NV04(push, NV15_BLIT(FLIP_CRTC_INCR_READ), 1); PUSH_DATA (push, head); BEGIN_NV04(push, SUBC_BLIT(0x00000100), 1); PUSH_DATA (push, 0); - BEGIN_NV04(push, SUBC_BLIT(0x00000130), 1); + BEGIN_NV04(push, NV15_BLIT(FLIP_WAIT), 1); PUSH_DATA (push, 0); } diff --git a/src/nvc0_accel.c b/src/nvc0_accel.c index 3a5a603..aa9cd19 100644 --- a/src/nvc0_accel.c +++ b/src/nvc0_accel.c @@ -190,9 +190,9 @@ NVAccelInit2D_NVC0(ScrnInfoPtr pScrn) PUSH_DATA (push, 1); BEGIN_NVC0(push, NV50_2D(COLOR_KEY_ENABLE), 1); PUSH_DATA (push, 0); - BEGIN_NVC0(push, SUBC_2D(0x0884), 1); + BEGIN_NVC0(push, NV50_2D(UNK0884), 1); PUSH_DATA (push, 0x3f); - BEGIN_NVC0(push, SUBC_2D(0x0888), 1); + BEGIN_NVC0(push, NV50_2D(UNK0888), 1); PUSH_DATA (push, 1); BEGIN_NVC0(push, NV50_2D(ROP), 1); PUSH_DATA (push, 0x55); diff --git a/src/nvc0_exa.c b/src/nvc0_exa.c index 966b7bc..aac7d6f 100644 --- a/src/nvc0_exa.c +++ b/src/nvc0_exa.c @@ -290,7 +290,7 @@ NVC0EXACopy(PixmapPtr pdpix, int srcX , int srcY, BEGIN_NVC0(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); PUSH_DATA (push, 0); - BEGIN_NVC0(push, SUBC_2D(0x088c), 1); + BEGIN_NVC0(push, NV50_2D(BLIT_CONTROL), 1); PUSH_DATA (push, 0); BEGIN_NVC0(push, NV50_2D(BLIT_DST_X), 12); PUSH_DATA (push, dstX); -- 2.0.5
Apparently Analagous Threads
- [PATCH] nv30/exa : cleanup from nv40 exa
- [PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
- [Mesa-dev] [PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
- [PATCH] nv50/exa: use dual-source blending for component-alpha composite
- [PATCH] nv50/accel: Fix mangled A8+A8 shader.