From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Alexandre Courbot <acourbot@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org,
Tomasz Figa <tfiga@chromium.org>
Subject: Re: [PATCH v4 02/27] venus: hfi: preparation to support venus 4xx
Date: Mon, 2 Jul 2018 15:35:46 +0300 [thread overview]
Message-ID: <22e415b0-fe3c-0584-e5ee-f0de94937234@linaro.org> (raw)
In-Reply-To: <CAPBb6MVST50MfDbs_GydCBDAA_fsVTYVVU9iCGiaCnMxPBRBPg@mail.gmail.com>
Hi Alex,
Thanks for the comments!
On 07/02/2018 11:45 AM, Alexandre Courbot wrote:
> On Thu, Jun 28, 2018 at 12:35 AM Stanimir Varbanov
> <stanimir.varbanov@linaro.org> wrote:
>>
>> This covers the differences between 1xx,3xx and 4xx.
>>
>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
>> ---
>> drivers/media/platform/qcom/venus/core.h | 4 ++
>> drivers/media/platform/qcom/venus/helpers.c | 37 +++++++----
>> drivers/media/platform/qcom/venus/hfi_helper.h | 84 ++++++++++++++++++++++--
>> drivers/media/platform/qcom/venus/hfi_venus_io.h | 7 ++
>> drivers/media/platform/qcom/venus/vdec.c | 5 +-
>> drivers/media/platform/qcom/venus/venc.c | 5 +-
>> 6 files changed, 120 insertions(+), 22 deletions(-)
>>
<snip>
>>
>> static int intbufs_alloc(struct venus_inst *inst)
>> {
>> - unsigned int i;
>> + size_t arr_sz;
>> + size_t i;
>> int ret;
>>
>> - for (i = 0; i < ARRAY_SIZE(intbuf_types); i++) {
>> - ret = intbufs_set_buffer(inst, intbuf_types[i]);
>> + if (IS_V4(inst->core))
>> + arr_sz = ARRAY_SIZE(intbuf_types_4xx);
>> + else
>> + arr_sz = ARRAY_SIZE(intbuf_types_1xx);
>> +
>> + for (i = 0; i < arr_sz; i++) {
>> + ret = intbufs_set_buffer(inst,
>> + IS_V4(inst->core) ? intbuf_types_4xx[i] :
>> + intbuf_types_1xx[i]);
>
> I suspect you could simplify this a bit by doing something like:
>
> const unsigned int *intbuf;
>
> if (IS_V4(inst->core)) {
> arr_sz = ARRAY_SIZE(intbuf_types_4xx);
> intbuf = intbuf_types_4xx;
> } else {
> arr_sz = ARRAY_SIZE(intbuf_types_1xx);
> intbuf = intbuf_types_1xx;
> }
>
> for (i = 0; i < arr_sz; i++) {
> ret = intbufs_set_buffer(inst, intbuf[i]);
> if (ret)
> goto error;
> }
yes, it looks better.
>
>> if (ret)
>> goto error;
>> }
>> @@ -257,12 +273,11 @@ static int load_scale_clocks(struct venus_core *core)
>>
>> set_freq:
>>
>> - if (core->res->hfi_version == HFI_VERSION_3XX) {
>> - ret = clk_set_rate(clk, freq);
>> + ret = clk_set_rate(clk, freq);
>> +
>> + if (IS_V3(core) || IS_V4(core)) {
>> ret |= clk_set_rate(core->core0_clk, freq);
>> ret |= clk_set_rate(core->core1_clk, freq);
>> - } else {
>> - ret = clk_set_rate(clk, freq);
>> }
>>
>> if (ret) {
>> diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
>> index 55d8eb21403a..1bc5aab1ce6b 100644
>> --- a/drivers/media/platform/qcom/venus/hfi_helper.h
>> +++ b/drivers/media/platform/qcom/venus/hfi_helper.h
>> @@ -121,6 +121,7 @@
>> #define HFI_EXTRADATA_METADATA_FILLER 0x7fe00002
>>
>> #define HFI_INDEX_EXTRADATA_INPUT_CROP 0x0700000e
>> +#define HFI_INDEX_EXTRADATA_OUTPUT_CROP 0x0700000f
>> #define HFI_INDEX_EXTRADATA_DIGITAL_ZOOM 0x07000010
>> #define HFI_INDEX_EXTRADATA_ASPECT_RATIO 0x7f100003
>>
>> @@ -376,13 +377,18 @@
>> #define HFI_BUFFER_OUTPUT2 0x3
>> #define HFI_BUFFER_INTERNAL_PERSIST 0x4
>> #define HFI_BUFFER_INTERNAL_PERSIST_1 0x5
>> -#define HFI_BUFFER_INTERNAL_SCRATCH 0x1000001
>> -#define HFI_BUFFER_EXTRADATA_INPUT 0x1000002
>> -#define HFI_BUFFER_EXTRADATA_OUTPUT 0x1000003
>> -#define HFI_BUFFER_EXTRADATA_OUTPUT2 0x1000004
>> -#define HFI_BUFFER_INTERNAL_SCRATCH_1 0x1000005
>> -#define HFI_BUFFER_INTERNAL_SCRATCH_2 0x1000006
>> -
>> +#define HFI_BUFFER_INTERNAL_SCRATCH(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0x6 : 0x1000001)
>> +#define HFI_BUFFER_INTERNAL_SCRATCH_1(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0x7 : 0x1000005)
>> +#define HFI_BUFFER_INTERNAL_SCRATCH_2(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0x8 : 0x1000006)
>> +#define HFI_BUFFER_EXTRADATA_INPUT(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002)
>> +#define HFI_BUFFER_EXTRADATA_OUTPUT(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0xa : 0x1000003)
>> +#define HFI_BUFFER_EXTRADATA_OUTPUT2(ver) \
>> + (((ver) == HFI_VERSION_4XX) ? 0xb : 0x1000004)
>> #define HFI_BUFFER_TYPE_MAX 11
>>
>> #define HFI_BUFFER_MODE_STATIC 0x1000001
>> @@ -424,12 +430,14 @@
>> #define HFI_PROPERTY_PARAM_CODEC_MASK_SUPPORTED 0x100e
>> #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT 0x100f
>> #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED 0x1010
>> +#define HFI_PROPERTY_PARAM_WORK_MODE 0x1015
>>
>> /*
>> * HFI_PROPERTY_CONFIG_COMMON_START
>> * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x2000
>> */
>> #define HFI_PROPERTY_CONFIG_FRAME_RATE 0x2001
>> +#define HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE 0x2002
>>
>> /*
>> * HFI_PROPERTY_PARAM_VDEC_COMMON_START
>> @@ -438,6 +446,9 @@
>> #define HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM 0x1003001
>> #define HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR 0x1003002
>> #define HFI_PROPERTY_PARAM_VDEC_NONCP_OUTPUT2 0x1003003
>> +#define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH 0x1003007
>> +#define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT 0x1003009
>> +#define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE 0x100300a
>>
>> /*
>> * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
>> @@ -518,6 +529,7 @@
>> enum hfi_version {
>> HFI_VERSION_1XX,
>> HFI_VERSION_3XX,
>> + HFI_VERSION_4XX
>> };
>>
>> struct hfi_buffer_info {
>> @@ -767,12 +779,56 @@ struct hfi_framesize {
>> u32 height;
>> };
>>
>> +#define VIDC_CORE_ID_DEFAULT 0
>> +#define VIDC_CORE_ID_1 1
>> +#define VIDC_CORE_ID_2 2
>> +#define VIDC_CORE_ID_3 3
>> +
>> +struct hfi_videocores_usage_type {
>> + u32 video_core_enable_mask;
>> +};
>> +
>> +#define VIDC_WORK_MODE_1 1
>> +#define VIDC_WORK_MODE_2 2
>> +
>> +struct hfi_video_work_mode {
>> + u32 video_work_mode;
>> +};
>> +
>> struct hfi_h264_vui_timing_info {
>> u32 enable;
>> u32 fixed_framerate;
>> u32 time_scale;
>> };
>>
>> +struct hfi_bit_depth {
>> + u32 buffer_type;
>> + u32 bit_depth;
>> +};
>> +
>> +struct hfi_picture_type {
>> + u32 is_sync_frame;
>> + u32 picture_type;
>> +};
>> +
>> +struct hfi_pic_struct {
>> + u32 progressive_only;
>> +};
>> +
>> +struct hfi_colour_space {
>> + u32 colour_space;
>> +};
>> +
>> +struct hfi_extradata_input_crop {
>> + u32 size;
>> + u32 version;
>> + u32 port_index;
>> + u32 left;
>> + u32 top;
>> + u32 width;
>> + u32 height;
>> +};
>
> These structures are being used in the next patch - wouldn't it make
> more sense to move their declaration there as well?
Ok. I'll move in next patch.
--
regards,
Stan
next prev parent reply other threads:[~2018-07-02 12:35 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 15:26 [PATCH v4 00/27] Venus updates Stanimir Varbanov
2018-06-27 15:26 ` [PATCH v4 01/27] venus: hfi_msgs: correct pointer increment Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 02/27] venus: hfi: preparation to support venus 4xx Stanimir Varbanov
2018-07-02 8:45 ` Alexandre Courbot
2018-07-02 12:35 ` Stanimir Varbanov [this message]
2018-06-27 15:27 ` [PATCH v4 03/27] venus: hfi: update sequence event to handle more properties Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 04/27] venus: hfi_cmds: add set_properties for 4xx version Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 05/27] venus: hfi: support session continue " Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 06/27] venus: hfi: handle buffer output2 type as well Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 07/27] venus: hfi_venus: add halt AXI support for Venus 4xx Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 08/27] venus: hfi_venus: fix suspend function for venus 3xx versions Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 09/27] venus: hfi_venus: move set of default properties to core init Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 11/27] venus: core,helpers: add two more clocks found in " Stanimir Varbanov
2018-07-02 8:45 ` Alexandre Courbot
2018-07-02 14:01 ` Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 12/27] venus: hfi_parser: add common capability parser Stanimir Varbanov
2018-07-02 8:45 ` Alexandre Courbot
2018-06-27 15:27 ` [PATCH v4 13/27] venus: helpers: rename a helper function and use buffer mode from caps Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 14/27] venus: helpers: add a helper function to set dynamic buffer mode Stanimir Varbanov
2018-07-02 8:45 ` Alexandre Courbot
2018-06-27 15:27 ` [PATCH v4 15/27] venus: helpers: add helper function to set actual buffer size Stanimir Varbanov
2018-07-02 8:45 ` Alexandre Courbot
2018-06-27 15:27 ` [PATCH v4 16/27] venus: core: delete not used buffer mode flags Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 17/27] venus: helpers: add buffer type argument to a helper Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 18/27] venus: helpers: add a new helper to set raw format Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 19/27] venus: helpers,vdec,venc: add helpers to set work mode and core usage Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 20/27] venus: helpers: extend set_num_bufs helper with one more argument Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 21/27] venus: helpers: add a helper to return opb buffer sizes Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 22/27] venus: vdec: get required input buffers as well Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 23/27] venus: vdec: a new function for output configuration Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 24/27] venus: helpers: move frame size calculations on common place Stanimir Varbanov
2018-07-02 8:46 ` Alexandre Courbot
2018-07-02 9:35 ` Vikash Garodia
2018-07-02 9:37 ` Tomasz Figa
2018-06-27 15:27 ` [PATCH v4 25/27] venus: implementing multi-stream support Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 26/27] venus: core: add sdm845 DT compatible and resource data Stanimir Varbanov
2018-06-27 15:27 ` [PATCH v4 27/27] venus: add HEVC codec support Stanimir Varbanov
2018-07-02 8:45 ` [PATCH v4 00/27] Venus updates Alexandre Courbot
2018-07-02 15:25 ` Stanimir Varbanov
2018-07-03 8:49 ` Alexandre Courbot
2018-07-05 10:16 ` Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22e415b0-fe3c-0584-e5ee-f0de94937234@linaro.org \
--to=stanimir.varbanov@linaro.org \
--cc=acourbot@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=tfiga@chromium.org \
--cc=vgarodia@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®