Skip to content

Commit af215c9

Browse files
committed
Merge tag 'drm-fixes-2024-12-20' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Probably the last pull before Christmas holidays, I'll still be around for most of the time anyways, nothing too major in here, bunch of amdgpu and i915 along with a smattering of fixes across the board. core: - fix FB dependency - avoid div by 0 more in vrefresh - maintainers update display: - fix DP tunnel error path dma-buf: - fix !DEBUG_FS sched: - docs warning fix panel: - collection of misc panel fixes i915: - Reset engine utilization buffer before registration - Ensure busyness counter increases motonically - Accumulate active runtime on gt reset amdgpu: - Disable BOCO when CONFIG_HOTPLUG_PCI_PCIE is not enabled - scheduler job fixes - IP version check fixes - devcoredump fix - GPUVM update fix - NBIO 2.5 fix udmabuf: - fix memory leak on last export - sealing fixes ivpu: - fix NULL pointer - fix memory leak - fix WARN" * tag 'drm-fixes-2024-12-20' of https://gitlab.freedesktop.org/drm/kernel: (33 commits) drm/sched: Fix drm_sched_fini() docu generation accel/ivpu: Fix WARN in ivpu_ipc_send_receive_internal() accel/ivpu: Fix memory leak in ivpu_mmu_reserved_context_init() accel/ivpu: Fix general protection fault in ivpu_bo_list() drm/amdgpu/nbio7.0: fix IP version check drm/amd: Update strapping for NBIO 2.5.0 drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update drm/amdgpu: fix amdgpu_coredump drm/amdgpu/smu14.0.2: fix IP version check drm/amdgpu/gfx12: fix IP version check drm/amdgpu/mmhub4.1: fix IP version check drm/amdgpu/nbio7.11: fix IP version check drm/amdgpu/nbio7.7: fix IP version check drm/amdgpu: don't access invalid sched drm/amd: Require CONFIG_HOTPLUG_PCI_PCIE for BOCO drm: rework FB_CORE dependency drm/fbdev: Select FB_CORE dependency for fbdev on DMA and TTM fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE i915/guc: Accumulate active runtime on gt reset i915/guc: Ensure busyness counter increases motonically ...
2 parents 5b83bcd + e639fb0 commit af215c9

33 files changed

+151
-61
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7347,7 +7347,7 @@ F: drivers/gpu/drm/panel/panel-novatek-nt36672a.c
73477347
DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS
73487348
M: Karol Herbst <[email protected]>
73497349
M: Lyude Paul <[email protected]>
7350-
M: Danilo Krummrich <dakr@redhat.com>
7350+
M: Danilo Krummrich <dakr@kernel.org>
73517351
73527352
73537353
S: Supported
@@ -8924,7 +8924,7 @@ F: include/linux/arm_ffa.h
89248924
FIRMWARE LOADER (request_firmware)
89258925
M: Luis Chamberlain <[email protected]>
89268926
M: Russ Weight <[email protected]>
8927-
M: Danilo Krummrich <dakr@redhat.com>
8927+
M: Danilo Krummrich <dakr@kernel.org>
89288928
89298929
S: Maintained
89308930
F: Documentation/firmware_class/

arch/powerpc/configs/pmac32_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ CONFIG_FB_ATY=y
208208
CONFIG_FB_ATY_CT=y
209209
CONFIG_FB_ATY_GX=y
210210
CONFIG_FB_3DFX=y
211+
CONFIG_BACKLIGHT_CLASS_DEVICE=y
211212
# CONFIG_VGA_CONSOLE is not set
212213
CONFIG_FRAMEBUFFER_CONSOLE=y
213214
CONFIG_LOGO=y

arch/powerpc/configs/ppc6xx_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ CONFIG_FB_TRIDENT=m
716716
CONFIG_FB_SM501=m
717717
CONFIG_FB_IBM_GXT4500=y
718718
CONFIG_LCD_PLATFORM=m
719+
CONFIG_BACKLIGHT_CLASS_DEVICE=y
719720
CONFIG_FRAMEBUFFER_CONSOLE=y
720721
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
721722
CONFIG_LOGO=y

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p)
409409
mutex_lock(&bo->lock);
410410

411411
drm_printf(p, "%-9p %-3u 0x%-12llx %-10lu 0x%-8x %-4u",
412-
bo, bo->ctx->id, bo->vpu_addr, bo->base.base.size,
412+
bo, bo->ctx ? bo->ctx->id : 0, bo->vpu_addr, bo->base.base.size,
413413
bo->flags, kref_read(&bo->base.base.refcount));
414414

415415
if (bo->base.pages)

drivers/accel/ivpu/ivpu_mmu_context.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,18 +612,22 @@ int ivpu_mmu_reserved_context_init(struct ivpu_device *vdev)
612612
if (!ivpu_mmu_ensure_pgd(vdev, &vdev->rctx.pgtable)) {
613613
ivpu_err(vdev, "Failed to allocate root page table for reserved context\n");
614614
ret = -ENOMEM;
615-
goto unlock;
615+
goto err_ctx_fini;
616616
}
617617

618618
ret = ivpu_mmu_cd_set(vdev, vdev->rctx.id, &vdev->rctx.pgtable);
619619
if (ret) {
620620
ivpu_err(vdev, "Failed to set context descriptor for reserved context\n");
621-
goto unlock;
621+
goto err_ctx_fini;
622622
}
623623

624-
unlock:
625624
mutex_unlock(&vdev->rctx.lock);
626625
return ret;
626+
627+
err_ctx_fini:
628+
mutex_unlock(&vdev->rctx.lock);
629+
ivpu_mmu_context_fini(vdev, &vdev->rctx);
630+
return ret;
627631
}
628632

629633
void ivpu_mmu_reserved_context_fini(struct ivpu_device *vdev)

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ void ivpu_pm_init(struct ivpu_device *vdev)
378378

379379
pm_runtime_use_autosuspend(dev);
380380
pm_runtime_set_autosuspend_delay(dev, delay);
381+
pm_runtime_set_active(dev);
381382

382383
ivpu_dbg(vdev, PM, "Autosuspend delay = %d\n", delay);
383384
}
@@ -392,7 +393,6 @@ void ivpu_pm_enable(struct ivpu_device *vdev)
392393
{
393394
struct device *dev = vdev->drm.dev;
394395

395-
pm_runtime_set_active(dev);
396396
pm_runtime_allow(dev);
397397
pm_runtime_mark_last_busy(dev);
398398
pm_runtime_put_autosuspend(dev);

drivers/auxdisplay/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ config IMG_ASCII_LCD
489489

490490
config HT16K33
491491
tristate "Holtek Ht16K33 LED controller with keyscan"
492-
depends on FB && I2C && INPUT
492+
depends on FB && I2C && INPUT && BACKLIGHT_CLASS_DEVICE
493493
select FB_SYSMEM_HELPERS
494494
select INPUT_MATRIXKMAP
495495
select FB_BACKLIGHT

drivers/dma-buf/dma-buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void __dma_buf_debugfs_list_add(struct dma_buf *dmabuf)
6060
{
6161
}
6262

63-
static void __dma_buf_debugfs_list_del(struct file *file)
63+
static void __dma_buf_debugfs_list_del(struct dma_buf *dmabuf)
6464
{
6565
}
6666
#endif

drivers/dma-buf/udmabuf.c

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static const struct dma_buf_ops udmabuf_ops = {
297297
};
298298

299299
#define SEALS_WANTED (F_SEAL_SHRINK)
300-
#define SEALS_DENIED (F_SEAL_WRITE)
300+
#define SEALS_DENIED (F_SEAL_WRITE|F_SEAL_FUTURE_WRITE)
301301

302302
static int check_memfd_seals(struct file *memfd)
303303
{
@@ -317,24 +317,18 @@ static int check_memfd_seals(struct file *memfd)
317317
return 0;
318318
}
319319

320-
static int export_udmabuf(struct udmabuf *ubuf,
321-
struct miscdevice *device,
322-
u32 flags)
320+
static struct dma_buf *export_udmabuf(struct udmabuf *ubuf,
321+
struct miscdevice *device)
323322
{
324323
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
325-
struct dma_buf *buf;
326324

327325
ubuf->device = device;
328326
exp_info.ops = &udmabuf_ops;
329327
exp_info.size = ubuf->pagecount << PAGE_SHIFT;
330328
exp_info.priv = ubuf;
331329
exp_info.flags = O_RDWR;
332330

333-
buf = dma_buf_export(&exp_info);
334-
if (IS_ERR(buf))
335-
return PTR_ERR(buf);
336-
337-
return dma_buf_fd(buf, flags);
331+
return dma_buf_export(&exp_info);
338332
}
339333

340334
static long udmabuf_pin_folios(struct udmabuf *ubuf, struct file *memfd,
@@ -391,6 +385,7 @@ static long udmabuf_create(struct miscdevice *device,
391385
struct folio **folios = NULL;
392386
pgoff_t pgcnt = 0, pglimit;
393387
struct udmabuf *ubuf;
388+
struct dma_buf *dmabuf;
394389
long ret = -EINVAL;
395390
u32 i, flags;
396391

@@ -436,23 +431,39 @@ static long udmabuf_create(struct miscdevice *device,
436431
goto err;
437432
}
438433

434+
/*
435+
* Take the inode lock to protect against concurrent
436+
* memfd_add_seals(), which takes this lock in write mode.
437+
*/
438+
inode_lock_shared(file_inode(memfd));
439439
ret = check_memfd_seals(memfd);
440-
if (ret < 0) {
441-
fput(memfd);
442-
goto err;
443-
}
440+
if (ret)
441+
goto out_unlock;
444442

445443
ret = udmabuf_pin_folios(ubuf, memfd, list[i].offset,
446444
list[i].size, folios);
445+
out_unlock:
446+
inode_unlock_shared(file_inode(memfd));
447447
fput(memfd);
448448
if (ret)
449449
goto err;
450450
}
451451

452452
flags = head->flags & UDMABUF_FLAGS_CLOEXEC ? O_CLOEXEC : 0;
453-
ret = export_udmabuf(ubuf, device, flags);
454-
if (ret < 0)
453+
dmabuf = export_udmabuf(ubuf, device);
454+
if (IS_ERR(dmabuf)) {
455+
ret = PTR_ERR(dmabuf);
455456
goto err;
457+
}
458+
/*
459+
* Ownership of ubuf is held by the dmabuf from here.
460+
* If the following dma_buf_fd() fails, dma_buf_put() cleans up both the
461+
* dmabuf and the ubuf (through udmabuf_ops.release).
462+
*/
463+
464+
ret = dma_buf_fd(dmabuf, flags);
465+
if (ret < 0)
466+
dma_buf_put(dmabuf);
456467

457468
kvfree(folios);
458469
return ret;

drivers/gpu/drm/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ config DRM_KUNIT_TEST
9999
config DRM_KMS_HELPER
100100
tristate
101101
depends on DRM
102+
select FB_CORE if DRM_FBDEV_EMULATION
102103
help
103104
CRTC helpers for KMS drivers.
104105

@@ -358,20 +359,23 @@ config DRM_TTM_HELPER
358359
tristate
359360
depends on DRM
360361
select DRM_TTM
362+
select FB_CORE if DRM_FBDEV_EMULATION
361363
select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
362364
help
363365
Helpers for ttm-based gem objects
364366

365367
config DRM_GEM_DMA_HELPER
366368
tristate
367369
depends on DRM
370+
select FB_CORE if DRM_FBDEV_EMULATION
368371
select FB_DMAMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
369372
help
370373
Choose this if you need the GEM DMA helper functions
371374

372375
config DRM_GEM_SHMEM_HELPER
373376
tristate
374377
depends on DRM && MMU
378+
select FB_CORE if DRM_FBDEV_EMULATION
375379
select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
376380
help
377381
Choose this if you need the GEM shmem helper functions

0 commit comments

Comments
 (0)