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

Platform: New platform probe design #2378

Merged
merged 21 commits into from Apr 14, 2022
Merged

Platform: New platform probe design #2378

merged 21 commits into from Apr 14, 2022

Conversation

RAOF
Copy link
Contributor

@RAOF RAOF commented Apr 7, 2022

This accomplishes multiple goals:

  • Platforms can now “bind” to a device, and the platform which claims to support that device best wins.
  • Platforms can list each device that they can drive, so later we can construct a DisplayPlatform or RenderingPlatform on the specific device.
  • Platforms can share data between the probe and construction phase

RAOF added 16 commits April 7, 2022 16:59
There are locations where we have a `dev_t` but will need a `udev::Device`.
Make this possible
This lets other parts of Mir simply add a `target_link_libaries(... mirudev)` to
get proper header handling.
This accomplishes multiple goals:
* Platforms can now “bind” to a device, and the platform which claims
  to support that device best wins.
* Platforms can list *each* device that they can drive, so later we
  can construct a `DisplayPlatform` or `RenderingPlatform` on the
  specific device.
* Platforms can share data between the `probe` and construction phase
Log what type of driver we've selected (display or rendering), and
fix the “Found <driver type> driver: $FOO” message
Even if the platform is not claiming to support a specific
device, we still shouldn't return platforms which return
`PlatformPriority::unsupported`.
The rendernode devices are /dev/dri/render*D*$NUMBER.

Fixes probing the gbm-kms rendering platform.
We no longer have a nested platform in that sense!
There's no reason this requires the Mesa platform - the dummy
platform is sufficient here.
Turns out that `<span>` is one of the C++20 features not supported
by 20.04's libstdc++. ☹
@RAOF
Copy link
Contributor Author

RAOF commented Apr 11, 2022

bors try

This failed because of the WLCS update.

bors bot added a commit that referenced this pull request Apr 11, 2022
@bors
Copy link
Contributor

bors bot commented Apr 11, 2022

…not be used depending on the set of built platforms
Copy link
Contributor

@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.

A few comments about one struct: I've not tried to get my head around the whole PR yet

include/platform/mir/graphics/platform.h Outdated Show resolved Hide resolved
include/platform/mir/graphics/platform.h Outdated Show resolved Hide resolved
Copy link
Contributor

@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.

Looks good and works for me.

A bit of nitpicking about ABI management, but otherwise good to go.

bors delegate

include/platform/mir/graphics/platform.h Show resolved Hide resolved
src/platform/symbols.map Show resolved Hide resolved
src/platform/symbols.map Show resolved Hide resolved
`MIR_SERVER_GRAPHICS_PLATFORM_STANZA_VERSION` is the variable we use for the
graphics platform-DSO <-> libmirplatform ABI.
TODO: Do we *need* both halves?
@RAOF
Copy link
Contributor Author

RAOF commented Apr 14, 2022

I think this is right, but I'd prefer a second review before accepting it.

Copy link
Contributor

@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.

bors merge

include/platform/mir/graphics/platform.h Show resolved Hide resolved
include/platform/mir/graphics/platform.h Show resolved Hide resolved
@bors bors bot merged commit 2f60889 into main Apr 14, 2022
@bors bors bot deleted the device-binding-probe branch April 14, 2022 09:18
@Saviq Saviq mentioned this pull request May 12, 2022
bors bot added a commit that referenced this pull request May 24, 2022
2423: Release 2.8.0 r=AlanGriffiths,graysonguarino,RAOF,wmww,Saviq a=Saviq

---
> - ABI summary:
>   - miral ABI unchanged at 4
>   - mircommon ABI bumped to 9
>   - mircookie ABI unchanged at 2
>   - mircore ABI unchanged at 1
>   - miroil ABI unchanged at 1
>   - mirplatform ABI unchanged at 23
>   - mirserver ABI bumped to 58
>   - mirwayland ABI unchanged at 3
>   - mirplatformgraphics ABI bumped to 20
>   - mirinputplatform ABI unchanged at 8
> - Enhancements:
>   - Move generated protocol code to build directory (#2300)
>   - Allow --app-env-amend to be supplied multiple times (#2333)
>   - Make window title a configuration option (#2349)
>   - Add fatal_error if unable to bind Wayland socket (#2350)
>   - Add `mold` to the list of supported linkers (#2353)
>   - Platform refactoring towards hybrid GPU support (#2358, #2378, #2407)
>   - Implement wlr_screencopy_unstable_v1 for screenshots (#2383)
>   - Refactor out mf::MirDisplay (#2406)
> - Bugs fixed:
>   - Synchronize buffer swaps to video frame in egl spinner (Fixes #2154)
>   - Do not give menus keyboard focus (Fixes #2324)
>   - Refactor Wayland keyboard input (Fixes #2331)
>   - Further simplify and correct keyboard focus setting (Fixes #2338)
>   - wl_pointer: do not send events when not compatible (Fixes #2341)
>   - Kill clients with error instead of sending unsupported (Fixes #2343)
>   - Initialize sig_handler_desc.sa_mask (#2386)
>   - Fix ThreadedDispatcherSignalTest.keeps_dispatching... (Fixes #2377)

Co-authored-by: Michał Sawicz <michal@sawicz.net>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
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.

None yet

3 participants