Add weston-drm-fourcc.h

This header is for sharing fallback definitions for drm_fourcc.h. A new
test in tests/yuv-buffer-test.c is going to be needing XYUV8888 format,
and more new formats will be expected with HDR supports.

Share these fallback definitions in one place instead of copying them
all over.

All users of drm_fourcc.h are converted to include weston-drm-fourcc.h
instead for consistency: have the same definitions available everywhere.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2021-02-04 17:39:45 +02:00
parent b9ca801324
commit 4b301fe7f2
17 changed files with 57 additions and 27 deletions
+1 -9
View File
@@ -39,7 +39,6 @@
#include <float.h>
#include <assert.h>
#include <linux/input.h>
#include <drm_fourcc.h>
#include <unistd.h>
#include "linux-sync-file.h"
@@ -57,6 +56,7 @@
#include "shared/helpers.h"
#include "shared/platform.h"
#include "shared/timespec-util.h"
#include "shared/weston-drm-fourcc.h"
#include "shared/weston-egl-ext.h"
#define BUFFER_DAMAGE_COUNT 2
@@ -2303,14 +2303,6 @@ import_simple_dmabuf(struct gl_renderer *gr,
return image;
}
/* The kernel header drm_fourcc.h defines the DRM formats below. We duplicate
* some of the definitions here so that building Weston won't require
* bleeding-edge kernel headers.
*/
#ifndef DRM_FORMAT_XYUV8888
#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
#endif
struct yuv_format_descriptor yuv_formats[] = {
{
.format = DRM_FORMAT_YUYV,