mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 01:45:59 +01:00
get dma formats from aq
This commit is contained in:
parent
00a8171643
commit
65a16b84fc
5 changed files with 14 additions and 12 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "math/Math.hpp"
|
#include "math/Math.hpp"
|
||||||
|
#include <aquamarine/backend/Misc.hpp>
|
||||||
|
|
||||||
typedef uint32_t DRMFormat;
|
typedef uint32_t DRMFormat;
|
||||||
typedef uint32_t SHMFormat;
|
typedef uint32_t SHMFormat;
|
||||||
|
@ -18,10 +19,7 @@ struct SPixelFormat {
|
||||||
Vector2D blockSize;
|
Vector2D blockSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SDRMFormat {
|
typedef Aquamarine::SDRMFormat SDRMFormat;
|
||||||
DRMFormat format = 0; /* DRM_FORMAT_INVALID */
|
|
||||||
std::vector<uint64_t> mods;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace FormatUtils {
|
namespace FormatUtils {
|
||||||
SHMFormat drmToShm(DRMFormat drm);
|
SHMFormat drmToShm(DRMFormat drm);
|
||||||
|
|
|
@ -26,8 +26,8 @@ CCompiledDMABUFFeedback::CCompiledDMABUFFeedback(dev_t device, std::vector<SDMAB
|
||||||
std::set<std::pair<uint32_t, uint64_t>> formats;
|
std::set<std::pair<uint32_t, uint64_t>> formats;
|
||||||
for (auto& t : tranches_) {
|
for (auto& t : tranches_) {
|
||||||
for (auto& fmt : t.formats) {
|
for (auto& fmt : t.formats) {
|
||||||
for (auto& mod : fmt.mods) {
|
for (auto& mod : fmt.modifiers) {
|
||||||
formats.insert(std::make_pair<>(fmt.format, mod));
|
formats.insert(std::make_pair<>(fmt.drmFormat, mod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,11 +387,16 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
|
||||||
|
|
||||||
mainDevice = *dev;
|
mainDevice = *dev;
|
||||||
|
|
||||||
auto fmts = g_pHyprOpenGL->getDRMFormats();
|
// FIXME: this will break on multi-gpu
|
||||||
|
std::vector<Aquamarine::SDRMFormat> aqFormats;
|
||||||
|
for (auto& impl : g_pCompositor->m_pAqBackend->getImplementations()) {
|
||||||
|
aqFormats = impl->getRenderFormats();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
SDMABufTranche tranche = {
|
SDMABufTranche tranche = {
|
||||||
.device = *dev,
|
.device = *dev,
|
||||||
.formats = fmts,
|
.formats = aqFormats,
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<SDMABufTranche> tches;
|
std::vector<SDMABufTranche> tches;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include <aquamarine/buffer/Buffer.hpp>
|
#include <aquamarine/buffer/Buffer.hpp>
|
||||||
|
|
||||||
class CDMABuffer;
|
class CDMABuffer;
|
||||||
struct SDRMFormat;
|
|
||||||
class CWLSurfaceResource;
|
class CWLSurfaceResource;
|
||||||
|
|
||||||
class CLinuxDMABuffer {
|
class CLinuxDMABuffer {
|
||||||
|
|
|
@ -87,7 +87,7 @@ CMesaDRMResource::CMesaDRMResource(SP<CWlDrm> resource_) : resource(resource_) {
|
||||||
|
|
||||||
auto fmts = g_pHyprOpenGL->getDRMFormats();
|
auto fmts = g_pHyprOpenGL->getDRMFormats();
|
||||||
for (auto& fmt : fmts) {
|
for (auto& fmt : fmts) {
|
||||||
resource->sendFormat(fmt.format);
|
resource->sendFormat(fmt.drmFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,8 +344,8 @@ void CHyprOpenGLImpl::initDRMFormats() {
|
||||||
mods.push_back(DRM_FORMAT_MOD_INVALID);
|
mods.push_back(DRM_FORMAT_MOD_INVALID);
|
||||||
|
|
||||||
dmaFormats.push_back(SDRMFormat{
|
dmaFormats.push_back(SDRMFormat{
|
||||||
.format = fmt,
|
.drmFormat = fmt,
|
||||||
.mods = mods,
|
.modifiers = mods,
|
||||||
});
|
});
|
||||||
|
|
||||||
std::vector<std::pair<uint64_t, std::string>> modifierData;
|
std::vector<std::pair<uint64_t, std::string>> modifierData;
|
||||||
|
|
Loading…
Reference in a new issue