Skip to content

Commit

Permalink
gbm: fix modifier list not updating when renderable list is empty (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
dawsers authored Sep 17, 2024
1 parent e4a1320 commit dc399a3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/allocator/GBM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,16 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti

// check if we can use modifiers. If the requested support has any explicit modifier
// supported by the primary backend, we can.
if (!RENDERABLE.empty()) {
TRACE(allocator->backend->log(AQ_LOG_TRACE, std::format("GBM: Renderable has {} formats, clipping", RENDERABLE.size())));
for (auto const& f : FORMATS) {
if (f.drmFormat != attrs.format)
continue;

for (auto const& f : FORMATS) {
if (f.drmFormat != attrs.format)
for (auto const& m : f.modifiers) {
if (m == DRM_FORMAT_MOD_INVALID)
continue;

for (auto const& m : f.modifiers) {
if (m == DRM_FORMAT_MOD_INVALID)
continue;

if (!RENDERABLE.empty()) {
TRACE(allocator->backend->log(AQ_LOG_TRACE, std::format("GBM: Renderable has {} formats, clipping", RENDERABLE.size())));
if (params.scanout && !CURSOR && !MULTIGPU) {
// regular scanout plane, check if the format is renderable
auto rformat = std::find_if(RENDERABLE.begin(), RENDERABLE.end(), [f](const auto& e) { return e.drmFormat == f.drmFormat; });
Expand All @@ -130,9 +129,8 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti
continue;
}
}

explicitModifiers.push_back(m);
}
explicitModifiers.push_back(m);
}
}

Expand Down

0 comments on commit dc399a3

Please sign in to comment.