search for: dp_receiver_cap_size

Displaying 20 results from an estimated 39 matches for "dp_receiver_cap_size".

2023 Feb 04
1
[PATCH] drm/nouveau/disp: More DP_RECEIVER_CAP_SIZE array fixes
More arrays (and arguments) for dcpd were set to 16, when it looks like DP_RECEIVER_CAP_SIZE (15) should be used. Fix the remaining cases, seen with GCC 13: ../drivers/gpu/drm/nouveau/nvif/outp.c: In function 'nvif_outp_acquire_dp': ../include/linux/fortify-string.h:57:33: warning: array subscript 'unsigned char[16][0]' is partly outside array bounds of 'u8[15]' {a...
2023 May 22
0
[PATCH 6.3 004/364] drm/nouveau/disp: More DP_RECEIVER_CAP_SIZE array fixes
From: Kees Cook <keescook at chromium.org> [ Upstream commit 25feda6fbd0cfefcb69308fb20d4d4815a107c5e ] More arrays (and arguments) for dcpd were set to 16, when it looks like DP_RECEIVER_CAP_SIZE (15) should be used. Fix the remaining cases, seen with GCC 13: ../drivers/gpu/drm/nouveau/nvif/outp.c: In function 'nvif_outp_acquire_dp': ../include/linux/fortify-string.h:57:33: warning: array subscript 'unsigned char[16][0]' is partly outside array bounds of 'u8[15]' {a...
2020 Aug 19
2
[RFC 19/20] drm/i915/dp: Extract drm_dp_read_dpcd_caps()
..._helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -423,6 +423,82 @@ bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, > } > EXPORT_SYMBOL(drm_dp_send_real_edid_checksum); > > +static int drm_dp_read_extended_dpcd_caps(struct drm_dp_aux *aux, > + u8 dpcd[DP_RECEIVER_CAP_SIZE]) > +{ > + u8 dpcd_ext[6]; > + int ret; > + > + /* > + * Prior to DP1.3 the bit represented by > + * DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT was reserved. > + * If it is set DP_DPCD_REV at 0000h could be at a value less than > + * the true capability of the panel. The...
2020 Aug 26
0
[PATCH v5 13/20] drm/i915/dp: Extract drm_dp_read_downstream_info()
...4c21cf69dad5a..f3643894ad951 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -423,6 +423,56 @@ bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_send_real_edid_checksum); +static u8 drm_dp_downstream_port_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + u8 port_count = dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_PORT_COUNT_MASK; + + if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE && port_count > 4) + port_count = 4; + + return port_count; +} + +/** + * drm_dp_read_downstream_info() - read DPCD downstream po...
2020 Aug 19
3
[RFC 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...ore the downstream port info in > + * > + * Returns: 0 if either the downstream port info was read successfully or > + * there was no downstream info to read, or a negative error code otherwise. > + */ > +int drm_dp_downstream_read_info(struct drm_dp_aux *aux, > + const u8 dpcd[DP_RECEIVER_CAP_SIZE], > + u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]) > +{ > + int ret; > + u8 len; > + > + memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS); > + > + /* No downstream info to read */ > + if (!drm_dp_is_branch(dpcd) || > + dpcd[DP_DPCD_REV] < DP_DPCD_REV_10...
2020 Aug 11
0
[RFC 19/20] drm/i915/dp: Extract drm_dp_read_dpcd_caps()
...100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -423,6 +423,82 @@ bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_send_real_edid_checksum); +static int drm_dp_read_extended_dpcd_caps(struct drm_dp_aux *aux, + u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + u8 dpcd_ext[6]; + int ret; + + /* + * Prior to DP1.3 the bit represented by + * DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT was reserved. + * If it is set DP_DPCD_REV at 0000h could be at a value less than + * the true capability of the panel. The only way to check is to + * then compare 000...
2020 Aug 20
0
[RFC v2 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...4c21cf69dad5a..4f845995f1f66 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -423,6 +423,52 @@ bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_send_real_edid_checksum); +static u8 drm_dp_downstream_port_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + u8 port_count = dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_PORT_COUNT_MASK; + + if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE && port_count > 4) + port_count = 4; + + return port_count; +} + +/** + * drm_dp_downstream_read_info() - read DPCD downstream po...
2019 Oct 22
0
[PATCH v5 08/14] drm/dp_mst: Lessen indenting in drm_dp_mst_topology_mgr_resume()
...e(struct drm_dp_mst_topology_mgr *mgr) { - int ret = 0; + int ret; + u8 guid[16]; mutex_lock(&mgr->lock); + if (!mgr->mst_primary) + goto out_fail; - if (mgr->mst_primary) { - int sret; - u8 guid[16]; + ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, + DP_RECEIVER_CAP_SIZE); + if (ret != DP_RECEIVER_CAP_SIZE) { + DRM_DEBUG_KMS("dpcd read failed - undocked during 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 r...
2022 Nov 27
1
[PATCH] drm/nouveau/disp: Fix nvif_outp_acquire_dp() argument size
...ar[16]'} drivers/gpu/drm/nouveau/include/nvif/outp.h:24:5: note: in a call to function 'nvif_outp_acquire_dp' 24 | int nvif_outp_acquire_dp(struct nvif_outp *, u8 dpcd[16], | ^~~~~~~~~~~~~~~~~~~~ Avoid these warnings by defining the argument size using the matching define (DP_RECEIVER_CAP_SIZE, 15) instead of having it be a literal (and incorrect) value (16). Reported-by: coverity-bot <keescook+coverity-bot at chromium.org> Addresses-Coverity-ID: 1527269 ("Memory - corruptions") Addresses-Coverity-ID: 1527268 ("Memory - corruptions") Link: https://lore.kernel.o...
2020 Aug 11
0
[RFC 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...downstream_ports: buffer to store the downstream port info in + * + * Returns: 0 if either the downstream port info was read successfully or + * there was no downstream info to read, or a negative error code otherwise. + */ +int drm_dp_downstream_read_info(struct drm_dp_aux *aux, + const u8 dpcd[DP_RECEIVER_CAP_SIZE], + u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]) +{ + int ret; + u8 len; + + memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS); + + /* No downstream info to read */ + if (!drm_dp_is_branch(dpcd) || + dpcd[DP_DPCD_REV] < DP_DPCD_REV_10 || + !(dpcd[DP_DOWNSTREAMPORT_PRESENT] & D...
2023 Jan 25
1
[PATCH] drm/nouveau/disp: Fix nvif_outp_acquire_dp() argument size
...outp.h:24:5: note: in a call to function 'nvif_outp_acquire_dp' > > 24 | int nvif_outp_acquire_dp(struct nvif_outp *, u8 dpcd[16], > > | ^~~~~~~~~~~~~~~~~~~~ > > > > Avoid these warnings by defining the argument size using the matching > > define (DP_RECEIVER_CAP_SIZE, 15) instead of having it be a literal > > (and incorrect) value (16). > > > > Reported-by: coverity-bot <keescook+coverity-bot at chromium.org> > > Addresses-Coverity-ID: 1527269 ("Memory - corruptions") > > Addresses-Coverity-ID: 1527268 ("Memor...
2020 Aug 11
29
[RFC 00/20] drm/dp, i915, nouveau: Cleanup nouveau HPD and add DP features from i915
To start off: this patch series is less work to review then it looks - most (but not all) of the nouveau related work has already been reviewed elsewhere. 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
2020 Aug 26
23
[PATCH v5 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
2020 Aug 20
2
[RFC 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...ns: 0 if either the downstream port info was read successfully or > > > + * there was no downstream info to read, or a negative error code > > > otherwise. > > > + */ > > > +int drm_dp_downstream_read_info(struct drm_dp_aux *aux, > > > + const u8 dpcd[DP_RECEIVER_CAP_SIZE], > > > + u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]) > > > +{ > > > + int ret; > > > + u8 len; > > > + > > > + memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS); > > > + > > > + /* No downstream info to read */ > &g...
2020 Aug 19
0
[RFC 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...; + * > > + * Returns: 0 if either the downstream port info was read successfully or > > + * there was no downstream info to read, or a negative error code > > otherwise. > > + */ > > +int drm_dp_downstream_read_info(struct drm_dp_aux *aux, > > + const u8 dpcd[DP_RECEIVER_CAP_SIZE], > > + u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]) > > +{ > > + int ret; > > + u8 len; > > + > > + memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS); > > + > > + /* No downstream info to read */ > > + if (!drm_dp_is_branch(dpcd) || >...
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
2020 Aug 20
22
[RFC v2 00/20] drm/dp, i915, nouveau: Cleanup nouveau HPD and add DP features from i915
To start off: this patch series is less work to review then it looks - most (but not all) of the nouveau related work has already been reviewed elsewhere. 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
2012 Oct 18
13
[PATCH 00/10] extract dp helper functions
Hi all, I've frustrated myself the last few days yelling at our link training code. Comparing the i915 code to radeon and nouveau I've noticed the lack of a nice set of dp helper functions. So I've started to extract a few. There's lots more that we can do I think (link configuration selection, the i2c over aux retry stuff which diverges already between i915 and radeon, maybe
2023 Jul 07
2
[PATCH] drm/nouveau/nvkm/dp: Add hack to fix DP 1.3+ DPCD issues
...ack, and this is just drm_dp_read_dpcd_caps() + * converted to work inside nvkm. This is a temporary holdover until we start + * passing the drm_dp_aux device through NVKM + */ +static int +nvkm_dp_read_dpcd_caps(struct nvkm_outp *outp) +{ + struct nvkm_i2c_aux *aux = outp->dp.aux; + u8 dpcd_ext[DP_RECEIVER_CAP_SIZE]; + int ret; + + ret = nvkm_rdaux(aux, DPCD_RC00_DPCD_REV, outp->dp.dpcd, DP_RECEIVER_CAP_SIZE); + if (ret < 0) + return ret; + + /* + * Prior to DP1.3 the bit represented by + * DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT was reserved. + * If it is set DP_DPCD_REV at 0000h could be at a value...
2020 Aug 21
0
[RFC 13/20] drm/i915/dp: Extract drm_dp_downstream_read_info()
...read successfully > > > > or > > > > + * there was no downstream info to read, or a negative error code > > > > otherwise. > > > > + */ > > > > +int drm_dp_downstream_read_info(struct drm_dp_aux *aux, > > > > + const u8 dpcd[DP_RECEIVER_CAP_SIZE], > > > > + u8 > > > > downstream_ports[DP_MAX_DOWNSTREAM_PORTS]) > > > > +{ > > > > + int ret; > > > > + u8 len; > > > > + > > > > + memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS); > > > > + &g...