diff mbox

[i-g-t,v2,2/2] overlay: Remove crtc<->pipe mapping code from kms-overlay

Message ID 1457539058-5782-3-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso March 9, 2016, 3:57 p.m. UTC
From: Micah Fedke <micah.fedke@collabora.co.uk>

the crtc id is now always equivalent to its index in the array of crtcs
returned by the kernel

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
[tomeu: Fixed include path and removed some dead code]
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Changes in v2:
- Fix include path as suggested by Thomas
- Remove some dead code

 overlay/Makefile.am       |  4 ++--
 overlay/kms/kms-overlay.c | 16 ++++------------
 2 files changed, 6 insertions(+), 14 deletions(-)
diff mbox

Patch

diff --git a/overlay/Makefile.am b/overlay/Makefile.am
index c648875d24a7..eed2f9293ce0 100644
--- a/overlay/Makefile.am
+++ b/overlay/Makefile.am
@@ -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 \
diff --git a/overlay/kms/kms-overlay.c b/overlay/kms/kms-overlay.c
index cfb3d5ae1dd7..494d57eeeb6b 100644
--- a/overlay/kms/kms-overlay.c
+++ b/overlay/kms/kms-overlay.c
@@ -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)