eglfs: Add various debug prints to KMS hooks

Change-Id: Ib0284601fa4ce2912312999190e4a1e2dc2afe42
Reviewed-by: Risto Avila <risto.avila@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
eglfs: Add better configuration support to KMS hooks

This patch improves the configurability of the KMS hooks. Support is added
for a json config file. The file can be used to specify the device to use,
whether pbuffers are supported, whether HW cursors should be used and the
mode to use per output.

The path to the configuration file is specified through the
QT_QPA_EGLFS_KMS_CONFIG environment variable.

The output initialization code is significantly changed and now closely
matches Weston's drm compositor setup code. We now track which crtc's and
which connectors are already in use for more robust output setup.

Importantly, it is now possible to turn off undesired outputs as well as
select the mode to use on outputs. The configuration syntax is similar
to Weston's config file, and the following settings are supported per
output:

 off, preferred, current, WIDTHxHEIGHT, modeline

Unless the output mode configuration matches "off", "preferred" or "current"
exactly, it is first attempted to parse the mode as WIDTHxHEIGHT, after
which it is attempted to parse the mode as a modeline. The modeline parsing
code is very closely modeled after the parsing code in Weston.

If an output mode cannot be parsed the default fallback is preferred mode.

The defaults for all settings are as follows:
 device: unless specified, the first device found through QDeviceDiscovery
 hwcursor: true
 pbuffers: false
 outputs: empty

An example configuration file might look as follows:

{
  "device": "/dev/dri/card1",
  "hwcursor": false,
  "pbuffers": true,
  "outputs": [
    {
      "name": "VGA1",
      "mode": "off"
    },
    {
      "name": "HDMI1",
      "mode": "1024x768"
    }
  ]
}

Change-Id: Ibe1e446c44a014ae8c7cbd8173a060ca862c2bc8
Reviewed-by: Risto Avila <risto.avila@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>