search for: drm_dp_dpcd_writeb

Displaying 20 results from an estimated 38 matches for "drm_dp_dpcd_writeb".

2024 Dec 11
4
[PATCH v2 1/4] drm/dp: Add helper to set LTTPRs in transparent mode
...gt; + * > + * Returns 0 on success or a negative error code on failure. > + */ > +int drm_dp_lttpr_set_transparent_mode(struct drm_dp_aux *aux, bool enable) > +{ > + u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : > + DP_PHY_REPEATER_MODE_NON_TRANSPARENT; > + int ret = drm_dp_dpcd_writeb(aux, DP_PHY_REPEATER_MODE, val); > + > + return ret == 1 ? 0 : ret; This looks correct, but I had to go look at drm_dp_dpcd_writeb() to make sure it never returns 0 (for short transfers). > +} > +EXPORT_SYMBOL(drm_dp_lttpr_set_transparent_mode); This appears to be what the driver cur...
2024 Dec 30
1
[PATCH v2 1/4] drm/dp: Add helper to set LTTPRs in transparent mode
...> > + */ > >> > +int drm_dp_lttpr_set_transparent_mode(struct drm_dp_aux *aux, bool enable) > >> > +{ > >> > + u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : > >> > + DP_PHY_REPEATER_MODE_NON_TRANSPARENT; > >> > + int ret = drm_dp_dpcd_writeb(aux, DP_PHY_REPEATER_MODE, val); > >> > + > >> > + return ret == 1 ? 0 : ret; > >> > >> This looks correct, but I had to go look at drm_dp_dpcd_writeb() to make > >> sure it never returns 0 (for short transfers). > > > > Will follow Dm...
2024 Dec 30
1
[PATCH v2 1/4] drm/dp: Add helper to set LTTPRs in transparent mode
...ror code on failure. >> > + */ >> > +int drm_dp_lttpr_set_transparent_mode(struct drm_dp_aux *aux, bool enable) >> > +{ >> > + u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : >> > + DP_PHY_REPEATER_MODE_NON_TRANSPARENT; >> > + int ret = drm_dp_dpcd_writeb(aux, DP_PHY_REPEATER_MODE, val); >> > + >> > + return ret == 1 ? 0 : ret; >> >> This looks correct, but I had to go look at drm_dp_dpcd_writeb() to make >> sure it never returns 0 (for short transfers). > > Will follow Dmitry's proposal here. > >...
2024 Dec 26
1
[PATCH v2 1/4] drm/dp: Add helper to set LTTPRs in transparent mode
...success or a negative error code on failure. > > + */ > > +int drm_dp_lttpr_set_transparent_mode(struct drm_dp_aux *aux, bool enable) > > +{ > > + u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : > > + DP_PHY_REPEATER_MODE_NON_TRANSPARENT; > > + int ret = drm_dp_dpcd_writeb(aux, DP_PHY_REPEATER_MODE, val); > > + > > + return ret == 1 ? 0 : ret; > > This looks correct, but I had to go look at drm_dp_dpcd_writeb() to make > sure it never returns 0 (for short transfers). Will follow Dmitry's proposal here. if (ret < 0) return ret;...
2018 Aug 09
2
[PATCH 0/2] Fix display detection issues with P50-P52 docks
This fixes some annoying issues on the P50-P52 with displays not being detected if they aren't plugged in at boot, and sometimes even when they are plugged in at boot. See: https://bugzilla.redhat.com/show_bug.cgi?id=1477182 Lyude Paul (2): drm/nouveau: Only write DP_MSTM_CTRL when needed drm/nouveau: Reset MST branching unit before enabling drivers/gpu/drm/nouveau/dispnv50/disp.c | 65
2019 Oct 22
0
[PATCH v5 08/14] drm/dp_mst: Lessen indenting in drm_dp_mst_topology_mgr_resume()
...g suspend?\n"); + goto out_fail; + } - sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE); - if (sret != DP_RECEIVER_CAP_SIZE) { - DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n"); - ret = -1; - goto out_unlock; - } + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | + DP_UP_REQ_EN | + DP_UPSTREAM_IS_SRC); + if (ret < 0) { + DRM_DEBUG_KMS("mst write failed - undocked during suspend?\n"); + goto out_fail; + } - ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, - DP_MST_EN | DP_UP_REQ_E...
2020 Nov 14
0
[PATCH 2/8] drm/nouveau/kms/nv50-: Remove (nv_encoder->crtc) checks in ->disable callbacks
...t;type == DCB_OUTPUT_DP) { + int ret = drm_dp_dpcd_readb(aux, DP_SET_POWER, &pwr); - if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { - int ret = drm_dp_dpcd_readb(aux, DP_SET_POWER, &pwr); - - if (ret == 0) { - pwr &= ~DP_SET_POWER_MASK; - pwr |= DP_SET_POWER_D3; - drm_dp_dpcd_writeb(aux, DP_SET_POWER, pwr); - } + if (ret == 0) { + pwr &= ~DP_SET_POWER_MASK; + pwr |= DP_SET_POWER_D3; + drm_dp_dpcd_writeb(aux, DP_SET_POWER, pwr); } - - nv_encoder->update(nv_encoder, nv_crtc->index, NULL, 0, 0); - nv50_audio_disable(encoder, nv_crtc); - nv50_hdmi_disable...
2024 Dec 11
4
[PATCH v2 0/4] drm/dp: Rework LTTPR transparent mode handling and add support to msm driver
Looking at both i915 and nouveau DP drivers, both are setting the first LTTPR (if found) in transparent mode first and then in non-transparent mode, just like the DP v2.0 specification mentions in section 3.6.6.1. Being part of the standard, setting the LTTPR in a specific operation mode can be easily moved in the generic framework. So do that by adding a new helper. Then, the msm DP driver is
2025 Jan 03
4
[PATCH v3 0/4] drm/dp: Rework LTTPR transparent mode handling and add support to msm driver
Looking at both i915 and nouveau DP drivers, both are setting the first LTTPR (if found) in transparent mode first and then in non-transparent mode, just like the DP v2.0 specification mentions in section 3.6.6.1. Being part of the standard, setting the LTTPR in a specific operation mode can be easily moved in the generic framework. So do that by adding a new helper. Then, the msm DP driver is
2025 Feb 03
7
[PATCH v5 0/4] drm/dp: Rework LTTPR transparent mode handling and add support to msm driver
Looking at both i915 and nouveau DP drivers, both are setting the first LTTPR (if found) in transparent mode first and then in non-transparent mode, just like the DP v2.0 specification mentions in section 3.6.6.1. Being part of the standard, setting the LTTPR in a specific operation mode can be easily moved in the generic framework. So do that by adding a new helper. Then, the msm DP driver is
2019 Sep 27
1
[PATCH v2 25/27] drm/dp_mst: Add basic topology reprobing when resuming
...} > > - sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE); > - if (sret != DP_RECEIVER_CAP_SIZE) { > - DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n"); > - ret = -1; > - goto out_unlock; > - } > + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, > + DP_MST_EN | > + DP_UP_REQ_EN | > + DP_UPSTREAM_IS_SRC); > + if (ret < 0) { > + DRM_DEBUG_KMS("mst write failed - undocked during suspend?\n"); > + goto out_fail; > + } > > - ret = drm_dp_dpcd_writeb(mgr->aux,...
2019 Sep 03
0
[PATCH v2 25/27] drm/dp_mst: Add basic topology reprobing when resuming
...g suspend?\n"); + goto out_fail; + } - sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE); - if (sret != DP_RECEIVER_CAP_SIZE) { - DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n"); - ret = -1; - goto out_unlock; - } + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | + DP_UP_REQ_EN | + DP_UPSTREAM_IS_SRC); + if (ret < 0) { + DRM_DEBUG_KMS("mst write failed - undocked during suspend?\n"); + goto out_fail; + } - ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, - DP_MST_EN | DP_UP_REQ_E...
2020 Aug 19
2
[RFC 19/20] drm/i915/dp: Extract drm_dp_read_dpcd_caps()
...d failed\n"); > return false; > } > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h > index 0c141fc81aaa8..11649e93e5bb6 100644 > --- a/include/drm/drm_dp_helper.h > +++ b/include/drm/drm_dp_helper.h > @@ -1607,6 +1607,9 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, > return drm_dp_dpcd_write(aux, offset, &value, 1); > } > > +int drm_dp_read_dpcd_caps(struct drm_dp_aux *aux, > + u8 dpcd[DP_RECEIVER_CAP_SIZE]); > + > int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, > u8 status[DP_LINK_S...
2018 Nov 17
3
[PATCH 0/2] drm/nouveau: Fix DP AUX RPM issues
Here's some fixes for the less important DP AUX issues I mentioned a while back. Lyude Paul (2): drm/dp: Add ->pre/post_transfer() hooks for drm_dp_aux drm/nouveau: Grab an rpm reference before/after DP AUX transactions drivers/gpu/drm/drm_dp_helper.c | 5 ++ drivers/gpu/drm/nouveau/nouveau_connector.c | 36 ++++++++ drivers/gpu/drm/nouveau/nouveau_drm.c | 12 ++-
2025 Jan 03
2
[PATCH v3 1/4] drm/dp: Add helper to set LTTPRs in transparent mode
...le: Enable or disable transparent mode + * + * Returns 0 on success or a negative error code on failure. + */ +int drm_dp_lttpr_set_transparent_mode(struct drm_dp_aux *aux, bool enable) +{ + u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : + DP_PHY_REPEATER_MODE_NON_TRANSPARENT; + int ret = drm_dp_dpcd_writeb(aux, DP_PHY_REPEATER_MODE, val); + + if (ret < 0) + return ret; + + return (ret == 1) ? 0 : -EIO; +} +EXPORT_SYMBOL(drm_dp_lttpr_set_transparent_mode); + +/** + * drm_dp_lttpr_init - init LTTPR transparency mode according to DP standard + * + * @aux: DisplayPort AUX channel + * @lttpr_count: Nu...
2019 Jul 18
2
[PATCH 00/26] DP MST Refactors + debugging tools + suspend/resume reprobing
This is the large series for adding MST suspend/resume reprobing that I've been working on for quite a while now. In addition, I: - Refactored and cleaned up any code I ended up digging through in the process of understanding how some parts of these helpers worked. - Added some debugging tools along the way that I ended up needing to figure out some issues in my own code Note that
2020 Aug 11
0
[RFC 19/20] drm/i915/dp: Extract drm_dp_read_dpcd_caps()
...DRM_ERROR("LSPCON DPCD read failed\n"); return false; } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 0c141fc81aaa8..11649e93e5bb6 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1607,6 +1607,9 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, return drm_dp_dpcd_write(aux, offset, &value, 1); } +int drm_dp_read_dpcd_caps(struct drm_dp_aux *aux, + u8 dpcd[DP_RECEIVER_CAP_SIZE]); + int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, u8 status[DP_LINK_STATUS_SIZE]); -- 2.26.2
2019 Sep 03
0
[PATCH v2 19/27] drm/dp_mst: Handle UP requests asynchronously
...truct drm_dp_sideband_msg_hdr hdr; + struct drm_dp_sideband_msg_req_body msg; + struct list_head next; +}; + static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, char *buf); @@ -3109,6 +3115,7 @@ void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr) drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, DP_MST_EN | DP_UPSTREAM_IS_SRC); mutex_unlock(&mgr->lock); + flush_work(&mgr->up_req_work); flush_work(&mgr->work); flush_work(&mgr->delayed_destroy_work); } @@ -3281,12 +3288,70 @@ static int drm_dp_mst_handle_down_rep(struct drm...
2019 Oct 22
0
[PATCH v5 04/14] drm/dp_mst: Handle UP requests asynchronously
...truct drm_dp_sideband_msg_hdr hdr; + struct drm_dp_sideband_msg_req_body msg; + struct list_head next; +}; + static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, char *buf); @@ -3091,6 +3097,7 @@ void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr) drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, DP_MST_EN | DP_UPSTREAM_IS_SRC); mutex_unlock(&mgr->lock); + flush_work(&mgr->up_req_work); flush_work(&mgr->work); flush_work(&mgr->delayed_destroy_work); } @@ -3263,12 +3270,70 @@ static int drm_dp_mst_handle_down_rep(struct drm...
2020 Aug 25
22
[RFC v4 00/20] drm/dp, i915, nouveau: Cleanup nouveau HPD and add DP features from i915
Most of the reason I'm asking for an RFC here is because this code pulls a lot of code out of i915 and into shared DP helpers. Anyway-nouveau's HPD related code has been collecting dust for a while. Other then the occasional runtime PM related and MST related fixes, we're missing a lot of nice things that have been added to DRM since this was originally written. Additionally, the code