From 05fdb35d8ec39b475478f766f47570bd3e1f6d04 Mon Sep 17 00:00:00 2001 From: Vamsee Vardhan Thummala Date: Thu, 20 Feb 2025 09:43:22 +0000 Subject: [PATCH] gpu: host1x: Allow loading tegra-drm without enabled engines Add support to load tegra-drm without any engine enabled under host1x node. Add support to register host1x devices without requiring subdevices. This ensures syncpoint functionality remains available even when engine subdevices are not present. Bug 5055946 Change-Id: I18076391e37e01926b621bb8f3e19f72f62d2533 Signed-off-by: Vamsee Vardhan Thummala Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306748 GVS: buildbot_gerritrpt Tested-by: mobile promotions Reviewed-by: mobile promotions Reviewed-by: Mikko Perttunen Reviewed-by: Santosh BS --- drivers/gpu/host1x/bus.c | 14 +++++++++++++- drivers/gpu/host1x/dev.c | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index f416bd6b..3cca29b1 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Avionic Design GmbH - * Copyright (C) 2012-2024, NVIDIA Corporation + * Copyright (C) 2012-2025, NVIDIA Corporation */ #include @@ -503,6 +503,18 @@ static int host1x_device_add(struct host1x *host1x, mutex_unlock(&clients_lock); + /* + * Add device even if there are no subdevs to ensure syncpoint functionality + * is available regardless of whether any engine subdevices are present + */ + if (list_empty(&device->subdevs)) { + err = device_add(&device->dev); + if (err < 0) + dev_err(&device->dev, "failed to add device: %d\n", err); + else + device->registered = true; + } + return 0; } diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index ea7504e1..b53c6a85 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -1420,6 +1420,7 @@ u64 host1x_get_dma_mask(struct host1x *host1x) } EXPORT_SYMBOL(host1x_get_dma_mask); +MODULE_SOFTDEP("post: tegra-drm"); MODULE_AUTHOR("Thierry Reding "); MODULE_AUTHOR("Terje Bergstrom "); MODULE_DESCRIPTION("Host1x driver for Tegra products");