Xilinx ZynqMP Ultrascale+ DisplayPort Subsystem¶
This subsystem handles DisplayPort video and audio output on the ZynqMP. Itsupports in-memory framebuffers with the DisplayPort DMA controller(xilinx-dpdma), as well as “live” video and audio from the programmable logic(PL). This subsystem can perform several transformations, including color spaceconversion, alpha blending, and audio mixing, although not all features arecurrently supported.
debugfs¶
To support debugging and compliance testing, several test modes can be enabledthough debugfs. The following files in /sys/kernel/debug/dri/X/DP-1/test/control the DisplayPort test modes:
- active:
Writing a 1 to this file will activate test mode, and writing a 0 willdeactivate test mode. Writing a 1 or 0 when the test mode is alreadyactive/inactive will re-activate/re-deactivate test mode. When testmode is inactive, changes made to other files will have no (immediate)effect, although the settings will be saved for when test mode isactivated. When test mode is active, changes made to other files willapply immediately.
- custom:
Custom test pattern value
- downspread:
Enable/disable clock downspreading (spread-spectrum clocking) bywriting 1/0
- enhanced:
Enable/disable enhanced framing
- ignore_aux_errors:
Ignore AUX errors when set to 1. Writes to this file take effectimmediately (regardless of whether test mode is active) and affect allAUX transfers.
- ignore_hpd:
Ignore hotplug events (such as cable removals or monitor linkretraining requests) when set to 1. Writes to this file take effectimmediately (regardless of whether test mode is active).
- laneX_preemphasis:
Preemphasis from 0 (lowest) to 2 (highest) for lane X
- laneX_swing:
Voltage swing from 0 (lowest) to 3 (highest) for lane X
- lanes:
Number of lanes to use (1, 2, or 4)
- pattern:
Test pattern. May be one of:
- video
Use regular video input
- symbol-error
Symbol error measurement pattern
- prbs7
Output of the PRBS7 (x^7 + x^6 + 1) polynomial
- 80bit-custom
A custom 80-bit pattern
- cp2520
HBR2 compliance eye pattern
- tps1
Link training symbol pattern TPS1 (/D10.2/)
- tps2
Link training symbol pattern TPS2
- tps3
Link training symbol pattern TPS3 (for HBR2)
- rate:
Rate in hertz. One of
5400000000 (HBR2)
2700000000 (HBR)
1620000000 (RBR)
You can dump the displayport test settings with the following command:
for prop in /sys/kernel/debug/dri/1/DP-1/test/*; do printf '%-17s ' ${prop##*/} if [ ${prop##*/} = custom ]; then hexdump -C $prop | head -1 else cat $prop fidoneThe output could look something like:
active 1custom 00000000 00 00 00 00 00 00 00 00 00 00 |..........|downspread 0enhanced 1ignore_aux_errors 1ignore_hpd 1lane0_preemphasis 0lane0_swing 3lane1_preemphasis 0lane1_swing 3lanes 2pattern prbs7rate 1620000000
The recommended test procedure is to connect the board to a monitor,configure test mode, activate test mode, and then disconnect the cableand connect it to your test equipment of choice. For example, onesequence of commands could be:
echo 1 > /sys/kernel/debug/dri/1/DP-1/test/enhancedecho tps1 > /sys/kernel/debug/dri/1/DP-1/test/patternecho 1620000000 > /sys/kernel/debug/dri/1/DP-1/test/rateecho 1 > /sys/kernel/debug/dri/1/DP-1/test/ignore_aux_errorsecho 1 > /sys/kernel/debug/dri/1/DP-1/test/ignore_hpdecho 1 > /sys/kernel/debug/dri/1/DP-1/test/active
at which point the cable could be disconnected from the monitor.
Internals¶
- enumzynqmp_dpsub_layer_id¶
Layer identifier
Constants
ZYNQMP_DPSUB_LAYER_VIDVideo layer
ZYNQMP_DPSUB_LAYER_GFXGraphics layer
- structzynqmp_dpsub¶
ZynqMP DisplayPort Subsystem
Definition:
struct zynqmp_dpsub { struct device *dev; struct clk *apb_clk; struct clk *vid_clk; bool vid_clk_from_ps; struct clk *aud_clk; bool aud_clk_from_ps; unsigned int connected_ports; bool dma_enabled; struct zynqmp_dpsub_drm *drm; struct drm_bridge *bridge; struct zynqmp_disp *disp; struct zynqmp_disp_layer *layers[ZYNQMP_DPSUB_NUM_LAYERS]; struct zynqmp_dp *dp; unsigned int dma_align; struct zynqmp_dpsub_audio *audio;};Members
devThe physical device
apb_clkThe APB clock
vid_clkVideo clock
vid_clk_from_psTrue of the video clock comes from PS, false from PL
aud_clkAudio clock
aud_clk_from_psTrue of the audio clock comes from PS, false from PL
connected_portsBitmask of connected ports in the device tree
dma_enabledTrue if the DMA interface is enabled, false if the DPSUB isdriven by the live input
drmThe DRM/KMS device data
bridgeThe DP encoder bridge
dispThe display controller
layersVideo and graphics layers
dpThe DisplayPort controller
dma_alignDMA alignment constraint (must be a power of 2)
audioDP audio data
- structzynqmp_dpsub_drm¶
ZynqMP DisplayPort Subsystem DRM/KMS data
Definition:
struct zynqmp_dpsub_drm { struct zynqmp_dpsub *dpsub; struct drm_device dev; struct drm_plane planes[ZYNQMP_DPSUB_NUM_LAYERS]; struct drm_crtc crtc; struct drm_encoder encoder;};Members
dpsubBackpointer to the DisplayPort subsystem
devThe DRM/KMS device
planesThe DRM planes
crtcThe DRM CRTC
encoderThe dummy DRM encoder
- enumzynqmp_dpsub_layer_mode¶
Layer mode
Constants
ZYNQMP_DPSUB_LAYER_NONLIVEnon-live (memory) mode
ZYNQMP_DPSUB_LAYER_LIVElive (stream) mode
- structzynqmp_disp_format¶
Display subsystem format information
Definition:
struct zynqmp_disp_format { u32 drm_fmt; u32 bus_fmt; u32 buf_fmt; bool swap; const u32 *sf;};Members
drm_fmtDRM format (4CC)
bus_fmtMedia bus format
buf_fmtAV buffer format
swapFlag to swap R & B for RGB formats, and U & V for YUV formats
sfScaling factors for color components
- structzynqmp_disp_layer_dma¶
DMA channel for one data plane of a layer
Definition:
struct zynqmp_disp_layer_dma { struct dma_chan *chan; struct dma_interleaved_template xt; struct data_chunk sgl;};Members
chanDMA channel
xtInterleaved DMA descriptor template
sglData chunk for dma_interleaved_template
- structzynqmp_disp_layer_info¶
Static layer information
Definition:
struct zynqmp_disp_layer_info { const struct zynqmp_disp_format *formats; unsigned int num_formats; unsigned int num_channels;};Members
formatsArray of supported formats
num_formatsNumber of formats informats array
num_channelsNumber of DMA channels
- structzynqmp_disp_layer¶
Display layer
Definition:
struct zynqmp_disp_layer { enum zynqmp_dpsub_layer_id id; struct zynqmp_disp *disp; const struct zynqmp_disp_layer_info *info; struct zynqmp_disp_layer_dma dmas[ZYNQMP_DISP_MAX_NUM_SUB_PLANES]; const struct zynqmp_disp_format *disp_fmt; const struct drm_format_info *drm_fmt; enum zynqmp_dpsub_layer_mode mode;};Members
idLayer ID
dispBack pointer to
structzynqmp_dispinfoStatic layer information
dmasDMA channels
disp_fmtCurrent format information
drm_fmtCurrent DRM format information
modeCurrent operation mode
- structzynqmp_disp¶
Display controller
Definition:
struct zynqmp_disp { struct device *dev; struct zynqmp_dpsub *dpsub; void __iomem *blend; void __iomem *avbuf; struct zynqmp_disp_layer layers[ZYNQMP_DPSUB_NUM_LAYERS];};Members
devDevice structure
dpsubDisplay subsystem
blendRegister I/O base address for the blender
avbufRegister I/O base address for the audio/video buffer manager
layersLayers (planes)
- voidzynqmp_disp_avbuf_set_format(structzynqmp_disp*disp,structzynqmp_disp_layer*layer,conststructzynqmp_disp_format*fmt)¶
Set the input format for a layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
conststructzynqmp_disp_format*fmtThe format information
Description
Set the video buffer manager format forlayer tofmt.
- voidzynqmp_disp_avbuf_set_clocks_sources(structzynqmp_disp*disp,boolvideo_from_ps,boolaudio_from_ps,booltimings_internal)¶
Set the clocks sources
Parameters
structzynqmp_disp*dispDisplay controller
boolvideo_from_psTrue if the video clock originates from the PS
boolaudio_from_psTrue if the audio clock originates from the PS
booltimings_internalTrue if video timings are generated internally
Description
Set the source for the video and audio clocks, as well as for the videotimings. Clocks can originate from the PS or PL, and timings can begenerated internally or externally.
- voidzynqmp_disp_avbuf_enable_channels(structzynqmp_disp*disp)¶
Enable buffer channels
Parameters
structzynqmp_disp*dispDisplay controller
Description
Enable all (video and audio) buffer channels.
- voidzynqmp_disp_avbuf_disable_channels(structzynqmp_disp*disp)¶
Disable buffer channels
Parameters
structzynqmp_disp*dispDisplay controller
Description
Disable all (video and audio) buffer channels.
- voidzynqmp_disp_avbuf_enable_audio(structzynqmp_disp*disp)¶
Enable audio
Parameters
structzynqmp_disp*dispDisplay controller
Description
Enable all audio buffers with a non-live (memory) source.
- voidzynqmp_disp_avbuf_disable_audio(structzynqmp_disp*disp)¶
Disable audio
Parameters
structzynqmp_disp*dispDisplay controller
Description
Disable all audio buffers.
- voidzynqmp_disp_avbuf_enable_video(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Enable a video layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
Description
Enable the video/graphics buffer forlayer.
- voidzynqmp_disp_avbuf_disable_video(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Disable a video layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
Description
Disable the video/graphics buffer forlayer.
- voidzynqmp_disp_avbuf_enable(structzynqmp_disp*disp)¶
Enable the video pipe
Parameters
structzynqmp_disp*dispDisplay controller
Description
De-assert the video pipe reset.
- voidzynqmp_disp_avbuf_disable(structzynqmp_disp*disp)¶
Disable the video pipe
Parameters
structzynqmp_disp*dispDisplay controller
Description
Assert the video pipe reset.
- voidzynqmp_disp_blend_set_output_format(structzynqmp_disp*disp,enumzynqmp_dpsub_formatformat)¶
Set the output format of the blender
Parameters
structzynqmp_disp*dispDisplay controller
enumzynqmp_dpsub_formatformatOutput format
Description
Set the output format of the blender toformat.
- voidzynqmp_disp_blend_set_bg_color(structzynqmp_disp*disp,u32rcr,u32gy,u32bcb)¶
Set the background color
Parameters
structzynqmp_disp*dispDisplay controller
u32rcrRed/Cr color component
u32gyGreen/Y color component
u32bcbBlue/Cb color component
Description
Set the background color to (rcr,gy,bcb), corresponding to the R, G andB or Cr, Y and Cb components respectively depending on the selected outputformat.
- voidzynqmp_disp_blend_set_global_alpha(structzynqmp_disp*disp,boolenable,u32alpha)¶
Configure global alpha blending
Parameters
structzynqmp_disp*dispDisplay controller
boolenableTrue to enable global alpha blending
u32alphaGlobal alpha value (ignored ifenabled is false)
- voidzynqmp_disp_blend_layer_set_csc(structzynqmp_disp*disp,structzynqmp_disp_layer*layer,constu16*coeffs,constu32*offsets)¶
Configure colorspace conversion for layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
constu16*coeffsColorspace conversion matrix
constu32*offsetsColorspace conversion offsets
Description
Configure the input colorspace conversion matrix and offsets for thelayer.Columns of the matrix are automatically swapped based on the input format tohandle RGB and YCrCb components permutations.
- voidzynqmp_disp_blend_layer_enable(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Enable a layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
- voidzynqmp_disp_blend_layer_disable(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Disable a layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
- conststructzynqmp_disp_format*zynqmp_disp_layer_find_format(structzynqmp_disp_layer*layer,u32drm_fmt)¶
Find format information for a DRM format
Parameters
structzynqmp_disp_layer*layerThe layer
u32drm_fmtDRM format to search
Description
Search display subsystem format information corresponding to the given DRMformatdrm_fmt for thelayer, and return a pointer to the formatdescriptor.
Return
A pointer to the format descriptor if found, NULL otherwise
- conststructzynqmp_disp_format*zynqmp_disp_layer_find_live_format(structzynqmp_disp_layer*layer,u32media_bus_format)¶
Find format information for given media bus format
Parameters
structzynqmp_disp_layer*layerThe layer
u32media_bus_formatMedia bus format to search
Description
Search display subsystem format information corresponding to the given mediabus formatmedia_bus_format for thelayer, and return a pointer to theformat descriptor.
Return
A pointer to the format descriptor if found, NULL otherwise
- u32*zynqmp_disp_layer_drm_formats(structzynqmp_disp_layer*layer,unsignedint*num_formats)¶
Return the DRM formats supported by the layer
Parameters
structzynqmp_disp_layer*layerThe layer
unsignedint*num_formatsPointer to the returned number of formats
NOTE
This function doesn’t make sense for live video layers and willalways return an empty list in such cases.zynqmp_disp_live_layer_formats()should be used to query a list of media bus formats supported by the livevideo input layer.
Return
A newly allocated u32 array that stores all the DRM formatssupported by the layer. The number of formats in the array is returnedthrough the num_formats argument.
- u32*zynqmp_disp_live_layer_formats(structzynqmp_disp_layer*layer,unsignedint*num_formats)¶
Return the media bus formats supported by the live video layer
Parameters
structzynqmp_disp_layer*layerThe layer
unsignedint*num_formatsPointer to the returned number of formats
NOTE
This function should be used only for live video input layers.
Return
A newly allocated u32 array of media bus formats supported by thelayer. The number of formats in the array is returned through thenum_formats argument.
- voidzynqmp_disp_layer_enable(structzynqmp_disp_layer*layer)¶
Enable a layer
Parameters
structzynqmp_disp_layer*layerThe layer
Description
Enable thelayer in the audio/video buffer manager and the blender. DMAchannels are started separately byzynqmp_disp_layer_update().
- voidzynqmp_disp_layer_disable(structzynqmp_disp_layer*layer)¶
Disable the layer
Parameters
structzynqmp_disp_layer*layerThe layer
Description
Disable the layer by stopping its DMA channels and disabling it in theaudio/video buffer manager and the blender.
- voidzynqmp_disp_layer_set_format(structzynqmp_disp_layer*layer,conststructdrm_format_info*info)¶
Set the layer format
Parameters
structzynqmp_disp_layer*layerThe layer
conststructdrm_format_info*infoThe format info
NOTE
Usezynqmp_disp_layer_set_live_format() to set media bus format forlive video layers.
Set the format forlayer toinfo. The layer must be disabled.
- voidzynqmp_disp_layer_set_live_format(structzynqmp_disp_layer*layer,u32media_bus_format)¶
Set the live video layer format
Parameters
structzynqmp_disp_layer*layerThe layer
u32media_bus_formatMedia bus format to set
NOTE
This function should not be used to set format for non-live videolayer. Usezynqmp_disp_layer_set_format() instead.
Set the display format for the livelayer. The layer must be disabled.
- intzynqmp_disp_layer_update(structzynqmp_disp_layer*layer,structdrm_plane_state*state)¶
Update the layer framebuffer
Parameters
structzynqmp_disp_layer*layerThe layer
structdrm_plane_state*stateThe plane state
Description
Update the framebuffer for the layer by issuing a new DMA engine transactionfor the new framebuffer.
Return
0 on success, or the DMA descriptor failure error otherwise
- voidzynqmp_disp_layer_release_dma(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Release DMA channels for a layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
Description
Release the DMA channels associated withlayer.
- voidzynqmp_disp_destroy_layers(structzynqmp_disp*disp)¶
Destroy all layers
Parameters
structzynqmp_disp*dispDisplay controller
- intzynqmp_disp_layer_request_dma(structzynqmp_disp*disp,structzynqmp_disp_layer*layer)¶
Request DMA channels for a layer
Parameters
structzynqmp_disp*dispDisplay controller
structzynqmp_disp_layer*layerThe layer
Description
Request all DMA engine channels needed bylayer.
Return
0 on success, or the DMA channel request error otherwise
- intzynqmp_disp_create_layers(structzynqmp_disp*disp)¶
Create and initialize all layers
Parameters
structzynqmp_disp*dispDisplay controller
Return
0 on success, or the DMA channel request error otherwise
- voidzynqmp_disp_enable(structzynqmp_disp*disp)¶
Enable the display controller
Parameters
structzynqmp_disp*dispDisplay controller
- voidzynqmp_disp_disable(structzynqmp_disp*disp)¶
Disable the display controller
Parameters
structzynqmp_disp*dispDisplay controller
- intzynqmp_disp_setup_clock(structzynqmp_disp*disp,unsignedlongmode_clock)¶
Configure the display controller pixel clock rate
Parameters
structzynqmp_disp*dispDisplay controller
unsignedlongmode_clockThe pixel clock rate, in Hz
Return
0 on success, or a negative error clock otherwise
- structzynqmp_dp_link_config¶
Common link config between source and sink
Definition:
struct zynqmp_dp_link_config { int max_rate; u8 max_lanes;};Members
max_ratemaximum link rate
max_lanesmaximum number of lanes
- structzynqmp_dp_mode¶
Configured mode of DisplayPort
Definition:
struct zynqmp_dp_mode { const char *fmt; int pclock; u8 bw_code; u8 lane_cnt;};Members
fmtformat identifier string
pclockpixel clock frequency of current mode
bw_codecode for bandwidth(link rate)
lane_cntnumber of lanes
- structzynqmp_dp_config¶
Configuration of DisplayPort from DTS
Definition:
struct zynqmp_dp_config { u8 misc0; u8 misc1; u8 bpp;};Members
misc0misc0 configuration (per DP v1.2 spec)
misc1misc1 configuration (per DP v1.2 spec)
bppbits per pixel
- enumtest_pattern¶
Test patterns for test testing
Constants
TEST_VIDEOUse regular video input
TEST_TPS1Link training symbol pattern TPS1 (/D10.2/)
TEST_TPS2Link training symbol pattern TPS2
TEST_TPS3Link training symbol pattern TPS3 (for HBR2)
TEST_SYMBOL_ERRORSymbol error measurement pattern
TEST_PRBS7Output of the PRBS7 (x^7 + x^6 + 1) polynomial
TEST_80BIT_CUSTOMA custom 80-bit pattern
TEST_CP2520HBR2 compliance eye pattern
- structzynqmp_dp_test¶
Configuration for test mode
Definition:
struct zynqmp_dp_test { enum test_pattern pattern; bool enhanced, downspread, active; u8 custom[10]; u8 train_set[ZYNQMP_DP_MAX_LANES]; u8 bw_code; u8 link_cnt;};Members
patternThe test pattern
enhancedUse enhanced framing
downspreadUse SSC
activeWhether test mode is active
customCustom pattern for
TEST_80BIT_CUSTOMtrain_setVoltage/preemphasis settings
bw_codeBandwidth code for the link
link_cntNumber of lanes
- structzynqmp_dp_train_set_priv¶
Private data for train_set debugfs files
Definition:
struct zynqmp_dp_train_set_priv { struct zynqmp_dp *dp; int lane;};Members
dpDisplayPort IP core structure
laneThe lane for this file
- structzynqmp_dp¶
Xilinx DisplayPort core
Definition:
struct zynqmp_dp { struct drm_dp_aux aux; struct drm_bridge bridge; struct work_struct hpd_work; struct work_struct hpd_irq_work; struct completion aux_done; struct mutex lock; struct drm_bridge *next_bridge; struct device *dev; struct zynqmp_dpsub *dpsub; void __iomem *iomem; struct reset_control *reset; struct phy *phy[ZYNQMP_DP_MAX_LANES]; enum drm_connector_status status; int irq; bool enabled; bool ignore_aux_errors; bool ignore_hpd; struct zynqmp_dp_train_set_priv debugfs_train_set[ZYNQMP_DP_MAX_LANES]; struct zynqmp_dp_mode mode; struct zynqmp_dp_link_config link_config; struct zynqmp_dp_test test; struct zynqmp_dp_config config; u8 dpcd[DP_RECEIVER_CAP_SIZE]; u8 train_set[ZYNQMP_DP_MAX_LANES]; u8 num_lanes;};Members
auxaux channel
bridgeDRM bridge for the DP encoder
hpd_workhot plug detection worker
hpd_irq_workhot plug detection IRQ worker
aux_doneCompleted when we get an AUX reply or timeout
lockMutex protecting this
structandregister access (but not AUX)next_bridgeThe downstream bridge
devdevice structure
dpsubDisplay subsystem
iomemdevice I/O memory for register access
resetreset controller
phyPHY handles for DP lanes
statusconnection status
irqirq
enabledflag to indicate if the device is enabled
ignore_aux_errorsIf set, AUX errors are suppressed
ignore_hpdIf set, HPD events and IRQs are ignored
debugfs_train_setDebugfs private data fortrain_set
modecurrent mode between IP core and sink device
link_configcommon link configuration between IP core and sink device
testConfiguration for test mode
configIP core configuration from DTS
dpcdDP configuration data from currently connected sink device
train_setset of training data
num_lanesnumber of enabled phy lanes
Description
lock covers the link configuration in thisstructand the device’sregisters. It does not coveraux orignore_aux_errors. It is not strictlyrequired for any of the members which are only modified at probe/remove time(e.g.dev).
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Initialize the phy.
Return
0 if the phy instances are initialized correctly, or the error codereturned from the callee functions.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Exit the phy.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Probe PHYs for all lanes. Less PHYs may be available than the number oflanes, which is not considered an error as long as at least one PHY isfound. The caller can check dp->num_lanes to check how many PHYs were found.
Return
0 - Success
- -ENXIO
No PHY found
- -EPROBE_DEFER
Probe deferral requested
Other negative value - PHY retrieval failure
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Check if PHY is ready. If PHY is not ready, wait 1ms to check for 100 times.This amount of delay was suggested by IP designer.
Return
0 if PHY is ready, or -ENODEV if PHY is not ready.
- intzynqmp_dp_max_rate(intlink_rate,u8lane_num,u8bpp)¶
Calculate and return available max pixel clock
Parameters
intlink_ratelink rate (Kilo-bytes / sec)
u8lane_numnumber of lanes
u8bppbits per pixel
Return
max pixel clock (KHz) supported by current link config.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
intpclockpixel clock for requested display mode
u8current_bwcurrent link rate
Description
Find the link configuration values, rate and lane count for requested pixelclockpclock. Thepclock is stored in the mode to be used in otherfunctions later. The returned rate is downshifted from the current ratecurrent_bw.
Return
Current link rate code, or -EINVAL.
- voidzynqmp_dp_adjust_train(structzynqmp_dp*dp,u8link_status[DP_LINK_STATUS_SIZE])¶
Adjust train values
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
u8link_status[DP_LINK_STATUS_SIZE]link status from sink which contains requested training values
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
u8*train_setA set of training values
Description
Update the training values based on the request from sink. The mapped valuesare predefined, and values(vs, pe, pc) are from the device manual.
Return
0 if vs and emph are updated successfully, or the error code returnedbydrm_dp_dpcd_write().
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Return
0 if clock recovery train is done successfully, or correspondingerror code.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Return
0 if channel equalization train is done successfully, orcorresponding error code.
- intzynqmp_dp_setup(structzynqmp_dp*dp,u8bw_code,u8lane_cnt,boolenhanced,booldownspread)¶
Set up major link parameters
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
u8bw_codeThe link bandwidth as a multiple of 270 MHz
u8lane_cntThe number of lanes to use
boolenhancedUse enhanced framing
booldownspreadEnable spread-spectrum clocking
Return
0 on success, or -errno on failure
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Return
0 if all trains are done successfully, or corresponding error code.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Train the link by downshifting the link rate if training is not successful.
- intzynqmp_dp_aux_cmd_submit(structzynqmp_dp*dp,u32cmd,u16addr,u8*buf,u8bytes,u8*reply)¶
Submit aux command
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
u32cmdaux command
u16addraux address
u8*bufbuffer for command data
u8bytesnumber of bytes forbuf
u8*replyreply code to be returned
Description
Submit an aux command. All aux related commands, native or i2c auxread/write, are submitted through this function. The function is mapped tothe transfer function ofstructdrm_dp_aux. This function involves inmultiple register reads/writes, thus synchronization is needed, and it isdone by drm_dp_helper usinghw_mutex. The calling thread goes into sleepif there’s no immediate reply to the command submission. The reply code isreturned atreply ifreply != NULL.
Return
0 if the command is submitted properly, or corresponding error code:-EBUSY when there is any request already being processed-ETIMEDOUT when receiving reply is timed out-EIO when received bytes are less than requested
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Program the AUX clock divider and filter and register the DP AUX adapter.
Return
0 on success, error value otherwise
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Unregister the DP AUX adapter.
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
The misc register values are stored in the structure, and thisfunction applies the values into the registers.
- intzynqmp_dp_set_format(structzynqmp_dp*dp,conststructdrm_display_info*info,enumzynqmp_dpsub_formatformat,unsignedintbpc)¶
Set the input format
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
conststructdrm_display_info*infoDisplay info
enumzynqmp_dpsub_formatformatinput format
unsignedintbpcbits per component
Description
Update misc register values based on inputformat andbpc.
Return
0 on success, or -EINVAL.
- voidzynqmp_dp_encoder_mode_set_transfer_unit(structzynqmp_dp*dp,conststructdrm_display_mode*mode)¶
Set the transfer unit values
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
conststructdrm_display_mode*moderequested display mode
Description
Set the transfer unit, and calculate all transfer unit size related values.Calculation is based on DP and IP core specification.
- voidzynqmp_dp_encoder_mode_set_stream(structzynqmp_dp*dp,conststructdrm_display_mode*mode)¶
Configure the main stream
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
conststructdrm_display_mode*moderequested display mode
Description
Configure the main stream based on the requested modemode. Calculation isbased on IP core specification.
- structzynqmp_disp_layer*zynqmp_dp_disp_connected_live_layer(structzynqmp_dp*dp)¶
Return the first connected live layer
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Return
The first connected live display layer or NULL if none of the livelayers are connected.
- intzynqmp_dp_set_test_pattern(structzynqmp_dp*dp,enumtest_patternpattern,u8*constcustom)¶
Configure the link for a test pattern
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
enumtest_patternpatternThe test pattern to configure
u8*constcustomThe custom pattern to use ifpattern is
TEST_80BIT_CUSTOM
Return
0 on success, or negative errno on (DPCD) failure
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Enable vblank interrupt
Parameters
structzynqmp_dp*dpDisplayPort IP core structure
Description
Disable vblank interrupt
- voidzynqmp_dpsub_drm_handle_vblank(structzynqmp_dpsub*dpsub)¶
Handle the vblank event
Parameters
structzynqmp_dpsub*dpsubDisplayPort subsystem
Description
This function handles the vblank interrupt, and sends an event toCRTC object. This will be called by the DP vblank interrupt handler.