summaryrefslogtreecommitdiff
path: root/tests/kms_pwrite_crc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-07-21 13:56:20 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2015-08-12 16:24:50 +0300
commit62426feec5343603ee67dd296674edda1871a7fb (patch)
tree3cf9e7e78b393ce5ce9095f03040cff8e4c07c4d /tests/kms_pwrite_crc.c
parentadfc294384d2ee20d085e98f249fe73d1f4c4055 (diff)
tests/kms_pwrite_crc: Use drmModeSetPlane() instead of igt_plane_set_fb()
igt_plane_set_fb()+igt_display_commit() have too much overhead, and that causes the cache to get flushed before we flip, making the test useless, at least on machines with small LLC. Switch to drmModeSetPlane() to reduce the chance that the cache gets flushed before we grab the crc. Still nowhere near 100% reliable on my IVB laptop with 3 MiB LLC, but at least it can now hit the problem occasioanally. My desktop IVB with 8 MiB LLC seems to hit it rather reliably. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_pwrite_crc.c')
-rw-r--r--tests/kms_pwrite_crc.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c
index 05b9e380..990866fb 100644
--- a/tests/kms_pwrite_crc.c
+++ b/tests/kms_pwrite_crc.c
@@ -52,7 +52,6 @@ typedef struct {
static void test(data_t *data)
{
- igt_display_t *display = &data->display;
igt_output_t *output = data->output;
struct igt_fb *fb = &data->fb[1];
drmModeModeInfo *mode;
@@ -72,12 +71,20 @@ static void test(data_t *data)
cairo_destroy(cr);
/* flip to it to make it UC/WC and fully flushed */
- igt_plane_set_fb(data->primary, fb);
- igt_display_commit(display);
+ drmModeSetPlane(data->drm_fd,
+ data->primary->drm_plane->plane_id,
+ output->config.crtc->crtc_id,
+ fb->fb_id, 0,
+ 0, 0, fb->width, fb->height,
+ 0, 0, fb->width << 16, fb->height << 16);
/* flip back the original white buffer */
- igt_plane_set_fb(data->primary, &data->fb[0]);
- igt_display_commit(display);
+ drmModeSetPlane(data->drm_fd,
+ data->primary->drm_plane->plane_id,
+ output->config.crtc->crtc_id,
+ data->fb[0].fb_id, 0,
+ 0, 0, fb->width, fb->height,
+ 0, 0, fb->width << 16, fb->height << 16);
/* make sure caching mode has become UC/WT */
caching = gem_get_caching(data->drm_fd, fb->gem_handle);
@@ -91,8 +98,12 @@ static void test(data_t *data)
free(buf);
/* and flip to it */
- igt_plane_set_fb(data->primary, fb);
- igt_display_commit(display);
+ drmModeSetPlane(data->drm_fd,
+ data->primary->drm_plane->plane_id,
+ output->config.crtc->crtc_id,
+ fb->fb_id, 0,
+ 0, 0, fb->width, fb->height,
+ 0, 0, fb->width << 16, fb->height << 16);
/* check that the crc is as expected, which requires that caches got flushed */
igt_pipe_crc_collect_crc(data->pipe_crc, &crc);