media: renesas: vsp1: Add VSP1_HAS_NON_ZERO_LBA feature bit

As per HW manual V3M and RZ/G2L SoCs has nonzero LIF buffer
attributes. So, introduce a feature bit for handling the same.

This patch also adds separate device info structure for V3M and V3H
SoCs, as both these SoCs share the same model ID, but V3H does not
have VSP1_HAS_NON_ZERO_LBA feature bit.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Biju Das 2022-08-28 10:13:33 +02:00 committed by Mauro Carvalho Chehab
parent 9c63902745
commit 4d728fd4c6
3 changed files with 19 additions and 3 deletions

View File

@ -55,6 +55,7 @@ struct vsp1_uif;
#define VSP1_HAS_HGT BIT(8)
#define VSP1_HAS_BRS BIT(9)
#define VSP1_HAS_EXT_DL BIT(10)
#define VSP1_HAS_NON_ZERO_LBA BIT(11)
struct vsp1_device_info {
u32 version;

View File

@ -788,6 +788,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
}, {
.version = VI6_IP_VERSION_MODEL_VSPD_V3,
.model = "VSP2-D",
.soc = VI6_IP_VERSION_SOC_V3H,
.gen = 3,
.features = VSP1_HAS_BRS | VSP1_HAS_BRU,
.lif_count = 1,
@ -795,6 +796,17 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
.uif_count = 1,
.wpf_count = 1,
.num_bru_inputs = 5,
}, {
.version = VI6_IP_VERSION_MODEL_VSPD_V3,
.model = "VSP2-D",
.soc = VI6_IP_VERSION_SOC_V3M,
.gen = 3,
.features = VSP1_HAS_BRS | VSP1_HAS_BRU | VSP1_HAS_NON_ZERO_LBA,
.lif_count = 1,
.rpf_count = 5,
.uif_count = 1,
.wpf_count = 1,
.num_bru_inputs = 5,
}, {
.version = VI6_IP_VERSION_MODEL_VSPDL_GEN3,
.model = "VSP2-DL",
@ -822,6 +834,8 @@ static const struct vsp1_device_info *vsp1_lookup_info(struct vsp1_device *vsp1)
{
const struct vsp1_device_info *info;
unsigned int i;
u32 model;
u32 soc;
/*
* Try the info stored in match data first for devices that don't have
@ -834,11 +848,13 @@ static const struct vsp1_device_info *vsp1_lookup_info(struct vsp1_device *vsp1)
}
vsp1->version = vsp1_read(vsp1, VI6_IP_VERSION);
model = vsp1->version & VI6_IP_VERSION_MODEL_MASK;
soc = vsp1->version & VI6_IP_VERSION_SOC_MASK;
for (i = 0; i < ARRAY_SIZE(vsp1_device_infos); ++i) {
info = &vsp1_device_infos[i];
if ((vsp1->version & VI6_IP_VERSION_MODEL_MASK) == info->version)
if (model == info->version && (!info->soc || soc == info->soc))
return info;
}

View File

@ -135,8 +135,7 @@ static void lif_configure_stream(struct vsp1_entity *entity,
* may appear on the output). The value required by the manual is not
* explained but is likely a buffer size or threshold.
*/
if ((entity->vsp1->version & VI6_IP_VERSION_MASK) ==
(VI6_IP_VERSION_MODEL_VSPD_V3 | VI6_IP_VERSION_SOC_V3M))
if (vsp1_feature(entity->vsp1, VSP1_HAS_NON_ZERO_LBA))
vsp1_lif_write(lif, dlb, VI6_LIF_LBA,
VI6_LIF_LBA_LBA0 |
(1536 << VI6_LIF_LBA_LBA1_SHIFT));