Skip to content

Commit 25294cb

Browse files
committed
Merge tag 'drm-fixes-2025-06-14' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Quiet week, only two pull requests came my way, xe has a couple of fixes and then a bunch of fixes across the board, vc4 probably fixes the biggest problem: vc4: - Fix infinite EPROBE_DEFER loop in vc4 probing amdxdna: - Fix amdxdna firmware size meson: - modesetting fixes sitronix: - Kconfig fix for st7171-i2c dma-buf: - Fix -EBUSY WARN_ON_ONCE in dma-buf udmabuf: - Use dma_sync_sgtable_for_cpu in udmabuf xe: - Fix regression disallowing 64K SVM migration - Use a bounce buffer for WA BB" * tag 'drm-fixes-2025-06-14' of https://gitlab.freedesktop.org/drm/kernel: drm/xe/lrc: Use a temporary buffer for WA BB udmabuf: use sgtable-based scatterlist wrappers dma-buf: fix compare in WARN_ON_ONCE drm/sitronix: st7571-i2c: Select VIDEOMODE_HELPERS drm/meson: fix more rounding issues with 59.94Hz modes drm/meson: use vclk_freq instead of pixel_freq in debug print drm/meson: fix debug log statement when setting the HDMI clocks drm/vc4: fix infinite EPROBE_DEFER loop drm/xe/svm: Fix regression disallowing 64K SVM migration accel/amdxdna: Fix incorrect PSP firmware size
2 parents 18531f4 + 1364af9 commit 25294cb

File tree

9 files changed

+68
-39
lines changed

9 files changed

+68
-39
lines changed

drivers/accel/amdxdna/aie2_psp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ struct psp_device *aie2m_psp_create(struct drm_device *ddev, struct psp_config *
126126
psp->ddev = ddev;
127127
memcpy(psp->psp_regs, conf->psp_regs, sizeof(psp->psp_regs));
128128

129-
psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN) + PSP_FW_ALIGN;
130-
psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz, GFP_KERNEL);
129+
psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN);
130+
psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz + PSP_FW_ALIGN, GFP_KERNEL);
131131
if (!psp->fw_buffer) {
132132
drm_err(ddev, "no memory for fw buffer");
133133
return NULL;

drivers/dma-buf/dma-buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
11181118
* Catch exporters making buffers inaccessible even when
11191119
* attachments preventing that exist.
11201120
*/
1121-
WARN_ON_ONCE(ret == EBUSY);
1121+
WARN_ON_ONCE(ret == -EBUSY);
11221122
if (ret)
11231123
return ERR_PTR(ret);
11241124
}

drivers/dma-buf/udmabuf.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ static int begin_cpu_udmabuf(struct dma_buf *buf,
264264
ubuf->sg = NULL;
265265
}
266266
} else {
267-
dma_sync_sg_for_cpu(dev, ubuf->sg->sgl, ubuf->sg->nents,
268-
direction);
267+
dma_sync_sgtable_for_cpu(dev, ubuf->sg, direction);
269268
}
270269

271270
return ret;
@@ -280,7 +279,7 @@ static int end_cpu_udmabuf(struct dma_buf *buf,
280279
if (!ubuf->sg)
281280
return -EINVAL;
282281

283-
dma_sync_sg_for_device(dev, ubuf->sg->sgl, ubuf->sg->nents, direction);
282+
dma_sync_sgtable_for_device(dev, ubuf->sg, direction);
284283
return 0;
285284
}
286285

drivers/gpu/drm/meson/meson_encoder_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void meson_encoder_hdmi_set_vclk(struct meson_encoder_hdmi *encoder_hdmi,
109109
venc_freq /= 2;
110110

111111
dev_dbg(priv->dev,
112-
"vclk:%lluHz phy=%lluHz venc=%lluHz hdmi=%lluHz enci=%d\n",
112+
"phy:%lluHz vclk=%lluHz venc=%lluHz hdmi=%lluHz enci=%d\n",
113113
phy_freq, vclk_freq, venc_freq, hdmi_freq,
114114
priv->venc.hdmi_use_enci);
115115

drivers/gpu/drm/meson/meson_vclk.c

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@
110110
#define HDMI_PLL_LOCK BIT(31)
111111
#define HDMI_PLL_LOCK_G12A (3 << 30)
112112

113-
#define PIXEL_FREQ_1000_1001(_freq) \
114-
DIV_ROUND_CLOSEST_ULL((_freq) * 1000ULL, 1001ULL)
115-
#define PHY_FREQ_1000_1001(_freq) \
116-
(PIXEL_FREQ_1000_1001(DIV_ROUND_DOWN_ULL(_freq, 10ULL)) * 10)
113+
#define FREQ_1000_1001(_freq) DIV_ROUND_CLOSEST_ULL((_freq) * 1000ULL, 1001ULL)
117114

118115
/* VID PLL Dividers */
119116
enum {
@@ -772,6 +769,36 @@ static void meson_hdmi_pll_generic_set(struct meson_drm *priv,
772769
pll_freq);
773770
}
774771

772+
static bool meson_vclk_freqs_are_matching_param(unsigned int idx,
773+
unsigned long long phy_freq,
774+
unsigned long long vclk_freq)
775+
{
776+
DRM_DEBUG_DRIVER("i = %d vclk_freq = %lluHz alt = %lluHz\n",
777+
idx, params[idx].vclk_freq,
778+
FREQ_1000_1001(params[idx].vclk_freq));
779+
DRM_DEBUG_DRIVER("i = %d phy_freq = %lluHz alt = %lluHz\n",
780+
idx, params[idx].phy_freq,
781+
FREQ_1000_1001(params[idx].phy_freq));
782+
783+
/* Match strict frequency */
784+
if (phy_freq == params[idx].phy_freq &&
785+
vclk_freq == params[idx].vclk_freq)
786+
return true;
787+
788+
/* Match 1000/1001 variant: vclk deviation has to be less than 1kHz
789+
* (drm EDID is defined in 1kHz steps, so everything smaller must be
790+
* rounding error) and the PHY freq deviation has to be less than
791+
* 10kHz (as the TMDS clock is 10 times the pixel clock, so anything
792+
* smaller must be rounding error as well).
793+
*/
794+
if (abs(vclk_freq - FREQ_1000_1001(params[idx].vclk_freq)) < 1000 &&
795+
abs(phy_freq - FREQ_1000_1001(params[idx].phy_freq)) < 10000)
796+
return true;
797+
798+
/* no match */
799+
return false;
800+
}
801+
775802
enum drm_mode_status
776803
meson_vclk_vic_supported_freq(struct meson_drm *priv,
777804
unsigned long long phy_freq,
@@ -790,19 +817,7 @@ meson_vclk_vic_supported_freq(struct meson_drm *priv,
790817
}
791818

792819
for (i = 0 ; params[i].pixel_freq ; ++i) {
793-
DRM_DEBUG_DRIVER("i = %d pixel_freq = %lluHz alt = %lluHz\n",
794-
i, params[i].pixel_freq,
795-
PIXEL_FREQ_1000_1001(params[i].pixel_freq));
796-
DRM_DEBUG_DRIVER("i = %d phy_freq = %lluHz alt = %lluHz\n",
797-
i, params[i].phy_freq,
798-
PHY_FREQ_1000_1001(params[i].phy_freq));
799-
/* Match strict frequency */
800-
if (phy_freq == params[i].phy_freq &&
801-
vclk_freq == params[i].vclk_freq)
802-
return MODE_OK;
803-
/* Match 1000/1001 variant */
804-
if (phy_freq == PHY_FREQ_1000_1001(params[i].phy_freq) &&
805-
vclk_freq == PIXEL_FREQ_1000_1001(params[i].vclk_freq))
820+
if (meson_vclk_freqs_are_matching_param(i, phy_freq, vclk_freq))
806821
return MODE_OK;
807822
}
808823

@@ -1075,10 +1090,8 @@ void meson_vclk_setup(struct meson_drm *priv, unsigned int target,
10751090
}
10761091

10771092
for (freq = 0 ; params[freq].pixel_freq ; ++freq) {
1078-
if ((phy_freq == params[freq].phy_freq ||
1079-
phy_freq == PHY_FREQ_1000_1001(params[freq].phy_freq)) &&
1080-
(vclk_freq == params[freq].vclk_freq ||
1081-
vclk_freq == PIXEL_FREQ_1000_1001(params[freq].vclk_freq))) {
1093+
if (meson_vclk_freqs_are_matching_param(freq, phy_freq,
1094+
vclk_freq)) {
10821095
if (vclk_freq != params[freq].vclk_freq)
10831096
vic_alternate_clock = true;
10841097
else

drivers/gpu/drm/sitronix/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config DRM_ST7571_I2C
55
select DRM_GEM_SHMEM_HELPER
66
select DRM_KMS_HELPER
77
select REGMAP_I2C
8+
select VIDEOMODE_HELPERS
89
help
910
DRM driver for Sitronix ST7571 panels controlled over I2C.
1011

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,6 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
560560
if (ret)
561561
return ret;
562562

563-
ret = drm_connector_hdmi_audio_init(connector, dev->dev,
564-
&vc4_hdmi_audio_funcs,
565-
8, false, -1);
566-
if (ret)
567-
return ret;
568-
569563
drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs);
570564

571565
/*
@@ -2291,6 +2285,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
22912285
return ret;
22922286
}
22932287

2288+
ret = drm_connector_hdmi_audio_init(&vc4_hdmi->connector, dev,
2289+
&vc4_hdmi_audio_funcs, 8, false,
2290+
-1);
2291+
if (ret)
2292+
return ret;
2293+
22942294
dai_link->cpus = &vc4_hdmi->audio.cpu;
22952295
dai_link->codecs = &vc4_hdmi->audio.codec;
22962296
dai_link->platforms = &vc4_hdmi->audio.platform;

drivers/gpu/drm/xe/xe_lrc.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,18 @@ static void xe_lrc_finish(struct xe_lrc *lrc)
941941
* store it in the PPHSWP.
942942
*/
943943
#define CONTEXT_ACTIVE 1ULL
944-
static void xe_lrc_setup_utilization(struct xe_lrc *lrc)
944+
static int xe_lrc_setup_utilization(struct xe_lrc *lrc)
945945
{
946-
u32 *cmd;
946+
u32 *cmd, *buf = NULL;
947947

948-
cmd = lrc->bb_per_ctx_bo->vmap.vaddr;
948+
if (lrc->bb_per_ctx_bo->vmap.is_iomem) {
949+
buf = kmalloc(lrc->bb_per_ctx_bo->size, GFP_KERNEL);
950+
if (!buf)
951+
return -ENOMEM;
952+
cmd = buf;
953+
} else {
954+
cmd = lrc->bb_per_ctx_bo->vmap.vaddr;
955+
}
949956

950957
*cmd++ = MI_STORE_REGISTER_MEM | MI_SRM_USE_GGTT | MI_SRM_ADD_CS_OFFSET;
951958
*cmd++ = ENGINE_ID(0).addr;
@@ -966,9 +973,16 @@ static void xe_lrc_setup_utilization(struct xe_lrc *lrc)
966973

967974
*cmd++ = MI_BATCH_BUFFER_END;
968975

976+
if (buf) {
977+
xe_map_memcpy_to(gt_to_xe(lrc->gt), &lrc->bb_per_ctx_bo->vmap, 0,
978+
buf, (cmd - buf) * sizeof(*cmd));
979+
kfree(buf);
980+
}
981+
969982
xe_lrc_write_ctx_reg(lrc, CTX_BB_PER_CTX_PTR,
970983
xe_bo_ggtt_addr(lrc->bb_per_ctx_bo) | 1);
971984

985+
return 0;
972986
}
973987

974988
#define PVC_CTX_ASID (0x2e + 1)
@@ -1125,7 +1139,9 @@ static int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
11251139
map = __xe_lrc_start_seqno_map(lrc);
11261140
xe_map_write32(lrc_to_xe(lrc), &map, lrc->fence_ctx.next_seqno - 1);
11271141

1128-
xe_lrc_setup_utilization(lrc);
1142+
err = xe_lrc_setup_utilization(lrc);
1143+
if (err)
1144+
goto err_lrc_finish;
11291145

11301146
return 0;
11311147

drivers/gpu/drm/xe/xe_svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ static bool xe_svm_range_needs_migrate_to_vram(struct xe_svm_range *range,
764764
return false;
765765
}
766766

767-
if (range_size <= SZ_64K && !supports_4K_migration(vm->xe)) {
767+
if (range_size < SZ_64K && !supports_4K_migration(vm->xe)) {
768768
drm_dbg(&vm->xe->drm, "Platform doesn't support SZ_4K range migration\n");
769769
return false;
770770
}

0 commit comments

Comments
 (0)