drm/tegra: Preparatory work for v5.19

This contains a single patch from a series that's ready to go for v5.10
 but is also a shared build-time dependency for an IOMMU series that is
 planned for v5.20. The idea is to take this into v5.19 to fulfill that
 dependency and remove the need for close coordination for the two
 series.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmKXN/sTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoXZdEAC+jn6g9btaBl8UMF1SPkTnxHdXsjs2
 Q9kD3Ipn7QN8UB0da7t1imqnT0yRbbGtn9qdh7Lq/vuF3YPu1b2UHjz9v09+4jK0
 Vcw22nADbCiP6XcK0LEzXJTEomejSy7QWADo5aOnjg3exCbA2+6NOcMm9BuzlBOb
 15bOi83L86WW2kyjUeHPVUYOCixwidgqDWjRPYwxQJr0n450dWqhbZJVzID72Ufl
 hMKGFqtWqs5Wi2yepRxRSIS8VEMUtgkMo5XAsCCGep9E/f8cUCHNjFmQ5+Q2G2rr
 ubczqaAxMamAHeOSMT3TWemUoLH19iqXgrh11JZzwKWTCIQWqdlYjON7p6oCreGo
 +bZOHh/z9CV9sBWmzdTsnZcBkGT+0oei44Q/+uC32oJ2XK9US6rlVxicwzKiLAD8
 2BwyBUbiq1hXwtcJ7a2SW54HavnVSkL76cHDrs0xAHILbYuW7TDVdwiOJvji9o7t
 kzrTQsiRJ5iBNL593UyYqZo4Q6vVC2jl9hwdlgH9kWYyEPi05JV7UujkrgbKNHLP
 A+ZppjcfQR+YgFgfRw1shSZM652dtv+RVyM9R/1IClocBURPqG8gZswnzj1gHjw0
 FHtdH6wqKWg8OgXLGUntgpmMyiG6ioaGFGNkktTgUMnGCsrrasmX26dbxPetqCdQ
 4I05RsVAFihTZA==
 =7+me
 -----END PGP SIGNATURE-----

Merge tag 'drm/tegra/for-5.19-prep-work' of https://gitlab.freedesktop.org/drm/tegra into drm-next

drm/tegra: Preparatory work for v5.19

This contains a single patch from a series that's ready to go for v5.10
but is also a shared build-time dependency for an IOMMU series that is
planned for v5.20. The idea is to take this into v5.19 to fulfill that
dependency and remove the need for close coordination for the two
series.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220601100335.3841301-1-thierry.reding@gmail.com
This commit is contained in:
Dave Airlie 2022-06-03 11:35:46 +10:00
commit 404204340c
5 changed files with 53 additions and 2 deletions

View file

@ -2,7 +2,6 @@
# drm/tegra depends on host1x, so if both drivers are built-in care must be
# taken to initialize them in the correct order. Link order is the only way
# to ensure this currently.
obj-$(CONFIG_TEGRA_HOST1X) += host1x/
obj-y += drm/ vga/
obj-y += host1x/ drm/ vga/
obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/
obj-$(CONFIG_TRACE_GPU_MEM) += trace/

View file

@ -1,8 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
config TEGRA_HOST1X_CONTEXT_BUS
bool
config TEGRA_HOST1X
tristate "NVIDIA Tegra host1x driver"
depends on ARCH_TEGRA || (ARM && COMPILE_TEST)
select DMA_SHARED_BUFFER
select TEGRA_HOST1X_CONTEXT_BUS
select IOMMU_IOVA
help
Driver for the NVIDIA Tegra host1x hardware.

View file

@ -18,3 +18,4 @@ host1x-y = \
hw/host1x07.o
obj-$(CONFIG_TEGRA_HOST1X) += host1x.o
obj-$(CONFIG_TEGRA_HOST1X_CONTEXT_BUS) += context_bus.o

View file

@ -0,0 +1,31 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021, NVIDIA Corporation.
*/
#include <linux/device.h>
#include <linux/of.h>
struct bus_type host1x_context_device_bus_type = {
.name = "host1x-context",
};
EXPORT_SYMBOL_GPL(host1x_context_device_bus_type);
static int __init host1x_context_device_bus_init(void)
{
int err;
if (!of_machine_is_compatible("nvidia,tegra186") &&
!of_machine_is_compatible("nvidia,tegra194") &&
!of_machine_is_compatible("nvidia,tegra234"))
return 0;
err = bus_register(&host1x_context_device_bus_type);
if (err < 0) {
pr_err("bus type registration failed: %d\n", err);
return err;
}
return 0;
}
postcore_initcall(host1x_context_device_bus_init);

View file

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2021, NVIDIA Corporation. All rights reserved.
*/
#ifndef __LINUX_HOST1X_CONTEXT_BUS_H
#define __LINUX_HOST1X_CONTEXT_BUS_H
#include <linux/device.h>
#ifdef CONFIG_TEGRA_HOST1X_CONTEXT_BUS
extern struct bus_type host1x_context_device_bus_type;
#endif
#endif