drm/tegra: Enable job timestamping for NVJPG

NVJPG firmware now supports timestamping, so enable use of it.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I5a21f51e29ac19a95d36bb435dc884a440095ac2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3070327
Reviewed-by: Satvik Raj Gupta <satvikrajg@nvidia.com>
Tested-by: Satvik Raj Gupta <satvikrajg@nvidia.com>
This commit is contained in:
Mikko Perttunen
2024-02-05 11:35:50 +02:00
committed by Satvik Raj Gupta
parent 01ab1b46c3
commit 6025535763
2 changed files with 13 additions and 11 deletions

View File

@@ -43,6 +43,7 @@ struct nvjpg_config {
unsigned int version;
bool supports_sid;
unsigned int num_instances;
bool supports_timestamping;
};
struct nvjpg {
@@ -554,12 +555,22 @@ static int nvjpg_can_use_memory_ctx(struct tegra_drm_client *client, bool *suppo
return 0;
}
static int nvjpg_has_job_timestamping(struct tegra_drm_client *client, bool *supported)
{
struct nvjpg *nvjpg = to_nvjpg(client);
*supported = nvjpg->config->supports_timestamping;
return 0;
}
static const struct tegra_drm_client_ops nvjpg_ops = {
.open_channel = nvjpg_open_channel,
.close_channel = nvjpg_close_channel,
.submit = tegra_drm_submit,
.get_streamid_offset = tegra_drm_get_streamid_offset_thi,
.can_use_memory_ctx = nvjpg_can_use_memory_ctx,
.has_job_timestamping = nvjpg_has_job_timestamping,
};
#define NVIDIA_TEGRA_210_NVJPG_FIRMWARE "nvidia/tegra210/nvjpg.bin"
@@ -596,6 +607,7 @@ static const struct nvjpg_config nvjpg_t234_config = {
.version = 0x23,
.supports_sid = true,
.num_instances = 2,
.supports_timestamping = true,
};
static const struct of_device_id tegra_nvjpg_of_match[] = {

View File

@@ -122,17 +122,7 @@ static int virt_engine_can_use_memory_ctx(struct tegra_drm_client *client, bool
static int virt_engine_has_job_timestamping(struct tegra_drm_client *client, bool *supported)
{
struct virt_engine *virt = to_virt_engine(client);
switch (virt->client.base.class) {
case HOST1X_CLASS_NVJPG:
case HOST1X_CLASS_NVJPG1:
*supported = false;
break;
default:
*supported = true;
break;
}
*supported = true;
return 0;
}