diff options
author | Tao Bao <tbao@google.com> | 2018-11-01 20:03:27 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-11-01 20:03:27 +0100 |
commit | deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079 (patch) | |
tree | 1d248214bcb090f9ae9ec00327d5801a217636cd /minui/graphics_adf.h | |
parent | Merge "Refactor the code to check the metadata" am: cbdcfc0038 am: 6ba8eb5248 (diff) | |
parent | Merge changes I69ce001a,I14514017,I8e67cda7 am: d2e1c0a981 (diff) | |
download | android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar.gz android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar.bz2 android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar.lz android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar.xz android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.tar.zst android_bootable_recovery-deaf2662d7ba0ee4672d5cc2a4ff7a50108e8079.zip |
Diffstat (limited to 'minui/graphics_adf.h')
-rw-r--r-- | minui/graphics_adf.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/minui/graphics_adf.h b/minui/graphics_adf.h index 099d32962..bf9842878 100644 --- a/minui/graphics_adf.h +++ b/minui/graphics_adf.h @@ -17,6 +17,9 @@ #pragma once #include <stdint.h> +#include <sys/types.h> + +#include <memory> #include <adf/adf.h> @@ -25,6 +28,11 @@ class GRSurfaceAdf : public GRSurface { public: + ~GRSurfaceAdf() override; + + static std::unique_ptr<GRSurfaceAdf> Create(int intf_fd, const drm_mode_modeinfo* mode, + __u32 format, int* err); + uint8_t* data() override { return mmapped_buffer_; } @@ -32,34 +40,36 @@ class GRSurfaceAdf : public GRSurface { private: friend class MinuiBackendAdf; - int fence_fd; - int fd; - __u32 offset; - __u32 pitch; + GRSurfaceAdf(int width, int height, int row_bytes, int pixel_bytes, __u32 offset, __u32 pitch, + int fd) + : GRSurface(width, height, row_bytes, pixel_bytes), offset(offset), pitch(pitch), fd(fd) {} + + const __u32 offset; + const __u32 pitch; + int fd; + int fence_fd{ -1 }; uint8_t* mmapped_buffer_{ nullptr }; }; class MinuiBackendAdf : public MinuiBackend { public: + MinuiBackendAdf(); + ~MinuiBackendAdf() override; GRSurface* Init() override; GRSurface* Flip() override; void Blank(bool) override; - ~MinuiBackendAdf() override; - MinuiBackendAdf(); private: - int SurfaceInit(const drm_mode_modeinfo* mode, GRSurfaceAdf* surf); int InterfaceInit(); int DeviceInit(adf_device* dev); - void SurfaceDestroy(GRSurfaceAdf* surf); void Sync(GRSurfaceAdf* surf); int intf_fd; adf_id_t eng_id; __u32 format; adf_device dev; - unsigned int current_surface; - unsigned int n_surfaces; - GRSurfaceAdf surfaces[2]; + size_t current_surface; + size_t n_surfaces; + std::unique_ptr<GRSurfaceAdf> surfaces[2]; }; |