[PATCH v2 1/3] drm/tegra: Add NVJPG driver

Mikko Perttunen cyndis at kapsi.fi
Mon Jun 30 06:11:34 UTC 2025


On 6/11/25 9:18 PM, Diogo Ivo wrote:
> ...
> +static int nvjpg_load_falcon_firmware(struct nvjpg *nvjpg)
> +{
> +	struct host1x_client *client = &nvjpg->client.base;
> +	struct tegra_drm *tegra = nvjpg->client.drm;
> +	dma_addr_t iova;
> +	size_t size;
> +	void *virt;
> +	int err;
> +
> +	if (nvjpg->falcon.firmware.virt)
> +		return 0;
> +
> +	err = falcon_read_firmware(&nvjpg->falcon, nvjpg->config->firmware);
> +	if (err < 0)
> +		return err;
> +
> +	size = nvjpg->falcon.firmware.size;
> +
> +	if (!client->group) {
> +		virt = dma_alloc_coherent(nvjpg->dev, size, &iova, GFP_KERNEL);
> +
> +		err = dma_mapping_error(nvjpg->dev, iova);
> +		if (err < 0)
> +			return err;

This needs to check the return value of dma_alloc_coherent. Looks like 
this was fixed in vic.c by Robin 
(5566174cb10a5167d59b0793871cab7990b149b8) but the issue persisted into 
nvdec.c in parallel, so it needs to be fixed there as well. I can send 
out the fix for nvdec.c.

With that fixed,

Acked-by: Mikko Perttunen <mperttunen at nvidia.com>

Thanks!
Mikko



More information about the dri-devel mailing list