Skip to content

Commit b095398

Browse files
committed
Merge tag 'drm-misc-fixes-2025-10-30' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: ast: - Preserve correct bits on register I/O dma-fence: - Use correct timeline name etnaviv: - Use correct GPU adress space for flush imx: - parallel-display: Fix bridge handling nouveau: - Fix locking in scheduler panel: - kingdisplay-kd097d04: Disable EOT packet - sitronix-st7789v: Use correct SYNC flags sched: - Fix locking to avoid race condition - Fix SIGKILL handling sysfb: - Avoid NULL-pointer access Signed-off-by: Simona Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patch.msgid.link/[email protected]
2 parents e28e383 + a9fb41b commit b095398

File tree

9 files changed

+44
-23
lines changed

9 files changed

+44
-23
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ const char __rcu *dma_fence_timeline_name(struct dma_fence *fence)
11411141
"RCU protection is required for safe access to returned string");
11421142

11431143
if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
1144-
return fence->ops->get_driver_name(fence);
1144+
return fence->ops->get_timeline_name(fence);
11451145
else
11461146
return "signaled-timeline";
11471147
}

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,13 @@ static inline void __ast_write8_i(void __iomem *addr, u32 reg, u8 index, u8 val)
282282
__ast_write8(addr, reg + 1, val);
283283
}
284284

285-
static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 read_mask,
285+
static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 preserve_mask,
286286
u8 val)
287287
{
288-
u8 tmp = __ast_read8_i_masked(addr, reg, index, read_mask);
288+
u8 tmp = __ast_read8_i_masked(addr, reg, index, preserve_mask);
289289

290-
tmp |= val;
291-
__ast_write8_i(addr, reg, index, tmp);
290+
val &= ~preserve_mask;
291+
__ast_write8_i(addr, reg, index, tmp | val);
292292
}
293293

294294
static inline u32 ast_read32(struct ast_device *ast, u32 reg)

drivers/gpu/drm/drm_gem_atomic_helper.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,12 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_plane_state);
310310
void __drm_gem_reset_shadow_plane(struct drm_plane *plane,
311311
struct drm_shadow_plane_state *shadow_plane_state)
312312
{
313-
__drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base);
314-
drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state);
313+
if (shadow_plane_state) {
314+
__drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base);
315+
drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state);
316+
} else {
317+
__drm_atomic_helper_plane_reset(plane, NULL);
318+
}
315319
}
316320
EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);
317321

drivers/gpu/drm/etnaviv/etnaviv_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state,
347347
u32 link_target, link_dwords;
348348
bool switch_context = gpu->exec_state != exec_state;
349349
bool switch_mmu_context = gpu->mmu_context != mmu_context;
350-
unsigned int new_flush_seq = READ_ONCE(gpu->mmu_context->flush_seq);
350+
unsigned int new_flush_seq = READ_ONCE(mmu_context->flush_seq);
351351
bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq;
352352
bool has_blt = !!(gpu->identity.minor_features5 &
353353
chipMinorFeatures5_BLT_ENGINE);

drivers/gpu/drm/imx/ipuv3/parallel-display.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@
2525

2626
struct imx_parallel_display_encoder {
2727
struct drm_encoder encoder;
28-
struct drm_bridge bridge;
29-
struct imx_parallel_display *pd;
3028
};
3129

3230
struct imx_parallel_display {
3331
struct device *dev;
3432
u32 bus_format;
3533
struct drm_bridge *next_bridge;
34+
struct drm_bridge bridge;
3635
};
3736

3837
static inline struct imx_parallel_display *bridge_to_imxpd(struct drm_bridge *b)
3938
{
40-
return container_of(b, struct imx_parallel_display_encoder, bridge)->pd;
39+
return container_of(b, struct imx_parallel_display, bridge);
4140
}
4241

4342
static const u32 imx_pd_bus_fmts[] = {
@@ -195,15 +194,13 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
195194
if (IS_ERR(imxpd_encoder))
196195
return PTR_ERR(imxpd_encoder);
197196

198-
imxpd_encoder->pd = imxpd;
199197
encoder = &imxpd_encoder->encoder;
200-
bridge = &imxpd_encoder->bridge;
198+
bridge = &imxpd->bridge;
201199

202200
ret = imx_drm_encoder_parse_of(drm, encoder, imxpd->dev->of_node);
203201
if (ret)
204202
return ret;
205203

206-
bridge->funcs = &imx_pd_bridge_funcs;
207204
drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
208205

209206
connector = drm_bridge_connector_init(drm, encoder);
@@ -228,9 +225,10 @@ static int imx_pd_probe(struct platform_device *pdev)
228225
u32 bus_format = 0;
229226
const char *fmt;
230227

231-
imxpd = devm_kzalloc(dev, sizeof(*imxpd), GFP_KERNEL);
232-
if (!imxpd)
233-
return -ENOMEM;
228+
imxpd = devm_drm_bridge_alloc(dev, struct imx_parallel_display, bridge,
229+
&imx_pd_bridge_funcs);
230+
if (IS_ERR(imxpd))
231+
return PTR_ERR(imxpd);
234232

235233
/* port@1 is the output port */
236234
imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
@@ -258,6 +256,8 @@ static int imx_pd_probe(struct platform_device *pdev)
258256

259257
platform_set_drvdata(pdev, imxpd);
260258

259+
devm_drm_bridge_add(dev, &imxpd->bridge);
260+
261261
return component_add(dev, &imx_pd_ops);
262262
}
263263

drivers/gpu/drm/nouveau/nouveau_sched.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,25 @@ nouveau_sched_create(struct nouveau_sched **psched, struct nouveau_drm *drm,
482482
return 0;
483483
}
484484

485+
static bool
486+
nouveau_sched_job_list_empty(struct nouveau_sched *sched)
487+
{
488+
bool empty;
489+
490+
spin_lock(&sched->job.list.lock);
491+
empty = list_empty(&sched->job.list.head);
492+
spin_unlock(&sched->job.list.lock);
493+
494+
return empty;
495+
}
485496

486497
static void
487498
nouveau_sched_fini(struct nouveau_sched *sched)
488499
{
489500
struct drm_gpu_scheduler *drm_sched = &sched->base;
490501
struct drm_sched_entity *entity = &sched->entity;
491502

492-
rmb(); /* for list_empty to work without lock */
493-
wait_event(sched->job.wq, list_empty(&sched->job.list.head));
503+
wait_event(sched->job.wq, nouveau_sched_job_list_empty(sched));
494504

495505
drm_sched_entity_fini(entity);
496506
drm_sched_fini(drm_sched);

drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)
359359
dsi->lanes = 4;
360360
dsi->format = MIPI_DSI_FMT_RGB888;
361361
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
362-
MIPI_DSI_MODE_LPM;
362+
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
363363

364364
kingdisplay = devm_drm_panel_alloc(&dsi->dev, __typeof(*kingdisplay), base,
365365
&kingdisplay_panel_funcs,

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ static const struct drm_display_mode default_mode = {
249249
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
250250
};
251251

252+
/*
253+
* The mode data for this panel has been reverse engineered without access
254+
* to the panel datasheet / manual. Using DRM_MODE_FLAG_PHSYNC like all
255+
* other panels results in garbage data on the display.
256+
*/
252257
static const struct drm_display_mode t28cp45tn89_mode = {
253258
.clock = 6008,
254259
.hdisplay = 240,
@@ -261,7 +266,7 @@ static const struct drm_display_mode t28cp45tn89_mode = {
261266
.vtotal = 320 + 8 + 4 + 4,
262267
.width_mm = 43,
263268
.height_mm = 57,
264-
.flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC,
269+
.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC,
265270
};
266271

267272
static const struct drm_display_mode et028013dma_mode = {

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
7070
entity->guilty = guilty;
7171
entity->num_sched_list = num_sched_list;
7272
entity->priority = priority;
73+
entity->last_user = current->group_leader;
7374
/*
7475
* It's perfectly valid to initialize an entity without having a valid
7576
* scheduler attached. It's just not valid to use the scheduler before it
@@ -302,7 +303,7 @@ long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout)
302303

303304
/* For a killed process disallow further enqueueing of jobs. */
304305
last_user = cmpxchg(&entity->last_user, current->group_leader, NULL);
305-
if ((!last_user || last_user == current->group_leader) &&
306+
if (last_user == current->group_leader &&
306307
(current->flags & PF_EXITING) && (current->exit_code == SIGKILL))
307308
drm_sched_entity_kill(entity);
308309

@@ -552,10 +553,11 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
552553
drm_sched_rq_remove_entity(entity->rq, entity);
553554
entity->rq = rq;
554555
}
555-
spin_unlock(&entity->lock);
556556

557557
if (entity->num_sched_list == 1)
558558
entity->sched_list = NULL;
559+
560+
spin_unlock(&entity->lock);
559561
}
560562

561563
/**

0 commit comments

Comments
 (0)