drm_hwcomposer: Improve Mapper@4 metadata API fds index guessing logic
Unfortunately Mapper@4.0 metadata API doesn't allow to query fd index or
getting fd another way for every layout plane, therefore users have to
provide their custom additional metadata API.
We are doing all our best to minimize custom per-platform logic in
drm_hwcomposer. So it was decided to implement primitive guessing logic,
allowing users to extend it with out-of-tree code if necessary.
As was reported by John Stultz in [1] our primitive logic has some flaws.
New guessing logic are using inputs from layout data (offsets, sizes),
and should be more precise.
[1]: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/merge_requests/159
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/include/drmhwcgralloc.h b/include/drmhwcgralloc.h
index 57685d1..09c7499 100644
--- a/include/drmhwcgralloc.h
+++ b/include/drmhwcgralloc.h
@@ -28,6 +28,8 @@
uint32_t usage;
uint32_t pitches[HWC_DRM_BO_MAX_PLANES];
uint32_t offsets[HWC_DRM_BO_MAX_PLANES];
+ /* sizes[] is used only by mapper@4 metadata getter for internal purposes */
+ uint32_t sizes[HWC_DRM_BO_MAX_PLANES];
int prime_fds[HWC_DRM_BO_MAX_PLANES];
uint64_t modifiers[HWC_DRM_BO_MAX_PLANES];
int acquire_fence_fd;