summaryrefslogtreecommitdiff
path: root/src/protocols/LinuxDMABUF.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-12-18 17:23:24 +0000
committerGitHub <noreply@github.com>2025-12-18 17:23:24 +0000
commit6175ecd4c4ba817c4620f66a75e1e11da7c7a8ca (patch)
treecf73852f1fc08b1dcee5a3a7380f914aaad9c50a /src/protocols/LinuxDMABUF.cpp
parentf88deb928a0f7dc02f427473f8c29e8f2bed14a3 (diff)
debug: move to hyprutils' logger (#12673)
Diffstat (limited to 'src/protocols/LinuxDMABUF.cpp')
-rw-r--r--src/protocols/LinuxDMABUF.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/protocols/LinuxDMABUF.cpp b/src/protocols/LinuxDMABUF.cpp
index a95a7a52..4f59e4b3 100644
--- a/src/protocols/LinuxDMABUF.cpp
+++ b/src/protocols/LinuxDMABUF.cpp
@@ -83,7 +83,7 @@ CDMABUFFormatTable::CDMABUFFormatTable(SDMABUFTranche _rendererTranche, std::vec
auto arr = sc<SDMABUFFormatTableEntry*>(mmap(nullptr, m_tableSize, PROT_READ | PROT_WRITE, MAP_SHARED, fds[0].get(), 0));
if (arr == MAP_FAILED) {
- LOGM(ERR, "mmap failed");
+ LOGM(Log::ERR, "mmap failed");
return;
}
@@ -105,7 +105,7 @@ CLinuxDMABuffer::CLinuxDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDM
});
if (!m_buffer->m_success)
- LOGM(ERR, "Possibly compositor bug: buffer failed to create");
+ LOGM(Log::ERR, "Possibly compositor bug: buffer failed to create");
}
CLinuxDMABuffer::~CLinuxDMABuffer() {
@@ -161,7 +161,7 @@ CLinuxDMABUFParamsResource::CLinuxDMABUFParamsResource(UP<CZwpLinuxBufferParamsV
if (flags > 0) {
r->sendFailed();
- LOGM(ERR, "DMABUF flags are not supported");
+ LOGM(Log::ERR, "DMABUF flags are not supported");
return;
}
@@ -180,7 +180,7 @@ CLinuxDMABUFParamsResource::CLinuxDMABUFParamsResource(UP<CZwpLinuxBufferParamsV
if (flags > 0) {
r->sendFailed();
- LOGM(ERR, "DMABUF flags are not supported");
+ LOGM(Log::ERR, "DMABUF flags are not supported");
return;
}
@@ -200,19 +200,19 @@ void CLinuxDMABUFParamsResource::create(uint32_t id) {
m_used = true;
if UNLIKELY (!verify()) {
- LOGM(ERR, "Failed creating a dmabuf: verify() said no");
+ LOGM(Log::ERR, "Failed creating a dmabuf: verify() said no");
return; // if verify failed, we errored the resource.
}
if UNLIKELY (!commence()) {
- LOGM(ERR, "Failed creating a dmabuf: commence() said no");
+ LOGM(Log::ERR, "Failed creating a dmabuf: commence() said no");
m_resource->sendFailed();
return;
}
- LOGM(LOG, "Creating a dmabuf, with id {}: size {}, fmt {}, planes {}", id, m_attrs->size, NFormatUtils::drmFormatName(m_attrs->format), m_attrs->planes);
+ LOGM(Log::DEBUG, "Creating a dmabuf, with id {}: size {}, fmt {}, planes {}", id, m_attrs->size, NFormatUtils::drmFormatName(m_attrs->format), m_attrs->planes);
for (int i = 0; i < m_attrs->planes; ++i) {
- LOGM(LOG, " | plane {}: mod {} fd {} stride {} offset {}", i, m_attrs->modifier, m_attrs->fds[i], m_attrs->strides[i], m_attrs->offsets[i]);
+ LOGM(Log::DEBUG, " | plane {}: mod {} fd {} stride {} offset {}", i, m_attrs->modifier, m_attrs->fds[i], m_attrs->strides[i], m_attrs->offsets[i]);
}
auto& buf = PROTO::linuxDma->m_buffers.emplace_back(makeUnique<CLinuxDMABuffer>(id, m_resource->client(), *m_attrs));
@@ -237,12 +237,12 @@ bool CLinuxDMABUFParamsResource::commence() {
uint32_t handle = 0;
if (drmPrimeFDToHandle(PROTO::linuxDma->m_mainDeviceFD.get(), m_attrs->fds.at(i), &handle)) {
- LOGM(ERR, "Failed to import dmabuf fd");
+ LOGM(Log::ERR, "Failed to import dmabuf fd");
return false;
}
if (drmCloseBufferHandle(PROTO::linuxDma->m_mainDeviceFD.get(), handle)) {
- LOGM(ERR, "Failed to close dmabuf handle");
+ LOGM(Log::ERR, "Failed to close dmabuf handle");
return false;
}
}
@@ -412,7 +412,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
auto dev = devIDFromFD(rendererFD);
if (!dev.has_value()) {
- LOGM(ERR, "failed to get drm dev, disabling linux dmabuf");
+ LOGM(Log::ERR, "failed to get drm dev, disabling linux dmabuf");
removeGlobal();
return;
}
@@ -462,7 +462,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
drmDevice* device = nullptr;
if (drmGetDeviceFromDevId(m_mainDevice, 0, &device) != 0) {
- LOGM(ERR, "failed to get drm dev, disabling linux dmabuf");
+ LOGM(Log::ERR, "failed to get drm dev, disabling linux dmabuf");
removeGlobal();
return;
}
@@ -472,7 +472,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
m_mainDeviceFD = CFileDescriptor{fcntl(g_pCompositor->m_drmRenderNode.fd, F_DUPFD_CLOEXEC, 0)};
drmFreeDevice(&device);
if (!m_mainDeviceFD.isValid()) {
- LOGM(ERR, "failed to open rendernode, disabling linux dmabuf");
+ LOGM(Log::ERR, "failed to open rendernode, disabling linux dmabuf");
removeGlobal();
return;
}
@@ -485,12 +485,12 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const
m_mainDeviceFD = CFileDescriptor{open(name, O_RDWR | O_CLOEXEC)};
drmFreeDevice(&device);
if (!m_mainDeviceFD.isValid()) {
- LOGM(ERR, "failed to open drm dev, disabling linux dmabuf");
+ LOGM(Log::ERR, "failed to open drm dev, disabling linux dmabuf");
removeGlobal();
return;
}
} else {
- LOGM(ERR, "DRM device {} has no render node, disabling linux dmabuf checks", device->nodes[DRM_NODE_PRIMARY] ? device->nodes[DRM_NODE_PRIMARY] : "null");
+ LOGM(Log::ERR, "DRM device {} has no render node, disabling linux dmabuf checks", device->nodes[DRM_NODE_PRIMARY] ? device->nodes[DRM_NODE_PRIMARY] : "null");
drmFreeDevice(&device);
}
});
@@ -500,7 +500,7 @@ void CLinuxDMABufV1Protocol::resetFormatTable() {
if (!m_formatTable)
return;
- LOGM(LOG, "Resetting format table");
+ LOGM(Log::DEBUG, "Resetting format table");
// this might be a big copy
auto newFormatTable = makeUnique<CDMABUFFormatTable>(m_formatTable->m_rendererTranche, m_formatTable->m_monitorTranches);
@@ -570,12 +570,12 @@ void CLinuxDMABufV1Protocol::updateScanoutTranche(SP<CWLSurfaceResource> surface
}
if (!feedbackResource) {
- LOGM(LOG, "updateScanoutTranche: surface has no dmabuf_feedback");
+ LOGM(Log::DEBUG, "updateScanoutTranche: surface has no dmabuf_feedback");
return;
}
if (!pMonitor) {
- LOGM(LOG, "updateScanoutTranche: resetting feedback");
+ LOGM(Log::DEBUG, "updateScanoutTranche: resetting feedback");
feedbackResource->sendDefaultFeedback();
return;
}
@@ -584,13 +584,13 @@ void CLinuxDMABufV1Protocol::updateScanoutTranche(SP<CWLSurfaceResource> surface
std::ranges::find_if(m_formatTable->m_monitorTranches, [pMonitor](std::pair<PHLMONITORREF, SDMABUFTranche> pair) { return pair.first == pMonitor; });
if (monitorTranchePair == m_formatTable->m_monitorTranches.end()) {
- LOGM(LOG, "updateScanoutTranche: monitor has no tranche");
+ LOGM(Log::DEBUG, "updateScanoutTranche: monitor has no tranche");
return;
}
auto& monitorTranche = (*monitorTranchePair).second;
- LOGM(LOG, "updateScanoutTranche: sending a scanout tranche");
+ LOGM(Log::DEBUG, "updateScanoutTranche: sending a scanout tranche");
struct wl_array deviceArr = {
.size = sizeof(m_mainDevice),