Skip to content

Commit a5f207e

Browse files
committed
Merge tag 'drm-misc-fixes-2026-01-07' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.19-rc5: pl111: - Fix error handling in probe mediatek/atomic/tidss: - Fix tidss in another way and revert reordering of pre-enable and post-disable operations, as it breaks other bridge drivers. nouveau: - Fix regression from fwsec s/r fix. pci/vga: - Fix multiple gpu's being reported a 'boot_display' fb-helper: - Fix vblank timeout during suspend/reset Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/f50067e6-243a-4ed8-9781-1e4e4fdebc8e@linux.intel.com
2 parents 50cf611 + d5bdf88 commit a5f207e

15 files changed

Lines changed: 274 additions & 232 deletions

File tree

drivers/gpu/drm/drm_atomic_helper.c

Lines changed: 99 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,18 @@ crtc_needs_disable(struct drm_crtc_state *old_state,
11621162
new_state->self_refresh_active;
11631163
}
11641164

1165-
static void
1166-
encoder_bridge_disable(struct drm_device *dev, struct drm_atomic_state *state)
1165+
/**
1166+
* drm_atomic_helper_commit_encoder_bridge_disable - disable bridges and encoder
1167+
* @dev: DRM device
1168+
* @state: the driver state object
1169+
*
1170+
* Loops over all connectors in the current state and if the CRTC needs
1171+
* it, disables the bridge chain all the way, then disables the encoder
1172+
* afterwards.
1173+
*/
1174+
void
1175+
drm_atomic_helper_commit_encoder_bridge_disable(struct drm_device *dev,
1176+
struct drm_atomic_state *state)
11671177
{
11681178
struct drm_connector *connector;
11691179
struct drm_connector_state *old_conn_state, *new_conn_state;
@@ -1229,9 +1239,18 @@ encoder_bridge_disable(struct drm_device *dev, struct drm_atomic_state *state)
12291239
}
12301240
}
12311241
}
1242+
EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_disable);
12321243

1233-
static void
1234-
crtc_disable(struct drm_device *dev, struct drm_atomic_state *state)
1244+
/**
1245+
* drm_atomic_helper_commit_crtc_disable - disable CRTSs
1246+
* @dev: DRM device
1247+
* @state: the driver state object
1248+
*
1249+
* Loops over all CRTCs in the current state and if the CRTC needs
1250+
* it, disables it.
1251+
*/
1252+
void
1253+
drm_atomic_helper_commit_crtc_disable(struct drm_device *dev, struct drm_atomic_state *state)
12351254
{
12361255
struct drm_crtc *crtc;
12371256
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
@@ -1282,9 +1301,18 @@ crtc_disable(struct drm_device *dev, struct drm_atomic_state *state)
12821301
drm_crtc_vblank_put(crtc);
12831302
}
12841303
}
1304+
EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_disable);
12851305

1286-
static void
1287-
encoder_bridge_post_disable(struct drm_device *dev, struct drm_atomic_state *state)
1306+
/**
1307+
* drm_atomic_helper_commit_encoder_bridge_post_disable - post-disable encoder bridges
1308+
* @dev: DRM device
1309+
* @state: the driver state object
1310+
*
1311+
* Loops over all connectors in the current state and if the CRTC needs
1312+
* it, post-disables all encoder bridges.
1313+
*/
1314+
void
1315+
drm_atomic_helper_commit_encoder_bridge_post_disable(struct drm_device *dev, struct drm_atomic_state *state)
12881316
{
12891317
struct drm_connector *connector;
12901318
struct drm_connector_state *old_conn_state, *new_conn_state;
@@ -1335,15 +1363,16 @@ encoder_bridge_post_disable(struct drm_device *dev, struct drm_atomic_state *sta
13351363
drm_bridge_put(bridge);
13361364
}
13371365
}
1366+
EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_post_disable);
13381367

13391368
static void
13401369
disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
13411370
{
1342-
encoder_bridge_disable(dev, state);
1371+
drm_atomic_helper_commit_encoder_bridge_disable(dev, state);
13431372

1344-
crtc_disable(dev, state);
1373+
drm_atomic_helper_commit_encoder_bridge_post_disable(dev, state);
13451374

1346-
encoder_bridge_post_disable(dev, state);
1375+
drm_atomic_helper_commit_crtc_disable(dev, state);
13471376
}
13481377

13491378
/**
@@ -1446,8 +1475,17 @@ void drm_atomic_helper_calc_timestamping_constants(struct drm_atomic_state *stat
14461475
}
14471476
EXPORT_SYMBOL(drm_atomic_helper_calc_timestamping_constants);
14481477

1449-
static void
1450-
crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *state)
1478+
/**
1479+
* drm_atomic_helper_commit_crtc_set_mode - set the new mode
1480+
* @dev: DRM device
1481+
* @state: the driver state object
1482+
*
1483+
* Loops over all connectors in the current state and if the mode has
1484+
* changed, change the mode of the CRTC, then call down the bridge
1485+
* chain and change the mode in all bridges as well.
1486+
*/
1487+
void
1488+
drm_atomic_helper_commit_crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *state)
14511489
{
14521490
struct drm_crtc *crtc;
14531491
struct drm_crtc_state *new_crtc_state;
@@ -1508,6 +1546,7 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *state)
15081546
drm_bridge_put(bridge);
15091547
}
15101548
}
1549+
EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_set_mode);
15111550

15121551
/**
15131552
* drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs
@@ -1531,12 +1570,21 @@ void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev,
15311570
drm_atomic_helper_update_legacy_modeset_state(dev, state);
15321571
drm_atomic_helper_calc_timestamping_constants(state);
15331572

1534-
crtc_set_mode(dev, state);
1573+
drm_atomic_helper_commit_crtc_set_mode(dev, state);
15351574
}
15361575
EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_disables);
15371576

1538-
static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
1539-
struct drm_atomic_state *state)
1577+
/**
1578+
* drm_atomic_helper_commit_writebacks - issue writebacks
1579+
* @dev: DRM device
1580+
* @state: atomic state object being committed
1581+
*
1582+
* This loops over the connectors, checks if the new state requires
1583+
* a writeback job to be issued and in that case issues an atomic
1584+
* commit on each connector.
1585+
*/
1586+
void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
1587+
struct drm_atomic_state *state)
15401588
{
15411589
struct drm_connector *connector;
15421590
struct drm_connector_state *new_conn_state;
@@ -1555,9 +1603,18 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
15551603
}
15561604
}
15571605
}
1606+
EXPORT_SYMBOL(drm_atomic_helper_commit_writebacks);
15581607

1559-
static void
1560-
encoder_bridge_pre_enable(struct drm_device *dev, struct drm_atomic_state *state)
1608+
/**
1609+
* drm_atomic_helper_commit_encoder_bridge_pre_enable - pre-enable bridges
1610+
* @dev: DRM device
1611+
* @state: atomic state object being committed
1612+
*
1613+
* This loops over the connectors and if the CRTC needs it, pre-enables
1614+
* the entire bridge chain.
1615+
*/
1616+
void
1617+
drm_atomic_helper_commit_encoder_bridge_pre_enable(struct drm_device *dev, struct drm_atomic_state *state)
15611618
{
15621619
struct drm_connector *connector;
15631620
struct drm_connector_state *new_conn_state;
@@ -1588,9 +1645,18 @@ encoder_bridge_pre_enable(struct drm_device *dev, struct drm_atomic_state *state
15881645
drm_bridge_put(bridge);
15891646
}
15901647
}
1648+
EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_pre_enable);
15911649

1592-
static void
1593-
crtc_enable(struct drm_device *dev, struct drm_atomic_state *state)
1650+
/**
1651+
* drm_atomic_helper_commit_crtc_enable - enables the CRTCs
1652+
* @dev: DRM device
1653+
* @state: atomic state object being committed
1654+
*
1655+
* This loops over CRTCs in the new state, and of the CRTC needs
1656+
* it, enables it.
1657+
*/
1658+
void
1659+
drm_atomic_helper_commit_crtc_enable(struct drm_device *dev, struct drm_atomic_state *state)
15941660
{
15951661
struct drm_crtc *crtc;
15961662
struct drm_crtc_state *old_crtc_state;
@@ -1619,9 +1685,18 @@ crtc_enable(struct drm_device *dev, struct drm_atomic_state *state)
16191685
}
16201686
}
16211687
}
1688+
EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_enable);
16221689

1623-
static void
1624-
encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
1690+
/**
1691+
* drm_atomic_helper_commit_encoder_bridge_enable - enables the bridges
1692+
* @dev: DRM device
1693+
* @state: atomic state object being committed
1694+
*
1695+
* This loops over all connectors in the new state, and of the CRTC needs
1696+
* it, enables the entire bridge chain.
1697+
*/
1698+
void
1699+
drm_atomic_helper_commit_encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
16251700
{
16261701
struct drm_connector *connector;
16271702
struct drm_connector_state *new_conn_state;
@@ -1664,6 +1739,7 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
16641739
drm_bridge_put(bridge);
16651740
}
16661741
}
1742+
EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_enable);
16671743

16681744
/**
16691745
* drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
@@ -1682,11 +1758,11 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
16821758
void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
16831759
struct drm_atomic_state *state)
16841760
{
1685-
encoder_bridge_pre_enable(dev, state);
1761+
drm_atomic_helper_commit_crtc_enable(dev, state);
16861762

1687-
crtc_enable(dev, state);
1763+
drm_atomic_helper_commit_encoder_bridge_pre_enable(dev, state);
16881764

1689-
encoder_bridge_enable(dev, state);
1765+
drm_atomic_helper_commit_encoder_bridge_enable(dev, state);
16901766

16911767
drm_atomic_helper_commit_writebacks(dev, state);
16921768
}

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ static void drm_fb_helper_damage_work(struct work_struct *work)
366366
{
367367
struct drm_fb_helper *helper = container_of(work, struct drm_fb_helper, damage_work);
368368

369+
if (helper->info->state != FBINFO_STATE_RUNNING)
370+
return;
371+
369372
drm_fb_helper_fb_dirty(helper);
370373
}
371374

@@ -732,6 +735,13 @@ void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper,
732735
if (fb_helper->info->state != FBINFO_STATE_RUNNING)
733736
return;
734737

738+
/*
739+
* Cancel pending damage work. During GPU reset, VBlank
740+
* interrupts are disabled and drm_fb_helper_fb_dirty()
741+
* would wait for VBlank timeout otherwise.
742+
*/
743+
cancel_work_sync(&fb_helper->damage_work);
744+
735745
console_lock();
736746

737747
} else {

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,12 +1002,6 @@ static int mtk_dsi_host_attach(struct mipi_dsi_host *host,
10021002
return PTR_ERR(dsi->next_bridge);
10031003
}
10041004

1005-
/*
1006-
* set flag to request the DSI host bridge be pre-enabled before device bridge
1007-
* in the chain, so the DSI host is ready when the device bridge is pre-enabled
1008-
*/
1009-
dsi->next_bridge->pre_enable_prev_first = true;
1010-
10111005
drm_bridge_add(&dsi->bridge);
10121006

10131007
ret = component_add(host->dev, &mtk_dsi_component_ops);

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ ad102_gsp = {
3030

3131
.booter.ctor = ga102_gsp_booter_ctor,
3232

33+
.fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
34+
.fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
35+
3336
.dtor = r535_gsp_dtor,
3437
.oneinit = tu102_gsp_oneinit,
3538
.init = tu102_gsp_init,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/fwsec.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,12 @@ nvkm_gsp_fwsec_sb(struct nvkm_gsp *gsp)
337337
}
338338

339339
int
340-
nvkm_gsp_fwsec_sb_ctor(struct nvkm_gsp *gsp)
340+
nvkm_gsp_fwsec_sb_init(struct nvkm_gsp *gsp)
341341
{
342342
return nvkm_gsp_fwsec_init(gsp, &gsp->fws.falcon.sb, "fwsec-sb",
343343
NVFW_FALCON_APPIF_DMEMMAPPER_CMD_SB);
344344
}
345345

346-
void
347-
nvkm_gsp_fwsec_sb_dtor(struct nvkm_gsp *gsp)
348-
{
349-
nvkm_falcon_fw_dtor(&gsp->fws.falcon.sb);
350-
}
351-
352346
int
353347
nvkm_gsp_fwsec_frts(struct nvkm_gsp *gsp)
354348
{

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ ga100_gsp = {
4747

4848
.booter.ctor = tu102_gsp_booter_ctor,
4949

50+
.fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
51+
.fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
52+
5053
.dtor = r535_gsp_dtor,
5154
.oneinit = tu102_gsp_oneinit,
5255
.init = tu102_gsp_init,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ ga102_gsp_r535 = {
158158

159159
.booter.ctor = ga102_gsp_booter_ctor,
160160

161+
.fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
162+
.fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
163+
161164
.dtor = r535_gsp_dtor,
162165
.oneinit = tu102_gsp_oneinit,
163166
.init = tu102_gsp_init,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ enum nvkm_acr_lsf_id;
77

88
int nvkm_gsp_fwsec_frts(struct nvkm_gsp *);
99

10-
int nvkm_gsp_fwsec_sb_ctor(struct nvkm_gsp *);
1110
int nvkm_gsp_fwsec_sb(struct nvkm_gsp *);
12-
void nvkm_gsp_fwsec_sb_dtor(struct nvkm_gsp *);
11+
int nvkm_gsp_fwsec_sb_init(struct nvkm_gsp *gsp);
1312

1413
struct nvkm_gsp_fwif {
1514
int version;
@@ -52,6 +51,11 @@ struct nvkm_gsp_func {
5251
struct nvkm_falcon *, struct nvkm_falcon_fw *);
5352
} booter;
5453

54+
struct {
55+
int (*ctor)(struct nvkm_gsp *);
56+
void (*dtor)(struct nvkm_gsp *);
57+
} fwsec_sb;
58+
5559
void (*dtor)(struct nvkm_gsp *);
5660
int (*oneinit)(struct nvkm_gsp *);
5761
int (*init)(struct nvkm_gsp *);
@@ -67,6 +71,8 @@ extern const struct nvkm_falcon_func tu102_gsp_flcn;
6771
extern const struct nvkm_falcon_fw_func tu102_gsp_fwsec;
6872
int tu102_gsp_booter_ctor(struct nvkm_gsp *, const char *, const struct firmware *,
6973
struct nvkm_falcon *, struct nvkm_falcon_fw *);
74+
int tu102_gsp_fwsec_sb_ctor(struct nvkm_gsp *);
75+
void tu102_gsp_fwsec_sb_dtor(struct nvkm_gsp *);
7076
int tu102_gsp_oneinit(struct nvkm_gsp *);
7177
int tu102_gsp_init(struct nvkm_gsp *);
7278
int tu102_gsp_fini(struct nvkm_gsp *, bool suspend);
@@ -91,5 +97,18 @@ int r535_gsp_fini(struct nvkm_gsp *, bool suspend);
9197
int nvkm_gsp_new_(const struct nvkm_gsp_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int,
9298
struct nvkm_gsp **);
9399

100+
static inline int nvkm_gsp_fwsec_sb_ctor(struct nvkm_gsp *gsp)
101+
{
102+
if (gsp->func->fwsec_sb.ctor)
103+
return gsp->func->fwsec_sb.ctor(gsp);
104+
return 0;
105+
}
106+
107+
static inline void nvkm_gsp_fwsec_sb_dtor(struct nvkm_gsp *gsp)
108+
{
109+
if (gsp->func->fwsec_sb.dtor)
110+
gsp->func->fwsec_sb.dtor(gsp);
111+
}
112+
94113
extern const struct nvkm_gsp_func gv100_gsp;
95114
#endif

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
#include <nvfw/fw.h>
3131
#include <nvfw/hs.h>
3232

33+
int
34+
tu102_gsp_fwsec_sb_ctor(struct nvkm_gsp *gsp)
35+
{
36+
return nvkm_gsp_fwsec_sb_init(gsp);
37+
}
38+
39+
void
40+
tu102_gsp_fwsec_sb_dtor(struct nvkm_gsp *gsp)
41+
{
42+
nvkm_falcon_fw_dtor(&gsp->fws.falcon.sb);
43+
}
44+
3345
static int
3446
tu102_gsp_booter_unload(struct nvkm_gsp *gsp, u32 mbox0, u32 mbox1)
3547
{
@@ -370,6 +382,9 @@ tu102_gsp = {
370382

371383
.booter.ctor = tu102_gsp_booter_ctor,
372384

385+
.fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
386+
.fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
387+
373388
.dtor = r535_gsp_dtor,
374389
.oneinit = tu102_gsp_oneinit,
375390
.init = tu102_gsp_init,

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ tu116_gsp = {
3030

3131
.booter.ctor = tu102_gsp_booter_ctor,
3232

33+
.fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
34+
.fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
35+
3336
.dtor = r535_gsp_dtor,
3437
.oneinit = tu102_gsp_oneinit,
3538
.init = tu102_gsp_init,

0 commit comments

Comments
 (0)