summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-30 23:20:10 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-30 23:20:10 +0000
commit5cf9016c5db95d5c12b18418a9d04e0c60e7c2d3 (patch)
treec04ba79d18660ad238aeab9fb0514f0be7226d32
parentcc73f9c401dbffe160ce99421eba64f4d1a9c366 (diff)
hwtest/pgraph: Fix a few things on NV20.
-rw-r--r--hwtest/pgraph_class_kelvin.cc2
-rw-r--r--hwtest/pgraph_mthd.cc1
-rw-r--r--hwtest/pgraph_mthd_grobj.cc14
3 files changed, 10 insertions, 7 deletions
diff --git a/hwtest/pgraph_class_kelvin.cc b/hwtest/pgraph_class_kelvin.cc
index 38a3ca1d..d50ca1a6 100644
--- a/hwtest/pgraph_class_kelvin.cc
+++ b/hwtest/pgraph_class_kelvin.cc
@@ -30,6 +30,7 @@
namespace hwtest {
namespace pgraph {
+namespace {
class MthdWarning : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1) {
@@ -63,6 +64,7 @@ class MthdState : public SingleMthdTest {
}
using SingleMthdTest::SingleMthdTest;
};
+}
std::vector<SingleMthdTest *> EmuCelsius::mthds() {
std::vector<SingleMthdTest *> res = {
diff --git a/hwtest/pgraph_mthd.cc b/hwtest/pgraph_mthd.cc
index c8d40688..70c8162f 100644
--- a/hwtest/pgraph_mthd.cc
+++ b/hwtest/pgraph_mthd.cc
@@ -316,6 +316,7 @@ static void nv04_pgraph_mthd(struct pgraph_state *state, uint32_t grobj[4], int
insrt(state->trap_addr, 2, 11, extr(state->fifo_mthd_st2, 2, 11));
insrt(state->trap_addr, 16, 3, extr(state->fifo_mthd_st2, 16, 3));
insrt(state->trap_addr, 20, 5, extr(state->fifo_mthd_st2, 20, 5));
+ insrt(state->trap_addr, 28, 1, 0);
}
state->trap_data[0] = state->fifo_data_st2[0];
state->trap_data[1] = state->fifo_data_st2[1];
diff --git a/hwtest/pgraph_mthd_grobj.cc b/hwtest/pgraph_mthd_grobj.cc
index db0cc754..14deb297 100644
--- a/hwtest/pgraph_mthd_grobj.cc
+++ b/hwtest/pgraph_mthd_grobj.cc
@@ -32,7 +32,7 @@ namespace pgraph {
void MthdOperation::emulate_mthd() {
if (!extr(exp.nsource, 1, 1)) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
else
egrobj[0] = exp.ctx_switch[0];
@@ -55,7 +55,7 @@ void MthdDither::emulate_mthd() {
if ((val & 3) == 3)
rval = 3;
if (!extr(exp.nsource, 1, 1)) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
else
egrobj[0] = exp.ctx_switch[0];
@@ -81,7 +81,7 @@ void MthdPatch::emulate_mthd() {
}
}
if (!extr(exp.nsource, 1, 1) && !extr(exp.intr, 4, 1)) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 24, 8, extr(exp.ctx_switch[0], 24, 8));
else
egrobj[0] = exp.ctx_switch[0];
@@ -170,7 +170,7 @@ static void nv04_pgraph_set_ctx(struct pgraph_state *state, uint32_t grobj[4], u
nv04_pgraph_blowup(state, 2);
if (!extr(state->nsource, 1, 1)) {
if (state->chipset.card_type >= 0x10) {
- if (state->chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&state->chipset))
insrt(grobj[0], 8, 24, extr(state->ctx_switch[0], 8, 24));
else
grobj[0] = state->ctx_switch[0];
@@ -228,7 +228,7 @@ void MthdCtxSurf::emulate_mthd() {
nv04_pgraph_blowup(&exp, 2);
if (!extr(exp.nsource, 1, 1)) {
if (chipset.card_type >= 0x10) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
else
egrobj[0] = exp.ctx_switch[0];
@@ -267,7 +267,7 @@ void MthdCtxSurf2D::emulate_mthd() {
nv04_pgraph_blowup(&exp, 2);
if (!extr(exp.nsource, 1, 1)) {
if (chipset.card_type >= 0x10) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
else
egrobj[0] = exp.ctx_switch[0];
@@ -309,7 +309,7 @@ void MthdCtxSurf3D::emulate_mthd() {
} else {
if (!extr(exp.nsource, 1, 1)) {
if (chipset.card_type >= 0x10) {
- if (chipset.card_type < 0x20)
+ if (!nv04_pgraph_is_nv25p(&chipset))
insrt(egrobj[0], 8, 24, extr(exp.ctx_switch[0], 8, 24));
else
egrobj[0] = exp.ctx_switch[0];