Lines Matching refs:smp

32 struct mdp5_kms *get_kms(struct mdp5_smp *smp)
34 struct msm_drm_private *priv = smp->dev->dev_private;
52 * if mdp5_cfg->smp.clients[SSPP_VIG0] = N,
58 return mdp5_cfg->smp.clients[pipe] + plane;
62 static int smp_request_block(struct mdp5_smp *smp,
67 int i, avail, cnt = smp->blk_cnt;
73 reserved = smp->reserved[cid];
82 DRM_DEV_ERROR(smp->dev->dev, "out of blks (req=%d > avail=%d)\n",
96 static void set_fifo_thresholds(struct mdp5_smp *smp,
99 u32 smp_entries_per_blk = smp->blk_size / (128 / BITS_PER_BYTE);
105 smp->pipe_reqprio_fifo_wm0[pipe] = val * 1;
106 smp->pipe_reqprio_fifo_wm1[pipe] = val * 2;
107 smp->pipe_reqprio_fifo_wm2[pipe] = val * 3;
116 uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
121 struct mdp5_kms *mdp5_kms = get_kms(smp);
152 n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size);
164 int mdp5_smp_assign(struct mdp5_smp *smp, struct mdp5_smp_state *state,
167 struct mdp5_kms *mdp5_kms = get_kms(smp);
179 ret = smp_request_block(smp, state, cid, n);
195 void mdp5_smp_release(struct mdp5_smp *smp, struct mdp5_smp_state *state,
199 int cnt = smp->blk_cnt;
218 static unsigned update_smp_state(struct mdp5_smp *smp,
221 int cnt = smp->blk_cnt;
229 val = smp->alloc_w[idx];
246 smp->alloc_w[idx] = val;
247 smp->alloc_r[idx] = val;
255 static void write_smp_alloc_regs(struct mdp5_smp *smp)
257 struct mdp5_kms *mdp5_kms = get_kms(smp);
260 num_regs = smp->blk_cnt / 3 + 1;
264 smp->alloc_w[i]);
266 smp->alloc_r[i]);
270 static void write_smp_fifo_regs(struct mdp5_smp *smp)
272 struct mdp5_kms *mdp5_kms = get_kms(smp);
280 smp->pipe_reqprio_fifo_wm0[pipe]);
282 smp->pipe_reqprio_fifo_wm1[pipe]);
284 smp->pipe_reqprio_fifo_wm2[pipe]);
288 void mdp5_smp_prepare_commit(struct mdp5_smp *smp, struct mdp5_smp_state *state)
299 nblks += update_smp_state(smp, cid, cs);
305 set_fifo_thresholds(smp, pipe, nblks);
308 write_smp_alloc_regs(smp);
309 write_smp_fifo_regs(smp);
314 void mdp5_smp_complete_commit(struct mdp5_smp *smp, struct mdp5_smp_state *state)
320 set_fifo_thresholds(smp, pipe, 0);
323 write_smp_fifo_regs(smp);
328 void mdp5_smp_dump(struct mdp5_smp *smp, struct drm_printer *p,
331 struct mdp5_kms *mdp5_kms = get_kms(smp);
341 state = &global_state->smp;
350 int inuse = bitmap_weight(cs, smp->blk_cnt);
360 drm_printf(p, "TOTAL:\t%d\t(of %d)\n", total, smp->blk_cnt);
361 drm_printf(p, "AVAIL:\t%d\n", smp->blk_cnt -
362 bitmap_weight(state->state, smp->blk_cnt));
371 struct mdp5_smp *smp;
373 smp = devm_kzalloc(dev->dev, sizeof(*smp), GFP_KERNEL);
374 if (unlikely(!smp))
377 smp->dev = mdp5_kms->dev;
378 smp->blk_cnt = cfg->mmb_count;
379 smp->blk_size = cfg->mmb_size;
382 state = &global_state->smp;
385 bitmap_copy(state->state, cfg->reserved_state, smp->blk_cnt);
386 memcpy(smp->reserved, cfg->reserved, sizeof(smp->reserved));
388 return smp;