Response inline. On Mon, 4 Apr 2016, Chris Wilson wrote:
On Mon, Apr 04, 2016 at 02:43:08PM +0100, Peter Antoine wrote:+static void run_test(int fd, unsigned mode) +{ + const int gen = intel_gen(intel_get_drm_devid(fd)); + const struct intel_execution_engine *e; + + igt_require(gen >= 9); + + test_mocs_values(fd); + + switch(mode) { + case NONE: break; + case RESET: igt_force_gpu_reset(); break; + case SUSPEND: igt_system_suspend_autoresume(); break; + case HIBERNATE: igt_system_hibernate_autoresume(); break; + }; + + /* + * Do render after other engines as older versions of code will + * cause the RCS context to program the registers and the test + * becomes invalid + */If you defer fd allocation to here, then that is moot, as we can create the fd for each test and be sure that the default context is uninitialised.
Ok, will wrap each test within an fd of it's own.
+ for (e = intel_execution_engines; e->name; e++) + if (e->exec_id != I915_EXEC_DEFAULT && + e->exec_id != I915_EXEC_RENDER && + gem_has_ring(fd, e->exec_id | e->flags)) + test_context_mocs_values(fd, e, true); + + for (e = intel_execution_engines; e->name; e++) + if (e->exec_id == I915_EXEC_RENDER && + gem_has_ring(fd, e->exec_id | e->flags)) { + test_context_mocs_values(fd, e, true); + test_context_mocs_values(fd, e, false); + }As well as checking for creating new contexts after resume, we also need to check that the register values are preserved across suspend (i.e. that the register state is being saved back into the context image and then restored).
Ok, I'll add another test case that does this for the render engine (the only one that is effected (at the moment) by context save and resume.
I might as well move the render engine context tests to a new testcase. As it is the only engine that uses the context registers.
If we get truly paranoid (and why not?!) then we can create a pair of contexts, change the register values in one and verify that the second context is unaffected.
Might as well, can add a test case that dirties the RCS context registers and see if they are the same after resume and if a new context is created afterwards that it has the correct values.
Peter.
-Chris
-- Peter Antoine (Android Graphics Driver Software Engineer) --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
