Commit b55b88d8 authored by Abhinav Kumar's avatar Abhinav Kumar Committed by Dmitry Baryshkov

drm/dp: drop the size parameter from drm_dp_vsc_sdp_pack()

Currently the size parameter of drm_dp_vsc_sdp_pack() is always
the size of struct dp_sdp. Hence lets drop this parameter and
use sizeof() directly.
Suggested-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Acked-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240220195348.1270854-2-quic_abhinavk@quicinc.com
parent 47f419e0
...@@ -2918,19 +2918,15 @@ EXPORT_SYMBOL(drm_dp_vsc_sdp_log); ...@@ -2918,19 +2918,15 @@ EXPORT_SYMBOL(drm_dp_vsc_sdp_log);
* @vsc: vsc sdp initialized according to its purpose as defined in * @vsc: vsc sdp initialized according to its purpose as defined in
* table 2-118 - table 2-120 in DP 1.4a specification * table 2-118 - table 2-120 in DP 1.4a specification
* @sdp: valid handle to the generic dp_sdp which will be packed * @sdp: valid handle to the generic dp_sdp which will be packed
* @size: valid size of the passed sdp handle
* *
* Returns length of sdp on success and error code on failure * Returns length of sdp on success and error code on failure
*/ */
ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc,
struct dp_sdp *sdp, size_t size) struct dp_sdp *sdp)
{ {
size_t length = sizeof(struct dp_sdp); size_t length = sizeof(struct dp_sdp);
if (size < length) memset(sdp, 0, sizeof(struct dp_sdp));
return -ENOSPC;
memset(sdp, 0, size);
/* /*
* Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119 * Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119
......
...@@ -4202,8 +4202,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, ...@@ -4202,8 +4202,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder,
switch (type) { switch (type) {
case DP_SDP_VSC: case DP_SDP_VSC:
len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp, len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp);
sizeof(sdp));
break; break;
case HDMI_PACKET_TYPE_GAMUT_METADATA: case HDMI_PACKET_TYPE_GAMUT_METADATA:
len = intel_dp_hdr_metadata_infoframe_sdp_pack(dev_priv, len = intel_dp_hdr_metadata_infoframe_sdp_pack(dev_priv,
......
...@@ -812,7 +812,6 @@ int drm_dp_bw_overhead(int lane_count, int hactive, ...@@ -812,7 +812,6 @@ int drm_dp_bw_overhead(int lane_count, int hactive,
int bpp_x16, unsigned long flags); int bpp_x16, unsigned long flags);
int drm_dp_bw_channel_coding_efficiency(bool is_uhbr); int drm_dp_bw_channel_coding_efficiency(bool is_uhbr);
ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, struct dp_sdp *sdp);
struct dp_sdp *sdp, size_t size);
#endif /* _DRM_DP_HELPER_H_ */ #endif /* _DRM_DP_HELPER_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment