Draft: gbm: add gbm_platform interface
This is an RFC and includes a half-baked interface change to gbm.h
only.
With dri_interface.h
becoming internal, there is a renewed interest for CrOS to use mesa gbm rather than minigbm. Other than playing the role of an allocator and a mapper, minigbm is also a resolver: it supports and resolves non-GPU use flags to additional alignment and modifier requirements.
The idea of this MR is to introduce struct gbm_platform
and gbm_create_device_for_platform
, as an alternative way to create a gbm device. A gbm platform is defined externally. It can make decisions dynamically or statically. All these are out of the scope of mesa gbm.
On platforms with split render/display DRM devices, use flags such as GBM_BO_USE_SCANOUT
are alrady non-GPU flags and can only be resolved heuristically. This change should also potentially allow us to move kmsro heuristics from gallium into gbm, but I didn't look into it too closely.
Thoughts?