summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2021-05-20 14:10:10 +0530
committerVinod Koul <vkoul@kernel.org>2021-05-20 14:21:35 +0530
commit3e70c409f5cd479a40fb80f919747db9b9dce58d (patch)
tree32b62f9ba37bfb529f9690108a4ff4eb4f248876 /drivers
parentcfc5362b9028e02e8acf47886684be79130a93a8 (diff)
fixup! drm/msm/dpu: Add DSC support in encoder
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index fb229ab8f673..4e3d0e749584 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -574,6 +574,8 @@ static struct msm_display_topology dpu_encoder_get_topology(
struct drm_display_mode *mode)
{
struct msm_display_topology topology = {0};
+ struct drm_encoder *drm_enc;
+ struct msm_drm_private *priv;
int i, intf_count = 0;
for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
@@ -608,8 +610,22 @@ static struct msm_display_topology dpu_encoder_get_topology(
topology.num_enc = 0;
topology.num_intf = intf_count;
+ drm_enc = &dpu_enc->base;
+ priv = drm_enc->dev->dev_private;
+ if (priv && priv->dsc) {
+ /* In case of Display Stream Compression DSC, we would use
+ * 2 encoders, 2 line mixers and 1 interface
+ * this is power optimal and can drive upto (including) 4k
+ * screens
+ */
+ topology.num_enc = 2;
+ topology.num_intf = 1;
+ topology.num_lm = 2;
+ }
+
return topology;
}
+
static int dpu_encoder_virt_atomic_check(
struct drm_encoder *drm_enc,
struct drm_crtc_state *crtc_state,
@@ -1017,7 +1033,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
struct dpu_hw_blk *hw_lm[MAX_CHANNELS_PER_ENC];
struct dpu_hw_blk *hw_dspp[MAX_CHANNELS_PER_ENC] = { NULL };
struct dpu_hw_blk *hw_dsc[MAX_CHANNELS_PER_ENC];
- int num_lm, num_ctl, num_pp, num_dspp, num_dsc;
+ int num_lm, num_ctl, num_pp, num_dsc;
int i, j;
if (!drm_enc) {
@@ -1939,6 +1955,7 @@ static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc,
struct msm_display_dsc_config *dsc,
u32 common_mode, bool ich_reset)
{
+
if (hw_dsc->ops.dsc_config)
hw_dsc->ops.dsc_config(hw_dsc, dsc, common_mode, ich_reset);
@@ -1976,8 +1993,8 @@ static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc,
}
dsc_common_mode = 0;
- pic_width = 2160;//dsc->drm.pic_width;
- pic_height = 2160;//dsc->drm.pic_height;
+ pic_width = dsc->drm.pic_width;
+ pic_height = dsc->drm.pic_height;
dpu_encoder_dsc_update_pic_dim(dsc, pic_width, pic_height);
@@ -1999,10 +2016,8 @@ static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc,
ich_res = dpu_encoder_dsc_ich_reset_override_needed(dsc, false);
- dpu_encoder_dsc_pipe_cfg(hw_dsc[0], hw_pp[0], dsc, dsc_common_mode,
- ich_res);
- dpu_encoder_dsc_pipe_cfg(hw_dsc[1], hw_pp[1], dsc, dsc_common_mode,
- ich_res);
+ for (i = 0; i < MAX_CHANNELS_PER_ENC; i++)
+ dpu_encoder_dsc_pipe_cfg(hw_dsc[i], hw_pp[i], dsc, dsc_common_mode, ich_res);
}
void dpu_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc)