aboutsummaryrefslogtreecommitdiff
path: root/drm/DrmFbImporter.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-10 01:01:59 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-10 01:01:59 +0000
commite9f598089179a592bf2b0d4bc333ffe03ab5dfe0 (patch)
tree8e2c640be06a05fdc28ced0de956702c43663f1d /drm/DrmFbImporter.h
parent9b2a7251c9ab49a79ea723cd1589fad8b2b8077b (diff)
parent0ce361010578834528e6e987c2f75d942884e370 (diff)
downloaddrm_hwcomposer-e9f598089179a592bf2b0d4bc333ffe03ab5dfe0.tar.gz
Change-Id: I1a69ed7685471b466a60937035a7a68040301845
Diffstat (limited to 'drm/DrmFbImporter.h')
-rw-r--r--drm/DrmFbImporter.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/drm/DrmFbImporter.h b/drm/DrmFbImporter.h
index efeb457..7f17bbe 100644
--- a/drm/DrmFbImporter.h
+++ b/drm/DrmFbImporter.h
@@ -37,8 +37,7 @@ namespace android {
class DrmFbIdHandle {
public:
static auto CreateInstance(hwc_drm_bo_t *bo, GemHandle first_gem_handle,
- const std::shared_ptr<DrmDevice> &drm)
- -> std::shared_ptr<DrmFbIdHandle>;
+ DrmDevice &drm) -> std::shared_ptr<DrmFbIdHandle>;
~DrmFbIdHandle();
DrmFbIdHandle(DrmFbIdHandle &&) = delete;
@@ -51,10 +50,9 @@ class DrmFbIdHandle {
}
private:
- explicit DrmFbIdHandle(std::shared_ptr<DrmDevice> drm)
- : drm_(std::move(drm)){};
+ explicit DrmFbIdHandle(DrmDevice &drm) : drm_(&drm){};
- const std::shared_ptr<DrmDevice> drm_;
+ DrmDevice *const drm_;
uint32_t fb_id_{};
std::array<GemHandle, kHwcDrmBoMaxPlanes> gem_handles_{};
@@ -62,8 +60,7 @@ class DrmFbIdHandle {
class DrmFbImporter {
public:
- explicit DrmFbImporter(std::shared_ptr<DrmDevice> drm)
- : drm_(std::move(drm)){};
+ explicit DrmFbImporter(DrmDevice &drm) : drm_(&drm){};
~DrmFbImporter() = default;
DrmFbImporter(const DrmFbImporter &) = delete;
DrmFbImporter(DrmFbImporter &&) = delete;
@@ -84,7 +81,7 @@ class DrmFbImporter {
}
}
- const std::shared_ptr<DrmDevice> drm_;
+ DrmDevice *const drm_;
std::map<GemHandle, std::weak_ptr<DrmFbIdHandle>> drm_fb_id_handle_cache_;
};