Skip to content

Commit

Permalink
allocator: Don't force linear for multigpu if unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Feb 24, 2025
1 parent f239e5a commit 86e36b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/allocator/GBM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,16 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti
return;
}

// FIXME: Nvidia cannot render to linear buffers. What do?
if (MULTIGPU) {
allocator->backend->log(AQ_LOG_DEBUG, "GBM: Buffer is marked as multigpu, forcing linear");
explicitModifiers = {DRM_FORMAT_MOD_LINEAR};
// Try to use the linear format if available for cross-GPU compatibility.
// However, Nvidia doesn't support linear, so this is a best-effort basis.
for (auto const& f : FORMATS) {
if (f.drmFormat == DRM_FORMAT_MOD_LINEAR) {
allocator->backend->log(AQ_LOG_DEBUG, "GBM: Buffer is marked as multigpu, using linear format");
explicitModifiers = {DRM_FORMAT_MOD_LINEAR};
break;
}
}
}

uint32_t flags = GBM_BO_USE_RENDERING;
Expand Down

0 comments on commit 86e36b5

Please sign in to comment.