@@ -3,8 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
endif
AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
-LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
+AM_CFLAGS = -I$(top_srcdir)/lib $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+LDADD = $(top_builddir)/lib/libintel_tools.la $(LIBUNWIND_LIBS) $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
intel_gpu_overlay_SOURCES = \
i915_pciids.h \
@@ -38,6 +38,7 @@
#include <xf86drmMode.h>
#include <i915_drm.h>
#include "../overlay.h"
+#include "igt_kms.h"
//#include "rgb2yuv.h"
#ifndef ALIGN
@@ -240,20 +241,11 @@ kms_overlay_create(struct config *config, int *width, int *height)
priv->crtc = 0;
for (i = 0; i < kmode->count_crtcs; i++) {
- struct drm_i915_get_pipe_from_crtc_id get_pipe;
-
- get_pipe.pipe = 0;
- get_pipe.crtc_id = kmode->crtcs[i];
- if (drmIoctl(priv->fd,
- DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID,
- &get_pipe)) {
- continue;
- }
-
- if (get_pipe.pipe != pipe)
+ if (kmstest_get_pipe_from_crtc_id(priv->fd,
+ kmode->crtcs[i]) != pipe)
continue;
- priv->crtc = get_pipe.crtc_id;
+ priv->crtc = kmode->crtcs[i];
}
if (priv->crtc == 0)