Skip to content

Commit 0353682

Browse files
committed
Merge tag 'msm-next-5.19-fixes' of https://gitlab.freedesktop.org/abhinavk/msm into drm-next
5.19 fixes for msm-next - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a big-time hitter in the CI-runs. Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Signed-off-by: Dave Airlie <airlied@redhat.com> From: Abhinav Kumar <quic_abhinavk@quicinc.com> Link: https://patchwork.freedesktop.org/patch/msgid/b011d51d-d634-123e-bf5f-27219ee33151@quicinc.com
2 parents 66ccd1d + 64b22a0 commit 0353682

9 files changed

Lines changed: 50 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
19141914
BUG_ON(!node);
19151915

19161916
ret = a6xx_gmu_init(a6xx_gpu, node);
1917+
of_node_put(node);
19171918
if (ret) {
19181919
a6xx_destroy(&(a6xx_gpu->base.base));
19191920
return ERR_PTR(ret);

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
10891089

10901090
dpu_kms_parse_data_bus_icc_path(dpu_kms);
10911091

1092-
pm_runtime_get_sync(&dpu_kms->pdev->dev);
1092+
rc = pm_runtime_resume_and_get(&dpu_kms->pdev->dev);
1093+
if (rc < 0)
1094+
goto error;
10931095

10941096
dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0);
10951097

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
15771577
BIT(DRM_MODE_BLEND_PREMULTI) |
15781578
BIT(DRM_MODE_BLEND_COVERAGE));
15791579

1580-
supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0;
1580+
supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
15811581

15821582
if (pdpu->pipe_hw->cap->features & BIT(DPU_SSPP_INLINE_ROTATION))
15831583
supported_rotations |= DRM_MODE_ROTATE_MASK;

drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
static int dpu_wb_conn_get_modes(struct drm_connector *connector)
99
{
1010
struct drm_device *dev = connector->dev;
11+
struct msm_drm_private *priv = dev->dev_private;
12+
struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
1113

12-
return drm_add_modes_noedid(connector, dev->mode_config.max_width,
14+
return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_linewidth,
1315
dev->mode_config.max_height);
1416
}
1517

drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,10 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
997997

998998
ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace,
999999
&mdp5_crtc->cursor.iova);
1000-
if (ret)
1000+
if (ret) {
1001+
drm_gem_object_put(cursor_bo);
10011002
return -EINVAL;
1003+
}
10021004

10031005
pm_runtime_get_sync(&pdev->dev);
10041006

drivers/gpu/drm/msm/dsi/dsi_manager.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ static struct msm_dsi_manager msm_dsim_glb;
3434
#define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed)
3535
#define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id == id)
3636

37+
#ifdef CONFIG_OF
38+
static bool dsi_mgr_power_on_early(struct drm_bridge *bridge)
39+
{
40+
struct drm_bridge *next_bridge = drm_bridge_get_next_bridge(bridge);
41+
42+
/*
43+
* If the next bridge in the chain is the Parade ps8640 bridge chip
44+
* then don't power on early since it seems to violate the expectations
45+
* of the firmware that the bridge chip is running.
46+
*
47+
* NOTE: this is expected to be a temporary special case. It's expected
48+
* that we'll eventually have a framework that allows the next level
49+
* bridge to indicate whether it needs us to power on before it or
50+
* after it. When that framework is in place then we'll use it and
51+
* remove this special case.
52+
*/
53+
return !(next_bridge && next_bridge->of_node &&
54+
of_device_is_compatible(next_bridge->of_node, "parade,ps8640"));
55+
}
56+
#else
57+
static inline bool dsi_mgr_power_on_early(struct drm_bridge *bridge)
58+
{
59+
return true;
60+
}
61+
#endif
62+
3763
static inline struct msm_dsi *dsi_mgr_get_dsi(int id)
3864
{
3965
return msm_dsim_glb.dsi[id];
@@ -389,6 +415,9 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
389415
if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id))
390416
return;
391417

418+
if (!dsi_mgr_power_on_early(bridge))
419+
dsi_mgr_bridge_power_on(bridge);
420+
392421
/* Always call panel functions once, because even for dual panels,
393422
* there is only one drm_panel instance.
394423
*/
@@ -570,7 +599,8 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,
570599
if (is_bonded_dsi && other_dsi)
571600
msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode);
572601

573-
dsi_mgr_bridge_power_on(bridge);
602+
if (dsi_mgr_power_on_early(bridge))
603+
dsi_mgr_bridge_power_on(bridge);
574604
}
575605

576606
static enum drm_mode_status dsi_mgr_bridge_mode_valid(struct drm_bridge *bridge,

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ static int msm_irq_postinstall(struct drm_device *dev)
113113

114114
static int msm_irq_install(struct drm_device *dev, unsigned int irq)
115115
{
116+
struct msm_drm_private *priv = dev->dev_private;
117+
struct msm_kms *kms = priv->kms;
116118
int ret;
117119

118120
if (irq == IRQ_NOTCONNECTED)
@@ -124,6 +126,8 @@ static int msm_irq_install(struct drm_device *dev, unsigned int irq)
124126
if (ret)
125127
return ret;
126128

129+
kms->irq_requested = true;
130+
127131
ret = msm_irq_postinstall(dev);
128132
if (ret) {
129133
free_irq(irq, dev);
@@ -139,7 +143,8 @@ static void msm_irq_uninstall(struct drm_device *dev)
139143
struct msm_kms *kms = priv->kms;
140144

141145
kms->funcs->irq_uninstall(kms);
142-
free_irq(kms->irq, dev);
146+
if (kms->irq_requested)
147+
free_irq(kms->irq, dev);
143148
}
144149

145150
struct msm_vblank_work {

drivers/gpu/drm/msm/msm_fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ uint32_t msm_framebuffer_iova(struct drm_framebuffer *fb,
118118
struct msm_gem_address_space *aspace, int plane)
119119
{
120120
struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
121-
return msm_fb->iova[plane];
121+
return msm_fb->iova[plane] + fb->offsets[plane];
122122
}
123123

124124
struct drm_gem_object *msm_framebuffer_bo(struct drm_framebuffer *fb, int plane)

drivers/gpu/drm/msm/msm_kms.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ struct msm_kms {
148148

149149
/* irq number to be passed on to msm_irq_install */
150150
int irq;
151+
bool irq_requested;
151152

152153
/* mapper-id used to request GEM buffer mapped for scanout: */
153154
struct msm_gem_address_space *aspace;

0 commit comments

Comments
 (0)