pub struct CoordinatorProxy { /* private fields */ }

Implementations§

source§

impl CoordinatorProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.hardware.display/Coordinator.

source

pub fn take_event_stream(&self) -> CoordinatorEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn import_image( &self, image_config: &ImageConfig, buffer_id: &BufferId, image_id: &ImageId ) -> QueryResponseFut<CoordinatorImportImageResult>

Imports a Buffer-Collection backed image.

image_config must be compatible with that passed through [fuchsia.hardware.display/Coordinator.SetBufferCollectionConstraints] on the buffer_collection_id.

Returns ZX_ERR_NOT_SUPPORTED if the display hardware doesn’t support image_config. Returns ZX_ERR_ALREADY_EXISTS if image_id was used in a successful ImportImage() without a corresponding ReleaseImage().

source

pub fn release_image(&self, image_id: &ImageId) -> Result<(), Error>

Releases an imported image.

image_id must be already imported by [fuchsia.hardware.display/Coordinator.ImportImage].

The image must not be the capture target of an ongoing capture specified in [fuchsia.hardware.display/Coordinator.StartCapture].

When an image is released, it is immediately removed from any pending or active configurations, and any fences associated with the image are dropped. The resources associated with the image will be released as soon as the image is no longer in use.

source

pub fn import_event(&self, event: Event, id: &EventId) -> Result<(), Error>

Imports an event into the driver and associates it with the given id.

It is illegal for id to be equal to INVALID_DISP_ID, and it is undefined to import one event with two different ids or to import two different events with the same id (note that ids map well to koids).

If a client is reusing events, they must clear the signal before referencing the id again.

source

pub fn release_event(&self, id: &EventId) -> Result<(), Error>

Releases the event imported with the given id.

If any images are currently using the given event, the event will still be waited up or signaled as appropriate before its resources are released. It is an error to reuse an ID while the active config has references to it.

source

pub fn create_layer(&self) -> QueryResponseFut<CoordinatorCreateLayerResult>

source

pub fn destroy_layer(&self, layer_id: &LayerId) -> Result<(), Error>

source

pub fn set_display_mode( &self, display_id: &DisplayId, mode: &Mode ) -> Result<(), Error>

source

pub fn set_display_color_conversion( &self, display_id: &DisplayId, preoffsets: &[f32; 3], coefficients: &[f32; 9], postoffsets: &[f32; 3] ) -> Result<(), Error>

source

pub fn set_display_layers( &self, display_id: &DisplayId, layer_ids: &[LayerId] ) -> Result<(), Error>

source

pub fn set_layer_primary_config( &self, layer_id: &LayerId, image_config: &ImageConfig ) -> Result<(), Error>

source

pub fn set_layer_primary_position( &self, layer_id: &LayerId, transform: Transform, src_frame: &Frame, dest_frame: &Frame ) -> Result<(), Error>

source

pub fn set_layer_primary_alpha( &self, layer_id: &LayerId, mode: AlphaMode, val: f32 ) -> Result<(), Error>

source

pub fn set_layer_color_config( &self, layer_id: &LayerId, pixel_format: PixelFormat, color_bytes: &[u8] ) -> Result<(), Error>

source

pub fn set_layer_image( &self, layer_id: &LayerId, image_id: &ImageId, wait_event_id: &EventId, signal_event_id: &EventId ) -> Result<(), Error>

source

pub fn check_config( &self, discard: bool ) -> QueryResponseFut<(ConfigResult, Vec<ClientCompositionOp>)>

source

pub fn apply_config(&self) -> Result<(), Error>

source

pub fn get_latest_applied_config_stamp(&self) -> QueryResponseFut<ConfigStamp>

Gets the stamp provided with the latest configuration the client submitted (by calling ApplyConfig()) and the display core driver accepted; the display configuration may not have been rendered yet because of pending image availability or pending layer changes. If no configuration was applied before, returns INVALID_CONFIG_STAMP_VALUE.

source

pub fn apply_config2(&self, signal_fences: Vec<Event>) -> Result<(), Error>

Applies any pending changes to the current configuration. This will not apply pending changes to layers which are not on any display.

For each event in signal_fences, once the pending configuration is applied to and contents are displayed on all the displays connected to the Coordinator, it will be signaled immediately.

Arguments

signal_fences: Stores all fence events that will be signaled once the configuration is applied.

Error handling

If the input is invalid, for example:
    - `signal_fences` contains invalid events
or the pending configuration cannot be applied, this call will
silently fail, so the client should ensure its configuration is
valid with CheckConfig().
source

pub fn enable_vsync(&self, enable: bool) -> Result<(), Error>

source

pub fn acknowledge_vsync(&self, cookie: u64) -> Result<(), Error>

source

pub fn set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), Error>

Sets the visibility behavior of the virtcon.

This must only be called from the Virtcon client.

source

pub fn import_buffer_collection( &self, buffer_collection_id: &BufferCollectionId, buffer_collection_token: ClientEnd<BufferCollectionTokenMarker> ) -> QueryResponseFut<CoordinatorImportBufferCollectionResult>

source

pub fn release_buffer_collection( &self, buffer_collection_id: &BufferCollectionId ) -> Result<(), Error>

source

pub fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, config: &ImageConfig ) -> QueryResponseFut<CoordinatorSetBufferCollectionConstraintsResult>

source

pub fn is_capture_supported( &self ) -> QueryResponseFut<CoordinatorIsCaptureSupportedResult>

Returns true if Capture is supported on the platform.

source

pub fn start_capture( &self, signal_event_id: &EventId, image_id: &ImageId ) -> QueryResponseFut<CoordinatorStartCaptureResult>

Starts capture. Client must provide a valid signal_event_id and image_id. signal_event_id must have been imported into the driver using ImportEvent FIDL API. Image_id is the id from ImportImageForCapture. The client will get notified once capture is complete via signal_event_id. Returns ZX_ERR_NOT_SUPPORTED if coordinator does not support capture

source

pub fn set_minimum_rgb( &self, minimum_rgb: u8 ) -> QueryResponseFut<CoordinatorSetMinimumRgbResult>

Set the minimum value of rgb channels. Valid range [0 255] inclusive. Returns ZX_ERR_NOT_SUPPORTED when the display hardware does not support this feature. This API is meant to address backlight bleeding that may occur on some hardware that have a specific type of panel and hardware assembly. The evolution of this API is highly hardware and product dependant and therefore as products evolve, this API may change or support for this API may become non-existent. Therefore, this API should be used with caution.

Unlike other calls in this API, SetMiniumRgb is applied immediately, and does not wait for ApplyConfig(). It is, however, still stateful.

source

pub fn set_display_power( &self, display_id: &DisplayId, power_on: bool ) -> QueryResponseFut<CoordinatorSetDisplayPowerResult>

Power off/on the display panel.

This function takes effect immediately. Clients don’t need to call ApplyConfig() to commit this command.

Once a display is turned off, it will not deliver vsync events, which may include the vsync event for the most recently applied config.

Staged display control commands (e.g. SetDisplayLayer) will not be affected. They are still applied to the display device when client calls ApplyConfig(), but the contents will be shown on display panel only after client powers on the display again.

Newly added displays are turned on by default.

Returns ZX_ERR_NOT_FOUND if display_id is invalid when Coordinator handles this method. Returns ZX_ERR_NOT_SUPPORTED if the display driver IC doesn’t support turning on/off displays.

Trait Implementations§

source§

impl Clone for CoordinatorProxy

source§

fn clone(&self) -> CoordinatorProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CoordinatorProxyInterface for CoordinatorProxy

§

type ImportImageResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn import_image( &self, image_config: &ImageConfig, buffer_id: &BufferId, image_id: &ImageId ) -> Self::ImportImageResponseFut

source§

fn release_image(&self, image_id: &ImageId) -> Result<(), Error>

source§

fn import_event(&self, event: Event, id: &EventId) -> Result<(), Error>

source§

fn release_event(&self, id: &EventId) -> Result<(), Error>

§

type CreateLayerResponseFut = QueryResponseFut<Result<LayerId, i32>>

source§

fn create_layer(&self) -> Self::CreateLayerResponseFut

source§

fn destroy_layer(&self, layer_id: &LayerId) -> Result<(), Error>

source§

fn set_display_mode( &self, display_id: &DisplayId, mode: &Mode ) -> Result<(), Error>

source§

fn set_display_color_conversion( &self, display_id: &DisplayId, preoffsets: &[f32; 3], coefficients: &[f32; 9], postoffsets: &[f32; 3] ) -> Result<(), Error>

source§

fn set_display_layers( &self, display_id: &DisplayId, layer_ids: &[LayerId] ) -> Result<(), Error>

source§

fn set_layer_primary_config( &self, layer_id: &LayerId, image_config: &ImageConfig ) -> Result<(), Error>

source§

fn set_layer_primary_position( &self, layer_id: &LayerId, transform: Transform, src_frame: &Frame, dest_frame: &Frame ) -> Result<(), Error>

source§

fn set_layer_primary_alpha( &self, layer_id: &LayerId, mode: AlphaMode, val: f32 ) -> Result<(), Error>

source§

fn set_layer_color_config( &self, layer_id: &LayerId, pixel_format: PixelFormat, color_bytes: &[u8] ) -> Result<(), Error>

source§

fn set_layer_image( &self, layer_id: &LayerId, image_id: &ImageId, wait_event_id: &EventId, signal_event_id: &EventId ) -> Result<(), Error>

§

type CheckConfigResponseFut = QueryResponseFut<(ConfigResult, Vec<ClientCompositionOp>)>

source§

fn check_config(&self, discard: bool) -> Self::CheckConfigResponseFut

source§

fn apply_config(&self) -> Result<(), Error>

§

type GetLatestAppliedConfigStampResponseFut = QueryResponseFut<ConfigStamp>

source§

fn get_latest_applied_config_stamp( &self ) -> Self::GetLatestAppliedConfigStampResponseFut

source§

fn apply_config2(&self, signal_fences: Vec<Event>) -> Result<(), Error>

source§

fn enable_vsync(&self, enable: bool) -> Result<(), Error>

source§

fn acknowledge_vsync(&self, cookie: u64) -> Result<(), Error>

source§

fn set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), Error>

§

type ImportBufferCollectionResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn import_buffer_collection( &self, buffer_collection_id: &BufferCollectionId, buffer_collection_token: ClientEnd<BufferCollectionTokenMarker> ) -> Self::ImportBufferCollectionResponseFut

source§

fn release_buffer_collection( &self, buffer_collection_id: &BufferCollectionId ) -> Result<(), Error>

§

type SetBufferCollectionConstraintsResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, config: &ImageConfig ) -> Self::SetBufferCollectionConstraintsResponseFut

§

type IsCaptureSupportedResponseFut = QueryResponseFut<Result<bool, i32>>

source§

fn is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut

§

type StartCaptureResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn start_capture( &self, signal_event_id: &EventId, image_id: &ImageId ) -> Self::StartCaptureResponseFut

§

type SetMinimumRgbResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut

§

type SetDisplayPowerResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn set_display_power( &self, display_id: &DisplayId, power_on: bool ) -> Self::SetDisplayPowerResponseFut

source§

impl Debug for CoordinatorProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Proxy for CoordinatorProxy

§

type Protocol = CoordinatorMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more