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 <stddef.h>
20#include <stdint.h>
21
22#include "android-base/unique_fd.h"
23#include "wayland-server-core.h"
24
25namespace wayland {
26
29 int32_t width = 0;
30 int32_t height = 0;
31 uint32_t format = 0;
32 uint32_t flags = 0;
33 uint32_t offset = 0;
34 uint32_t stride = 0;
35 uint64_t modifier = 0;
36 uint8_t* mapped_ptr = nullptr;
37 size_t mapped_size = 0;
38
40};
41
42// Returns the DmabufBuffer associated with the given wl_buffer resource,
43// or nullptr if the resource is not a dmabuf wl_buffer.
44DmabufBuffer* GetDmabufBuffer(wl_resource* buffer);
45
48
49// Binds the dmabuf interface to the given wayland server.
50void BindDmabufInterface(wl_display* display);
51
52} // namespace wayland
android::base::unique_fd unique_fd
Definition: adb_unique_fd.h:32
Definition: wayland_compositor.cpp:26
void DmabufBufferBeginAccess(DmabufBuffer *buffer)
Definition: wayland_dmabuf.cpp:268
void BindDmabufInterface(wl_display *display)
Definition: wayland_dmabuf.cpp:288
void DmabufBufferEndAccess(DmabufBuffer *buffer)
Definition: wayland_dmabuf.cpp:278
DmabufBuffer * GetDmabufBuffer(wl_resource *buffer)
Definition: wayland_dmabuf.cpp:257
Definition: wayland_dmabuf.h:27
uint32_t offset
Definition: wayland_dmabuf.h:33
android::base::unique_fd fd
Definition: wayland_dmabuf.h:28
size_t mapped_size
Definition: wayland_dmabuf.h:37
uint32_t flags
Definition: wayland_dmabuf.h:32
uint64_t modifier
Definition: wayland_dmabuf.h:35
uint32_t format
Definition: wayland_dmabuf.h:31
int32_t height
Definition: wayland_dmabuf.h:30
uint8_t * mapped_ptr
Definition: wayland_dmabuf.h:36
int32_t width
Definition: wayland_dmabuf.h:29
uint32_t stride
Definition: wayland_dmabuf.h:34
~DmabufBuffer()
Definition: wayland_dmabuf.cpp:39