Commit c0ab2901 authored by Vikash Garodia's avatar Vikash Garodia Committed by Mauro Carvalho Chehab

media: venus: hfi_platform: Correct supported codecs for sc7280

VP8 codec is deprecated for sc7280 SOC. Fix in platform layer to
update the supported codecs accordingly.
Signed-off-by: default avatarVikash Garodia <quic_vgarodia@quicinc.com>
Acked-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: Fritz Koenig<frkoenig@chromium.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 748b080f
......@@ -234,6 +234,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
const struct hfi_plat_caps *caps = NULL;
u32 enc_codecs, dec_codecs, count = 0;
unsigned int entries;
int ret;
plat = hfi_platform_get(core->res->hfi_version);
if (!plat)
......@@ -242,8 +243,9 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
if (inst)
return 0;
if (plat->codecs)
plat->codecs(&enc_codecs, &dec_codecs, &count);
ret = hfi_platform_get_codecs(core, &enc_codecs, &dec_codecs, &count);
if (ret)
return ret;
if (plat->capabilities)
caps = plat->capabilities(&entries);
......
......@@ -2,7 +2,9 @@
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#include <linux/of_device.h>
#include "hfi_platform.h"
#include "core.h"
const struct hfi_platform *hfi_platform_get(enum hfi_version version)
{
......@@ -66,3 +68,23 @@ hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec, u32 session_
return freq;
}
int
hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs, u32 *count)
{
const struct hfi_platform *plat;
plat = hfi_platform_get(core->res->hfi_version);
if (!plat)
return -EINVAL;
if (plat->codecs)
plat->codecs(enc_codecs, dec_codecs, count);
if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) {
*enc_codecs &= ~HFI_VIDEO_CODEC_VP8;
*dec_codecs &= ~HFI_VIDEO_CODEC_VP8;
}
return 0;
}
......@@ -66,4 +66,6 @@ unsigned long hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 code
u32 session_type);
unsigned long hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec,
u32 session_type);
int hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs,
u32 *count);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment