Commit 6e85c1ec authored by Simona Vetter's avatar Simona Vetter
Browse files

Merge tag 'drm-misc-next-2025-07-10' of...

Merge tag 'drm-misc-next-2025-07-10' of https://gitlab.freedesktop.org/drm/misc/kernel

 into drm-next

drm-misc-next for 6.17:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:

Driver Changes:
- amdgpu: debugfs improvements
- ast: Improve hardware generations implementation
- dma-buf heaps:
  - Give the CMA heap a stable name
- panthor: fix UAF in debugfs
- rockchip: Convert inno_hdmi to a bridge
- sti: Convert to devm_drm_bridge_alloc()
- vkms: Use faux_device

- bridge:
  - Improve CEC handling code, convertions to devm_drm_bridge_alloc()

Signed-off-by: default avatarSimona Vetter <simona.vetter@ffwll.ch>
From: Maxime Ripard <mripard@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250710-observant-elite-dingo-acfd6d@houat
parents 203dcde8 fe69a391
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -19,7 +19,10 @@ following heaps:
 - The ``cma`` heap allocates physically contiguous, cacheable,
   buffers. Only present if a CMA region is present. Such a region is
   usually created either through the kernel commandline through the
   `cma` parameter, a memory region Device-Tree node with the
   `linux,cma-default` property set, or through the `CMA_SIZE_MBYTES` or
   `CMA_SIZE_PERCENTAGE` Kconfig options. Depending on the platform, it
   might be called ``reserved``, ``linux,cma``, or ``default-pool``.
   ``cma`` parameter, a memory region Device-Tree node with the
   ``linux,cma-default`` property set, or through the ``CMA_SIZE_MBYTES`` or
   ``CMA_SIZE_PERCENTAGE`` Kconfig options. The heap's name in devtmpfs is
   ``default_cma_region``. For backwards compatibility, when the
   ``DMABUF_HEAPS_CMA_LEGACY`` Kconfig option is set, a duplicate node is
   created following legacy naming conventions; the legacy name might be
   ``reserved``, ``linux,cma``, or ``default-pool``.
+0 −2
Original line number Diff line number Diff line
@@ -209,8 +209,6 @@ source "drivers/thunderbolt/Kconfig"

source "drivers/android/Kconfig"

source "drivers/gpu/trace/Kconfig"

source "drivers/nvdimm/Kconfig"

source "drivers/dax/Kconfig"
+0 −16
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@

DEFINE_XARRAY_ALLOC(accel_minors_xa);

static struct dentry *accel_debugfs_root;

static const struct device_type accel_sysfs_device_minor = {
	.name = "accel_minor"
};
@@ -73,17 +71,6 @@ static const struct drm_info_list accel_debugfs_list[] = {
};
#define ACCEL_DEBUGFS_ENTRIES ARRAY_SIZE(accel_debugfs_list)

/**
 * accel_debugfs_init() - Initialize debugfs for device
 * @dev: Pointer to the device instance.
 *
 * This function creates a root directory for the device in debugfs.
 */
void accel_debugfs_init(struct drm_device *dev)
{
	drm_debugfs_dev_init(dev, accel_debugfs_root);
}

/**
 * accel_debugfs_register() - Register debugfs for device
 * @dev: Pointer to the device instance.
@@ -194,7 +181,6 @@ static const struct file_operations accel_stub_fops = {
void accel_core_exit(void)
{
	unregister_chrdev(ACCEL_MAJOR, "accel");
	debugfs_remove(accel_debugfs_root);
	accel_sysfs_destroy();
	WARN_ON(!xa_empty(&accel_minors_xa));
}
@@ -209,8 +195,6 @@ int __init accel_core_init(void)
		goto error;
	}

	accel_debugfs_root = debugfs_create_dir("accel", NULL);

	ret = register_chrdev(ACCEL_MAJOR, "accel", &accel_stub_fops);
	if (ret < 0)
		DRM_ERROR("Cannot register ACCEL major: %d\n", ret);
+10 −0
Original line number Diff line number Diff line
@@ -12,3 +12,13 @@ config DMABUF_HEAPS_CMA
	  Choose this option to enable dma-buf CMA heap. This heap is backed
	  by the Contiguous Memory Allocator (CMA). If your system has these
	  regions, you should say Y here.

config DMABUF_HEAPS_CMA_LEGACY
	bool "Legacy DMA-BUF CMA Heap"
	default y
	depends on DMABUF_HEAPS_CMA
	help
	  Add a duplicate CMA-backed dma-buf heap with legacy naming derived
	  from the CMA area's devicetree node, or "reserved" if the area is not
	  defined in the devicetree. This uses the same underlying allocator as
	  CONFIG_DMABUF_HEAPS_CMA.
+29 −7
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@
 * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
 *	Andrew F. Davis <afd@ti.com>
 */

#define pr_fmt(fmt) "cma_heap: " fmt

#include <linux/cma.h>
#include <linux/dma-buf.h>
#include <linux/dma-heap.h>
@@ -22,6 +25,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>

#define DEFAULT_CMA_NAME "default_cma_region"

struct cma_heap {
	struct dma_heap *heap;
@@ -366,17 +370,17 @@ static const struct dma_heap_ops cma_heap_ops = {
	.allocate = cma_heap_allocate,
};

static int __init __add_cma_heap(struct cma *cma, void *data)
static int __init __add_cma_heap(struct cma *cma, const char *name)
{
	struct cma_heap *cma_heap;
	struct dma_heap_export_info exp_info;
	struct cma_heap *cma_heap;

	cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL);
	if (!cma_heap)
		return -ENOMEM;
	cma_heap->cma = cma;

	exp_info.name = cma_get_name(cma);
	exp_info.name = name;
	exp_info.ops = &cma_heap_ops;
	exp_info.priv = cma_heap;

@@ -394,12 +398,30 @@ static int __init __add_cma_heap(struct cma *cma, void *data)
static int __init add_default_cma_heap(void)
{
	struct cma *default_cma = dev_get_cma_area(NULL);
	int ret = 0;
	const char *legacy_cma_name;
	int ret;

	if (default_cma)
		ret = __add_cma_heap(default_cma, NULL);
	if (!default_cma)
		return 0;

	ret = __add_cma_heap(default_cma, DEFAULT_CMA_NAME);
	if (ret)
		return ret;

	if (IS_ENABLED(CONFIG_DMABUF_HEAPS_CMA_LEGACY)) {
		legacy_cma_name = cma_get_name(default_cma);
		if (!strcmp(legacy_cma_name, DEFAULT_CMA_NAME)) {
			pr_warn("legacy name and default name are the same, skipping legacy heap\n");
			return 0;
		}

		ret = __add_cma_heap(default_cma, legacy_cma_name);
		if (ret)
			pr_warn("failed to add legacy heap: %pe\n",
				ERR_PTR(ret));
	}

	return 0;
}
module_init(add_default_cma_heap);
MODULE_DESCRIPTION("DMA-BUF CMA Heap");
Loading