media: venus: helpers: add buffer type argument to a helper
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Thu, 5 Jul 2018 13:03:51 +0000 (09:03 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 25 Jul 2018 12:52:34 +0000 (08:52 -0400)
This adds one more function argument to pass buffer type to
set_output_resolution() helper function. That is a preparation
to support secondary decoder output.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/qcom/venus/helpers.c
drivers/media/platform/qcom/venus/helpers.h
drivers/media/platform/qcom/venus/venc.c

index 6fd7458..7e764ee 100644 (file)
@@ -458,12 +458,13 @@ int venus_helper_set_input_resolution(struct venus_inst *inst,
 EXPORT_SYMBOL_GPL(venus_helper_set_input_resolution);
 
 int venus_helper_set_output_resolution(struct venus_inst *inst,
-                                      unsigned int width, unsigned int height)
+                                      unsigned int width, unsigned int height,
+                                      u32 buftype)
 {
        u32 ptype = HFI_PROPERTY_PARAM_FRAME_SIZE;
        struct hfi_framesize fs;
 
-       fs.buffer_type = HFI_BUFFER_OUTPUT;
+       fs.buffer_type = buftype;
        fs.width = width;
        fs.height = height;
 
index cd306bd..0de9989 100644 (file)
@@ -36,7 +36,8 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
 int venus_helper_set_input_resolution(struct venus_inst *inst,
                                      unsigned int width, unsigned int height);
 int venus_helper_set_output_resolution(struct venus_inst *inst,
-                                      unsigned int width, unsigned int height);
+                                      unsigned int width, unsigned int height,
+                                      u32 buftype);
 int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
                              unsigned int output_bufs);
 int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt);
index 4edca7e..75527db 100644 (file)
@@ -793,7 +793,8 @@ static int venc_init_session(struct venus_inst *inst)
                goto deinit;
 
        ret = venus_helper_set_output_resolution(inst, inst->width,
-                                                inst->height);
+                                                inst->height,
+                                                HFI_BUFFER_OUTPUT);
        if (ret)
                goto deinit;