minigbm: add GRALLOC_DRM_GET_USAGE query

Low-latency stylus support requires EGL_KHR_mutable_render_buffer, and
front rendering support in mesa requires the bo to be shared between gpu
and composer simultaneously. Either BO_USE_FRONT_RENDERING or forcing
linear with BO_USE_LINEAR is needed upon bo allocation. This change adds
a way for the client to inform gralloc of such info so that the minigbm
backend can choose the proper bo use flags upon allocation.

BUG=b:183507528
TEST=dEQP-EGL.functional.mutable_render_buffer.*
TEST=tast run $DUT arc.Gralloc.vm

Change-Id: Id7da33cea7d62aa9ae035ee3a6767f87874cb6ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2895370
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2 files changed