Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
linuxdmabufclientbufferintegration.cpp File Reference
#include "linuxdmabufclientbufferintegration.h"
#include "linuxdmabuf.h"
#include <QtWaylandCompositor/QWaylandCompositor>
#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
#include <qpa/qplatformnativeinterface.h>
#include <QtOpenGL/QOpenGLTexture>
#include <QtCore/QVarLengthArray>
#include <QtGui/QGuiApplication>
#include <QtGui/QOpenGLContext>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <unistd.h>
#include <drm_fourcc.h>
+ Include dependency graph for linuxdmabufclientbufferintegration.cpp:

Go to the source code of this file.

Macros

#define ADD_PLANE_ATTRIBS(plane_idx)
 

Functions

static QT_BEGIN_NAMESPACE QWaylandBufferRef::BufferFormatEgl formatFromDrmFormat (EGLint format)
 
static QOpenGLTexture::TextureFormat openGLFormatFromBufferFormat (QWaylandBufferRef::BufferFormatEgl format)
 

Macro Definition Documentation

◆ ADD_PLANE_ATTRIBS

#define ADD_PLANE_ATTRIBS (   plane_idx)
Value:
{ \
attribs.append(EGL_DMA_BUF_PLANE ## plane_idx ## _FD_EXT); \
attribs.append(dmabufBuffer->plane(plane_idx).fd); \
attribs.append(EGL_DMA_BUF_PLANE ## plane_idx ## _OFFSET_EXT); \
attribs.append(EGLint(dmabufBuffer->plane(plane_idx).offset)); \
attribs.append(EGL_DMA_BUF_PLANE ## plane_idx ## _PITCH_EXT); \
attribs.append(EGLint(dmabufBuffer->plane(plane_idx).stride)); \
if (dmabufBuffer->plane(plane_idx).modifiers != DRM_FORMAT_MOD_INVALID) { \
attribs.append(EGL_DMA_BUF_PLANE ## plane_idx ## _MODIFIER_LO_EXT); \
attribs.append(EGLint(dmabufBuffer->plane(plane_idx).modifiers & 0xffffffff)); \
attribs.append(EGL_DMA_BUF_PLANE ## plane_idx ## _MODIFIER_HI_EXT); \
attribs.append(EGLint(dmabufBuffer->plane(plane_idx).modifiers >> 32)); \
} \
}
#define DRM_FORMAT_MOD_INVALID
Definition linuxdmabuf.h:36
const GLint * attribs

Function Documentation

◆ formatFromDrmFormat()

static QT_BEGIN_NAMESPACE QWaylandBufferRef::BufferFormatEgl formatFromDrmFormat ( EGLint  format)
static

Definition at line 22 of file linuxdmabufclientbufferintegration.cpp.

References QWaylandBufferRef::BufferFormatEgl_Null, QWaylandBufferRef::BufferFormatEgl_RGB, QWaylandBufferRef::BufferFormatEgl_RGBA, QWaylandBufferRef::BufferFormatEgl_Y_XUXV, DRM_FORMAT_ABGR8888, DRM_FORMAT_BGR888, DRM_FORMAT_BGRA1010102, DRM_FORMAT_RGB565, DRM_FORMAT_RGB888, DRM_FORMAT_RGBA8888, Qt::hex(), and qCDebug.

Referenced by LinuxDmabufClientBuffer::bufferFormatEgl(), and LinuxDmabufClientBuffer::toOpenGlTexture().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openGLFormatFromBufferFormat()

static QOpenGLTexture::TextureFormat openGLFormatFromBufferFormat ( QWaylandBufferRef::BufferFormatEgl  format)
static

Definition at line 72 of file linuxdmabufclientbufferintegration.cpp.

References QWaylandBufferRef::BufferFormatEgl_RGB, QWaylandBufferRef::BufferFormatEgl_RGBA, QOpenGLTexture::NoFormat, QOpenGLTexture::RGBAFormat, and QOpenGLTexture::RGBFormat.

Referenced by LinuxDmabufClientBuffer::toOpenGlTexture().

+ Here is the caller graph for this function: