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:
parent
b9ca801324
commit
4b301fe7f2
|
@ -39,13 +39,13 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
#include <xf86drm.h>
|
||||
#include <gbm.h>
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/platform.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include <libweston/zalloc.h>
|
||||
#include "xdg-shell-client-protocol.h"
|
||||
#include "fullscreen-shell-unstable-v1-client-protocol.h"
|
||||
|
|
|
@ -37,8 +37,6 @@
|
|||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -54,6 +52,7 @@
|
|||
#include "weston-direct-display-client-protocol.h"
|
||||
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
|
||||
#define CLEAR(x) memset(&(x), 0, sizeof(x))
|
||||
#define OPT_FLAG_INVERT (1 << 0)
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#ifdef BUILD_DRM_GBM
|
||||
#include <gbm.h>
|
||||
|
@ -56,6 +55,7 @@
|
|||
#include <libweston/backend-drm.h>
|
||||
#include <libweston/weston-log.h>
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "libinput-seat.h"
|
||||
#include "backend.h"
|
||||
#include "libweston-internal.h"
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libudev.h>
|
||||
|
||||
|
@ -55,6 +54,7 @@
|
|||
#include "shared/helpers.h"
|
||||
#include "shared/timespec-util.h"
|
||||
#include "shared/string-helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "pixman-renderer.h"
|
||||
#include "pixel-formats.h"
|
||||
#include "libbacklight.h"
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libweston/libweston.h>
|
||||
#include <libweston/backend-drm.h>
|
||||
#include <libweston/pixel-formats.h>
|
||||
#include <libweston/linux-dmabuf.h>
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "drm-internal.h"
|
||||
#include "linux-dmabuf.h"
|
||||
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libweston/libweston.h>
|
||||
#include <libweston/backend-drm.h>
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "drm-internal.h"
|
||||
#include "pixel-formats.h"
|
||||
#include "presentation-time-server-protocol.h"
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include "drm-internal.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
|
||||
static const char *const aspect_ratio_as_string[] = {
|
||||
[WESTON_MODE_PIC_AR_NONE] = "",
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include "drm-internal.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
|
||||
/**
|
||||
* Allocate a new, empty, plane state.
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdbool.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libweston/libweston.h>
|
||||
#include <libweston/backend-headless.h>
|
||||
|
@ -40,6 +39,7 @@
|
|||
#include "linux-explicit-synchronization.h"
|
||||
#include "pixman-renderer.h"
|
||||
#include "renderer-gl/gl-renderer.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "shared/weston-egl-ext.h"
|
||||
#include "linux-dmabuf.h"
|
||||
#include "presentation-time-server-protocol.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <sys/mman.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
#include <wayland-client.h>
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
|
@ -49,6 +48,7 @@
|
|||
#include <libweston/libweston.h>
|
||||
#include <libweston/backend-wayland.h>
|
||||
#include "renderer-gl/gl-renderer.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "shared/weston-egl-ext.h"
|
||||
#include "pixman-renderer.h"
|
||||
#include "shared/helpers.h"
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <sys/shm.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/shm.h>
|
||||
#ifdef HAVE_XCB_XKB
|
||||
|
@ -58,6 +57,7 @@
|
|||
#include "shared/timespec-util.h"
|
||||
#include "shared/file-util.h"
|
||||
#include "renderer-gl/gl-renderer.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "shared/weston-egl-ext.h"
|
||||
#include "pixman-renderer.h"
|
||||
#include "presentation-time-server-protocol.h"
|
||||
|
|
|
@ -30,12 +30,11 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libweston/libweston.h>
|
||||
#include "linux-dmabuf.h"
|
||||
#include "linux-dmabuf-unstable-v1-server-protocol.h"
|
||||
#include "libweston-internal.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
|
||||
static void
|
||||
linux_dmabuf_buffer_destroy(struct linux_dmabuf_buffer *buffer)
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <drm_fourcc.h>
|
||||
#include <wayland-client-protocol.h>
|
||||
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "wayland-util.h"
|
||||
#include "pixel-formats.h"
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -41,12 +41,12 @@
|
|||
#include <gst/allocators/gstdmabuf.h>
|
||||
#include <gst/app/gstappsrc.h>
|
||||
#include <gst/video/gstvideometa.h>
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include <libweston/remoting-plugin.h>
|
||||
#include <libweston/backend-drm.h>
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/timespec-util.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "backend.h"
|
||||
#include "libweston-internal.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright © 2012 Intel Corporation
|
||||
* Copyright © 2015,2019 Collabora, Ltd.
|
||||
* Copyright © 2016 NVIDIA Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef WESTON_DRM_FOURCC_H
|
||||
#define WESTON_DRM_FOURCC_H
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
/* 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
|
||||
|
||||
#endif
|
|
@ -31,11 +31,10 @@
|
|||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
|
||||
#include "weston-test-client-helper.h"
|
||||
#include "weston-test-fixture-compositor.h"
|
||||
#include "shared/os-compatibility.h"
|
||||
#include "shared/weston-drm-fourcc.h"
|
||||
#include "shared/xalloc.h"
|
||||
|
||||
static enum test_result_code
|
||||
|
|
Loading…
Reference in New Issue