2 * Copyright 息 2013 Renesas Solutions Corp.
4 * Based on src/egl/wayland/wayland-drm/wayland-drm.h in Mesa.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
27 * Takanari Hayama <taki@igel.co.jp>
33 #include <wayland-server.h>
39 struct wl_kms_planes {
44 struct wl_kms_buffer {
45 struct wl_resource *resource;
47 int32_t width, height;
48 uint32_t stride, format;
53 // for multi-planer formats
55 struct wl_kms_planes planes[MAX_PLANES];
58 int wayland_kms_fd_get(struct wl_kms *kms);
60 struct wl_kms_buffer *wayland_kms_buffer_get(struct wl_resource *resource);
62 struct wl_kms *wayland_kms_init(struct wl_display *display,
63 struct wl_display *server, char *device_name, int fd);
65 void wayland_kms_uninit(struct wl_kms *kms);
67 uint32_t wayland_kms_buffer_get_format(struct wl_kms_buffer *buffer);
69 void *wayland_kms_buffer_get_buffer(struct wl_kms_buffer *buffer);
71 enum wl_kms_attribute {
77 int wayland_kms_query_buffer(struct wl_kms *kms, struct wl_resource *resource,
78 enum wl_kms_attribute attr, int *value);