diff options
author | Imre Deak <imre.deak@intel.com> | 2012-10-15 21:15:18 +0300 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2012-10-16 19:40:06 +0300 |
commit | 6c2b53d8948a0660e6a95b4d7350a0d15bf78ceb (patch) | |
tree | 290dc93c62f60033bef58a623007c051bff64e95 /tests/flip_test.c | |
parent | 641261f4fec9a4519f55a08c2df6913f65c4e9b4 (diff) |
flip_test: store the pipe id in the test context obj
For DRM_IOCTL_WAIT_VBLANK we'll have to pass the pipe id - as opposed to
the crtc id required by the rest of the IOCTLs we use.
Thanks for Chris Wilson for pointing this out.
No functional change.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'tests/flip_test.c')
-rw-r--r-- | tests/flip_test.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/flip_test.c b/tests/flip_test.c index 4d43313..5ea880d 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -90,6 +90,7 @@ struct test_output { drmModeEncoder *encoder; drmModeConnector *connector; int crtc; + int pipe; int flags; unsigned int current_fb_id; unsigned int fb_width; @@ -601,6 +602,19 @@ static void flip_mode(struct test_output *o, int crtc, int duration) drmModeFreeConnector(o->connector); } +static int get_pipe_from_crtc_id(int crtc_id) +{ + struct drm_i915_get_pipe_from_crtc_id pfci; + int ret; + + memset(&pfci, 0, sizeof(pfci)); + pfci.crtc_id = crtc_id; + ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &pfci); + assert(ret == 0); + + return pfci.pipe; +} + static int run_test(int duration, int flags) { struct test_output o; @@ -616,12 +630,16 @@ static int run_test(int duration, int flags) /* Find any connected displays */ for (c = 0; c < resources->count_connectors; c++) { for (i = 0; i < resources->count_crtcs; i++) { + int crtc; + memset(&o, 0, sizeof(o)); o.id = resources->connectors[c]; o.flags = flags; o.flip_state.name = "flip"; + crtc = resources->crtcs[i]; + o.pipe = get_pipe_from_crtc_id(crtc); - flip_mode(&o, resources->crtcs[i], duration); + flip_mode(&o, crtc, duration); } } |