Skip to content

Commit f581dbb

Browse files
committed
Merge tag 'drm-misc-fixes-2024-02-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
A list handling fix and 64bit division on 32bit platform fix for the drm/buddy allocator, a cast warning and an initialization fix for nouveau, a bridge handling fix for meson, an initialisation fix for ivpu, a SPARC build fix for fbdev, a double-free fix for ttm, and two fence handling fixes for syncobj. Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/gl2antuifidtzn3dfm426p7xwh5fxj23behagwh26owfnosh2w@gqoa7vj5prnh
2 parents b401b62 + 2aa6f5b commit f581dbb

File tree

12 files changed

+39
-24
lines changed

12 files changed

+39
-24
lines changed

arch/sparc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ libs-y += arch/sparc/prom/
6060
libs-y += arch/sparc/lib/
6161

6262
drivers-$(CONFIG_PM) += arch/sparc/power/
63-
drivers-$(CONFIG_FB) += arch/sparc/video/
63+
drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
6464

6565
boot := arch/sparc/boot
6666

arch/sparc/video/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3-
obj-$(CONFIG_FB) += fbdev.o
3+
obj-$(CONFIG_FB_CORE) += fbdev.o

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define SKU_HW_ID_SHIFT 16u
2525
#define SKU_HW_ID_MASK 0xffff0000u
2626

27-
#define PLL_CONFIG_DEFAULT 0x1
27+
#define PLL_CONFIG_DEFAULT 0x0
2828
#define PLL_CDYN_DEFAULT 0x80
2929
#define PLL_EPP_DEFAULT 0x80
3030
#define PLL_REF_CLK_FREQ (50 * 1000000)

drivers/gpu/drm/drm_buddy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
538538
list_add(&block->left->tmp_link, dfs);
539539
} while (1);
540540

541-
list_splice_tail(&allocated, blocks);
542-
543541
if (total_allocated < size) {
544542
err = -ENOSPC;
545543
goto err_free;
546544
}
547545

546+
list_splice_tail(&allocated, blocks);
547+
548548
return 0;
549549

550550
err_undo:

drivers/gpu/drm/drm_syncobj.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
10401040
uint64_t *points;
10411041
uint32_t signaled_count, i;
10421042

1043-
if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT)
1043+
if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
1044+
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE))
10441045
lockdep_assert_none_held_once();
10451046

10461047
points = kmalloc_array(count, sizeof(*points), GFP_KERNEL);
@@ -1109,7 +1110,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
11091110
* fallthough and try a 0 timeout wait!
11101111
*/
11111112

1112-
if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) {
1113+
if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
1114+
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE)) {
11131115
for (i = 0; i < count; ++i)
11141116
drm_syncobj_fence_add_wait(syncobjs[i], &entries[i]);
11151117
}
@@ -1416,10 +1418,21 @@ syncobj_eventfd_entry_func(struct drm_syncobj *syncobj,
14161418

14171419
/* This happens inside the syncobj lock */
14181420
fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, 1));
1421+
if (!fence)
1422+
return;
1423+
14191424
ret = dma_fence_chain_find_seqno(&fence, entry->point);
1420-
if (ret != 0 || !fence) {
1425+
if (ret != 0) {
1426+
/* The given seqno has not been submitted yet. */
14211427
dma_fence_put(fence);
14221428
return;
1429+
} else if (!fence) {
1430+
/* If dma_fence_chain_find_seqno returns 0 but sets the fence
1431+
* to NULL, it implies that the given seqno is signaled and a
1432+
* later seqno has already been submitted. Assign a stub fence
1433+
* so that the eventfd still gets signaled below.
1434+
*/
1435+
fence = dma_fence_get_stub();
14231436
}
14241437

14251438
list_del_init(&entry->node);

drivers/gpu/drm/meson/meson_encoder_cvbs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,5 @@ void meson_encoder_cvbs_remove(struct meson_drm *priv)
294294
if (priv->encoders[MESON_ENC_CVBS]) {
295295
meson_encoder_cvbs = priv->encoders[MESON_ENC_CVBS];
296296
drm_bridge_remove(&meson_encoder_cvbs->bridge);
297-
drm_bridge_remove(meson_encoder_cvbs->next_bridge);
298297
}
299298
}

drivers/gpu/drm/meson/meson_encoder_dsi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,5 @@ void meson_encoder_dsi_remove(struct meson_drm *priv)
168168
if (priv->encoders[MESON_ENC_DSI]) {
169169
meson_encoder_dsi = priv->encoders[MESON_ENC_DSI];
170170
drm_bridge_remove(&meson_encoder_dsi->bridge);
171-
drm_bridge_remove(meson_encoder_dsi->next_bridge);
172171
}
173172
}

drivers/gpu/drm/meson/meson_encoder_hdmi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,5 @@ void meson_encoder_hdmi_remove(struct meson_drm *priv)
474474
if (priv->encoders[MESON_ENC_HDMI]) {
475475
meson_encoder_hdmi = priv->encoders[MESON_ENC_HDMI];
476476
drm_bridge_remove(&meson_encoder_hdmi->bridge);
477-
drm_bridge_remove(meson_encoder_hdmi->next_bridge);
478477
}
479478
}

drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device,
168168
rm->flush = r535_bar_flush;
169169

170170
ret = gf100_bar_new_(rm, device, type, inst, &bar);
171-
*pbar = bar;
172171
if (ret) {
173-
if (!bar)
174-
kfree(rm);
172+
kfree(rm);
175173
return ret;
176174
}
175+
*pbar = bar;
177176

178177
bar->flushBAR2PhysMode = ioremap(device->func->resource_addr(device, 3), PAGE_SIZE);
179178
if (!bar->flushBAR2PhysMode)

drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
154154
return (void *)fw;
155155
}
156156

157+
static void
158+
shadow_fw_release(void *fw)
159+
{
160+
release_firmware(fw);
161+
}
162+
157163
static const struct nvbios_source
158164
shadow_fw = {
159165
.name = "firmware",
160166
.init = shadow_fw_init,
161-
.fini = (void(*)(void *))release_firmware,
167+
.fini = shadow_fw_release,
162168
.read = shadow_fw_read,
163169
.rw = false,
164170
};

0 commit comments

Comments
 (0)