Recent dicussion on the mailing list [1], [2] outlined a need to document which intf type is used for DP and which one is used for eDP interfaces.
This series implements my proposal [3]:
- Keep INTF_EDP reserved for 8x74/8x84 - Use INTF_DP for all contemporary DP and eDP ports - Documet this in dpu_hw_mdss.h - Remove INTF_EDP usage in dpu1 driver.
Main reasons behind this proposal: - It's not always possible to separate eDP and DP. For example INTF_5 on sc7280 is connected to combo eDP/DP PHY. - Using INTF_EDP would require us to split too many pieces, ending up with a singnificant amount of code duplication... - ... for nothing. From the DPU point of view there is no difference between DP and eDP interfaces as found on current SoC generations.
[1]: https://lore.kernel.org/linux-arm-msm/0dac8ffa-89a6-d972-bdc1-3f7755c5169d@l... [2]: https://lore.kernel.org/linux-arm-msm/be397e2e-05ab-5c18-8e2d-16c443f0a6d1@q... [3]: https://lore.kernel.org/linux-arm-msm/e2fab93e-82a6-4837-4ee5-ee1b16caa84d@l...
Dmitry Baryshkov (4): drm/msm/dpu: document INTF_EDP/INTF_DP difference drm/msm/dpu: drop INTF_TYPE_MAX symbol drm/msm/dpu: drop obsolete INTF_EDP comment drm/msm/dpu: drop INTF_EDP from interface type conditions
.../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 14 +------------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 9 ++++++++- 3 files changed, 10 insertions(+), 15 deletions(-)
Based on the discussions on the mailing list, document enum dpu_intf_type and it's controversial fields: INTF_DP and INTF_EDP.
INTF_EDP is used for older eDP interface found on msm8x74/msm8x84 INTF_DP is used for both eDP and DP interfaces handled by the msm/dp driver. The DPU driver does not make a difference between them.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h index bb9ceadeb0bb..4f8336cc7911 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h @@ -205,12 +205,20 @@ enum dpu_intf { INTF_MAX };
+/* + * Historically these values correspond to the values written to the + * DISP_INTF_SEL register, which had to programmed manually. On newer MDP + * generations this register is NOP, but we keep the values for historical + * reasons. + */ enum dpu_intf_type { INTF_NONE = 0x0, INTF_DSI = 0x1, INTF_HDMI = 0x3, INTF_LCDC = 0x5, + /* old eDP found on 8x74 and 8x84 */ INTF_EDP = 0x9, + /* both DP and eDP, handled by the new DP driver */ INTF_DP = 0xa, INTF_TYPE_MAX,
This enum value does not correspond to any of actual interface types, it's not used by the driver, and the value of INTF_WB is greater than INTF_TYPE_MAX. Thus this symbol serves no purpose and can be removed.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h index 4f8336cc7911..a9b6d0955539 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h @@ -220,7 +220,6 @@ enum dpu_intf_type { INTF_EDP = 0x9, /* both DP and eDP, handled by the new DP driver */ INTF_DP = 0xa, - INTF_TYPE_MAX,
/* virtual interfaces */ INTF_WB = 0x100,
DPU driver never supported INTF_EDP, so let's drop the obsolete comment. If at some point 8x74/8x84's INTF_EDP is ported to DPU driver, corresponding handling will have to be ported too. Until that time, the comment serves no purpose.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 11 ----------- 1 file changed, 11 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index f49f42e70b29..478a608ba7f2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -91,17 +91,6 @@ static void drm_mode_to_intf_timing_params( timing->vsync_polarity = 0; }
- /* - * For edp only: - * DISPLAY_V_START = (VBP * HCYCLE) + HBP - * DISPLAY_V_END = (VBP + VACTIVE) * HCYCLE - 1 - HFP - */ - /* - * if (vid_enc->hw->cap->type == INTF_EDP) { - * display_v_start += mode->htotal - mode->hsync_start; - * display_v_end -= mode->hsync_start - mode->hdisplay; - * } - */ /* for DP/EDP, Shift timings to align it to bottom right */ if ((phys_enc->hw_intf->cap->type == INTF_DP) || (phys_enc->hw_intf->cap->type == INTF_EDP)) {
To remove possible confusion between (old) INTF_EDP and newer INTF_DP, stop using INTF_EDP in DPU's code. Until the 8x74/8x84 SoCs are supported by DPU driver, there is no point in using INTF_EDP.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 478a608ba7f2..e76d240f554d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -92,8 +92,7 @@ static void drm_mode_to_intf_timing_params( }
/* for DP/EDP, Shift timings to align it to bottom right */ - if ((phys_enc->hw_intf->cap->type == INTF_DP) || - (phys_enc->hw_intf->cap->type == INTF_EDP)) { + if (phys_enc->hw_intf->cap->type == INTF_DP) { timing->h_back_porch += timing->h_front_porch; timing->h_front_porch = 0; timing->v_back_porch += timing->v_front_porch; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c index 116e2b5b1a90..1548614c508b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -141,7 +141,7 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, hsync_ctl = (hsync_period << 16) | p->hsync_pulse_width; display_hctl = (hsync_end_x << 16) | hsync_start_x;
- if (ctx->cap->type == INTF_EDP || ctx->cap->type == INTF_DP) { + if (ctx->cap->type == INTF_DP) { active_h_start = hsync_start_x; active_h_end = active_h_start + p->xres - 1; active_v_start = display_v_start;
On 2/21/2022 10:22 PM, Dmitry Baryshkov wrote:
I have notified the team about the change and we have discussed the potential implications of this with both upstream and downstream drivers in mind. Overall, even though some members wanted to retain INTF_eDP for clarity, some members were fine removing its usage.
Going with the majority and I have checked all the changes in this series,
Hence:
Reviewed-by: Abhinav Kumar quic_abhinavk@quicinc.com
For the entire series.
dri-devel@lists.freedesktop.org