Skip to content

Commit 690e516

Browse files
committed
Merge tag 'drm-misc-fixes-2024-09-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
An off-by-one fix for the CMA DMA-buf heap, An init fix for nouveau, a config dependency fix for stm, a syncobj leak fix, and two iommu fixes for tegra and rockchip. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240912-phenomenal-upbeat-grouse-a26781@houat
2 parents bb7e19b + 45c690a commit 690e516

File tree

8 files changed

+29
-11
lines changed

8 files changed

+29
-11
lines changed

drivers/dma-buf/heaps/cma_heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf)
165165
struct vm_area_struct *vma = vmf->vma;
166166
struct cma_heap_buffer *buffer = vma->vm_private_data;
167167

168-
if (vmf->pgoff > buffer->pagecount)
168+
if (vmf->pgoff >= buffer->pagecount)
169169
return VM_FAULT_SIGBUS;
170170

171171
return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff]));

drivers/gpu/drm/drm_syncobj.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
14641464
struct drm_syncobj *syncobj;
14651465
struct eventfd_ctx *ev_fd_ctx;
14661466
struct syncobj_eventfd_entry *entry;
1467+
int ret;
14671468

14681469
if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))
14691470
return -EOPNOTSUPP;
@@ -1479,13 +1480,15 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
14791480
return -ENOENT;
14801481

14811482
ev_fd_ctx = eventfd_ctx_fdget(args->fd);
1482-
if (IS_ERR(ev_fd_ctx))
1483-
return PTR_ERR(ev_fd_ctx);
1483+
if (IS_ERR(ev_fd_ctx)) {
1484+
ret = PTR_ERR(ev_fd_ctx);
1485+
goto err_fdget;
1486+
}
14841487

14851488
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
14861489
if (!entry) {
1487-
eventfd_ctx_put(ev_fd_ctx);
1488-
return -ENOMEM;
1490+
ret = -ENOMEM;
1491+
goto err_kzalloc;
14891492
}
14901493
entry->syncobj = syncobj;
14911494
entry->ev_fd_ctx = ev_fd_ctx;
@@ -1496,6 +1499,12 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
14961499
drm_syncobj_put(syncobj);
14971500

14981501
return 0;
1502+
1503+
err_kzalloc:
1504+
eventfd_ctx_put(ev_fd_ctx);
1505+
err_fdget:
1506+
drm_syncobj_put(syncobj);
1507+
return ret;
14991508
}
15001509

15011510
int

drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ u32 gm107_ram_probe_fbp(const struct nvkm_ram_func *,
4646
u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
4747
struct nvkm_device *, int, int *);
4848

49+
int gp100_ram_init(struct nvkm_ram *);
50+
4951
/* RAM type-specific MR calculation routines */
5052
int nvkm_sddr2_calc(struct nvkm_ram *);
5153
int nvkm_sddr3_calc(struct nvkm_ram *);

drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <subdev/bios/init.h>
2828
#include <subdev/bios/rammap.h>
2929

30-
static int
30+
int
3131
gp100_ram_init(struct nvkm_ram *ram)
3232
{
3333
struct nvkm_subdev *subdev = &ram->fb->subdev;

drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
static const struct nvkm_ram_func
77
gp102_ram = {
8+
.init = gp100_ram_init,
89
};
910

1011
int

drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,17 @@ static int rockchip_drm_init_iommu(struct drm_device *drm_dev)
103103
struct rockchip_drm_private *private = drm_dev->dev_private;
104104
struct iommu_domain_geometry *geometry;
105105
u64 start, end;
106+
int ret;
106107

107108
if (IS_ERR_OR_NULL(private->iommu_dev))
108109
return 0;
109110

110-
private->domain = iommu_domain_alloc(private->iommu_dev->bus);
111-
if (!private->domain)
112-
return -ENOMEM;
111+
private->domain = iommu_paging_domain_alloc(private->iommu_dev);
112+
if (IS_ERR(private->domain)) {
113+
ret = PTR_ERR(private->domain);
114+
private->domain = NULL;
115+
return ret;
116+
}
113117

114118
geometry = &private->domain->geometry;
115119
start = geometry->aperture_start;

drivers/gpu/drm/stm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config DRM_STM
33
tristate "DRM Support for STMicroelectronics SoC Series"
44
depends on DRM && (ARCH_STM32 || COMPILE_TEST)
5+
depends on COMMON_CLK
56
select DRM_KMS_HELPER
67
select DRM_GEM_DMA_HELPER
78
select DRM_PANEL_BRIDGE

drivers/gpu/drm/tegra/drm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev)
11351135

11361136
static int host1x_drm_probe(struct host1x_device *dev)
11371137
{
1138+
struct device *dma_dev = dev->dev.parent;
11381139
struct tegra_drm *tegra;
11391140
struct drm_device *drm;
11401141
int err;
@@ -1149,8 +1150,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
11491150
goto put;
11501151
}
11511152

1152-
if (host1x_drm_wants_iommu(dev) && iommu_present(&platform_bus_type)) {
1153-
tegra->domain = iommu_domain_alloc(&platform_bus_type);
1153+
if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) {
1154+
tegra->domain = iommu_paging_domain_alloc(dma_dev);
11541155
if (!tegra->domain) {
11551156
err = -ENOMEM;
11561157
goto free;

0 commit comments

Comments
 (0)