igt/gem_exec_parse: Add a MI_LOAD_REGISTER_REG test.
PATCH 1/1 igt/gem_exec_parse: Add a MI_LOAD_REGISTER_REG test.
This stores a known value to a register, copies it using MI_LOAD_REGISTER_REG, then stores from the second register back to memory, and verifies the value. This ensures that MI_LOAD_REGISTER_REG is allowed by the command parser, and actually takes effect.
--- lib/intel_reg.h | 2 ++ tests/gem_exec_parse.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+)
This tests functionality I've proposed to merge in version 7 of the command parser. The corresponding kernel patch is:
drm/i915: Allow MI_LOAD_REGISTER_REG between whitelisted registers.
I'm not sure if there's some procedure for marking tests as requiring a particular version of the command parser, or what the ordering constraints on merging kernel patches vs. tests are, so...please advise, or just go ahead and take care of it :)
Thanks!
lib/intel_reg.h +2 -0
@@ -2566,6 +2566,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#define MI_LOAD_SCAN_LINES_INCL (0x12<<23)#define MI_LOAD_REGISTER_IMM ((0x22 << 23) | 1) +#define MI_LOAD_REGISTER_REG (0x2A<<23) +#define MI_STORE_REGISTER_MEM (0x24<<23)/* Flush */ #define MI_FLUSH (0x04<<23)
tests/gem_exec_parse.c +19 -0
@@ -470,6 +470,25 @@ igt_main 0x12000000); } + igt_subtest("load_register_reg") { +uint32_t pc[] = { +MI_LOAD_REGISTER_IMM , +0x2600 ,/* CS_GPR0 */ +0x31337000 , +MI_LOAD_REGISTER_REG | (3 -2 ), +0x2600 ,/* CS_GPR0 */ +0x2608 ,/* CS_GPR1 */ +MI_STORE_REGISTER_MEM | (3 -2 ), +0x2608 , +0 ,/* To be patched */ +MI_BATCH_BUFFER_END , + }; +exec_batch_patched (fd, handle, + pc,sizeof (pc), +32 ,/* patch offset, */ +0x31337000 ); + } + igt_fixture {gem_close (fd, handle);
Signature · 6 lines
2.8.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx