EGL/Wayland: DRI_PRIME support v3

Implements DRI_PRIME support for the Wayand EGL backend.

v3: Add a check to dri2_create_image_wayland_wl_buffer to fail
if we forbid to use tiling (which now means we use another gpu
than the compositor). We can't check the buffer is untiled (which
is unlikely), so we fail here. It's in the specification.
v2: some cleanup and fixes

Signed-off-by: Axel Davy <axel.davy@ens.fr>
drirc: Add string support

Signed-off-by: Axel Davy <axel.davy@ens.fr>
EGL/Wayland drirc: Use drirc to complement DRI_PRIME

Add to drirc a new parameter: "wanted_device_id_path_tag"
to indicate the gpu we would like to use.

The EGL Wayland platform checks this parameter under
the driver name "init". It should be possible to get GLX
to check this parameter too, and use it for DRI3
GPU offlading.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
DRIimage: add blitImage to the specification

It allows to blit two __DRIimages.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Gallium/dri2: implement blitImage

Signed-off-by: Axel Davy <axel.davy@ens.fr>
EGL/Wayland: use blitImage when requested and on a different device

When the client use a different graphic device than the server,
we want for better performance to render to a tiled buffer,
and copy to a linear buffer which we share with the server.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
gallium: Add __DRIimageDriverExtension support to gallium

Provide the hook to pull textures out of __DRIimage structures and use them as
renderbuffers.

Signed-off-by: Keith Packard <keithp@keithp.com>
gallium/dri: fix unsetting of format when encountering depth/stencil

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
gallium: Use base.stamp for all drawable invalidation checks.

Upper levels of the stack use base.stamp to tell when a drawable needs to be
revalidated, but the dri state tracker was using dPriv->lastStamp. Those two,
along with dri2.stamp, all get simultaneously incremented when a dri2
invalidate event was delivered, and so end up containing precisely the same
value.

This patch doesn't change the fact that there are three variables, rather it
switches all of the tests to use only base.stamp, which is functionally
equivalent to the previous code.

Then, it passes base.stamp to the image loader getBuffers function so that the
one which is checked will get updated by the XCB special event queue used by DRI3.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>