Skip to content

Commit c943b49

Browse files
Chandan Uddarajurobclark
authored andcommitted
drm/msm/dp: add displayPort driver support
Add the needed displayPort files to enable DP driver on msm target. "dp_display" module is the main module that calls into other sub-modules. "dp_drm" file represents the interface between DRM framework and DP driver. Changes in v12: -- Add support of pm ops in display port driver -- Clear bpp depth bits before writing to MISC register -- Fix edid read Previous Change log: https://lkml.kernel.org/lkml/[email protected]/ Signed-off-by: Chandan Uddaraju <[email protected]> Signed-off-by: Vara Reddy <[email protected]> Signed-off-by: Tanmay Shah <[email protected]> Co-developed-by: Abhinav Kumar <[email protected]> Signed-off-by: Abhinav Kumar <[email protected]> Co-developed-by: Kuogee Hsieh <[email protected]> Signed-off-by: Kuogee Hsieh <[email protected]> Co-developed-by: Guenter Roeck <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Co-developed-by: Stephen Boyd <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent b22960b commit c943b49

27 files changed

+8061
-3
lines changed

drivers/gpu/drm/msm/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ config DRM_MSM_HDMI_HDCP
5858
help
5959
Choose this option to enable HDCP state machine
6060

61+
config DRM_MSM_DP
62+
bool "Enable DisplayPort support in MSM DRM driver"
63+
depends on DRM_MSM
64+
help
65+
Compile in support for DP driver in MSM DRM driver. DP external
66+
display support is enabled through this config option. It can
67+
be primary or secondary display on device.
68+
6169
config DRM_MSM_DSI
6270
bool "Enable DSI support in MSM DRM driver"
6371
depends on DRM_MSM

drivers/gpu/drm/msm/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ccflags-y := -I $(srctree)/$(src)
33
ccflags-y += -I $(srctree)/$(src)/disp/dpu1
44
ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
5+
ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp
56

67
msm-y := \
78
adreno/adreno_device.o \
@@ -99,6 +100,17 @@ msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
99100

100101
msm-$(CONFIG_DRM_MSM_GPU_STATE) += adreno/a6xx_gpu_state.o
101102

103+
msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
104+
dp/dp_catalog.o \
105+
dp/dp_ctrl.o \
106+
dp/dp_display.o \
107+
dp/dp_drm.o \
108+
dp/dp_hpd.o \
109+
dp/dp_link.o \
110+
dp/dp_panel.o \
111+
dp/dp_parser.o \
112+
dp/dp_power.o
113+
102114
msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
103115
msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
104116
msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
10011001

10021002
trace_dpu_enc_mode_set(DRMID(drm_enc));
10031003

1004+
if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp)
1005+
msm_dp_display_mode_set(priv->dp, drm_enc, mode, adj_mode);
1006+
10041007
list_for_each_entry(conn_iter, connector_list, head)
10051008
if (conn_iter->encoder == drm_enc)
10061009
conn = conn_iter;
@@ -1146,6 +1149,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
11461149
{
11471150
struct dpu_encoder_virt *dpu_enc = NULL;
11481151
int ret = 0;
1152+
struct msm_drm_private *priv;
11491153
struct drm_display_mode *cur_mode = NULL;
11501154

11511155
if (!drm_enc) {
@@ -1156,6 +1160,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
11561160

11571161
mutex_lock(&dpu_enc->enc_lock);
11581162
cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
1163+
priv = drm_enc->dev->dev_private;
11591164

11601165
trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
11611166
cur_mode->vdisplay);
@@ -1176,6 +1181,15 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
11761181

11771182
_dpu_encoder_virt_enable_helper(drm_enc);
11781183

1184+
if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
1185+
ret = msm_dp_display_enable(priv->dp,
1186+
drm_enc);
1187+
if (ret) {
1188+
DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n",
1189+
ret);
1190+
goto out;
1191+
}
1192+
}
11791193
dpu_enc->enabled = true;
11801194

11811195
out:
@@ -1234,6 +1248,11 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
12341248

12351249
DPU_DEBUG_ENC(dpu_enc, "encoder disabled\n");
12361250

1251+
if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
1252+
if (msm_dp_display_disable(priv->dp, drm_enc))
1253+
DPU_ERROR_ENC(dpu_enc, "dp display disable failed\n");
1254+
}
1255+
12371256
mutex_unlock(&dpu_enc->enc_lock);
12381257
}
12391258

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ static void drm_mode_to_intf_timing_params(
100100
* display_v_end -= mode->hsync_start - mode->hdisplay;
101101
* }
102102
*/
103+
/* for DP/EDP, Shift timings to align it to bottom right */
104+
if ((phys_enc->hw_intf->cap->type == INTF_DP) ||
105+
(phys_enc->hw_intf->cap->type == INTF_EDP)) {
106+
timing->h_back_porch += timing->h_front_porch;
107+
timing->h_front_porch = 0;
108+
timing->v_back_porch += timing->v_front_porch;
109+
timing->v_front_porch = 0;
110+
}
103111
}
104112

105113
static u32 get_horizontal_total(const struct intf_timing_params *timing)

0 commit comments

Comments
 (0)