fidl_fuchsia_hardware_display

Struct CoordinatorProxy

Source
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_metadata: &ImageMetadata, buffer_id: &BufferId, image_id: &ImageId, ) -> QueryResponseFut<CoordinatorImportImageResult, DefaultFuchsiaResourceDialect>

Imports a Buffer-Collection backed image.

image_metadata must be compatible with the arguments passed to [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, DefaultFuchsiaResourceDialect>

Creates a new layer.

Layers are not associated with a particular display, but they can only be shown on at most one display at any given time. A layer is considered in use from the time it is passed to SetDisplayLayers until a subsequent configuration is applied which does not include the layer or until its display is removed.

Source

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

Destroys the given layer.

It is illegal to destroy a layer which does not exist or which is in use.

Source

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

Sets the display mode for the given display.

It is illegal to pass a display mode which was not part of the display’s Info.

Source

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

Set the color conversion applied to the display. The conversion is applied to to each pixel according to the formula:

(coefficients * (pixel + preoffsets)) + postoffsets

where pixel is a column vector consisting of the pixel’s 3 components.

coefficients is passed in row-major order. If the first entry of an array is NaN, the array is treated as the identity element for the relevant operation. Hardware that support color correction generally accept a limited range of coefficient values. Coefficients in the range of [-2, 2] inclusive will be accepted by most hardware. The hardware driver will clamp values that are outside its acceptable range.

preoffsets, postoffsets: Clients are encourged to produce color correction values that do not depend on pre and post offsets since some hardware do not have support for that. For cases where pre and post offset values need to be used, the range should be limited to (-1, 1) exclusive as confirmed by CheckConfig API. Values outside this range will be rejected.

Clients are encouraged to use the CheckConfig API to confirm support for correction and to validate their color correction input values.

This a stateful call. Once color conversion values have been succesfully applied via a call to ApplyConfig() they will remain in place until changed and another ApplyConfig() call is successful. If SetDisplayColorConversion() is called and then the config is discarded, then the last successfully applied state is restored.

Source

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

Sets which layers are on a display. The list is in increasing z-order.

It is illegal to use a layer on multiple displays concurrently. If a layer needs to be moved between displays, it must be removed from the first display’s pending config before being added to the second display’s pending config. It is also illegal to pass an invalid layer id.

Source

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

Configures the layer as a primary layer with no image and the default config (no src_frame cropping, the identity transform, positioned in the top-left corner of the composed output, and no scaling).

See the documentation on SetLayerImage for details on how this method affects the layer’s contents.

It is illegal to pass an invalid layer id.

Source

pub fn set_layer_primary_position( &self, layer_id: &LayerId, image_source_transformation: CoordinateTransformation, image_source: &RectU, display_destination: &RectU, ) -> Result<(), Error>

Sets the layer transform, scaling, and positioning.

CheckConfig() will return INVALID_CONFIG if any of the configuration validity conditions specified here is violated.

Calling this on a non-primary layer or passing an invalid transform is illegal.

Source

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

Sets the alpha mode of the plane.

If mode == DISABLED, the layer is opaque and val is ignored.

If mode == PREMULTIPLIED or HW_MULTIPLY and val is NaN, the alpha used when blending is determined by the per-pixel alpha channel.

If mode == PREMULTIPLIED or HW_MULTIPLY and val is not NaN, the alpha used when blending is the product of val and any per-pixel alpha. Additionally, if mode == PREMULTIPLIED, then the hardware premultiplies the color channel with val before blending.

It is illegal to call this on a non-primary layer, to pass an invalid mode, or to pass a value of val which is not NaN or in the range [0, 1].

Source

pub fn set_layer_color_config( &self, layer_id: &LayerId, color: &Color, ) -> Result<(), Error>

Configures the layer as a solid color fill layer.

It is illegal to call this on an invalid layer.

Source

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

Sets the image for the layer.

If wait_event_id corresponds to an imported event, the driver will wait for ZX_EVENT_SIGNALED on the object before presenting the image.

A layer’s active image is the most recently applied image which either has no wait event or whose wait event has been signaled. Whenever a new image becomes active, any older images which never became active are dropped, and their signal events will be fired as soon as their wait events are signaled. The driver also does not have any concept like ‘target vsync’, meaning that if multiple images become active within one vsync period, then only the last image will actually be displayed.

By default, the driver retains an active image until a new image becomes active. However, setting a layer’s ImageConfig with SetLayerPrimaryConfig resets the layer’s active and pending images, even if the new ImageConfig matches the old ImageConfig.

An image cannot be used for multiple layers simultaneously, nor can an image be given back to the display coordinator while it is still in use. An image is considered in use when it is part of a pending configuration or from when its configuration is applied until it is replaced by a subsequent configuration that is displayed (not merely applied).

It is illegal to call this with an invalid layer or image id, to call it on a color layer, or to call it with an image and layer whose ImageConfigs do not match. It is illegal to apply a configuration with an image layer that has no image (note that is is not illegal to validate such a configuration). It is illegal to reuse a wait event which another layer that has not been presented is waiting on.

Source

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

Attempts to validate the current configuration.

When CheckConfig is called, the driver will validate the pending configuration. If res is UNSUPPORTED_CONFIG, then ops will be non-empty.

Most SetX operations require revalidating the configuration. The following operations do not require revalidation.

  • SetLayerImage2()

If discard is true, the pending changes will be discarded after validation.

Source

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

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

If 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 get_latest_applied_config_stamp( &self, ) -> QueryResponseFut<ConfigStamp, DefaultFuchsiaResourceDialect>

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_config3( &self, payload: CoordinatorApplyConfig3Request, ) -> Result<(), Error>

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

If 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>

Sets whether or not vsync events will be given to this client. Defaults to false.

Source

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

This API is used by the client to acknowledge receipt of vsync messages. The cookie sent should match the cookie received via vsync message (OnVsync). A cookie can only be acknowledged once. Using invalid cookies, or previously acknowledged cookies will not be accepted by the driver.

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, DefaultFuchsiaResourceDialect>

Import a sysmem buffer collection token. buffer_collection_id must not already be in use.

Source

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

Release an imported buffer collection.

Source

pub fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, buffer_usage: &ImageBufferUsage, ) -> QueryResponseFut<CoordinatorSetBufferCollectionConstraintsResult, DefaultFuchsiaResourceDialect>

Takes an imported buffer collection and sets the constraints on it so that it can be imported with a specific config.

Source

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

Returns true if Capture is supported on the platform.

Source

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

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, DefaultFuchsiaResourceDialect>

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, DefaultFuchsiaResourceDialect>

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

Source§

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

Source§

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

Source§

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

Source§

type GetLatestAppliedConfigStampResponseFut = QueryResponseFut<ConfigStamp>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn import_image( &self, image_metadata: &ImageMetadata, 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>

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_metadata: &ImageMetadata, ) -> Result<(), Error>

Source§

fn set_layer_primary_position( &self, layer_id: &LayerId, image_source_transformation: CoordinateTransformation, image_source: &RectU, display_destination: &RectU, ) -> 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, color: &Color, ) -> Result<(), Error>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn apply_config3( &self, payload: CoordinatorApplyConfig3Request, ) -> 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>

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>

Source§

fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, buffer_usage: &ImageBufferUsage, ) -> Self::SetBufferCollectionConstraintsResponseFut

Source§

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

Source§

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

Source§

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

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

Source§

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<'_, Unowned<'_, Handle>>

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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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
§

impl<T> ProxyHasClient for T
where T: Proxy,

§

fn client(&self) -> Result<ZirconClient, Infallible>

Get a “client” for this proxy. This is just an object which has methods for a few common handle creation operations.
Source§

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

Source§

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>,

Source§

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>,

Source§

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