Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Vikash Garodia <quic_vgarodia@quicinc.com>,
	Dikshita Agarwal <quic_dikshita@quicinc.com>,
	Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Dikshita Agarwal <dikshita@qti.qualcomm.com>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Dikshita Agarwal <dikshita@codeaurora.org>,
	Mansur Alisha Shaik <mansur@codeaurora.org>,
	Jonathan Marek <jonathan@marek.ca>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Vikash Garodia <vgarodia@codeaurora.org>
Subject: Re: [PATCH 02/18] media: venus: Introduce VPU version distinction
Date: Thu, 30 Mar 2023 13:15:28 +0200	[thread overview]
Message-ID: <58b9c5bb-e70c-67b3-e0d9-9aaaa4d4caf5@linaro.org> (raw)
In-Reply-To: <0e85caec-f6ec-fbd4-1815-8df9769bffcf@quicinc.com>



On 30.03.2023 13:02, Vikash Garodia wrote:
> On 3/2/2023 5:07 PM, Konrad Dybcio wrote:
>>
>> On 2.03.2023 08:12, Dikshita Agarwal wrote:
>>> On 2/28/2023 8:54 PM, Konrad Dybcio wrote:
>>>> The Video Processing Unit hardware version is the differentiator,
>>>> based on which we should decide which code paths to take in hw
>>>> init. Up until now, we've relied on HFI versions, but that was
>>>> just a happy accident between recent SoCs. Add a field in the
>>>> res struct and add correlated definitions that will be used to
>>>> account for the aforementioned differences.
>>>>
>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>> ---
>>>>    drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++
>>>>    1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
>>>> index 32551c2602a9..4b785205c5b1 100644
>>>> --- a/drivers/media/platform/qcom/venus/core.h
>>>> +++ b/drivers/media/platform/qcom/venus/core.h
>>>> @@ -48,6 +48,14 @@ struct bw_tbl {
>>>>        u32 peak_10bit;
>>>>    };
>>>>    +enum vpu_version {
>>>> +    VPU_VERSION_AR50, /* VPU4 */
>>>> +    VPU_VERSION_AR50_LITE, /* VPU4.4 */
>>>> +    VPU_VERSION_IRIS1, /* VPU5 */
> 
> There was Venus3X, followed by a different generation of video hardware. Driver just extended the versions for next generation incrementally.
> 
> Existing versions in driver are not the VPU versions, so we can drop them from comments.
Ack!

> 
>>>> +    VPU_VERSION_IRIS2,
>>>> +    VPU_VERSION_IRIS2_1,
>>>> +};
>>>> +
>>>>    struct venus_resources {
>>>>        u64 dma_mask;
>>>>        const struct freq_tbl *freq_tbl;
>>>> @@ -71,6 +79,7 @@ struct venus_resources {
>>>>        const char * const resets[VIDC_RESETS_NUM_MAX];
>>>>        unsigned int resets_num;
>>>>        enum hfi_version hfi_version;
>>>> +    enum vpu_version vpu_version;
>>>>        u8 num_vpp_pipes;
>>>>        u32 max_load;
>>>>        unsigned int vmem_id;
>>>> @@ -473,6 +482,12 @@ struct venus_inst {
>>>>    #define IS_V4(core)    ((core)->res->hfi_version == HFI_VERSION_4XX)
>>>>    #define IS_V6(core)    ((core)->res->hfi_version == HFI_VERSION_6XX)
>>>>    +#define IS_AR50(core)        ((core)->res->vpu_version == VPU_VERSION_AR50)
>>>> +#define IS_AR50_LITE(core)    ((core)->res->vpu_version == VPU_VERSION_AR50_LITE)
>>>> +#define IS_IRIS1(core)        ((core)->res->vpu_version == VPU_VERSION_IRIS1)
>>>> +#define IS_IRIS2(core)        ((core)->res->vpu_version == VPU_VERSION_IRIS2)
>>>> +#define IS_IRIS2_1(core)    ((core)->res->vpu_version == VPU_VERSION_IRIS2_1)
>>>> +
>>>>    #define ctrl_to_inst(ctrl)    \
>>>>        container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
>>>>    
>>> Adding VPU version check seems a good idea to me. Can we remove HFI Version checks now?
>> If all implementations using VPU x.y *always* use the
>> same HFI generation for given x, y, we could.
> 
> HFIs generally does not change, so we can be sure that they would always use the same HFI.
> 
> We might add a new interface (HFI) for a feature requirement, but always support the existing ones.
Okay, will do. Thanks!

Konrad
> 
>>
>> That said, I think keeping it as-is would be convenient
>> from the maintainability standpoint if nothing else.. For
>> example functions that only appear in ancient msm-3.10
>> releases can be easily guarded with IS_V1 or what have you
>> without having to dig up all n VPU revisions.
>>
>> Konrad

  reply	other threads:[~2023-03-30 11:15 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 15:24 [PATCH 00/18] Venus QoL / maintainability fixes Konrad Dybcio
2023-02-28 15:24 ` [PATCH 01/18] media: venus: hfi_venus: Set venus_sys_idle_indicator to false on V6 Konrad Dybcio
2023-02-28 15:26   ` Bryan O'Donoghue
2023-02-28 15:31     ` Bryan O'Donoghue
2023-02-28 15:37       ` Konrad Dybcio
2023-02-28 15:38         ` Bryan O'Donoghue
2023-02-28 15:41           ` Konrad Dybcio
2023-02-28 16:53             ` Bryan O'Donoghue
2023-03-02  6:39               ` Dikshita Agarwal
2023-03-02 11:33                 ` Konrad Dybcio
2023-03-02 11:54                   ` Dikshita Agarwal
2023-03-20 14:54                 ` Konrad Dybcio
     [not found]                   ` <e93ba74a-ccde-c6bd-4302-8884144d615d@quicinc.com>
     [not found]                     ` <bf5e30fa-5014-5585-3b8e-b1a8d2f95549@quicinc.com>
2023-04-04 17:52                       ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 02/18] media: venus: Introduce VPU version distinction Konrad Dybcio
2023-03-02  7:12   ` Dikshita Agarwal
2023-03-02 11:37     ` Konrad Dybcio
2023-03-30 11:02       ` Vikash Garodia
2023-03-30 11:15         ` Konrad Dybcio [this message]
2023-02-28 15:24 ` [PATCH 03/18] media: venus: Add vpu_version to most SoCs Konrad Dybcio
2023-02-28 15:24 ` [PATCH 04/18] media: venus: firmware: Leave a clue for homegrown porters Konrad Dybcio
2023-03-02  8:18   ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 05/18] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version Konrad Dybcio
2023-03-02 11:00   ` Dikshita Agarwal
2023-03-02 11:10     ` Konrad Dybcio
2023-03-02 11:58       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 06/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts Konrad Dybcio
2023-02-28 15:33   ` Bryan O'Donoghue
2023-02-28 15:59     ` Konrad Dybcio
2023-03-02 12:27       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 07/18] media: venus: core: Assign registers based on VPU version Konrad Dybcio
2023-03-07  4:57   ` Dikshita Agarwal
2023-03-07 11:18     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 08/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi() Konrad Dybcio
2023-02-28 15:36   ` Bryan O'Donoghue
2023-02-28 16:01     ` Konrad Dybcio
2023-03-02 12:35       ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 09/18] media: venus: hfi_venus: Fix version checks in venus_isr() Konrad Dybcio
2023-03-07  6:12   ` Dikshita Agarwal
2023-03-07  6:14     ` Dikshita Agarwal
2023-02-28 15:24 ` [PATCH 10/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle() Konrad Dybcio
2023-02-28 15:40   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready() Konrad Dybcio
2023-02-28 15:24 ` [PATCH 12/18] media: venus: firmware: Correct IS_V6() checks Konrad Dybcio
2023-02-28 15:48   ` Bryan O'Donoghue
2023-02-28 16:08     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 13/18] media: venus: hfi_platform: Check vpu_version instead of device compatible Konrad Dybcio
2023-02-28 15:49   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 14/18] media: venus: vdec: Fix version check in vdec_set_work_route() Konrad Dybcio
2023-02-28 15:50   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 15/18] media: venus: Remap bufreq fields on HFI6XX Konrad Dybcio
2023-02-28 15:51   ` Bryan O'Donoghue
2023-02-28 16:05     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 16/18] media: venus: Introduce accessors for remapped hfi_buffer_reqs members Konrad Dybcio
2023-02-28 15:54   ` Bryan O'Donoghue
2023-02-28 15:24 ` [PATCH 17/18] media: venus: Use newly-introduced hfi_buffer_requirements accessors Konrad Dybcio
2023-02-28 15:56   ` Bryan O'Donoghue
2023-02-28 16:09     ` Konrad Dybcio
2023-02-28 15:24 ` [PATCH 18/18] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2 Konrad Dybcio
2023-02-28 15:57   ` Bryan O'Donoghue
2023-02-28 16:09     ` Konrad Dybcio

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=58b9c5bb-e70c-67b3-e0d9-9aaaa4d4caf5@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dikshita@codeaurora.org \
    --cc=dikshita@qti.qualcomm.com \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mansur@codeaurora.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=quic_dikshita@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=stanimir.k.varbanov@gmail.com \
    --cc=stanimir.varbanov@linaro.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