1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/media/platform/qcom/venus/hfi_platform.c
Dikshita Agarwal 920173c7cf media: venus: Add num_vpp_pipes to resource structure
V6 HW can have vpp pipes as 1 or 4, add num_vpp_pipes
to resource struture to differentiate.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-10-08 11:26:13 +02:00

68 lines
1.3 KiB
C

// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#include "hfi_platform.h"
const struct hfi_platform *hfi_platform_get(enum hfi_version version)
{
switch (version) {
case HFI_VERSION_4XX:
return &hfi_plat_v4;
case HFI_VERSION_6XX:
return &hfi_plat_v6;
default:
break;
}
return NULL;
}
unsigned long
hfi_platform_get_codec_vpp_freq(enum hfi_version version, u32 codec, u32 session_type)
{
const struct hfi_platform *plat;
unsigned long freq = 0;
plat = hfi_platform_get(version);
if (!plat)
return 0;
if (plat->codec_vpp_freq)
freq = plat->codec_vpp_freq(session_type, codec);
return freq;
}
unsigned long
hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 codec, u32 session_type)
{
const struct hfi_platform *plat;
unsigned long freq = 0;
plat = hfi_platform_get(version);
if (!plat)
return 0;
if (plat->codec_vpp_freq)
freq = plat->codec_vsp_freq(session_type, codec);
return freq;
}
unsigned long
hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec, u32 session_type)
{
const struct hfi_platform *plat;
unsigned long freq = 0;
plat = hfi_platform_get(version);
if (!plat)
return 0;
if (plat->codec_lp_freq)
freq = plat->codec_lp_freq(session_type, codec);
return freq;
}