Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux-dmabuf: Fix cross-GPU imports #3401

Merged
merged 2 commits into from
May 28, 2024

Conversation

RAOF
Copy link
Contributor

@RAOF RAOF commented May 27, 2024

One-half of fixing hybrid on my laptop is to allocate
the bounce buffers necessary to get the client buffer
somewhere the compositing GPU can read it in a format
that the compositing GPU can read.

The code was trying to do that by matching on supported
modifiers. Unfortunately, due to other constraints, the
code accepts (and must accept, elsewhere) DRM_FORMAT_MOD_INVALID.

MOD_INVALID means “use a driver-specific side-band to know
what the format is”, and is unlikely to work across GPUs.

RAOF added 2 commits May 27, 2024 16:50
Trying to import a buffer with `DRM_FORMAT_MOD_INVALID` from one GPU
to another is very unlikely to work, as `MOD_INVALID` means “use
out-of-band driver-specific logic to know what the format is”."
Some DRI drivers don't support modifiers (for example, amdgpu on some hardware families).
On these systems, `gbm_bo_create_with_modifiers2` will fail with `ENOSYS`.

Handle this by falling back to `gbm_bo_create` with `GBM_BO_USE_LINEAR` (which is
an old special-case modifier-like system for ensuring cross-GPU compatibility).
@RAOF RAOF requested a review from a team as a code owner May 27, 2024 07:06
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 64 lines in your changes missing coverage. Please review.

Project coverage is 77.50%. Comparing base (a5f3143) to head (0444294).
Report is 460 commits behind head on main.

Files Patch % Lines
src/platform/graphics/linux_dmabuf.cpp 0.00% 49 Missing ⚠️
src/platforms/gbm-kms/server/kms/platform.cpp 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3401      +/-   ##
==========================================
- Coverage   77.52%   77.50%   -0.02%     
==========================================
  Files        1065     1065              
  Lines       67901    67914      +13     
==========================================
- Hits        52639    52638       -1     
- Misses      15262    15276      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@AlanGriffiths AlanGriffiths added this pull request to the merge queue May 28, 2024
Merged via the queue into main with commit 7c97869 May 28, 2024
34 of 36 checks passed
@AlanGriffiths AlanGriffiths deleted the MIRENG-542-fix-cross-GPU-imports branch May 28, 2024 11:28
@AlanGriffiths AlanGriffiths mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants