[samples] fix drm drivers detection
Current mechanism to detect Intel drm drivers uses the following schema: 1) Walk through the list of PCI devices, get device properties (Vendor ID) and calculate number of PCI devices that corresponds to ‘DISPLAY_CONTROLLER_CLASS’ (adapters_num) 2) Use adapters_num to get path to /dev/dri/cardN and /dev/dri/renderDN with checking for Vendor ID. But this approach is not working in some cases. For example, if PCI device is present but corresponding driver is not set up. So it can be attempt to open wrong /dev/dri/renderN and /dev/dri/cardN paths. New approach is based on checking for /dev/dri/renderD<N> (N=0..15) with drm request for driver name.
Showing with 54 additions and 179 deletions