lib: extract kmstest_get_pipe_from_crtc_id

This commit is contained in:
Daniel Vetter
2012-12-15 01:06:11 +01:00
parent 573d59dd14
commit 0af2b184ad
3 changed files with 15 additions and 14 deletions
+13
View File
@@ -916,3 +916,16 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
fflush(stdout);
}
int kmstest_get_pipe_from_crtc_id(int fd, 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(fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &pfci);
assert(ret == 0);
return pfci.pipe;
}