diff options
author | Roman Stratiienko <r.stratiienko@gmail.com> | 2021-02-10 14:59:52 +0200 |
---|---|---|
committer | Roman Stratiienko <r.stratiienko@gmail.com> | 2021-05-19 19:31:29 +0300 |
commit | 5128715b42e6713b98244bd05f218b8800a39b74 (patch) | |
tree | c67c606920c126611f6465c3c810a8f2232e8c1a /include/drmhwcomposer.h | |
parent | f0b3e28682d9f11787ddf364f52fcb54c616c968 (diff) | |
download | drm_hwcomposer-5128715b42e6713b98244bd05f218b8800a39b74.tar.gz |
drm_hwcomposer: cleanup hwcutils
Remove DrmHwcBuffer class. Wrap remaining logic into
DrmHwcLayer class.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Diffstat (limited to 'include/drmhwcomposer.h')
-rw-r--r-- | include/drmhwcomposer.h | 55 |
1 files changed, 4 insertions, 51 deletions
diff --git a/include/drmhwcomposer.h b/include/drmhwcomposer.h index 2ec1154..6955306 100644 --- a/include/drmhwcomposer.h +++ b/include/drmhwcomposer.h @@ -28,57 +28,9 @@ #include "drm/DrmFbImporter.h" #include "drmhwcgralloc.h" -class DrmFbIdHandle; -struct hwc_import_context; - -int hwc_import_init(struct hwc_import_context **ctx); -int hwc_import_destroy(struct hwc_import_context *ctx); - -int hwc_import_bo_create(int fd, struct hwc_import_context *ctx, - buffer_handle_t buf, struct hwc_drm_bo *bo); -bool hwc_import_bo_release(int fd, struct hwc_import_context *ctx, - struct hwc_drm_bo *bo); - namespace android { -class DrmHwcBuffer { - public: - DrmHwcBuffer() = default; - DrmHwcBuffer(const hwc_drm_bo &bo, DrmDevice *drmDevice) - : bo_(bo), mDrmDevice(drmDevice) { - } - DrmHwcBuffer(DrmHwcBuffer &&rhs) : bo_(rhs.bo_), mDrmDevice(rhs.mDrmDevice) { - rhs.mDrmDevice = nullptr; - FbIdHandle.swap(rhs.FbIdHandle); - } - - ~DrmHwcBuffer() { - } - - DrmHwcBuffer &operator=(DrmHwcBuffer &&rhs) { - FbIdHandle.swap(rhs.FbIdHandle); - mDrmDevice = rhs.mDrmDevice; - rhs.mDrmDevice = nullptr; - bo_ = rhs.bo_; - return *this; - } - - operator bool() const { - return mDrmDevice != NULL; - } - - const hwc_drm_bo *operator->() const; - - void Clear(); - - std::shared_ptr<DrmFbIdHandle> FbIdHandle; - - int ImportBuffer(buffer_handle_t handle, DrmDevice *drmDevice); - - private: - hwc_drm_bo bo_; - DrmDevice *mDrmDevice; -}; +class DrmFbIdHandle; enum DrmHwcTransform { kIdentity = 0, @@ -97,8 +49,10 @@ enum class DrmHwcBlending : int32_t { struct DrmHwcLayer { buffer_handle_t sf_handle = NULL; + hwc_drm_bo_t buffer_info{}; + std::shared_ptr<DrmFbIdHandle> FbIdHandle; + int gralloc_buffer_usage = 0; - DrmHwcBuffer buffer; uint32_t transform; DrmHwcBlending blending = DrmHwcBlending::kNone; uint16_t alpha = 0xffff; @@ -110,7 +64,6 @@ struct DrmHwcLayer { OutputFd release_fence; int ImportBuffer(DrmDevice *drmDevice); - int InitFromDrmHwcLayer(DrmHwcLayer *layer, DrmDevice *drmDevice); void SetTransform(int32_t sf_transform); |