dri3: Add multi-planar/modifier buffer requests

Initial implementation for DRI3 v1.1. Only the DRI3 implementation
is there, backends need to implement the proper hooks.

Version is still set to 1.0 so clients shouldn't use the new
requests yet.

v2: Use depth/bpp instead of DRM formats in requests

v3: Remove DMA fence requests from v1.1
    Add screen/drawable modifier sets

v4: Free array returned by 'get_drawable_modifiers()'

v5: Fix FD leak

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Louis-Francis Ratté-Boulianne
2018-02-28 01:19:35 +00:00
committed by Adam Jackson
parent 0ff4074224
commit 6e7c40f62d
8 changed files with 559 additions and 29 deletions

View File

@@ -26,6 +26,8 @@
#include "dri3_priv.h"
#include <drm_fourcc.h>
static int dri3_request;
DevPrivateKeyRec dri3_screen_private_key;
@@ -99,3 +101,20 @@ dri3_extension_init(void)
bail:
FatalError("Cannot initialize DRI3 extension");
}
uint32_t
drm_format_for_depth(uint32_t depth, uint32_t bpp)
{
switch (bpp) {
case 16:
return DRM_FORMAT_RGB565;
case 24:
return DRM_FORMAT_XRGB8888;
case 30:
return DRM_FORMAT_XRGB2101010;
case 32:
return DRM_FORMAT_ARGB8888;
default:
return 0;
}
}