mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	tests/pm_rpm: add system-suspend-{execbuf,modeset} subtests
We were having a problem where the system-suspend test was passing, but then the next test - gem-execbuf-stress - was failing because of bugs caused by the suspend subtest. So add a single test that emulates the same problem, and another test that just sets a mode after resume. This way, we should be reproducing the problem even if you don't run the tests in the order they are defined. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
		
							parent
							
								
									cba3088619
								
							
						
					
					
						commit
						15972aa866
					
				@ -1376,6 +1376,55 @@ static void system_suspend_subtest(void)
 | 
				
			|||||||
	igt_assert(wait_for_suspended());
 | 
						igt_assert(wait_for_suspended());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void system_suspend_execbuf_subtest(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						int i;
 | 
				
			||||||
 | 
						int batch_size = 4 * sizeof(uint32_t);
 | 
				
			||||||
 | 
						uint32_t batch_buf[batch_size];
 | 
				
			||||||
 | 
						uint32_t handle;
 | 
				
			||||||
 | 
						struct drm_i915_gem_execbuffer2 execbuf = {};
 | 
				
			||||||
 | 
						struct drm_i915_gem_exec_object2 objs[1] = {{}};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						i = 0;
 | 
				
			||||||
 | 
						batch_buf[i++] = MI_NOOP;
 | 
				
			||||||
 | 
						batch_buf[i++] = MI_NOOP;
 | 
				
			||||||
 | 
						batch_buf[i++] = MI_BATCH_BUFFER_END;
 | 
				
			||||||
 | 
						batch_buf[i++] = MI_NOOP;
 | 
				
			||||||
 | 
						igt_assert(i * sizeof(uint32_t) == batch_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						handle = gem_create(drm_fd, batch_size);
 | 
				
			||||||
 | 
						gem_write(drm_fd, handle, 0, batch_buf, batch_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						objs[0].handle = handle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						execbuf.buffers_ptr = (uintptr_t)objs;
 | 
				
			||||||
 | 
						execbuf.buffer_count = 1;
 | 
				
			||||||
 | 
						execbuf.batch_len = batch_size;
 | 
				
			||||||
 | 
						execbuf.flags = I915_EXEC_RENDER;
 | 
				
			||||||
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						disable_all_screens_and_wait(&ms_data);
 | 
				
			||||||
 | 
						igt_system_suspend_autoresume();
 | 
				
			||||||
 | 
						igt_assert(wait_for_suspended());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (i = 0; i < 20; i++) {
 | 
				
			||||||
 | 
							do_ioctl(drm_fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
 | 
				
			||||||
 | 
							igt_assert(wait_for_suspended());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gem_close(drm_fd, handle);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void system_suspend_modeset_subtest(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						disable_all_screens_and_wait(&ms_data);
 | 
				
			||||||
 | 
						igt_system_suspend_autoresume();
 | 
				
			||||||
 | 
						igt_assert(wait_for_suspended());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						enable_one_screen_and_wait(&ms_data);
 | 
				
			||||||
 | 
						disable_all_screens_and_wait(&ms_data);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Enable a screen, activate DPMS, then do a modeset. At some point our driver
 | 
					/* Enable a screen, activate DPMS, then do a modeset. At some point our driver
 | 
				
			||||||
 * produced WARNs on this case. */
 | 
					 * produced WARNs on this case. */
 | 
				
			||||||
static void dpms_mode_unset_subtest(enum screen_type type)
 | 
					static void dpms_mode_unset_subtest(enum screen_type type)
 | 
				
			||||||
@ -1837,6 +1886,10 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
	/* System suspend */
 | 
						/* System suspend */
 | 
				
			||||||
	igt_subtest("system-suspend")
 | 
						igt_subtest("system-suspend")
 | 
				
			||||||
		system_suspend_subtest();
 | 
							system_suspend_subtest();
 | 
				
			||||||
 | 
						igt_subtest("system-suspend-execbuf")
 | 
				
			||||||
 | 
							system_suspend_execbuf_subtest();
 | 
				
			||||||
 | 
						igt_subtest("system-suspend-modeset")
 | 
				
			||||||
 | 
							system_suspend_modeset_subtest();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* GEM stress */
 | 
						/* GEM stress */
 | 
				
			||||||
	igt_subtest("gem-execbuf-stress")
 | 
						igt_subtest("gem-execbuf-stress")
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user