mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Add NVENC/NVJPG support on Tegra234
Add NVENC/NVJPG support on Tegra234. These work similarly to the ones on Tegra194, so no big changes. Bug 3778105 Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Change-Id: I4a4b12d5625f927c69a6dc1c6b6bade1bca7b171 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771770 (cherry picked from commit ee6576a1493dae1ddc5c8dc3b415d0987f670390) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759062 Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
2e8de96526
commit
59a24174d4
@@ -1399,6 +1399,8 @@ static const struct of_device_id host1x_drm_subdevs[] = {
|
|||||||
{ .compatible = "nvidia,tegra194-nvjpg", },
|
{ .compatible = "nvidia,tegra194-nvjpg", },
|
||||||
{ .compatible = "nvidia,tegra234-vic", },
|
{ .compatible = "nvidia,tegra234-vic", },
|
||||||
{ .compatible = "nvidia,tegra234-nvdec", },
|
{ .compatible = "nvidia,tegra234-nvdec", },
|
||||||
|
{ .compatible = "nvidia,tegra234-nvenc", },
|
||||||
|
{ .compatible = "nvidia,tegra234-nvjpg", },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -348,10 +348,20 @@ static const struct nvenc_config nvenc_t194_config = {
|
|||||||
.num_instances = 2,
|
.num_instances = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define NVIDIA_TEGRA_234_NVENC_FIRMWARE "nvidia/tegra234/nvenc.bin"
|
||||||
|
|
||||||
|
static const struct nvenc_config nvenc_t234_config = {
|
||||||
|
.firmware = NVIDIA_TEGRA_234_NVENC_FIRMWARE,
|
||||||
|
.version = 0x23,
|
||||||
|
.supports_sid = true,
|
||||||
|
.num_instances = 1,
|
||||||
|
};
|
||||||
|
|
||||||
static const struct of_device_id tegra_nvenc_of_match[] = {
|
static const struct of_device_id tegra_nvenc_of_match[] = {
|
||||||
{ .compatible = "nvidia,tegra210-nvenc", .data = &nvenc_t210_config },
|
{ .compatible = "nvidia,tegra210-nvenc", .data = &nvenc_t210_config },
|
||||||
{ .compatible = "nvidia,tegra186-nvenc", .data = &nvenc_t186_config },
|
{ .compatible = "nvidia,tegra186-nvenc", .data = &nvenc_t186_config },
|
||||||
{ .compatible = "nvidia,tegra194-nvenc", .data = &nvenc_t194_config },
|
{ .compatible = "nvidia,tegra194-nvenc", .data = &nvenc_t194_config },
|
||||||
|
{ .compatible = "nvidia,tegra234-nvenc", .data = &nvenc_t234_config },
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, tegra_nvenc_of_match);
|
MODULE_DEVICE_TABLE(of, tegra_nvenc_of_match);
|
||||||
@@ -479,3 +489,6 @@ MODULE_FIRMWARE(NVIDIA_TEGRA_186_NVENC_FIRMWARE);
|
|||||||
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
|
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
|
||||||
MODULE_FIRMWARE(NVIDIA_TEGRA_194_NVENC_FIRMWARE);
|
MODULE_FIRMWARE(NVIDIA_TEGRA_194_NVENC_FIRMWARE);
|
||||||
#endif
|
#endif
|
||||||
|
#if IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
|
||||||
|
MODULE_FIRMWARE(NVIDIA_TEGRA_234_NVENC_FIRMWARE);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ struct nvjpg_config {
|
|||||||
const char *firmware;
|
const char *firmware;
|
||||||
unsigned int version;
|
unsigned int version;
|
||||||
bool supports_sid;
|
bool supports_sid;
|
||||||
|
unsigned int num_instances;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nvjpg {
|
struct nvjpg {
|
||||||
@@ -326,6 +327,7 @@ static const struct nvjpg_config nvjpg_t210_config = {
|
|||||||
.firmware = NVIDIA_TEGRA_210_NVJPG_FIRMWARE,
|
.firmware = NVIDIA_TEGRA_210_NVJPG_FIRMWARE,
|
||||||
.version = 0x21,
|
.version = 0x21,
|
||||||
.supports_sid = false,
|
.supports_sid = false,
|
||||||
|
.num_instances = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NVIDIA_TEGRA_186_NVJPG_FIRMWARE "nvidia/tegra186/nvjpg.bin"
|
#define NVIDIA_TEGRA_186_NVJPG_FIRMWARE "nvidia/tegra186/nvjpg.bin"
|
||||||
@@ -334,6 +336,7 @@ static const struct nvjpg_config nvjpg_t186_config = {
|
|||||||
.firmware = NVIDIA_TEGRA_186_NVJPG_FIRMWARE,
|
.firmware = NVIDIA_TEGRA_186_NVJPG_FIRMWARE,
|
||||||
.version = 0x18,
|
.version = 0x18,
|
||||||
.supports_sid = true,
|
.supports_sid = true,
|
||||||
|
.num_instances = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NVIDIA_TEGRA_194_NVJPG_FIRMWARE "nvidia/tegra194/nvjpg.bin"
|
#define NVIDIA_TEGRA_194_NVJPG_FIRMWARE "nvidia/tegra194/nvjpg.bin"
|
||||||
@@ -342,12 +345,23 @@ static const struct nvjpg_config nvjpg_t194_config = {
|
|||||||
.firmware = NVIDIA_TEGRA_194_NVJPG_FIRMWARE,
|
.firmware = NVIDIA_TEGRA_194_NVJPG_FIRMWARE,
|
||||||
.version = 0x19,
|
.version = 0x19,
|
||||||
.supports_sid = true,
|
.supports_sid = true,
|
||||||
|
.num_instances = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define NVIDIA_TEGRA_234_NVJPG_FIRMWARE "nvidia/tegra234/nvjpg.bin"
|
||||||
|
|
||||||
|
static const struct nvjpg_config nvjpg_t234_config = {
|
||||||
|
.firmware = NVIDIA_TEGRA_234_NVJPG_FIRMWARE,
|
||||||
|
.version = 0x23,
|
||||||
|
.supports_sid = true,
|
||||||
|
.num_instances = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id tegra_nvjpg_of_match[] = {
|
static const struct of_device_id tegra_nvjpg_of_match[] = {
|
||||||
{ .compatible = "nvidia,tegra210-nvjpg", .data = &nvjpg_t210_config },
|
{ .compatible = "nvidia,tegra210-nvjpg", .data = &nvjpg_t210_config },
|
||||||
{ .compatible = "nvidia,tegra186-nvjpg", .data = &nvjpg_t186_config },
|
{ .compatible = "nvidia,tegra186-nvjpg", .data = &nvjpg_t186_config },
|
||||||
{ .compatible = "nvidia,tegra194-nvjpg", .data = &nvjpg_t194_config },
|
{ .compatible = "nvidia,tegra194-nvjpg", .data = &nvjpg_t194_config },
|
||||||
|
{ .compatible = "nvidia,tegra234-nvjpg", .data = &nvjpg_t234_config },
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, tegra_nvjpg_of_match);
|
MODULE_DEVICE_TABLE(of, tegra_nvjpg_of_match);
|
||||||
@@ -357,6 +371,7 @@ static int nvjpg_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct host1x_syncpt **syncpts;
|
struct host1x_syncpt **syncpts;
|
||||||
struct nvjpg *nvjpg;
|
struct nvjpg *nvjpg;
|
||||||
|
u32 host_class;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* inherit DMA mask from host1x parent */
|
/* inherit DMA mask from host1x parent */
|
||||||
@@ -392,6 +407,11 @@ static int nvjpg_probe(struct platform_device *pdev)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = of_property_read_u32(dev->of_node, "nvidia,host1x-class",
|
||||||
|
&host_class);
|
||||||
|
if (err < 0)
|
||||||
|
host_class = HOST1X_CLASS_NVJPG;
|
||||||
|
|
||||||
nvjpg->falcon.dev = dev;
|
nvjpg->falcon.dev = dev;
|
||||||
nvjpg->falcon.regs = nvjpg->regs;
|
nvjpg->falcon.regs = nvjpg->regs;
|
||||||
|
|
||||||
@@ -404,7 +424,7 @@ static int nvjpg_probe(struct platform_device *pdev)
|
|||||||
INIT_LIST_HEAD(&nvjpg->client.base.list);
|
INIT_LIST_HEAD(&nvjpg->client.base.list);
|
||||||
nvjpg->client.base.ops = &nvjpg_client_ops;
|
nvjpg->client.base.ops = &nvjpg_client_ops;
|
||||||
nvjpg->client.base.dev = dev;
|
nvjpg->client.base.dev = dev;
|
||||||
nvjpg->client.base.class = HOST1X_CLASS_NVJPG;
|
nvjpg->client.base.class = host_class;
|
||||||
nvjpg->client.base.syncpts = syncpts;
|
nvjpg->client.base.syncpts = syncpts;
|
||||||
nvjpg->client.base.num_syncpts = 1;
|
nvjpg->client.base.num_syncpts = 1;
|
||||||
nvjpg->dev = dev;
|
nvjpg->dev = dev;
|
||||||
@@ -469,3 +489,6 @@ MODULE_FIRMWARE(NVIDIA_TEGRA_186_NVJPG_FIRMWARE);
|
|||||||
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
|
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
|
||||||
MODULE_FIRMWARE(NVIDIA_TEGRA_194_NVJPG_FIRMWARE);
|
MODULE_FIRMWARE(NVIDIA_TEGRA_194_NVJPG_FIRMWARE);
|
||||||
#endif
|
#endif
|
||||||
|
#if IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
|
||||||
|
MODULE_FIRMWARE(NVIDIA_TEGRA_234_NVJPG_FIRMWARE);
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user