summaryrefslogtreecommitdiff
path: root/platformminigbm.h
diff options
context:
space:
mode:
authorAlistair Strachan <astrachan@google.com>2018-05-02 17:01:49 -0700
committerSean Paul <seanpaul@chromium.org>2018-05-03 10:48:56 -0400
commit71edaca727572bdcc60c6c7e12cb7fb74dfd4947 (patch)
tree40a4986d8d9fb26c8ed6e0251f4bcc81c84e1a17 /platformminigbm.h
parentaf0ff9c549d78515d317989ec18de4e3a8c72aac (diff)
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 <john.stultz@linaro.org> Cc: Rob Herring <rob.herring@linaro.org> Cc: Sean Paul <seanpaul@google.com> Cc: Greg Hartman <ghartman@google.com> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Alistair Strachan <astrachan@google.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'platformminigbm.h')
-rw-r--r--platformminigbm.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/platformminigbm.h b/platformminigbm.h
new file mode 100644
index 0000000..ded4c07
--- /dev/null
+++ b/platformminigbm.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_PLATFORM_DRM_MINIGBM_H_
+#define ANDROID_PLATFORM_DRM_MINIGBM_H_
+
+#include "drmresources.h"
+#include "platform.h"
+#include "platformdrmgeneric.h"
+
+#include <hardware/gralloc.h>
+
+namespace android {
+
+class DrmMinigbmImporter : public DrmGenericImporter {
+ public:
+ DrmMinigbmImporter(DrmResources *drm);
+ ~DrmMinigbmImporter() override;
+
+ int Init();
+
+ EGLImageKHR ImportImage(EGLDisplay egl_display, buffer_handle_t handle) override;
+ int ImportBuffer(buffer_handle_t handle, hwc_drm_bo_t *bo) override;
+
+ private:
+ DrmResources *drm_;
+
+ const gralloc_module_t *gralloc_;
+};
+
+}
+
+#endif