On Tue, Jun 10, 2025 at 12:26:07PM +0900, Mikko Perttunen wrote:
On 6/6/25 7:45 PM, Diogo Ivo wrote:
Add support for booting and using NVJPG on Tegra210 to the Host1x
and TegraDRM drivers. This driver only supports the new TegraDRM uAPI.
Hello Diogo -- I'm happy to see this driver!
So am I, nice work!
[...]
+ if (IS_ERR(nvjpg->regs))
+ return PTR_ERR(nvjpg->regs);
+
+ nvjpg->rst = devm_reset_control_get_exclusive_released(&pdev->dev, "nvjpg");
+ if (IS_ERR(nvjpg->rst)) {
+ err = PTR_ERR(nvjpg->rst);
+
+ if (err != -EBUSY || WARN_ON(!pdev->dev.pm_domain)) {
+ dev_err(&pdev->dev, "failed to get reset control: %d\n",
+ err);
+ return err;
+ }
+
+ /*
+ * At this point, the reset control is most likely being used
+ * by the generic power domain implementation. With any luck
+ * the power domain will have taken care of resetting the SOR
+ * and we don't have to do anything.
+ */
+ nvjpg->rst = NULL;
+ }
I see you've taken this from sor.c, but I think it should be unnecessary. I
imagine the code in sor.c is overcomplicated as well, maybe because we used
not to have the power domain implementation.
Agreed. SOR is also slightly older than NVJPG and used on Tegra124 where
we don't use power domains, so most of these quirks are for backwards-
compatibility. If we can avoid them for NVJPG, that'd be great.