Enumerations

enum class VideoInputModuleId
Name Value
kVideoInputModule0 0
kVideoInputModule1 1

There are two video input modules (VDIN) in Amlogic display engine that

receive video from external input (e.g. BT.656) or internal input (e.g.

internal VIU loopback), and write the data back to the DDR memory.

Defined at line 20 of file ../../src/graphics/display/drivers/amlogic-display/video-input-regs.h

enum viu_type
Name Value
VIU_ENCL 0
VIU_ENCI 1
VIU_ENCP 2
VIU_ENCT 3

Defined at line 21 of file ../../src/graphics/display/drivers/amlogic-display/hdmi-host.h

enum class HdmiTransmitterControllerCall : uint8_t
Name Value
kConfigHdmitx 0
kSetupInterrupts 1
kReset 2
kSetupScdc 3
kResetFc 4
kSetFcScramblerCtrl 5

Defined at line 24 of file ../../src/graphics/display/drivers/amlogic-display/hdmi-transmitter-test.cc

enum DsiOpcode : uint8_t
Name Value Comments
kDsiOpGpio 0xf0

Drive a GPIO pin.

<op
>
<size
=2|3>
<gpio
_id=0>
<value
> [delay_ms]

gpio_id 0 is connected to the RESX (LCD RESET) pin. All other IDs are
invalid.

DSI packet types ending in 0b0000 are reserved, so this opcode will not
overlap any valid DSI packet DI (Data Identifier) value.

kDsiOpReadReg 0xfc

Attempt to read `count` values from the MIPI-DSI register at `address`.

<op
>
<size
=2>
<address
>
<count
=1|2|3|4>

This opcode overlaps the DSI packet DI (Data Identifier) value for "Packed
Pixel Stream, 20-bit YCbCr, 4:2:2 Format" data type, Virtual Channel 3.

TODO(https://fxbug.dev/322438328): Support reading larger-sized registers.

kDsiOpDelay 0xfd

Odd extended delay command to take several delays and gather them into
one big sleep. Behaves as an exit if byte 1 is 0xff or 0x0.

<op
>
<size
>
<sleep
_ms_1>
<sleep
_ms_2> ...
<sleep
_ms_N>

This opcode overlaps the DSI packet DI (Data Identifier) value for "Packed
Pixel Stream, 12-bit YCbCr, 4:2:0 Format" data type, Virtual Channel 3.

kDsiOpSleep 0xff

Simple sleep for N millis, or exit if N=0xff || N=0x0.

<op
>
<sleep
_ms>

DSI packet types ending in 0b1111 are reserved, so this opcode will not
overlap any valid DSI packet DI (Data Identifier) value.

DSI packet DI (Data Identifier) values that convey special operations.

The values here share a namespace with valid DSI DIs, described by Section

8.5.1 "Data Identifier Byte" and Section 8.7 "Processor to Peripheral

Direction (Processor-Sourced) Packet Data Types" of the DSI spec.

Defined at line 25 of file ../../src/graphics/display/drivers/amlogic-display/panel-config.h

enum class ColorSpaceConversionMode
Name Value
kRgbInternalRgbOut 0
kRgbInternalYuvOut 1

Mode of color space conversion from the internal Video Input Unit (VIU) to

the Video output module (Vout) by the Video Post Processor (VPP).

Defined at line 26 of file ../../src/graphics/display/drivers/amlogic-display/vpu.h

enum class HotPlugDetectionState : uint8_t
Name Value Comments
kNotDetected 0

No display is attached.

kDetected 1

A display is attached.

The logical state of a Hot-Plug Detect pin.

Defined at line 27 of file ../../src/graphics/display/drivers/amlogic-display/hot-plug-detection.h

enum class VoutType : uint8_t
Name Value
kDsi 0
kHdmi 1

Defined at line 29 of file ../../src/graphics/display/drivers/amlogic-display/vout.h

enum class EncoderBuiltInSelfTestMode : uint8_t
Name Value Comments
kFixedColor 0

Outputs a fixed color specified by the following registers:
- EncoderBuiltInSelfTestFixedColorLuminance
- EncoderBuiltInSelfTestFixedColorChrominanceBlue
- EncoderBuiltInSelfTestFixedColorChrominanceRed

kColorBar 1

Outputs color bars with 100% and 75% luminance (intensity), also known as
100/75 color bars.

kThinLines 2

Outputs thin horizontal and vertical lines on the screen.

kDotGrid 3

Outputs a grid of white dots on the display.

Defined at line 39 of file ../../src/graphics/display/drivers/amlogic-display/encoder-regs.h

enum PowerOpcode : uint8_t
Name Value Comments
kPowerOpGpio 0

Drive a GPIO pin.

kPowerOpSignal 2

Turn the device on/off.

kPowerOpAwaitGpio 4

Wait for a GPIO input to reach a value.

kPowerOpExit 0xff

Wait for a GPIO input to reach a value.

Defined at line 72 of file ../../src/graphics/display/drivers/amlogic-display/panel-config.h

enum class BtiResourceIndex : uint8_t
Name Value Comments
kDma 0

BTI used for CANVAS / DMA transfers.

The resource ordering in the board driver's `display_btis` table.

Defined at line 105 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.h

enum class SecureMonitorCallResourceIndex : uint8_t
Name Value Comments
kSiliconProvider 0

SMC used to initialize HDCP.

The resource ordering in the board driver's `kDisplaySmcs` table.

Defined at line 119 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.h

enum class VideoClock
Name Value
kVideoClock1 1
kVideoClock2 2

Video clock tree has two muxes for input signals, named video clock 1 / mux 1

(VID_CLK) and video clock 2 / mux 2 (VIID_CLK / V2).

Each video clock mux is followed by a programmable divisor (/N0 for mux 1

and /N2 for mux 2) and then multiple fixed divisors (/2, /4, /6 and /12).

Each encoder / HDMI transmitter / video digital-to-analog converter (DAC)

clock signal has its own mux, to select a clock from those provided by the

above divisors.

The output of video clock 1 is also used to generate the timing

controller signal and LCD analog clocks.

Defined at line 129 of file ../../src/graphics/display/drivers/amlogic-display/clock-regs.h

enum class VideoClockMuxSource : uint32_t
Name Value Comments
kVideoPll 0

vid_pll

kGeneralPurpose0Pll 1

gp0_pll

kHifiPll 2

hifi_pll

kMpll1 3

mp1_clk

kFixed666Mhz 4

fclk_div3

kFixed500Mhz 5

fclk_div4

kFixed400Mhz 6

fclk_div5

kFixed285_7Mhz 7

fclk_div7

Selection of video clock muxes.

The mux value

<

-> clock source mapping is shown in the following diagram

of the Amlogic datasheets:

A311D Datasheet, Figure 8-13 "Video Clock Tree", Section 8.7.1.4 EE Clock

Tree, Page 114.

S905D2 Datasheet, Figure 6-12 "Video Clock Tree", Section 6.6.2.4 EE Clock

Tree, Page 98.

S905D3 Datasheet, Figure 6-13 "Video Clock Tree", Section 6.7.2.4 EE Clock

Tree, Page 99.

Defined at line 144 of file ../../src/graphics/display/drivers/amlogic-display/clock-regs.h

enum class EncoderClockSource : uint32_t
Name Value Comments
kVideoClock1 0

"VideoClock1" is first divided by the programmable divider "/N0" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 1 input) / (N0) / (1, 2, 4, 16, or 12)

kVideoClock1Div2 1

"VideoClock1" is first divided by the programmable divider "/N0" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 1 input) / (N0) / (1, 2, 4, 16, or 12)

kVideoClock1Div4 2

"VideoClock1" is first divided by the programmable divider "/N0" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 1 input) / (N0) / (1, 2, 4, 16, or 12)

kVideoClock1Div6 3

"VideoClock1" is first divided by the programmable divider "/N0" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 1 input) / (N0) / (1, 2, 4, 16, or 12)

kVideoClock1Div12 4

"VideoClock1" is first divided by the programmable divider "/N0" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 1 input) / (N0) / (1, 2, 4, 16, or 12)

kVideoClock2 8

"VideoClock2" is first divided by the programmable divider "/N2" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 2 input) / (N2) / (1, 2, 4, 16, or 12)

kVideoClock2Div2 9

"VideoClock2" is first divided by the programmable divider "/N2" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 2 input) / (N2) / (1, 2, 4, 16, or 12)

kVideoClock2Div4 10

"VideoClock2" is first divided by the programmable divider "/N2" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 2 input) / (N2) / (1, 2, 4, 16, or 12)

kVideoClock2Div6 11

"VideoClock2" is first divided by the programmable divider "/N2" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 2 input) / (N2) / (1, 2, 4, 16, or 12)

kVideoClock2Div12 12

"VideoClock2" is first divided by the programmable divider "/N2" before
being divided by the fixed divider. So the actual frequency is
(Selected Video Clock 2 input) / (N2) / (1, 2, 4, 16, or 12)

Selection of video clock and dividers for encoder clock muxes.

The mux value

<

-> clock source mapping is shown in the following diagram

of the Amlogic datasheets:

A311D Datasheet, Figure 8-13 "Video Clock Tree", Section 8.7.1.4 EE Clock

Tree, Page 114.

S905D2 Datasheet, Figure 6-12 "Video Clock Tree", Section 6.6.2.4 EE Clock

Tree, Page 98.

S905D3 Datasheet, Figure 6-13 "Video Clock Tree", Section 6.7.2.4 EE Clock

Tree, Page 99.

Defined at line 165 of file ../../src/graphics/display/drivers/amlogic-display/clock-regs.h

enum class MemoryPowerDomainMode
Name Value
kPoweredOff 0b11
kPoweredOn 0b00

A311D datasheet Section 8.7.5 "Clock" > "Register Description", register

HHI_VPU_MEM_PD_REG0, field "Deinterlacer - di_post", page 144

S905D2 datasheet Section 6.6.6 "Clock" > "Register Description", register

HHI_VPU_MEM_PD_REG0, field "Deinterlacer - di_post" page 130

S905Y4 datasheet Section 7.2.1 "Overview", list item "MEMPD", page 52

Defined at line 189 of file ../../src/graphics/display/drivers/amlogic-display/power-regs.h

enum class WritebackMuxSource : uint32_t
Name Value Comments
kDisabled 0b00000

Disable the input path. A required intermediate step for changing input
sources.

kEncoderInterlaced 0b00001

VIU ENCI domain.

kEncoderProgressive 0b00010

VIU ENCP domain.

kEncoderTvPanel 0b00100

VIU ENCT domain.

kViuWriteback0 0b01000

Also known as "VIU writeback domain 1" in S905D3 datasheets.

kViuWriteback1 0b10000

Also known as "VIU writeback domain 2" in S905D3 datasheets.

Selects the clock or data source for a writeback mux.

Fields of this type must transition through `kDisabled` when being updated.

Defined at line 355 of file ../../src/graphics/display/drivers/amlogic-display/video-input-regs.h

enum FifoWordsPerBurst
Name Value
Burst1 0x0
Burst2 0x1
Burst4 0x2
BurstInvalid 0x3

Defined at line 418 of file ../../src/graphics/display/drivers/amlogic-display/vpu-regs.h

enum class HdmiClockTreePatternGeneratorModeSource : uint32_t
Name Value Comments
kRepeated12BitPattern 0

Source 0: Repeating the lower 12 bits of the provided pattern.

kRepeated14BitPattern 1

Source 1: Repeating the lower 14 bits of the provided pattern.

kRepeated15BitPattern 2

Source 2: Repeating the lower 15 bits of the provided pattern.

kFixed25BitPattern 3

Source 3: Repeating a fixed 25-bit pattern:
(MSB) 111 000 111 000 111 000 1111 000 (LSB)

Values for the `pattern_generator_mode_selection` field in `HdmiClockTreeControl`.

Defined at line 1018 of file ../../src/graphics/display/drivers/amlogic-display/clock-regs.h

Records

Functions

  • display::Mode ToDisplayMode (const display::DisplayTiming & timing)

    Defined at line 15 of file ../../src/graphics/display/drivers/amlogic-display/display-timing-mode-conversion.h

  • void LogDisplayTiming (const display::DisplayTiming & display_timing)

    Log contents of `display::DisplayTiming` to INFO level system log.

    Defined at line 16 of file ../../src/graphics/display/drivers/amlogic-display/logging.cc

  • zx::result<BoardInfo> GetBoardInfo (fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> platform_device)

    Typesafe wrapper for [`fuchsia.hardware.platform.device/Device.GetBoardInfo`].

    `platform_device` must be valid.

    If the result is successful, the fields in BoardInfo are guaranteed to be

    valid.

    Defined at line 18 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.cc

  • uint32_t ToU28_4 (double value)

    Lossless conversion from a floating-point number `value` to a U28.4 fixed

    point number.

    The Um.n notation is defined in:

    https://source.android.com/docs/core/audio/data_formats#q.

    The function will error on values that doesn't fit in a U28.4 fixed-point

    number.

    TODO(https://fxbug.dev/42064981): In C++20 this can be consteval.

    Defined at line 25 of file ../../src/graphics/display/drivers/amlogic-display/fixed-point-util.h

  • template <typename T>
    uint8_t NsToLaneByte (T x, int64_t lanebytetime)

    Defined at line 26 of file ../../src/graphics/display/drivers/amlogic-display/mipi-phy.cc

  • bool operator== (const PixelGridSize2D & a, const PixelGridSize2D & b)

    Defined at line 35 of file ../../src/graphics/display/drivers/amlogic-display/pixel-grid-size2d.h

  • bool operator!= (const PixelGridSize2D & a, const PixelGridSize2D & b)

    Defined at line 39 of file ../../src/graphics/display/drivers/amlogic-display/pixel-grid-size2d.h

  • uint32_t ToU28_4 (int value)

    Lossless conversion from an integer `value` to a U28.4 fixed point number.

    The Um.n notation is defined in:

    https://source.android.com/docs/core/audio/data_formats#q.

    The function will error on values that doesn't fit in a U28.4 fixed-point

    number.

    TODO(https://fxbug.dev/42064981): In C++20 this can be consteval.

    Defined at line 41 of file ../../src/graphics/display/drivers/amlogic-display/fixed-point-util.h

  • void LogPanelConfig (const PanelConfig & panel_config)

    Log contents of `PanelConfig` to INFO level system log.

    Defined at line 47 of file ../../src/graphics/display/drivers/amlogic-display/logging.cc

  • zx::result<fdf::MmioBuffer> MapMmio (std::string_view mmio_name, fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> platform_device)

    Typesafe wrapper for [`fuchsia.hardware.platform.device/Device.GetMmioByName`].

    `platform_device` must be valid.

    If the result is successful, the MmioBuffer is guaranteed to be valid.

    Defined at line 47 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.cc

  • double U28_4ToDouble (uint32_t u28_4)

    Converts a U28.4 fixed point number `u28_4` used in HdmiClockTreeControl::

    SetFrequencyDivider.

    The Um.n notation is defined in:

    https://source.android.com/docs/core/audio/data_formats#q.

    TODO(https://fxbug.dev/42064981): In C++20 this can be consteval.

    Defined at line 55 of file ../../src/graphics/display/drivers/amlogic-display/fixed-point-util.h

  • size_t RdmaRegionSize ()

    RDMA Region size (AFBC and non-AFBC)

    Defined at line 80 of file ../../src/graphics/display/drivers/amlogic-display/rdma.h

  • zx::result<zx::interrupt> GetInterrupt (std::string_view interrupt_name, fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> platform_device)

    Typesafe wrappers for [`fuchsia.hardware.platform.device/Device.GetInterruptByName`].

    `platform_device` must be valid. Note that interrupts retrieved via this function will

    be created using the ZX_INTERRUPT_MODE_EDGE_HIGH and ZX_INTERRUPT_TIMESTAMP_MONO flags.

    If the result is successful, the zx::interrupt is guaranteed to be valid.

    Defined at line 80 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.cc

  • zx::result<zx::bti> GetBti (BtiResourceIndex bti_index, fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> platform_device)

    Typesafe wrapper for [`fuchsia.hardware.platform.device/Device.GetBtiById`].

    `platform_device` must be valid.

    If the result is successful, the zx::bti is guaranteed to be valid.

    Defined at line 104 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.cc

  • zx::result<zx::resource> GetSecureMonitorCall (SecureMonitorCallResourceIndex secure_monitor_call_index, fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> platform_device)

    Typesafe wrapper for [`fuchsia.hardware.platform.device/Device.GetSmcById`].

    `platform_device` must be valid.

    If the result is successful, the zx::resource is guaranteed to be valid and

    represent a Secure Monitor Call.

    Defined at line 125 of file ../../src/graphics/display/drivers/amlogic-display/board-resources.cc

  • const PanelConfig * GetPanelConfig (display::PanelType panel_type)

    If the `panel_type` is supported, returns the panel configuration.

    Otherwise returns nullptr.

    Defined at line 443 of file ../../src/graphics/display/drivers/amlogic-display/panel-config.cc

  • zx_koid_t GetKoid (zx_handle_t handle)

    Defined at line 1128 of file ../../src/graphics/display/drivers/amlogic-display/display-engine.cc

Variables

const int64_t kExternalOscillatorFrequencyHz

Defined at line 77 of file ../../src/graphics/display/drivers/amlogic-display/dsi.h

const int64_t kMinVoltageControlledOscillatorFrequencyHz

Defined at line 78 of file ../../src/graphics/display/drivers/amlogic-display/dsi.h

const int64_t kMaxVoltageControlledOscillatorFrequencyHz

Defined at line 80 of file ../../src/graphics/display/drivers/amlogic-display/dsi.h

const int64_t kMaxPixelClockFrequencyHz

Defined at line 82 of file ../../src/graphics/display/drivers/amlogic-display/dsi.h