aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch
blob: 308a84959c8bcc3304fa955a4f529eb30fcd9b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From 68936c7fb864440bb4d2ab737a651888ac7c253a Mon Sep 17 00:00:00 2001
From: Eric Ruei <e-ruei1@ti.com>
Date: Fri, 17 Mar 2017 10:42:32 -0400
Subject: [PATCH 2/3] kmssink: remove DCE dependencies

Replace DCE related API calls to libdrm and omapdrm API calls
to decouple DCE from kmssink

Signed-off-by: Eric Ruei <e-ruei1@ti.com>
---
 configure.ac         |  1 -
 sys/kms/Makefile.am  |  2 --
 sys/kms/gstkmssink.c | 17 +++++++++++++----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index f93d52d..a6f93a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2321,7 +2321,6 @@ dnl *** kms ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true)
 AG_GST_CHECK_FEATURE(KMS, [kmssink], kms, [
 PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no)
-PKG_CHECK_MODULES(LIBDCE, [libdce >= 1.0.0], HAVE_KMS=yes, HAVE_KMS=no)
 AC_SUBST(DRM_CFLAGS)
 AC_SUBST(DRM_LIBS)
 ])
diff --git a/sys/kms/Makefile.am b/sys/kms/Makefile.am
index 6d56073..cc7353e 100644
--- a/sys/kms/Makefile.am
+++ b/sys/kms/Makefile.am
@@ -9,7 +9,6 @@ libgstkmssink_la_CFLAGS = \
 	$(GST_PLUGINS_BAD_CFLAGS) \
 	$(GST_PLUGINS_BASE_CFLAGS) \
 	$(GST_BASE_CFLAGS) \
-	$(LIBDCE_CFLAGS) \
 	$(GST_CFLAGS) \
 	$(DRM_CFLAGS)
 
@@ -17,7 +16,6 @@ libgstkmssink_la_LIBADD = \
 	$(GST_PLUGINS_BASE_LIBS) \
 	$(GST_BASE_LIBS) \
 	$(GST_LIBS) \
-	$(LIBDCE_LIBS) \
 	$(DRM_LIBS) \
 	-lgstvideo-$(GST_API_VERSION) \
 	$(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
index 17e6407..9795bdf 100644
--- a/sys/kms/gstkmssink.c
+++ b/sys/kms/gstkmssink.c
@@ -31,7 +31,6 @@
 #include "gstkmssink.h"
 #include "gstkmsbufferpriv.h"
 
-#include <libdce.h>
 #include <omap_drm.h>
 #include <omap_drmif.h>
 #include <xf86drmMode.h>
@@ -516,13 +515,18 @@ gst_kms_sink_start (GstBaseSink * bsink)
 
   sink = GST_KMS_SINK (bsink);
 
-  drm_dev = dce_init ();
+  drm_fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC);
+  if(drm_fd == NULL)
+    goto drm_failed;
+  else {
+    drm_dev = omap_device_new(drm_fd);
+  }
+
   if (drm_dev == NULL)
     goto device_failed;
   else {
+    sink->fd = drm_fd;
     sink->dev = drm_dev;
-    sink->fd = dce_get_fd ();
-    drm_fd = dce_get_fd ();
   }
 
   sink->resources = drmModeGetResources (sink->fd);
@@ -539,6 +543,11 @@ fail:
   gst_kms_sink_reset (sink);
   return FALSE;
 
+drm_failed:
+  GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
+      (NULL), ("drmOpen failed"));
+  goto fail;
+
 device_failed:
   GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
       (NULL), ("omap_device_new failed"));
-- 
1.9.1