class Controller

Defined at line 60 of file ../../src/graphics/display/drivers/coordinator/controller.h

Multiplexes between display controller clients and display engine drivers.

Instances are not thread-safe, and must only be used on the driver

dispatcher.

Public Methods

void Controller (const Controller & )

Defined at line 86 of file ../../src/graphics/display/drivers/coordinator/controller.h

Controller & operator= (const Controller & )

Defined at line 87 of file ../../src/graphics/display/drivers/coordinator/controller.h

EngineDriverClient * engine_driver_client ()

Defined at line 138 of file ../../src/graphics/display/drivers/coordinator/controller.h

bool supports_capture ()

May only be called after the display engine driver is connected.

Defined at line 141 of file ../../src/graphics/display/drivers/coordinator/controller.h

const display::EngineInfo & engine_info ()

May only be called after the display engine driver is connected.

Defined at line 144 of file ../../src/graphics/display/drivers/coordinator/controller.h

fdf::UnownedSynchronizedDispatcher driver_dispatcher ()

Defined at line 146 of file ../../src/graphics/display/drivers/coordinator/controller.h

bool IsRunningOnDriverDispatcher ()

Defined at line 149 of file ../../src/graphics/display/drivers/coordinator/controller.h

const inspect::Inspector & inspector ()

Defined at line 153 of file ../../src/graphics/display/drivers/coordinator/controller.h

const ClientSet & ClientsForTesting ()

Defined at line 171 of file ../../src/graphics/display/drivers/coordinator/controller.h

zx::result<std::unique_ptr<Controller>> Create (std::unique_ptr<EngineDriverClient> engine_driver_client, fdf::UnownedSynchronizedDispatcher driver_dispatcher)

Factory method for production use.

Creates and initializes a Controller instance.

Asynchronous work that manages the state of the display clients and

coordinates the display state between clients and engine drivers runs on

`driver_dispatcher`.

`engine_driver_client` must not be null.

`driver_dispatcher` must be running until `PrepareStop()` is called.

`driver_dispatcher` must be shut down when `Stop()` is called.

Defined at line 565 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void Controller (std::unique_ptr<EngineDriverClient> engine_driver_client, fdf::UnownedSynchronizedDispatcher driver_dispatcher)

Creates a new coordinator Controller instance. It creates a new Inspector

which will be solely owned by the Controller instance.

`engine_driver_client` must not be null.

Defined at line 633 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void ~Controller ()

Defined at line 664 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void PrepareStop ()

References the `PrepareStop()` method in the DFv2 (fdf::DriverBase) driver

lifecycle.

Defined at line 608 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OnDisplayAdded (std::unique_ptr<AddedDisplayInfo> added_display_info)

`EngineListener`:

Must run on `driver_dispatcher_`.

Defined at line 120 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OnDisplayRemoved (display::DisplayId removed_display_id)

Defined at line 135 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OnCaptureComplete ()

Defined at line 148 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OnDisplayVsync (display::DisplayId display_id, zx::time_monotonic timestamp, display::DriverConfigStamp driver_config_stamp)

Defined at line 176 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OnClientDisconnected (Client * client)

`client` must not be null.

`client` is removed from the client set and destroyed during this call.

Defined at line 445 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void SetVirtconMode (fuchsia_hardware_display::wire::VirtconMode virtcon_mode)

Defined at line 439 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void SubmitConfig (DisplayConfig & display_config, display::ConfigStamp client_config_stamp, ClientId client_id)

Defined at line 300 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void ImageWillBeDestroyed (display::DriverImageId driver_image_id)

ImageLifecycleListener:

Defined at line 415 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void ReleaseCaptureImage (display::DriverCaptureImageId driver_capture_image_id)

Defined at line 419 of file ../../src/graphics/display/drivers/coordinator/controller.cc

zx::result<std::span<const display::ModeAndId>> GetDisplayPreferredModes (display::DisplayId display_id)

The display modes are guaranteed to be valid as long as the display with

`display_id` is valid.

For a valid display, it's guaranteed that `GetDisplayPreferredModes()` is

non-empty.

Defined at line 457 of file ../../src/graphics/display/drivers/coordinator/controller.cc

zx::result<fbl::Vector<display::PixelFormat>> GetSupportedPixelFormats (display::DisplayId display_id)

Defined at line 473 of file ../../src/graphics/display/drivers/coordinator/controller.cc

template <typename Callback>
bool FindDisplayInfo (display::DisplayId display_id, Callback callback)

Calls `callback` with a const DisplayInfo

&

matching the given `display_id`.

Returns true iff a DisplayInfo with `display_id` was found and `callback`

was called.

The controller mutex is guaranteed to be held while `callback` is called.

Defined at line 243 of file ../../src/graphics/display/drivers/coordinator/controller.h

zx::result<> CreateClient (display::ClientPriority client_priority, fidl::ServerEnd<fuchsia_hardware_display::Coordinator> coordinator_server_end, fidl::ClientEnd<fuchsia_hardware_display::CoordinatorListener> coordinator_listener_client_end)

Typically called by OpenController/OpenVirtconController. However, this is made public

for use by testing services which provide a fake display controller.

`client_priority` must be valid.

Defined at line 495 of file ../../src/graphics/display/drivers/coordinator/controller.cc

display::DriverBufferCollectionId GetNextDriverBufferCollectionId ()

Defined at line 526 of file ../../src/graphics/display/drivers/coordinator/controller.cc

void OpenCoordinator (OpenCoordinatorRequestView request, OpenCoordinatorCompleter::Sync & completer)

`fidl::WireServer

<fuchsia

_hardware_display::Provider>`:

Defined at line 532 of file ../../src/graphics/display/drivers/coordinator/controller.cc