Add xf86drm.h wrapper with pending features.

Fork of a libdrm change so we can move forward with a mesa3d merge
without needing to update libdrm again.

From: Robert Foss <robert.foss@collabora.com>

drmHandleMatch is intended to allow for userspace to filter out
devices that it does not want to open.

Opening specific devices using paths alone is not a reliable due to
probing order. This function intends to provide a mechanism
for filtering out devices that don't fit what you need using an
extensible set of filters.

drm_match_key_t is intended to be extended with whatever
filter that would come in handy down the line.

As a catch-all filter, the DRM_MATCH_FUNCTION was included
which allows the caller to filter based on an arbitrary function.

An function pointer filter could of course filter based on
anything. But for the sake of convenience a few other simple
filters have been included.

If the function pointer filter ends up being called with a
boilerplate fp by mutliple libdrm users, perhaps that funtion
could be moved into libdrm at a future date.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
[astrachan: cherry picked pending upstream change to resolve merge issue]
Bug: 79165890
List: https://patchwork.kernel.org/patch/10368203/
Change-Id: I2d3e6e0e85e5ac0d3039051078d7df9abb36e126
Signed-off-by: Alistair Strachan <astrachan@google.com>
1 file changed