Skip to content

Commit 3c9eced

Browse files
committed
Merge tag 'drm-misc-fixes-2026-03-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
A pixel byte swap fix for st7586, a null pointer dereference fix for gud, two timings fixes for ti-sn65dsi83, an initialization fix for ivpu, and a runtime suspend deadlock fix for amdxdna. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20260312-accurate-ambrosial-trout-bfabf8@houat
2 parents 50ae4ce + 49973e2 commit 3c9eced

10 files changed

Lines changed: 74 additions & 55 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8626,9 +8626,8 @@ F: drivers/gpu/drm/lima/
86268626
F: include/uapi/drm/lima_drm.h
86278627

86288628
DRM DRIVERS FOR LOONGSON
8629-
M: Sui Jingfeng <suijingfeng@loongson.cn>
86308629
L: dri-devel@lists.freedesktop.org
8631-
S: Supported
8630+
S: Orphan
86328631
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
86338632
F: drivers/gpu/drm/loongson/
86348633

drivers/accel/amdxdna/aie2_ctx.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ aie2_sched_notify(struct amdxdna_sched_job *job)
165165

166166
trace_xdna_job(&job->base, job->hwctx->name, "signaled fence", job->seq);
167167

168-
amdxdna_pm_suspend_put(job->hwctx->client->xdna);
169168
job->hwctx->priv->completed++;
170169
dma_fence_signal(fence);
171170

@@ -290,19 +289,11 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
290289
struct dma_fence *fence;
291290
int ret;
292291

293-
ret = amdxdna_pm_resume_get(hwctx->client->xdna);
294-
if (ret)
292+
if (!hwctx->priv->mbox_chann)
295293
return NULL;
296294

297-
if (!hwctx->priv->mbox_chann) {
298-
amdxdna_pm_suspend_put(hwctx->client->xdna);
299-
return NULL;
300-
}
301-
302-
if (!mmget_not_zero(job->mm)) {
303-
amdxdna_pm_suspend_put(hwctx->client->xdna);
295+
if (!mmget_not_zero(job->mm))
304296
return ERR_PTR(-ESRCH);
305-
}
306297

307298
kref_get(&job->refcnt);
308299
fence = dma_fence_get(job->fence);
@@ -333,7 +324,6 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
333324

334325
out:
335326
if (ret) {
336-
amdxdna_pm_suspend_put(hwctx->client->xdna);
337327
dma_fence_put(job->fence);
338328
aie2_job_put(job);
339329
mmput(job->mm);

drivers/accel/amdxdna/amdxdna_ctx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "amdxdna_ctx.h"
1818
#include "amdxdna_gem.h"
1919
#include "amdxdna_pci_drv.h"
20+
#include "amdxdna_pm.h"
2021

2122
#define MAX_HWCTX_ID 255
2223
#define MAX_ARG_COUNT 4095
@@ -445,6 +446,7 @@ amdxdna_arg_bos_lookup(struct amdxdna_client *client,
445446
void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job)
446447
{
447448
trace_amdxdna_debug_point(job->hwctx->name, job->seq, "job release");
449+
amdxdna_pm_suspend_put(job->hwctx->client->xdna);
448450
amdxdna_arg_bos_put(job);
449451
amdxdna_gem_put_obj(job->cmd_bo);
450452
dma_fence_put(job->fence);
@@ -482,6 +484,12 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
482484
goto cmd_put;
483485
}
484486

487+
ret = amdxdna_pm_resume_get(xdna);
488+
if (ret) {
489+
XDNA_ERR(xdna, "Resume failed, ret %d", ret);
490+
goto put_bos;
491+
}
492+
485493
idx = srcu_read_lock(&client->hwctx_srcu);
486494
hwctx = xa_load(&client->hwctx_xa, hwctx_hdl);
487495
if (!hwctx) {
@@ -522,6 +530,8 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
522530
dma_fence_put(job->fence);
523531
unlock_srcu:
524532
srcu_read_unlock(&client->hwctx_srcu, idx);
533+
amdxdna_pm_suspend_put(xdna);
534+
put_bos:
525535
amdxdna_arg_bos_put(job);
526536
cmd_put:
527537
amdxdna_gem_put_obj(job->cmd_bo);

drivers/accel/ivpu/ivpu_hw_40xx_reg.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@
121121
#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY 0x0003006cu
122122
#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY_STATUS_DLY_MASK GENMASK(7, 0)
123123

124-
#define VPU_40XX_HOST_SS_AON_RETENTION0 0x0003000cu
125-
#define VPU_40XX_HOST_SS_AON_RETENTION1 0x00030010u
126-
#define VPU_40XX_HOST_SS_AON_RETENTION2 0x00030014u
127-
#define VPU_40XX_HOST_SS_AON_RETENTION3 0x00030018u
128-
#define VPU_40XX_HOST_SS_AON_RETENTION4 0x0003001cu
129-
130124
#define VPU_40XX_HOST_SS_AON_IDLE_GEN 0x00030200u
131125
#define VPU_40XX_HOST_SS_AON_IDLE_GEN_EN_MASK BIT_MASK(0)
132126
#define VPU_40XX_HOST_SS_AON_IDLE_GEN_HW_PG_EN_MASK BIT_MASK(1)

drivers/accel/ivpu/ivpu_hw_ip.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,6 @@ static int soc_cpu_boot_40xx(struct ivpu_device *vdev)
931931

932932
static int soc_cpu_boot_60xx(struct ivpu_device *vdev)
933933
{
934-
REGV_WR64(VPU_40XX_HOST_SS_AON_RETENTION1, vdev->fw->mem_bp->vpu_addr);
935934
soc_cpu_set_entry_point_40xx(vdev, vdev->fw->cold_boot_entry_point);
936935

937936
return 0;

drivers/gpu/drm/bridge/ti-sn65dsi83.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ static u8 sn65dsi83_get_dsi_range(struct sn65dsi83 *ctx,
351351
* DSI_CLK = mode clock * bpp / dsi_data_lanes / 2
352352
* the 2 is there because the bus is DDR.
353353
*/
354-
return DIV_ROUND_UP(clamp((unsigned int)mode->clock *
355-
mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) /
356-
ctx->dsi->lanes / 2, 40000U, 500000U), 5000U);
354+
return clamp((unsigned int)mode->clock *
355+
mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) /
356+
ctx->dsi->lanes / 2, 40000U, 500000U) / 5000U;
357357
}
358358

359359
static u8 sn65dsi83_get_dsi_div(struct sn65dsi83 *ctx)
@@ -517,6 +517,7 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge,
517517
struct drm_atomic_state *state)
518518
{
519519
struct sn65dsi83 *ctx = bridge_to_sn65dsi83(bridge);
520+
const unsigned int dual_factor = ctx->lvds_dual_link ? 2 : 1;
520521
const struct drm_bridge_state *bridge_state;
521522
const struct drm_crtc_state *crtc_state;
522523
const struct drm_display_mode *mode;
@@ -653,18 +654,18 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge,
653654
/* 32 + 1 pixel clock to ensure proper operation */
654655
le16val = cpu_to_le16(32 + 1);
655656
regmap_bulk_write(ctx->regmap, REG_VID_CHA_SYNC_DELAY_LOW, &le16val, 2);
656-
le16val = cpu_to_le16(mode->hsync_end - mode->hsync_start);
657+
le16val = cpu_to_le16((mode->hsync_end - mode->hsync_start) / dual_factor);
657658
regmap_bulk_write(ctx->regmap, REG_VID_CHA_HSYNC_PULSE_WIDTH_LOW,
658659
&le16val, 2);
659660
le16val = cpu_to_le16(mode->vsync_end - mode->vsync_start);
660661
regmap_bulk_write(ctx->regmap, REG_VID_CHA_VSYNC_PULSE_WIDTH_LOW,
661662
&le16val, 2);
662663
regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_BACK_PORCH,
663-
mode->htotal - mode->hsync_end);
664+
(mode->htotal - mode->hsync_end) / dual_factor);
664665
regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_BACK_PORCH,
665666
mode->vtotal - mode->vsync_end);
666667
regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_FRONT_PORCH,
667-
mode->hsync_start - mode->hdisplay);
668+
(mode->hsync_start - mode->hdisplay) / dual_factor);
668669
regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_FRONT_PORCH,
669670
mode->vsync_start - mode->vdisplay);
670671
regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00);

drivers/gpu/drm/gud/gud_drv.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ static int gud_stats_debugfs(struct seq_file *m, void *data)
339339
}
340340

341341
static const struct drm_crtc_helper_funcs gud_crtc_helper_funcs = {
342-
.atomic_check = drm_crtc_helper_atomic_check
342+
.atomic_check = drm_crtc_helper_atomic_check,
343+
.atomic_enable = gud_crtc_atomic_enable,
344+
.atomic_disable = gud_crtc_atomic_disable,
343345
};
344346

345347
static const struct drm_crtc_funcs gud_crtc_funcs = {
@@ -364,6 +366,10 @@ static const struct drm_plane_funcs gud_plane_funcs = {
364366
DRM_GEM_SHADOW_PLANE_FUNCS,
365367
};
366368

369+
static const struct drm_mode_config_helper_funcs gud_mode_config_helpers = {
370+
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
371+
};
372+
367373
static const struct drm_mode_config_funcs gud_mode_config_funcs = {
368374
.fb_create = drm_gem_fb_create_with_dirty,
369375
.atomic_check = drm_atomic_helper_check,
@@ -499,6 +505,7 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
499505
drm->mode_config.min_height = le32_to_cpu(desc.min_height);
500506
drm->mode_config.max_height = le32_to_cpu(desc.max_height);
501507
drm->mode_config.funcs = &gud_mode_config_funcs;
508+
drm->mode_config.helper_private = &gud_mode_config_helpers;
502509

503510
/* Format init */
504511
formats_dev = devm_kmalloc(dev, GUD_FORMATS_MAX_NUM, GFP_KERNEL);

drivers/gpu/drm/gud/gud_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ int gud_usb_set_u8(struct gud_device *gdrm, u8 request, u8 val);
6262

6363
void gud_clear_damage(struct gud_device *gdrm);
6464
void gud_flush_work(struct work_struct *work);
65+
void gud_crtc_atomic_enable(struct drm_crtc *crtc,
66+
struct drm_atomic_state *state);
67+
void gud_crtc_atomic_disable(struct drm_crtc *crtc,
68+
struct drm_atomic_state *state);
6569
int gud_plane_atomic_check(struct drm_plane *plane,
6670
struct drm_atomic_state *state);
6771
void gud_plane_atomic_update(struct drm_plane *plane,

drivers/gpu/drm/gud/gud_pipe.c

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,39 @@ int gud_plane_atomic_check(struct drm_plane *plane,
580580
return ret;
581581
}
582582

583+
void gud_crtc_atomic_enable(struct drm_crtc *crtc,
584+
struct drm_atomic_state *state)
585+
{
586+
struct drm_device *drm = crtc->dev;
587+
struct gud_device *gdrm = to_gud_device(drm);
588+
int idx;
589+
590+
if (!drm_dev_enter(drm, &idx))
591+
return;
592+
593+
gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 1);
594+
gud_usb_set(gdrm, GUD_REQ_SET_STATE_COMMIT, 0, NULL, 0);
595+
gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, 1);
596+
597+
drm_dev_exit(idx);
598+
}
599+
600+
void gud_crtc_atomic_disable(struct drm_crtc *crtc,
601+
struct drm_atomic_state *state)
602+
{
603+
struct drm_device *drm = crtc->dev;
604+
struct gud_device *gdrm = to_gud_device(drm);
605+
int idx;
606+
607+
if (!drm_dev_enter(drm, &idx))
608+
return;
609+
610+
gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, 0);
611+
gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 0);
612+
613+
drm_dev_exit(idx);
614+
}
615+
583616
void gud_plane_atomic_update(struct drm_plane *plane,
584617
struct drm_atomic_state *atomic_state)
585618
{
@@ -607,34 +640,19 @@ void gud_plane_atomic_update(struct drm_plane *plane,
607640
mutex_unlock(&gdrm->damage_lock);
608641
}
609642

610-
if (!drm_dev_enter(drm, &idx))
643+
if (!crtc || !drm_dev_enter(drm, &idx))
611644
return;
612645

613-
if (!old_state->fb)
614-
gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 1);
615-
616-
if (fb && (crtc->state->mode_changed || crtc->state->connectors_changed))
617-
gud_usb_set(gdrm, GUD_REQ_SET_STATE_COMMIT, 0, NULL, 0);
618-
619-
if (crtc->state->active_changed)
620-
gud_usb_set_u8(gdrm, GUD_REQ_SET_DISPLAY_ENABLE, crtc->state->active);
621-
622-
if (!fb)
623-
goto ctrl_disable;
624-
625646
ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
626647
if (ret)
627-
goto ctrl_disable;
648+
goto out;
628649

629650
drm_atomic_helper_damage_iter_init(&iter, old_state, new_state);
630651
drm_atomic_for_each_plane_damage(&iter, &damage)
631652
gud_fb_handle_damage(gdrm, fb, &shadow_plane_state->data[0], &damage);
632653

633654
drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
634655

635-
ctrl_disable:
636-
if (!crtc->state->enable)
637-
gud_usb_set_u8(gdrm, GUD_REQ_SET_CONTROLLER_ENABLE, 0);
638-
656+
out:
639657
drm_dev_exit(idx);
640658
}

drivers/gpu/drm/sitronix/st7586.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ static int st7586_probe(struct spi_device *spi)
347347
if (ret)
348348
return ret;
349349

350+
/*
351+
* Override value set by mipi_dbi_spi_init(). This driver is a bit
352+
* non-standard, so best to set it explicitly here.
353+
*/
354+
dbi->write_memory_bpw = 8;
355+
350356
/* Cannot read from this controller via SPI */
351357
dbi->read_commands = NULL;
352358

@@ -356,15 +362,6 @@ static int st7586_probe(struct spi_device *spi)
356362
if (ret)
357363
return ret;
358364

359-
/*
360-
* we are using 8-bit data, so we are not actually swapping anything,
361-
* but setting mipi->swap_bytes makes mipi_dbi_typec3_command() do the
362-
* right thing and not use 16-bit transfers (which results in swapped
363-
* bytes on little-endian systems and causes out of order data to be
364-
* sent to the display).
365-
*/
366-
dbi->swap_bytes = true;
367-
368365
drm_mode_config_reset(drm);
369366

370367
ret = drm_dev_register(drm, 0);

0 commit comments

Comments
 (0)