Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.display

PROTOCOLS

Controller

Defined in fuchsia.hardware.display/display-controller.fidl

Interface for accessing the display hardware.

A display configuration can be separated into two parts: the layer layout and the layer contents. The layout includes all parts of a configuration other than the image handles. The active configuration is composed of the most recently applied layout and an active image from each layer - see SetLayerImage for details on how the active image is defined. Note the requirement that each layer has an active image. Whenever a new active configuration is available, it is immediately given to the hardware. This allows the layout and each layer's contents to advance independently when possible.

Performing illegal actions on the interface will result in the interface being closed.

AcknowledgeVsync

Request

NameType
cookie uint64

ApplyConfig

Request

NameType

CheckConfig

Request

NameType
discard bool

Response

NameType
res ConfigResult
ops vector<ClientCompositionOp>

CreateLayer

Request

NameType

Response

NameType
res zx/status
layer_id uint64

DestroyLayer

Request

NameType
layer_id uint64

EnableVsync

Request

NameType
enable bool

GetSingleBufferFramebuffer

Request

NameType

Response

NameType
res zx/status
vmo handle<vmo>?
stride uint32

ImportBufferCollection

Request

NameType
collection_id uint64
collection_token fuchsia.sysmem/BufferCollectionToken

Response

NameType
res zx/status

ImportEvent

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.

Request

NameType
event handle<event>
id uint64

ImportGammaTable

Import a gamma table for display calibration.

Each array is a quantized representation of the gamma curve for a single color channel. An input luminance in [0.0, 1.0] is mapped to an index between 0-255, and the value in the array is used as the output luminance. Rounding behavior is hardware-specific, and most often it will floor(input * 255.0), requiring an input luminance of 1.0 to get the max output luminance.

It is an error to use output luminances outside of [0.0, 1.0]. Hardware drivers may either clamp such values or disconnect a client that provides invalid tables.

Request

NameType
gamma_table_id uint64
r float32[256]
g float32[256]
b float32[256]

ImportImage

Request

NameType
image_config ImageConfig
collection_id uint64
index uint32

Response

NameType
res zx/status
image_id uint64

ImportImageForCapture

Imports a buffer collection backed VMO into the display controller. The VMO will be used by display controller to capture the image being displayed. Returns ZX_OK along with an image_id. image_id must be used by the client to start capture and/or release resources allocated for capture. Returns ZX_ERR_NOT_SUPPORTED if controller does not support capture

Request

NameType
image_config ImageConfig
collection_id uint64
index uint32

Response

NameType
result Controller_ImportImageForCapture_Result

ImportVmoImage

Request

NameType
image_config ImageConfig
vmo handle<vmo>
offset int32

Response

NameType
res zx/status
image_id uint64

IsCaptureSupported

Returns true if Capture is supported on the platform.

Request

NameType

Response

NameType
result Controller_IsCaptureSupported_Result

OnClientOwnershipChange

Response

NameType
has_ownership bool

OnDisplaysChanged

Response

NameType
added vector<Info>
removed vector<uint64>

OnVsync

Response

NameType
display_id uint64
timestamp uint64
images vector<uint64>
cookie uint64

ReleaseBufferCollection

Request

NameType
collection_id uint64

ReleaseCapture

Releases resources allocated for capture. Returns ZX_ERR_NOT_SUPPORTED if controller does not support capture

Request

NameType
image_id uint64

Response

NameType
result Controller_ReleaseCapture_Result

ReleaseEvent

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.

Request

NameType
id uint64

ReleaseGammaTable

Release an imported gamma table.

Subsequent calls to SetDisplayGammaTable cannot reference this table. It is legal to re-use the gamma_table_id after making this call. Releasing a table while it is set on a display is safe, and will not modify the output of the display.

Request

NameType
gamma_table_id uint64

ReleaseImage

Request

NameType
image_id uint64

SetBufferCollectionConstraints

Request

NameType
collection_id uint64
config ImageConfig

Response

NameType
res zx/status

SetDisplayColorConversion

Request

NameType
display_id uint64
preoffsets float32[3]
coefficients float32[9]
postoffsets float32[3]

SetDisplayGammaTable

Set the gamma correction table for a display.

gamma_table_id must be a table registered with ImportGammaTable. It is safe to release a gamma table after using it here, and will not modify display output.

Request

NameType
display_id uint64
gamma_table_id uint64

SetDisplayLayers

Request

NameType
display_id uint64
layer_ids vector<uint64>

SetDisplayMode

Request

NameType
display_id uint64
mode Mode

SetLayerColorConfig

Request

NameType
layer_id uint64
pixel_format uint32
color_bytes vector<uint8>

SetLayerCursorConfig

Request

NameType
layer_id uint64
image_config ImageConfig

SetLayerCursorPosition

Request

NameType
layer_id uint64
x int32
y int32

SetLayerImage

Request

NameType
layer_id uint64
image_id uint64
wait_event_id uint64
signal_event_id uint64

SetLayerPrimaryAlpha

Request

NameType
layer_id uint64
mode AlphaMode
val float32

SetLayerPrimaryConfig

Request

NameType
layer_id uint64
image_config ImageConfig

SetLayerPrimaryPosition

Request

NameType
layer_id uint64
transform Transform
src_frame Frame
dest_frame Frame

SetMinimumRgb

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.

Request

NameType
minimum_rgb uint8

Response

NameType
result Controller_SetMinimumRgb_Result

SetVirtconMode

Request

NameType
mode uint8

StartCapture

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 controller does not support capture

Request

NameType
signal_event_id uint64
image_id uint64

Response

NameType
result Controller_StartCapture_Result

Provider

Defined in fuchsia.hardware.display/display-controller.fidl

Provider for display controllers.

The driver supports two simultaneous clients - a primary client and a virtcon client. In some cases, the provider service may provide access to only one or the other; if the client tries to open the other then ZX_ERR_NOT_SUPPORTED will be returned.

OpenController

Open a primary client. device should be a handle to one endpoint of a channel that (on success) will become an open connection to a new instance of a display client device. A protocol request controller provides an interface to the Controller for the new device. Closing the connection to device will also close the controller interface. If the display device already has a primary controller then this method will return ZX_ERR_ALREADY_BOUND.

Request

NameType
device handle<channel>
controller request<Controller>

Response

NameType
s zx/status

OpenVirtconController

Open a virtcon client. device should be a handle to one endpoint of a channel that (on success) will become an open connection to a new instance of a display client device. A protocol request controller provides an interface to the Controller for the new device. Closing the connection to device will also close the controller interface. If the display device already has a virtcon controller then this method will return ZX_ERR_ALREADY_BOUND.

Request

NameType
device handle<channel>
controller request<Controller>

Response

NameType
s zx/status

STRUCTS

ClientCompositionOp

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
display_id uint64

display_id and layer_id uniquely identify the subject of the opcode.

No default
layer_id uint64

layer_id is 0 for whole-display issues like unsupported color conversion and gamma tables.

No default
opcode ClientCompositionOpcode No default

Controller_ImportImageForCapture_Response

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
image_id uint64 No default

Controller_IsCaptureSupported_Response

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
supported bool No default

Controller_ReleaseCapture_Response

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault

Controller_SetMinimumRgb_Response

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault

Controller_StartCapture_Response

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault

CursorInfo

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
width uint32 No default
height uint32 No default
pixel_format uint32 No default

Frame

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
x_pos uint32 No default
y_pos uint32 No default
width uint32 No default
height uint32 No default

ImageConfig

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
width uint32 No default
height uint32 No default
pixel_format uint32 No default
type uint32 TYPE_SIMPLE

Info

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
id uint64 No default
modes vector<Mode> No default
pixel_format vector<uint32> No default
cursor_configs vector<CursorInfo> No default
manufacturer_name string[128] No default
monitor_name string[128] No default
monitor_serial string[128] No default
horizontal_size_mm uint32

Physical horizontal size in millimeters. If this value is not available, set to a best guess value and set the flag

No default
vertical_size_mm uint32

Physical vertical size in millimeters If this value is not available, set to a best guess value and set the flag

No default
using_fallback_size bool

This flag is set if fallback horizontal and vertical sizes were used as opposed to actual values reported by the display.

No default

Mode

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescriptionDefault
horizontal_resolution uint32 No default
vertical_resolution uint32 No default
refresh_rate_e2 uint32 No default
flags uint32 No default

ENUMS

AlphaMode

Type: uint8

Defined in fuchsia.hardware.display/display-controller.fidl

NameValueDescription
DISABLE 0
PREMULTIPLIED 1
HW_MULTIPLY 2

ClientCompositionOpcode

Type: uint8

Defined in fuchsia.hardware.display/display-controller.fidl

NameValueDescription
CLIENT_USE_PRIMARY 0
CLIENT_MERGE_BASE 1
CLIENT_MERGE_SRC 2
CLIENT_FRAME_SCALE 3
CLIENT_SRC_FRAME 4
CLIENT_TRANSFORM 5
CLIENT_COLOR_CONVERSION 6
CLIENT_ALPHA 7
CLIENT_GAMMA 8

ConfigResult

Type: uint32

Defined in fuchsia.hardware.display/display-controller.fidl

NameValueDescription
OK 0
INVALID_CONFIG 1
UNSUPPORTED_CONFIG 2
TOO_MANY_DISPLAYS 3
UNSUPPORTED_DISPLAY_MODES 4

Transform

Type: uint8

Defined in fuchsia.hardware.display/display-controller.fidl

NameValueDescription
IDENTITY 0
REFLECT_X 1
REFLECT_Y 2
ROT_90 3
ROT_180 4
ROT_270 5
ROT_90_REFLECT_X 6
ROT_90_REFLECT_Y 7

VirtconMode

Type: uint8

Defined in fuchsia.hardware.display/display-controller.fidl

NameValueDescription
INACTIVE 0
FALLBACK 1
FORCED 2

UNIONS

Controller_ImportImageForCapture_Result

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescription
response Controller_ImportImageForCapture_Response
err zx/status

Controller_IsCaptureSupported_Result

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescription
response Controller_IsCaptureSupported_Response
err zx/status

Controller_ReleaseCapture_Result

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescription
response Controller_ReleaseCapture_Response
err zx/status

Controller_SetMinimumRgb_Result

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescription
response Controller_SetMinimumRgb_Response
err zx/status

Controller_StartCapture_Result

Defined in fuchsia.hardware.display/display-controller.fidl

NameTypeDescription
response Controller_StartCapture_Response
err zx/status

CONSTANTS

NameValueTypeDescription
IDENTIFIER_MAX_LEN 128 uint32
INVALID_DISP_ID 0 uint64
MODE_INTERLACED 1 int32
TYPE_CAPTURE 10 uint32
TYPE_SIMPLE 0 uint32