gbm: Set errno on errors

This should give the caller some information of what called the error.
For the gbm_bo_import() case, for instance, it is possible to know if
the import is not supported or the error was caused by an invalid
parameter.
wayland: Fix the logic in disabling the prime capability

It looks like this bit of code is trying to disable the prime capability if
the driver doesn't support createImageFromFds. However the logic looks a bit
broken and what it would actually do is disable all other capabilities apart
from prime. This patch fixes it to actually disable prime.
egl/drm: Rename dri2_egl_surface field gbm_surf to gbm_dri_surf

It actually contains a pointer to a gbm_dri_surface, so use a more
appropriate name.
egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM

Otherwise it fails to compile if the drm egl platform is disabled.
gbm: Add a native intel backend
gbm_drm: Keep a reference to drm native objects

Add bo and bufmgr fields to gbm_drm_bo and gbm_drm_device respectively.
dri, i965: Add an extension for sharing the drm bufmgr

If the fd used by the DRI driver is going to be shared with something
else, like gbm, this lets the loader pass the bufmgr struct so it is
shared too.
dri, i965: Add entry point for creating image from native handle

The native handle is a pointer to drm_intel_bo for the i965 driver.
egl/dri: Add gbm platform

This adds a GBM platform that works with native gbm backends, such
as the intel backend.
gbm: Add entry points for mapping and unmapping bos

Add gbm_bo_map() and gbm_bo_unmap(). This lets a user access the
contents of a bo using the CPU.
gbm: Hacked together import and export to/from dma_bufs

This patch needs work. It's just something I hacked together very
quickly.