drm: zynqmp_dp: IRQ cleanups and debugfs support
Subsystems (5)
v4 cover drm: zynqmp_dp: IRQ cleanups and debugfs support
This series cleans up the zyqnmp_dp IRQ and locking situation. Once that's done, it adds debugfs support. The intent is to enable compliance testing or to help debug signal-integrity issues.
Last time I discussed converting the HPD work(s) to a threaded IRQ. I did not end up doing that for this series since the steps would be
- Add locking
- Move link retraining to a work function
- Harden the IRQ
- Merge the works into a threaded IRQ (omitted)
Which with the exception of the final step is the same as leaving those works as-is. Conversion to a threaded IRQ can be done as a follow-up.
Changes in v4:
- Rebase onto drm/drm-next
Changes in v3:
- Store base pointers in zynqmp_disp directly
- Don't delay work
- Convert to a hard IRQ
- Use AUX IRQs instead of polling
- Take dp->lock in zynqmp_dp_hpd_work_func
Changes in v2:
- Fix kerneldoc
- Rearrange zynqmp_dp for better padding
- Split off the HPD IRQ work into another commit
- Expand the commit message
- Document hpd_irq_work
- Document debugfs files
- Add ignore_aux_errors and ignore_hpd debugfs files to replace earlier implicit functionality
- Attempt to fix unreproducable, spurious build warning
- Drop "Optionally ignore DPCD errors" in favor of a debugfs file directly affecting zynqmp_dp_aux_transfer.
Sean Anderson (13):
drm: xlnx: Store base pointers in zynqmp_disp directly
drm: xlnx: Fix kerneldoc
drm: zynqmp_dp: Downgrade log level for aux retries message
drm: zynqmp_dp: Adjust training values per-lane
drm: zynqmp_dp: Rearrange zynqmp_dp for better padding
drm: zynqmp_dp: Don't delay work
drm: zynqmp_dp: Add locking
drm: zynqmp_dp: Don't retrain the link in our IRQ
drm: zynqmp_dp: Convert to a hard IRQ
drm: zynqmp_dp: Use AUX IRQs instead of polling
drm: zynqmp_dp: Split off several helper functions
drm: zynqmp_dp: Take dp->lock in zynqmp_dp_hpd_work_func
drm: zynqmp_dp: Add debugfs interface for compliance testing
Documentation/gpu/drivers.rst | 1 + Documentation/gpu/zynqmp.rst | 149 +++++ MAINTAINERS | 1 + drivers/gpu/drm/xlnx/zynqmp_disp.c | 44 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 908 +++++++++++++++++++++++++--- drivers/gpu/drm/xlnx/zynqmp_dpsub.h | 1 + drivers/gpu/drm/xlnx/zynqmp_kms.h | 4 +- 7 files changed, 999 insertions(+), 109 deletions(-) create mode 100644 Documentation/gpu/zynqmp.rst
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 1/13 drm: xlnx: Store base pointers in zynqmp_disp directly
The blend, avbuf, and audio members of zynqmp_disp are anonymous structs with only one member each. This is rather pointless, so move the members up a level.
---
(no changes since v3)
Changes in v3:
- New
drivers/gpu/drm/xlnx/zynqmp_disp.c | 44 +++++++++++++----------------- 1 file changed, 19 insertions(+), 25 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_disp.c +19 -25
@@ -128,24 +128,18 @@ struct zynqmp_disp_layer {* struct zynqmp_disp - Display controller * @dev: Device structure * @dpsub: Display subsystem -* @blend.base: Register I/O base address for the blender -* @avbuf.base: Register I/O base address for the audio/video buffer manager -* @audio.base: Registers I/O base address for the audio mixer +* @blend: Register I/O base address for the blender +* @avbuf: Register I/O base address for the audio/video buffer manager +* @audio: Registers I/O base address for the audio mixer * @layers: Layers (planes) */ struct zynqmp_disp {struct device *dev;struct zynqmp_dpsub *dpsub; -struct { -void __iomem *base; - } blend; -struct { -void __iomem *base; - } avbuf; -struct { -void __iomem *base; - } audio; +void __iomem *blend; +void __iomem *avbuf; +void __iomem *audio;struct zynqmp_disp_layer layers[ZYNQMP_DPSUB_NUM_LAYERS ]; };
@@ -356,12 +350,12 @@ static const struct zynqmp_disp_format avbuf_gfx_fmts[] = {static u32 zynqmp_disp_avbuf_read (struct zynqmp_disp *disp,int reg) { -return readl (disp->avbuf.base + reg); +return readl (disp->avbuf + reg); }static void zynqmp_disp_avbuf_write (struct zynqmp_disp *disp,int reg,u32 val) { -writel (val, disp->avbuf.base + reg); +writel (val, disp->avbuf + reg); }static bool zynqmp_disp_layer_is_video (const struct zynqmp_disp_layer *layer)
@@ -587,7 +581,7 @@ static void zynqmp_disp_avbuf_disable(struct zynqmp_disp *disp)static void zynqmp_disp_blend_write (struct zynqmp_disp *disp,int reg,u32 val) { -writel (val, disp->blend.base + reg); +writel (val, disp->blend + reg); }/*
@@ -813,7 +807,7 @@ static void zynqmp_disp_blend_layer_disable(struct zynqmp_disp *disp,static void zynqmp_disp_audio_write (struct zynqmp_disp *disp,int reg,u32 val) { -writel (val, disp->audio.base + reg); +writel (val, disp->audio + reg); }/**
@@ -1237,21 +1231,21 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) disp->dev = &pdev->dev; disp->dpsub = dpsub; - disp->blend.base =devm_platform_ioremap_resource_byname (pdev,"blend" ); -if (IS_ERR (disp->blend.base)) { - ret =PTR_ERR (disp->blend.base); + disp->blend =devm_platform_ioremap_resource_byname (pdev,"blend" ); +if (IS_ERR (disp->blend)) { + ret =PTR_ERR (disp->blend); goto error; } - disp->avbuf.base =devm_platform_ioremap_resource_byname (pdev,"av_buf" ); -if (IS_ERR (disp->avbuf.base)) { - ret =PTR_ERR (disp->avbuf.base); + disp->avbuf =devm_platform_ioremap_resource_byname (pdev,"av_buf" ); +if (IS_ERR (disp->avbuf)) { + ret =PTR_ERR (disp->avbuf); goto error; } - disp->audio.base =devm_platform_ioremap_resource_byname (pdev,"aud" ); -if (IS_ERR (disp->audio.base)) { - ret =PTR_ERR (disp->audio.base); + disp->audio =devm_platform_ioremap_resource_byname (pdev,"aud" ); +if (IS_ERR (disp->audio)) { + ret =PTR_ERR (disp->audio); goto error; }
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 2/13 drm: xlnx: Fix kerneldoc
In reply to Sean AndersonFix a few errors in the kerneldoc. Mostly this addresses missing/renamed members.
---
(no changes since v3)
Changes in v3:
- Split off documentation for base pointers to previous commit
Changes in v2:
- New
drivers/gpu/drm/xlnx/zynqmp_dpsub.h | 1 + drivers/gpu/drm/xlnx/zynqmp_kms.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dpsub.h +1 -0
@@ -53,6 +53,7 @@ enum zynqmp_dpsub_format {* @drm: The DRM/KMS device data * @bridge: The DP encoder bridge * @disp: The display controller +* @layers: Video and graphics layers * @dp: The DisplayPort controller * @dma_align: DMA alignment constraint (must be a power of 2) */
drivers/gpu/drm/xlnx/zynqmp_kms.h +2 -2
@@ -22,9 +22,9 @@struct zynqmp_dpsub ;/** -* struct zynqmp_dpsub - ZynqMP DisplayPort Subsystem DRM/KMS data +* struct zynqmp_dpsub_drm - ZynqMP DisplayPort Subsystem DRM/KMS data * @dpsub: Backpointer to the DisplayPort subsystem -* @drm: The DRM/KMS device +* @dev: The DRM/KMS device * @planes: The DRM planes * @crtc: The DRM CRTC * @encoder: The dummy DRM encoder
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 3/13 drm: zynqmp_dp: Downgrade log level for aux retries message
In reply to Sean AndersonEnable this message for verbose debugging only as it is otherwise printed after every AUX message, quickly filling the log buffer.
---
(no changes since v1)
drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +1 -1
@@ -1006,7 +1006,7 @@ zynqmp_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) msg->buffer, msg->size, &msg->reply);if (!ret) { -dev_dbg (dp->dev,"aux %d retries\n" , i); +dev_vdbg (dp->dev,"aux %d retries\n" , i);return msg->size; }
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 4/13 drm: zynqmp_dp: Adjust training values per-lane
In reply to Sean AndersonThe feedback we get from the DPRX is per-lane. Make changes using this information, instead of picking the maximum values from all lanes. This results in more-consistent training on marginal links.
---
(no changes since v1)
drivers/gpu/drm/xlnx/zynqmp_dp.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +8 -15
@@ -605,28 +605,21 @@ static void zynqmp_dp_adjust_train(struct zynqmp_dp *dp, u8 link_status[DP_LINK_STATUS_SIZE]) {u8 *train_set = dp->train_set; -u8 voltage =0 , preemphasis =0 ;u8 i;for (i =0 ; i < dp->mode.lane_cnt; i++) { -u8 v =drm_dp_get_adjust_request_voltage (link_status, i); -u8 p =drm_dp_get_adjust_request_pre_emphasis (link_status, i); +u8 voltage =drm_dp_get_adjust_request_voltage (link_status, i); +u8 preemphasis = +drm_dp_get_adjust_request_pre_emphasis (link_status, i); -if (v > voltage) - voltage = v; +if (voltage >=DP_TRAIN_VOLTAGE_SWING_LEVEL_3 ) + voltage |=DP_TRAIN_MAX_SWING_REACHED ; -if (p > preemphasis) - preemphasis = p; - } +if (preemphasis >=DP_TRAIN_PRE_EMPH_LEVEL_2 ) + preemphasis |=DP_TRAIN_MAX_PRE_EMPHASIS_REACHED ; -if (voltage >=DP_TRAIN_VOLTAGE_SWING_LEVEL_3 ) - voltage |=DP_TRAIN_MAX_SWING_REACHED ; - -if (preemphasis >=DP_TRAIN_PRE_EMPH_LEVEL_2 ) - preemphasis |=DP_TRAIN_MAX_PRE_EMPHASIS_REACHED ; - -for (i =0 ; i < dp->mode.lane_cnt; i++) train_set[i] = voltage | preemphasis; + } }/**
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 5/13 drm: zynqmp_dp: Rearrange zynqmp_dp for better padding
In reply to Sean AndersonSort the members of struct zynqmp_dp to reduce padding necessary for alignment.
---
(no changes since v2)
Changes in v2:
- New
drivers/gpu/drm/xlnx/zynqmp_dp.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +14 -14
@@ -255,10 +255,10 @@ struct zynqmp_dp_link_config {* @fmt: format identifier string */ struct zynqmp_dp_mode { -u8 bw_code; -u8 lane_cnt; -int pclock;const char *fmt; +int pclock; +u8 bw_code; +u8 lane_cnt; };/**
@@ -295,27 +295,27 @@ struct zynqmp_dp_config {* @train_set: set of training data */ struct zynqmp_dp { +struct drm_dp_aux aux; +struct drm_bridge bridge; +struct delayed_work hpd_work; + +struct drm_bridge *next_bridge;struct device *dev;struct zynqmp_dpsub *dpsub;void __iomem *iomem;struct reset_control *reset; -int irq; - -struct drm_bridge bridge; -struct drm_bridge *next_bridge; - -struct zynqmp_dp_config config; -struct drm_dp_aux aux;struct phy *phy[ZYNQMP_DP_MAX_LANES ]; -u8 num_lanes; -struct delayed_work hpd_work; +enum drm_connector_status status; +int irq;bool enabled; -u8 dpcd[DP_RECEIVER_CAP_SIZE ]; -struct zynqmp_dp_link_config link_config;struct zynqmp_dp_mode mode; +struct zynqmp_dp_link_config link_config; +struct zynqmp_dp_config config; +u8 dpcd[DP_RECEIVER_CAP_SIZE ];u8 train_set[ZYNQMP_DP_MAX_LANES ]; +u8 num_lanes; };static inline struct zynqmp_dp *bridge_to_dp (struct drm_bridge *bridge)
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 6/13 drm: zynqmp_dp: Don't delay work
In reply to Sean AndersonWe always call scheduled_delayed_work with no delay, so just use a non-delayed work_struct instead.
---
(no changes since v3)
Changes in v3:
- New
drivers/gpu/drm/xlnx/zynqmp_dp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +6 -7
@@ -297,7 +297,7 @@ struct zynqmp_dp_config {struct zynqmp_dp {struct drm_dp_aux aux;struct drm_bridge bridge; -struct delayed_work hpd_work; +struct work_struct hpd_work;struct drm_bridge *next_bridge;struct device *dev;
@@ -1467,7 +1467,7 @@ static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge,struct zynqmp_dp *dp =bridge_to_dp (bridge); dp->enabled = false; -cancel_delayed_work (&dp->hpd_work); +cancel_work (&dp->hpd_work);zynqmp_dp_write (dp,ZYNQMP_DP_MAIN_STREAM_ENABLE ,0 );drm_dp_dpcd_writeb (&dp->aux,DP_SET_POWER ,DP_SET_POWER_D3 ); zynqmp_dp_write(dp, ZYNQMP_DP_TX_PHY_POWER_DOWN,
@@ -1603,8 +1603,7 @@ void zynqmp_dp_disable_vblank(struct zynqmp_dp *dp)static void zynqmp_dp_hpd_work_func (struct work_struct *work) { - struct zynqmp_dp *dp = container_of(work, struct zynqmp_dp, - hpd_work.work); + struct zynqmp_dp *dp = container_of(work, struct zynqmp_dp, hpd_work);enum drm_connector_status status; status =zynqmp_dp_bridge_detect (&dp->bridge);
@@ -1640,7 +1639,7 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data)zynqmp_dpsub_drm_handle_vblank (dp->dpsub);if (status &ZYNQMP_DP_INT_HPD_EVENT ) -schedule_delayed_work (&dp->hpd_work,0 ); +schedule_work (&dp->hpd_work);if (status &ZYNQMP_DP_INT_HPD_IRQ ) {int ret;
@@ -1682,7 +1681,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) dp->dpsub = dpsub; dp->status = connector_status_disconnected; -INIT_DELAYED_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func); +INIT_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func);/* Acquire all resources (IOMEM, IRQ and PHYs). */ res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"dp" );
@@ -1787,7 +1786,7 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub)zynqmp_dp_write (dp,ZYNQMP_DP_INT_DS ,ZYNQMP_DP_INT_ALL );disable_irq (dp->irq); -cancel_delayed_work_sync (&dp->hpd_work); +cancel_work_sync (&dp->hpd_work);zynqmp_dp_write (dp,ZYNQMP_DP_TRANSMITTER_ENABLE ,0 );zynqmp_dp_write (dp,ZYNQMP_DP_INT_DS ,0xffffffff );
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 7/13 drm: zynqmp_dp: Add locking
In reply to Sean AndersonAdd some locking to prevent the IRQ/workers/bridge API calls from stepping on each other's toes. This lock protects:
- Non-atomic registers configuring the link. That is, everything but the IRQ registers (since these are accessed in an atomic fashion), and the DP AUX registers (since these don't affect the link). We also access AUX while holding this lock, so it would be very tricky to support.
- Link configuration. This is effectively everything in zynqmp_dp which isn't read-only after probe time. So from next_bridge onward.
This lock is designed to protect configuration changes so we don't have to do anything tricky. Configuration should never be in the hot path, so I'm not worried about performance.
---
(no changes since v2)
Changes in v2:
- Split off the HPD IRQ work into another commit
- Expand the commit message
drivers/gpu/drm/xlnx/zynqmp_dp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/xlnx/zynqmp_dp.c +18 -0
@@ -279,6 +279,7 @@ struct zynqmp_dp_config {* @dpsub: Display subsystem * @iomem: device I/O memory for register access * @reset: reset controller +* @lock: Mutex protecting this struct and register access (but not AUX) * @irq: irq * @bridge: DRM bridge for the DP encoder * @next_bridge: The downstream bridge
@@ -293,11 +294,16 @@ struct zynqmp_dp_config {* @link_config: common link configuration between IP core and sink device * @mode: current mode between IP core and sink device * @train_set: set of training data +* +* @lock covers the link configuration in this struct and the device's +* registers. It does not cover @aux. It is not strictly required for any of +* the members which are only modified at probe/remove time (e.g. @dev). */ struct zynqmp_dp {struct drm_dp_aux aux;struct drm_bridge bridge;struct work_struct hpd_work; +struct mutex lock;struct drm_bridge *next_bridge;struct device *dev;
@@ -1371,8 +1377,10 @@ zynqmp_dp_bridge_mode_valid(struct drm_bridge *bridge, }/* Check with link rate and lane count */ +mutex_lock (&dp->lock); rate =zynqmp_dp_max_rate (dp->link_config.max_rate, dp->link_config.max_lanes, dp->config.bpp); +mutex_unlock (&dp->lock);if (mode->clock > rate) {dev_dbg (dp->dev,"filtered mode %s for high pixel rate\n" , mode->name);
@@ -1399,6 +1407,7 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge,pm_runtime_get_sync (dp->dev); +mutex_lock (&dp->lock);zynqmp_dp_disp_enable (dp, old_bridge_state);/*
@@ -1459,6 +1468,7 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge,zynqmp_dp_write (dp,ZYNQMP_DP_SOFTWARE_RESET ,ZYNQMP_DP_SOFTWARE_RESET_ALL );zynqmp_dp_write (dp,ZYNQMP_DP_MAIN_STREAM_ENABLE ,1 ); +mutex_unlock (&dp->lock); } static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge,
@@ -1466,6 +1476,7 @@ static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge, {struct zynqmp_dp *dp =bridge_to_dp (bridge); +mutex_lock (&dp->lock); dp->enabled = false;cancel_work (&dp->hpd_work);zynqmp_dp_write (dp,ZYNQMP_DP_MAIN_STREAM_ENABLE ,0 );
@@ -1476,6 +1487,7 @@ static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge,zynqmp_dp_write (dp,ZYNQMP_DP_TX_AUDIO_CONTROL ,0 );zynqmp_dp_disp_disable (dp, old_bridge_state); +mutex_unlock (&dp->lock);pm_runtime_put_sync (dp->dev); }
@@ -1518,6 +1530,8 @@ static enum drm_connector_status zynqmp_dp_bridge_detect(struct drm_bridge *bridu32 state, i;int ret; +mutex_lock (&dp->lock); +/* * This is from heuristic. It takes some delay (ex, 100 ~ 500 msec) to * get the HPD signal with some monitors.
@@ -1545,11 +1559,13 @@ static enum drm_connector_status zynqmp_dp_bridge_detect(struct drm_bridge *brid dp->num_lanes); dp->status = connector_status_connected; +mutex_unlock (&dp->lock);return connector_status_connected; } disconnected: dp->status = connector_status_disconnected; +mutex_unlock (&dp->lock);return connector_status_disconnected; }
@@ -1680,6 +1696,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) dp->dev = &pdev->dev; dp->dpsub = dpsub; dp->status = connector_status_disconnected; +mutex_init (&dp->lock);INIT_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func);
@@ -1793,4 +1810,5 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub)zynqmp_dp_phy_exit (dp);zynqmp_dp_reset (dp, true); +mutex_destroy (&dp->lock); }
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 8/13 drm: zynqmp_dp: Don't retrain the link in our IRQ
In reply to Sean AndersonRetraining the link can take a while, and might involve waiting for DPCD reads/writes to complete. In preparation for unthreading the IRQ handler, move this into its own work function.
---
(no changes since v2)
Changes in v2:
- Document hpd_irq_work
- Split this off from the locking changes
drivers/gpu/drm/xlnx/zynqmp_dp.c | 45 ++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +29 -16
@@ -288,6 +288,7 @@ struct zynqmp_dp_config {* @phy: PHY handles for DP lanes * @num_lanes: number of enabled phy lanes * @hpd_work: hot plug detection worker +* @hpd_irq_work: hot plug detection IRQ worker * @status: connection status * @enabled: flag to indicate if the device is enabled * @dpcd: DP configuration data from currently connected sink device
@@ -303,6 +304,7 @@ struct zynqmp_dp {struct drm_dp_aux aux;struct drm_bridge bridge;struct work_struct hpd_work; +struct work_struct hpd_irq_work;struct mutex lock;struct drm_bridge *next_bridge;
@@ -1626,6 +1628,29 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work)drm_bridge_hpd_notify (&dp->bridge, status); } +static void zynqmp_dp_hpd_irq_work_func (struct work_struct *work) +{ + struct zynqmp_dp *dp = container_of(work, struct zynqmp_dp, + hpd_irq_work); +u8 status[DP_LINK_STATUS_SIZE +2 ]; +int err; + +mutex_lock (&dp->lock); + err =drm_dp_dpcd_read (&dp->aux,DP_SINK_COUNT , status, +DP_LINK_STATUS_SIZE +2 ); +if (err <0 ) { +dev_dbg_ratelimited (dp->dev, +"could not read sink status: %d\n" , err); + }else { +if (status[4 ] &DP_LINK_STATUS_UPDATED || + !drm_dp_clock_recovery_ok (&status[2 ], dp->mode.lane_cnt) || + !drm_dp_channel_eq_ok (&status[2 ], dp->mode.lane_cnt)) { +zynqmp_dp_train_loop (dp); + } + } +mutex_unlock (&dp->lock); +} +static irqreturn_t zynqmp_dp_irq_handler (int irq,void *data) {struct zynqmp_dp *dp = (struct zynqmp_dp *)data;
@@ -1657,23 +1682,9 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data)if (status &ZYNQMP_DP_INT_HPD_EVENT )schedule_work (&dp->hpd_work); -if (status &ZYNQMP_DP_INT_HPD_IRQ ) { -int ret; -u8 status[DP_LINK_STATUS_SIZE +2 ]; +if (status &ZYNQMP_DP_INT_HPD_IRQ ) +schedule_work (&dp->hpd_irq_work); - ret =drm_dp_dpcd_read (&dp->aux,DP_SINK_COUNT , status, -DP_LINK_STATUS_SIZE +2 ); -if (ret <0 ) - goto handled; - -if (status[4 ] &DP_LINK_STATUS_UPDATED || - !drm_dp_clock_recovery_ok (&status[2 ], dp->mode.lane_cnt) || - !drm_dp_channel_eq_ok (&status[2 ], dp->mode.lane_cnt)) { -zynqmp_dp_train_loop (dp); - } - } - -handled:return IRQ_HANDLED ; }
@@ -1699,6 +1710,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)mutex_init (&dp->lock);INIT_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func); +INIT_WORK (&dp->hpd_irq_work, zynqmp_dp_hpd_irq_work_func);/* Acquire all resources (IOMEM, IRQ and PHYs). */ res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"dp" );
@@ -1803,6 +1815,7 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub)zynqmp_dp_write (dp,ZYNQMP_DP_INT_DS ,ZYNQMP_DP_INT_ALL );disable_irq (dp->irq); +cancel_work_sync (&dp->hpd_irq_work);cancel_work_sync (&dp->hpd_work);zynqmp_dp_write (dp,ZYNQMP_DP_TRANSMITTER_ENABLE ,0 );
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 9/13 drm: zynqmp_dp: Convert to a hard IRQ
In reply to Sean AndersonNow that all of the sleeping work is done outside of the IRQ, we can convert it to a hard IRQ.
---
(no changes since v3)
Changes in v3:
- New
drivers/gpu/drm/xlnx/zynqmp_dp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +2 -3
@@ -1786,9 +1786,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)* Now that the hardware is initialized and won't generate spurious * interrupts, request the IRQ. */ - ret =devm_request_threaded_irq (dp->dev, dp->irq,NULL , - zynqmp_dp_irq_handler,IRQF_ONESHOT , -dev_name (dp->dev), dp); + ret =devm_request_irq (dp->dev, dp->irq, zynqmp_dp_irq_handler, +IRQF_SHARED ,dev_name (dp->dev), dp);if (ret <0 ) goto err_phy_exit;
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 10/13 drm: zynqmp_dp: Use AUX IRQs instead of polling
In reply to Sean AndersonInstead of polling the status register for the AUX status, just enable the IRQs and signal a completion.
---
(no changes since v3)
Changes in v3:
- New
drivers/gpu/drm/xlnx/zynqmp_dp.c | 35 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +25 -10
@@ -285,6 +285,7 @@ struct zynqmp_dp_config {* @next_bridge: The downstream bridge * @config: IP core configuration from DTS * @aux: aux channel +* @aux_done: Completed when we get an AUX reply or timeout * @phy: PHY handles for DP lanes * @num_lanes: number of enabled phy lanes * @hpd_work: hot plug detection worker
@@ -305,6 +306,7 @@ struct zynqmp_dp {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;
@@ -941,12 +943,15 @@ static int zynqmp_dp_aux_cmd_submit(struct zynqmp_dp *dp, u32 cmd, u16 addr, u8 *buf, u8 bytes, u8 *reply) { bool is_read = (cmd & AUX_READ_BIT) ? true : false; +unsigned long time_left;u32 reg, i; reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE );if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REQUEST )return -EBUSY ; +reinit_completion (&dp->aux_done); +zynqmp_dp_write (dp,ZYNQMP_DP_AUX_ADDRESS , addr);if (!is_read)for (i =0 ; i < bytes; i++)
@@ -961,17 +966,14 @@ static int zynqmp_dp_aux_cmd_submit(struct zynqmp_dp *dp, u32 cmd, u16 addr,zynqmp_dp_write (dp,ZYNQMP_DP_AUX_COMMAND , reg);/* Wait for reply to be delivered upto 2ms */ -for (i =0 ; ; i++) { - reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE ); -if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY ) -break ; + time_left =wait_for_completion_timeout (&dp->aux_done, +msecs_to_jiffies (2 )); +if (!time_left) +return -ETIMEDOUT ; -if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT || - i ==2 ) -return -ETIMEDOUT ; - -usleep_range (1000 ,1100 ); - } + reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE ); +if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT ) +return -ETIMEDOUT ; reg =zynqmp_dp_read (dp,ZYNQMP_DP_AUX_REPLY_CODE );if (reply)
@@ -1055,6 +1057,9 @@ static int zynqmp_dp_aux_init(struct zynqmp_dp *dp) (w <<ZYNQMP_DP_AUX_CLK_DIVIDER_AUX_FILTER_SHIFT ) | (rate / (1000 * 1000))); +zynqmp_dp_write (dp,ZYNQMP_DP_INT_EN ,ZYNQMP_DP_INT_REPLY_RECEIVED | +ZYNQMP_DP_INT_REPLY_TIMEOUT ); + dp->aux.name ="ZynqMP DP AUX" ; dp->aux.dev = dp->dev; dp->aux.drm_dev = dp->bridge.dev;
@@ -1072,6 +1077,9 @@ static int zynqmp_dp_aux_init(struct zynqmp_dp *dp)static void zynqmp_dp_aux_cleanup (struct zynqmp_dp *dp) {drm_dp_aux_unregister (&dp->aux); + +zynqmp_dp_write (dp,ZYNQMP_DP_INT_DS ,ZYNQMP_DP_INT_REPLY_RECEIVED | +ZYNQMP_DP_INT_REPLY_TIMEOUT ); }/* -----------------------------------------------------------------------------
@@ -1685,6 +1693,12 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data)if (status &ZYNQMP_DP_INT_HPD_IRQ )schedule_work (&dp->hpd_irq_work); +if (status &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY ) +complete (&dp->aux_done); + +if (status &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT ) +complete (&dp->aux_done); +return IRQ_HANDLED ; }
@@ -1708,6 +1722,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) dp->dpsub = dpsub; dp->status = connector_status_disconnected;mutex_init (&dp->lock); +init_completion (&dp->aux_done);INIT_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func);INIT_WORK (&dp->hpd_irq_work, zynqmp_dp_hpd_irq_work_func);
Signature · 1 line
2.35.1.1320.gc452695387.dirty
Tomi Valkeinen
maintainerRe: [PATCH v4 10/13] drm: zynqmp_dp: Use AUX IRQs instead of polling
Quoted 6 lines · Sean Anderson
Instead of polling the status register for the AUX status, just enable the IRQs and signal a completion.
Signed-off-by Sean Anderson <[email protected]>---
This one seems to cause a hang when I unload the modules. I didn't debug it further yet, but most likely we get an AUX interrupt when disabling the hardware, and the driver hasn't disabled the IRQ handler.
Tomi
Quoted 110 lines
(no changes since v3)
Changes in v3:
- Newdrivers/gpu/drm/xlnx/zynqmp_dp.c | 35 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-)drivers/gpu/drm/xlnx/zynqmp_dp.c +25
-10@@ -285,6 +285,7 @@ struct zynqmp_dp_config {* @next_bridge: The downstream bridge * @config: IP core configuration from DTS * @aux: aux channel +* @aux_done: Completed when we get an AUX reply or timeout * @phy: PHY handles for DP lanes * @num_lanes: number of enabled phy lanes * @hpd_work: hot plug detection worker @@ -305,6 +306,7 @@ struct zynqmp_dp {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;@@ -941,12 +943,15 @@ static int zynqmp_dp_aux_cmd_submit(struct zynqmp_dp *dp, u32 cmd, u16 addr, u8 *buf, u8 bytes, u8 *reply) { bool is_read = (cmd & AUX_READ_BIT) ? true : false; +unsigned long time_left;u32 reg, i; reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE );if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REQUEST )return -EBUSY ; +reinit_completion (&dp->aux_done); +zynqmp_dp_write (dp,ZYNQMP_DP_AUX_ADDRESS , addr);if (!is_read)for (i =0 ; i < bytes; i++)@@ -961,17 +966,14 @@ static int zynqmp_dp_aux_cmd_submit(struct zynqmp_dp *dp, u32 cmd, u16 addr,zynqmp_dp_write (dp,ZYNQMP_DP_AUX_COMMAND , reg);/* Wait for reply to be delivered upto 2ms */ -for (i =0 ; ; i++) { - reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE ); -if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY ) -break ; + time_left =wait_for_completion_timeout (&dp->aux_done, +msecs_to_jiffies (2 )); +if (!time_left) +return -ETIMEDOUT ; -if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT || - i ==2 ) -return -ETIMEDOUT ; - -usleep_range (1000 ,1100 ); - } + reg =zynqmp_dp_read (dp,ZYNQMP_DP_INTERRUPT_SIGNAL_STATE ); +if (reg &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT ) +return -ETIMEDOUT ; reg =zynqmp_dp_read (dp,ZYNQMP_DP_AUX_REPLY_CODE );if (reply)@@ -1055,6 +1057,9 @@ static int zynqmp_dp_aux_init(struct zynqmp_dp *dp) (w <<ZYNQMP_DP_AUX_CLK_DIVIDER_AUX_FILTER_SHIFT ) | (rate / (1000 * 1000))); +zynqmp_dp_write (dp,ZYNQMP_DP_INT_EN ,ZYNQMP_DP_INT_REPLY_RECEIVED | +ZYNQMP_DP_INT_REPLY_TIMEOUT ); + dp->aux.name ="ZynqMP DP AUX" ; dp->aux.dev = dp->dev; dp->aux.drm_dev = dp->bridge.dev;@@ -1072,6 +1077,9 @@ static int zynqmp_dp_aux_init(struct zynqmp_dp *dp)static void zynqmp_dp_aux_cleanup (struct zynqmp_dp *dp) {drm_dp_aux_unregister (&dp->aux); + +zynqmp_dp_write (dp,ZYNQMP_DP_INT_DS ,ZYNQMP_DP_INT_REPLY_RECEIVED | +ZYNQMP_DP_INT_REPLY_TIMEOUT ); }/* ----------------------------------------------------------------------------- @@ -1685,6 +1693,12 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data)if (status &ZYNQMP_DP_INT_HPD_IRQ )schedule_work (&dp->hpd_irq_work); +if (status &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY ) +complete (&dp->aux_done); + +if (status &ZYNQMP_DP_INTERRUPT_SIGNAL_STATE_REPLY_TIMEOUT ) +complete (&dp->aux_done); +return IRQ_HANDLED ; }@@ -1708,6 +1722,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) dp->dpsub = dpsub; dp->status = connector_status_disconnected;mutex_init (&dp->lock); +init_completion (&dp->aux_done);INIT_WORK (&dp->hpd_work, zynqmp_dp_hpd_work_func);INIT_WORK (&dp->hpd_irq_work, zynqmp_dp_hpd_irq_work_func);
PATCH v4 11/13 drm: zynqmp_dp: Split off several helper functions
In reply to Sean AndersonIn preparation for supporting compliance testing, split off several helper functions. No functional change intended.
---
(no changes since v1)
drivers/gpu/drm/xlnx/zynqmp_dp.c | 49 ++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 15 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +34 -15
@@ -635,6 +635,7 @@ static void zynqmp_dp_adjust_train(struct zynqmp_dp *dp,/** * zynqmp_dp_update_vs_emph - Update the training values * @dp: DisplayPort IP core structure +* @train_set: A set of training values * * Update the training values based on the request from sink. The mapped values * are predefined, and values(vs, pe, pc) are from the device manual.
@@ -642,12 +643,12 @@ static void zynqmp_dp_adjust_train(struct zynqmp_dp *dp,* Return: 0 if vs and emph are updated successfully, or the error code returned * by drm_dp_dpcd_write(). */ -static int zynqmp_dp_update_vs_emph (struct zynqmp_dp *dp) +static int zynqmp_dp_update_vs_emph (struct zynqmp_dp *dp,u8 *train_set) {unsigned int i;int ret; - ret =drm_dp_dpcd_write (&dp->aux,DP_TRAINING_LANE0_SET , dp->train_set, + ret =drm_dp_dpcd_write (&dp->aux,DP_TRAINING_LANE0_SET , train_set, dp->mode.lane_cnt);if (ret <0 )return ret;
@@ -655,7 +656,7 @@ static int zynqmp_dp_update_vs_emph(struct zynqmp_dp *dp)for (i =0 ; i < dp->mode.lane_cnt; i++) {u32 reg =ZYNQMP_DP_SUB_TX_PHY_PRECURSOR_LANE_0 + i *4 ;union phy_configure_opts opts = {0 }; -u8 train = dp->train_set[i]; +u8 train = train_set[i]; opts.dp.voltage[0 ] = (train &DP_TRAIN_VOLTAGE_SWING_MASK ) >>DP_TRAIN_VOLTAGE_SWING_SHIFT ;
@@ -699,7 +700,7 @@ static int zynqmp_dp_link_train_cr(struct zynqmp_dp *dp)* So, This loop should exit before 512 iterations */ for (max_tries =0 ; max_tries <512 ; max_tries++) { - ret =zynqmp_dp_update_vs_emph (dp); + ret =zynqmp_dp_update_vs_emph (dp, dp->train_set);if (ret)return ret;
@@ -764,7 +765,7 @@ static int zynqmp_dp_link_train_ce(struct zynqmp_dp *dp)return ret;for (tries =0 ; tries <DP_MAX_TRAINING_TRIES ; tries++) { - ret =zynqmp_dp_update_vs_emph (dp); + ret =zynqmp_dp_update_vs_emph (dp, dp->train_set);if (ret)return ret;
@@ -787,28 +788,29 @@ static int zynqmp_dp_link_train_ce(struct zynqmp_dp *dp) }/** -* zynqmp_dp_train - Train the link +* zynqmp_dp_setup() - Set up major link parameters * @dp: DisplayPort IP core structure +* @bw_code: The link bandwidth as a multiple of 270 MHz +* @lane_cnt: The number of lanes to use +* @enhanced: Use enhanced framing +* @downspread: Enable spread-spectrum clocking * -* Return: 0 if all trains are done successfully, or corresponding error code. +* Return: 0 on success, or -errno on failure */ -static int zynqmp_dp_train (struct zynqmp_dp *dp) +static int zynqmp_dp_setup (struct zynqmp_dp *dp,u8 bw_code,u8 lane_cnt, +bool enhanced,bool downspread) {u32 reg; -u8 bw_code = dp->mode.bw_code; -u8 lane_cnt = dp->mode.lane_cnt;u8 aux_lane_cnt = lane_cnt; -bool enhanced;int ret;zynqmp_dp_write (dp,ZYNQMP_DP_LANE_COUNT_SET , lane_cnt); - enhanced =drm_dp_enhanced_frame_cap (dp->dpcd);if (enhanced) {zynqmp_dp_write (dp,ZYNQMP_DP_ENHANCED_FRAME_EN ,1 ); aux_lane_cnt |=DP_LANE_COUNT_ENHANCED_FRAME_EN ; } -if (dp->dpcd[3 ] &0x1 ) { +if (downspread) {zynqmp_dp_write (dp,ZYNQMP_DP_DOWNSPREAD_CTL ,1 );drm_dp_dpcd_writeb (&dp->aux,DP_DOWNSPREAD_CTRL ,DP_SPREAD_AMP_0_5 );
@@ -851,8 +853,25 @@ static int zynqmp_dp_train(struct zynqmp_dp *dp) }zynqmp_dp_write (dp,ZYNQMP_DP_PHY_CLOCK_SELECT , reg); - ret =zynqmp_dp_phy_ready (dp); -if (ret <0 ) +return zynqmp_dp_phy_ready (dp); +} + + +/** +* zynqmp_dp_train - Train the link +* @dp: DisplayPort IP core structure +* +* Return: 0 if all trains are done successfully, or corresponding error code. +*/ +static int zynqmp_dp_train (struct zynqmp_dp *dp) +{ +int ret; + + ret =zynqmp_dp_setup (dp, dp->mode.bw_code, dp->mode.lane_cnt, +drm_dp_enhanced_frame_cap (dp->dpcd), + dp->dpcd[DP_MAX_DOWNSPREAD ] & +DP_MAX_DOWNSPREAD_0_5 ); +if (ret)return ret;zynqmp_dp_write (dp,ZYNQMP_DP_SCRAMBLING_DISABLE ,1 );
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 12/13 drm: zynqmp_dp: Take dp->lock in zynqmp_dp_hpd_work_func
In reply to Sean AndersonAdd a non-locking version of zynqmp_dp_bridge_detect and use it in zynqmp_dp_hpd_work_func so we can take the lock explicitly. This will make it easier to check for hpd_ignore when we add debugfs support.
---
(no changes since v3)
Changes in v3:
- New
drivers/gpu/drm/xlnx/zynqmp_dp.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +18 -6
@@ -1552,14 +1552,13 @@ static int zynqmp_dp_bridge_atomic_check(struct drm_bridge *bridge,return 0 ; } -static enum drm_connector_status zynqmp_dp_bridge_detect (struct drm_bridge *bridge) +static enum drm_connector_status __zynqmp_dp_bridge_detect (struct zynqmp_dp *dp) { -struct zynqmp_dp *dp =bridge_to_dp (bridge);struct zynqmp_dp_link_config *link_config = &dp->link_config;u32 state, i;int ret; -mutex_lock (&dp->lock); +lockdep_assert_held (&dp->lock);/* * This is from heuristic. It takes some delay (ex, 100 ~ 500 msec) to
@@ -1588,16 +1587,26 @@ static enum drm_connector_status zynqmp_dp_bridge_detect(struct drm_bridge *brid dp->num_lanes); dp->status = connector_status_connected; -mutex_unlock (&dp->lock);return connector_status_connected; } disconnected: dp->status = connector_status_disconnected; -mutex_unlock (&dp->lock);return connector_status_disconnected; } +static enum drm_connector_status zynqmp_dp_bridge_detect (struct drm_bridge *bridge) +{ +struct zynqmp_dp *dp =bridge_to_dp (bridge); +enum drm_connector_status ret; + +mutex_lock (&dp->lock); + ret =__zynqmp_dp_bridge_detect (dp); +mutex_unlock (&dp->lock); + +return ret; +} +static const struct drm_edid *zynqmp_dp_bridge_edid_read (struct drm_bridge *bridge,struct drm_connector *connector) {
@@ -1651,7 +1660,10 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) struct zynqmp_dp *dp = container_of(work, struct zynqmp_dp, hpd_work);enum drm_connector_status status; - status =zynqmp_dp_bridge_detect (&dp->bridge); +mutex_lock (&dp->lock); + status =__zynqmp_dp_bridge_detect (dp); +mutex_unlock (&dp->lock); +drm_bridge_hpd_notify (&dp->bridge, status); }
Signature · 1 line
2.35.1.1320.gc452695387.dirty
PATCH v4 13/13 drm: zynqmp_dp: Add debugfs interface for compliance testing
In reply to Sean AndersonAdd a debugfs interface for exercising the various test modes supported by the DisplayPort controller. This allows performing compliance testing, or performing signal integrity measurements on a failing link. At the moment, we do not support sink-driven link quality testing, although such support would be fairly easy to add.
Additionally, add some debugfs files for ignoring AUX errors and HPD events, as this can allow testing with equipment that cannot emulate a DPRX.
---
(no changes since v2)
Changes in v2:
- Document debugfs files
- Add ignore_aux_errors and ignore_hpd debugfs files to replace earlier implicit functionality
- Attempt to fix unreproducable, spurious build warning
Documentation/gpu/drivers.rst | 1 + Documentation/gpu/zynqmp.rst | 149 +++++++ MAINTAINERS | 1 + drivers/gpu/drm/xlnx/zynqmp_dp.c | 682 ++++++++++++++++++++++++++++++- 4 files changed, 830 insertions(+), 3 deletions(-) create mode 100644 Documentation/gpu/zynqmp.rst
Documentation/gpu/drivers.rst +1 -0
@@ -22,6 +22,7 @@ GPU Driver Documentation afbc komeda-kms panfrost + zynqmp .. only:: subproject and html
Documentation/gpu/zynqmp.rst new file +149 -0
149 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -7391,6 +7391,7 @@ L: [email protected] S: Maintained T: git https://gitlab.freedesktop.org/drm/misc/kernel.git F: Documentation/devicetree/bindings/display/xlnx/ +F: Documentation/gpu/zynqmp.rst F: drivers/gpu/drm/xlnx/ DRM GPU SCHEDULER
drivers/gpu/drm/xlnx/zynqmp_dp.c +679 -3
779 lines not on this page · raw message
Signature · 1 line
2.35.1.1320.gc452695387.dirty
Tomi Valkeinen
maintainerHi Sean,
Quoted 7 lines · Sean Anderson
This series cleans up the
zyqnmp_dpIRQ and locking situation. Once that's done, it adds debugfs support. The intent is to enable compliance testing or to help debug signal-integrity issues.Last time I discussed converting the HPD work(s) to a threaded IRQ. I did not end up doing that for this series since the steps would be
Quoted 7 lines
- Add locking
- Move link retraining to a work function
- Harden the IRQ
- Merge the works into a threaded IRQ (omitted)Which with the exception of the final step is the same as leaving those works as-is. Conversion to a threaded IRQ can be done as a follow-up.
If it's ok to you, I'd like to pick the first four patches to drm-misc already.
Tomi
Quoted 48 lines
Changes in v4:
- Rebase onto drm/drm-nextChanges in v3:
- Store base pointers inzynqmp_dispdirectly
- Don't delay work
- Convert to a hard IRQ
- Use AUX IRQs instead of polling
- Takedp->lockinzynqmp_dp_hpd_work_funcChanges in v2:
- Fix kerneldoc
- Rearrangezynqmp_dpfor better padding
- Split off the HPD IRQ work into another commit
- Expand the commit message
- Documenthpd_irq_work
- Document debugfs files
- Addignore_aux_errorsandignore_hpddebugfs files to replace earlier implicit functionality
- Attempt to fix unreproducable, spurious build warning
- Drop "Optionally ignore DPCD errors" in favor of a debugfs file directly affectingzynqmp_dp_aux_transfer.Sean Anderson (13):
drm: xlnx: Store base pointers inzynqmp_dispdirectly
drm: xlnx: Fix kerneldoc
drm:zynqmp_dp: Downgrade log level for aux retries message
drm:zynqmp_dp: Adjust training values per-lane
drm:zynqmp_dp: Rearrangezynqmp_dpfor better padding
drm:zynqmp_dp: Don't delay work
drm:zynqmp_dp: Add locking
drm:zynqmp_dp: Don't retrain the link in our IRQ
drm:zynqmp_dp: Convert to a hard IRQ
drm:zynqmp_dp: Use AUX IRQs instead of polling
drm:zynqmp_dp: Split off several helper functions
drm:zynqmp_dp: Takedp->lockinzynqmp_dp_hpd_work_func
drm:zynqmp_dp: Add debugfs interface for compliance testingDocumentation/gpu/drivers.rst | 1 + Documentation/gpu/zynqmp.rst | 149 +++++ MAINTAINERS | 1 + drivers/gpu/drm/xlnx/zynqmp_disp.c | 44 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 908 +++++++++++++++++++++++++--- drivers/gpu/drm/xlnx/zynqmp_dpsub.h | 1 + drivers/gpu/drm/xlnx/zynqmp_kms.h | 4 +- 7 files changed, 999 insertions(+), 109 deletions(-)create mode 100644
Documentation/gpu/zynqmp.rst
Quoted 15 lines · Tomi Valkeinen
Hi Sean,
Quoted 12 lines · Sean Anderson
This series cleans up the
zyqnmp_dpIRQ and locking situation. Once that's done, it adds debugfs support. The intent is to enable compliance testing or to help debug signal-integrity issues.Last time I discussed converting the HPD work(s) to a threaded IRQ. I did not end up doing that for this series since the steps would be
- Add locking
- Move link retraining to a work function
- Harden the IRQ
- Merge the works into a threaded IRQ (omitted)
Quoted 4 lines
Quoted 2 lines
Which with the exception of the final step is the same as leaving those works as-is. Conversion to a threaded IRQ can be done as a follow-up.
If it's ok to you, I'd like to pick the first four patches to drm-misc already.
Fine by me.
--Sean
Tomi Valkeinen
maintainerQuoted 16 lines · Sean Anderson
Quoted 15 lines · Tomi Valkeinen
Hi Sean,
Quoted 12 lines · Sean Anderson
This series cleans up the
zyqnmp_dpIRQ and locking situation. Once that's done, it adds debugfs support. The intent is to enable compliance testing or to help debug signal-integrity issues.Last time I discussed converting the HPD work(s) to a threaded IRQ. I did not end up doing that for this series since the steps would be
- Add locking
- Move link retraining to a work function
- Harden the IRQ
- Merge the works into a threaded IRQ (omitted)
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Which with the exception of the final step is the same as leaving those works as-is. Conversion to a threaded IRQ can be done as a follow-up.
If it's ok to you, I'd like to pick the first four patches to drm-misc already.
Fine by me.
I have pushed the first four to drm-misc. I'll try to look at the rest of the patches next week.
Tomi