Commit cdac2690 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: port layers to DrmDisplayDevice

parent dd198461
......@@ -25,4 +25,9 @@ RenderLoop *DrmAbstractOutput::renderLoop() const
return m_renderLoop;
}
QRect DrmAbstractOutput::renderGeometry() const
{
return geometry();
}
}
......@@ -23,6 +23,7 @@ public:
DrmAbstractOutput(DrmGpu *gpu);
RenderLoop *renderLoop() const override;
QRect renderGeometry() const override;
protected:
friend class DrmGpu;
......
......@@ -33,6 +33,7 @@ public:
virtual bool isFormatSupported(uint32_t drmFormat) const = 0;
virtual QVector<uint64_t> supportedModifiers(uint32_t drmFormat) const = 0;
virtual int maxBpc() const = 0;
virtual QRect renderGeometry() const = 0;
protected:
DrmGpu *const m_gpu;
......
......@@ -17,7 +17,7 @@ namespace KWin
class SurfaceItem;
class DrmBuffer;
class DrmAbstractOutput;
class DrmDisplayDevice;
class DrmLayer
{
......@@ -41,7 +41,7 @@ public:
virtual QSharedPointer<DrmBuffer> testBuffer() = 0;
virtual QSharedPointer<DrmBuffer> currentBuffer() const = 0;
virtual DrmAbstractOutput *output() const = 0;
virtual DrmDisplayDevice *displayDevice() const = 0;
};
}
......@@ -117,4 +117,9 @@ int DrmLeaseOutput::maxBpc() const
}
}
QRect DrmLeaseOutput::renderGeometry() const
{
return QRect(QPoint(), m_pipeline->sourceSize());
}
}
......@@ -47,6 +47,7 @@ public:
bool isFormatSupported(uint32_t drmFormat) const override;
QVector<uint64_t> supportedModifiers(uint32_t drmFormat) const override;
int maxBpc() const override;
QRect renderGeometry() const override;
private:
DrmPipeline *m_pipeline;
......
......@@ -16,18 +16,18 @@
namespace KWin
{
DrmQPainterLayer::DrmQPainterLayer(DrmAbstractOutput *output)
: m_output(output)
DrmQPainterLayer::DrmQPainterLayer(DrmDisplayDevice *displayDevice)
: m_displayDevice(displayDevice)
{
}
std::optional<QRegion> DrmQPainterLayer::startRendering()
{
if (!doesSwapchainFit()) {
m_swapchain = QSharedPointer<DumbSwapchain>::create(m_output->gpu(), m_output->sourceSize(), DRM_FORMAT_XRGB8888);
m_swapchain = QSharedPointer<DumbSwapchain>::create(m_displayDevice->gpu(), m_displayDevice->sourceSize(), DRM_FORMAT_XRGB8888);
}
QRegion needsRepaint;
if (!m_swapchain->acquireBuffer(m_output->geometry(), &needsRepaint)) {
if (!m_swapchain->acquireBuffer(m_displayDevice->renderGeometry(), &needsRepaint)) {
return std::optional<QRegion>();
}
return needsRepaint;
......@@ -48,14 +48,14 @@ bool DrmQPainterLayer::scanout(SurfaceItem *surfaceItem)
QSharedPointer<DrmBuffer> DrmQPainterLayer::testBuffer()
{
if (!doesSwapchainFit()) {
m_swapchain = QSharedPointer<DumbSwapchain>::create(m_output->gpu(), m_output->sourceSize(), DRM_FORMAT_XRGB8888);
m_swapchain = QSharedPointer<DumbSwapchain>::create(m_displayDevice->gpu(), m_displayDevice->sourceSize(), DRM_FORMAT_XRGB8888);
}
return m_swapchain->currentBuffer();
}
bool DrmQPainterLayer::doesSwapchainFit() const
{
return m_swapchain && m_swapchain->size() == m_output->sourceSize();
return m_swapchain && m_swapchain->size() == m_displayDevice->sourceSize();
}
QSharedPointer<DrmBuffer> DrmQPainterLayer::currentBuffer() const
......@@ -63,9 +63,9 @@ QSharedPointer<DrmBuffer> DrmQPainterLayer::currentBuffer() const
return m_swapchain ? m_swapchain->currentBuffer() : nullptr;
}
DrmAbstractOutput *DrmQPainterLayer::output() const
DrmDisplayDevice *DrmQPainterLayer::displayDevice() const
{
return m_output;
return m_displayDevice;
}
}
......@@ -16,20 +16,20 @@ class DumbSwapchain;
class DrmQPainterLayer : public DrmLayer {
public:
DrmQPainterLayer(DrmAbstractOutput *output);
DrmQPainterLayer(DrmDisplayDevice *displayDevice);
std::optional<QRegion> startRendering() override;
bool endRendering(const QRegion &damagedRegion) override;
bool scanout(SurfaceItem *surfaceItem) override;
QSharedPointer<DrmBuffer> testBuffer() override;
QSharedPointer<DrmBuffer> currentBuffer() const override;
DrmAbstractOutput *output() const override;
DrmDisplayDevice *displayDevice() const override;
private:
bool doesSwapchainFit() const;
QSharedPointer<DumbSwapchain> m_swapchain;
DrmAbstractOutput *const m_output;
DrmDisplayDevice *const m_displayDevice;
};
}
......@@ -323,14 +323,14 @@ GbmFormat EglGbmBackend::gbmFormatForDrmFormat(uint32_t format) const
}
}
std::optional<uint32_t> EglGbmBackend::chooseFormat(DrmAbstractOutput *output) const
std::optional<uint32_t> EglGbmBackend::chooseFormat(DrmDisplayDevice *device) const
{
// formats are already sorted by order of preference
std::optional<uint32_t> fallback;
for (const auto &format : qAsConst(m_formats)) {
if (output->isFormatSupported(format.drmFormat)) {
if (device->isFormatSupported(format.drmFormat)) {
int bpc = std::max(format.redSize, std::max(format.greenSize, format.blueSize));
if (bpc <= output->maxBpc() && !fallback.has_value()) {
if (bpc <= device->maxBpc() && !fallback.has_value()) {
fallback = format.drmFormat;
} else {
return format.drmFormat;
......
......@@ -38,6 +38,7 @@ class ShadowBuffer;
class DrmBackend;
class DrmGpu;
class EglGbmLayer;
class DrmDisplayDevice;
struct GbmFormat {
uint32_t drmFormat = 0;
......@@ -72,7 +73,7 @@ public:
QSharedPointer<DrmBuffer> testBuffer(DrmAbstractOutput *output);
EGLConfig config(uint32_t format) const;
GbmFormat gbmFormatForDrmFormat(uint32_t format) const;
std::optional<uint32_t> chooseFormat(DrmAbstractOutput *output) const;
std::optional<uint32_t> chooseFormat(DrmDisplayDevice *displyDevice) const;
protected:
void cleanupSurfaces() override;
......
......@@ -32,8 +32,8 @@
namespace KWin
{
EglGbmLayer::EglGbmLayer(DrmGpu *renderGpu, DrmAbstractOutput *output)
: m_output(output)
EglGbmLayer::EglGbmLayer(DrmGpu *renderGpu, DrmDisplayDevice *displayDevice)
: m_displayDevice(displayDevice)
, m_renderGpu(renderGpu)
{
}
......@@ -76,7 +76,7 @@ std::optional<QRegion> EglGbmLayer::startRendering()
if (!m_gbmSurface->makeContextCurrent()) {
return std::optional<QRegion>();
}
auto repaintRegion = m_gbmSurface->repaintRegion(m_output->geometry());
auto repaintRegion = m_gbmSurface->repaintRegion(m_displayDevice->renderGeometry());
// shadow buffer
if (doesShadowBufferFit(m_shadowBuffer.data())) {
......@@ -85,9 +85,9 @@ std::optional<QRegion> EglGbmLayer::startRendering()
if (doesShadowBufferFit(m_oldShadowBuffer.data())) {
m_shadowBuffer = m_oldShadowBuffer;
} else {
if (m_output->softwareTransforms() != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)) {
if (m_displayDevice->softwareTransforms() != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)) {
const auto format = m_renderGpu->eglBackend()->gbmFormatForDrmFormat(m_gbmSurface->format());
m_shadowBuffer = QSharedPointer<ShadowBuffer>::create(m_output->sourceSize(), format);
m_shadowBuffer = QSharedPointer<ShadowBuffer>::create(m_displayDevice->sourceSize(), format);
if (!m_shadowBuffer->isComplete()) {
return std::optional<QRegion>();
}
......@@ -111,7 +111,7 @@ bool EglGbmLayer::endRendering(const QRegion &damagedRegion)
{
if (m_shadowBuffer) {
GLRenderTarget::popRenderTarget();
m_shadowBuffer->render(m_output);
m_shadowBuffer->render(m_displayDevice);
}
GLRenderTarget::popRenderTarget();
const auto buffer = m_gbmSurface->swapBuffersForDrm(damagedRegion);
......@@ -138,7 +138,7 @@ bool EglGbmLayer::renderTestBuffer()
return false;
}
glClear(GL_COLOR_BUFFER_BIT);
if (!endRendering(m_output->geometry())) {
if (!endRendering(m_displayDevice->renderGeometry())) {
return false;
}
return true;
......@@ -149,14 +149,14 @@ bool EglGbmLayer::createGbmSurface()
static bool modifiersEnvSet = false;
static const bool modifiersEnv = qEnvironmentVariableIntValue("KWIN_DRM_USE_MODIFIERS", &modifiersEnvSet) != 0;
auto format = m_renderGpu->eglBackend()->chooseFormat(m_output);
auto format = m_renderGpu->eglBackend()->chooseFormat(m_displayDevice);
if (!format || m_importMode == MultiGpuImportMode::DumbBufferXrgb8888) {
format = DRM_FORMAT_XRGB8888;
}
const auto modifiers = m_output->supportedModifiers(format.value());
const auto size = m_output->bufferSize();
const auto modifiers = m_displayDevice->supportedModifiers(format.value());
const auto size = m_displayDevice->bufferSize();
const auto config = m_renderGpu->eglBackend()->config(format.value());
const bool allowModifiers = m_renderGpu->addFB2ModifiersSupported() && m_output->gpu()->addFB2ModifiersSupported()
const bool allowModifiers = m_renderGpu->addFB2ModifiersSupported() && m_displayDevice->gpu()->addFB2ModifiersSupported()
&& ((m_renderGpu->isNVidia() && !modifiersEnvSet) || (modifiersEnvSet && modifiersEnv));
QSharedPointer<GbmSurface> gbmSurface;
......@@ -164,10 +164,10 @@ bool EglGbmLayer::createGbmSurface()
if (!allowModifiers) {
#else
// modifiers have to be disabled with multi-gpu if gbm_bo_get_fd_for_plane is not available
if (!allowModifiers || m_output->gpu() != m_renderGpu) {
if (!allowModifiers || m_displayDevice->gpu() != m_renderGpu) {
#endif
int flags = GBM_BO_USE_RENDERING;
if (m_output->gpu() == m_renderGpu) {
if (m_displayDevice->gpu() == m_renderGpu) {
flags |= GBM_BO_USE_SCANOUT;
} else {
flags |= GBM_BO_USE_LINEAR;
......@@ -192,16 +192,16 @@ bool EglGbmLayer::createGbmSurface()
bool EglGbmLayer::doesGbmSurfaceFit(GbmSurface *surf) const
{
return surf && surf->size() == m_output->bufferSize()
&& m_output->isFormatSupported(surf->format())
return surf && surf->size() == m_displayDevice->bufferSize()
&& m_displayDevice->isFormatSupported(surf->format())
&& (m_importMode != MultiGpuImportMode::DumbBufferXrgb8888 || surf->format() == DRM_FORMAT_XRGB8888)
&& (surf->modifiers().isEmpty() || m_output->supportedModifiers(surf->format()) == surf->modifiers());
&& (surf->modifiers().isEmpty() || m_displayDevice->supportedModifiers(surf->format()) == surf->modifiers());
}
bool EglGbmLayer::doesShadowBufferFit(ShadowBuffer *buffer) const
{
if (m_output->softwareTransforms() != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)) {
return buffer && buffer->texture()->size() == m_output->sourceSize() && buffer->drmFormat() == m_gbmSurface->format();
if (m_displayDevice->softwareTransforms() != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)) {
return buffer && buffer->texture()->size() == m_displayDevice->sourceSize() && buffer->drmFormat() == m_gbmSurface->format();
} else {
return buffer == nullptr;
}
......@@ -209,7 +209,7 @@ bool EglGbmLayer::doesShadowBufferFit(ShadowBuffer *buffer) const
bool EglGbmLayer::doesSwapchainFit(DumbSwapchain *swapchain) const
{
return swapchain && swapchain->size() == m_output->sourceSize() && swapchain->drmFormat() == m_gbmSurface->format();
return swapchain && swapchain->size() == m_displayDevice->sourceSize() && swapchain->drmFormat() == m_gbmSurface->format();
}
QSharedPointer<GLTexture> EglGbmLayer::texture() const
......@@ -227,7 +227,7 @@ QSharedPointer<GLTexture> EglGbmLayer::texture() const
qCWarning(KWIN_DRM) << "Failed to record frame: Error creating EGLImageKHR - " << glGetError();
return nullptr;
}
return QSharedPointer<EGLImageTexture>::create(m_renderGpu->eglDisplay(), image, GL_RGBA8, m_output->modeSize());
return QSharedPointer<EGLImageTexture>::create(m_renderGpu->eglDisplay(), image, GL_RGBA8, m_displayDevice->sourceSize());
}
QSharedPointer<DrmBuffer> EglGbmLayer::importBuffer()
......@@ -281,7 +281,7 @@ QSharedPointer<DrmBuffer> EglGbmLayer::importDmabuf()
data.strides[i] = gbm_bo_get_stride_for_plane(bo, i);
data.offsets[i] = gbm_bo_get_offset(bo, i);
}
importedBuffer = gbm_bo_import(m_output->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
importedBuffer = gbm_bo_import(m_displayDevice->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
} else {
#endif
gbm_import_fd_data data = {
......@@ -295,7 +295,7 @@ QSharedPointer<DrmBuffer> EglGbmLayer::importDmabuf()
qCWarning(KWIN_DRM, "failed to export gbm_bo as dma-buf: %s", strerror(errno));
return nullptr;
}
importedBuffer = gbm_bo_import(m_output->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
importedBuffer = gbm_bo_import(m_displayDevice->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
#if HAVE_GBM_BO_GET_FD_FOR_PLANE
}
#endif
......@@ -303,7 +303,7 @@ QSharedPointer<DrmBuffer> EglGbmLayer::importDmabuf()
qCWarning(KWIN_DRM, "failed to import gbm_bo for multi-gpu usage: %s", strerror(errno));
return nullptr;
}
const auto buffer = QSharedPointer<DrmGbmBuffer>::create(m_output->gpu(), importedBuffer, nullptr);
const auto buffer = QSharedPointer<DrmGbmBuffer>::create(m_displayDevice->gpu(), importedBuffer, nullptr);
return buffer->bufferId() ? buffer : nullptr;
}
......@@ -315,7 +315,7 @@ QSharedPointer<DrmBuffer> EglGbmLayer::importWithCpu()
if (doesSwapchainFit(m_oldImportSwapchain.data())) {
m_importSwapchain = m_oldImportSwapchain;
} else {
const auto swapchain = QSharedPointer<DumbSwapchain>::create(m_output->gpu(), m_output->sourceSize(), m_gbmSurface->format());
const auto swapchain = QSharedPointer<DumbSwapchain>::create(m_displayDevice->gpu(), m_displayDevice->sourceSize(), m_gbmSurface->format());
if (swapchain->isEmpty()) {
return nullptr;
}
......@@ -352,7 +352,7 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
return false;
}
const auto buffer = qobject_cast<KWaylandServer::LinuxDmaBufV1ClientBuffer *>(item->surface()->buffer());
if (!buffer || buffer->planes().isEmpty() || buffer->size() != m_output->sourceSize()) {
if (!buffer || buffer->planes().isEmpty() || buffer->size() != m_displayDevice->sourceSize()) {
return false;
}
......@@ -362,14 +362,14 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
m_scanoutCandidate.surface = item->surface();
m_scanoutCandidate.attemptedThisFrame = true;
if (!m_output->isFormatSupported(buffer->format())) {
if (!m_displayDevice->isFormatSupported(buffer->format())) {
sendDmabufFeedback(buffer);
return false;
}
const auto planes = buffer->planes();
gbm_bo *importedBuffer;
if (planes.first().modifier != DRM_FORMAT_MOD_INVALID || planes.first().offset > 0 || planes.count() > 1) {
if (!m_output->gpu()->addFB2ModifiersSupported() || !m_output->supportedModifiers(buffer->format()).contains(planes.first().modifier)) {
if (!m_displayDevice->gpu()->addFB2ModifiersSupported() || !m_displayDevice->supportedModifiers(buffer->format()).contains(planes.first().modifier)) {
return false;
}
gbm_import_fd_modifier_data data = {};
......@@ -383,7 +383,7 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
data.offsets[i] = planes[i].offset;
data.strides[i] = planes[i].stride;
}
importedBuffer = gbm_bo_import(m_output->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
importedBuffer = gbm_bo_import(m_displayDevice->gpu()->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT);
} else {
const auto &plane = planes.first();
gbm_import_fd_data data = {};
......@@ -392,7 +392,7 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
data.height = (uint32_t) buffer->size().height();
data.stride = plane.stride;
data.format = buffer->format();
importedBuffer = gbm_bo_import(m_output->gpu()->gbmDevice(), GBM_BO_IMPORT_FD, &data, GBM_BO_USE_SCANOUT);
importedBuffer = gbm_bo_import(m_displayDevice->gpu()->gbmDevice(), GBM_BO_IMPORT_FD, &data, GBM_BO_USE_SCANOUT);
}
if (!importedBuffer) {
sendDmabufFeedback(buffer);
......@@ -401,7 +401,7 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
}
return false;
}
const auto bo = QSharedPointer<DrmGbmBuffer>::create(m_output->gpu(), importedBuffer, buffer);
const auto bo = QSharedPointer<DrmGbmBuffer>::create(m_displayDevice->gpu(), importedBuffer, buffer);
if (!bo->bufferId()) {
// buffer can't actually be scanned out. Mesa is supposed to prevent this from happening
// in gbm_bo_import but apparently that doesn't always work
......@@ -415,13 +415,13 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem)
surfaceItem->resetDamage();
for (const auto &rect : trackedDamage) {
auto damageRect = QRect(rect);
damageRect.translate(m_output->geometry().topLeft());
damageRect.translate(m_displayDevice->renderGeometry().topLeft());
damage |= damageRect;
}
} else {
damage = m_output->geometry();
damage = m_displayDevice->renderGeometry();
}
if (m_output->present(bo, damage)) {
if (m_displayDevice->present(bo, damage)) {
m_currentBuffer = bo;
return true;
} else {
......@@ -434,7 +434,7 @@ void EglGbmLayer::sendDmabufFeedback(KWaylandServer::LinuxDmaBufV1ClientBuffer *
if (!m_scanoutCandidate.attemptedFormats[failedBuffer->format()].contains(failedBuffer->planes().first().modifier)) {
m_scanoutCandidate.attemptedFormats[failedBuffer->format()] << failedBuffer->planes().first().modifier;
}
if (const auto &drmOutput = qobject_cast<DrmOutput *>(m_output); drmOutput && m_scanoutCandidate.surface->dmabufFeedbackV1()) {
if (const auto &drmOutput = dynamic_cast<DrmOutput *>(m_displayDevice); drmOutput && m_scanoutCandidate.surface->dmabufFeedbackV1()) {
QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> scanoutTranches;
const auto &drmFormats = drmOutput->pipeline()->supportedFormats();
const auto tranches = m_renderGpu->eglBackend()->dmabuf()->tranches();
......@@ -451,7 +451,7 @@ void EglGbmLayer::sendDmabufFeedback(KWaylandServer::LinuxDmaBufV1ClientBuffer *
}
}
if (!scanoutTranche.formatTable.isEmpty()) {
scanoutTranche.device = m_output->gpu()->deviceId();
scanoutTranche.device = m_displayDevice->gpu()->deviceId();
scanoutTranche.flags = KWaylandServer::LinuxDmaBufV1Feedback::TrancheFlag::Scanout;
scanoutTranches << scanoutTranche;
}
......@@ -465,9 +465,9 @@ QSharedPointer<DrmBuffer> EglGbmLayer::currentBuffer() const
return m_currentBuffer;
}
DrmAbstractOutput *EglGbmLayer::output() const
DrmDisplayDevice *EglGbmLayer::displayDevice() const
{
return m_output;
return m_displayDevice;
}
int EglGbmLayer::bufferAge() const
......
......@@ -28,7 +28,6 @@ namespace KWin
class GbmSurface;
class DumbSwapchain;
class ShadowBuffer;
class DrmAbstractOutput;
class DrmBuffer;
class DrmGpu;
class SurfaceItem;
......@@ -37,7 +36,7 @@ class GLTexture;
class EglGbmLayer : public DrmLayer
{
public:
EglGbmLayer(DrmGpu *renderGpu, DrmAbstractOutput *output);
EglGbmLayer(DrmGpu *renderGpu, DrmDisplayDevice *displayDevice);
~EglGbmLayer();
std::optional<QRegion> startRendering() override;
......@@ -47,7 +46,7 @@ public:
QSharedPointer<DrmBuffer> currentBuffer() const override;
QSharedPointer<GLTexture> texture() const;
DrmAbstractOutput *output() const override;
DrmDisplayDevice *displayDevice() const override;
int bufferAge() const;
EGLSurface eglSurface() const;
......@@ -85,7 +84,7 @@ private:
QSharedPointer<DumbSwapchain> m_importSwapchain;
QSharedPointer<DumbSwapchain> m_oldImportSwapchain;
DrmAbstractOutput *const m_output;
DrmDisplayDevice *const m_displayDevice;
DrmGpu *const m_renderGpu;
};
......
......@@ -55,35 +55,22 @@ ShadowBuffer::~ShadowBuffer()
{
}
void ShadowBuffer::render(DrmAbstractOutput *output)
void ShadowBuffer::render(DrmDisplayDevice *displayDevice)
{
QMatrix4x4 mvpMatrix;
switch (output->transform()) {
case DrmOutput::Transform::Normal:
case DrmOutput::Transform::Flipped:
break;
case DrmOutput::Transform::Rotated90:
case DrmOutput::Transform::Flipped90:
const auto transform = displayDevice->softwareTransforms();
if (transform & DrmPlane::Transformation::Rotate90) {
mvpMatrix.rotate(90, 0, 0, 1);
break;
case DrmOutput::Transform::Rotated180:
case DrmOutput::Transform::Flipped180:
} else if (transform & DrmPlane::Transformation::Rotate180) {
mvpMatrix.rotate(180, 0, 0, 1);
break;
case DrmOutput::Transform::Rotated270:
case DrmOutput::Transform::Flipped270:
} else if (transform & DrmPlane::Transformation::Rotate270) {
mvpMatrix.rotate(270, 0, 0, 1);
break;
}
switch (output->transform()) {
case DrmOutput::Transform::Flipped:
case DrmOutput::Transform::Flipped90:
case DrmOutput::Transform::Flipped180:
case DrmOutput::Transform::Flipped270:
if (transform & DrmPlane::Transformation::ReflectX) {
mvpMatrix.scale(-1, 1);
break;
default:
break;
}
if (transform & DrmPlane::Transformation::ReflectY) {
mvpMatrix.scale(1, -1);
}
auto shader = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture);
......
......@@ -16,7 +16,7 @@
namespace KWin
{
class DrmAbstractOutput;
class DrmDisplayDevice;
class ShadowBuffer
{
......@@ -25,8 +25,7 @@ public:
~ShadowBuffer();
bool isComplete() const;
void render(DrmAbstractOutput *output);
void render(DrmDisplayDevice *displayDevice);
GLRenderTarget *renderTarget() const;
QSharedPointer<GLTexture> texture() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment