From fab823d82ee50c7953bd67d152e35e0bddaeee86 Mon Sep 17 00:00:00 2001 From: Vamsee Vardhan Thummala Date: Tue, 8 Jul 2025 21:18:08 +0900 Subject: gpu: host1x: Allow loading tegra-drm without enabled engines Add support to register host1x devices without requiring subdevices. This ensures syncpoint functionality remains available even when engine subdevices are not present. Add softdep for tegra-drm to make userspace interface available without module autoloading through device tree entries. Signed-off-by: Vamsee Vardhan Thummala [mperttunen@nvidia.com: some rewording] Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20250708-host1x-allow-no-subdevs-v1-1-93c66c251f03@nvidia.com --- drivers/gpu/host1x/dev.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/host1x/dev.c') diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 1f93e5e276c0..e1a9246d35f4 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -821,6 +821,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"); -- cgit v1.2.3 From b4505b6ad9444c8c517240c74f8b9cbbba94a86b Mon Sep 17 00:00:00 2001 From: Akhilesh Patil Date: Fri, 22 Aug 2025 11:44:04 +0530 Subject: gpu: host1x: Use dev_err_probe() in probe path Use dev_err_probe() helper as recommended by core driver model in drivers/base/core.c to handle deferred probe error. Improve code consistency and debuggability using standard helper. Signed-off-by: Akhilesh Patil Tested-by: Mikko Perttunen Acked-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/aKgKrCxUvP9Sw0YI@bhairav-test.ee.iitb.ac.in --- drivers/gpu/host1x/dev.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/host1x/dev.c') diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index e1a9246d35f4..e365df6af353 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -585,14 +585,8 @@ static int host1x_probe(struct platform_device *pdev) } host->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(host->clk)) { - err = PTR_ERR(host->clk); - - if (err != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to get clock: %d\n", err); - - return err; - } + if (IS_ERR(host->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(host->clk), "failed to get clock\n"); err = host1x_get_resets(host); if (err) -- cgit v1.2.3 From bfe68975768a983d4e59c7fb465301999b863a7e Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Wed, 17 Sep 2025 10:48:30 +0900 Subject: gpu: host1x: Syncpoint interrupt performance optimization Optimize performance of syncpoint interrupt handling by reading the status register in 64-bit chunks when possible, and skipping processing when the read value is zero. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patch.msgid.link/20250917-host1x-syncpt-irq-perf-v2-1-736ef69b1347@nvidia.com --- drivers/gpu/host1x/dev.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/gpu/host1x/dev.c') diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index e365df6af353..3f475f0e6545 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -71,6 +71,15 @@ u32 host1x_sync_readl(struct host1x *host1x, u32 r) return readl(sync_regs + r); } +#ifdef CONFIG_64BIT +u64 host1x_sync_readq(struct host1x *host1x, u32 r) +{ + void __iomem *sync_regs = host1x->regs + host1x->info->sync_offset; + + return readq(sync_regs + r); +} +#endif + void host1x_ch_writel(struct host1x_channel *ch, u32 v, u32 r) { writel(v, ch->regs + r); -- cgit v1.2.3