On Wed, Jan 22, 2025 at 05:23:44PM +0100, Marijn Suijten wrote: > Some SoCs such as SC7280 (used in the Fairphone 5) have only a single > DSC "hard slice" encoder. The current hardcoded use of 2:2:1 topology > (2 LM and 2 DSC for a single interface) make it impossible to use > Display Stream Compression panels with mainline, which is exactly what's > installed on the Fairphone 5. > > By loosening the hardcoded `num_dsc = 2` to fall back to `num_dsc = > 1` when the catalog only contains one entry, we can trivially support > this phone and unblock further panel enablement on mainline. A few > more supporting changes in this patch ensure hardcoded constants of 2 > DSC encoders are replaced to count or read back the actual number of > DSC hardware blocks that are enabled for the given virtual encoder. > Likewise DSC_MODE_SPLIT_PANEL can no longer be unconditionally enabled. > > Cc: Luca Weiss <luca.weiss@xxxxxxxxxxxxx> > Signed-off-by: Marijn Suijten <marijn.suijten@xxxxxxxxxxxxxx> > --- > Note that this doesn't paint the full picture in case there are SoCs > with more DSC hardware blocks, but when multiple virtual encoders > have already allocated most of them. My initial plan was to code > ahead for dynamically tracking and reallocating these blocks in RM, if > some virtual encoder could potentially be using too many DSC encoders > which, while "power optimal", may not be able to support the number of > requested displays/interfaces. Such a solution would automatically > ensure DSCmerge is *not* used when there are not enough hardware blocks > available in the first place. > --- > Changes in v2: > - Fairphone is one word, lowercase the P from phone (Luca); > - Skip unnecessary if (dpu_enc->dsc) check and always count the number > of non-NULL dpu_enc->hw_dsc[i] instead (Dmitry); > - Revert irrelevant whitespace cleanup in DSC comment, even if > worthless enough to send separately (Dmitry); > - Drop dsc_common_mode=0 initialization and move existing 0-assignment > from a random place in the function down to where this variable is > actually being updated (Dmitry); > - Link to v1: https://lore.kernel.org/r/20250121-dpu-111-topology-v1-1-d01987205c53@xxxxxxxxxxxxxx > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 47 +++++++++++++++-------------- > 1 file changed, 25 insertions(+), 22 deletions(-) > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> -- With best wishes Dmitry