mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
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. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZdeI8QAKCRDj7w1vZxhR xTMdAP9YVgpb8RlifVyi0H5jRtlsIKNpKECQpz1o6KsNIqp3WAEA1rMU8Rbbn7oj goeoviKt1anQ+vlonWRYeo1Z3SctKwU= =gJLo -----END PGP SIGNATURE----- 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 <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/gl2antuifidtzn3dfm426p7xwh5fxj23behagwh26owfnosh2w@gqoa7vj5prnh
This commit is contained in:
commit
f581dbb34c
@ -60,7 +60,7 @@ libs-y += arch/sparc/prom/
|
||||
libs-y += arch/sparc/lib/
|
||||
|
||||
drivers-$(CONFIG_PM) += arch/sparc/power/
|
||||
drivers-$(CONFIG_FB) += arch/sparc/video/
|
||||
drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
|
||||
|
||||
boot := arch/sparc/boot
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
obj-$(CONFIG_FB) += fbdev.o
|
||||
obj-$(CONFIG_FB_CORE) += fbdev.o
|
||||
|
@ -24,7 +24,7 @@
|
||||
#define SKU_HW_ID_SHIFT 16u
|
||||
#define SKU_HW_ID_MASK 0xffff0000u
|
||||
|
||||
#define PLL_CONFIG_DEFAULT 0x1
|
||||
#define PLL_CONFIG_DEFAULT 0x0
|
||||
#define PLL_CDYN_DEFAULT 0x80
|
||||
#define PLL_EPP_DEFAULT 0x80
|
||||
#define PLL_REF_CLK_FREQ (50 * 1000000)
|
||||
|
@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
|
||||
list_add(&block->left->tmp_link, dfs);
|
||||
} while (1);
|
||||
|
||||
list_splice_tail(&allocated, blocks);
|
||||
|
||||
if (total_allocated < size) {
|
||||
err = -ENOSPC;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
list_splice_tail(&allocated, blocks);
|
||||
|
||||
return 0;
|
||||
|
||||
err_undo:
|
||||
|
@ -1040,7 +1040,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
|
||||
uint64_t *points;
|
||||
uint32_t signaled_count, i;
|
||||
|
||||
if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT)
|
||||
if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
|
||||
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE))
|
||||
lockdep_assert_none_held_once();
|
||||
|
||||
points = kmalloc_array(count, sizeof(*points), GFP_KERNEL);
|
||||
@ -1109,7 +1110,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
|
||||
* fallthough and try a 0 timeout wait!
|
||||
*/
|
||||
|
||||
if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) {
|
||||
if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
|
||||
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE)) {
|
||||
for (i = 0; i < count; ++i)
|
||||
drm_syncobj_fence_add_wait(syncobjs[i], &entries[i]);
|
||||
}
|
||||
@ -1416,10 +1418,21 @@ syncobj_eventfd_entry_func(struct drm_syncobj *syncobj,
|
||||
|
||||
/* This happens inside the syncobj lock */
|
||||
fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, 1));
|
||||
if (!fence)
|
||||
return;
|
||||
|
||||
ret = dma_fence_chain_find_seqno(&fence, entry->point);
|
||||
if (ret != 0 || !fence) {
|
||||
if (ret != 0) {
|
||||
/* The given seqno has not been submitted yet. */
|
||||
dma_fence_put(fence);
|
||||
return;
|
||||
} else if (!fence) {
|
||||
/* If dma_fence_chain_find_seqno returns 0 but sets the fence
|
||||
* to NULL, it implies that the given seqno is signaled and a
|
||||
* later seqno has already been submitted. Assign a stub fence
|
||||
* so that the eventfd still gets signaled below.
|
||||
*/
|
||||
fence = dma_fence_get_stub();
|
||||
}
|
||||
|
||||
list_del_init(&entry->node);
|
||||
|
@ -294,6 +294,5 @@ void meson_encoder_cvbs_remove(struct meson_drm *priv)
|
||||
if (priv->encoders[MESON_ENC_CVBS]) {
|
||||
meson_encoder_cvbs = priv->encoders[MESON_ENC_CVBS];
|
||||
drm_bridge_remove(&meson_encoder_cvbs->bridge);
|
||||
drm_bridge_remove(meson_encoder_cvbs->next_bridge);
|
||||
}
|
||||
}
|
||||
|
@ -168,6 +168,5 @@ void meson_encoder_dsi_remove(struct meson_drm *priv)
|
||||
if (priv->encoders[MESON_ENC_DSI]) {
|
||||
meson_encoder_dsi = priv->encoders[MESON_ENC_DSI];
|
||||
drm_bridge_remove(&meson_encoder_dsi->bridge);
|
||||
drm_bridge_remove(meson_encoder_dsi->next_bridge);
|
||||
}
|
||||
}
|
||||
|
@ -474,6 +474,5 @@ void meson_encoder_hdmi_remove(struct meson_drm *priv)
|
||||
if (priv->encoders[MESON_ENC_HDMI]) {
|
||||
meson_encoder_hdmi = priv->encoders[MESON_ENC_HDMI];
|
||||
drm_bridge_remove(&meson_encoder_hdmi->bridge);
|
||||
drm_bridge_remove(meson_encoder_hdmi->next_bridge);
|
||||
}
|
||||
}
|
||||
|
@ -168,12 +168,11 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device,
|
||||
rm->flush = r535_bar_flush;
|
||||
|
||||
ret = gf100_bar_new_(rm, device, type, inst, &bar);
|
||||
*pbar = bar;
|
||||
if (ret) {
|
||||
if (!bar)
|
||||
kfree(rm);
|
||||
kfree(rm);
|
||||
return ret;
|
||||
}
|
||||
*pbar = bar;
|
||||
|
||||
bar->flushBAR2PhysMode = ioremap(device->func->resource_addr(device, 3), PAGE_SIZE);
|
||||
if (!bar->flushBAR2PhysMode)
|
||||
|
@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
|
||||
return (void *)fw;
|
||||
}
|
||||
|
||||
static void
|
||||
shadow_fw_release(void *fw)
|
||||
{
|
||||
release_firmware(fw);
|
||||
}
|
||||
|
||||
static const struct nvbios_source
|
||||
shadow_fw = {
|
||||
.name = "firmware",
|
||||
.init = shadow_fw_init,
|
||||
.fini = (void(*)(void *))release_firmware,
|
||||
.fini = shadow_fw_release,
|
||||
.read = shadow_fw_read,
|
||||
.rw = false,
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
|
||||
|
||||
static void drm_test_buddy_alloc_contiguous(struct kunit *test)
|
||||
{
|
||||
u64 mm_size, ps = SZ_4K, i, n_pages, total;
|
||||
u32 mm_size, ps = SZ_4K, i, n_pages, total;
|
||||
struct drm_buddy_block *block;
|
||||
struct drm_buddy mm;
|
||||
LIST_HEAD(left);
|
||||
@ -56,30 +56,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
|
||||
KUNIT_ASSERT_FALSE_MSG(test,
|
||||
drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
ps, ps, list, 0),
|
||||
"buddy_alloc hit an error size=%d\n",
|
||||
"buddy_alloc hit an error size=%u\n",
|
||||
ps);
|
||||
} while (++i < n_pages);
|
||||
|
||||
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
3 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc didn't error size=%d\n", 3 * ps);
|
||||
"buddy_alloc didn't error size=%u\n", 3 * ps);
|
||||
|
||||
drm_buddy_free_list(&mm, &middle);
|
||||
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
3 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc didn't error size=%llu\n", 3 * ps);
|
||||
"buddy_alloc didn't error size=%u\n", 3 * ps);
|
||||
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
2 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc didn't error size=%llu\n", 2 * ps);
|
||||
"buddy_alloc didn't error size=%u\n", 2 * ps);
|
||||
|
||||
drm_buddy_free_list(&mm, &right);
|
||||
KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
3 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc didn't error size=%llu\n", 3 * ps);
|
||||
"buddy_alloc didn't error size=%u\n", 3 * ps);
|
||||
/*
|
||||
* At this point we should have enough contiguous space for 2 blocks,
|
||||
* however they are never buddies (since we freed middle and right) so
|
||||
@ -88,13 +88,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
|
||||
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
2 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc hit an error size=%d\n", 2 * ps);
|
||||
"buddy_alloc hit an error size=%u\n", 2 * ps);
|
||||
|
||||
drm_buddy_free_list(&mm, &left);
|
||||
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
|
||||
3 * ps, ps, &allocated,
|
||||
DRM_BUDDY_CONTIGUOUS_ALLOCATION),
|
||||
"buddy_alloc hit an error size=%d\n", 3 * ps);
|
||||
"buddy_alloc hit an error size=%u\n", 3 * ps);
|
||||
|
||||
total = 0;
|
||||
list_for_each_entry(block, &allocated, link)
|
||||
|
@ -387,7 +387,7 @@ static void ttm_pool_free_range(struct ttm_pool *pool, struct ttm_tt *tt,
|
||||
enum ttm_caching caching,
|
||||
pgoff_t start_page, pgoff_t end_page)
|
||||
{
|
||||
struct page **pages = tt->pages;
|
||||
struct page **pages = &tt->pages[start_page];
|
||||
unsigned int order;
|
||||
pgoff_t i, nr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user