Open the DRM device of the primary framebuffer (fb0) With the new added drmOpenByFB function in libdrm, it's easy to find the correct DRM device of the primary framebuffer. Signed-off-by: Chih-Wei Huang]]>
Let gbm_free() return a value So that gralloc_gbm_handle_unregister() could return correct value required by gralloctest. Signed-off-by: Chih-Wei Huang]]>
Merge branch 'fb' of https://github.com/lambdadroid/gbm_gralloc into oreo-x86]]>
android: add gralloctest gralloctest executable is added for Android based on minigbm/cros_gralloc commits: b57dffc ("minigbm: move gralloctest to this repo") 2eeaf5a ("minigbm: cros_gralloc: fix -Wimplicit-function-declaration warnings in gralloctest") Signed-off-by: Mauro Rossi]]>
Merge remote-tracking branch 'origin/master' into oreo-x86 Conflicts: gralloc_drm_handle.h]]>
Add simple framebuffer HAL implementation using drm_framebuffer]]>
Update usage flag handling for hwc Add support for GRALLOC_USAGE_HW_COMPOSER usage flag mapping it to GBM flags, inspired by minigbm implementation. Fixes the artifacts issues with vulkan hal radv with the following apps with benefit to all apps using HWC layers: V1 - GPU Benchmark Pro (Vulkan API) PPSSPP - PSP emulator Sascha Willems Vulkan Examples (e.g. Vulkan Gears, Vulkan Texture) Signed-off-by: Mauro Rossi]]>Signed-off-by: Rob Herring
Switch to use gralloc handle defined in libdrm Remove our custom handle definition and use the one defined in libdrm. Signed-off-by: Rob Herring]]>
Use a std::unordered_map to lookup BOs from handles Remove the fragile dependency on the handle 'data' pointer and 'data_owner' flag. This idea is stolen from the CrOS minigbm gralloc implementation. Signed-off-by: Rob Herring]]>
Remove GRALLOC_MODULE_PERFORM_GET_USAGE This is no longer used by drm_hwc and can be removed. Signed-off-by: Rob Herring]]>
Move gralloc_gbm_handle_t accesses into gralloc_gbm.cpp The only access to the gralloc_gbm_handle_t in gralloc.cpp is to set the stride of allocated buffers. Move this into gralloc_gbm.cpp to isolate accesses to the struct in one place. Signed-off-by: Rob Herring]]>
Merge remote-tracking branch 'origin/master' into nougat-x86 Conflicts: gralloc_drm_handle.h]]>
Explicitly include string.h The master build started failing on strcmp and memset being undeclared, so explicitly include string.h. Change-Id: I55d042b34e55375ed50f9300ab0c3abdfa0f2631 Signed-off-by: Rob Herring]]>
Fix unused parameter 'handle' warning AOSP now builds with -Werror. Fix this warning: gralloc_drm_handle.h:90:62: error: unused parameter 'handle' [-Werror,-Wunused-parameter] Change-Id: Ief13c01f0ca1ede2b9ef5662acbdc6d0f27f6cd4 Signed-off-by: Rob Herring]]>
Use native_handle functions Use native_handle_{create,delete} functions instead of the C++ alloc/free. This will do the initialization for us instead of open coding it. Change-Id: I285292770ca756c1d2c2effa5c73e252526bae0c Signed-off-by: Rob Herring]]>
Merge remote-tracking branch 'origin/master' into nougat-x86]]>
Remove old libraries in /system Since commit 94559640 the libraries are moved to /vendor. But the old libraries are not removed in an incremental build. Therefore the new libraries may not be used. Fixes: 94559640 ("Android: move libraries to /vendor") Signed-off-by: Chih-Wei Huang]]>
Fix 32-bit app crashing in 64-bit Android Seemingly the 64-bit int is always aligned to 8 in LP64. But this is not hold in LP32. Consequently sizeof(gralloc_drm_handle_t) are different between LP64 (which is 18 ints) and LP32 (which is 16 ints). As a result, 32-bit apps will crash in 64-bit OS since the checking handle->base.numInts != GRALLOC_GBM_HANDLE_NUM_INTS is true. Fix it by always aligning 64-bit int to 8. Besides, to avoid additional padding, just exchange the order of data_owner and modifier. It aligns modifier to 8 natually. This makes gralloc_drm_handle_t fit in 16 ints perfectly. Signed-off-by: Chih-Wei Huang]]>
Android: move libraries to /vendor As part of Treble project in Android O, all the device specific files have to be located in a separate vendor partition. This is done by setting LOCAL_PROPRIETARY_MODULE (the name is misleading). This change will not break existing platforms without a vendor partition as it will just move files to /system/vendor. Change-Id: I0e863d55406b3e2457bbaded818e7fd4f19f064a Signed-off-by: Rob Herring]]>
Convert gralloc_gbm_bo_t to gbm user data Instead of wrapping struct gbm_bo with our own BO struct, make the struct GBM BO userdata instead. This makes things clearer as to what a BO is. Signed-off-by: Rob Herring]]>
kill off gralloc_gbm_get_pid Caching getpid() calls seems pointless, so remove the added complexity and just use getpid() directly when needed. Signed-off-by: Rob Herring]]>
Rework handle register/unregister calls What validate_handle() did was ambiguous and broken for binderized gralloc. Reusing the existing BO pointer for gralloc_gbm_handle_register is broken because the BO may get freed. It is necessary to always import the buffer. So split validate handle into separate functions to retrieve the BO ptr and import the buffer. Change-Id: I4ea18aa0ded2d201c8f71f4e33a8fc893240d109 Signed-off-by: Rob Herring]]>
remove handle from BO Pass the handle to internal functions instead of the BO pointer, then we can always get the BO from the handle and never need to get the handle from the BO. Signed-off-by: Rob Herring]]>
Rework unregister/free code It is not necessary to track imported buffers nor ref count them and doing so is broken when native handles are cloned. So remove all the related code and separate the unregister and free code paths. Signed-off-by: Rob Herring]]>
Don't close fds on imported buffers The fds should only be closed if we allocated the handle. Signed-off-by: Rob Herring]]>
Revert "Add libgralloc_drm library to export headers to mesa" This reverts commit 77f32995cb6e0193878b4b4147201b701076cee8.]]>
gbm_import: fix missing gbm_import_fd_modifier_data initialization With gbm_import_fd_modifier_data, some fields are not getting initialized and in particular offset[0] is not which causes import failures. Add memset to ensure all fields are initialized. Reviewed-by: Robert Foss]]>Reviewed-by: Aleksander Morgado Signed-off-by: Rob Herring
Sync with the gbm API to import FD with modifier Commit 4026744fcb31f1d27c1b32e6945aadd4da415c6d in mesa introduced an updated `struct gbm_import_fd_modifier_data' with arrays for fds, strides and offsets, instead of single values. Fix just by specifying one single item in the arrays. Signed-off-by: Aleksander Morgado]]>
Add support for modifiers Modifiers are used to describe buffer metadata like if and how they are compressed or if tiling is used. This is needed to allow different devices to communicate about buffers that have these properties. Signed-off-by: Robert Foss]]>
Add description of GRALLOC_MODULE_PERFORM_GET_DRM_FD Add description of the perform call GRALLOC_MODULE_PERFORM_GET_DRM_FD. Signed-off-by: Robert Foss]]>