hwc2/gralloc1: Create libgrallocutils
--For gralloc1, create a libgrallocutils that provides helpers to
calculate various buffer related info
--Make hwc2/gralloc1 structures independent of libdrmutils
and fb_id / gemhandles
--Implement GetBufferLayout API from BufferAllocator that can be called
by DAL before creating fb_id
Change-Id: I0aede7d1ea87302ecda593047728d381383484b9
CRs-fixed: 1114808
diff --git a/libgralloc1/gr_adreno_info.h b/libgralloc1/gr_adreno_info.h
index 5cad771..1c85c8c 100644
--- a/libgralloc1/gr_adreno_info.h
+++ b/libgralloc1/gr_adreno_info.h
@@ -71,10 +71,6 @@
class AdrenoMemInfo {
public:
- AdrenoMemInfo();
-
- ~AdrenoMemInfo();
-
bool Init();
/*
@@ -124,7 +120,10 @@
*/
ADRENOPIXELFORMAT GetGpuPixelFormat(int hal_format);
+ static AdrenoMemInfo *GetInstance();
+
private:
+ ~AdrenoMemInfo();
// link(s)to adreno surface padding library.
int (*LINK_adreno_compute_padding)(int width, int bpp, int surface_tile_height,
int screen_tile_height, int padding_threshold) = NULL;
@@ -141,6 +140,8 @@
bool gfx_ubwc_disable_ = false;
bool map_fb_ = false;
void *libadreno_utils_ = NULL;
+
+ static AdrenoMemInfo *s_instance;
};
} // namespace gralloc1