lkml.org 
[lkml]   [2018]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] media: venus: add support for selection rectangles
Date
Handles target type crop by setting the new active rectangle
to hardware. The new rectangle should be within YUV size.

Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
---
drivers/media/platform/qcom/venus/venc.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 3f50cd0..754c19a 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -478,16 +478,31 @@ static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
{
struct venus_inst *inst = to_inst(file);
+ int ret;
+ u32 buftype;

if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
return -EINVAL;

switch (s->target) {
case V4L2_SEL_TGT_CROP:
- if (s->r.width != inst->out_width ||
- s->r.height != inst->out_height ||
+ if (s->r.width > inst->out_width ||
+ s->r.height > inst->out_height ||
s->r.top != 0 || s->r.left != 0)
return -EINVAL;
+ if (s->r.width != inst->width ||
+ s->r.height != inst->height) {
+ buftype = HFI_BUFFER_OUTPUT;
+ ret = venus_helper_set_output_resolution(inst,
+ s->r.width,
+ s->r.height,
+ buftype);
+ if (ret)
+ return ret;
+
+ inst->width = s->r.width;
+ inst->height = s->r.height;
+ }
break;
default:
return -EINVAL;
--
1.9.1
\
 
 \ /
  Last update: 2018-10-09 10:00    [W:0.896 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site