From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/igt_fb: Add missing set_domain calls
Date: Thu, 6 Sep 2018 15:27:49 +0300 [thread overview]
Message-ID: <20180906122749.12294-1-ville.syrjala@linux.intel.com> (raw)
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We're missing some set_domain calls around the ggtt mmap paths. This
means we never tell the kernel that we've dirtied the object. And
then at some point down the line the kernel throws the pages into
/dev/null instead of hanging on to them/swapping them out because
they were never marked as dirty.
Throw in the missing set_domains(GTT,GTT) calls and rip out the old
bogus set_domain(CPU,CPU).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
lib/igt_fb.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ae71d9673228..1085d25d33ce 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -404,6 +404,9 @@ static int create_bo_for_fb(int fd, int width, int height,
bo = gem_create(fd, size);
gem_set_tiling(fd, bo, igt_fb_mod_to_tiling(tiling), stride);
+ gem_set_domain(fd, bo,
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+
/* Ensure the framebuffer is preallocated */
ptr = gem_mmap__gtt(fd, bo, size, PROT_READ | PROT_WRITE);
igt_assert(*(uint32_t *)ptr == 0);
@@ -1342,6 +1345,9 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
{
void *ptr;
+ gem_set_domain(fd, fb->gem_handle,
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+
if (fb->is_dumb)
ptr = kmstest_dumb_map_buffer(fd, fb->gem_handle, fb->size,
PROT_READ | PROT_WRITE);
@@ -1790,6 +1796,8 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
setup_linear_mapping(fd, fb, &blit->linear);
} else {
blit->linear.handle = 0;
+ gem_set_domain(fd, fb->gem_handle,
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
blit->linear.map = gem_mmap__gtt(fd, fb->gem_handle, fb->size,
PROT_READ | PROT_WRITE);
igt_assert(blit->linear.map);
@@ -1848,10 +1856,6 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
create_cairo_surface__gtt(fd, fb);
}
- if (!fb->is_dumb)
- gem_set_domain(fd, fb->gem_handle, I915_GEM_DOMAIN_CPU,
- I915_GEM_DOMAIN_CPU);
-
igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS);
return fb->cairo_surface;
}
--
2.16.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2018-09-06 12:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 12:27 Ville Syrjala [this message]
2018-09-06 12:34 ` [igt-dev] [PATCH i-g-t] lib/igt_fb: Add missing set_domain calls Chris Wilson
2018-09-06 14:58 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-09-06 17:09 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180906122749.12294-1-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox