drm_hwcomposer: Use DUMB buffer for modeset
Now, as the LayerProperties struct accepts BufferInfo and BufferInfo can
carry the RAII-wrapped dmabuf FD, it has become elementary to use dumb
buffer for a modeset.
There are two benefits compared to using the gralloc:
1. We aim to make the DRM composer backend Android-agnostic.
2. Not every gralloc may support mapping the HWFB buffer.
Change-Id: I661c88be276de8f068d3af1e44da2740b1bec60d
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/drm/DrmDevice.h b/drm/DrmDevice.h
index cbaa536..7ee7d10 100644
--- a/drm/DrmDevice.h
+++ b/drm/DrmDevice.h
@@ -18,11 +18,13 @@
#include <cstdint>
#include <map>
+#include <optional>
#include <tuple>
#include "DrmConnector.h"
#include "DrmCrtc.h"
#include "DrmEncoder.h"
+#include "bufferinfo/BufferInfo.h"
#include "utils/fd.h"
namespace android {
@@ -70,6 +72,9 @@
return HasAddFb2ModifiersSupport_;
}
+ auto CreateBufferForModeset(uint32_t width, uint32_t height)
+ -> std::optional<BufferInfo>;
+
auto &GetDrmFbImporter() {
return *drm_fb_importer_;
}