Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 894dde5c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: vsp1: wpf: Add flipping support



Vertical flipping is available on both Gen2 and Gen3, while horizontal
flipping is only available on Gen3.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d05a3310
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ struct vsp1_uds;
#define VSP1_HAS_SRU		(1 << 2)
#define VSP1_HAS_BRU		(1 << 3)
#define VSP1_HAS_CLU		(1 << 4)
#define VSP1_HAS_WPF_VFLIP	(1 << 5)
#define VSP1_HAS_WPF_HFLIP	(1 << 6)

struct vsp1_device_info {
	u32 version;
+9 −7
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
		.version = VI6_IP_VERSION_MODEL_VSPS_H2,
		.gen = 2,
		.features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
			  | VSP1_HAS_SRU,
			  | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.uds_count = 3,
		.wpf_count = 4,
@@ -572,7 +572,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
	}, {
		.version = VI6_IP_VERSION_MODEL_VSPR_H2,
		.gen = 2,
		.features = VSP1_HAS_BRU | VSP1_HAS_SRU,
		.features = VSP1_HAS_BRU | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.uds_count = 3,
		.wpf_count = 4,
@@ -591,7 +591,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
		.version = VI6_IP_VERSION_MODEL_VSPS_M2,
		.gen = 2,
		.features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
			  | VSP1_HAS_SRU,
			  | VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.uds_count = 1,
		.wpf_count = 4,
@@ -600,7 +600,8 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
	}, {
		.version = VI6_IP_VERSION_MODEL_VSPI_GEN3,
		.gen = 3,
		.features = VSP1_HAS_CLU | VSP1_HAS_LUT | VSP1_HAS_SRU,
		.features = VSP1_HAS_CLU | VSP1_HAS_LUT | VSP1_HAS_SRU
			  | VSP1_HAS_WPF_HFLIP | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 1,
		.uds_count = 1,
		.wpf_count = 1,
@@ -608,7 +609,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
	}, {
		.version = VI6_IP_VERSION_MODEL_VSPBD_GEN3,
		.gen = 3,
		.features = VSP1_HAS_BRU,
		.features = VSP1_HAS_BRU | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.wpf_count = 1,
		.num_bru_inputs = 5,
@@ -616,7 +617,8 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
	}, {
		.version = VI6_IP_VERSION_MODEL_VSPBC_GEN3,
		.gen = 3,
		.features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT,
		.features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT
			  | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.wpf_count = 1,
		.num_bru_inputs = 5,
@@ -624,7 +626,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
	}, {
		.version = VI6_IP_VERSION_MODEL_VSPD_GEN3,
		.gen = 3,
		.features = VSP1_HAS_BRU | VSP1_HAS_LIF,
		.features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_WPF_VFLIP,
		.rpf_count = 5,
		.wpf_count = 2,
		.num_bru_inputs = 5,
+7 −0
Original line number Diff line number Diff line
@@ -255,6 +255,8 @@
#define VI6_WPF_OUTFMT_PDV_MASK		(0xff << 24)
#define VI6_WPF_OUTFMT_PDV_SHIFT	24
#define VI6_WPF_OUTFMT_PXA		(1 << 23)
#define VI6_WPF_OUTFMT_ROT		(1 << 18)
#define VI6_WPF_OUTFMT_HFLP		(1 << 17)
#define VI6_WPF_OUTFMT_FLP		(1 << 16)
#define VI6_WPF_OUTFMT_SPYCS		(1 << 15)
#define VI6_WPF_OUTFMT_SPUVS		(1 << 14)
@@ -289,6 +291,11 @@
#define VI6_WPF_RNDCTRL_CLMD_EXT	(2 << 12)
#define VI6_WPF_RNDCTRL_CLMD_MASK	(3 << 12)

#define VI6_WPF_ROT_CTRL		0x1018
#define VI6_WPF_ROT_CTRL_LN16		(1 << 17)
#define VI6_WPF_ROT_CTRL_LMEM_WD_MASK	(0x1fff << 0)
#define VI6_WPF_ROT_CTRL_LMEM_WD_SHIFT	0

#define VI6_WPF_DSTM_STRIDE_Y		0x101c
#define VI6_WPF_DSTM_STRIDE_C		0x1020
#define VI6_WPF_DSTM_ADDR_Y		0x1024
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index)
		return ERR_PTR(ret);

	/* Initialize the control handler. */
	ret = vsp1_rwpf_init_ctrls(rpf);
	ret = vsp1_rwpf_init_ctrls(rpf, 0);
	if (ret < 0) {
		dev_err(vsp1->dev, "rpf%u: failed to initialize controls\n",
			index);
+2 −2
Original line number Diff line number Diff line
@@ -241,9 +241,9 @@ static const struct v4l2_ctrl_ops vsp1_rwpf_ctrl_ops = {
	.s_ctrl = vsp1_rwpf_s_ctrl,
};

int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf)
int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols)
{
	v4l2_ctrl_handler_init(&rwpf->ctrls, 1);
	v4l2_ctrl_handler_init(&rwpf->ctrls, ncontrols + 1);
	v4l2_ctrl_new_std(&rwpf->ctrls, &vsp1_rwpf_ctrl_ops,
			  V4L2_CID_ALPHA_COMPONENT, 0, 255, 1, 255);

Loading