mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 09:26:10 +00:00
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>
This commit is contained in:
parent
641261f4fe
commit
6c2b53d894
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user