Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media: venus: pm_helper: Commonize v3/v4 pmdomains and clocks management
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