lib: adding drm_open_driver() interface

The drm_open_driver*() functions replace the drm_open_any*() functions and
provide the same utility, but in a way that is platform agnostic, not
intel-specific.  This opens the path for adopting intel-gpu-tools to non-intel
platforms.

This commit renames the calls and adds the chipset parameter which can be used
to restrict the opening to a specific hardware family.  For example,
drm_open_driver(DRIVER_INTEL) will only return a valid fd if an intel GPU is
found on the system, along with performing intel-specific initialization stuff
like gem_quiescent_gpu(), et al.  If OPEN_ANY_GPU is specified, the first
available drm device of any type will be opened.

Other hardware type flags may be added in the future.

The drm_open_any*() calls are retained as aliases of
drm_open_driver*(OPEN_ANY_GPU) but will be removed in a subsequent patch.

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2 files changed