1

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.
 -----BEGIN PGP SIGNATURE-----
 
 iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZuKq/QAKCRAnX84Zoj2+
 djX/AX9yH6TTbCOGSJ2BF6No8RXE0kNOi/AaS0dr+WuUetXsMcjQ2g4ttbMVKh/o
 RefF0n8BgN5BWitAA+rkqRWjCPxUPGb6kjPamPp/YEFTcEv/8nvnr344ZPEV6jXe
 7dv+h319Dg==
 =Qvnm
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Dave Airlie 2024-09-13 14:47:49 +10:00
commit 690e516e98
8 changed files with 29 additions and 11 deletions

View File

@ -165,7 +165,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf)
struct vm_area_struct *vma = vmf->vma; struct vm_area_struct *vma = vmf->vma;
struct cma_heap_buffer *buffer = vma->vm_private_data; struct cma_heap_buffer *buffer = vma->vm_private_data;
if (vmf->pgoff > buffer->pagecount) if (vmf->pgoff >= buffer->pagecount)
return VM_FAULT_SIGBUS; return VM_FAULT_SIGBUS;
return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff])); return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff]));

View File

@ -1464,6 +1464,7 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
struct drm_syncobj *syncobj; struct drm_syncobj *syncobj;
struct eventfd_ctx *ev_fd_ctx; struct eventfd_ctx *ev_fd_ctx;
struct syncobj_eventfd_entry *entry; struct syncobj_eventfd_entry *entry;
int ret;
if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE)) if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))
return -EOPNOTSUPP; return -EOPNOTSUPP;
@ -1479,13 +1480,15 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
return -ENOENT; return -ENOENT;
ev_fd_ctx = eventfd_ctx_fdget(args->fd); ev_fd_ctx = eventfd_ctx_fdget(args->fd);
if (IS_ERR(ev_fd_ctx)) if (IS_ERR(ev_fd_ctx)) {
return PTR_ERR(ev_fd_ctx); ret = PTR_ERR(ev_fd_ctx);
goto err_fdget;
}
entry = kzalloc(sizeof(*entry), GFP_KERNEL); entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry) { if (!entry) {
eventfd_ctx_put(ev_fd_ctx); ret = -ENOMEM;
return -ENOMEM; goto err_kzalloc;
} }
entry->syncobj = syncobj; entry->syncobj = syncobj;
entry->ev_fd_ctx = ev_fd_ctx; entry->ev_fd_ctx = ev_fd_ctx;
@ -1496,6 +1499,12 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
drm_syncobj_put(syncobj); drm_syncobj_put(syncobj);
return 0; return 0;
err_kzalloc:
eventfd_ctx_put(ev_fd_ctx);
err_fdget:
drm_syncobj_put(syncobj);
return ret;
} }
int int

View File

@ -46,6 +46,8 @@ u32 gm107_ram_probe_fbp(const struct nvkm_ram_func *,
u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32, u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
struct nvkm_device *, int, int *); struct nvkm_device *, int, int *);
int gp100_ram_init(struct nvkm_ram *);
/* RAM type-specific MR calculation routines */ /* RAM type-specific MR calculation routines */
int nvkm_sddr2_calc(struct nvkm_ram *); int nvkm_sddr2_calc(struct nvkm_ram *);
int nvkm_sddr3_calc(struct nvkm_ram *); int nvkm_sddr3_calc(struct nvkm_ram *);

View File

@ -27,7 +27,7 @@
#include <subdev/bios/init.h> #include <subdev/bios/init.h>
#include <subdev/bios/rammap.h> #include <subdev/bios/rammap.h>
static int int
gp100_ram_init(struct nvkm_ram *ram) gp100_ram_init(struct nvkm_ram *ram)
{ {
struct nvkm_subdev *subdev = &ram->fb->subdev; struct nvkm_subdev *subdev = &ram->fb->subdev;

View File

@ -5,6 +5,7 @@
static const struct nvkm_ram_func static const struct nvkm_ram_func
gp102_ram = { gp102_ram = {
.init = gp100_ram_init,
}; };
int int

View File

@ -103,13 +103,17 @@ static int rockchip_drm_init_iommu(struct drm_device *drm_dev)
struct rockchip_drm_private *private = drm_dev->dev_private; struct rockchip_drm_private *private = drm_dev->dev_private;
struct iommu_domain_geometry *geometry; struct iommu_domain_geometry *geometry;
u64 start, end; u64 start, end;
int ret;
if (IS_ERR_OR_NULL(private->iommu_dev)) if (IS_ERR_OR_NULL(private->iommu_dev))
return 0; return 0;
private->domain = iommu_domain_alloc(private->iommu_dev->bus); private->domain = iommu_paging_domain_alloc(private->iommu_dev);
if (!private->domain) if (IS_ERR(private->domain)) {
return -ENOMEM; ret = PTR_ERR(private->domain);
private->domain = NULL;
return ret;
}
geometry = &private->domain->geometry; geometry = &private->domain->geometry;
start = geometry->aperture_start; start = geometry->aperture_start;

View File

@ -2,6 +2,7 @@
config DRM_STM config DRM_STM
tristate "DRM Support for STMicroelectronics SoC Series" tristate "DRM Support for STMicroelectronics SoC Series"
depends on DRM && (ARCH_STM32 || COMPILE_TEST) depends on DRM && (ARCH_STM32 || COMPILE_TEST)
depends on COMMON_CLK
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_PANEL_BRIDGE select DRM_PANEL_BRIDGE

View File

@ -1135,6 +1135,7 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev)
static int host1x_drm_probe(struct host1x_device *dev) static int host1x_drm_probe(struct host1x_device *dev)
{ {
struct device *dma_dev = dev->dev.parent;
struct tegra_drm *tegra; struct tegra_drm *tegra;
struct drm_device *drm; struct drm_device *drm;
int err; int err;
@ -1149,8 +1150,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
goto put; goto put;
} }
if (host1x_drm_wants_iommu(dev) && iommu_present(&platform_bus_type)) { if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) {
tegra->domain = iommu_domain_alloc(&platform_bus_type); tegra->domain = iommu_paging_domain_alloc(dma_dev);
if (!tegra->domain) { if (!tegra->domain) {
err = -ENOMEM; err = -ENOMEM;
goto free; goto free;