| // Copyright 2023 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.hardware.display; |
| |
| /// Type of the internal value in [`fuchsia.hardware.display/ImageId`]. |
| alias ImageIdValue = uint64; |
| |
| /// Identifies an image resource shared between the Display Coordinator and |
| /// its client. |
| /// |
| /// [`fuchsia.hardware.display/INVALID_DISP_ID`] represents an invalid value. |
| /// |
| /// Values are managed by [`fuchsia.hardware.display/Coordinator`] clients, to |
| /// facilitate feed-forward dataflow. |
| /// |
| /// Valid values uniquely identify imported images within a Display Coordinator |
| /// connection. |
| // TODO(fxbug.dev/130027): Figure out a more accurate description for the |
| // ID uniqueness. |
| type ImageId = struct { |
| value ImageIdValue; |
| }; |
| |
| /// Information about the usage and storage format of an image buffer. |
| /// |
| /// Values other than [`fuchsia.hardware.display/TYPE_SIMPLE`] and |
| /// [`fuchsia.hardware.display/TYPE_CAPTURE`] are an escape hatch. The driver |
| /// and image producer are responsible for agreeing on the meaning of the value, |
| /// through some mechanism outside the scope of this API. |
| alias ImageTypeValue = uint32; |
| |
| /// Default for [`fuchsia.hardware.display/ImageTypeValue`]. |
| const TYPE_SIMPLE ImageTypeValue = 0; |
| |
| // The gap between TYPE_SIMPLE and TYPE_CAPTURE can be used for |
| // platform-specific / driver-specific formats. Eventually, this magic will be |
| // replaced by better primitives for discovering and negotiating image |
| // contracts. |
| |
| /// The image buffer is used by the display engine to store displayed contents. |
| const TYPE_CAPTURE ImageTypeValue = 10; |
| |
| /// Defines how data in an image buffer is interpreted. |
| type ImageConfig = struct { |
| /// Image width, in pixels. |
| width uint32; |
| |
| /// Image height, in pixels. |
| height uint32; |
| |
| @allow_deprecated_struct_defaults |
| type ImageTypeValue = TYPE_SIMPLE; |
| }; |