[Intel-gfx] [PATCH 4/4] igt/gem_stolen: Verify contents of stolen-backed objects across hibernation

Chris Wilson chris at chris-wilson.co.uk
Tue Dec 22 08:17:22 PST 2015


On Tue, Dec 22, 2015 at 04:00:51PM +0000, Tvrtko Ursulin wrote:
> 
> 
> On 22/12/15 10:07, ankitprasad.r.sharma at intel.com wrote:
> >From: Ankitprasad Sharma <ankitprasad.r.sharma at intel.com>
> >
> >This patch verifies if the contents of the stolen backed object were
> >preserved across hibernation. This is to validate kernel changes related
> >to moving stolen-backed objects to shmem on hibernation.
> >
> >v2: Added comment, Use igt_assert_eq() instead of igt_assert(), Made loops
> >more readable (Tvrtko)
> >
> >Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma at intel.com>
> >---
> >  tests/gem_stolen.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 98 insertions(+)
> >
> >diff --git a/tests/gem_stolen.c b/tests/gem_stolen.c
> >index 5dc2117..8a0bcb7 100644
> >--- a/tests/gem_stolen.c
> >+++ b/tests/gem_stolen.c
> >@@ -290,6 +290,101 @@ static void stolen_fill_purge_test(int fd)
> >  		gem_close(fd, handle[i]);
> >  }
> >
> >+static void stolen_hibernate(int fd)
> >+{
> >+	drm_intel_bo *bo;
> >+	drm_intel_bo *src, *dest;
> >+	int obj_count = 0, i = 0;
> >+	int ret, j;
> >+	uint32_t handle[MAX_OBJECTS], src_handle;
> >+	uint32_t *virt;
> >+
> >+	gem_require_stolen_support(fd);
> >+
> >+	src_handle = gem_create(fd, SIZE);
> >+	src = gem_handle_to_libdrm_bo(bufmgr, fd,
> >+				     "bo", src_handle);

Why? Just use gem_map__gtt.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list