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

Initial Atomic KMS platform #3525

Merged
merged 27 commits into from
Nov 7, 2024
Merged

Initial Atomic KMS platform #3525

merged 27 commits into from
Nov 7, 2024

Commits on Oct 15, 2024

  1. Configuration menu
    Copy the full SHA
    ec4e20f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba3b2f3 View commit details
    Browse the repository at this point in the history
  3. platforms: Add atomic-kms platform

    This is initially a copy of the display half of `gbm-kms`, quickly ported to use
    only the atomic KMS APIs.
    
    It shall be further developed to usefully use the atomic APIs to fix various TODOs,
    and provide support for extra performance features
    RAOF authored and tarek-y-ismail committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    59dd726 View commit details
    Browse the repository at this point in the history
  4. platforms/atomic-kms: Populate supported pixel formats correctly (#3596)

    `DisplayConfigurationOutput.pixel_formats` now contains the list of
    accepted pixel formats (or, at least, those pixel formats that are
    representable in the `MirPixelFormats` enum; many aren't).
    
    ---------
    
    Co-authored-by: tarek-y-ismail <[email protected]>
    Co-authored-by: Alan Griffiths <[email protected]>
    3 people committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e9a505f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0dc388b View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. platforms/atomic-kms: Fix AtomicKMSOutput::clear_crtc

    The dance required to actually disable an output (and free its
    resources) is surprisingly involved.
    RAOF committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    7a6c934 View commit details
    Browse the repository at this point in the history
  2. platforms/atomic-kms: Fix AtomicKMSOutput::set_power_mode

    We might not actually have a `current_crtc` when `set_power_mode` is called
    (notably, when disabling an output we set `mir_power_mode_off`).
    
    Rather than crashing, log an error if we try and turn on an unconfigured
    output. Silently ignore trying to turn *off* an unconfigured output,
    as it's already off.
    RAOF committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    b5f03e0 View commit details
    Browse the repository at this point in the history
  3. platforms/atomic-kms: Fix modesetting with AtomicKMSOutput::set_crtc

    The way changing the display mode works is that the
    `configure` sets the desired `mode_index`, and then
    the *next* `set_crtc` is meant to actually set the mode.
    
    This means that we can wait for correctly-sized content
    to present at the new mode, rather than showing a single
    black frame before the correct content.
    
    But it also means that `set_crtc` needs to look at
    the requested mode, rather than the current mode!
    RAOF committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    6b5ec1d View commit details
    Browse the repository at this point in the history
  4. platforms/atomic-kms: Fix log message.

    We were trying to pageflip, so let's say that.
    RAOF committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    3c2d3ca View commit details
    Browse the repository at this point in the history
  5. platforms/atomic-kms: Don't try to pageflip incorrectly sized FBs

    Currently we expect to only flip framebuffers that are
    the same size, in pixels, as the output mode.
    
    Check in `schedule_page_flip` that this holds. Otherwise,
    we must be expecting a modeset and need to go through
    the `set_crtc` codepath.
    
    We might, later, update the system to handle using the
    display scalers to present framebuffers that aren't the
    same size as the output mode.
    RAOF committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    99e65ba View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2024

  1. platforms/atomic-kms: Make DisplaySink associated with exactly one KM…

    …SOutput.
    
    This is a different behaviour to `gbm-kms`. On `gbm-kms`, when outputs
    have an overlapping view of the logical space they are grouped
    together so that they share a single *physical* framebuffer.
    
    When the overlap is great (such as a complete clone), this
    should result in lower GPU memory usage (as we need only a single
    set of framebuffers for all clones) at the cost of tying
    the refresh rates of each clone together. (And some bugs, like
    #3641).
    
    When the overlap is *not* great, this potential memory saving
    goes away (and may indeed result in *higher* GPU memory usage -
    if outputs have different sizes, we may now need to have a
    bunch of unused pixels, as the FB can only be rectangular).
    
    For Atomic KMS, instead, we give each output its own physical
    framebuffer, regardless of whether it overlaps.
    RAOF committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    b09ddee View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. Drop dead code

    AlanGriffiths committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    ebac9f3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4e3489b View commit details
    Browse the repository at this point in the history
  3. Naked #include <gbm.h>

    AlanGriffiths committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    b847994 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2f539f9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    484154f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e9e94f9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3ffc1e2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    72c7038 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8082102 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2024

  1. Failing to get gamma curves shouldn't be fatal in `AtomicKMSOutput::u…

    …pdate_from_hardware_state()`
    AlanGriffiths committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    1b0062f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a816adb View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2024

  1. platforms/atomic-kms: Synchronise access to CRTC configuration.

    *Almost* all of this is only accessed on a single thread, the compositor's
    submission thread.
    
    *Almost*.
    
    Unfortunately, `configure` is generally called from the ServerAction loop,
    which is a different thread to the composition thread. `ensure_crtc` can
    also (transitively) be called from `configuration`, which also happens
    off-composition-thread.
    
    Wrap this ball of wax up in a `mir::Synchronised<>`, to ensure we're
    not racy.
    
    (This also affects `gbm-kms`, but to a much lesser extent)
    RAOF committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    75910a6 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. platforms/atomic-kms: Clean up unused resources in `refresh_hardware_…

    …state`
    
    When we refresh the hardware state of each `KMSOutput` check whether
    it has resources currently assigned but is now not connected.
    
    If so, free the resources before continuing.
    RAOF committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    ee57db3 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2024

  1. Configuration menu
    Copy the full SHA
    bec4b25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3aae8bb View commit details
    Browse the repository at this point in the history
  3. platforms/atomic-kms: Release resources for disconnected outputs.

    Otherwise we *can* be in a position where hardware resources are bound to
    a disconnected output, preventing them being used if a display is plugged
    in to a different connector.
    RAOF committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    5efbaef View commit details
    Browse the repository at this point in the history