diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-12-26 16:12:41 +0000 |
---|---|---|
committer | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-12-26 16:12:41 +0000 |
commit | 23063d3aace4e6e26b519cfb510bbbf7ccaf1f90 (patch) | |
tree | 89638c9fcf6bd5703517b31946ae13a417fad7db | |
parent | b61e362a4844d743d32ff60a7c5248393035ce59 (diff) |
hwtest/pgraph: Add stub tests for ifc_data methods.
-rw-r--r-- | hwtest/pgraph_class_ifc.cc | 77 | ||||
-rw-r--r-- | hwtest/pgraph_class_solid.cc | 10 | ||||
-rw-r--r-- | hwtest/pgraph_mthd.h | 10 |
3 files changed, 81 insertions, 16 deletions
diff --git a/hwtest/pgraph_class_ifc.cc b/hwtest/pgraph_class_ifc.cc index ec6923fa..d9cebbd1 100644 --- a/hwtest/pgraph_class_ifc.cc +++ b/hwtest/pgraph_class_ifc.cc @@ -162,8 +162,57 @@ class MthdPaletteOffset : public SingleMthdTest { using SingleMthdTest::SingleMthdTest; }; -class MthdIfcDataLo : public SingleMthdTest { +void MthdBitmapData::adjust_orig_mthd() { + if (chipset.card_type >= 4) { + insrt(orig.notify, 0, 1, 0); + } +} + +void MthdBitmapData::emulate_mthd_pre() { + if (!extr(exp.xy_misc_3, 12, 1)) + insrt(exp.xy_misc_3, 4, 1, 0); +} + +void MthdBitmapData::emulate_mthd() { + uint32_t rval = nv04_pgraph_bswap(&exp, val); + if (chipset.card_type == 3) { + // yup, orig. hw bug. + exp.misc32[0] = pgraph_expand_mono(&orig, rval); + } else { + exp.misc32[0] = pgraph_expand_mono(&exp, rval); + } + // XXX: test me + skip = true; +} + +class MthdIifcData : public SingleMthdTest { void adjust_orig_mthd() override { + insrt(orig.notify, 0, 1, 0); + // XXX: unlock it some day + orig.valid[0] = 0; + } + void emulate_mthd_pre() override { + insrt(exp.xy_misc_3, 4, 1, 0); + } + void emulate_mthd() override { + exp.misc32[0] = nv04_pgraph_bswap(&exp, val); + // XXX: test me + skip = true; + } + using SingleMthdTest::SingleMthdTest; +}; + +class MthdIfcData : public SingleMthdTest { + int which; + bool draw; + void adjust_orig_mthd() override { + if (draw && chipset.card_type >= 4) { + insrt(orig.notify, 0, 1, 0); + } + } + void emulate_mthd_pre() override { + if (draw && !pgraph_is_class_sifc(&exp)) + insrt(exp.xy_misc_3, 4, 1, 0); } void emulate_mthd() override { uint32_t rv = val; @@ -184,9 +233,15 @@ class MthdIfcDataLo : public SingleMthdTest { } break; } - exp.misc32[0] = rv; + exp.misc32[which] = rv; + if (draw) { + // XXX: test me + skip = true; + } } - using SingleMthdTest::SingleMthdTest; +public: + MthdIfcData(hwtest::TestOptions &opt, uint32_t seed, const std::string &name, int trapbit, uint32_t cls, uint32_t mthd, uint32_t num, uint32_t stride, int which, bool draw) + : SingleMthdTest(opt, seed, name, trapbit, cls, mthd, num, stride), which(which), draw(draw) {} }; std::vector<SingleMthdTest *> Ifc::mthds() { @@ -228,12 +283,12 @@ std::vector<SingleMthdTest *> Ifc::mthds() { new MthdSync(opt, rnd(), "sync", -1, cls, 0x108), }); res.insert(res.end(), { - new MthdIfcDataLo(opt, rnd(), "ifc_data_lo", 14, cls, 0x400, 0x380, 8), - new UntestedMthd(opt, rnd(), "ifc_data_hi", -1, cls, 0x404, 0x380, 8), // XXX + new MthdIfcData(opt, rnd(), "ifc_data_lo", 14, cls, 0x400, 0x380, 8, 0, false), + new MthdIfcData(opt, rnd(), "ifc_data_hi", 14, cls, 0x404, 0x380, 8, 1, true), }); } else { res.insert(res.end(), { - new UntestedMthd(opt, rnd(), "ifc_data", -1, cls, 0x400, cls == 0x21 ? 0x20 : 0x700), // XXX + new MthdIfcData(opt, rnd(), "ifc_data", 14, cls, 0x400, cls == 0x21 ? 0x20 : 0x700, 4, 0, true), }); } return res; @@ -247,7 +302,7 @@ std::vector<SingleMthdTest *> Bitmap::mthds() { new MthdVtxXy(opt, rnd(), "xy", -1, cls, 0x310, 1, 4, VTX_FIRST | VTX_IFC), new MthdIfcSize(opt, rnd(), "size_out", -1, cls, 0x314, IFC_OUT | IFC_BITMAP), new MthdIfcSize(opt, rnd(), "size_in", -1, cls, 0x318, IFC_IN | IFC_BITMAP), - new UntestedMthd(opt, rnd(), "bitmap_data", -1, cls, 0x400, 0x20), // XXX + new MthdBitmapData(opt, rnd(), "bitmap_data", -1, cls, 0x400, 0x20, 4, true), }; } @@ -271,7 +326,7 @@ std::vector<SingleMthdTest *> Sifc::mthds() { new MthdClipXy(opt, rnd(), "clip_xy", 13, cls, 0x310, 1, 0), new MthdClipRect(opt, rnd(), "clip_rect", 14, cls, 0x314, 1), new MthdSifcXy(opt, rnd(), "xy", 15, cls, 0x318), - new UntestedMthd(opt, rnd(), "sifc_data", -1, cls, 0x400, 0x700), // XXX + new MthdIfcData(opt, rnd(), "sifc_data", 16, cls, 0x400, 0x700, 4, 0, true), }; if (cls == 0x36) { res.insert(res.end(), { @@ -314,7 +369,7 @@ std::vector<SingleMthdTest *> Iifc::mthds() { new MthdVtxXy(opt, rnd(), "xy", 14, cls, 0x3f4, 1, 4, VTX_FIRST | VTX_IFC), new MthdIfcSize(opt, rnd(), "size_out", 15, cls, 0x3f8, IFC_OUT), new MthdIfcSize(opt, rnd(), "size_in", 16, cls, 0x3fc, IFC_IN), - new UntestedMthd(opt, rnd(), "iifc_data", -1, cls, 0x400, 0x700), // XXX + new MthdIifcData(opt, rnd(), "iifc_data", 17, cls, 0x400, 0x700), }; if (cls == 0x64) { res.insert(res.end(), { @@ -338,8 +393,8 @@ std::vector<SingleMthdTest *> Tfc::mthds() { new MthdIfcSize(opt, rnd(), "size", 7, cls, 0x308, IFC_IN | IFC_OUT | IFC_TFC), new MthdClipHv(opt, rnd(), "clip_h", 8, cls, 0x30c, 1, 0), new MthdClipHv(opt, rnd(), "clip_v", 9, cls, 0x310, 1, 1), - new MthdIfcDataLo(opt, rnd(), "tfc_data_lo", 10, cls, 0x400, 0x380, 8), - new UntestedMthd(opt, rnd(), "tfc_data_hi", -1, cls, 0x404, 0x380, 8), // XXX + new MthdIfcData(opt, rnd(), "tfc_data_lo", 10, cls, 0x400, 0x380, 8, 0, false), + new MthdIfcData(opt, rnd(), "tfc_data_hi", 11, cls, 0x404, 0x380, 8, 1, true), }; } diff --git a/hwtest/pgraph_class_solid.cc b/hwtest/pgraph_class_solid.cc index 78b21f9f..4fedbe09 100644 --- a/hwtest/pgraph_class_solid.cc +++ b/hwtest/pgraph_class_solid.cc @@ -305,14 +305,14 @@ std::vector<SingleMthdTest *> GdiNv3::mthds() { new MthdBitmapColor1(opt, rnd(), "c.color", 12, cls, 0xbf4), new MthdIfcSize(opt, rnd(), "c.size", 21, cls, 0xbf8, IFC_IN | IFC_OUT | IFC_BITMAP), new MthdVtxXy(opt, rnd(), "c.xy", 20, cls, 0xbfc, 1, 4, VTX_FIRST | VTX_IFC), - new UntestedMthd(opt, rnd(), "c.bitmap_data", -1, cls, 0xc00, 0x80), // XXX + new MthdBitmapData(opt, rnd(), "c.bitmap_data", 24, cls, 0xc00, 0x80, 4, false), new MthdClipXy(opt, rnd(), "d.clip_xy_0", 16, cls, 0xfe8, 1, 0), new MthdClipXy(opt, rnd(), "d.clip_xy_1", 17, cls, 0xfec, 1, 1), new MthdBitmapColor1(opt, rnd(), "d.color", 12, cls, 0xff0), new MthdIfcSize(opt, rnd(), "d.size_in", 22, cls, 0xff4, IFC_IN | IFC_BITMAP), new MthdIfcSize(opt, rnd(), "d.size_out", 23, cls, 0xff8, IFC_OUT | IFC_BITMAP), new MthdVtxXy(opt, rnd(), "d.xy", 20, cls, 0xffc, 1, 4, VTX_FIRST | VTX_IFC), - new UntestedMthd(opt, rnd(), "d.bitmap_data", -1, cls, 0x1000, 0x80), // XXX + new MthdBitmapData(opt, rnd(), "d.bitmap_data", 24, cls, 0x1000, 0x80, 4, false), new MthdClipXy(opt, rnd(), "e.clip_xy_0", 16, cls, 0x13e4, 1, 0), new MthdClipXy(opt, rnd(), "e.clip_xy_1", 17, cls, 0x13e8, 1, 1), new MthdBitmapColor0(opt, rnd(), "e.color0", 13, cls, 0x13ec), @@ -320,7 +320,7 @@ std::vector<SingleMthdTest *> GdiNv3::mthds() { new MthdIfcSize(opt, rnd(), "e.size_in", 22, cls, 0x13f4, IFC_IN | IFC_BITMAP), new MthdIfcSize(opt, rnd(), "e.size_out", 23, cls, 0x13f8, IFC_OUT | IFC_BITMAP), new MthdVtxXy(opt, rnd(), "e.xy", 20, cls, 0x13fc, 1, 4, VTX_FIRST | VTX_IFC), - new UntestedMthd(opt, rnd(), "e.bitmap_data", -1, cls, 0x1400, 0x80), // XXX + new MthdBitmapData(opt, rnd(), "e.bitmap_data", 25, cls, 0x1400, 0x80, 4, true), }; } @@ -354,7 +354,7 @@ std::vector<SingleMthdTest *> GdiNv4::mthds() { new MthdBitmapColor1(opt, rnd(), "c.color", 12, cls, 0x7f4), new MthdIfcSize(opt, rnd(), "c.size", 21, cls, 0x7f8, IFC_IN | IFC_OUT | IFC_BITMAP), new MthdVtxXy(opt, rnd(), "c.xy", 20, cls, 0x7fc, 1, 4, VTX_FIRST | VTX_IFC), - new UntestedMthd(opt, rnd(), "c.bitmap_data", -1, cls, 0x800, 0x80), // XXX + new MthdBitmapData(opt, rnd(), "c.bitmap_data", 24, cls, 0x800, 0x80, 4, false), new MthdClipXy(opt, rnd(), "e.clip_xy_0", 16, cls, 0xbe4, 1, 0), new MthdClipXy(opt, rnd(), "e.clip_xy_1", 17, cls, 0xbe8, 1, 1), new MthdBitmapColor0(opt, rnd(), "e.color0", 13, cls, 0xbec), @@ -362,7 +362,7 @@ std::vector<SingleMthdTest *> GdiNv4::mthds() { new MthdIfcSize(opt, rnd(), "e.size_in", 22, cls, 0xbf4, IFC_IN | IFC_BITMAP), new MthdIfcSize(opt, rnd(), "e.size_out", 23, cls, 0xbf8, IFC_OUT | IFC_BITMAP), new MthdVtxXy(opt, rnd(), "e.xy", 20, cls, 0xbfc, 1, 4, VTX_FIRST | VTX_IFC), - new UntestedMthd(opt, rnd(), "e.bitmap_data", -1, cls, 0xc00, 0x80), // XXX + new MthdBitmapData(opt, rnd(), "e.bitmap_data", 25, cls, 0xc00, 0x80, 4, true), new MthdFont(opt, rnd(), "f.font", 26, cls, 0xff0), new MthdClipXy(opt, rnd(), "f.clip_xy_0", 16, cls, 0xff4, 1, 0), new MthdClipXy(opt, rnd(), "f.clip_xy_1", 17, cls, 0xff8, 1, 1), diff --git a/hwtest/pgraph_mthd.h b/hwtest/pgraph_mthd.h index adcdd436..4017b111 100644 --- a/hwtest/pgraph_mthd.h +++ b/hwtest/pgraph_mthd.h @@ -632,6 +632,16 @@ public: } }; +class MthdBitmapData : public SingleMthdTest { + bool twocolor; + void adjust_orig_mthd() override; + void emulate_mthd_pre() override; + void emulate_mthd() override; +public: + MthdBitmapData(hwtest::TestOptions &opt, uint32_t seed, const std::string &name, int trapbit, uint32_t cls, uint32_t mthd, uint32_t num, uint32_t stride, bool twocolor) + : SingleMthdTest(opt, seed, name, trapbit, cls, mthd, num, stride), twocolor(twocolor) {} +}; + } } |