* [PATCH/RFC] v4l: vsp1: Change pixel count at scale-up setting
@ 2015-06-14 17:29 Yoshihiro Kaneko
2015-06-18 20:01 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro Kaneko @ 2015-06-14 17:29 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Laurent Pinchart, Damian Hobson-Garcia,
Simon Horman, Magnus Damm, linux-sh
From: Atsushi Akatsuka <atsushi.akatsuka.vb@hitachi.com>
This commit sets AMD bit of VI6_UDSn_CTRL register,
and modifies scaling formula to fit AMD bit.
Signed-off-by: Atsushi Akatsuka <atsushi.akatsuka.vb@hitachi.com>
Signed-off-by: Hiroki Negishi <hiroki.negishi.zr@hitachi-solutions.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---
This patch is based on the master branch of linuxtv.org/media_tree.git.
drivers/media/platform/vsp1/vsp1_uds.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
index ccc8243..e7a046d 100644
--- a/drivers/media/platform/vsp1/vsp1_uds.c
+++ b/drivers/media/platform/vsp1/vsp1_uds.c
@@ -64,10 +64,10 @@ static unsigned int uds_output_size(unsigned int input, unsigned int ratio)
mp = ratio / 4096;
mp = mp < 4 ? 1 : (mp < 8 ? 2 : 4);
- return (input - 1) / mp * mp * 4096 / ratio + 1;
+ return input / mp * mp * 4096 / ratio;
} else {
/* Up-scaling */
- return (input - 1) * 4096 / ratio + 1;
+ return input * 4096 / ratio;
}
}
@@ -145,7 +145,8 @@ static int uds_s_stream(struct v4l2_subdev *subdev, int enable)
vsp1_uds_write(uds, VI6_UDS_CTRL,
(uds->scale_alpha ? VI6_UDS_CTRL_AON : 0) |
- (multitap ? VI6_UDS_CTRL_BC : 0));
+ (multitap ? VI6_UDS_CTRL_BC : 0) |
+ VI6_UDS_CTRL_AMD);
vsp1_uds_write(uds, VI6_UDS_PASS_BWIDTH,
(uds_passband_width(hscale)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH/RFC] v4l: vsp1: Change pixel count at scale-up setting
2015-06-14 17:29 [PATCH/RFC] v4l: vsp1: Change pixel count at scale-up setting Yoshihiro Kaneko
@ 2015-06-18 20:01 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2015-06-18 20:01 UTC (permalink / raw)
To: Yoshihiro Kaneko
Cc: linux-media, Mauro Carvalho Chehab, Laurent Pinchart,
Damian Hobson-Garcia, Simon Horman, Magnus Damm, linux-sh
Hi Kaneko-san,
Thank you for the patch.
On Monday 15 June 2015 02:29:14 Yoshihiro Kaneko wrote:
> From: Atsushi Akatsuka <atsushi.akatsuka.vb@hitachi.com>
>
> This commit sets AMD bit of VI6_UDSn_CTRL register,
> and modifies scaling formula to fit AMD bit.
What's the rationale for that ? What are the side effects of setting the AMD
bit ? Will it change anything beside the scaling factor computation formula ?
> Signed-off-by: Atsushi Akatsuka <atsushi.akatsuka.vb@hitachi.com>
> Signed-off-by: Hiroki Negishi <hiroki.negishi.zr@hitachi-solutions.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on the master branch of linuxtv.org/media_tree.git.
>
> drivers/media/platform/vsp1/vsp1_uds.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_uds.c
> b/drivers/media/platform/vsp1/vsp1_uds.c index ccc8243..e7a046d 100644
> --- a/drivers/media/platform/vsp1/vsp1_uds.c
> +++ b/drivers/media/platform/vsp1/vsp1_uds.c
> @@ -64,10 +64,10 @@ static unsigned int uds_output_size(unsigned int input,
> unsigned int ratio) mp = ratio / 4096;
> mp = mp < 4 ? 1 : (mp < 8 ? 2 : 4);
>
> - return (input - 1) / mp * mp * 4096 / ratio + 1;
> + return input / mp * mp * 4096 / ratio;
According to the datasheet I have access to the AMD bit only influences the
scale-up case.
> } else {
> /* Up-scaling */
> - return (input - 1) * 4096 / ratio + 1;
> + return input * 4096 / ratio;
> }
> }
>
> @@ -145,7 +145,8 @@ static int uds_s_stream(struct v4l2_subdev *subdev, int
> enable)
>
> vsp1_uds_write(uds, VI6_UDS_CTRL,
> (uds->scale_alpha ? VI6_UDS_CTRL_AON : 0) |
> - (multitap ? VI6_UDS_CTRL_BC : 0));
> + (multitap ? VI6_UDS_CTRL_BC : 0) |
> + VI6_UDS_CTRL_AMD);
>
> vsp1_uds_write(uds, VI6_UDS_PASS_BWIDTH,
> (uds_passband_width(hscale)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-18 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-14 17:29 [PATCH/RFC] v4l: vsp1: Change pixel count at scale-up setting Yoshihiro Kaneko
2015-06-18 20:01 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).