Skip to content

Commit 1364af9

Browse files
committed
Merge tag 'drm-misc-fixes-2025-06-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.16-rc2: - Fix infinite EPROBE_DEFER loop in vc4 probing. - Fix amdxdna firmware size. - mode fixes for meson. - Kconfig fix for st7171-i2c. - Fix -EBUSY WARN_ON_ONCE in dma-buf - Use dma_sync_sgtable_for_cpu in udmabuf. Signed-off-by: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents a24823d + afe3828 commit 1364af9

File tree

7 files changed

+47
-34
lines changed

7 files changed

+47
-34
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;

0 commit comments

Comments
 (0)