aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
index e61e1cfed853..04996cae4585 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
@@ -108,11 +108,15 @@ static int smp_request_block(struct mdp5_smp *smp,
108 enum mdp5_client_id cid, int nblks) 108 enum mdp5_client_id cid, int nblks)
109{ 109{
110 struct mdp5_kms *mdp5_kms = get_kms(smp); 110 struct mdp5_kms *mdp5_kms = get_kms(smp);
111 const struct mdp5_cfg_hw *hw_cfg;
111 struct mdp5_client_smp_state *ps = &smp->client_state[cid]; 112 struct mdp5_client_smp_state *ps = &smp->client_state[cid];
112 int i, ret, avail, cur_nblks, cnt = smp->blk_cnt; 113 int i, ret, avail, cur_nblks, cnt = smp->blk_cnt;
113 int reserved = mdp5_kms->hw_cfg->smp.reserved[cid]; 114 int reserved;
114 unsigned long flags; 115 unsigned long flags;
115 116
117 hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg_priv);
118 reserved = hw_cfg->smp.reserved[cid];
119
116 spin_lock_irqsave(&smp->state_lock, flags); 120 spin_lock_irqsave(&smp->state_lock, flags);
117 121
118 nblks -= reserved; 122 nblks -= reserved;
@@ -175,6 +179,7 @@ int mdp5_smp_request(void *handler, enum mdp5_pipe pipe, u32 fmt, u32 width)
175 struct mdp5_smp *smp = handler; 179 struct mdp5_smp *smp = handler;
176 struct mdp5_kms *mdp5_kms = get_kms(smp); 180 struct mdp5_kms *mdp5_kms = get_kms(smp);
177 struct drm_device *dev = mdp5_kms->dev; 181 struct drm_device *dev = mdp5_kms->dev;
182 int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg_priv);
178 int i, hsub, nplanes, nlines, nblks, ret; 183 int i, hsub, nplanes, nlines, nblks, ret;
179 184
180 nplanes = drm_format_num_planes(fmt); 185 nplanes = drm_format_num_planes(fmt);
@@ -192,7 +197,7 @@ int mdp5_smp_request(void *handler, enum mdp5_pipe pipe, u32 fmt, u32 width)
192 n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size); 197 n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size);
193 198
194 /* for hw rev v1.00 */ 199 /* for hw rev v1.00 */
195 if (mdp5_kms->rev == 0) 200 if (rev == 0)
196 n = roundup_pow_of_two(n); 201 n = roundup_pow_of_two(n);
197 202
198 DBG("%s[%d]: request %d SMP blocks", pipe2name(pipe), i, n); 203 DBG("%s[%d]: request %d SMP blocks", pipe2name(pipe), i, n);