Skip to content

Commit 5dce58d

Browse files
committed
Merge tag 'drm-msm-fixes-2021-05-09' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
- dsi regression fix - dma-buf pinning fix - displayport fixes - llc fix Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGuqLZDAEJwUFKb6m+h3kyxgjDEKa3DPA1fHA69vxbXH=g@mail.gmail.com
2 parents 89cd34a + f2f46b8 commit 5dce58d

File tree

9 files changed

+47
-18
lines changed

9 files changed

+47
-18
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,10 +1153,6 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
11531153
{
11541154
struct device_node *phandle;
11551155

1156-
a6xx_gpu->llc_mmio = msm_ioremap(pdev, "cx_mem", "gpu_cx");
1157-
if (IS_ERR(a6xx_gpu->llc_mmio))
1158-
return;
1159-
11601156
/*
11611157
* There is a different programming path for targets with an mmu500
11621158
* attached, so detect if that is the case
@@ -1166,6 +1162,11 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
11661162
of_device_is_compatible(phandle, "arm,mmu-500"));
11671163
of_node_put(phandle);
11681164

1165+
if (a6xx_gpu->have_mmu500)
1166+
a6xx_gpu->llc_mmio = NULL;
1167+
else
1168+
a6xx_gpu->llc_mmio = msm_ioremap(pdev, "cx_mem", "gpu_cx");
1169+
11691170
a6xx_gpu->llc_slice = llcc_slice_getd(LLCC_GPU);
11701171
a6xx_gpu->htw_llc_slice = llcc_slice_getd(LLCC_GPUHTW);
11711172

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ int dp_audio_hw_params(struct device *dev,
527527
dp_audio_setup_acr(audio);
528528
dp_audio_safe_to_exit_level(audio);
529529
dp_audio_enable(audio, true);
530+
dp_display_signal_audio_start(dp_display);
530531
dp_display->audio_enabled = true;
531532

532533
end:

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ static int dp_del_event(struct dp_display_private *dp_priv, u32 event)
178178
return 0;
179179
}
180180

181+
void dp_display_signal_audio_start(struct msm_dp *dp_display)
182+
{
183+
struct dp_display_private *dp;
184+
185+
dp = container_of(dp_display, struct dp_display_private, dp_display);
186+
187+
reinit_completion(&dp->audio_comp);
188+
}
189+
181190
void dp_display_signal_audio_complete(struct msm_dp *dp_display)
182191
{
183192
struct dp_display_private *dp;
@@ -586,10 +595,8 @@ static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data)
586595
mutex_lock(&dp->event_mutex);
587596

588597
state = dp->hpd_state;
589-
if (state == ST_CONNECT_PENDING) {
590-
dp_display_enable(dp, 0);
598+
if (state == ST_CONNECT_PENDING)
591599
dp->hpd_state = ST_CONNECTED;
592-
}
593600

594601
mutex_unlock(&dp->event_mutex);
595602

@@ -651,7 +658,6 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
651658
dp_add_event(dp, EV_DISCONNECT_PENDING_TIMEOUT, 0, DP_TIMEOUT_5_SECOND);
652659

653660
/* signal the disconnect event early to ensure proper teardown */
654-
reinit_completion(&dp->audio_comp);
655661
dp_display_handle_plugged_change(g_dp_display, false);
656662

657663
dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_PLUG_INT_MASK |
@@ -669,10 +675,8 @@ static int dp_disconnect_pending_timeout(struct dp_display_private *dp, u32 data
669675
mutex_lock(&dp->event_mutex);
670676

671677
state = dp->hpd_state;
672-
if (state == ST_DISCONNECT_PENDING) {
673-
dp_display_disable(dp, 0);
678+
if (state == ST_DISCONNECT_PENDING)
674679
dp->hpd_state = ST_DISCONNECTED;
675-
}
676680

677681
mutex_unlock(&dp->event_mutex);
678682

@@ -898,7 +902,6 @@ static int dp_display_disable(struct dp_display_private *dp, u32 data)
898902
/* wait only if audio was enabled */
899903
if (dp_display->audio_enabled) {
900904
/* signal the disconnect event */
901-
reinit_completion(&dp->audio_comp);
902905
dp_display_handle_plugged_change(dp_display, false);
903906
if (!wait_for_completion_timeout(&dp->audio_comp,
904907
HZ * 5))
@@ -1272,7 +1275,12 @@ static int dp_pm_resume(struct device *dev)
12721275

12731276
status = dp_catalog_link_is_connected(dp->catalog);
12741277

1275-
if (status)
1278+
/*
1279+
* can not declared display is connected unless
1280+
* HDMI cable is plugged in and sink_count of
1281+
* dongle become 1
1282+
*/
1283+
if (status && dp->link->sink_count)
12761284
dp->dp_display.is_connected = true;
12771285
else
12781286
dp->dp_display.is_connected = false;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int dp_display_get_modes(struct msm_dp *dp_display,
3434
int dp_display_request_irq(struct msm_dp *dp_display);
3535
bool dp_display_check_video_test(struct msm_dp *dp_display);
3636
int dp_display_get_test_bpp(struct msm_dp *dp_display);
37+
void dp_display_signal_audio_start(struct msm_dp *dp_display);
3738
void dp_display_signal_audio_complete(struct msm_dp *dp_display);
3839

3940
#endif /* _DP_DISPLAY_H_ */

drivers/gpu/drm/msm/dsi/phy/dsi_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ int msm_dsi_phy_get_clk_provider(struct msm_dsi_phy *phy,
843843
if (pixel_clk_provider)
844844
*pixel_clk_provider = phy->provided_clocks->hws[DSI_PIXEL_PLL_CLK]->clk;
845845

846-
return -EINVAL;
846+
return 0;
847847
}
848848

849849
void msm_dsi_phy_pll_save_state(struct msm_dsi_phy *phy)

drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm_8960.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ static int pll_28nm_register(struct dsi_pll_28nm *pll_28nm, struct clk_hw **prov
405405
if (!vco_name)
406406
return -ENOMEM;
407407

408+
parent_name = devm_kzalloc(dev, 32, GFP_KERNEL);
409+
if (!parent_name)
410+
return -ENOMEM;
411+
408412
clk_name = devm_kzalloc(dev, 32, GFP_KERNEL);
409413
if (!clk_name)
410414
return -ENOMEM;

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* - 1.7.0 - Add MSM_PARAM_SUSPENDS to access suspend count
4343
*/
4444
#define MSM_VERSION_MAJOR 1
45-
#define MSM_VERSION_MINOR 6
45+
#define MSM_VERSION_MINOR 7
4646
#define MSM_VERSION_PATCHLEVEL 0
4747

4848
static const struct drm_mode_config_funcs mode_config_funcs = {

drivers/gpu/drm/msm/msm_gem.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,25 @@ struct page **msm_gem_get_pages(struct drm_gem_object *obj)
190190
}
191191

192192
p = get_pages(obj);
193+
194+
if (!IS_ERR(p)) {
195+
msm_obj->pin_count++;
196+
update_inactive(msm_obj);
197+
}
198+
193199
msm_gem_unlock(obj);
194200
return p;
195201
}
196202

197203
void msm_gem_put_pages(struct drm_gem_object *obj)
198204
{
199-
/* when we start tracking the pin count, then do something here */
205+
struct msm_gem_object *msm_obj = to_msm_bo(obj);
206+
207+
msm_gem_lock(obj);
208+
msm_obj->pin_count--;
209+
GEM_WARN_ON(msm_obj->pin_count < 0);
210+
update_inactive(msm_obj);
211+
msm_gem_unlock(obj);
200212
}
201213

202214
int msm_gem_mmap_obj(struct drm_gem_object *obj,
@@ -646,6 +658,8 @@ static void *get_vaddr(struct drm_gem_object *obj, unsigned madv)
646658
ret = -ENOMEM;
647659
goto fail;
648660
}
661+
662+
update_inactive(msm_obj);
649663
}
650664

651665
return msm_obj->vaddr;

drivers/gpu/drm/msm/msm_gem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static inline bool is_active(struct msm_gem_object *msm_obj)
221221
/* imported/exported objects are not purgeable: */
222222
static inline bool is_unpurgeable(struct msm_gem_object *msm_obj)
223223
{
224-
return msm_obj->base.dma_buf && msm_obj->base.import_attach;
224+
return msm_obj->base.import_attach || msm_obj->pin_count;
225225
}
226226

227227
static inline bool is_purgeable(struct msm_gem_object *msm_obj)
@@ -271,7 +271,7 @@ static inline void mark_unpurgeable(struct msm_gem_object *msm_obj)
271271

272272
static inline bool is_unevictable(struct msm_gem_object *msm_obj)
273273
{
274-
return is_unpurgeable(msm_obj) || msm_obj->pin_count || msm_obj->vaddr;
274+
return is_unpurgeable(msm_obj) || msm_obj->vaddr;
275275
}
276276

277277
static inline void mark_evictable(struct msm_gem_object *msm_obj)

0 commit comments

Comments
 (0)