Add support to pack and send the VSC SDP packet for DP. This therefore allows the transmision of format information to the sinks which is needed for YUV420 support over DP. Changes in v5: - Slightly modify use of drm_dp_vsc_sdp_pack() - Remove dp_catalog NULL checks - Modify dp_utils_pack_sdp_header() to more clearly pack the header buffer - Move dp_utils_pack_sdp_header() inside of dp_catalog_panel_send_vsc_sdp to clearly show the relationship between the header buffer and the vsc_sdp struct - Due to the last point, remove the dp_utils_pack_vsc_sdp() function and only call drm_dp_vsc_sdp_pack() in dp_panel_setup_vsc_sdp_yuv_420() Changes in v4: - Remove struct msm_dp_sdp_with_parity - Use dp_utils_pack_sdp_header() to pack the SDP header and parity bytes into a buffer - Use this buffer when writing the VSC SDP data in dp_catalog_panel_send_vsc_sdp() - Write to all of the MMSS_DP_GENERIC0 registers instead of just the ones with non-zero values Changes in v3: - Create a new struct, msm_dp_sdp_with_parity, which holds the packing information for VSC SDP - Use drm_dp_vsc_sdp_pack() to pack the data into the new msm_dp_sdp_with_parity struct instead of specifically packing for YUV420 format - Modify dp_catalog_panel_send_vsc_sdp() to send the VSC SDP data using the new msm_dp_sdp_with_parity struct Changes in v2: - Rename GENERIC0_SDPSIZE macro to GENERIC0_SDPSIZE_VALID - Remove dp_sdp from the dp_catalog struct since this data is being allocated at the point used - Create a new function in dp_utils to pack the VSC SDP data into a buffer - Create a new function that packs the SDP header bytes into a buffer. This function is made generic so that it can be utilized by dp_audio header bytes into a buffer - Create a new function in dp_utils that takes the packed buffer and writes to the DP_GENERIC0_* registers - Split the dp_catalog_panel_config_vsc_sdp() function into two to disable/enable sending VSC SDP packets - Check the DP HW version using the original useage of dp_catalog_hw_revision() and correct the version checking logic - Rename dp_panel_setup_vsc_sdp() to dp_panel_setup_vsc_sdp_yuv_420() to explicitly state that currently VSC SDP is only being set up to support YUV420 modes Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/579636/ Link: https://lore.kernel.org/r/20240222194025.25329-14-quic_parellan@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2024, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _DP_UTILS_H_
|
|
#define _DP_UTILS_H_
|
|
|
|
#include <linux/bitfield.h>
|
|
#include <linux/bits.h>
|
|
#include <drm/display/drm_dp_helper.h>
|
|
|
|
#define HEADER_BYTE_0_BIT 0
|
|
#define PARITY_BYTE_0_BIT 8
|
|
#define HEADER_BYTE_1_BIT 16
|
|
#define PARITY_BYTE_1_BIT 24
|
|
#define HEADER_BYTE_2_BIT 0
|
|
#define PARITY_BYTE_2_BIT 8
|
|
#define HEADER_BYTE_3_BIT 16
|
|
#define PARITY_BYTE_3_BIT 24
|
|
|
|
#define HEADER_0_MASK GENMASK(7, 0)
|
|
#define PARITY_0_MASK GENMASK(15, 8)
|
|
#define HEADER_1_MASK GENMASK(23, 16)
|
|
#define PARITY_1_MASK GENMASK(31, 24)
|
|
#define HEADER_2_MASK GENMASK(7, 0)
|
|
#define PARITY_2_MASK GENMASK(15, 8)
|
|
#define HEADER_3_MASK GENMASK(23, 16)
|
|
#define PARITY_3_MASK GENMASK(31, 24)
|
|
|
|
u8 dp_utils_get_g0_value(u8 data);
|
|
u8 dp_utils_get_g1_value(u8 data);
|
|
u8 dp_utils_calculate_parity(u32 data);
|
|
ssize_t dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 *header_buff);
|
|
|
|
#endif /* _DP_UTILS_H_ */
|