Skip to content

Commit

Permalink
media: venus: pm_helper: Commonize v3/v4 pmdomains and clocks management
Browse files Browse the repository at this point in the history
Most of the SoCs that are featuring Venus HFI3 also need to scale the
clocks and also need to bringup power domains, very very similarly to
SoCs (like SDM845 and SC7180) featuring HFI4 Venus, which has *yes*
differences, but not in that specific "field".

So, reduce code duplication (most v3 functions are a subset of v4),
achieve better power consumption and slightly simplify the code by
merging the v3 and v4 functions that are responsible for bringing
up and tearing down clocks and pm domains.

While at it, also add a small quirk to the video encoder functions:
since not all SoCs have got two (or more) vcodec instances, it is
incorrect to *always* manage vcodec1_clks (and itsrelative pmdomain)
there.
To get video encoders working fine - and to avoid duplicating clocks
and pmdomains declarations between vcodec0 and 1 - check for the
number of vcodecs and currently assume that:
  1. If Venus has only one vcodec (vcodec_num), then we use vcodec0
     for both video decoder and encoder;
  2. If it has more than one vcodec, then we use vcodec1 for the
     video encoder and vcodec0 for the decoder.

Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
  • Loading branch information
kholk authored and intel-lab-lkp committed Sep 26, 2020
1 parent e883494 commit 144283c
Showing 1 changed file with 277 additions and 248 deletions.

0 comments on commit 144283c

Please sign in to comment.