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

examples/drm: Don't force card{i} enumeration to start at 0 #245

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

MarijnS95
Copy link
Member

On my setup with an AMD RX6800XT GPU (same happens with an Intel Arc GPU) there is only card1 and renderD128. The example would fail with a "File not found" error for /dev/dri/card0 when it should instead continue to iterate to find the first valid DRM device.

A more future-proof solution would be to replace the 0..10 range with a readdir()-like iterator over the contents of /dev/dri if that's accepted for an example. Note that drm 0.14.0 added wrappers for dealing with /dev/dri files and Smithay/drm-rs#208 is adding exactly the iterator we need to find the first valid device, which I'd recommend to use in our iterator instead when released :)

On my setup with an AMD RX6800XT GPU (same happens with an Intel Arc
GPU) there is only `card1` and `renderD128`.  The example would fail
with a "File not found" error for `/dev/dri/card0` when it should
instead continue to iterate to find the first valid DRM device.

A more future-proof solution would be to replace the `0..10` range with
a `readdir()`-like iterator over the contents of `/dev/dri` if that's
accepted for an example.
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Thanks!

@notgull notgull merged commit c020394 into master Jan 1, 2025
38 checks passed
@notgull notgull deleted the drm-card1 branch January 1, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants