Commit dae437d5 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm/tegra/for-6.3-rc1' of https://gitlab.freedesktop.org/drm/tegra into drm-next



drm/tegra: Changes for v6.3-rc1

This set of changes includes a rework of the custom syncpoint interrupt
code to take better advantage of existing DRM/KMS infrastructure.

There's also various bits of cleanup and fixes included.

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

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230127170119.495943-1-thierry.reding@gmail.com
parents 54587d99 2abdd44e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7040,7 +7040,7 @@ M: Thierry Reding <thierry.reding@gmail.com>
L:	dri-devel@lists.freedesktop.org
L:	linux-tegra@vger.kernel.org
S:	Supported
T:	git git://anongit.freedesktop.org/tegra/linux.git
T:	git https://gitlab.freedesktop.org/drm/tegra.git
F:	Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml
F:	Documentation/devicetree/bindings/gpu/host1x/
F:	drivers/gpu/drm/tegra/
+2 −4
Original line number Diff line number Diff line
@@ -598,7 +598,6 @@ static int tegra_dpaux_remove(struct platform_device *pdev)
	return 0;
}

#ifdef CONFIG_PM
static int tegra_dpaux_suspend(struct device *dev)
{
	struct tegra_dpaux *dpaux = dev_get_drvdata(dev);
@@ -657,10 +656,9 @@ static int tegra_dpaux_resume(struct device *dev)
	clk_disable_unprepare(dpaux->clk);
	return err;
}
#endif

static const struct dev_pm_ops tegra_dpaux_pm_ops = {
	SET_RUNTIME_PM_OPS(tegra_dpaux_suspend, tegra_dpaux_resume, NULL)
	RUNTIME_PM_OPS(tegra_dpaux_suspend, tegra_dpaux_resume, NULL)
};

static const struct tegra_dpaux_soc tegra124_dpaux_soc = {
@@ -694,7 +692,7 @@ struct platform_driver tegra_dpaux_driver = {
	.driver = {
		.name = "tegra-dpaux",
		.of_match_table = tegra_dpaux_of_match,
		.pm = &tegra_dpaux_pm_ops,
		.pm = pm_ptr(&tegra_dpaux_pm_ops),
	},
	.probe = tegra_dpaux_probe,
	.remove = tegra_dpaux_remove,
+3 −0
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@ static int fw_check_regs_imm(struct tegra_drm_firewall *fw, u32 offset)
{
	bool is_addr;

	if (!fw->client->ops->is_addr_reg)
		return 0;

	is_addr = fw->client->ops->is_addr_reg(fw->client->base.dev, fw->class,
					       offset);
	if (is_addr)
+4 −12
Original line number Diff line number Diff line
@@ -67,26 +67,18 @@ static inline void nvdec_writel(struct nvdec *nvdec, u32 value,

static int nvdec_boot_falcon(struct nvdec *nvdec)
{
#ifdef CONFIG_IOMMU_API
	struct iommu_fwspec *spec = dev_iommu_fwspec_get(nvdec->dev);
#endif
	u32 stream_id;
	int err;

#ifdef CONFIG_IOMMU_API
	if (nvdec->config->supports_sid && spec) {
	if (nvdec->config->supports_sid && tegra_dev_iommu_get_stream_id(nvdec->dev, &stream_id)) {
		u32 value;

		value = TRANSCFG_ATT(1, TRANSCFG_SID_FALCON) | TRANSCFG_ATT(0, TRANSCFG_SID_HW);
		nvdec_writel(nvdec, value, NVDEC_TFBIF_TRANSCFG);

		if (spec->num_ids > 0) {
			value = spec->ids[0] & 0xffff;

			nvdec_writel(nvdec, value, VIC_THI_STREAMID0);
			nvdec_writel(nvdec, value, VIC_THI_STREAMID1);
		nvdec_writel(nvdec, stream_id, VIC_THI_STREAMID0);
		nvdec_writel(nvdec, stream_id, VIC_THI_STREAMID1);
	}
	}
#endif

	err = falcon_boot(&nvdec->falcon);
	if (err < 0)
+5 −14
Original line number Diff line number Diff line
@@ -609,21 +609,13 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
			host1x_memory_context_get(job->memory_context);
		}
	} else if (context->client->ops->get_streamid_offset) {
#ifdef CONFIG_IOMMU_API
		struct iommu_fwspec *spec;

		/*
		 * Job submission will need to temporarily change stream ID,
		 * so need to tell it what to change it back to.
		 */
		spec = dev_iommu_fwspec_get(context->client->base.dev);
		if (spec && spec->num_ids > 0)
			job->engine_fallback_streamid = spec->ids[0] & 0xffff;
		else
			job->engine_fallback_streamid = 0x7f;
#else
		job->engine_fallback_streamid = 0x7f;
#endif
		if (!tegra_dev_iommu_get_stream_id(context->client->base.dev,
						   &job->engine_fallback_streamid))
			job->engine_fallback_streamid = TEGRA_STREAM_ID_BYPASS;
	}

	/* Boot engine. */
@@ -654,7 +646,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
	args->syncpt.value = job->syncpt_end;

	if (syncobj) {
		struct dma_fence *fence = host1x_fence_create(job->syncpt, job->syncpt_end);
		struct dma_fence *fence = host1x_fence_create(job->syncpt, job->syncpt_end, true);
		if (IS_ERR(fence)) {
			err = PTR_ERR(fence);
			SUBMIT_ERR(context, "failed to create postfence: %d", err);
@@ -680,7 +672,6 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
		kfree(job_data->used_mappings);
	}

	if (job_data)
	kfree(job_data);
put_bo:
	gather_bo_put(&bo->base);
Loading