Skip to contentSkip to conversation

Add Maxwell support

PATCH In review Ilia Mirkin 2 participants 15 messages Oct 27, 2016 8 messages not in the archive

lore
Share & tools
lore
#0 lore raw

v2 cover Add Maxwell support

I believe I've addressed all the feedback from the first time around, and also made fixes necessary for GM20x based on testing results. I believe now it should actually work for all GM10x and GM20x. Further, GP10x should be very easy to add, but without someone to actually test I didn't want to claim support for it.

Ilia Mirkin (7):
exa: add GM10x acceleration support
hwdefs: update nvc0_3d, add gm107_texture for new TIC format
nvc0: make use of the new hwdefs for TEX_CB_INDEX
nvc0: rename BEGIN_IMC0 to IMMED_NVC0
nvc0: refactor TIC uploads to allow different specifics per generation
copy: add maxwell/pascal copy engine classes
recognize and accelerate GM20x

 src/Makefile.am                |  17 +
 src/hwdefs/gm107_texture.xml.h | 365 +++++++++++++++++
 src/hwdefs/nvc0_3d.xml.h       | 867 +++++++++++++++++++++++++----------------
 src/nouveau_copy.c             |   3 +
 src/nouveau_exa.c              |   2 +-
 src/nouveau_local.h            |   2 +-
 src/nouveau_xv.c               |   2 +-
 src/nv_accel_common.c          |   1 +
 src/nv_driver.c                |   3 +
 src/nvc0_accel.c               |  68 +++-
 src/nvc0_accel.h               |  57 +++
 src/nvc0_exa.c                 |  71 ++--
 src/nvc0_xv.c                  | 115 +++---
 src/shader/Makefile            |  23 +-
 src/shader/exac8nv110.fp       |  47 +++
 src/shader/exac8nv110.fpc      |  38 ++
 src/shader/exacanv110.fp       |  47 +++
 src/shader/exacanv110.fpc      |  38 ++
 src/shader/exacmnv110.fp       |  47 +++
 src/shader/exacmnv110.fpc      |  38 ++
 src/shader/exas8nv110.fp       |  42 ++
 src/shader/exas8nv110.fpc      |  28 ++
 src/shader/exasanv110.fp       |  47 +++
 src/shader/exasanv110.fpc      |  38 ++
 src/shader/exascnv110.fp       |  38 ++
 src/shader/exascnv110.fpc      |  20 +
 src/shader/videonv110.fp       |  54 +++
 src/shader/videonv110.fpc      |  52 +++
 src/shader/xfrm2nv110.vp       |  82 ++++
 src/shader/xfrm2nv110.vpc      | 102 +++++
 30 files changed, 1928 insertions(+), 426 deletions(-)
 create mode 100644 src/hwdefs/gm107_texture.xml.h
 create mode 100644 src/shader/exac8nv110.fp
 create mode 100644 src/shader/exac8nv110.fpc
 create mode 100644 src/shader/exacanv110.fp
 create mode 100644 src/shader/exacanv110.fpc
 create mode 100644 src/shader/exacmnv110.fp
 create mode 100644 src/shader/exacmnv110.fpc
 create mode 100644 src/shader/exas8nv110.fp
 create mode 100644 src/shader/exas8nv110.fpc
 create mode 100644 src/shader/exasanv110.fp
 create mode 100644 src/shader/exasanv110.fpc
 create mode 100644 src/shader/exascnv110.fp
 create mode 100644 src/shader/exascnv110.fpc
 create mode 100644 src/shader/videonv110.fp
 create mode 100644 src/shader/videonv110.fpc
 create mode 100644 src/shader/xfrm2nv110.vp
 create mode 100644 src/shader/xfrm2nv110.vpc
Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1477576980-7962-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#2 lore raw

PATCH v2 1/7 exa: add GM10x acceleration support

rendercheck -f a8r8g8b8 passes as much as on a GK208, and xv appears to work. Very lightly tested.

Instead of sticking coordinates into pushbufs, the vertex shader is modified to read them from a constbuf, indexed by vertex id. This approach could be used for all nvc0 generations, but I didn't want to rock the boat.

---
 src/Makefile.am           |  16 ++++++++
 src/nouveau_copy.c        |   1 +
 src/nouveau_exa.c         |   2 +-
 src/nouveau_xv.c          |   2 +-
 src/nv_accel_common.c     |   1 +
 src/nv_driver.c           |   1 +
 src/nvc0_accel.c          |  37 ++++++++++++++---
 src/nvc0_exa.c            |  48 ++++++++++++++++++++--
 src/nvc0_xv.c             |  48 ++++++++++++++++++++--
 src/shader/Makefile       |  23 ++++++++---
 src/shader/exac8nv110.fp  |  47 +++++++++++++++++++++
 src/shader/exac8nv110.fpc |  38 +++++++++++++++++
 src/shader/exacanv110.fp  |  47 +++++++++++++++++++++
 src/shader/exacanv110.fpc |  38 +++++++++++++++++
 src/shader/exacmnv110.fp  |  47 +++++++++++++++++++++
 src/shader/exacmnv110.fpc |  38 +++++++++++++++++
 src/shader/exas8nv110.fp  |  42 +++++++++++++++++++
 src/shader/exas8nv110.fpc |  28 +++++++++++++
 src/shader/exasanv110.fp  |  47 +++++++++++++++++++++
 src/shader/exasanv110.fpc |  38 +++++++++++++++++
 src/shader/exascnv110.fp  |  38 +++++++++++++++++
 src/shader/exascnv110.fpc |  20 +++++++++
 src/shader/videonv110.fp  |  54 ++++++++++++++++++++++++
 src/shader/videonv110.fpc |  52 +++++++++++++++++++++++
 src/shader/xfrm2nv110.vp  |  82 +++++++++++++++++++++++++++++++++++++
 src/shader/xfrm2nv110.vpc | 102 ++++++++++++++++++++++++++++++++++++++++++++++
 26 files changed, 918 insertions(+), 19 deletions(-)
 create mode 100644 src/shader/exac8nv110.fp
 create mode 100644 src/shader/exac8nv110.fpc
 create mode 100644 src/shader/exacanv110.fp
 create mode 100644 src/shader/exacanv110.fpc
 create mode 100644 src/shader/exacmnv110.fp
 create mode 100644 src/shader/exacmnv110.fpc
 create mode 100644 src/shader/exas8nv110.fp
 create mode 100644 src/shader/exas8nv110.fpc
 create mode 100644 src/shader/exasanv110.fp
 create mode 100644 src/shader/exasanv110.fpc
 create mode 100644 src/shader/exascnv110.fp
 create mode 100644 src/shader/exascnv110.fpc
 create mode 100644 src/shader/videonv110.fp
 create mode 100644 src/shader/videonv110.fpc
 create mode 100644 src/shader/xfrm2nv110.vp
 create mode 100644 src/shader/xfrm2nv110.vpc
src/Makefile.am +16 -0
index 1e04ddf..6ba8d87 100644
@@ -77,48 +77,64 @@ EXTRA_DIST = hwdefs/nv_3ddefs.xml.h \
 	     shader/exac8nve0.fpc \
 	     shader/exac8nvf0.fp \
 	     shader/exac8nvf0.fpc \
+	     shader/exac8nv110.fp \
+	     shader/exac8nv110.fpc \
 	     shader/exacanvc0.fp \
 	     shader/exacanvc0.fpc \
 	     shader/exacanve0.fp \
 	     shader/exacanve0.fpc \
 	     shader/exacanvf0.fp \
 	     shader/exacanvf0.fpc \
+	     shader/exacanv110.fp \
+	     shader/exacanv110.fpc \
 	     shader/exacmnvc0.fp \
 	     shader/exacmnvc0.fpc \
 	     shader/exacmnve0.fp \
 	     shader/exacmnve0.fpc \
 	     shader/exacmnvf0.fp \
 	     shader/exacmnvf0.fpc \
+	     shader/exacmnv110.fp \
+	     shader/exacmnv110.fpc \
 	     shader/exas8nvc0.fp \
 	     shader/exas8nvc0.fpc \
 	     shader/exas8nve0.fp \
 	     shader/exas8nve0.fpc \
 	     shader/exas8nvf0.fp \
 	     shader/exas8nvf0.fpc \
+	     shader/exas8nv110.fp \
+	     shader/exas8nv110.fpc \
 	     shader/exasanvc0.fp \
 	     shader/exasanvc0.fpc \
 	     shader/exasanve0.fp \
 	     shader/exasanve0.fpc \
 	     shader/exasanvf0.fp \
 	     shader/exasanvf0.fpc \
+	     shader/exasanv110.fp \
+	     shader/exasanv110.fpc \
 	     shader/exascnvc0.fp \
 	     shader/exascnvc0.fpc \
 	     shader/exascnve0.fp \
 	     shader/exascnve0.fpc \
 	     shader/exascnvf0.fp \
 	     shader/exascnvf0.fpc \
+	     shader/exascnv110.fp \
+	     shader/exascnv110.fpc \
 	     shader/videonvc0.fp \
 	     shader/videonvc0.fpc \
 	     shader/videonve0.fp \
 	     shader/videonve0.fpc \
 	     shader/videonvf0.fp \
 	     shader/videonvf0.fpc \
+	     shader/videonv110.fp \
+	     shader/videonv110.fpc \
 	     shader/xfrm2nvc0.vp \
 	     shader/xfrm2nvc0.vpc \
 	     shader/xfrm2nve0.vp \
 	     shader/xfrm2nve0.vpc \
 	     shader/xfrm2nvf0.vp \
 	     shader/xfrm2nvf0.vpc \
+	     shader/xfrm2nv110.vp \
+	     shader/xfrm2nv110.vpc \
 	     shader/Makefile \
 	     nouveau_local.h \
 	     nouveau_copy.h \
src/nouveau_copy.c +1 -0
index e152a53..c139de6 100644
@@ -81,6 +81,7 @@ nouveau_copy_init(ScreenPtr pScreen)
 					 &pNv->ce_channel);
 		break;
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		ret = nouveau_object_new(&pNv->dev->object, 0,
 					 NOUVEAU_FIFO_CHANNEL_CLASS,
 					 &(struct nve0_fifo) {
src/nouveau_exa.c +1 -1
index def66ac..0f02b99 100644
@@ -514,12 +514,12 @@ nouveau_exa_init(ScreenPtr pScreen)
 		break;
 	case NV_FERMI:
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		exa->CheckComposite   = NVC0EXACheckComposite;
 		exa->PrepareComposite = NVC0EXAPrepareComposite;
 		exa->Composite        = NVC0EXAComposite;
 		exa->DoneComposite    = NVC0EXADoneComposite;
 		break;
-	case NV_MAXWELL:
 	default:
 		break;
 	}
src/nouveau_xv.c +1 -1
index d514dbf..716b18d 100644
@@ -2142,7 +2142,7 @@ NVSetupTexturedVideo (ScreenPtr pScreen, XF86VideoAdaptorPtr *textureAdaptor)
 		textureAdaptor[0] = NV40SetupTexturedVideo(pScreen, FALSE);
 		textureAdaptor[1] = NV40SetupTexturedVideo(pScreen, TRUE);
 	} else
-	if (pNv->Architecture >= NV_TESLA && pNv->Architecture < NV_MAXWELL) {
+	if (pNv->Architecture >= NV_TESLA) {
 		textureAdaptor[0] = NV50SetupTexturedVideo(pScreen);
 	}
 }
src/nv_accel_common.c +1 -0
index 9361ce8..5d12dd8 100644
@@ -722,6 +722,7 @@ NVAccelCommonInit(ScrnInfoPtr pScrn)
 	switch (pNv->Architecture) {
 	case NV_FERMI:
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		INIT_CONTEXT_OBJECT(3D_NVC0);
 		break;
 	case NV_TESLA:
src/nv_driver.c +1 -0
index 4dde8e0..fff83f8 100644
@@ -389,6 +389,7 @@ NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev)
 	case 0xe0:
 	case 0xf0:
 	case 0x100:
+	case 0x110:
 		break;
 	default:
 		xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
src/nvc0_accel.c +31 -6
index d2a3b93..52a17db 100644
@@ -53,6 +53,16 @@
 #include "shader/exas8nvf0.fp"
 #include "shader/exac8nvf0.fp"
 
+#include "shader/xfrm2nv110.vp"
+#include "shader/videonv110.fp"
+
+#include "shader/exascnv110.fp"
+#include "shader/exacmnv110.fp"
+#include "shader/exacanv110.fp"
+#include "shader/exasanv110.fp"
+#include "shader/exas8nv110.fp"
+#include "shader/exac8nv110.fp"
+
 #define NVC0PushProgram(pNv,addr,code) do {                                    \
 	const unsigned size = sizeof(code) / sizeof(code[0]);                  \
 	PUSH_DATAu((pNv)->pushbuf, (pNv)->scratch, (addr), size);              \
@@ -223,9 +233,12 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 	} else if (pNv->dev->chipset < 0xf0) {
 		class  = 0xa097;
 		handle = 0x0000906e;
-	} else {
+	} else if (pNv->dev->chipset < 0x110) {
 		class  = 0xa197;
 		handle = 0x0000906e;
+	} else {
+		class  = 0xb097;
+		handle = 0x0000906e;
 	}
 
 	ret = nouveau_object_new(pNv->channel, class, class,
@@ -304,10 +317,12 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		PUSH_DATA (push, 1);
 	}
 
-	BEGIN_NVC0(push, NVC0_3D(VERTEX_QUARANTINE_ADDRESS_HIGH), 3);
-	PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
-	PUSH_DATA (push, (bo->offset + MISC_OFFSET));
-	PUSH_DATA (push, 1);
+	if (pNv->Architecture < NV_MAXWELL) {
+		BEGIN_NVC0(push, NVC0_3D(VERTEX_QUARANTINE_ADDRESS_HIGH), 3);
+		PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
+		PUSH_DATA (push, (bo->offset + MISC_OFFSET));
+		PUSH_DATA (push, 1);
+	}
 
 	BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
 	PUSH_DATA (push, (bo->offset + CODE_OFFSET) >> 32);
@@ -334,7 +349,8 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		NVC0PushProgram(pNv, PFP_S_A8, NVE0FP_Source_A8);
 		NVC0PushProgram(pNv, PFP_C_A8, NVE0FP_Composite_A8);
 		NVC0PushProgram(pNv, PFP_NV12, NVE0FP_NV12);
-	} else {
+	} else
+	if (pNv->dev->chipset < 0x110) {
 		NVC0PushProgram(pNv, PVP_PASS, NVF0VP_Transform2);
 		NVC0PushProgram(pNv, PFP_S, NVF0FP_Source);
 		NVC0PushProgram(pNv, PFP_C, NVF0FP_Composite);
@@ -343,6 +359,15 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		NVC0PushProgram(pNv, PFP_S_A8, NVF0FP_Source_A8);
 		NVC0PushProgram(pNv, PFP_C_A8, NVF0FP_Composite_A8);
 		NVC0PushProgram(pNv, PFP_NV12, NVF0FP_NV12);
+	} else {
+		NVC0PushProgram(pNv, PVP_PASS, NV110VP_Transform2);
+		NVC0PushProgram(pNv, PFP_S, NV110FP_Source);
+		NVC0PushProgram(pNv, PFP_C, NV110FP_Composite);
+		NVC0PushProgram(pNv, PFP_CCA, NV110FP_CAComposite);
+		NVC0PushProgram(pNv, PFP_CCASA, NV110FP_CACompositeSrcAlpha);
+		NVC0PushProgram(pNv, PFP_S_A8, NV110FP_Source_A8);
+		NVC0PushProgram(pNv, PFP_C_A8, NV110FP_Composite_A8);
+		NVC0PushProgram(pNv, PFP_NV12, NV110FP_NV12);
 	}
 
 	BEGIN_NVC0(push, NVC0_3D(SP_SELECT(1)), 4);
src/nvc0_exa.c +45 -3

59 lines not on this page · raw message

src/nvc0_xv.c +45 -3

60 lines not on this page · raw message

src/shader/Makefile +18 -5
index 2d789be..12bf455 100644
@@ -22,23 +22,36 @@ NVF0_SHADERS = xfrm2nvf0.vpc \
 	       exas8nvf0.fpc \
 	       exac8nvf0.fpc \
 	       videonvf0.fpc
+NV110_SHADERS = xfrm2nv110.vpc \
+	       exascnv110.fpc \
+	       exacmnv110.fpc \
+	       exacanv110.fpc \
+	       exasanv110.fpc \
+	       exas8nv110.fpc \
+	       exac8nv110.fpc \
+	       videonv110.fpc
 
-SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS)
+SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS) $(NV110_SHADERS)
 ENVYAS ?= envyas
 
 all: $(SHADERS)
 
 $(filter %nvc0.vpc,$(SHADERS)): %.vpc: %.vp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
 $(filter %nvc0.fpc,$(SHADERS)): %.fpc: %.fp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
 
 $(filter %nve0.vpc,$(SHADERS)): %.vpc: %.vp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
 $(filter %nve0.fpc,$(SHADERS)): %.fpc: %.fp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
 
 $(filter %nvf0.vpc,$(SHADERS)): %.vpc: %.vp
 	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
 $(filter %nvf0.fpc,$(SHADERS)): %.fpc: %.fp
 	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
+
+$(filter %nv110.vpc,$(SHADERS)): %.vpc: %.vp
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
+$(filter %nv110.fpc,$(SHADERS)): %.fpc: %.fp
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
src/shader/exac8nv110.fp new file +47 -0

47 lines not on this page · raw message

src/shader/exac8nv110.fpc new file +38 -0
new file mode 100644
index 0000000..4aa1368
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0x2ff70201,
+0xc03a0014,
+0x4007ff03,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff88,
+0x2ff70200,
+0xc03a0004,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00170003,
+0x5c681000,
+0x00370002,
+0x5c980780,
+0x00370001,
+0x5c980780,
+0xfc0007e0,
+0x001f8000,
+0x00370000,
+0x5c980780,
+0x0007000f,
+0xe3000000,
src/shader/exacanv110.fp new file +47 -0

47 lines not on this page · raw message

src/shader/exacanv110.fpc new file +38 -0
new file mode 100644
index 0000000..7c0ca5e
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0xaff70204,
+0xc03a0017,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00770303,
+0x5c681000,
+0x00670202,
+0x5c681000,
+0x00570101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exacmnv110.fp new file +47 -0

47 lines not on this page · raw message

src/shader/exacmnv110.fpc new file +38 -0
new file mode 100644
index 0000000..9d62c1a
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0x2ff70204,
+0xc03a0014,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00470303,
+0x5c681000,
+0x00470202,
+0x5c681000,
+0x00470101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exas8nv110.fp new file +42 -0

42 lines not on this page · raw message

src/shader/exas8nv110.fpc new file +28 -0
new file mode 100644
index 0000000..1181c41
@@ -0,0 +1,28 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0x2ff70000,
+0xc03a0004,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00070003,
+0x5c980780,
+0x00070002,
+0x5c980780,
+0x00070001,
+0x5c980780,
+0xfc0007e0,
+0x001f8000,
+0x0007000f,
+0xe3000000,
src/shader/exasanv110.fp new file +47 -0

47 lines not on this page · raw message

src/shader/exasanv110.fpc new file +38 -0
new file mode 100644
index 0000000..5516a03
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff88,
+0x2ff70204,
+0xc03a0004,
+0x4007ff01,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff89,
+0xaff70000,
+0xc03a0017,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00470303,
+0x5c681000,
+0x00470202,
+0x5c681000,
+0x00470101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exascnv110.fp new file +38 -0
new file mode 100644
index 0000000..90bbb55
@@ -0,0 +1,38 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_Source[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x0000000a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exascnv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r1 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x0 t2d 0xf
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+exit
+#endif
src/shader/exascnv110.fpc new file +20 -0
new file mode 100644
index 0000000..2dba15d
@@ -0,0 +1,20 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x0007000f,
+0xe3000000,
src/shader/videonv110.fp new file +54 -0

54 lines not on this page · raw message

src/shader/videonv110.fpc new file +52 -0

52 lines not on this page · raw message

src/shader/xfrm2nv110.vp new file +82 -0

82 lines not on this page · raw message

src/shader/xfrm2nv110.vpc new file +102 -0

102 lines not on this page · raw message

Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1477576980-7962-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

Reviewed-by
#4 lore raw

Re: [PATCH v2 1/7] exa: add GM10x acceleration support

Two minor nitpicks below.

I didn't read all shaders carefully because it's a pain, but I didn't see any obvious things. :-)

Thanks for that great work Ilia!

Quoted 273 lines · Ilia Mirkin

rendercheck -f a8r8g8b8 passes as much as on a GK208, and xv appears to work. Very lightly tested.

Instead of sticking coordinates into pushbufs, the vertex shader is modified to read them from a constbuf, indexed by vertex id. This approach could be used for all nvc0 generations, but I didn't want to rock the boat.

---
 src/Makefile.am           |  16 ++++++++
 src/nouveau_copy.c        |   1 +
 src/nouveau_exa.c         |   2 +-
 src/nouveau_xv.c          |   2 +-
 src/nv_accel_common.c     |   1 +
 src/nv_driver.c           |   1 +
 src/nvc0_accel.c          |  37 ++++++++++++++---
 src/nvc0_exa.c            |  48 ++++++++++++++++++++--
 src/nvc0_xv.c             |  48 ++++++++++++++++++++--
 src/shader/Makefile       |  23 ++++++++---
 src/shader/exac8nv110.fp  |  47 +++++++++++++++++++++
 src/shader/exac8nv110.fpc |  38 +++++++++++++++++
 src/shader/exacanv110.fp  |  47 +++++++++++++++++++++
 src/shader/exacanv110.fpc |  38 +++++++++++++++++
 src/shader/exacmnv110.fp  |  47 +++++++++++++++++++++
 src/shader/exacmnv110.fpc |  38 +++++++++++++++++
 src/shader/exas8nv110.fp  |  42 +++++++++++++++++++
 src/shader/exas8nv110.fpc |  28 +++++++++++++
 src/shader/exasanv110.fp  |  47 +++++++++++++++++++++
 src/shader/exasanv110.fpc |  38 +++++++++++++++++
 src/shader/exascnv110.fp  |  38 +++++++++++++++++
 src/shader/exascnv110.fpc |  20 +++++++++
 src/shader/videonv110.fp  |  54 ++++++++++++++++++++++++
 src/shader/videonv110.fpc |  52 +++++++++++++++++++++++
 src/shader/xfrm2nv110.vp  |  82 +++++++++++++++++++++++++++++++++++++
 src/shader/xfrm2nv110.vpc | 102 ++++++++++++++++++++++++++++++++++++++++++++++
 26 files changed, 918 insertions(+), 19 deletions(-)
 create mode 100644 src/shader/exac8nv110.fp
 create mode 100644 src/shader/exac8nv110.fpc
 create mode 100644 src/shader/exacanv110.fp
 create mode 100644 src/shader/exacanv110.fpc
 create mode 100644 src/shader/exacmnv110.fp
 create mode 100644 src/shader/exacmnv110.fpc
 create mode 100644 src/shader/exas8nv110.fp
 create mode 100644 src/shader/exas8nv110.fpc
 create mode 100644 src/shader/exasanv110.fp
 create mode 100644 src/shader/exasanv110.fpc
 create mode 100644 src/shader/exascnv110.fp
 create mode 100644 src/shader/exascnv110.fpc
 create mode 100644 src/shader/videonv110.fp
 create mode 100644 src/shader/videonv110.fpc
 create mode 100644 src/shader/xfrm2nv110.vp
 create mode 100644 src/shader/xfrm2nv110.vpc
src/Makefile.am +16 -0
index 1e04ddf..6ba8d87 100644
@@ -77,48 +77,64 @@ EXTRA_DIST = hwdefs/nv_3ddefs.xml.h \
 	     shader/exac8nve0.fpc \
 	     shader/exac8nvf0.fp \
 	     shader/exac8nvf0.fpc \
+	     shader/exac8nv110.fp \
+	     shader/exac8nv110.fpc \
 	     shader/exacanvc0.fp \
 	     shader/exacanvc0.fpc \
 	     shader/exacanve0.fp \
 	     shader/exacanve0.fpc \
 	     shader/exacanvf0.fp \
 	     shader/exacanvf0.fpc \
+	     shader/exacanv110.fp \
+	     shader/exacanv110.fpc \
 	     shader/exacmnvc0.fp \
 	     shader/exacmnvc0.fpc \
 	     shader/exacmnve0.fp \
 	     shader/exacmnve0.fpc \
 	     shader/exacmnvf0.fp \
 	     shader/exacmnvf0.fpc \
+	     shader/exacmnv110.fp \
+	     shader/exacmnv110.fpc \
 	     shader/exas8nvc0.fp \
 	     shader/exas8nvc0.fpc \
 	     shader/exas8nve0.fp \
 	     shader/exas8nve0.fpc \
 	     shader/exas8nvf0.fp \
 	     shader/exas8nvf0.fpc \
+	     shader/exas8nv110.fp \
+	     shader/exas8nv110.fpc \
 	     shader/exasanvc0.fp \
 	     shader/exasanvc0.fpc \
 	     shader/exasanve0.fp \
 	     shader/exasanve0.fpc \
 	     shader/exasanvf0.fp \
 	     shader/exasanvf0.fpc \
+	     shader/exasanv110.fp \
+	     shader/exasanv110.fpc \
 	     shader/exascnvc0.fp \
 	     shader/exascnvc0.fpc \
 	     shader/exascnve0.fp \
 	     shader/exascnve0.fpc \
 	     shader/exascnvf0.fp \
 	     shader/exascnvf0.fpc \
+	     shader/exascnv110.fp \
+	     shader/exascnv110.fpc \
 	     shader/videonvc0.fp \
 	     shader/videonvc0.fpc \
 	     shader/videonve0.fp \
 	     shader/videonve0.fpc \
 	     shader/videonvf0.fp \
 	     shader/videonvf0.fpc \
+	     shader/videonv110.fp \
+	     shader/videonv110.fpc \
 	     shader/xfrm2nvc0.vp \
 	     shader/xfrm2nvc0.vpc \
 	     shader/xfrm2nve0.vp \
 	     shader/xfrm2nve0.vpc \
 	     shader/xfrm2nvf0.vp \
 	     shader/xfrm2nvf0.vpc \
+	     shader/xfrm2nv110.vp \
+	     shader/xfrm2nv110.vpc \
 	     shader/Makefile \
 	     nouveau_local.h \
 	     nouveau_copy.h \
src/nouveau_copy.c +1 -0
index e152a53..c139de6 100644
@@ -81,6 +81,7 @@ nouveau_copy_init(ScreenPtr pScreen)
 					 &pNv->ce_channel);
 		break;
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		ret = nouveau_object_new(&pNv->dev->object, 0,
 					 NOUVEAU_FIFO_CHANNEL_CLASS,
 					 &(struct nve0_fifo) {
src/nouveau_exa.c +1 -1
index def66ac..0f02b99 100644
@@ -514,12 +514,12 @@ nouveau_exa_init(ScreenPtr pScreen)
 		break;
 	case NV_FERMI:
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		exa->CheckComposite   = NVC0EXACheckComposite;
 		exa->PrepareComposite = NVC0EXAPrepareComposite;
 		exa->Composite        = NVC0EXAComposite;
 		exa->DoneComposite    = NVC0EXADoneComposite;
 		break;
-	case NV_MAXWELL:
 	default:
 		break;
 	}
src/nouveau_xv.c +1 -1
index d514dbf..716b18d 100644
@@ -2142,7 +2142,7 @@ NVSetupTexturedVideo (ScreenPtr pScreen, XF86VideoAdaptorPtr *textureAdaptor)
 		textureAdaptor[0] = NV40SetupTexturedVideo(pScreen, FALSE);
 		textureAdaptor[1] = NV40SetupTexturedVideo(pScreen, TRUE);
 	} else
-	if (pNv->Architecture >= NV_TESLA && pNv->Architecture < NV_MAXWELL) {
+	if (pNv->Architecture >= NV_TESLA) {
 		textureAdaptor[0] = NV50SetupTexturedVideo(pScreen);
 	}
 }
src/nv_accel_common.c +1 -0
index 9361ce8..5d12dd8 100644
@@ -722,6 +722,7 @@ NVAccelCommonInit(ScrnInfoPtr pScrn)
 	switch (pNv->Architecture) {
 	case NV_FERMI:
 	case NV_KEPLER:
+	case NV_MAXWELL:
 		INIT_CONTEXT_OBJECT(3D_NVC0);
 		break;
 	case NV_TESLA:
src/nv_driver.c +1 -0
index 4dde8e0..fff83f8 100644
@@ -389,6 +389,7 @@ NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev)
 	case 0xe0:
 	case 0xf0:
 	case 0x100:
+	case 0x110:
 		break;
 	default:
 		xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
src/nvc0_accel.c +31 -6
index d2a3b93..52a17db 100644
@@ -53,6 +53,16 @@
 #include "shader/exas8nvf0.fp"
 #include "shader/exac8nvf0.fp"
 
+#include "shader/xfrm2nv110.vp"
+#include "shader/videonv110.fp"
+
+#include "shader/exascnv110.fp"
+#include "shader/exacmnv110.fp"
+#include "shader/exacanv110.fp"
+#include "shader/exasanv110.fp"
+#include "shader/exas8nv110.fp"
+#include "shader/exac8nv110.fp"
+
 #define NVC0PushProgram(pNv,addr,code) do {                                    \
 	const unsigned size = sizeof(code) / sizeof(code[0]);                  \
 	PUSH_DATAu((pNv)->pushbuf, (pNv)->scratch, (addr), size);              \
@@ -223,9 +233,12 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 	} else if (pNv->dev->chipset < 0xf0) {
 		class  = 0xa097;
 		handle = 0x0000906e;
-	} else {
+	} else if (pNv->dev->chipset < 0x110) {
 		class  = 0xa197;
 		handle = 0x0000906e;
+	} else {
+		class  = 0xb097;
+		handle = 0x0000906e;
 	}
 
 	ret = nouveau_object_new(pNv->channel, class, class,
@@ -304,10 +317,12 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		PUSH_DATA (push, 1);
 	}
 
-	BEGIN_NVC0(push, NVC0_3D(VERTEX_QUARANTINE_ADDRESS_HIGH), 3);
-	PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
-	PUSH_DATA (push, (bo->offset + MISC_OFFSET));
-	PUSH_DATA (push, 1);
+	if (pNv->Architecture < NV_MAXWELL) {
+		BEGIN_NVC0(push, NVC0_3D(VERTEX_QUARANTINE_ADDRESS_HIGH), 3);
+		PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
+		PUSH_DATA (push, (bo->offset + MISC_OFFSET));
+		PUSH_DATA (push, 1);
+	}
 
 	BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
 	PUSH_DATA (push, (bo->offset + CODE_OFFSET) >> 32);
@@ -334,7 +349,8 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		NVC0PushProgram(pNv, PFP_S_A8, NVE0FP_Source_A8);
 		NVC0PushProgram(pNv, PFP_C_A8, NVE0FP_Composite_A8);
 		NVC0PushProgram(pNv, PFP_NV12, NVE0FP_NV12);
-	} else {
+	} else
+	if (pNv->dev->chipset < 0x110) {
 		NVC0PushProgram(pNv, PVP_PASS, NVF0VP_Transform2);
 		NVC0PushProgram(pNv, PFP_S, NVF0FP_Source);
 		NVC0PushProgram(pNv, PFP_C, NVF0FP_Composite);
@@ -343,6 +359,15 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		NVC0PushProgram(pNv, PFP_S_A8, NVF0FP_Source_A8);
 		NVC0PushProgram(pNv, PFP_C_A8, NVF0FP_Composite_A8);
 		NVC0PushProgram(pNv, PFP_NV12, NVF0FP_NV12);
+	} else {
+		NVC0PushProgram(pNv, PVP_PASS, NV110VP_Transform2);
+		NVC0PushProgram(pNv, PFP_S, NV110FP_Source);
+		NVC0PushProgram(pNv, PFP_C, NV110FP_Composite);
+		NVC0PushProgram(pNv, PFP_CCA, NV110FP_CAComposite);
+		NVC0PushProgram(pNv, PFP_CCASA, NV110FP_CACompositeSrcAlpha);
+		NVC0PushProgram(pNv, PFP_S_A8, NV110FP_Source_A8);
+		NVC0PushProgram(pNv, PFP_C_A8, NV110FP_Composite_A8);
+		NVC0PushProgram(pNv, PFP_NV12, NV110FP_NV12);
 	}
 
 	BEGIN_NVC0(push, NVC0_3D(SP_SELECT(1)), 4);
src/nvc0_exa.c +0 -0
index 6add60b..a53dfe6 100644

src/nvc0_exa.c NVC0EXAComposite(PixmapPtr pdpix, · line 922

Quoted 9 lines
src/nvc0_exa.c +6 -0
@@ -914,14 +914,56 @@ NVC0EXAComposite(PixmapPtr pdpix,
 	if (!PUSH_SPACE(push, 64))
 		return;
 
+	if (pNv->dev->chipset >= 0x110) {
+		BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
+		PUSH_DATA (push, 256);
+		PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA) >> 32);
+		PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA));
+		BEGIN_1IC0(push, NVC0_3D(CB_POS), 3 * (4 + 2 + 2) + 1);

I would suggest only "1 + 24" here, but your call.

Quoted 55 lines
src/nvc0_exa.c +39 -3
+		PUSH_DATA (push, 0x80);
+
+		PUSH_DATAf(push, dx);
+		PUSH_DATAf(push, dy + (h * 2));
+		PUSH_DATAf(push, 0);
+		PUSH_DATAf(push, 1);
+		PUSH_DATAf(push, sx);
+		PUSH_DATAf(push, sy + (h * 2));
+		PUSH_DATAf(push, mx);
+		PUSH_DATAf(push, my + (h * 2));
+
+		PUSH_DATAf(push, dx);
+		PUSH_DATAf(push, dy);
+		PUSH_DATAf(push, 0);
+		PUSH_DATAf(push, 1);
+		PUSH_DATAf(push, sx);
+		PUSH_DATAf(push, sy);
+		PUSH_DATAf(push, mx);
+		PUSH_DATAf(push, my);
+
+		PUSH_DATAf(push, dx + (w * 2));
+		PUSH_DATAf(push, dy);
+		PUSH_DATAf(push, 0);
+		PUSH_DATAf(push, 1);
+		PUSH_DATAf(push, sx + (w * 2));
+		PUSH_DATAf(push, sy);
+		PUSH_DATAf(push, mx + (w * 2));
+		PUSH_DATAf(push, my);
+	}
+
 	BEGIN_NVC0(push, NVC0_3D(SCISSOR_HORIZ(0)), 2);
 	PUSH_DATA (push, ((dx + w) << 16) | dx);
 	PUSH_DATA (push, ((dy + h) << 16) | dy);
 	BEGIN_NVC0(push, NVC0_3D(VERTEX_BEGIN_GL), 1);
 	PUSH_DATA (push, NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES);
-	PUSH_VTX2s(push, sx, sy + (h * 2), mx, my + (h * 2), dx, dy + (h * 2));
-	PUSH_VTX2s(push, sx, sy, mx, my, dx, dy);
-	PUSH_VTX2s(push, sx + (w * 2), sy, mx + (w * 2), my, dx + (w * 2), dy);
+	if (pNv->dev->chipset < 0x110) {
+		PUSH_VTX2s(push, sx, sy + (h * 2), mx, my + (h * 2), dx, dy + (h * 2));
+		PUSH_VTX2s(push, sx, sy, mx, my, dx, dy);
+		PUSH_VTX2s(push, sx + (w * 2), sy, mx + (w * 2), my, dx + (w * 2), dy);
+	} else {
+		BEGIN_NVC0(push, NVC0_3D(VERTEX_BUFFER_FIRST), 2);
+		PUSH_DATA (push, 0);
+		PUSH_DATA (push, 3);
+	}
 	BEGIN_NVC0(push, NVC0_3D(VERTEX_END_GL), 1);
 	PUSH_DATA (push, 0);
 }
src/nvc0_xv.c +0 -0
index d1d8f18..129c505 100644

src/nvc0_xv.c nvc0_xv_image_put(ScrnInfoPtr pScrn, · line 255

Quoted 9 lines
src/nvc0_xv.c +6 -0
@@ -247,15 +247,57 @@ nvc0_xv_image_put(ScrnInfoPtr pScrn,
 		    nouveau_pushbuf_refn (push, refs, 3))
 			return BadImplementation;
 
+		if (pNv->dev->chipset >= 0x110) {
+			BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
+			PUSH_DATA (push, 256);
+			PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA) >> 32);
+			PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA));
+			BEGIN_1IC0(push, NVC0_3D(CB_POS), 3 * (4 + 2 + 2) + 1);

And here as well.

Quoted 942 lines
src/nvc0_xv.c +39 -3
+			PUSH_DATA (push, 0x80);
+
+			PUSH_DATAf(push, sx1);
+			PUSH_DATAf(push, sy1);
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 1);
+			PUSH_DATAf(push, tx1);
+			PUSH_DATAf(push, ty1);
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 0);
+
+			PUSH_DATAf(push, sx2+(sx2-sx1));
+			PUSH_DATAf(push, sy1);
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 1);
+			PUSH_DATAf(push, tx2+(tx2-tx1));
+			PUSH_DATAf(push, ty1);
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 0);
+
+			PUSH_DATAf(push, sx1);
+			PUSH_DATAf(push, sy2+(sy2-sy1));
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 1);
+			PUSH_DATAf(push, tx1);
+			PUSH_DATAf(push, ty2+(ty2-ty1));
+			PUSH_DATAf(push, 0);
+			PUSH_DATAf(push, 0);
+		}
+
 		BEGIN_NVC0(push, NVC0_3D(SCISSOR_HORIZ(0)), 2);
 		PUSH_DATA (push, sx2 << NVC0_3D_SCISSOR_HORIZ_MAX__SHIFT | sx1);
 		PUSH_DATA (push, sy2 << NVC0_3D_SCISSOR_VERT_MAX__SHIFT | sy1 );
 
 		BEGIN_NVC0(push, NVC0_3D(VERTEX_BEGIN_GL), 1);
 		PUSH_DATA (push, NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES);
-		PUSH_VTX1s(push, tx1, ty1, sx1, sy1);
-		PUSH_VTX1s(push, tx2+(tx2-tx1), ty1, sx2+(sx2-sx1), sy1);
-		PUSH_VTX1s(push, tx1, ty2+(ty2-ty1), sx1, sy2+(sy2-sy1));
+		if (pNv->dev->chipset < 0x110) {
+			PUSH_VTX1s(push, tx1, ty1, sx1, sy1);
+			PUSH_VTX1s(push, tx2+(tx2-tx1), ty1, sx2+(sx2-sx1), sy1);
+			PUSH_VTX1s(push, tx1, ty2+(ty2-ty1), sx1, sy2+(sy2-sy1));
+		} else {
+			BEGIN_NVC0(push, NVC0_3D(VERTEX_BUFFER_FIRST), 2);
+			PUSH_DATA (push, 0);
+			PUSH_DATA (push, 3);
+		}
 		BEGIN_NVC0(push, NVC0_3D(VERTEX_END_GL), 1);
 		PUSH_DATA (push, 0);
 
src/shader/Makefile +18 -5
index 2d789be..12bf455 100644
@@ -22,23 +22,36 @@ NVF0_SHADERS = xfrm2nvf0.vpc \
 	       exas8nvf0.fpc \
 	       exac8nvf0.fpc \
 	       videonvf0.fpc
+NV110_SHADERS = xfrm2nv110.vpc \
+	       exascnv110.fpc \
+	       exacmnv110.fpc \
+	       exacanv110.fpc \
+	       exasanv110.fpc \
+	       exas8nv110.fpc \
+	       exac8nv110.fpc \
+	       videonv110.fpc
 
-SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS)
+SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS) $(NV110_SHADERS)
 ENVYAS ?= envyas
 
 all: $(SHADERS)
 
 $(filter %nvc0.vpc,$(SHADERS)): %.vpc: %.vp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
 $(filter %nvc0.fpc,$(SHADERS)): %.fpc: %.fp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
 
 $(filter %nve0.vpc,$(SHADERS)): %.vpc: %.vp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
 $(filter %nve0.fpc,$(SHADERS)): %.fpc: %.fp
-	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
 
 $(filter %nvf0.vpc,$(SHADERS)): %.vpc: %.vp
 	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
 $(filter %nvf0.fpc,$(SHADERS)): %.fpc: %.fp
 	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
+
+$(filter %nv110.vpc,$(SHADERS)): %.vpc: %.vp
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
+$(filter %nv110.fpc,$(SHADERS)): %.fpc: %.fp
+	cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
src/shader/exac8nv110.fp new file +47 -0
new file mode 100644
index 0000000..ce78036
@@ -0,0 +1,47 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_Composite_A8[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x00000a0a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exac8nv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r3 a[0x94] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r2 a[0x90] $r0 0x0 0x1
+tex nodep $r1 $r2 0x0 0x1 t2d 0x8
+ipa $r3 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r2 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r2 0x0 0x0 t2d 0x8
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r3 $r0 $r1
+mov $r2 $r3 0xf
+mov $r1 $r3 0xf
+sched (st 0x0) (st 0x0) (st 0x0)
+mov $r0 $r3 0xf
+exit
+#endif
src/shader/exac8nv110.fpc new file +38 -0
new file mode 100644
index 0000000..4aa1368
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0x2ff70201,
+0xc03a0014,
+0x4007ff03,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff88,
+0x2ff70200,
+0xc03a0004,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00170003,
+0x5c681000,
+0x00370002,
+0x5c980780,
+0x00370001,
+0x5c980780,
+0xfc0007e0,
+0x001f8000,
+0x00370000,
+0x5c980780,
+0x0007000f,
+0xe3000000,
src/shader/exacanv110.fp new file +47 -0
new file mode 100644
index 0000000..a70d5c5
@@ -0,0 +1,47 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_CAComposite[] = {
+	0x00001462, /* 0x0000c000 = USES_KIL, MULTI_COLORS */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000, /* FRAG_COORD_UMASK = 0x8 */
+	0x00000a0a, /* FP_INTERP[0x080], 0022 0022 */
+	0x00000000, /* FP_INTERP[0x0c0], 0 = OFF */
+	0x00000000, /* FP_INTERP[0x100], 1 = FLAT */
+	0x00000000, /* FP_INTERP[0x140], 2 = PERSPECTIVE */
+	0x00000000, /* FP_INTERP[0x180], 3 = LINEAR */
+	0x00000000, /* FP_INTERP[0x1c0] */
+	0x00000000, /* FP_INTERP[0x200] */
+	0x00000000, /* FP_INTERP[0x240] */
+	0x00000000, /* FP_INTERP[0x280] */
+	0x00000000, /* FP_INTERP[0x2c0] */
+	0x00000000, /* FP_INTERP[0x300] */
+	0x00000000,
+	0x0000000f, /* FP_RESULT_MASK (0x8000 Face ?) */
+	0x00000000, /* 0x2 = FragDepth, 0x1 = SampleMask */
+#include "exacanv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r3 a[0x94] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r2 a[0x90] $r0 0x0 0x1
+tex nodep $r4 $r2 0x0 0x1 t2d 0xf
+ipa $r1 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x0 t2d 0xf
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r3 $r3 $r7
+fmul ftz $r2 $r2 $r6
+fmul ftz $r1 $r1 $r5
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r0 $r0 $r4
+exit
+#endif
src/shader/exacanv110.fpc new file +38 -0
new file mode 100644
index 0000000..7c0ca5e
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0xaff70204,
+0xc03a0017,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00770303,
+0x5c681000,
+0x00670202,
+0x5c681000,
+0x00570101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exacmnv110.fp new file +47 -0
new file mode 100644
index 0000000..fe5c294
@@ -0,0 +1,47 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_Composite[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x00000a0a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exacmnv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r3 a[0x94] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r2 a[0x90] $r0 0x0 0x1
+tex nodep $r4 $r2 0x0 0x1 t2d 0x8
+ipa $r1 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x0 t2d 0xf
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r3 $r3 $r4
+fmul ftz $r2 $r2 $r4
+fmul ftz $r1 $r1 $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r0 $r0 $r4
+exit
+#endif
src/shader/exacmnv110.fpc new file +38 -0
new file mode 100644
index 0000000..9d62c1a
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff89,
+0x2ff70204,
+0xc03a0014,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00470303,
+0x5c681000,
+0x00470202,
+0x5c681000,
+0x00470101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exas8nv110.fp new file +42 -0
new file mode 100644
index 0000000..4fe2e19
@@ -0,0 +1,42 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_Source_A8[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x0000000a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exas8nv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r1 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x0 t2d 0x8
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+mov $r3 $r0 0xf
+mov $r2 $r0 0xf
+mov $r1 $r0 0xf
+sched (st 0x0) (st 0x0) (st 0x0)
+exit
+#endif
src/shader/exas8nv110.fpc new file +28 -0
new file mode 100644
index 0000000..1181c41
@@ -0,0 +1,28 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0x2ff70000,
+0xc03a0004,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00070003,
+0x5c980780,
+0x00070002,
+0x5c980780,
+0x00070001,
+0x5c980780,
+0xfc0007e0,
+0x001f8000,
+0x0007000f,
+0xe3000000,
src/shader/exasanv110.fp new file +47 -0
new file mode 100644
index 0000000..61374a6
@@ -0,0 +1,47 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_CACompositeSrcAlpha[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x00000a0a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exasanv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r3 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r2 a[0x80] $r0 0x0 0x1
+tex nodep $r4 $r2 0x0 0x0 t2d 0x8
+ipa $r1 a[0x94] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x90] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x1 t2d 0xf
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r3 $r3 $r4
+fmul ftz $r2 $r2 $r4
+fmul ftz $r1 $r1 $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r0 $r0 $r4
+exit
+#endif
src/shader/exasanv110.fpc new file +38 -0
new file mode 100644
index 0000000..5516a03
@@ -0,0 +1,38 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff03,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff02,
+0xe043ff88,
+0x2ff70204,
+0xc03a0004,
+0x4007ff01,
+0xe043ff89,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff89,
+0xaff70000,
+0xc03a0017,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00470303,
+0x5c681000,
+0x00470202,
+0x5c681000,
+0x00470101,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470000,
+0x5c681000,
+0x0007000f,
+0xe3000000,
src/shader/exascnv110.fp new file +38 -0
new file mode 100644
index 0000000..90bbb55
@@ -0,0 +1,38 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_Source[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x0000000a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "exascnv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r0 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r0 $r0
+ipa $r1 a[0x84] $r0 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r0 a[0x80] $r0 0x0 0x1
+tex nodep $r0 $r0 0x0 0x0 t2d 0xf
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+exit
+#endif
src/shader/exascnv110.fpc new file +20 -0
new file mode 100644
index 0000000..2dba15d
@@ -0,0 +1,20 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff00,
+0xe003ff87,
+0x00470000,
+0x50800000,
+0x4007ff01,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x0007ff00,
+0xe043ff88,
+0xaff70000,
+0xc03a0007,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x0007000f,
+0xe3000000,
src/shader/videonv110.fp new file +54 -0
new file mode 100644
index 0000000..2728311
@@ -0,0 +1,54 @@
+#ifndef ENVYAS
+static uint32_t
+NV110FP_NV12[] = {
+	0x00001462,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x80000000,
+	0x0000000a,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x0000000f,
+	0x00000000,
+#include "videonv110.fpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa pass $r2 a[0x7c] 0x0 0x0 0x1
+mufu rcp $r2 $r2
+ipa $r0 a[0x80] $r2 0x0 0x1
+sched (st 0x0) (st 0x0) (st 0x0)
+ipa $r1 a[0x84] $r2 0x0 0x1
+tex nodep $r4 $r0 0x0 0x0 t2d 0x8
+tex nodep $r0 $r0 0x0 0x1 t2d 0xc
+sched (st 0x0) (st 0x0) (st 0x0)
+depbar le 0x5 0x1 0x1
+fmul ftz $r5 $r4 c0[0x0]
+fadd ftz $r3 $r5 c0[0x4]
+sched (st 0x0) (st 0x0) (st 0x0)
+fadd ftz $r4 $r5 c0[0x8]
+fadd ftz $r5 $r5 c0[0xc]
+depbar le 0x5 0x0 0x0
+sched (st 0x0) (st 0x0) (st 0x0)
+ffma ftz $r3 $r0 c0[0x10] $r3
+ffma ftz $r4 $r0 c0[0x14] $r4
+ffma ftz $r5 $r0 c0[0x18] $r5
+sched (st 0x0) (st 0x0) (st 0x0)
+ffma ftz $r0 $r1 c0[0x1c] $r3
+ffma ftz $r2 $r1 c0[0x24] $r5
+ffma ftz $r1 $r1 c0[0x20] $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+exit
+#endif
src/shader/videonv110.fpc new file +52 -0
new file mode 100644
index 0000000..31d745a
@@ -0,0 +1,52 @@
+0xfc0007e0,
+0x001f8000,
+0xcff7ff02,
+0xe003ff87,
+0x00470202,
+0x50800000,
+0x0027ff00,
+0xe043ff88,
+0xfc0007e0,
+0x001f8000,
+0x4027ff01,
+0xe043ff88,
+0x2ff70004,
+0xc03a0004,
+0x2ff70000,
+0xc03a0016,
+0xfc0007e0,
+0x001f8000,
+0x34170001,
+0xf0f00000,
+0x00070405,
+0x4c681000,
+0x00170503,
+0x4c581000,
+0xfc0007e0,
+0x001f8000,
+0x00270504,
+0x4c581000,
+0x00370505,
+0x4c581000,
+0x34070000,
+0xf0f00000,
+0xfc0007e0,
+0x001f8000,
+0x00470003,
+0x49a00180,
+0x00570004,
+0x49a00200,
+0x00670005,
+0x49a00280,
+0xfc0007e0,
+0x001f8000,
+0x00770100,
+0x49a00180,
+0x00970102,
+0x49a00280,
+0x00870101,
+0x49a00200,
+0xfc0007e0,
+0x001f8000,
+0x0007000f,
+0xe3000000,
src/shader/xfrm2nv110.vp new file +82 -0
new file mode 100644
index 0000000..bbfc527
@@ -0,0 +1,82 @@
+#ifndef ENVYAS
+static uint32_t
+NV110VP_Transform2[] = {
+	0x02000461,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x000ff000,
+	0x00000000, /* VP_ATTR_EN[0x000] */
+	0x00000000, /* VP_ATTR_EN[0x080] */
+	0x00000000, /* VP_ATTR_EN[0x100] */
+	0x00000000,
+	0x00000000, /* VP_ATTR_EN[0x200] */
+	0x80000000, /* VERTEXID */
+	0x00000000, /* VP_ATTR_EN[0x300] */
+	0x00000000,
+	0x0033f000, /* VP_EXPORT_EN[0x040] */
+	0x00000000, /* VP_EXPORT_EN[0x0c0] */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000, /* VP_EXPORT_EN[0x2c0] */
+	0x00000000,
+#include "xfrm2nv110.vpc"
+};
+#else
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ld b32 $r5 a[0x2fc] 0x0
+shl $r5 $r5 0x5
+ld b64 $r0 c0[$r5+0x80]
+sched (st 0x0) (st 0x0) (st 0x0)
+ld b64 $r2 c0[$r5+0x88]
+st b128 a[0x70] $r0 0x0
+
+ld b64 $r0 c0[$r5+0x90]
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r2 $r0 c0[0x0]
+fmul ftz $r3 $r0 c0[0xc]
+fmul ftz $r4 $r0 c0[0x18]
+sched (st 0x0) (st 0x0) (st 0x0)
+ffma ftz $r2 $r1 c0[0x4] $r2
+ffma ftz $r3 $r1 c0[0x10] $r3
+ffma ftz $r4 $r1 c0[0x1c] $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+fadd ftz $r2 $r2 c0[0x8]
+fadd ftz $r3 $r3 c0[0x14]
+fadd ftz $r4 $r4 c0[0x20]
+sched (st 0x0) (st 0x0) (st 0x0)
+mufu rcp $r4 $r4
+fmul ftz $r2 $r2 $r4
+fmul ftz $r3 $r3 $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r0 $r2 c0[0x24]
+fmul ftz $r1 $r3 c0[0x28]
+st b64 a[0x80] $r0 0x0
+
+sched (st 0x0) (st 0x0) (st 0x0)
+ld b64 $r0 c0[$r5+0x98]
+fmul ftz $r2 $r0 c0[0x2c]
+fmul ftz $r3 $r0 c0[0x38]
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r4 $r0 c0[0x44]
+ffma ftz $r2 $r1 c0[0x30] $r2
+ffma ftz $r3 $r1 c0[0x3c] $r3
+sched (st 0x0) (st 0x0) (st 0x0)
+ffma ftz $r4 $r1 c0[0x48] $r4
+fadd ftz $r2 $r2 c0[0x34]
+fadd ftz $r3 $r3 c0[0x40]
+sched (st 0x0) (st 0x0) (st 0x0)
+fadd ftz $r4 $r4 c0[0x4c]
+mufu rcp $r4 $r4
+fmul ftz $r2 $r2 $r4
+sched (st 0x0) (st 0x0) (st 0x0)
+fmul ftz $r3 $r3 $r4
+fmul ftz $r0 $r2 c0[0x50]
+fmul ftz $r1 $r3 c0[0x54]
+sched (st 0x0) (st 0x0) (st 0x0)
+st b64 a[0x90] $r0 0x0
+
+exit
+#endif
src/shader/xfrm2nv110.vpc new file +92 -0
new file mode 100644
index 0000000..0d9ebfd
@@ -0,0 +1,102 @@
+0xfc0007e0,
+0x001f8000,
+0x2fc7ff05,
+0xefd87f80,
+0x00570505,
+0x38480000,
+0x08070500,
+0xef950000,
+0xfc0007e0,
+0x001f8000,
+0x08870502,
+0xef950000,
+0x0707ff00,
+0xeff1ff80,
+0x09070500,
+0xef950000,
+0xfc0007e0,
+0x001f8000,
+0x00070002,
+0x4c681000,
+0x00370003,
+0x4c681000,
+0x00670004,
+0x4c681000,
+0xfc0007e0,
+0x001f8000,
+0x00170102,
+0x49a00100,
+0x00470103,
+0x49a00180,
+0x00770104,
+0x49a00200,
+0xfc0007e0,
+0x001f8000,
+0x00270202,
+0x4c581000,
+0x00570303,
+0x4c581000,
+0x00870404,
+0x4c581000,
+0xfc0007e0,
+0x001f8000,
+0x00470404,
+0x50800000,
+0x00470202,
+0x5c681000,
+0x00470303,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00970200,
+0x4c681000,
+0x00a70301,
+0x4c681000,
+0x0807ff00,
+0xeff0ff80,
+0xfc0007e0,
+0x001f8000,
+0x09870500,
+0xef950000,
+0x00b70002,
+0x4c681000,
+0x00e70003,
+0x4c681000,
+0xfc0007e0,
+0x001f8000,
+0x01170004,
+0x4c681000,
+0x00c70102,
+0x49a00100,
+0x00f70103,
+0x49a00180,
+0xfc0007e0,
+0x001f8000,
+0x01270104,
+0x49a00200,
+0x00d70202,
+0x4c581000,
+0x01070303,
+0x4c581000,
+0xfc0007e0,
+0x001f8000,
+0x01370404,
+0x4c581000,
+0x00470404,
+0x50800000,
+0x00470202,
+0x5c681000,
+0xfc0007e0,
+0x001f8000,
+0x00470303,
+0x5c681000,

src/shader/xfrm2nv110.vpc line 102

Quoted 10 lines
src/shader/xfrm2nv110.vpc new file +10 -0
+0x01470200,
+0x4c681000,
+0x01570301,
+0x4c681000,
+0xfc0007e0,
+0x001f8000,
+0x0907ff00,
+0xeff0ff80,
+0x0007000f,
+0xe3000000,

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#5 lore raw

PATCH v2 2/7 hwdefs: update nvc0_3d, add gm107_texture for new TIC format

In reply to a message not in the archive

These are copied directly from the mesa repository.

---
 src/Makefile.am                |   1 +
 src/hwdefs/gm107_texture.xml.h | 365 +++++++++++++++++
 src/hwdefs/nvc0_3d.xml.h       | 867 +++++++++++++++++++++++++----------------
 3 files changed, 893 insertions(+), 340 deletions(-)
 create mode 100644 src/hwdefs/gm107_texture.xml.h
src/Makefile.am +1 -0
index 6ba8d87..d777fe5 100644
@@ -71,6 +71,7 @@ EXTRA_DIST = hwdefs/nv_3ddefs.xml.h \
 	     hwdefs/nv50_texture.h \
 	     hwdefs/nvc0_3d.xml.h \
 	     hwdefs/nvc0_m2mf.xml.h \
+	     hwdefs/gm107_texture.xml.h \
 	     shader/exac8nvc0.fp \
 	     shader/exac8nvc0.fpc \
 	     shader/exac8nve0.fp \
src/hwdefs/gm107_texture.xml.h new file +365 -0

365 lines not on this page · raw message

src/hwdefs/nvc0_3d.xml.h +527 -340

1,708 lines not on this page · raw message

Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
#6 lore raw

PATCH v2 3/7 nvc0: make use of the new hwdefs for TEX_CB_INDEX

In reply to a message not in the archive
---
 src/nvc0_accel.c | 2 +-
 src/nvc0_accel.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
src/nvc0_accel.c +1 -1
index 52a17db..0682806 100644
@@ -313,7 +313,7 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		PUSH_DATA (push, 0x00000001);
 		BEGIN_NVC0(push, NVC0_3D(CB_BIND(4)), 1);
 		PUSH_DATA (push, 0x11);
-		BEGIN_NVC0(push, SUBC_3D(0x2608), 1);
+		BEGIN_NVC0(push, NVE4_3D(TEX_CB_INDEX), 1);
 		PUSH_DATA (push, 1);
 	}
 
src/nvc0_accel.h +1 -0
index 4c3bb0f..607e97b 100644
@@ -12,6 +12,7 @@
 /* subchannel assignments, compatible with kepler's fixed layout  */
 #define SUBC_3D(mthd)    0, (mthd)
 #define NVC0_3D(mthd)    SUBC_3D(NVC0_3D_##mthd)
+#define NVE4_3D(mthd)    SUBC_3D(NVE4_3D_##mthd)
 #define SUBC_M2MF(mthd)  2, (mthd)
 #define SUBC_P2MF(mthd)  2, (mthd)
 #define NVC0_M2MF(mthd)  SUBC_M2MF(NVC0_M2MF_##mthd)
Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
#7 lore raw

PATCH v2 4/7 nvc0: rename BEGIN_IMC0 to IMMED_NVC0

In reply to a message not in the archive

For consistency with mesa. It wasn't used anywhere previously.

---
 src/nouveau_local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/nouveau_local.h +1 -1
index 3de69a2..dd49395 100644
@@ -237,7 +237,7 @@ BEGIN_NIC0(struct nouveau_pushbuf *push, int subc, int mthd, int size)
 }
 
 static inline void
-BEGIN_IMC0(struct nouveau_pushbuf *push, int subc, int mthd, int data)
+IMMED_NVC0(struct nouveau_pushbuf *push, int subc, int mthd, int data)
 {
 	PUSH_DATA (push, 0x80000000 | (data << 16) | (subc << 13) | (mthd / 4));
 }
Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
#8 lore raw

PATCH v2 5/7 nvc0: refactor TIC uploads to allow different specifics per generation

In reply to a message not in the archive

This flips GM10x to using the updated format, which is what I tested with. However GM20x and GP10x also use this TIC format.

---
 src/nvc0_accel.c | 11 ++++++++++
 src/nvc0_accel.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 src/nvc0_exa.c   | 23 ++++---------------
 src/nvc0_xv.c    | 67 +++++++++++++++++++-------------------------------------
 4 files changed, 93 insertions(+), 64 deletions(-)
src/nvc0_accel.c +11 -0
index 0682806..8da5051 100644
@@ -322,6 +322,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
 		PUSH_DATA (push, (bo->offset + MISC_OFFSET));
 		PUSH_DATA (push, 1);
+	} else {
+		/* Use new TIC format. Not strictly necessary for GM20x+ */
+		IMMED_NVC0(push, SUBC_3D(0x0f10), 1);
+		if (pNv->dev->chipset >= 0x120) {
+			/* Use center sample locations. */
+			BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+		}
 	}
 
 	BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
src/nvc0_accel.h +56 -0

66 lines not on this page · raw message

src/nvc0_exa.c +4 -19
index a53dfe6..017a7da 100644
@@ -532,20 +532,13 @@ NVC0EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op)
 static Bool
 NVC0EXAPictSolid(NVPtr pNv, PicturePtr ppict, unsigned unit)
 {
-	uint64_t offset = pNv->scratch->offset + SOLID(unit);
 	struct nouveau_pushbuf *push = pNv->pushbuf;
 
 	PUSH_DATAu(push, pNv->scratch, SOLID(unit), 1);
 	PUSH_DATA (push, ppict->pSourcePict->solidFill.color);
 	PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-	PUSH_DATA (push, _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
-	PUSH_DATA (push,  offset);
-	PUSH_DATA (push, (offset >> 32) | 0xd005d000);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, 0x00000001);
-	PUSH_DATA (push, 0x00010001);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
+	PUSH_TIC  (push, pNv->scratch, SOLID(unit), 1, 1, 4,
+		   _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
 	PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
 	PUSH_DATA (push, NV50TSC_1_0_WRAPS_REPEAT |
 			 NV50TSC_1_0_WRAPT_REPEAT |
@@ -651,16 +644,8 @@ NVC0EXAPictTexture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, unsigned unit)
 
 	PUSH_REFN (push, bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
 	PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-	PUSH_DATA (push, format);
-	PUSH_DATA (push, bo->offset);
-	PUSH_DATA (push, (bo->offset >> 32) |
-			 (bo->config.nvc0.tile_mode << 18) |
-			 0xd0005000);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, (1 << 31) | ppix->drawable.width);
-	PUSH_DATA (push, (1 << 16) | ppix->drawable.height);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
+	PUSH_TIC  (push, bo, 0, ppix->drawable.width, ppix->drawable.height, 0,
+		   format);
 
 	PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
 	if (ppict->repeat) {
src/nvc0_xv.c +22 -45

100 lines not on this page · raw message

Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1477576980-7962-6-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#10 lore raw

Re: [PATCH v2 5/7] nvc0: refactor TIC uploads to allow different specifics per generation

Are you sure this refactoring doesn't break anything?

Few comments inline.

Quoted 114 lines · Ilia Mirkin

This flips GM10x to using the updated format, which is what I tested with. However GM20x and GP10x also use this TIC format.

---
 src/nvc0_accel.c | 11 ++++++++++
 src/nvc0_accel.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 src/nvc0_exa.c   | 23 ++++---------------
 src/nvc0_xv.c    | 67 +++++++++++++++++++-------------------------------------
 4 files changed, 93 insertions(+), 64 deletions(-)
src/nvc0_accel.c +11 -0
index 0682806..8da5051 100644
@@ -322,6 +322,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 		PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
 		PUSH_DATA (push, (bo->offset + MISC_OFFSET));
 		PUSH_DATA (push, 1);
+	} else {
+		/* Use new TIC format. Not strictly necessary for GM20x+ */
+		IMMED_NVC0(push, SUBC_3D(0x0f10), 1);
+		if (pNv->dev->chipset >= 0x120) {
+			/* Use center sample locations. */
+			BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+			PUSH_DATA (push, 0x88888888);
+		}
 	}
 
 	BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
src/nvc0_accel.h +56 -0
index 607e97b..959f67f 100644
@@ -7,6 +7,7 @@
 #include "hwdefs/nvc0_m2mf.xml.h"
 #include "hwdefs/nv50_defs.xml.h"
 #include "hwdefs/nv50_texture.h"
+#include "hwdefs/gm107_texture.xml.h"
 #include "hwdefs/nv_3ddefs.xml.h"
 
 /* subchannel assignments, compatible with kepler's fixed layout  */
@@ -108,4 +109,59 @@ PUSH_DATAu(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
 	}
 }
 
+static __inline__ void
+PUSH_TIC(struct nouveau_pushbuf *push, struct nouveau_bo *bo, unsigned offset,
+	 unsigned width, unsigned height, unsigned pitch, unsigned format)
+{
+	if (push->client->device->chipset < 0x110) {
+		unsigned tic2 = 0xd0001000;
+		if (pitch == 0)
+			tic2 |= 0x00004000;
+		else
+			tic2 |= 0x0005c000;
+		PUSH_DATA(push, format);
+		PUSH_DATA(push, bo->offset + offset);
+		PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+			        (bo->config.nvc0.tile_mode << 18) |
+			        tic2);
+		PUSH_DATA(push, 0x00300000);
+		PUSH_DATA(push, 0x80000000 | width);
+		PUSH_DATA(push, 0x00010000 | height);
+		PUSH_DATA(push, 0x03000000);
+		PUSH_DATA(push, 0x00000000);
+	} else {
+		unsigned tile_mode = bo->config.nvc0.tile_mode;
+		PUSH_DATA(push, (format & 0x3f) | ((format & ~0x3f) << 1));
+		PUSH_DATA(push, bo->offset + offset);
+		if (pitch == 0) {
+			PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+				  GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR);
+			PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+				  ((tile_mode & 0x007)) |
+				  ((tile_mode & 0x070) >> (4 - 3)) |
+				  ((tile_mode & 0x700) >> (8 - 6)));
+			PUSH_DATA(push, GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_V |
+				  GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+				  GM107_TIC2_4_TEXTURE_TYPE_TWO_D |
+				  (width - 1));
+			PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |
+				        ((height - 1) & 0xffff));
+			PUSH_DATA(push, GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_TWO |
+				        GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_ONE);
+			PUSH_DATA(push, 0x00000000);
+		} else {
+			PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+				        GM107_TIC2_2_HEADER_VERSION_PITCH);
+			PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+				        (pitch >> 5));
+			PUSH_DATA(push, GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+				  GM107_TIC2_4_TEXTURE_TYPE_TWO_D_NO_MIPMAP |
+				  (width - 1));
+			PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS | (height - 1));
+			PUSH_DATA(push, 0x000000000);
+			PUSH_DATA(push, 0x000000000);
+		}
+	}
+}
+
 #endif
src/nvc0_exa.c +0 -1
index a53dfe6..017a7da 100644
@@ -532,20 +532,13 @@ NVC0EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op)
 static Bool
 NVC0EXAPictSolid(NVPtr pNv, PicturePtr ppict, unsigned unit)
 {
-	uint64_t offset = pNv->scratch->offset + SOLID(unit);

src/nvc0_exa.c NVC0EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op) · line 545

Quoted 10 lines
src/nvc0_exa.c +0 -5
 	struct nouveau_pushbuf *push = pNv->pushbuf;
 
 	PUSH_DATAu(push, pNv->scratch, SOLID(unit), 1);
 	PUSH_DATA (push, ppict->pSourcePict->solidFill.color);
 	PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-	PUSH_DATA (push, _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
-	PUSH_DATA (push,  offset);
-	PUSH_DATA (push, (offset >> 32) | 0xd005d000);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, 0x00000001);

You always set bit-31 in PUSH_TIC, but it's not set here, is that intended?

Quoted 44 lines
src/nvc0_exa.c +4 -13
-	PUSH_DATA (push, 0x00010001);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
+	PUSH_TIC  (push, pNv->scratch, SOLID(unit), 1, 1, 4,
+		   _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
 	PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
 	PUSH_DATA (push, NV50TSC_1_0_WRAPS_REPEAT |
 			 NV50TSC_1_0_WRAPT_REPEAT |
@@ -651,16 +644,8 @@ NVC0EXAPictTexture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, unsigned unit)
 
 	PUSH_REFN (push, bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
 	PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-	PUSH_DATA (push, format);
-	PUSH_DATA (push, bo->offset);
-	PUSH_DATA (push, (bo->offset >> 32) |
-			 (bo->config.nvc0.tile_mode << 18) |
-			 0xd0005000);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, (1 << 31) | ppix->drawable.width);
-	PUSH_DATA (push, (1 << 16) | ppix->drawable.height);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
+	PUSH_TIC  (push, bo, 0, ppix->drawable.width, ppix->drawable.height, 0,
+		   format);
 
 	PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
 	if (ppict->repeat) {
src/nvc0_xv.c +0 -2
index 129c505..c3e58da 100644
@@ -74,7 +74,6 @@ nvc0_xv_image_put(ScrnInfoPtr pScrn,
 		{ dst, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR },
 	};
 	struct nouveau_pushbuf *push = pNv->pushbuf;
-	uint32_t mode = 0xd0005000 | (src->config.nvc0.tile_mode << 18);
 	float X1, X2, Y1, Y2;
 	BoxPtr pbox;
 	int nbox;
@@ -105,71 +104,49 @@ nvc0_xv_image_put(ScrnInfoPtr pScrn,
 
 	PUSH_DATAu(push, pNv->scratch, TIC_OFFSET, 16);
 	if (id == FOURCC_YV12 || id == FOURCC_I420) {
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |

src/nvc0_xv.c nvc0_xv_image_put(ScrnInfoPtr pScrn, · line 116

Quoted 10 lines
src/nvc0_xv.c +2 -4
+		PUSH_TIC(push, src, packed_y, width, height, 0,
+			 NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
 			 NV50TIC_0_0_FMT_8);
-	PUSH_DATA (push, ((src->offset + packed_y)));
-	PUSH_DATA (push, ((src->offset + packed_y) >> 32) | mode);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, width);

Same here, I bet bit-31 is not set. :-)

Quoted 70 lines
src/nvc0_xv.c +17 -35
-	PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
+		PUSH_TIC(push, src, uv, width >> 1, height >> 1, 0,
+			 NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
 			 NV50TIC_0_0_FMT_8_8);
-	PUSH_DATA (push, ((src->offset + uv)));
-	PUSH_DATA (push, ((src->offset + uv) >> 32) | mode);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, width >> 1);
-	PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | (height >> 1));
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
 	} else {
-	if (id == FOURCC_UYVY) {
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
+		unsigned format;
+		if (id == FOURCC_UYVY) {
+		format = NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
-			 NV50TIC_0_0_FMT_8_8);
-	} else {
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
+			 NV50TIC_0_0_FMT_8_8;
+		} else {
+		format = NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
-			 NV50TIC_0_0_FMT_8_8);
-	}
-	PUSH_DATA (push, ((src->offset + packed_y)));
-	PUSH_DATA (push, ((src->offset + packed_y) >> 32) | mode);
-	PUSH_DATA (push, 0x00300000);
-	PUSH_DATA (push, width);
-	PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
-	if (id == FOURCC_UYVY) {
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C2 | NV50TIC_0_0_TYPEA_UNORM |
+			 NV50TIC_0_0_FMT_8_8;
+		}
+		PUSH_TIC(push, src, packed_y, width, height, 0, format);
+
+		if (id == FOURCC_UYVY) {
+		format = NV50TIC_0_0_MAPA_C2 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
-			 NV50TIC_0_0_FMT_8_8_8_8);
-	} else {
-	PUSH_DATA (push, NV50TIC_0_0_MAPA_C3 | NV50TIC_0_0_TYPEA_UNORM |
+			 NV50TIC_0_0_FMT_8_8_8_8;
+		} else {
+		format = NV50TIC_0_0_MAPA_C3 | NV50TIC_0_0_TYPEA_UNORM |
 			 NV50TIC_0_0_MAPB_C1 | NV50TIC_0_0_TYPEB_UNORM |
 			 NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
 			 NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
-			 NV50TIC_0_0_FMT_8_8_8_8);
-	}
-	PUSH_DATA (push, ((src->offset + packed_y)));
-	PUSH_DATA (push, ((src->offset + packed_y) >> 32) | mode);
-	PUSH_DATA (push, 0x00300000);

src/nvc0_xv.c nvc0_xv_image_put(ScrnInfoPtr pScrn, · line 152

Quoted 10 lines
src/nvc0_xv.c +3 -4
-	PUSH_DATA (push, (width >> 1));
-	PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
-	PUSH_DATA (push, 0x03000000);
-	PUSH_DATA (push, 0x00000000);
+			 NV50TIC_0_0_FMT_8_8_8_8;
+		}
+		PUSH_TIC(push, src, packed_y, width >> 1, height, 0, format);
 	}
 
 	PUSH_DATAu(push, pNv->scratch, TSC_OFFSET, 16);

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 0e027351-d919-6f0c-5d81-0b7328e8e98e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#12 lore raw

Re: [PATCH v2 5/7] nvc0: refactor TIC uploads to allow different specifics per generation

Quoted 137 lines · Samuel Pitoiset

Are you sure this refactoring doesn't break anything?

Few comments inline.

Quoted 131 lines · Ilia Mirkin

This flips GM10x to using the updated format, which is what I tested with. However GM20x and GP10x also use this TIC format.

---
 src/nvc0_accel.c | 11 ++++++++++
 src/nvc0_accel.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 src/nvc0_exa.c   | 23 ++++---------------
 src/nvc0_xv.c    | 67
+++++++++++++++++++-------------------------------------
 4 files changed, 93 insertions(+), 64 deletions(-)
src/nvc0_accel.c +11 -0
index 0682806..8da5051 100644
@@ -322,6 +322,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
                PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
                PUSH_DATA (push, (bo->offset + MISC_OFFSET));
                PUSH_DATA (push, 1);
+       } else {
+               /* Use new TIC format. Not strictly necessary for GM20x+
 */
+               IMMED_NVC0(push, SUBC_3D(0x0f10), 1);
+               if (pNv->dev->chipset >= 0x120) {
+                       /* Use center sample locations. */
+                       BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+               }
        }
 
        BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
src/nvc0_accel.h +3 -0
index 607e97b..959f67f 100644
@@ -7,6 +7,7 @@
 #include "hwdefs/nvc0_m2mf.xml.h"
 #include "hwdefs/nv50_defs.xml.h"
 #include "hwdefs/nv50_texture.h"
+#include "hwdefs/gm107_texture.xml.h"
 #include "hwdefs/nv_3ddefs.xml.h"
 
 /* subchannel assignments, compatible with kepler's fixed layout  */
@@ -108,4 +109,59 @@ PUSH_DATAu(struct nouveau_pushbuf *push, struct
 nouveau_bo *bo,
        }
 }
 
+static __inline__ void
+PUSH_TIC(struct nouveau_pushbuf *push, struct nouveau_bo *bo, unsigned

offset,

src/nvc0_accel.h +21 -0
+        unsigned width, unsigned height, unsigned pitch, unsigned format)
+{
+       if (push->client->device->chipset < 0x110) {
+               unsigned tic2 = 0xd0001000;
+               if (pitch == 0)
+                       tic2 |= 0x00004000;
+               else
+                       tic2 |= 0x0005c000;
+               PUSH_DATA(push, format);
+               PUSH_DATA(push, bo->offset + offset);
+               PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+                               (bo->config.nvc0.tile_mode << 18) |
+                               tic2);
+               PUSH_DATA(push, 0x00300000);
+               PUSH_DATA(push, 0x80000000 | width);
+               PUSH_DATA(push, 0x00010000 | height);
+               PUSH_DATA(push, 0x03000000);
+               PUSH_DATA(push, 0x00000000);
+       } else {
+               unsigned tile_mode = bo->config.nvc0.tile_mode;
+               PUSH_DATA(push, (format & 0x3f) | ((format & ~0x3f) <<

1));

src/nvc0_accel.h +4 -0
+               PUSH_DATA(push, bo->offset + offset);
+               if (pitch == 0) {
+                       PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+

GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR);

src/nvc0_accel.h +5 -0
+                       PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+                                 ((tile_mode & 0x007)) |
+                                 ((tile_mode & 0x070) >> (4 - 3)) |
+                                 ((tile_mode & 0x700) >> (8 - 6)));
+                       PUSH_DATA(push,

GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_V |

src/nvc0_accel.h +6 -0
+                                 GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+                                 GM107_TIC2_4_TEXTURE_TYPE_TWO_D |
+                                 (width - 1));
+                       PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |
+                                       ((height - 1) & 0xffff));
+                       PUSH_DATA(push,

GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_TWO |
+
GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_ONE);

src/nvc0_accel.h +4 -0
+                       PUSH_DATA(push, 0x00000000);
+               } else {
+                       PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+

GM107_TIC2_2_HEADER_VERSION_PITCH);

src/nvc0_accel.h +3 -0
+                       PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+                                       (pitch >> 5));
+                       PUSH_DATA(push,

GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+
GM107_TIC2_4_TEXTURE_TYPE_TWO_D_NO_MIPMAP |

src/nvc0_accel.h +2 -0
+                                 (width - 1));
+                       PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |

(height - 1));

src/nvc0_accel.h +6 -0
+                       PUSH_DATA(push, 0x000000000);
+                       PUSH_DATA(push, 0x000000000);
+               }
+       }
+}
+
 #endif
src/nvc0_exa.c +0 -1
index a53dfe6..017a7da 100644
@@ -532,20 +532,13 @@ NVC0EXACheckTexture(PicturePtr ppict, PicturePtr
 pdpict, int op)
 static Bool
 NVC0EXAPictSolid(NVPtr pNv, PicturePtr ppict, unsigned unit)
 {
-       uint64_t offset = pNv->scratch->offset + SOLID(unit);
        struct nouveau_pushbuf *push = pNv->pushbuf;
 
Quoted 11 lines

src/nvc0_exa.c NVC0EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op) · line 545

Quoted 8 lines
src/nvc0_exa.c +0 -5
        PUSH_DATAu(push, pNv->scratch, SOLID(unit), 1);
        PUSH_DATA (push, ppict->pSourcePict->solidFill.color);
        PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-       PUSH_DATA (push, _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
-       PUSH_DATA (push,  offset);
-       PUSH_DATA (push, (offset >> 32) | 0xd005d000);
-       PUSH_DATA (push, 0x00300000);
-       PUSH_DATA (push, 0x00000001);

You always set bit-31 in PUSH_TIC, but it's not set here, is that intended?

Yep, that's fine. That bit 31 controls the meaning of the last TIC word. (Which is technically only supported on G84+). However in practice, we don't use any of those features, and setting that bit on G80 doesn't hurt anything (I'm pretty sure). On G80 (and without that word set), that last word is some colorkey-related thing. I don't know exactly... that mode is never used for anything useful.

-ilia
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): CAKb7Uvg7=njU-JUSnE2CvM8LfGuGBwwi1ttC7LEbpmsnLQdV0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#14 lore raw

Re: [PATCH v2 5/7] nvc0: refactor TIC uploads to allow different specifics per generation

Quoted 151 lines · Ilia Mirkin
Quoted 137 lines · Samuel Pitoiset

Are you sure this refactoring doesn't break anything?

Few comments inline.

Quoted 131 lines · Ilia Mirkin

This flips GM10x to using the updated format, which is what I tested with. However GM20x and GP10x also use this TIC format.

---
 src/nvc0_accel.c | 11 ++++++++++
 src/nvc0_accel.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 src/nvc0_exa.c   | 23 ++++---------------
 src/nvc0_xv.c    | 67
+++++++++++++++++++-------------------------------------
 4 files changed, 93 insertions(+), 64 deletions(-)
src/nvc0_accel.c +11 -0
index 0682806..8da5051 100644
@@ -322,6 +322,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
                PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
                PUSH_DATA (push, (bo->offset + MISC_OFFSET));
                PUSH_DATA (push, 1);
+       } else {
+               /* Use new TIC format. Not strictly necessary for GM20x+
 */
+               IMMED_NVC0(push, SUBC_3D(0x0f10), 1);
+               if (pNv->dev->chipset >= 0x120) {
+                       /* Use center sample locations. */
+                       BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+                       PUSH_DATA (push, 0x88888888);
+               }
        }
 
        BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
src/nvc0_accel.h +3 -0
index 607e97b..959f67f 100644
@@ -7,6 +7,7 @@
 #include "hwdefs/nvc0_m2mf.xml.h"
 #include "hwdefs/nv50_defs.xml.h"
 #include "hwdefs/nv50_texture.h"
+#include "hwdefs/gm107_texture.xml.h"
 #include "hwdefs/nv_3ddefs.xml.h"
 
 /* subchannel assignments, compatible with kepler's fixed layout  */
@@ -108,4 +109,59 @@ PUSH_DATAu(struct nouveau_pushbuf *push, struct
 nouveau_bo *bo,
        }
 }
 
+static __inline__ void
+PUSH_TIC(struct nouveau_pushbuf *push, struct nouveau_bo *bo, unsigned

offset,

src/nvc0_accel.h +21 -0
+        unsigned width, unsigned height, unsigned pitch, unsigned format)
+{
+       if (push->client->device->chipset < 0x110) {
+               unsigned tic2 = 0xd0001000;
+               if (pitch == 0)
+                       tic2 |= 0x00004000;
+               else
+                       tic2 |= 0x0005c000;
+               PUSH_DATA(push, format);
+               PUSH_DATA(push, bo->offset + offset);
+               PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+                               (bo->config.nvc0.tile_mode << 18) |
+                               tic2);
+               PUSH_DATA(push, 0x00300000);
+               PUSH_DATA(push, 0x80000000 | width);
+               PUSH_DATA(push, 0x00010000 | height);
+               PUSH_DATA(push, 0x03000000);
+               PUSH_DATA(push, 0x00000000);
+       } else {
+               unsigned tile_mode = bo->config.nvc0.tile_mode;
+               PUSH_DATA(push, (format & 0x3f) | ((format & ~0x3f) <<

1));

src/nvc0_accel.h +4 -0
+               PUSH_DATA(push, bo->offset + offset);
+               if (pitch == 0) {
+                       PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+

GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR);

src/nvc0_accel.h +5 -0
+                       PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+                                 ((tile_mode & 0x007)) |
+                                 ((tile_mode & 0x070) >> (4 - 3)) |
+                                 ((tile_mode & 0x700) >> (8 - 6)));
+                       PUSH_DATA(push,

GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_V |

src/nvc0_accel.h +6 -0
+                                 GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+                                 GM107_TIC2_4_TEXTURE_TYPE_TWO_D |
+                                 (width - 1));
+                       PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |
+                                       ((height - 1) & 0xffff));
+                       PUSH_DATA(push,

GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_TWO |
+
GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_ONE);

src/nvc0_accel.h +4 -0
+                       PUSH_DATA(push, 0x00000000);
+               } else {
+                       PUSH_DATA(push, ((bo->offset + offset) >> 32) |
+

GM107_TIC2_2_HEADER_VERSION_PITCH);

src/nvc0_accel.h +3 -0
+                       PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
+                                       (pitch >> 5));
+                       PUSH_DATA(push,

GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
+
GM107_TIC2_4_TEXTURE_TYPE_TWO_D_NO_MIPMAP |

src/nvc0_accel.h +2 -0
+                                 (width - 1));
+                       PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |

(height - 1));

src/nvc0_accel.h +6 -0
+                       PUSH_DATA(push, 0x000000000);
+                       PUSH_DATA(push, 0x000000000);
+               }
+       }
+}
+
 #endif
src/nvc0_exa.c +0 -1
index a53dfe6..017a7da 100644
@@ -532,20 +532,13 @@ NVC0EXACheckTexture(PicturePtr ppict, PicturePtr
 pdpict, int op)
 static Bool
 NVC0EXAPictSolid(NVPtr pNv, PicturePtr ppict, unsigned unit)
 {
-       uint64_t offset = pNv->scratch->offset + SOLID(unit);
        struct nouveau_pushbuf *push = pNv->pushbuf;
 
Quoted 11 lines

src/nvc0_exa.c NVC0EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op) · line 545

Quoted 8 lines
src/nvc0_exa.c +0 -5
        PUSH_DATAu(push, pNv->scratch, SOLID(unit), 1);
        PUSH_DATA (push, ppict->pSourcePict->solidFill.color);
        PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
-       PUSH_DATA (push, _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
-       PUSH_DATA (push,  offset);
-       PUSH_DATA (push, (offset >> 32) | 0xd005d000);
-       PUSH_DATA (push, 0x00300000);
-       PUSH_DATA (push, 0x00000001);

You always set bit-31 in PUSH_TIC, but it's not set here, is that intended?

Quoted 6 lines

Yep, that's fine. That bit 31 controls the meaning of the last TIC word. (Which is technically only supported on G84+). However in practice, we don't use any of those features, and setting that bit on G80 doesn't hurt anything (I'm pretty sure). On G80 (and without that word set), that last word is some colorkey-related thing. I don't know exactly... that mode is never used for anything useful.

Okay, hopefully it will work as expected.

Quoted 3 lines

-ilia

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#15 lore raw

PATCH v2 6/7 copy: add maxwell/pascal copy engine classes

In reply to a message not in the archive
---
 src/nouveau_copy.c |  2 ++
 src/nvc0_accel.c   | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
src/nouveau_copy.c +2 -0
index c139de6..7118a7a 100644
@@ -42,6 +42,8 @@ nouveau_copy_init(ScreenPtr pScreen)
 		int engine;
 		Bool (*init)(NVPtr);
 	} methods[] = {
+		{ 0xc0b5, 0, nouveau_copya0b5_init },
+		{ 0xb0b5, 0, nouveau_copya0b5_init },
 		{ 0xa0b5, 0, nouveau_copya0b5_init },
 		{ 0x90b8, 5, nouveau_copy90b5_init },
 		{ 0x90b5, 4, nouveau_copy90b5_init },
src/nvc0_accel.c +9 -1
index 8da5051..d0a835e 100644
@@ -156,9 +156,17 @@ NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn)
 {
 	NVPtr pNv = NVPTR(pScrn);
 	struct nouveau_pushbuf *push = pNv->pushbuf;
+	uint32_t class;
 	int ret;
 
-	ret = nouveau_object_new(pNv->channel, 0x0000a0b5, 0xa0b5,
+	if (pNv->dev->chipset < 0x110)
+		class = 0xa0b5;
+	else if (pNv->dev->chipset < 0x130)
+		class = 0xb0b5;
+	else
+		class = 0xc0b5;
+
+	ret = nouveau_object_new(pNv->channel, class, class,
 				 NULL, 0, &pNv->NvCOPY);
 	if (ret)
 		return FALSE;
Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1477576980-7962-7-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

Reviewed-by
#17 lore raw

Re: [PATCH v2 6/7] copy: add maxwell/pascal copy engine classes

0xc0b5 is not in rnndb, I guess it should be GP100_COPY, right?

Quoted 33 lines · Ilia Mirkin
---
 src/nouveau_copy.c |  2 ++
 src/nvc0_accel.c   | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
src/nouveau_copy.c +2 -0
index c139de6..7118a7a 100644
@@ -42,6 +42,8 @@ nouveau_copy_init(ScreenPtr pScreen)
 		int engine;
 		Bool (*init)(NVPtr);
 	} methods[] = {
+		{ 0xc0b5, 0, nouveau_copya0b5_init },
+		{ 0xb0b5, 0, nouveau_copya0b5_init },
 		{ 0xa0b5, 0, nouveau_copya0b5_init },
 		{ 0x90b8, 5, nouveau_copy90b5_init },
 		{ 0x90b5, 4, nouveau_copy90b5_init },
src/nvc0_accel.c +2 -1
index 8da5051..d0a835e 100644
@@ -156,9 +156,17 @@ NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn)
 {
 	NVPtr pNv = NVPTR(pScrn);
 	struct nouveau_pushbuf *push = pNv->pushbuf;
+	uint32_t class;
 	int ret;
 
-	ret = nouveau_object_new(pNv->channel, 0x0000a0b5, 0xa0b5,
+	if (pNv->dev->chipset < 0x110)

src/nvc0_accel.c NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn) · line 172

Quoted 10 lines
src/nvc0_accel.c +7 -0
+		class = 0xa0b5;
+	else if (pNv->dev->chipset < 0x130)
+		class = 0xb0b5;
+	else
+		class = 0xc0b5;
+
+	ret = nouveau_object_new(pNv->channel, class, class,
 				 NULL, 0, &pNv->NvCOPY);
 	if (ret)
 		return FALSE;

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 555d9fc2-f543-d29b-ef17-ded5013ae410-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#19 lore raw

Re: [PATCH v2 6/7] copy: add maxwell/pascal copy engine classes

Yep. It's in the nouveau codebase, check ce/gp100.c.

Quoted 37 lines · Samuel Pitoiset

0xc0b5 is not in rnndb, I guess it should be GP100_COPY, right?

Quoted 31 lines · Ilia Mirkin
---
 src/nouveau_copy.c |  2 ++
 src/nvc0_accel.c   | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
src/nouveau_copy.c +2 -0
index c139de6..7118a7a 100644
@@ -42,6 +42,8 @@ nouveau_copy_init(ScreenPtr pScreen)
                int engine;
                Bool (*init)(NVPtr);
        } methods[] = {
+               { 0xc0b5, 0, nouveau_copya0b5_init },
+               { 0xb0b5, 0, nouveau_copya0b5_init },
                { 0xa0b5, 0, nouveau_copya0b5_init },
                { 0x90b8, 5, nouveau_copy90b5_init },
                { 0x90b5, 4, nouveau_copy90b5_init },
src/nvc0_accel.c +1 -0
index 8da5051..d0a835e 100644
@@ -156,9 +156,17 @@ NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn)
 {
        NVPtr pNv = NVPTR(pScrn);
        struct nouveau_pushbuf *push = pNv->pushbuf;
+       uint32_t class;
        int ret;
 
Quoted 14 lines

src/nvc0_accel.c NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn) · line 172

Quoted 13 lines
src/nvc0_accel.c +8 -1
-       ret = nouveau_object_new(pNv->channel, 0x0000a0b5, 0xa0b5,
+       if (pNv->dev->chipset < 0x110)
+               class = 0xa0b5;
+       else if (pNv->dev->chipset < 0x130)
+               class = 0xb0b5;
+       else
+               class = 0xc0b5;
+
+       ret = nouveau_object_new(pNv->channel, class, class,
                                 NULL, 0, &pNv->NvCOPY);
        if (ret)
                return FALSE;

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#20 lore raw

PATCH v2 7/7 recognize and accelerate GM20x

In reply to a message not in the archive
---
 src/nv_driver.c  |  2 ++
 src/nvc0_accel.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
src/nv_driver.c +2 -0
index fff83f8..61940a8 100644
@@ -390,6 +390,7 @@ NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev)
 	case 0xf0:
 	case 0x100:
 	case 0x110:
+	case 0x120:
 		break;
 	default:
 		xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
@@ -941,6 +942,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
 		pNv->Architecture = NV_KEPLER;
 		break;
 	case 0x110:
+	case 0x120:
 		pNv->Architecture = NV_MAXWELL;
 		break;
 	default:
src/nvc0_accel.c +9 -1
index d0a835e..6c2bae8 100644
@@ -244,9 +244,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 	} else if (pNv->dev->chipset < 0x110) {
 		class  = 0xa197;
 		handle = 0x0000906e;
-	} else {
+	} else if (pNv->dev->chipset < 0x120) {
 		class  = 0xb097;
 		handle = 0x0000906e;
+	} else if (pNv->dev->chipset < 0x130) {
+		class  = 0xb197;
+		handle = 0x0000906e;
+	} else {
+		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+			   "No 3D acceleration support for NV%X\n",
+			   pNv->dev->chipset);
+		return FALSE;
 	}
 
 	ret = nouveau_object_new(pNv->channel, class, class,
Signature · 6 lines
2.7.3

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1477576980-7962-8-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

Reviewed-by
#22 lore raw

Re: [PATCH v2 7/7] recognize and accelerate GM20x

Quoted 40 lines · Ilia Mirkin
---
 src/nv_driver.c  |  2 ++
 src/nvc0_accel.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
src/nv_driver.c +2 -0
index fff83f8..61940a8 100644
@@ -390,6 +390,7 @@ NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev)
 	case 0xf0:
 	case 0x100:
 	case 0x110:
+	case 0x120:
 		break;
 	default:
 		xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
@@ -941,6 +942,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
 		pNv->Architecture = NV_KEPLER;
 		break;
 	case 0x110:
+	case 0x120:
 		pNv->Architecture = NV_MAXWELL;
 		break;
 	default:
src/nvc0_accel.c +2 -1
index d0a835e..6c2bae8 100644
@@ -244,9 +244,17 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
 	} else if (pNv->dev->chipset < 0x110) {
 		class  = 0xa197;
 		handle = 0x0000906e;
-	} else {
+	} else if (pNv->dev->chipset < 0x120) {
 		class  = 0xb097;
 		handle = 0x0000906e;
+	} else if (pNv->dev->chipset < 0x130) {

src/nvc0_accel.c NVAccelInit3D_NVC0(ScrnInfoPtr pScrn) · line 260

Quoted 10 lines
src/nvc0_accel.c +7 -0
+		class  = 0xb197;
+		handle = 0x0000906e;
+	} else {
+		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+			   "No 3D acceleration support for NV%X\n",
+			   pNv->dev->chipset);
+		return FALSE;
 	}
 
 	ret = nouveau_object_new(pNv->channel, class, class,

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau