drm/msm/dpu: Allow specifying features and sblk in DSPP_BLK macro
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Tue, 12 Jan 2021 19:26:29 +0000 (20:26 +0100)
committerRob Clark <robdclark@chromium.org>
Sun, 31 Jan 2021 19:34:35 +0000 (11:34 -0800)
The DSPP_BLK macro was ad-hoc made for SC7180, but this is wrong
because not all of the DPU DSPP versions can use the same DSPP block
configuration, and not all of them have got the same features.

For this reason, add two more params to the DSPP_BLK macro, so that
it is possible to specify the feature mask and the sblk config for
each DSPP.

Fixes: 4259ff7ae509 ("drm/msm/dpu: add support for pcc color block in dpu driver")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

index 48d490f65840238654ddbf9edd22c6f8043421b1..2e0f6f726a1bd35560873df51e7ca4970d6667aa 100644 (file)
@@ -532,23 +532,28 @@ static const struct dpu_dspp_sub_blks sm8150_dspp_sblk = {
                .len = 0x90, .version = 0x40000},
 };
 
-#define DSPP_BLK(_name, _id, _base, _sblk) \
+#define DSPP_BLK(_name, _id, _base, _mask, _sblk) \
                {\
                .name = _name, .id = _id, \
                .base = _base, .len = 0x1800, \
-               .features = DSPP_SC7180_MASK, \
+               .features = _mask, \
                .sblk = _sblk \
                }
 
 static const struct dpu_dspp_cfg sc7180_dspp[] = {
-       DSPP_BLK("dspp_0", DSPP_0, 0x54000, &sc7180_dspp_sblk),
+       DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
+                &sc7180_dspp_sblk),
 };
 
 static const struct dpu_dspp_cfg sm8150_dspp[] = {
-       DSPP_BLK("dspp_0", DSPP_0, 0x54000, &sm8150_dspp_sblk),
-       DSPP_BLK("dspp_1", DSPP_1, 0x56000, &sm8150_dspp_sblk),
-       DSPP_BLK("dspp_2", DSPP_2, 0x58000, &sm8150_dspp_sblk),
-       DSPP_BLK("dspp_3", DSPP_3, 0x5a000, &sm8150_dspp_sblk),
+       DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK,
+                &sm8150_dspp_sblk),
+       DSPP_BLK("dspp_1", DSPP_1, 0x56000, DSPP_SC7180_MASK,
+                &sm8150_dspp_sblk),
+       DSPP_BLK("dspp_2", DSPP_2, 0x58000, DSPP_SC7180_MASK,
+                &sm8150_dspp_sblk),
+       DSPP_BLK("dspp_3", DSPP_3, 0x5a000, DSPP_SC7180_MASK,
+                &sm8150_dspp_sblk),
 };
 
 /*************************************************************