pub struct CoordinatorProxy { /* private fields */ }
Implementations§
source§impl CoordinatorProxy
impl CoordinatorProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.display/Coordinator.
sourcepub fn take_event_stream(&self) -> CoordinatorEventStream
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.
sourcepub fn import_image(
&self,
image_metadata: &ImageMetadata,
buffer_id: &BufferId,
image_id: &ImageId
) -> QueryResponseFut<CoordinatorImportImageResult>
pub fn import_image( &self, image_metadata: &ImageMetadata, buffer_id: &BufferId, image_id: &ImageId ) -> QueryResponseFut<CoordinatorImportImageResult>
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()
.
sourcepub fn release_image(&self, image_id: &ImageId) -> Result<(), Error>
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.
sourcepub fn import_event(&self, event: Event, id: &EventId) -> Result<(), Error>
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.
sourcepub fn release_event(&self, id: &EventId) -> Result<(), Error>
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.
pub fn create_layer(&self) -> QueryResponseFut<CoordinatorCreateLayerResult>
pub fn destroy_layer(&self, layer_id: &LayerId) -> Result<(), Error>
pub fn set_display_mode( &self, display_id: &DisplayId, mode: &Mode ) -> Result<(), Error>
pub fn set_display_color_conversion( &self, display_id: &DisplayId, preoffsets: &[f32; 3], coefficients: &[f32; 9], postoffsets: &[f32; 3] ) -> Result<(), Error>
pub fn set_display_layers( &self, display_id: &DisplayId, layer_ids: &[LayerId] ) -> Result<(), Error>
pub fn set_layer_primary_config( &self, layer_id: &LayerId, image_metadata: &ImageMetadata ) -> Result<(), Error>
pub fn set_layer_primary_position( &self, layer_id: &LayerId, transform: Transform, src_frame: &Frame, dest_frame: &Frame ) -> Result<(), Error>
pub fn set_layer_primary_alpha( &self, layer_id: &LayerId, mode: AlphaMode, val: f32 ) -> Result<(), Error>
pub fn set_layer_color_config( &self, layer_id: &LayerId, pixel_format: PixelFormat, color_bytes: &[u8] ) -> Result<(), Error>
pub fn set_layer_image( &self, layer_id: &LayerId, image_id: &ImageId, wait_event_id: &EventId, signal_event_id: &EventId ) -> Result<(), Error>
pub fn check_config( &self, discard: bool ) -> QueryResponseFut<(ConfigResult, Vec<ClientCompositionOp>)>
pub fn apply_config(&self) -> Result<(), Error>
sourcepub fn get_latest_applied_config_stamp(&self) -> QueryResponseFut<ConfigStamp>
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
.
sourcepub fn apply_config2(&self, signal_fences: Vec<Event>) -> Result<(), Error>
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().
pub fn enable_vsync(&self, enable: bool) -> Result<(), Error>
pub fn acknowledge_vsync(&self, cookie: u64) -> Result<(), Error>
sourcepub fn set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), Error>
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.
pub fn import_buffer_collection( &self, buffer_collection_id: &BufferCollectionId, buffer_collection_token: ClientEnd<BufferCollectionTokenMarker> ) -> QueryResponseFut<CoordinatorImportBufferCollectionResult>
pub fn release_buffer_collection( &self, buffer_collection_id: &BufferCollectionId ) -> Result<(), Error>
pub fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, buffer_usage: &ImageBufferUsage ) -> QueryResponseFut<CoordinatorSetBufferCollectionConstraintsResult>
sourcepub fn is_capture_supported(
&self
) -> QueryResponseFut<CoordinatorIsCaptureSupportedResult>
pub fn is_capture_supported( &self ) -> QueryResponseFut<CoordinatorIsCaptureSupportedResult>
Returns true if Capture is supported on the platform.
sourcepub fn start_capture(
&self,
signal_event_id: &EventId,
image_id: &ImageId
) -> QueryResponseFut<CoordinatorStartCaptureResult>
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
sourcepub fn set_minimum_rgb(
&self,
minimum_rgb: u8
) -> QueryResponseFut<CoordinatorSetMinimumRgbResult>
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.
sourcepub fn set_display_power(
&self,
display_id: &DisplayId,
power_on: bool
) -> QueryResponseFut<CoordinatorSetDisplayPowerResult>
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
impl Clone for CoordinatorProxy
source§fn clone(&self) -> CoordinatorProxy
fn clone(&self) -> CoordinatorProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CoordinatorProxyInterface for CoordinatorProxy
impl CoordinatorProxyInterface for CoordinatorProxy
type ImportImageResponseFut = QueryResponseFut<Result<(), i32>>
fn import_image( &self, image_metadata: &ImageMetadata, buffer_id: &BufferId, image_id: &ImageId ) -> Self::ImportImageResponseFut
fn release_image(&self, image_id: &ImageId) -> Result<(), Error>
fn import_event(&self, event: Event, id: &EventId) -> Result<(), Error>
fn release_event(&self, id: &EventId) -> Result<(), Error>
type CreateLayerResponseFut = QueryResponseFut<Result<LayerId, i32>>
fn create_layer(&self) -> Self::CreateLayerResponseFut
fn destroy_layer(&self, layer_id: &LayerId) -> Result<(), Error>
fn set_display_mode( &self, display_id: &DisplayId, mode: &Mode ) -> Result<(), Error>
fn set_display_color_conversion( &self, display_id: &DisplayId, preoffsets: &[f32; 3], coefficients: &[f32; 9], postoffsets: &[f32; 3] ) -> Result<(), Error>
fn set_display_layers( &self, display_id: &DisplayId, layer_ids: &[LayerId] ) -> Result<(), Error>
fn set_layer_primary_config( &self, layer_id: &LayerId, image_metadata: &ImageMetadata ) -> Result<(), Error>
fn set_layer_primary_position( &self, layer_id: &LayerId, transform: Transform, src_frame: &Frame, dest_frame: &Frame ) -> Result<(), Error>
fn set_layer_primary_alpha( &self, layer_id: &LayerId, mode: AlphaMode, val: f32 ) -> Result<(), Error>
fn set_layer_color_config( &self, layer_id: &LayerId, pixel_format: PixelFormat, color_bytes: &[u8] ) -> Result<(), Error>
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>)>
fn check_config(&self, discard: bool) -> Self::CheckConfigResponseFut
fn apply_config(&self) -> Result<(), Error>
type GetLatestAppliedConfigStampResponseFut = QueryResponseFut<ConfigStamp>
fn get_latest_applied_config_stamp( &self ) -> Self::GetLatestAppliedConfigStampResponseFut
fn apply_config2(&self, signal_fences: Vec<Event>) -> Result<(), Error>
fn enable_vsync(&self, enable: bool) -> Result<(), Error>
fn acknowledge_vsync(&self, cookie: u64) -> Result<(), Error>
fn set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), Error>
type ImportBufferCollectionResponseFut = QueryResponseFut<Result<(), i32>>
fn import_buffer_collection( &self, buffer_collection_id: &BufferCollectionId, buffer_collection_token: ClientEnd<BufferCollectionTokenMarker> ) -> Self::ImportBufferCollectionResponseFut
fn release_buffer_collection( &self, buffer_collection_id: &BufferCollectionId ) -> Result<(), Error>
type SetBufferCollectionConstraintsResponseFut = QueryResponseFut<Result<(), i32>>
fn set_buffer_collection_constraints( &self, buffer_collection_id: &BufferCollectionId, buffer_usage: &ImageBufferUsage ) -> Self::SetBufferCollectionConstraintsResponseFut
type IsCaptureSupportedResponseFut = QueryResponseFut<Result<bool, i32>>
fn is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut
type StartCaptureResponseFut = QueryResponseFut<Result<(), i32>>
fn start_capture( &self, signal_event_id: &EventId, image_id: &ImageId ) -> Self::StartCaptureResponseFut
type SetMinimumRgbResponseFut = QueryResponseFut<Result<(), i32>>
fn set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut
type SetDisplayPowerResponseFut = QueryResponseFut<Result<(), i32>>
fn set_display_power( &self, display_id: &DisplayId, power_on: bool ) -> Self::SetDisplayPowerResponseFut
source§impl Debug for CoordinatorProxy
impl Debug for CoordinatorProxy
source§impl Proxy for CoordinatorProxy
impl Proxy for CoordinatorProxy
§type Protocol = CoordinatorMarker
type Protocol = CoordinatorMarker
Proxy
controls.