Skip to content

Commit 21497a4

Browse files
Paloma Arellanolumag
authored andcommitted
drm/msm/dp: enable SDP and SDE periph flush update
DP controller can be setup to operate in either SDP update flush mode or peripheral flush mode based on the DP controller hardware version. Starting in DP v1.2, the hardware documents require the use of peripheral flush mode for SDP packets such as PPS OR VSC SDP packets. In-line with this guidance, lets program the DP controller to use peripheral flush mode starting DP v1.2 Changes in v4: - Clear up that DP_MAINLINK_CTRL_FLUSH_MODE register requires the use of bits [24:23] - Modify macros DP_MAINLINK_FLUSH_MODE_UPDATE_SDP and DP_MAINLINK_FLUSH_MODE_SDP_PERIPH_UPDATE to explicitly set their values in the bits of DP_MAINLINK_CTRL_FLUSH_MODE_MASK Changes in v3: - Clear up that the DP_MAINLINK_FLUSH_MODE_SDE_PERIPH_UPDATE macro is setting bits [24:23] to a value of 3 Changes in v2: - Use the original dp_catalog_hw_revision() function to correctly check the DP HW version Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/579621/ Link: https://lore.kernel.org/r/20240222194025.25329-16-quic_parellan@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 64f7b81 commit 21497a4

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

drivers/gpu/drm/msm/dp/dp_catalog.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,23 @@ void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog,
450450
dp_write_link(catalog, REG_DP_MISC1_MISC0, misc_val);
451451
}
452452

453+
void dp_catalog_setup_peripheral_flush(struct dp_catalog *dp_catalog)
454+
{
455+
u32 mainlink_ctrl, hw_revision;
456+
struct dp_catalog_private *catalog = container_of(dp_catalog,
457+
struct dp_catalog_private, dp_catalog);
458+
459+
mainlink_ctrl = dp_read_link(catalog, REG_DP_MAINLINK_CTRL);
460+
461+
hw_revision = dp_catalog_hw_revision(dp_catalog);
462+
if (hw_revision >= DP_HW_VERSION_1_2)
463+
mainlink_ctrl |= DP_MAINLINK_FLUSH_MODE_SDE_PERIPH_UPDATE;
464+
else
465+
mainlink_ctrl |= DP_MAINLINK_FLUSH_MODE_UPDATE_SDP;
466+
467+
dp_write_link(catalog, REG_DP_MAINLINK_CTRL, mainlink_ctrl);
468+
}
469+
453470
void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog,
454471
u32 rate, u32 stream_rate_khz,
455472
bool fixed_nvid, bool is_ycbcr_420)

drivers/gpu/drm/msm/dp/dp_catalog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ void dp_catalog_ctrl_config_ctrl(struct dp_catalog *dp_catalog, u32 config);
9696
void dp_catalog_ctrl_lane_mapping(struct dp_catalog *dp_catalog);
9797
void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog, bool enable);
9898
void dp_catalog_ctrl_psr_mainlink_enable(struct dp_catalog *dp_catalog, bool enable);
99+
void dp_catalog_setup_peripheral_flush(struct dp_catalog *dp_catalog);
99100
void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog, u32 cc, u32 tb);
100101
void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate,
101102
u32 stream_rate_khz, bool fixed_nvid, bool is_ycbcr_420);

drivers/gpu/drm/msm/dp/dp_ctrl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ static void dp_ctrl_configure_source_params(struct dp_ctrl_private *ctrl)
179179

180180
dp_catalog_ctrl_lane_mapping(ctrl->catalog);
181181
dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, true);
182+
dp_catalog_setup_peripheral_flush(ctrl->catalog);
182183

183184
dp_ctrl_config_ctrl(ctrl);
184185

drivers/gpu/drm/msm/dp/dp_reg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#ifndef _DP_REG_H_
77
#define _DP_REG_H_
88

9+
#include <linux/bitfield.h>
10+
#include <linux/bits.h>
11+
912
/* DP_TX Registers */
1013
#define REG_DP_HW_VERSION (0x00000000)
1114

@@ -102,6 +105,9 @@
102105
#define DP_MAINLINK_CTRL_ENABLE (0x00000001)
103106
#define DP_MAINLINK_CTRL_RESET (0x00000002)
104107
#define DP_MAINLINK_CTRL_SW_BYPASS_SCRAMBLER (0x00000010)
108+
#define DP_MAINLINK_CTRL_FLUSH_MODE_MASK GENMASK(24, 23)
109+
#define DP_MAINLINK_FLUSH_MODE_UPDATE_SDP FIELD_PREP(DP_MAINLINK_CTRL_FLUSH_MODE_MASK, 1)
110+
#define DP_MAINLINK_FLUSH_MODE_SDE_PERIPH_UPDATE FIELD_PREP(DP_MAINLINK_CTRL_FLUSH_MODE_MASK, 3)
105111
#define DP_MAINLINK_FB_BOUNDARY_SEL (0x02000000)
106112

107113
#define REG_DP_STATE_CTRL (0x00000004)

0 commit comments

Comments
 (0)