Android-cuttlefish cvd tool
wayland_dmabuf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <stdint.h>
20
21#include <map>
22
24#include "wayland-server-core.h"
25
26namespace wayland {
27
30 uint32_t plane = 0;
31 uint32_t offset = 0;
32 uint32_t stride = 0;
33 uint32_t modifier_hi = 0;
34 uint32_t modifier_lo = 0;
35};
36
38 DmabufParams() = default;
39
40 DmabufParams(const DmabufParams& rhs) = delete;
41 DmabufParams& operator=(const DmabufParams& rhs) = delete;
42
43 DmabufParams(DmabufParams&& rhs) = default;
45
46 std::map<int32_t, DmabufPlane> planes;
47};
48
49struct Dmabuf {
50 uint32_t width = 0;
51 uint32_t height = 0;
52 uint32_t format = 0;
53 uint32_t flags = 0;
55};
56
57// Binds the dmabuf interface to the given wayland server.
58void BindDmabufInterface(wl_display* display);
59
60bool IsDmabufResource(struct wl_resource* resource);
61
62} // namespace wayland
Definition: unique_fd.h:61
Definition: wayland_compositor.cpp:26
void BindDmabufInterface(wl_display *display)
Definition: wayland_dmabuf.cpp:167
bool IsDmabufResource(struct wl_resource *resource)
Definition: wayland_dmabuf.cpp:172
Definition: wayland_dmabuf.h:37
DmabufParams & operator=(DmabufParams &&rhs)=default
DmabufParams(const DmabufParams &rhs)=delete
DmabufParams & operator=(const DmabufParams &rhs)=delete
DmabufParams(DmabufParams &&rhs)=default
std::map< int32_t, DmabufPlane > planes
Definition: wayland_dmabuf.h:46
Definition: wayland_dmabuf.h:28
uint32_t offset
Definition: wayland_dmabuf.h:31
uint32_t plane
Definition: wayland_dmabuf.h:30
android::base::unique_fd fd
Definition: wayland_dmabuf.h:29
uint32_t modifier_lo
Definition: wayland_dmabuf.h:34
uint32_t modifier_hi
Definition: wayland_dmabuf.h:33
uint32_t stride
Definition: wayland_dmabuf.h:32
Definition: wayland_dmabuf.h:49
uint32_t flags
Definition: wayland_dmabuf.h:53
DmabufParams params
Definition: wayland_dmabuf.h:54
uint32_t width
Definition: wayland_dmabuf.h:50
uint32_t height
Definition: wayland_dmabuf.h:51
uint32_t format
Definition: wayland_dmabuf.h:52