summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-07-13 23:14:04 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-07-23 12:23:31 +0100
commitab0c6f1ac957d1631cd33ed63e46f76978bd8a1c (patch)
treef6ff2ccb82763d55d927d2791e893cf929ae377a
parent9197ce090bfd428e80592e681452e8cde746d9a3 (diff)
downloadxf86-video-armada-ab0c6f1ac957d1631cd33ed63e46f76978bd8a1c.tar.gz
Add support for imx-drm
Add support for attaching to the imx-drm kernel module, thus allowing the driver to be used on iMX hardware as well. It should be noted that the libGAL backend does not support iMX, and so should be manually disabled in the Xorg config file. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/armada_drm.c13
-rw-r--r--src/armada_module.c7
2 files changed, 18 insertions, 2 deletions
diff --git a/src/armada_drm.c b/src/armada_drm.c
index d3ef0e3..49d4e4b 100644
--- a/src/armada_drm.c
+++ b/src/armada_drm.c
@@ -26,13 +26,14 @@
#include <X11/Xatom.h>
#include "compat-api.h"
+#include "utils.h"
#include "vivante.h"
#include "vivante_dri2.h"
#define CURSOR_MAX_WIDTH 64
#define CURSOR_MAX_HEIGHT 32
-#define DRM_MODULE_NAME "armada-drm"
+#define DRM_MODULE_NAMES "armada-drm", "imx-drm"
#define DRM_DEFAULT_BUS_ID NULL
enum {
@@ -445,6 +446,8 @@ static int armada_get_cap(int fd, uint64_t cap, uint64_t *val, int scrnIndex,
return err;
}
+static const char *drm_module_names[] = { DRM_MODULE_NAMES };
+
static Bool armada_drm_open_master(ScrnInfoPtr pScrn)
{
struct all_drm_info *drm;
@@ -453,6 +456,7 @@ static Bool armada_drm_open_master(ScrnInfoPtr pScrn)
drmVersionPtr version;
const char *busid = DRM_DEFAULT_BUS_ID;
uint64_t val;
+ unsigned i;
int err;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
@@ -478,7 +482,12 @@ static Bool armada_drm_open_master(ScrnInfoPtr pScrn)
drm->common.event_context.vblank_handler = vivante_dri2_vblank;
#endif
- drm->common.fd = drmOpen(DRM_MODULE_NAME, busid);
+ for (i = 0; i < ARRAY_SIZE(drm_module_names); i++) {
+ drm->common.fd = drmOpen(drm_module_names[i], busid);
+ if (drm->common.fd >= 0)
+ break;
+ }
+
if (drm->common.fd < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %s\n",
diff --git a/src/armada_module.c b/src/armada_module.c
index 13483ea..bacf891 100644
--- a/src/armada_module.c
+++ b/src/armada_module.c
@@ -21,10 +21,17 @@ static SymTabRec armada_chipsets[] = {
{ -1, NULL }
};
+static SymTabRec ipu_chipsets[] = {
+ { 0, "i.MX6" },
+ { -1, NULL }
+};
+
static void armada_identify(int flags)
{
xf86PrintChipsets(ARMADA_NAME, "Support for Marvell LCD Controller",
armada_chipsets);
+ xf86PrintChipsets(ARMADA_NAME, "Support for Freescale IPU",
+ ipu_chipsets);
}
static Bool armada_probe(DriverPtr drv, int flags)