aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2015-02-04 16:55:31 +0200
committerStéphane Marchesin <marcheu@google.com>2015-02-14 01:38:58 +0000
commit64717b22fe9c1203f7feb607ce3e4cecc0818bb7 (patch)
treeb1d4b3bcba481972ef5b05d1244a1ec4d1d1cc11
parent132e010f2394379b6e077a8dcb4d6f1e9204946e (diff)
downloaddrm_hwcomposer-64717b22fe9c1203f7feb607ce3e4cecc0818bb7.tar.gz
drm_hwcomposer: Support other drm nodes than card0
On dragon, card0 = Nouveau, card1 = TegraDRM. Change-Id: Ie69639e40162ceb4ab99025dd9406ae44b7204c8 Reviewed-on: https://chrome-internal-review.googlesource.com/196021 Reviewed-by: Stéphane Marchesin <marcheu@google.com> Commit-Queue: Stéphane Marchesin <marcheu@google.com> Tested-by: Stéphane Marchesin <marcheu@google.com>
-rw-r--r--Android.mk1
-rw-r--r--hwcomposer.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 2a725f3..214e28f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -20,6 +20,7 @@ include $(CLEAR_VARS)
BUFFER_IMPORTER := gralloc
LOCAL_SHARED_LIBRARIES := \
+ libcutils \
libdrm \
libhardware \
liblog \
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index cf0a8c3..92cfea6 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -31,6 +31,7 @@
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
+#include <cutils/properties.h>
#include <sync/sync.h>
#include <sw_sync.h>
@@ -1276,6 +1277,7 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name,
{
int ret = 0;
struct hwc_context_t *ctx;
+ char path[PROPERTY_VALUE_MAX];
if (strcmp(name, HWC_HARDWARE_COMPOSER)) {
ALOGE("Invalid module name- %s", name);
@@ -1294,8 +1296,9 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name,
goto out;
}
+ property_get("hwc.drm.device", path, HWCOMPOSER_DRM_DEVICE);
/* TODO: Use drmOpenControl here instead */
- ctx->fd = open(HWCOMPOSER_DRM_DEVICE, O_RDWR);
+ ctx->fd = open(path, O_RDWR);
if (ctx->fd < 0) {
ALOGE("Failed to open dri- %s", strerror(-errno));
goto out;