summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-05-29 20:25:03 -0400
committerRobert Foss <robert.foss@collabora.com>2017-05-29 20:25:03 -0400
commitb42d5c24b42f2360723bcb4700171a3e6a6c2561 (patch)
treea7a60a8d2df1d5eec9f7d1cb6e1857639fc1408b
parent5a8764bab4d8ef9372c440e0e246432a07096be8 (diff)
downloadgbm_gralloc-b42d5c24b42f2360723bcb4700171a3e6a6c2561.tar.gz
gbm_gralloc-b42d5c24b42f2360723bcb4700171a3e6a6c2561.tar.xz
WIPWIP
-rw-r--r--Android.mk3
-rw-r--r--gralloc_gbm.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 14d0b58..c6ad8d8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,6 +26,9 @@ LOCAL_SRC_FILES := \
gralloc_gbm.cpp \
gralloc.cpp
+LOCAL_C_INCLUDES := \
+ external/libdrm/include
+
LOCAL_SHARED_LIBRARIES := \
libgbm \
liblog \
diff --git a/gralloc_gbm.cpp b/gralloc_gbm.cpp
index f7e5750..299213b 100644
--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -37,6 +37,8 @@
#include <hardware/gralloc.h>
#include <system/graphics.h>
+#include <drm/drm_fourcc.h>
+
#include <gbm.h>
#include "gralloc_gbm_priv.h"
@@ -169,6 +171,9 @@ static struct gralloc_gbm_bo_t *gbm_alloc(struct gbm_device *gbm,
ALOGV("create BO, size=%dx%d, fmt=%d, usage=%x",
handle->width, handle->height, handle->format, usage);
buf->bo = gbm_bo_create(gbm, width, height, format, usage);
+ const uint64_t modifiers[] = { DRM_FORMAT_MOD_VIVANTE_SUPER_TILED };
+ buf->bo = gbm_bo_create_with_modifiers(gbm, width, height, format, (uint64_t *) &modifiers, 1);
+ //buf->bo = gbm_bo_create(gbm, width, height, format, usage);
if (!buf->bo) {
ALOGE("failed to create BO, size=%dx%d, fmt=%d, usage=%x",
handle->width, handle->height, handle->format, usage);
@@ -291,7 +296,8 @@ static struct gralloc_gbm_bo_t *validate_handle(buffer_handle_t _handle,
if (!gbm)
return NULL;
- ALOGV("handle: pfd=%d\n", handle->prime_fd);
+ ALOGE("%s handle->prime_fd=%llu\n", __func__, handle->prime_fd);
+ ALOGE("%s handle->modifier=%llu\n", __func__, handle->modifier);
bo = gbm_import(gbm, handle);
if (bo) {