summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/driver.c10
-rw-r--r--src/driver.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index b839b3d..dec9ee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,7 +69,7 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
AC_HEADER_STDC
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.2])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.2 libdrm_tegra])
AM_CONDITIONAL(DRM, test "x$DRM" = xyes)
PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
diff --git a/src/driver.c b/src/driver.c
index 6434f0e..66dc3f2 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -58,6 +58,8 @@
#include "xf86drm.h"
#include "xf86drmMode.h"
+#include <libdrm/tegra.h>
+
#include "compat-api.h"
#include "driver.h"
@@ -353,6 +355,12 @@ TegraPreInit(ScrnInfoPtr pScrn, int flags)
if (tegra->fd < 0)
return FALSE;
+ ret = drm_tegra_new(&tegra->drm, tegra->fd);
+ if (ret < 0) {
+ close(tegra->fd);
+ return FALSE;
+ }
+
tegra->drmmode.fd = tegra->fd;
#ifdef TEGRA_OUTPUT_SLAVE_SUPPORT
@@ -593,6 +601,8 @@ TegraCloseScreen(CLOSE_SCREEN_ARGS_DECL)
if (pScrn->vtSema)
TegraLeaveVT(VT_FUNC_ARGS);
+ drm_tegra_close(tegra->drm);
+
pScreen->CreateScreenResources = tegra->createScreenResources;
pScreen->BlockHandler = tegra->BlockHandler;
diff --git a/src/driver.h b/src/driver.h
index 563e854..15d4e4c 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -45,6 +45,7 @@ typedef struct
typedef struct _TegraRec
{
+ struct drm_tegra *drm;
int fd;
EntPtr entityPrivate;