mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-26 17:26:14 +00:00
lib: extract kmstest_get_pipe_from_crtc_id
This commit is contained in:
parent
573d59dd14
commit
0af2b184ad
@ -916,3 +916,16 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
|
|||||||
fflush(stdout);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
|
|||||||
void *func_arg);
|
void *func_arg);
|
||||||
void kmstest_remove_fb(int fd, int fb_id);
|
void kmstest_remove_fb(int fd, int fb_id);
|
||||||
void kmstest_dump_mode(drmModeModeInfo *mode);
|
void kmstest_dump_mode(drmModeModeInfo *mode);
|
||||||
|
int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
|
||||||
|
|
||||||
inline static void _do_or_die(const char *function, int line, int ret)
|
inline static void _do_or_die(const char *function, int line, int ret)
|
||||||
{
|
{
|
||||||
|
@ -938,19 +938,6 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration)
|
|||||||
drmModeFreeConnector(o->connector);
|
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, const char *test_name)
|
static int run_test(int duration, int flags, const char *test_name)
|
||||||
{
|
{
|
||||||
struct test_output o;
|
struct test_output o;
|
||||||
@ -975,7 +962,7 @@ static int run_test(int duration, int flags, const char *test_name)
|
|||||||
o.flip_state.name = "flip";
|
o.flip_state.name = "flip";
|
||||||
o.vblank_state.name = "vblank";
|
o.vblank_state.name = "vblank";
|
||||||
crtc = resources->crtcs[i];
|
crtc = resources->crtcs[i];
|
||||||
o.pipe = get_pipe_from_crtc_id(crtc);
|
o.pipe = kmstest_get_pipe_from_crtc_id(drm_fd, crtc);
|
||||||
|
|
||||||
run_test_on_crtc(&o, crtc, duration);
|
run_test_on_crtc(&o, crtc, duration);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user