Skip to content

Commit 986c34b

Browse files
committed
Merge tag 'drm-msm-fixes-2023-06-08' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
A few more late fixes for v6.4-rc6 + Fix max segment size to address splat on newer a6xx + Disable PSR by default w/ modparam to re-enable, since there still seems to be a lingering issue + Fix HPD issue + Fix issue with unitialized GMU mutex Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGufjVZRNT6YfQ7YUXFC7Cz95wdLF7QHAYkiGfp+3Xc3DQ@mail.gmail.com
2 parents bcd8430 + 12abd73 commit 986c34b

File tree

6 files changed

+44
-59
lines changed

6 files changed

+44
-59
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gmu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,6 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
15261526
if (!pdev)
15271527
return -ENODEV;
15281528

1529-
mutex_init(&gmu->lock);
1530-
15311529
gmu->dev = &pdev->dev;
15321530

15331531
of_dma_configure(gmu->dev, node, true);

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
19811981
adreno_gpu = &a6xx_gpu->base;
19821982
gpu = &adreno_gpu->base;
19831983

1984+
mutex_init(&a6xx_gpu->gmu.lock);
1985+
19841986
adreno_gpu->registers = NULL;
19851987

19861988
/*

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog,
620620
config & DP_DP_HPD_INT_MASK);
621621
}
622622

623-
void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog)
623+
void dp_catalog_ctrl_hpd_enable(struct dp_catalog *dp_catalog)
624624
{
625625
struct dp_catalog_private *catalog = container_of(dp_catalog,
626626
struct dp_catalog_private, dp_catalog);
@@ -635,6 +635,19 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog)
635635
dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, DP_DP_HPD_CTRL_HPD_EN);
636636
}
637637

638+
void dp_catalog_ctrl_hpd_disable(struct dp_catalog *dp_catalog)
639+
{
640+
struct dp_catalog_private *catalog = container_of(dp_catalog,
641+
struct dp_catalog_private, dp_catalog);
642+
643+
u32 reftimer = dp_read_aux(catalog, REG_DP_DP_HPD_REFTIMER);
644+
645+
reftimer &= ~DP_DP_HPD_REFTIMER_ENABLE;
646+
dp_write_aux(catalog, REG_DP_DP_HPD_REFTIMER, reftimer);
647+
648+
dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, 0);
649+
}
650+
638651
static void dp_catalog_enable_sdp(struct dp_catalog_private *catalog)
639652
{
640653
/* trigger sdp */

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ bool dp_catalog_ctrl_mainlink_ready(struct dp_catalog *dp_catalog);
104104
void dp_catalog_ctrl_enable_irq(struct dp_catalog *dp_catalog, bool enable);
105105
void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog,
106106
u32 intr_mask, bool en);
107-
void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog);
107+
void dp_catalog_ctrl_hpd_enable(struct dp_catalog *dp_catalog);
108+
void dp_catalog_ctrl_hpd_disable(struct dp_catalog *dp_catalog);
108109
void dp_catalog_ctrl_config_psr(struct dp_catalog *dp_catalog);
109110
void dp_catalog_ctrl_set_psr(struct dp_catalog *dp_catalog, bool enter);
110111
u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog);

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

Lines changed: 24 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "dp_audio.h"
2929
#include "dp_debug.h"
3030

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+
3135
#define HPD_STRING_SIZE 30
3236

3337
enum {
@@ -407,7 +411,7 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)
407411

408412
edid = dp->panel->edid;
409413

410-
dp->dp_display.psr_supported = dp->panel->psr_cap.version;
414+
dp->dp_display.psr_supported = dp->panel->psr_cap.version && psr_enabled;
411415

412416
dp->audio_supported = drm_detect_monitor_audio(edid);
413417
dp_panel_handle_sink_request(dp->panel);
@@ -616,12 +620,6 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)
616620
dp->hpd_state = ST_MAINLINK_READY;
617621
}
618622

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-
625623
drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n",
626624
dp->dp_display.connector_type, state);
627625
mutex_unlock(&dp->event_mutex);
@@ -659,12 +657,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
659657
drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n",
660658
dp->dp_display.connector_type, state);
661659

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-
668660
/* unplugged, no more irq_hpd handle */
669661
dp_del_event(dp, EV_IRQ_HPD_INT);
670662

@@ -688,10 +680,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
688680
return 0;
689681
}
690682

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-
695683
/*
696684
* We don't need separate work for disconnect as
697685
* connect/attention interrupts are disabled
@@ -707,10 +695,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
707695
/* signal the disconnect event early to ensure proper teardown */
708696
dp_display_handle_plugged_change(&dp->dp_display, false);
709697

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-
714698
drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n",
715699
dp->dp_display.connector_type, state);
716700

@@ -1083,26 +1067,6 @@ void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp)
10831067
mutex_unlock(&dp_display->event_mutex);
10841068
}
10851069

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-
11061070
void dp_display_set_psr(struct msm_dp *dp_display, bool enter)
11071071
{
11081072
struct dp_display_private *dp;
@@ -1177,7 +1141,7 @@ static int hpd_event_thread(void *data)
11771141

11781142
switch (todo->event_id) {
11791143
case EV_HPD_INIT_SETUP:
1180-
dp_display_config_hpd(dp_priv);
1144+
dp_display_host_init(dp_priv);
11811145
break;
11821146
case EV_HPD_PLUG_INT:
11831147
dp_hpd_plug_handle(dp_priv, todo->data);
@@ -1283,7 +1247,6 @@ int dp_display_request_irq(struct msm_dp *dp_display)
12831247
dp->irq, rc);
12841248
return rc;
12851249
}
1286-
disable_irq(dp->irq);
12871250

12881251
return 0;
12891252
}
@@ -1395,13 +1358,8 @@ static int dp_pm_resume(struct device *dev)
13951358
/* turn on dp ctrl/phy */
13961359
dp_display_host_init(dp);
13971360

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);
14051363

14061364
if (dp_catalog_link_is_connected(dp->catalog)) {
14071365
/*
@@ -1569,9 +1527,8 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
15691527

15701528
if (aux_bus && dp->is_edp) {
15711529
dp_display_host_init(dp_priv);
1572-
dp_catalog_ctrl_hpd_config(dp_priv->catalog);
1530+
dp_catalog_ctrl_hpd_enable(dp_priv->catalog);
15731531
dp_display_host_phy_init(dp_priv);
1574-
enable_irq(dp_priv->irq);
15751532

15761533
/*
15771534
* 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)
16131570

16141571
error:
16151572
if (dp->is_edp) {
1616-
disable_irq(dp_priv->irq);
16171573
dp_display_host_phy_exit(dp_priv);
16181574
dp_display_host_deinit(dp_priv);
16191575
}
@@ -1802,16 +1758,31 @@ void dp_bridge_hpd_enable(struct drm_bridge *bridge)
18021758
{
18031759
struct msm_dp_bridge *dp_bridge = to_dp_bridge(bridge);
18041760
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);
18051768

18061769
dp_display->internal_hpd = true;
1770+
mutex_unlock(&dp->event_mutex);
18071771
}
18081772

18091773
void dp_bridge_hpd_disable(struct drm_bridge *bridge)
18101774
{
18111775
struct msm_dp_bridge *dp_bridge = to_dp_bridge(bridge);
18121776
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);
18131783

18141784
dp_display->internal_hpd = false;
1785+
mutex_unlock(&dp->event_mutex);
18151786
}
18161787

18171788
void dp_bridge_hpd_notify(struct drm_bridge *bridge,

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
449449
if (ret)
450450
goto err_cleanup_mode_config;
451451

452+
dma_set_max_seg_size(dev, UINT_MAX);
453+
452454
/* Bind all our sub-components: */
453455
ret = component_bind_all(dev, ddev);
454456
if (ret)
@@ -459,8 +461,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
459461
if (ret)
460462
goto err_msm_uninit;
461463

462-
dma_set_max_seg_size(dev, UINT_MAX);
463-
464464
msm_gem_shrinker_init(ddev);
465465

466466
if (priv->kms_init) {

0 commit comments

Comments
 (0)