Skip to content

Commit afc7333

Browse files
committed
drm/i915/dp: Ensure panel power remains enabled during connector detection
The sink's capabilities, like the DSC caps, depend on the source OUI written to the sink's DPCD registers and so this OUI value should be valid for the whole duration of the detection. An eDP sink will reset this OUI value when the panel power is disabled, so prevent the disabling - happening by default after a 1 sec idle period - for the whole duration of detection. v2: Update the documentation for intel_pps_on(). (Jani) Cc: Jani Nikula <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b1d43e6 commit afc7333

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5619,6 +5619,8 @@ intel_dp_detect(struct drm_connector *connector,
56195619

56205620
intel_dp_flush_connector_commits(intel_connector);
56215621

5622+
intel_pps_vdd_on(intel_dp);
5623+
56225624
/* Can't disconnect eDP */
56235625
if (intel_dp_is_edp(intel_dp))
56245626
status = edp_detect(intel_dp);
@@ -5649,12 +5651,15 @@ intel_dp_detect(struct drm_connector *connector,
56495651

56505652
intel_dp_tunnel_disconnect(intel_dp);
56515653

5652-
goto out;
5654+
goto out_unset_edid;
56535655
}
56545656

56555657
ret = intel_dp_tunnel_detect(intel_dp, ctx);
5656-
if (ret == -EDEADLK)
5657-
return ret;
5658+
if (ret == -EDEADLK) {
5659+
status = ret;
5660+
5661+
goto out_vdd_off;
5662+
}
56585663

56595664
if (ret == 1)
56605665
intel_connector->base.epoch_counter++;
@@ -5682,7 +5687,7 @@ intel_dp_detect(struct drm_connector *connector,
56825687
* with EDID on it
56835688
*/
56845689
status = connector_status_disconnected;
5685-
goto out;
5690+
goto out_unset_edid;
56865691
}
56875692

56885693
/*
@@ -5711,7 +5716,7 @@ intel_dp_detect(struct drm_connector *connector,
57115716

57125717
intel_dp_check_device_service_irq(intel_dp);
57135718

5714-
out:
5719+
out_unset_edid:
57155720
if (status != connector_status_connected && !intel_dp->is_mst)
57165721
intel_dp_unset_edid(intel_dp);
57175722

@@ -5720,6 +5725,9 @@ intel_dp_detect(struct drm_connector *connector,
57205725
status,
57215726
intel_dp->dpcd,
57225727
intel_dp->downstream_ports);
5728+
out_vdd_off:
5729+
intel_pps_vdd_off(intel_dp);
5730+
57235731
return status;
57245732
}
57255733

drivers/gpu/drm/i915/display/intel_pps.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
797797
}
798798

799799
/*
800-
* Must be paired with intel_pps_off().
800+
* Must be paired with intel_pps_vdd_off() or - to disable
801+
* both VDD and panel power - intel_pps_off().
801802
* Nested calls to these functions are not allowed since
802803
* we drop the lock. Caller must use some higher level
803804
* locking to prevent nested calls from other threads.
@@ -944,6 +945,17 @@ void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync)
944945
edp_panel_vdd_schedule_off(intel_dp);
945946
}
946947

948+
void intel_pps_vdd_off(struct intel_dp *intel_dp)
949+
{
950+
intel_wakeref_t wakeref;
951+
952+
if (!intel_dp_is_edp(intel_dp))
953+
return;
954+
955+
with_intel_pps_lock(intel_dp, wakeref)
956+
intel_pps_vdd_off_unlocked(intel_dp, false);
957+
}
958+
947959
void intel_pps_on_unlocked(struct intel_dp *intel_dp)
948960
{
949961
struct intel_display *display = to_intel_display(intel_dp);

drivers/gpu/drm/i915/display/intel_pps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ void intel_pps_off_unlocked(struct intel_dp *intel_dp);
3434
void intel_pps_check_power_unlocked(struct intel_dp *intel_dp);
3535

3636
void intel_pps_vdd_on(struct intel_dp *intel_dp);
37+
void intel_pps_vdd_off(struct intel_dp *intel_dp);
3738
void intel_pps_on(struct intel_dp *intel_dp);
3839
void intel_pps_off(struct intel_dp *intel_dp);
3940
void intel_pps_vdd_off_sync(struct intel_dp *intel_dp);

0 commit comments

Comments
 (0)