mbox series

[0/2] Use APIs in gdsc genpd to switch gdsc mode for venus v4 core

Message ID 20241122-switch_gdsc_mode-v1-0-365f097ecbb0@quicinc.com (mailing list archive)
Headers show
Series Use APIs in gdsc genpd to switch gdsc mode for venus v4 core | expand

Message

Renjiang Han Nov. 22, 2024, 10:31 a.m. UTC
The Venus driver requires vcodec GDSC to be ON in SW mode for clock
operations and move it back to HW mode to gain power benefits. Earlier,
as there is no interface to switch the GDSC mode from GenPD framework,
the GDSC is moved to HW control mode as part of GDSC enable callback and
venus driver is writing to its POWER_CONTROL register to keep the GDSC ON
from SW whereever required. But the POWER_CONTROL register addresses are
not constant and can vary across the variants.

Also as per the HW recommendation, the GDSC mode switching needs to be
controlled from respective GDSC register and this is a uniform approach
across all the targets. Hence use dev_pm_genpd_set_hwmode() API which
controls GDSC mode switching using its respective GDSC register.

Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
---
Renjiang Han (1):
      venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V4

Taniya Das (1):
      clk: qcom: videocc: Use HW_CTRL_TRIGGER flag for video GDSC's

 drivers/clk/qcom/videocc-sc7180.c              |  2 +-
 drivers/clk/qcom/videocc-sdm845.c              |  4 ++--
 drivers/media/platform/qcom/venus/pm_helpers.c | 10 +++++-----
 3 files changed, 8 insertions(+), 8 deletions(-)
---
base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17
change-id: 20241122-switch_gdsc_mode-b658ea233c2a

Best regards,

Comments

Bryan O'Donoghue Nov. 23, 2024, 12:18 a.m. UTC | #1
On 22/11/2024 10:31, Renjiang Han wrote:
> The Venus driver requires vcodec GDSC to be ON in SW mode for clock
> operations and move it back to HW mode to gain power benefits. Earlier,
> as there is no interface to switch the GDSC mode from GenPD framework,
> the GDSC is moved to HW control mode as part of GDSC enable callback and
> venus driver is writing to its POWER_CONTROL register to keep the GDSC ON
> from SW whereever required. But the POWER_CONTROL register addresses are
> not constant and can vary across the variants.
> 
> Also as per the HW recommendation, the GDSC mode switching needs to be
> controlled from respective GDSC register and this is a uniform approach
> across all the targets. Hence use dev_pm_genpd_set_hwmode() API which
> controls GDSC mode switching using its respective GDSC register.
> 
> Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
> ---
> Renjiang Han (1):
>        venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V4
> 
> Taniya Das (1):
>        clk: qcom: videocc: Use HW_CTRL_TRIGGER flag for video GDSC's
> 
>   drivers/clk/qcom/videocc-sc7180.c              |  2 +-
>   drivers/clk/qcom/videocc-sdm845.c              |  4 ++--
>   drivers/media/platform/qcom/venus/pm_helpers.c | 10 +++++-----
>   3 files changed, 8 insertions(+), 8 deletions(-)
> ---
> base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17
> change-id: 20241122-switch_gdsc_mode-b658ea233c2a
> 
> Best regards,

What's your test strategy here ? What platforms have you tested this on ?

What help do you need ?

---
bod
Renjiang Han Nov. 25, 2024, 3:49 a.m. UTC | #2
On Saturday, November 23, 2024 8:19 AM, Bryan O'Donoghue wrote:
> On 22/11/2024 10:31, Renjiang Han wrote:
> > The Venus driver requires vcodec GDSC to be ON in SW mode for clock 
> > operations and move it back to HW mode to gain power benefits. 
> > Earlier, as there is no interface to switch the GDSC mode from GenPD 
> > framework, the GDSC is moved to HW control mode as part of GDSC enable 
> > callback and venus driver is writing to its POWER_CONTROL register to 
> > keep the GDSC ON from SW whereever required. But the POWER_CONTROL 
> > register addresses are not constant and can vary across the variants.
> > 
> > Also as per the HW recommendation, the GDSC mode switching needs to be 
> > controlled from respective GDSC register and this is a uniform 
> > approach across all the targets. Hence use dev_pm_genpd_set_hwmode() 
> > API which controls GDSC mode switching using its respective GDSC register.
> > 
> > Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com> >
> > ---
> > Renjiang Han (1):
> >        venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC 
> > mode on V4
> > 
> > Taniya Das (1):
> >        clk: qcom: videocc: Use HW_CTRL_TRIGGER flag for video GDSC's
> > 
> >   drivers/clk/qcom/videocc-sc7180.c              |  2 +-
> >   drivers/clk/qcom/videocc-sdm845.c              |  4 ++--
> >   drivers/media/platform/qcom/venus/pm_helpers.c | 10 +++++-----
> >   3 files changed, 8 insertions(+), 8 deletions(-)
> > ---
> > base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17
> > change-id: 20241122-switch_gdsc_mode-b658ea233c2a
> > 
> > Best regards,

> What's your test strategy here ? What platforms have you tested this on ?

> What help do you need ?
Since the GDSC flag has been changed to HW_CTRL_TRIGGER, the v4 core needs to use
dev_pm_genpd_set_hwmode to switch the GDSC mode like v6. The video codec has
been verified on SC7180 and the result is OK. The same verification has been done on
the latest QCS615 and the result is also OK.
In addition, since the videocc of QCS615 uses the HW_CTRL_TRIGGER flag, QCS615 and
SC7180 both use the v4 core in venus. So the v4 core needs to use
dev_pm_genpd_set_hwmode to switch the GDSC mode like v6.

> ---
> bod
Bryan O'Donoghue Nov. 25, 2024, 9:35 a.m. UTC | #3
On 25/11/2024 03:49, Renjiang Han (QUIC) wrote:
>> What help do you need ?
> Since the GDSC flag has been changed to HW_CTRL_TRIGGER, the v4 core needs to use
> dev_pm_genpd_set_hwmode to switch the GDSC mode like v6. The video codec has
> been verified on SC7180 and the result is OK. The same verification has been done on
> the latest QCS615 and the result is also OK.
> In addition, since the videocc of QCS615 uses the HW_CTRL_TRIGGER flag, QCS615 and
> SC7180 both use the v4 core in venus. So the v4 core needs to use
> dev_pm_genpd_set_hwmode to switch the GDSC mode like v6.

I think you need this tested on sdm845.

I can do that for you.

---
bod
Renjiang Han Nov. 25, 2024, 10:13 a.m. UTC | #4
On Monday, November 25, 2024 5:36 PM, Bryan O'Donoghue wrote:
> On 25/11/2024 03:49, Renjiang Han (QUIC) wrote:
> > > > What help do you need ?
> > Since the GDSC flag has been changed to HW_CTRL_TRIGGER, the v4 core 
> > needs to use dev_pm_genpd_set_hwmode to switch the GDSC mode like v6. 
> > The video codec has been verified on SC7180 and the result is OK. The 
> > same verification has been done on the latest QCS615 and the result is also OK.
> > In addition, since the videocc of QCS615 uses the HW_CTRL_TRIGGER 
> > flag, QCS615 and
> > SC7180 both use the v4 core in venus. So the v4 core needs to use 
> > dev_pm_genpd_set_hwmode to switch the GDSC mode like v6.

> I think you need this tested on sdm845.

> I can do that for you.
Thanks for your reply. Yes, we need to test on sdm845. Please help run these two changes on sdm845. Thanks for your help again.
> ---
> bod