mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
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:
committed by
Adam Jackson
parent
0ff4074224
commit
6e7c40f62d
19
dri3/dri3.c
19
dri3/dri3.c
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user