Skip to contentSkip to conversation

drm_hwcomposer: Add platform backend for minigbm

PATCH In review Alistair Strachan 2 participants 4 messages May 2, 2018 – May 3, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 drm_hwcomposer: Add platform backend for minigbm

This adds support for the chromiumos (not AOSP) version of minigbm. Like hisi, the gralloc handle is not the same as the common libdrm handle (just yet), so we do need a separate backend.

Tested with a pending change to the 'cuttlefish' android virtual device in AOSP with its custom gralloc switched to minigbm.

Cc John Stultz <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sean Paul <[email protected]>
Cc Greg Hartman <[email protected]>
---
 Android.mk          |   8 +--
 platformminigbm.cpp | 122 ++++++++++++++++++++++++++++++++++++++++++++
 platformminigbm.h   |  46 +++++++++++++++++
 3 files changed, 173 insertions(+), 3 deletions(-)
 create mode 100644 platformminigbm.cpp
 create mode 100644 platformminigbm.h
Android.mk +5 -3
index 747bf27..549fc7c 100644
@@ -101,14 +101,16 @@ ifeq ($(TARGET_PRODUCT),hikey960)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc960/
-else
-ifeq ($(TARGET_PRODUCT),hikey)
+else ifeq ($(TARGET_PRODUCT),hikey)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc/
+else ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),minigbm)
+LOCAL_SRC_FILES += platformminigbm.cpp
+LOCAL_C_INCLUDES += external/minigbm/cros_gralloc/
 else
 LOCAL_CPPFLAGS += -DUSE_DRM_GENERIC_IMPORTER
-endif
+LOCAL_C_INCLUDES += external/drm_gralloc
 endif
 
 LOCAL_MODULE := hwcomposer.drm
platformminigbm.cpp new file +122 -0

122 lines not on this page · raw message

platformminigbm.h new file +46 -0

46 lines not on this page · raw message

Signature · 6 lines
2.17.0.441.gb46fe60e1d-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v2 3/3 drm_hwcomposer: Add platform backend for minigbm

This adds support for the chromiumos (not AOSP) version of minigbm. Like hisi, the gralloc handle is not the same as the common libdrm handle (just yet), so we do need a separate backend for now.

Tested with a pending change to the 'cuttlefish' android virtual device in AOSP with its custom gralloc switched to minigbm.

Cc John Stultz <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sean Paul <[email protected]>
Cc Greg Hartman <[email protected]>

---
v2: Removed re-introduction of <external/drm_gralloc>

 Android.mk          |   7 +--
 platformminigbm.cpp | 122 ++++++++++++++++++++++++++++++++++++++++++++
 platformminigbm.h   |  46 +++++++++++++++++
 3 files changed, 172 insertions(+), 3 deletions(-)
 create mode 100644 platformminigbm.cpp
 create mode 100644 platformminigbm.h
Android.mk +4 -3
index 747bf27..0818a40 100644
@@ -101,15 +101,16 @@ ifeq ($(TARGET_PRODUCT),hikey960)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc960/
-else
-ifeq ($(TARGET_PRODUCT),hikey)
+else ifeq ($(TARGET_PRODUCT),hikey)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc/
+else ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),minigbm)
+LOCAL_SRC_FILES += platformminigbm.cpp
+LOCAL_C_INCLUDES += external/minigbm/cros_gralloc/
 else
 LOCAL_CPPFLAGS += -DUSE_DRM_GENERIC_IMPORTER
 endif
-endif
 
 LOCAL_MODULE := hwcomposer.drm
 LOCAL_MODULE_TAGS := optional
platformminigbm.cpp new file +122 -0

122 lines not on this page · raw message

platformminigbm.h new file +46 -0

46 lines not on this page · raw message

Signature · 6 lines
2.17.0.441.gb46fe60e1d-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 29 lines · Alistair Strachan

This adds support for the chromiumos (not AOSP) version of minigbm. Like hisi, the gralloc handle is not the same as the common libdrm handle (just yet), so we do need a separate backend for now.

Tested with a pending change to the 'cuttlefish' android virtual device in AOSP with its custom gralloc switched to minigbm.

Cc John Stultz <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sean Paul <[email protected]>
Cc Greg Hartman <[email protected]>

---
v2: Removed re-introduction of <external/drm_gralloc>

 Android.mk          |   7 +--
 platformminigbm.cpp | 122 ++++++++++++++++++++++++++++++++++++++++++++
 platformminigbm.h   |  46 +++++++++++++++++
 3 files changed, 172 insertions(+), 3 deletions(-)
 create mode 100644 platformminigbm.cpp
 create mode 100644 platformminigbm.h
Android.mk +0 -0
index 747bf27..0818a40 100644
@@ -101,15 +101,16 @@ ifeq ($(TARGET_PRODUCT),hikey960)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp

Android.mk ifeq ($(TARGET_PRODUCT),hikey960) · line 110

Quoted 10 lines
Android.mk +4 -2
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc960/
-else
-ifeq ($(TARGET_PRODUCT),hikey)
+else ifeq ($(TARGET_PRODUCT),hikey)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc/
+else ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),minigbm)
+LOCAL_SRC_FILES += platformminigbm.cpp
+LOCAL_C_INCLUDES += external/minigbm/cros_gralloc/

So, I'm not seeing external/minigbm in the manifest file yet, so I'm not sure much testing of this bit in-particular can be done, but otherwise I don't see anything to object to.

I did apply your entire series here (including the separate cleanups) and did validate it all works ok with HiKey960 (sans Treble - I'm currently rebuilding w/ Treble now so that's ~an hour out).

thanks
-john
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Tested-by
#3 lore raw
Quoted 45 lines · John Stultz
Quoted 29 lines · Alistair Strachan

This adds support for the chromiumos (not AOSP) version of minigbm. Like hisi, the gralloc handle is not the same as the common libdrm handle (just yet), so we do need a separate backend for now.

Tested with a pending change to the 'cuttlefish' android virtual device in AOSP with its custom gralloc switched to minigbm.

Cc John Stultz <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sean Paul <[email protected]>
Cc Greg Hartman <[email protected]>

---
v2: Removed re-introduction of <external/drm_gralloc>

 Android.mk          |   7 +--
 platformminigbm.cpp | 122 ++++++++++++++++++++++++++++++++++++++++++++
 platformminigbm.h   |  46 +++++++++++++++++
 3 files changed, 172 insertions(+), 3 deletions(-)
 create mode 100644 platformminigbm.cpp
 create mode 100644 platformminigbm.h
Android.mk +0 -0
index 747bf27..0818a40 100644
@@ -101,15 +101,16 @@ ifeq ($(TARGET_PRODUCT),hikey960)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp

Android.mk ifeq ($(TARGET_PRODUCT),hikey960) · line 110

Quoted 10 lines
Android.mk +4 -2
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc960/
-else
-ifeq ($(TARGET_PRODUCT),hikey)
+else ifeq ($(TARGET_PRODUCT),hikey)
 LOCAL_CPPFLAGS += -DUSE_HISI_IMPORTER
 LOCAL_SRC_FILES += platformhisi.cpp
 LOCAL_C_INCLUDES += device/linaro/hikey/gralloc/
+else ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),minigbm)
+LOCAL_SRC_FILES += platformminigbm.cpp
+LOCAL_C_INCLUDES += external/minigbm/cros_gralloc/

So, I'm not seeing external/minigbm in the manifest file yet, so I'm not sure much testing of this bit in-particular can be done, but otherwise I don't see anything to object to.

Quoted 3 lines

I did apply your entire series here (including the separate cleanups) and did validate it all works ok with HiKey960 (sans Treble - I'm currently rebuilding w/ Treble now so that's ~an hour out).

Just finished building and its looking good on HiKey960.

So for the whole series:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel