diff options
author | Lauri Peltonen <lpeltonen@nvidia.com> | 2015-02-04 16:55:31 +0200 |
---|---|---|
committer | Stéphane Marchesin <marcheu@google.com> | 2015-02-14 01:38:58 +0000 |
commit | 64717b22fe9c1203f7feb607ce3e4cecc0818bb7 (patch) | |
tree | b1d4b3bcba481972ef5b05d1244a1ec4d1d1cc11 | |
parent | 132e010f2394379b6e077a8dcb4d6f1e9204946e (diff) | |
download | drm_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.mk | 1 | ||||
-rw-r--r-- | hwcomposer.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -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; |