aboutsummaryrefslogtreecommitdiff
path: root/drm/DrmDevice.h
diff options
context:
space:
mode:
authorRoman Stratiienko <r.stratiienko@gmail.com>2021-02-09 17:49:55 +0200
committerRoman Stratiienko <r.stratiienko@gmail.com>2021-05-19 19:31:29 +0300
commit8666dc9c58e41bab871b97bdfc5a050f08017671 (patch)
tree44c0e24d346b732e308eb390bf7a9afdc12f3274 /drm/DrmDevice.h
parent92c6a40d5240b2b58bbe9c52eb7e7a4692380ad9 (diff)
downloaddrm_hwcomposer-8666dc9c58e41bab871b97bdfc5a050f08017671.tar.gz
drm_hwcomposer: Tracking of the DRM FB objects using RAII
DRM framebuffer objects must be kept registered in DRM/KMS while used for scanning-out (After atomic commit applied for processing by display controller and until next atomic commit is applied for processing). Existing logic for tracking current state is overcomplicated and needs to be redesigned. Also further developing of drm_hwc will require migration to asynchronous atomic commit, so additional asynchronous FB cleanup logic must be created. Buffer caching logic will also benefit from this. With the RAII all further changes will be less painful and more robust. By this commit I also renamed DrmGenericImporter to DrmFbImporter: 'Fb' word is present in most of existing composers (android and linux) so it will be easier to compare different implementations. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Diffstat (limited to 'drm/DrmDevice.h')
-rw-r--r--drm/DrmDevice.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drm/DrmDevice.h b/drm/DrmDevice.h
index d8f347f..c92004b 100644
--- a/drm/DrmDevice.h
+++ b/drm/DrmDevice.h
@@ -26,10 +26,14 @@
#include "DrmCrtc.h"
#include "DrmEncoder.h"
#include "DrmEventListener.h"
+#include "DrmFbImporter.h"
#include "DrmPlane.h"
namespace android {
+class DrmFbImporter;
+class DrmPlane;
+
class DrmDevice {
public:
DrmDevice();
@@ -83,6 +87,14 @@ class DrmDevice {
event_listener_.RegisterHotplugHandler(handler);
}
+ bool HasAddFb2ModifiersSupport() const {
+ return HasAddFb2ModifiersSupport_;
+ }
+
+ DrmFbImporter &GetDrmFbImporter() {
+ return *mDrmFbImporter.get();
+ }
+
private:
int TryEncoderForDisplay(int display, DrmEncoder *enc);
int GetProperty(uint32_t obj_id, uint32_t obj_type, const char *prop_name,
@@ -104,6 +116,12 @@ class DrmDevice {
std::pair<uint32_t, uint32_t> min_resolution_;
std::pair<uint32_t, uint32_t> max_resolution_;
std::map<int, int> displays_;
+
+ bool HasAddFb2ModifiersSupport_{};
+
+ std::shared_ptr<DrmDevice> self;
+
+ std::unique_ptr<DrmFbImporter> mDrmFbImporter;
};
} // namespace android