Commit c4f8ac09 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'nova-next-v6.16-2025-05-20' of https://gitlab.freedesktop.org/drm/nova into drm-next

Nova changes for v6.16

auxiliary:
  - bus abstractions
  - implementation for driver registration
  - add sample driver

drm:
  - implement __drm_dev_alloc()
  - DRM core infrastructure Rust abstractions
    - device, driver and registration
    - DRM IOCTL
    - DRM File
    - GEM object
  - IntoGEMObject rework
    - generically implement AlwaysRefCounted through IntoGEMObject
    - refactor unsound from_gem_obj() into as_ref()
    - refactor into_gem_obj() into as_raw()

driver-core:
  - merge topic/device-context-2025-04-17 from driver-core tree
  - implement Devres::access()
    - fix: doctest build under `!CONFIG_PCI`
  - accessor for Device::parent()
    - fix: conditionally expect `dead_code` for `parent()`
  - impl TryFrom<&Device> bus devices (PCI, platform)

nova-core:
  - remove completed Vec extentions from task list
  - register auxiliary device for nova-drm
  - derive useful traits for Chipset
  - add missing GA100 chipset
  - take &Device<Bound> in Gpu::new()
  - infrastructure to generate register definitions
  - fix register layout of NV_PMC_BOOT_0
  - move Firmware into own (Rust) module
  - fix: select AUXILIARY_BUS

nova-drm:
  - initial driver skeleton (depends on drm and auxiliary bus
    abstractions)
  - fix: select AUXILIARY_BUS

Rust (dependencies):
  - implement Opaque::zeroed()
  - implement Revocable::try_access_with()
  - implement Revocable::access()

From: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/aCxAf3RqQAXLDhAj@cassiopeiae
parents 7c1a9408 276c53c6
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -102,7 +102,13 @@ Usage:
	let boot0 = Boot0::read(&bar);
	pr_info!("Revision: {}\n", boot0.revision());

Note: a work-in-progress implementation currently resides in
`drivers/gpu/nova-core/regs/macros.rs` and is used in nova-core. It would be
nice to improve it (possibly using proc macros) and move it to the `kernel`
crate so it can be used by other components as well.

| Complexity: Advanced
| Contact: Alexandre Courbot

Delay / Sleep abstractions
--------------------------
@@ -190,16 +196,6 @@ Rust abstraction for debugfs APIs.
| Reference: Export GSP log buffers
| Complexity: Intermediate

Vec extensions
--------------

Implement ``Vec::truncate`` and ``Vec::resize``.

Currently this is used for some experimental code to parse the vBIOS.

| Reference vBIOS support
| Complexity: Beginner

GPU (general)
=============

+17 −0
Original line number Diff line number Diff line
@@ -3880,6 +3880,9 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
F:	Documentation/driver-api/auxiliary_bus.rst
F:	drivers/base/auxiliary.c
F:	include/linux/auxiliary_bus.h
F:	rust/helpers/auxiliary.c
F:	rust/kernel/auxiliary.rs
F:	samples/rust/rust_driver_auxiliary.rs
AUXILIARY DISPLAY DRIVERS
M:	Andy Shevchenko <andy@kernel.org>
@@ -7607,6 +7610,18 @@ T: git https://gitlab.freedesktop.org/drm/nova.git nova-next
F:	Documentation/gpu/nova/
F:	drivers/gpu/nova-core/
DRM DRIVER FOR NVIDIA GPUS [RUST]
M:	Danilo Krummrich <dakr@kernel.org>
L:	nouveau@lists.freedesktop.org
S:	Supported
Q:	https://patchwork.freedesktop.org/project/nouveau/
B:	https://gitlab.freedesktop.org/drm/nova/-/issues
C:	irc://irc.oftc.net/nouveau
T:	git https://gitlab.freedesktop.org/drm/nova.git nova-next
F:	Documentation/gpu/nova/
F:	drivers/gpu/drm/nova/
F:	include/uapi/drm/nova_drm.h
DRM DRIVER FOR OLIMEX LCD-OLINUXINO PANELS
M:	Stefan Mavrodiev <stefan@olimex.com>
S:	Maintained
@@ -7820,6 +7835,7 @@ F: Documentation/devicetree/bindings/display/
F:	Documentation/devicetree/bindings/gpu/
F:	Documentation/gpu/
F:	drivers/gpu/
F:	rust/kernel/drm/
F:	include/drm/
F:	include/linux/vga*
F:	include/uapi/drm/
@@ -7836,6 +7852,7 @@ F: Documentation/devicetree/bindings/gpu/
F:	Documentation/gpu/
F:	drivers/gpu/drm/
F:	drivers/gpu/vga/
F:	rust/kernel/drm/
F:	include/drm/drm
F:	include/linux/vga*
F:	include/uapi/drm/
+2 −0
Original line number Diff line number Diff line
@@ -274,6 +274,8 @@ source "drivers/gpu/drm/amd/amdgpu/Kconfig"

source "drivers/gpu/drm/nouveau/Kconfig"

source "drivers/gpu/drm/nova/Kconfig"

source "drivers/gpu/drm/i915/Kconfig"

source "drivers/gpu/drm/xe/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
obj-$(CONFIG_DRM_VGEM)	+= vgem/
obj-$(CONFIG_DRM_VKMS)	+= vkms/
obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
obj-$(CONFIG_DRM_NOVA) += nova/
obj-$(CONFIG_DRM_EXYNOS) +=exynos/
obj-$(CONFIG_DRM_ROCKCHIP) +=rockchip/
obj-$(CONFIG_DRM_GMA500) += gma500/
+42 −16
Original line number Diff line number Diff line
@@ -830,36 +830,62 @@ void *__devm_drm_dev_alloc(struct device *parent,
EXPORT_SYMBOL(__devm_drm_dev_alloc);

/**
 * drm_dev_alloc - Allocate new DRM device
 * @driver: DRM driver to allocate device for
 * __drm_dev_alloc - Allocation of a &drm_device instance
 * @parent: Parent device object
 * @driver: DRM driver
 * @size: the size of the struct which contains struct drm_device
 * @offset: the offset of the &drm_device within the container.
 *
 * This is the deprecated version of devm_drm_dev_alloc(), which does not support
 * subclassing through embedding the struct &drm_device in a driver private
 * structure, and which does not support automatic cleanup through devres.
 * This should *NOT* be by any drivers, but is a dedicated interface for the
 * corresponding Rust abstraction.
 *
 * RETURNS:
 * Pointer to new DRM device, or ERR_PTR on failure.
 * This is the same as devm_drm_dev_alloc(), but without the corresponding
 * resource management through the parent device, but not the same as
 * drm_dev_alloc(), since the latter is the deprecated version, which does not
 * support subclassing.
 *
 * Returns: A pointer to new DRM device, or an ERR_PTR on failure.
 */
struct drm_device *drm_dev_alloc(const struct drm_driver *driver,
				 struct device *parent)
void *__drm_dev_alloc(struct device *parent,
		      const struct drm_driver *driver,
		      size_t size, size_t offset)
{
	struct drm_device *dev;
	void *container;
	struct drm_device *drm;
	int ret;

	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (!dev)
	container = kzalloc(size, GFP_KERNEL);
	if (!container)
		return ERR_PTR(-ENOMEM);

	ret = drm_dev_init(dev, driver, parent);
	drm = container + offset;
	ret = drm_dev_init(drm, driver, parent);
	if (ret) {
		kfree(dev);
		kfree(container);
		return ERR_PTR(ret);
	}
	drmm_add_final_kfree(drm, container);

	drmm_add_final_kfree(dev, dev);
	return container;
}
EXPORT_SYMBOL(__drm_dev_alloc);

	return dev;
/**
 * drm_dev_alloc - Allocate new DRM device
 * @driver: DRM driver to allocate device for
 * @parent: Parent device object
 *
 * This is the deprecated version of devm_drm_dev_alloc(), which does not support
 * subclassing through embedding the struct &drm_device in a driver private
 * structure, and which does not support automatic cleanup through devres.
 *
 * RETURNS:
 * Pointer to new DRM device, or ERR_PTR on failure.
 */
struct drm_device *drm_dev_alloc(const struct drm_driver *driver,
				 struct device *parent)
{
	return __drm_dev_alloc(parent, driver, sizeof(struct drm_device), 0);
}
EXPORT_SYMBOL(drm_dev_alloc);

Loading