summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-31 17:51:17 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-31 17:51:17 +0000
commit0b87ad8dfc5ebf9f3d0e60931cccbf81fd42f7cf (patch)
tree17a4d829ec208831d693d8ad15e8e82c1f5ca6ce
parent66cdbc3951e5b5d73142219b4451022c9193dcb5 (diff)
hwtest/pgraph: Enter Rankine methods.
-rw-r--r--hwtest/pgraph.cc33
-rw-r--r--hwtest/pgraph_class.h5
-rw-r--r--hwtest/pgraph_class_ifc.cc12
-rw-r--r--hwtest/pgraph_class_kelvin.cc48
-rw-r--r--hwtest/pgraph_class_sifm.cc10
-rw-r--r--hwtest/pgraph_class_solid.cc4
-rw-r--r--hwtest/pgraph_class_surf.cc22
-rw-r--r--hwtest/pgraph_mthd.cc2
-rw-r--r--hwtest/pgraph_mthd_grobj.cc4
-rw-r--r--hwtest/pgraph_mthd_misc.cc6
-rw-r--r--include/nvhw/pgraph.h6
-rw-r--r--nvhw/pgraph.c14
-rw-r--r--nvhw/pgraph_xy4.c70
13 files changed, 208 insertions, 28 deletions
diff --git a/hwtest/pgraph.cc b/hwtest/pgraph.cc
index 5adf96ad..efddd8fd 100644
--- a/hwtest/pgraph.cc
+++ b/hwtest/pgraph.cc
@@ -34,7 +34,7 @@ using namespace hwtest::pgraph;
class PGraphClassTests : public hwtest::Test {
public:
bool supported() override {
- return chipset.card_type < 0x30;
+ return chipset.card_type < 0x40;
}
std::vector<Class *> classes() {
if (chipset.card_type < 3) {
@@ -185,6 +185,25 @@ public:
new Kelvin(opt, rnd(), 0x597, "kelvin_nv25"),
});
}
+ } else if (chipset.card_type == 0x30) {
+ res.insert(res.end(), {
+ new Kelvin(opt, rnd(), 0x597, "kelvin_nv25"),
+ new Rankine(opt, rnd(), 0x397, "rankine_nv30"),
+ });
+ if (chipset.chipset == 0x30 || chipset.chipset == 0x31) {
+ res.insert(res.end(), {
+ new Kelvin(opt, rnd(), 0x097, "kelvin_nv20"),
+ });
+ } else if (chipset.chipset == 0x35 || chipset.chipset == 0x36) {
+ res.insert(res.end(), {
+ new Kelvin(opt, rnd(), 0x097, "kelvin_nv20"),
+ new Rankine(opt, rnd(), 0x497, "rankine_nv35"),
+ });
+ } else if (chipset.chipset == 0x34) {
+ res.insert(res.end(), {
+ new Rankine(opt, rnd(), 0x697, "rankine_nv34"),
+ });
+ }
}
if (chipset.card_type >= 0x10) {
res.insert(res.end(), {
@@ -202,6 +221,18 @@ public:
new SurfSwz(opt, rnd(), 0x9e, "surfswz_nv15"),
});
}
+ if (chipset.card_type == 0x30) {
+ res.insert(res.end(), {
+ new Line(opt, rnd(), 0x35c, "lin_nv30"),
+ new Ifc(opt, rnd(), 0x38a, "ifc_nv30"),
+ new Iifc(opt, rnd(), 0x364, "iifc_nv30"),
+ new Sifc(opt, rnd(), 0x366, "sifc_nv30"),
+ new Tfc(opt, rnd(), 0x37b, "tfc_nv30"),
+ new Sifm(opt, rnd(), 0x389, "sifm_nv30"),
+ new Surf2D(opt, rnd(), 0x362, "surf2d_nv30"),
+ new SurfSwz(opt, rnd(), 0x39e, "surfswz_nv30"),
+ });
+ }
return res;
}
}
diff --git a/hwtest/pgraph_class.h b/hwtest/pgraph_class.h
index 7d1f8656..e686ad1f 100644
--- a/hwtest/pgraph_class.h
+++ b/hwtest/pgraph_class.h
@@ -270,6 +270,11 @@ class Kelvin : public Class {
using Class::Class;
};
+class Rankine : public Class {
+ std::vector<SingleMthdTest *> mthds() override;
+ using Class::Class;
+};
+
class OpClip : public Class {
std::vector<SingleMthdTest *> mthds() override;
using Class::Class;
diff --git a/hwtest/pgraph_class_ifc.cc b/hwtest/pgraph_class_ifc.cc
index d9cebbd1..78b094ef 100644
--- a/hwtest/pgraph_class_ifc.cc
+++ b/hwtest/pgraph_class_ifc.cc
@@ -109,6 +109,8 @@ class MthdIfcFormat : public SingleMthdTest {
}
}
bool is_valid_val() override {
+ if (cls & 0xff00)
+ return val < 8 && val != 0;
return val < 6 && val != 0;
}
void emulate_mthd() override {
@@ -124,6 +126,10 @@ class MthdIfcFormat : public SingleMthdTest {
fmt = 0xd;
if (sfmt == 5)
fmt = 0xe;
+ if (sfmt == 6 && is_new && chipset.card_type >= 0x30)
+ fmt = 0x18;
+ if (sfmt == 7 && is_new && chipset.card_type >= 0x30)
+ fmt = 0x19;
if (!extr(exp.nsource, 1, 1)) {
insrt(egrobj[1], 8, 8, fmt);
exp.ctx_cache[subc][1] = exp.ctx_switch[1];
@@ -216,7 +222,7 @@ class MthdIfcData : public SingleMthdTest {
}
void emulate_mthd() override {
uint32_t rv = val;
- switch (extr(nv04_pgraph_formats(&exp), 12, 4)) {
+ switch (extr(nv04_pgraph_formats(&exp), 12, 5)) {
case 1:
rv = nv04_pgraph_bswap(&exp, rv);
break;
@@ -338,7 +344,7 @@ std::vector<SingleMthdTest *> Sifc::mthds() {
new MthdCtxSurf2D(opt, rnd(), "ctx_surf2d", 7, cls, 0x198, SURF2D_NV10),
});
}
- if (cls == 0x66) {
+ if ((cls & 0xff) == 0x66) {
res.insert(res.end(), {
new MthdDither(opt, rnd(), "dither", 17, cls, 0x2f8),
});
@@ -371,7 +377,7 @@ std::vector<SingleMthdTest *> Iifc::mthds() {
new MthdIfcSize(opt, rnd(), "size_in", 16, cls, 0x3fc, IFC_IN),
new MthdIifcData(opt, rnd(), "iifc_data", 17, cls, 0x400, 0x700),
};
- if (cls == 0x64) {
+ if ((cls & 0xff) == 0x64) {
res.insert(res.end(), {
new MthdDither(opt, rnd(), "dither", 18, cls, 0x3e0),
});
diff --git a/hwtest/pgraph_class_kelvin.cc b/hwtest/pgraph_class_kelvin.cc
index b85750d2..dfc657be 100644
--- a/hwtest/pgraph_class_kelvin.cc
+++ b/hwtest/pgraph_class_kelvin.cc
@@ -114,12 +114,56 @@ std::vector<SingleMthdTest *> Kelvin::mthds() {
};
if (cls == 0x597) {
res.insert(res.end(), {
- new UntestedMthd(opt, rnd(), "dma_clipid", -1, cls, 0x1ac),
- new UntestedMthd(opt, rnd(), "dma_zcull", -1, cls, 0x1b0),
+ new UntestedMthd(opt, rnd(), "dma_clipid", -1, cls, 0x1ac), // XXX
+ new UntestedMthd(opt, rnd(), "dma_zcull", -1, cls, 0x1b0), // XXX
});
}
return res;
}
+std::vector<SingleMthdTest *> Rankine::mthds() {
+ std::vector<SingleMthdTest *> res = {
+ new MthdNop(opt, rnd(), "nop", -1, cls, 0x100),
+ new MthdNotify(opt, rnd(), "notify", -1, cls, 0x104),
+ new MthdWarning(opt, rnd(), "warning", -1, cls, 0x108),
+ new MthdState(opt, rnd(), "state", -1, cls, 0x10c),
+ new MthdSync(opt, rnd(), "sync", -1, cls, 0x110),
+ new MthdFlipSet(opt, rnd(), "flip_write", -1, cls, 0x120, 1, 1),
+ new MthdFlipSet(opt, rnd(), "flip_read", -1, cls, 0x124, 1, 0),
+ new MthdFlipSet(opt, rnd(), "flip_modulo", -1, cls, 0x128, 1, 2),
+ new MthdFlipBumpWrite(opt, rnd(), "flip_bump_write", -1, cls, 0x12c, 1),
+ new UntestedMthd(opt, rnd(), "flip_unk130", -1, cls, 0x130),
+ new MthdPmTrigger(opt, rnd(), "pm_trigger", -1, cls, 0x140),
+ new MthdDmaNotify(opt, rnd(), "dma_notify", -1, cls, 0x180),
+ new UntestedMthd(opt, rnd(), "dma_tex_a", -1, cls, 0x184), // XXX
+ new UntestedMthd(opt, rnd(), "dma_tex_b", -1, cls, 0x188), // XXX
+ new MthdDmaSurf(opt, rnd(), "dma_surf_color_b", -1, cls, 0x18c, 6, SURF_NV10),
+ new UntestedMthd(opt, rnd(), "dma_state", -1, cls, 0x190), // XXX
+ new MthdDmaSurf(opt, rnd(), "dma_surf_color_a", -1, cls, 0x194, 2, SURF_NV10),
+ new MthdDmaSurf(opt, rnd(), "dma_surf_zeta", -1, cls, 0x198, 3, SURF_NV10),
+ new UntestedMthd(opt, rnd(), "dma_vtx_a", -1, cls, 0x19c), // XXX
+ new UntestedMthd(opt, rnd(), "dma_vtx_b", -1, cls, 0x1a0), // XXX
+ new UntestedMthd(opt, rnd(), "dma_fence", -1, cls, 0x1a4), // XXX
+ new UntestedMthd(opt, rnd(), "dma_query", -1, cls, 0x1a8), // XXX
+ new UntestedMthd(opt, rnd(), "dma_clipid", -1, cls, 0x1ac), // XXX
+ new UntestedMthd(opt, rnd(), "dma_zcull", -1, cls, 0x1b0), // XXX
+ new UntestedMthd(opt, rnd(), "clip_h", -1, cls, 0x200), // XXX
+ new UntestedMthd(opt, rnd(), "clip_v", -1, cls, 0x204), // XXX
+ new MthdSurf3DFormat(opt, rnd(), "surf_format", -1, cls, 0x208, true),
+ new MthdSurfPitch2(opt, rnd(), "surf_pitch_2", -1, cls, 0x20c, 2, 3, SURF_NV10),
+ new MthdSurfOffset(opt, rnd(), "color_offset", -1, cls, 0x210, 2, SURF_NV10),
+ new MthdSurfOffset(opt, rnd(), "zeta_offset", -1, cls, 0x214, 3, SURF_NV10),
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x218, 2), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x220, 8), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x240, 0x10), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x280, 0x20), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x300, 0x40), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x400, 0x100), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x800, 0x200), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x1000, 0x400), // XXX
+ };
+ return res;
+}
+
}
}
diff --git a/hwtest/pgraph_class_sifm.cc b/hwtest/pgraph_class_sifm.cc
index 99ab6017..3c7fec52 100644
--- a/hwtest/pgraph_class_sifm.cc
+++ b/hwtest/pgraph_class_sifm.cc
@@ -48,6 +48,8 @@ class MthdSifmFormat : public SingleMthdTest {
if (nv04_pgraph_is_nv11p(&chipset) && extr(exp.ctx_switch[0], 22, 1)) {
max = 0xb;
}
+ if (cls & 0xff00)
+ max = 0xd;
}
return val <= max && val != 0;
}
@@ -80,6 +82,12 @@ class MthdSifmFormat : public SingleMthdTest {
if (sfmt == 0xb)
fmt = 0x17;
}
+ if (chipset.card_type >= 0x30) {
+ if (sfmt == 0xc)
+ fmt = 0x18;
+ if (sfmt == 0xd)
+ fmt = 0x19;
+ }
if (!extr(exp.nsource, 1, 1)) {
insrt(egrobj[1], 8, 8, fmt);
exp.ctx_cache[subc][1] = exp.ctx_switch[1];
@@ -121,7 +129,7 @@ class MthdSurfDvdFormat : public SingleMthdTest {
exp.valid[0] |= 4;
exp.surf_pitch[4] = val & pgraph_pitch_mask(&chipset);
insrt(exp.ctx_valid, 12, 1, !extr(exp.nsource, 1, 1));
- insrt(exp.surf_format, 16, 4, fmt);
+ pgraph_set_surf_format(&exp, 4, fmt);
}
using SingleMthdTest::SingleMthdTest;
};
diff --git a/hwtest/pgraph_class_solid.cc b/hwtest/pgraph_class_solid.cc
index 41753694..4fc440b1 100644
--- a/hwtest/pgraph_class_solid.cc
+++ b/hwtest/pgraph_class_solid.cc
@@ -68,6 +68,8 @@ class MthdSolidFormat : public SingleMthdTest {
bool is_new;
bool supported() override { return chipset.card_type >= 4; }
bool is_valid_val() override {
+ if (cls & 0xff00)
+ return val < 5 && val != 0;
return val < (is_new || cls == 0x4b ? 4 : 5) && val != 0;
}
void adjust_orig_mthd() override {
@@ -87,6 +89,8 @@ class MthdSolidFormat : public SingleMthdTest {
fmt = 0xe;
if (sfmt == 4 && !is_new)
fmt = 0x11;
+ if (sfmt == 4 && is_new && chipset.card_type >= 0x30)
+ fmt = 0x19;
if (!extr(exp.nsource, 1, 1)) {
insrt(egrobj[1], 8, 8, fmt);
exp.ctx_cache[subc][1] = exp.ctx_switch[1];
diff --git a/hwtest/pgraph_class_surf.cc b/hwtest/pgraph_class_surf.cc
index 77208032..1206e4fc 100644
--- a/hwtest/pgraph_class_surf.cc
+++ b/hwtest/pgraph_class_surf.cc
@@ -74,7 +74,7 @@ class MthdSurfFormat : public SingleMthdTest {
else
fmt = 6;
}
- insrt(exp.surf_format, which*4, 4, fmt);
+ pgraph_set_surf_format(&exp, which, fmt);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -147,8 +147,8 @@ class MthdSurf2DFormat : public SingleMthdTest {
fmt = 0xd;
break;
}
- insrt(exp.surf_format, 0, 4, fmt);
- insrt(exp.surf_format, 4, 4, fmt);
+ pgraph_set_surf_format(&exp, 0, fmt);
+ pgraph_set_surf_format(&exp, 1, fmt);
}
using SingleMthdTest::SingleMthdTest;
};
@@ -224,7 +224,7 @@ class MthdSurfSwzFormat : public SingleMthdTest {
if (cls == 0x9e && chipset.card_type < 0x20) {
fmt = 0;
}
- insrt(exp.surf_format, 20, 4, fmt);
+ pgraph_set_surf_format(&exp, 5, fmt);
insrt(exp.surf_swizzle[1], 16, 4, swzx);
insrt(exp.surf_swizzle[1], 24, 4, swzy);
}
@@ -261,8 +261,12 @@ void MthdDmaSurf::emulate_mthd() {
uint32_t base = (pobj[2] & ~0xfff) | extr(pobj[0], 20, 12);
uint32_t limit = pobj[1];
uint32_t dcls = extr(pobj[0], 0, 12);
- exp.surf_limit[which] = (limit & offset_mask) | (chipset.card_type < 0x20 ? 0xf : 0x3f) | (dcls == 0x30) << 31;
- exp.surf_base[which] = base & offset_mask;
+ exp.surf_limit[which] = (limit & offset_mask) | ((chipset.card_type < 0x20 || chipset.chipset == 0x34) ? 0xf : 0x3f) | (dcls == 0x30) << 31;
+ insrt(exp.surf_base[which], 0, 30, base & offset_mask);
+ if (chipset.chipset == 0x34) {
+ insrt(exp.surf_base[which], 30, 1, extr(pobj[0], 16, 2) == 1);
+ insrt(exp.surf_base[which], 31, 1, dcls == 0x30);
+ }
bool bad = true;
if (dcls == 0x30 || dcls == 0x3d)
bad = false;
@@ -460,7 +464,7 @@ void MthdSurf3DFormat::emulate_mthd() {
fmt = 0x6;
break;
}
- insrt(exp.surf_format, 8, 4, fmt);
+ pgraph_set_surf_format(&exp, 2, fmt);
insrt(exp.surf_type, 0, 2, extr(val, 8, 2));
if (chipset.card_type < 0x20) {
if (nv04_pgraph_is_nv11p(&chipset))
@@ -476,14 +480,14 @@ void MthdSurf3DFormat::emulate_mthd() {
int zfmt = extr(val, 4, 4);
if (zfmt > 2)
zfmt = 0;
- insrt(exp.surf_format, 12, 4, zfmt);
+ pgraph_set_surf_format(&exp, 3, zfmt);
} else {
int zfmt = extr(val, 4, 1) ? 1 : 2;
if (sfmt == 1 || sfmt == 2 || sfmt == 3 || sfmt == 9 || sfmt == 0xa)
zfmt = 1;
if (!fmt)
zfmt = 0;
- insrt(exp.surf_format, 12, 4, zfmt);
+ pgraph_set_surf_format(&exp, 3, zfmt);
}
}
insrt(exp.surf_swizzle[0], 16, 4, extr(val, 16, 4));
diff --git a/hwtest/pgraph_mthd.cc b/hwtest/pgraph_mthd.cc
index b76ad0a2..2552eca8 100644
--- a/hwtest/pgraph_mthd.cc
+++ b/hwtest/pgraph_mthd.cc
@@ -79,7 +79,7 @@ static uint32_t nv04_pgraph_gen_ctxobj(int cnum, std::mt19937 &rnd, int subc, st
ctxobj[i] = rnd();
}
if (rnd() & 1) {
- uint32_t classes[] = {0x30, 0x12, 0x72, 0x19, 0x43, 0x17, 0x57, 0x18, 0x44, 0x42, 0x52, 0x53, 0x58, 0x59, 0x5a, 0x5b, 0x62, 0x93, 0x82, 0x9e};
+ uint32_t classes[] = {0x30, 0x12, 0x72, 0x19, 0x43, 0x17, 0x57, 0x18, 0x44, 0x42, 0x52, 0x53, 0x58, 0x59, 0x5a, 0x5b, 0x62, 0x93, 0x82, 0x9e, 0x39e, 0x362};
insrt(ctxobj[0], 0, 12, classes[rnd() % ARRAY_SIZE(classes)]);
}
if (rnd() & 1) {
diff --git a/hwtest/pgraph_mthd_grobj.cc b/hwtest/pgraph_mthd_grobj.cc
index e1044e8f..e9b0f969 100644
--- a/hwtest/pgraph_mthd_grobj.cc
+++ b/hwtest/pgraph_mthd_grobj.cc
@@ -220,6 +220,8 @@ void MthdCtxSurf::emulate_mthd() {
bool isswz = ccls == 0x52;
if (nv04_pgraph_is_nv15p(&chipset) && ccls == 0x9e)
isswz = true;
+ if (chipset.card_type == 0x30 && ccls == 0x39e)
+ isswz = true;
if (chipset.card_type < 0x10 && !extr(exp.nsource, 1, 1)) {
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
insrt(egrobj[0], 25 + (which & 1), 1, ccls != 0x30);
@@ -258,6 +260,8 @@ void MthdCtxSurf2D::emulate_mthd() {
bool isswz = ccls == 0x52;
if (nv04_pgraph_is_nv15p(&chipset) && ccls == 0x9e)
isswz = true;
+ if (chipset.card_type == 0x30 && ccls == 0x39e)
+ isswz = true;
if (isswz && !swz_ok)
bad = true;
if (chipset.chipset >= 5 && chipset.card_type < 0x10 && !extr(exp.nsource, 1, 1)) {
diff --git a/hwtest/pgraph_mthd_misc.cc b/hwtest/pgraph_mthd_misc.cc
index c3cf1420..8eb336a3 100644
--- a/hwtest/pgraph_mthd_misc.cc
+++ b/hwtest/pgraph_mthd_misc.cc
@@ -267,7 +267,7 @@ void MthdNotify::emulate_mthd() {
}
bool MthdFlipSet::is_valid_mthd() {
- if ((cls & 0xff) == 0x97)
+ if (cls == 0x97 || cls == 0x597)
return extr(exp.debug[3], 25, 1);
return true;
}
@@ -277,7 +277,7 @@ void MthdFlipSet::emulate_mthd() {
}
bool MthdFlipBumpWrite::is_valid_mthd() {
- if ((cls & 0xff) == 0x97)
+ if (cls == 0x97 || cls == 0x597)
return extr(exp.debug[3], 25, 1);
return true;
}
@@ -293,7 +293,7 @@ void MthdFlipBumpWrite::emulate_mthd() {
bool PGraphMthdMiscTests::supported() {
- return chipset.card_type < 0x30;
+ return chipset.card_type < 0x40;
}
Test::Subtests PGraphMthdMiscTests::subtests() {
diff --git a/include/nvhw/pgraph.h b/include/nvhw/pgraph.h
index 0838c4ef..b1a483e8 100644
--- a/include/nvhw/pgraph.h
+++ b/include/nvhw/pgraph.h
@@ -283,6 +283,8 @@ uint32_t nv03_pgraph_rop(struct pgraph_state *state, int x, int y, uint32_t pixe
uint32_t nv03_pgraph_solid_rop(struct pgraph_state *state, int x, int y, uint32_t pixel);
bool pgraph_cliprect_pass(struct pgraph_state *state, int32_t x, int32_t y);
void pgraph_prep_draw(struct pgraph_state *state, bool poly, bool noclip);
+void pgraph_set_surf_format(struct pgraph_state *state, int which, uint32_t fmt);
+uint32_t pgraph_surf_format(struct pgraph_state *state, int which);
/* pgraph_xy.c */
void pgraph_set_xy_d(struct pgraph_state *state, int xy, int idx, int sid, bool carry, bool oob, bool ovf, int cstat);
@@ -442,7 +444,7 @@ static inline bool pgraph_is_class_line(struct pgraph_state *state) {
if (state->chipset.card_type < 4) {
return cls == 0x9 || cls == 0xa;
} else {
- return cls == 0x1c || cls == 0x5c;
+ return cls == 0x1c || cls == 0x5c || (cls == 0x35c && state->chipset.card_type == 0x30);
}
}
@@ -486,6 +488,8 @@ static inline bool pgraph_is_class_sifc(struct pgraph_state *state) {
return true;
if (state->chipset.chipset >= 5 && cls == 0x66)
return true;
+ if (state->chipset.card_type == 0x30 && cls == 0x366)
+ return true;
return false;
}
}
diff --git a/nvhw/pgraph.c b/nvhw/pgraph.c
index f52df9e8..6453bbb3 100644
--- a/nvhw/pgraph.c
+++ b/nvhw/pgraph.c
@@ -1174,3 +1174,17 @@ void pgraph_prep_draw(struct pgraph_state *state, bool poly, bool noclip) {
state->fifo_enable = 0;
}
}
+
+void pgraph_set_surf_format(struct pgraph_state *state, int which, uint32_t fmt) {
+ if (state->chipset.card_type < 0x30)
+ insrt(state->surf_format, which*4, 4, fmt);
+ else
+ insrt(state->surf_format, which*5, 5, fmt);
+}
+
+uint32_t pgraph_surf_format(struct pgraph_state *state, int which) {
+ if (state->chipset.card_type < 0x30)
+ return extr(state->surf_format, which*4, 4);
+ else
+ return extr(state->surf_format, which*5, 5);
+}
diff --git a/nvhw/pgraph_xy4.c b/nvhw/pgraph_xy4.c
index b563651b..b66ad42f 100644
--- a/nvhw/pgraph_xy4.c
+++ b/nvhw/pgraph_xy4.c
@@ -106,7 +106,24 @@ bool nv04_pgraph_is_syncable_class(struct pgraph_state *state) {
case 0x99:
return nv04_pgraph_is_nv17p(&state->chipset);
case 0x97:
- return state->chipset.card_type >= 0x20;
+ return state->chipset.card_type >= 0x20 && state->chipset.chipset != 0x34;
+ case 0x597:
+ return nv04_pgraph_is_nv25p(&state->chipset);
+ case 0x397:
+ return state->chipset.card_type == 0x30;
+ case 0x497:
+ return state->chipset.chipset == 0x35 || state->chipset.chipset == 0x36;
+ case 0x697:
+ return state->chipset.chipset == 0x34;
+ case 0x35c:
+ case 0x38a:
+ case 0x364:
+ case 0x366:
+ case 0x37b:
+ case 0x389:
+ case 0x362:
+ case 0x39e:
+ return state->chipset.card_type == 0x30;
default:
return false;
}
@@ -142,7 +159,21 @@ bool nv04_pgraph_is_sync_class(struct pgraph_state *state) {
case 0x99:
return nv04_pgraph_is_nv17p(&state->chipset);
case 0x97:
- return state->chipset.card_type >= 0x20;
+ return state->chipset.card_type >= 0x20 && state->chipset.chipset != 0x34;
+ case 0x597:
+ return nv04_pgraph_is_nv25p(&state->chipset);
+ case 0x397:
+ return state->chipset.card_type == 0x30;
+ case 0x497:
+ return state->chipset.chipset == 0x35 || state->chipset.chipset == 0x36;
+ case 0x697:
+ return state->chipset.chipset == 0x34;
+ case 0x362:
+ case 0x39e:
+ case 0x389:
+ case 0x38a:
+ case 0x37b:
+ return state->chipset.card_type == 0x30;
default:
return false;
}
@@ -191,9 +222,15 @@ bool nv04_pgraph_is_3d_class(struct pgraph_state *state) {
case 0x85:
return alt;
case 0x97:
- return state->chipset.card_type >= 0x20;
+ return state->chipset.card_type >= 0x20 && state->chipset.chipset != 0x34;
case 0x597:
return nv04_pgraph_is_nv25p(&state->chipset);
+ case 0x397:
+ return state->chipset.card_type == 0x30;
+ case 0x497:
+ return state->chipset.chipset == 0x35 || state->chipset.chipset == 0x36;
+ case 0x697:
+ return state->chipset.chipset == 0x34;
}
return false;
}
@@ -241,6 +278,10 @@ bool nv04_pgraph_is_oclip_class(struct pgraph_state *state) {
case 0x79:
case 0x67:
return alt;
+ case 0x366:
+ case 0x389:
+ case 0x37b:
+ return state->chipset.card_type == 0x30;
}
return false;
}
@@ -295,6 +336,13 @@ bool nv04_pgraph_is_new_render_class(struct pgraph_state *state) {
return state->chipset.card_type >= 0x10;
case 0x9f:
return state->chipset.chipset > 0x10;
+ case 0x35c:
+ case 0x38a:
+ case 0x364:
+ case 0x366:
+ case 0x37b:
+ case 0x389:
+ return state->chipset.card_type == 0x30;
}
return false;
}
@@ -381,7 +429,7 @@ void nv04_pgraph_uclip_write(struct pgraph_state *state, int which, int xy, int
uint32_t nv04_pgraph_formats(struct pgraph_state *state) {
int cls = pgraph_class(state);
uint32_t src = extr(state->ctx_switch[1], 8, 8);
- uint32_t surf = extr(state->surf_format, 0, 4);
+ uint32_t surf = pgraph_surf_format(state, 0);
bool dither = extr(state->debug[3], 12, 1);
if (state->chipset.chipset >= 5) {
int op = extr(state->ctx_switch[0], 15, 3);
@@ -428,6 +476,14 @@ uint32_t nv04_pgraph_formats(struct pgraph_state *state) {
case 0x9e:
new_class = state->chipset.chipset > 0x10;
break;
+ case 0x35c:
+ case 0x38a:
+ case 0x364:
+ case 0x366:
+ case 0x37b:
+ case 0x389:
+ new_class = state->chipset.card_type == 0x30;
+ break;
}
bool chroma_zero = false;
if (!new_class) {
@@ -459,7 +515,7 @@ uint32_t nv04_pgraph_formats(struct pgraph_state *state) {
bool checkswz = state->chipset.card_type >= 0x10;
if (nv04_pgraph_is_3d_class(state)) {
dither = false;
- surf = extr(state->surf_format, 8, 4);
+ surf = pgraph_surf_format(state, 2);
src = 0xd;
checkswz = false;
}
@@ -479,9 +535,9 @@ uint32_t nv04_pgraph_formats(struct pgraph_state *state) {
checkswz = state->chipset.chipset >= 5;;
}
if (extr(state->ctx_switch[0], 14, 1) && checkswz)
- surf = extr(state->surf_format, 20, 4);
+ surf = pgraph_surf_format(state, 5);
if (cls == 0x38 || (state->chipset.card_type >= 0x10 && cls == 0x88)) {
- surf = extr(state->surf_format, 16, 4);
+ surf = pgraph_surf_format(state, 4);
src_ov = 0x13;
}
if (state->chipset.card_type >= 0x10 && !nv04_pgraph_is_3d_class(state)) {