Skip to content

Commit 7513ccb

Browse files
alexVinarskislumag
authored andcommitted
drm/msm/dp: Prepare for link training per-segment for LTTPRs
Per-segment link training requires knowing the number of LTTPRs (if any) present. Store the count during LTTPRs' initialization. Fixes: 72d0af4 ("drm/msm/dp: Add support for LTTPR handling") Reviewed-by: Abel Vesa <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Aleksandrs Vinarskis <[email protected]> Tested-by: Jessica Zhang <[email protected]> # SA8775P Tested-by: Johan Hovold <[email protected]> Tested-by: Rob Clark <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/652306/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent c156fe2 commit 7513ccb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,21 @@ static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *d
360360
return 0;
361361
}
362362

363-
static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd)
363+
static int msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd)
364364
{
365-
int rc;
365+
int rc, lttpr_count;
366366

367367
if (drm_dp_read_lttpr_common_caps(dp->aux, dpcd, dp->link->lttpr_common_caps))
368-
return;
368+
return 0;
369369

370-
rc = drm_dp_lttpr_init(dp->aux, drm_dp_lttpr_count(dp->link->lttpr_common_caps));
371-
if (rc)
370+
lttpr_count = drm_dp_lttpr_count(dp->link->lttpr_common_caps);
371+
rc = drm_dp_lttpr_init(dp->aux, lttpr_count);
372+
if (rc) {
372373
DRM_ERROR("failed to set LTTPRs transparency mode, rc=%d\n", rc);
374+
return 0;
375+
}
376+
377+
return lttpr_count;
373378
}
374379

375380
static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
@@ -383,7 +388,7 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
383388
if (rc)
384389
goto end;
385390

386-
msm_dp_display_lttpr_init(dp, dpcd);
391+
dp->link->lttpr_count = msm_dp_display_lttpr_init(dp, dpcd);
387392

388393
rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
389394
if (rc)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct msm_dp_link_phy_params {
6262

6363
struct msm_dp_link {
6464
u8 lttpr_common_caps[DP_LTTPR_COMMON_CAP_SIZE];
65+
int lttpr_count;
6566

6667
u32 sink_request;
6768
u32 test_response;

0 commit comments

Comments
 (0)