KWayland
linuxdmabuf_v1_interface.cpp
131 void create(wl_client *client, uint32_t bufferId, const QSize &size, uint32_t format, uint32_t flags);
135 add(wl_client *client, wl_resource *resource, int fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, uint32_t modifier_lo);
136 static void create(wl_client *client, wl_resource *resource, int width, int height, uint32_t format, uint32_t flags);
137 static void createImmed(wl_client *client, wl_resource *resource, uint32_t new_id, int width, int height, uint32_t format, uint32_t flags);
153 void V1Iface::Private::Params::create(wl_client *client, wl_resource *resource, int width, int height, uint32_t format, uint32_t flags)
157 V1Iface::Private::Params *params = static_cast<V1Iface::Private::Params *>(wl_resource_get_user_data(resource));
162 void V1Iface::Private::Params::createImmed(wl_client *client, wl_resource *resource, uint32_t new_id, int width, int height, uint32_t format, uint32_t flags)
166 V1Iface::Private::Params *params = static_cast<V1Iface::Private::Params *>(wl_resource_get_user_data(resource));
172 const struct zwp_linux_dmabuf_v1_interface V1Iface::Private::s_implementation = {[](wl_client *, wl_resource *resource) {
184 const struct zwp_linux_buffer_params_v1_interface V1Iface::Private::Params::s_interface = {destroy, add, create, createImmed};
187 V1Iface::Private::Params::Params(V1Iface::Private *dmabufInterface, wl_client *client, uint32_t version, uint32_t id)
217 void V1Iface::Private::Params::create(wl_client *client, uint32_t bufferId, const QSize &size, uint32_t format, uint32_t flags)
225 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED, "params was already used to create a wl_buffer");
231 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE, "no dmabuf has been added to the params");
241 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE, "no dmabuf has been added for plane %i", i);
246 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS, "invalid width %d or height %d", width, height);
254 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, "size overflow for plane %i", i);
259 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, "size overflow for plane %i", i);
270 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, "invalid offset %i for plane %i", plane.offset, i);
275 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, "invalid stride %i for plane %i", plane.stride, i);
282 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, "invalid buffer stride or height for plane %i", i);
295 LinuxDmabufUnstableV1Buffer *buffer = m_dmabufInterface->impl->importBuffer(planes, format, size, (V1Iface::Flags)flags);
319 // Send a 'created' event when the request is not for an immediate import, i.e. bufferId is zero
332 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER, "importing the supplied dmabufs failed");
337 void V1Iface::Private::Params::add(int fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint64_t modifier)
340 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED, "params was already used to create a wl_buffer");
346 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX, "plane index %u is too high", plane_idx);
354 wl_resource_post_error(m_resource, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET, "a dmabuf has already been added for plane %u", plane_idx);
384 V1Iface::Private::Params *params = static_cast<V1Iface::Private::Params *>(wl_resource_get_user_data(resource));
402 wl_resource *resource = wl_resource_create(client, &zwp_linux_dmabuf_v1_interface, std::min(s_version, version), id);
413 QHash<uint32_t, QSet<uint64_t>>::const_iterator it = supportedFormatsWithModifiers.constBegin();
442 void V1Iface::Private::createParamsCallback(wl_client *client, wl_resource *resource, uint32_t id)
const T value(const Key &key) const const
The base class for linux-dmabuf buffers.
Definition: linuxdmabuf_v1_interface.h:33
int width() const const
void create()
Creates the global by creating a native wl_global and by that announcing it to the clients.
Definition: global.cpp:48
T * data() const const
int height() const const
QHash::const_iterator constBegin() const const
uint32_t format() const
Returns the DRM format code for the buffer.
Definition: linuxdmabuf_v1_interface.cpp:47
const Key key(const T &value) const const
QAction * create(StandardGameAction id, const QObject *recvr, const char *slot, QObject *parent)
void reserve(int size)
~LinuxDmabufUnstableV1Interface() override
Destroys the LinuxDmabufUnstableV1Interface.
KGuiItem add()
void setImpl(Impl *impl)
Sets the compositor implementation for the dmabuf interface.
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Jan 30 2023 03:56:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Jan 30 2023 03:56:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.