Close DRM file descriptor on clean-up

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Add support for platform probe

Inspired by xf86-video-freedreno.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Add support for server managed file descriptors

Inspired by xf86-video-freedreno's commit
4936b859d1f4374a581e5eb3256a1b951d5e6687.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Add OutputClass configuration file

This enables the xserver to associate the drm driver name "exynos" to the
xf86-video-openfimg driver.

Inspired by commit 0624ed0a86c411ad7a2070f670b540b323e29f35 of
xf86-video-freedreno project.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
kms: fix problem with multiple displays

Previously, by trying to re-use the fb creation in _resize(), we'd end
up with a call back into _set_mode_major() with a bogus (all zero's)
mode.  Which results in trying to set mode 0x0@0 which results in
bad things.

The clocks react badly when trying to set them to 0Hz, so we need a bit
of protection in the kernel for this.  But we should get rid of the
bogus modeset in DDX as well (which this patch does).

Signed-off-by: Rob Clark <robdclark@gmail.com>
[tomasz.figa: Applied to xf86-video-openfimg]
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
make sure scanout has a legit stride

The gpu wants pixmaps (including scanout) with width aligned to 32
pixels.  We calculate the correct pitch when allocating the scanout
buffer (so the buffer is the correct size), but nothing was updating
scanout pixmap's pitch, resulting in gpu trying to blit to the wrong
places.

Signed-off-by: Rob Clark <robdclark@gmail.com>
[tomasz.figa: Applied to xf86-video-openfimg]
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
kms: remove fb on ScreenClose

Otherwise we'd end up with a new scanout buffer, but old fb, on the next
time around.  This way drmmode_xf86crtc_resize() realizes to create a
new fb on next server generation.

Signed-off-by: Rob Clark <robdclark@gmail.com>
[tomasz.figa: Applied to xf86-video-openfimg]
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
dri2: pDraw can be gone already... don't dixSetPrivate()

Signed-off-by: Rob Clark <robdclark@gmail.com>
[tomasz.figa: Applied to xf86-video-openfimg]
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Allocate initial scanout buffer

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>