28
28
#include "dp_audio.h"
29
29
#include "dp_debug.h"
30
30
31
+ static bool psr_enabled = false;
32
+ module_param (psr_enabled , bool , 0 );
33
+ MODULE_PARM_DESC (psr_enabled , "enable PSR for eDP and DP displays" );
34
+
31
35
#define HPD_STRING_SIZE 30
32
36
33
37
enum {
@@ -407,7 +411,7 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)
407
411
408
412
edid = dp -> panel -> edid ;
409
413
410
- dp -> dp_display .psr_supported = dp -> panel -> psr_cap .version ;
414
+ dp -> dp_display .psr_supported = dp -> panel -> psr_cap .version && psr_enabled ;
411
415
412
416
dp -> audio_supported = drm_detect_monitor_audio (edid );
413
417
dp_panel_handle_sink_request (dp -> panel );
@@ -616,12 +620,6 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)
616
620
dp -> hpd_state = ST_MAINLINK_READY ;
617
621
}
618
622
619
- /* enable HDP irq_hpd/replug interrupt */
620
- if (dp -> dp_display .internal_hpd )
621
- dp_catalog_hpd_config_intr (dp -> catalog ,
622
- DP_DP_IRQ_HPD_INT_MASK | DP_DP_HPD_REPLUG_INT_MASK ,
623
- true);
624
-
625
623
drm_dbg_dp (dp -> drm_dev , "After, type=%d hpd_state=%d\n" ,
626
624
dp -> dp_display .connector_type , state );
627
625
mutex_unlock (& dp -> event_mutex );
@@ -659,12 +657,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
659
657
drm_dbg_dp (dp -> drm_dev , "Before, type=%d hpd_state=%d\n" ,
660
658
dp -> dp_display .connector_type , state );
661
659
662
- /* disable irq_hpd/replug interrupts */
663
- if (dp -> dp_display .internal_hpd )
664
- dp_catalog_hpd_config_intr (dp -> catalog ,
665
- DP_DP_IRQ_HPD_INT_MASK | DP_DP_HPD_REPLUG_INT_MASK ,
666
- false);
667
-
668
660
/* unplugged, no more irq_hpd handle */
669
661
dp_del_event (dp , EV_IRQ_HPD_INT );
670
662
@@ -688,10 +680,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
688
680
return 0 ;
689
681
}
690
682
691
- /* disable HPD plug interrupts */
692
- if (dp -> dp_display .internal_hpd )
693
- dp_catalog_hpd_config_intr (dp -> catalog , DP_DP_HPD_PLUG_INT_MASK , false);
694
-
695
683
/*
696
684
* We don't need separate work for disconnect as
697
685
* connect/attention interrupts are disabled
@@ -707,10 +695,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
707
695
/* signal the disconnect event early to ensure proper teardown */
708
696
dp_display_handle_plugged_change (& dp -> dp_display , false);
709
697
710
- /* enable HDP plug interrupt to prepare for next plugin */
711
- if (dp -> dp_display .internal_hpd )
712
- dp_catalog_hpd_config_intr (dp -> catalog , DP_DP_HPD_PLUG_INT_MASK , true);
713
-
714
698
drm_dbg_dp (dp -> drm_dev , "After, type=%d hpd_state=%d\n" ,
715
699
dp -> dp_display .connector_type , state );
716
700
@@ -1083,26 +1067,6 @@ void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp)
1083
1067
mutex_unlock (& dp_display -> event_mutex );
1084
1068
}
1085
1069
1086
- static void dp_display_config_hpd (struct dp_display_private * dp )
1087
- {
1088
-
1089
- dp_display_host_init (dp );
1090
- dp_catalog_ctrl_hpd_config (dp -> catalog );
1091
-
1092
- /* Enable plug and unplug interrupts only if requested */
1093
- if (dp -> dp_display .internal_hpd )
1094
- dp_catalog_hpd_config_intr (dp -> catalog ,
1095
- DP_DP_HPD_PLUG_INT_MASK |
1096
- DP_DP_HPD_UNPLUG_INT_MASK ,
1097
- true);
1098
-
1099
- /* Enable interrupt first time
1100
- * we are leaving dp clocks on during disconnect
1101
- * and never disable interrupt
1102
- */
1103
- enable_irq (dp -> irq );
1104
- }
1105
-
1106
1070
void dp_display_set_psr (struct msm_dp * dp_display , bool enter )
1107
1071
{
1108
1072
struct dp_display_private * dp ;
@@ -1177,7 +1141,7 @@ static int hpd_event_thread(void *data)
1177
1141
1178
1142
switch (todo -> event_id ) {
1179
1143
case EV_HPD_INIT_SETUP :
1180
- dp_display_config_hpd (dp_priv );
1144
+ dp_display_host_init (dp_priv );
1181
1145
break ;
1182
1146
case EV_HPD_PLUG_INT :
1183
1147
dp_hpd_plug_handle (dp_priv , todo -> data );
@@ -1283,7 +1247,6 @@ int dp_display_request_irq(struct msm_dp *dp_display)
1283
1247
dp -> irq , rc );
1284
1248
return rc ;
1285
1249
}
1286
- disable_irq (dp -> irq );
1287
1250
1288
1251
return 0 ;
1289
1252
}
@@ -1395,13 +1358,8 @@ static int dp_pm_resume(struct device *dev)
1395
1358
/* turn on dp ctrl/phy */
1396
1359
dp_display_host_init (dp );
1397
1360
1398
- dp_catalog_ctrl_hpd_config (dp -> catalog );
1399
-
1400
- if (dp -> dp_display .internal_hpd )
1401
- dp_catalog_hpd_config_intr (dp -> catalog ,
1402
- DP_DP_HPD_PLUG_INT_MASK |
1403
- DP_DP_HPD_UNPLUG_INT_MASK ,
1404
- true);
1361
+ if (dp_display -> is_edp )
1362
+ dp_catalog_ctrl_hpd_enable (dp -> catalog );
1405
1363
1406
1364
if (dp_catalog_link_is_connected (dp -> catalog )) {
1407
1365
/*
@@ -1569,9 +1527,8 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
1569
1527
1570
1528
if (aux_bus && dp -> is_edp ) {
1571
1529
dp_display_host_init (dp_priv );
1572
- dp_catalog_ctrl_hpd_config (dp_priv -> catalog );
1530
+ dp_catalog_ctrl_hpd_enable (dp_priv -> catalog );
1573
1531
dp_display_host_phy_init (dp_priv );
1574
- enable_irq (dp_priv -> irq );
1575
1532
1576
1533
/*
1577
1534
* The code below assumes that the panel will finish probing
@@ -1613,7 +1570,6 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
1613
1570
1614
1571
error :
1615
1572
if (dp -> is_edp ) {
1616
- disable_irq (dp_priv -> irq );
1617
1573
dp_display_host_phy_exit (dp_priv );
1618
1574
dp_display_host_deinit (dp_priv );
1619
1575
}
@@ -1802,16 +1758,31 @@ void dp_bridge_hpd_enable(struct drm_bridge *bridge)
1802
1758
{
1803
1759
struct msm_dp_bridge * dp_bridge = to_dp_bridge (bridge );
1804
1760
struct msm_dp * dp_display = dp_bridge -> dp_display ;
1761
+ struct dp_display_private * dp = container_of (dp_display , struct dp_display_private , dp_display );
1762
+
1763
+ mutex_lock (& dp -> event_mutex );
1764
+ dp_catalog_ctrl_hpd_enable (dp -> catalog );
1765
+
1766
+ /* enable HDP interrupts */
1767
+ dp_catalog_hpd_config_intr (dp -> catalog , DP_DP_HPD_INT_MASK , true);
1805
1768
1806
1769
dp_display -> internal_hpd = true;
1770
+ mutex_unlock (& dp -> event_mutex );
1807
1771
}
1808
1772
1809
1773
void dp_bridge_hpd_disable (struct drm_bridge * bridge )
1810
1774
{
1811
1775
struct msm_dp_bridge * dp_bridge = to_dp_bridge (bridge );
1812
1776
struct msm_dp * dp_display = dp_bridge -> dp_display ;
1777
+ struct dp_display_private * dp = container_of (dp_display , struct dp_display_private , dp_display );
1778
+
1779
+ mutex_lock (& dp -> event_mutex );
1780
+ /* disable HDP interrupts */
1781
+ dp_catalog_hpd_config_intr (dp -> catalog , DP_DP_HPD_INT_MASK , false);
1782
+ dp_catalog_ctrl_hpd_disable (dp -> catalog );
1813
1783
1814
1784
dp_display -> internal_hpd = false;
1785
+ mutex_unlock (& dp -> event_mutex );
1815
1786
}
1816
1787
1817
1788
void dp_bridge_hpd_notify (struct drm_bridge * bridge ,
0 commit comments