From 4297a83b48664b2b6a6dc0a72a4d11b043f34778 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 12 Jan 2007 00:13:05 -0500 Subject: nouveau: get nv30 context switching to work. * Pulled in some registers from nv10reg.h. Needed for context switching. * Filled in nv30 graphics context (based on nv40_graph.c). * Figure out nv30 context table, set up on context creation. Allows the cards automatic switching to work. --- shared-core/nouveau_reg.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'shared-core/nouveau_reg.h') diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h index 23fce39a..97d81048 100644 --- a/shared-core/nouveau_reg.h +++ b/shared-core/nouveau_reg.h @@ -71,6 +71,21 @@ #define NV_PGRAPH_FIFO 0x00400720 #define NV_PGRAPH_FFINTFC_ST2 0x00400764 +/* NV-Register NV_PGRAPH_CHANNEL_CTX_TABLE */ +#define NV_PGRAPH_CHANNEL_CTX_TABLE 0x00400780 +#define NV_PGRAPH_CHANNEL_CTX_TABLE_INST 0x0000FFFF +#define NV_PGRAPH_CHANNEL_CTX_TABLE_INST_0 0x00000000 + +/* NV-Register NV_PGRAPH_CHANNEL_CTX_SIZE */ +#define NV_PGRAPH_CHANNEL_CTX_SIZE 0x00400784 +#define NV_PGRAPH_CHANNEL_CTX_SIZE_VALUE 0x0000FFFF +#define NV_PGRAPH_CHANNEL_CTX_SIZE_VALUE_INIT 0x00001000 + +/* NV-Register NV_PGRAPH_CHANNEL_CTX_POINTER */ +#define NV_PGRAPH_CHANNEL_CTX_POINTER 0x00400788 +#define NV_PGRAPH_CHANNEL_CTX_POINTER_INST 0x0000FFFF +#define NV_PGRAPH_CHANNEL_CTX_POINTER_INST_0 0x00000000 + /* It's a guess that this works on NV03. Confirmed on NV04, though */ #define NV_PFIFO_DELAY_0 0x00002040 #define NV_PFIFO_DMA_TIMESLICE 0x00002044 -- cgit v1.2.3 From 1967aa82cfc18c422360ef544b66e316d98f53a1 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sat, 13 Jan 2007 12:32:45 +0100 Subject: nouveau: Oops, fix the nv04 RAMFC_DMA_FETCH value. --- shared-core/nouveau_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-core/nouveau_reg.h') diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h index 97d81048..a1d189f1 100644 --- a/shared-core/nouveau_reg.h +++ b/shared-core/nouveau_reg.h @@ -213,7 +213,7 @@ #define NV04_RAMFC_DMA_PUT 0x00 #define NV04_RAMFC_DMA_GET 0x04 #define NV04_RAMFC_DMA_INSTANCE 0x08 -#define NV04_RAMFC_DMA_FETCH 0x16 +#define NV04_RAMFC_DMA_FETCH 0x10 #define NV10_RAMFC_DMA_PUT 0x00 #define NV10_RAMFC_DMA_GET 0x04 -- cgit v1.2.3 From 4ae64a1b583be3ef13338e8029e7e9efe21f2c2f Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sat, 13 Jan 2007 21:41:33 +0100 Subject: nouveau: add and indent pgraph regs --- shared-core/nouveau_reg.h | 107 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 15 deletions(-) (limited to 'shared-core/nouveau_reg.h') diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h index a1d189f1..8058e980 100644 --- a/shared-core/nouveau_reg.h +++ b/shared-core/nouveau_reg.h @@ -55,6 +55,7 @@ #define NV_PMC_INTEN 0x00000140 # define NV_PMC_INTEN_MASTER_ENABLE (1<< 0) +#define NV_PGRAPH_DEBUG_4 0x00400090 #define NV_PGRAPH_INTSTAT 0x00400100 #define NV04_PGRAPH_INTEN 0x00400140 #define NV40_PGRAPH_INTEN 0x0040013C @@ -68,23 +69,99 @@ # define NV_PGRAPH_NV40_UNK220_FB_INSTANCE #define NV_PGRAPH_CTX_USER 0x00400148 #define NV_PGRAPH_CTX_SWITCH1 0x0040014C -#define NV_PGRAPH_FIFO 0x00400720 -#define NV_PGRAPH_FFINTFC_ST2 0x00400764 - -/* NV-Register NV_PGRAPH_CHANNEL_CTX_TABLE */ -#define NV_PGRAPH_CHANNEL_CTX_TABLE 0x00400780 -#define NV_PGRAPH_CHANNEL_CTX_TABLE_INST 0x0000FFFF -#define NV_PGRAPH_CHANNEL_CTX_TABLE_INST_0 0x00000000 +#define NV_PGRAPH_CTX_SWITCH2 0x00400150 +#define NV_PGRAPH_CTX_SWITCH3 0x00400154 +#define NV_PGRAPH_CTX_SWITCH4 0x00400158 +#define NV_PGRAPH_CTX_SWITCH5 0x0040015C +#define NV_PGRAPH_X_MISC 0x00400500 +#define NV_PGRAPH_Y_MISC 0x00400504 +#define NV_PGRAPH_VALID1 0x00400508 +#define NV_PGRAPH_SOURCE_COLOR 0x0040050C +#define NV_PGRAPH_MISC24_0 0x00400510 +#define NV_PGRAPH_XY_LOGIC_MISC0 0x00400514 +#define NV_PGRAPH_XY_LOGIC_MISC1 0x00400518 +#define NV_PGRAPH_XY_LOGIC_MISC2 0x0040051C +#define NV_PGRAPH_XY_LOGIC_MISC3 0x00400520 +#define NV_PGRAPH_CLIPX_0 0x00400524 +#define NV_PGRAPH_CLIPX_1 0x00400528 +#define NV_PGRAPH_CLIPY_0 0x0040052C +#define NV_PGRAPH_CLIPY_1 0x00400530 +#define NV_PGRAPH_ABS_ICLIP_XMAX 0x00400534 +#define NV_PGRAPH_ABS_ICLIP_YMAX 0x00400538 +#define NV_PGRAPH_ABS_UCLIP_XMIN 0x0040053C +#define NV_PGRAPH_ABS_UCLIP_YMIN 0x00400540 +#define NV_PGRAPH_ABS_UCLIP_XMAX 0x00400544 +#define NV_PGRAPH_ABS_UCLIP_YMAX 0x00400548 +#define NV_PGRAPH_ABS_UCLIPA_XMIN 0x00400560 +#define NV_PGRAPH_ABS_UCLIPA_YMIN 0x00400564 +#define NV_PGRAPH_ABS_UCLIPA_XMAX 0x00400568 +#define NV_PGRAPH_ABS_UCLIPA_YMAX 0x0040056C +#define NV_PGRAPH_MISC24_1 0x00400570 +#define NV_PGRAPH_MISC24_2 0x00400574 +#define NV_PGRAPH_VALID2 0x00400578 +#define NV_PGRAPH_PASSTHRU_0 0x0040057C +#define NV_PGRAPH_PASSTHRU_1 0x00400580 +#define NV_PGRAPH_PASSTHRU_2 0x00400584 +#define NV_PGRAPH_DIMX_TEXTURE 0x00400588 +#define NV_PGRAPH_WDIMX_TEXTURE 0x0040058C +#define NV_PGRAPH_MONO_COLOR0 0x00400600 +#define NV_PGRAPH_ROP3 0x00400604 +#define NV_PGRAPH_BETA_AND 0x00400608 +#define NV_PGRAPH_BETA_PREMULT 0x0040060C +#define NV_PGRAPH_BOFFSET0 0x00400640 +#define NV_PGRAPH_BOFFSET1 0x00400644 +#define NV_PGRAPH_BOFFSET2 0x00400648 +#define NV_PGRAPH_BOFFSET3 0x0040064C +#define NV_PGRAPH_BOFFSET4 0x00400650 +#define NV_PGRAPH_BOFFSET5 0x00400654 +#define NV_PGRAPH_BBASE0 0x00400658 +#define NV_PGRAPH_BBASE1 0x0040065C +#define NV_PGRAPH_BBASE2 0x00400660 +#define NV_PGRAPH_BBASE3 0x00400664 +#define NV_PGRAPH_BBASE4 0x00400668 +#define NV_PGRAPH_BBASE5 0x0040066C +#define NV_PGRAPH_BPITCH0 0x00400670 +#define NV_PGRAPH_BPITCH1 0x00400674 +#define NV_PGRAPH_BPITCH2 0x00400678 +#define NV_PGRAPH_BPITCH3 0x0040067C +#define NV_PGRAPH_BPITCH4 0x00400680 +#define NV_PGRAPH_BLIMIT0 0x00400684 +#define NV_PGRAPH_BLIMIT1 0x00400688 +#define NV_PGRAPH_BLIMIT2 0x0040068C +#define NV_PGRAPH_BLIMIT3 0x00400690 +#define NV_PGRAPH_BLIMIT4 0x00400694 +#define NV_PGRAPH_BLIMIT5 0x00400698 +#define NV_PGRAPH_BSWIZZLE2 0x0040069C +#define NV_PGRAPH_BSWIZZLE5 0x004006A0 +#define NV_PGRAPH_SURFACE 0x00400710 +#define NV_PGRAPH_STATE 0x00400714 +#define NV_PGRAPH_NOTIFY 0x00400718 -/* NV-Register NV_PGRAPH_CHANNEL_CTX_SIZE */ -#define NV_PGRAPH_CHANNEL_CTX_SIZE 0x00400784 -#define NV_PGRAPH_CHANNEL_CTX_SIZE_VALUE 0x0000FFFF -#define NV_PGRAPH_CHANNEL_CTX_SIZE_VALUE_INIT 0x00001000 +#define NV_PGRAPH_FIFO 0x00400720 -/* NV-Register NV_PGRAPH_CHANNEL_CTX_POINTER */ -#define NV_PGRAPH_CHANNEL_CTX_POINTER 0x00400788 -#define NV_PGRAPH_CHANNEL_CTX_POINTER_INST 0x0000FFFF -#define NV_PGRAPH_CHANNEL_CTX_POINTER_INST_0 0x00000000 +#define NV_PGRAPH_BPIXEL 0x00400724 +#define NV_PGRAPH_FFINTFC_ST2 0x00400764 +#define NV_PGRAPH_DMA_PITCH 0x00400770 +#define NV_PGRAPH_DVD_COLORFMT 0x00400774 +#define NV_PGRAPH_SCALED_FORMAT 0x00400778 +#define NV_PGRAPH_CHANNEL_CTX_TABLE 0x00400780 +#define NV_PGRAPH_CHANNEL_CTX_SIZE 0x00400784 +#define NV_PGRAPH_CHANNEL_CTX_POINTER 0x00400788 +#define NV_PGRAPH_PATT_COLOR0 0x00400800 +#define NV_PGRAPH_PATT_COLOR1 0x00400804 +#define NV_PGRAPH_PATTERN_SHAPE 0x00400810 +#define NV_PGRAPH_CHROMA 0x00400814 +#define NV_PGRAPH_STORED_FMT 0x00400830 +#define NV_PGRAPH_XFMODE0 0x00400F40 +#define NV_PGRAPH_XFMODE1 0x00400F44 +#define NV_PGRAPH_GLOBALSTATE0 0x00400F48 +#define NV_PGRAPH_GLOBALSTATE1 0x00400F4C +#define NV_PGRAPH_PIPE_ADDRESS 0x00400F50 +#define NV_PGRAPH_PIPE_DATA 0x00400F54 +#define NV_PGRAPH_DMA_START_0 0x00401000 +#define NV_PGRAPH_DMA_START_1 0x00401004 +#define NV_PGRAPH_DMA_LENGTH 0x00401008 +#define NV_PGRAPH_DMA_MISC 0x0040100C /* It's a guess that this works on NV03. Confirmed on NV04, though */ #define NV_PFIFO_DELAY_0 0x00002040 -- cgit v1.2.3 From f04347f371c6c9c3a47550c6b7d26b7bd5629c85 Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sat, 13 Jan 2007 23:19:41 +0100 Subject: nouveau: nv20 graph ctx switch. Untested... --- shared-core/nouveau_reg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shared-core/nouveau_reg.h') diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h index 8058e980..543be694 100644 --- a/shared-core/nouveau_reg.h +++ b/shared-core/nouveau_reg.h @@ -140,6 +140,8 @@ #define NV_PGRAPH_FIFO 0x00400720 #define NV_PGRAPH_BPIXEL 0x00400724 +#define NV_PGRAPH_RDI_INDEX 0x00400750 +#define NV_PGRAPH_RDI_DATA 0x00400754 #define NV_PGRAPH_FFINTFC_ST2 0x00400764 #define NV_PGRAPH_DMA_PITCH 0x00400770 #define NV_PGRAPH_DVD_COLORFMT 0x00400774 -- cgit v1.2.3