Lines Matching +full:sub +full:- +full:sampled
1 // SPDX-License-Identifier: GPL-2.0-only
34 struct msm_drm_private *priv = smp->dev->dev_private; in get_kms()
36 return to_mdp5_kms(to_mdp_kms(priv->kms)); in get_kms()
48 * For ViG pipes, fetch Y/Cr/Cb-components clients are always in pipe2client()
52 * if mdp5_cfg->smp.clients[SSPP_VIG0] = N, in pipe2client()
58 return mdp5_cfg->smp.clients[pipe] + plane; in pipe2client()
66 void *cs = state->client_state[cid]; in smp_request_block()
67 int i, avail, cnt = smp->blk_cnt; in smp_request_block()
70 /* we shouldn't be requesting blocks for an in-use client: */ in smp_request_block()
73 reserved = smp->reserved[cid]; in smp_request_block()
76 nblks = max(0, nblks - reserved); in smp_request_block()
80 avail = cnt - bitmap_weight(state->state, cnt); in smp_request_block()
82 DRM_DEV_ERROR(smp->dev->dev, "out of blks (req=%d > avail=%d)\n", in smp_request_block()
84 return -ENOSPC; in smp_request_block()
88 int blk = find_first_zero_bit(state->state, cnt); in smp_request_block()
90 set_bit(blk, state->state); in smp_request_block()
99 u32 smp_entries_per_blk = smp->blk_size / (128 / BITS_PER_BYTE); in set_fifo_thresholds()
105 smp->pipe_reqprio_fifo_wm0[pipe] = val * 1; in set_fifo_thresholds()
106 smp->pipe_reqprio_fifo_wm1[pipe] = val * 2; in set_fifo_thresholds()
107 smp->pipe_reqprio_fifo_wm2[pipe] = val * 3; in set_fifo_thresholds()
112 * then the width used to calculate SMP block requirements is the post-
120 const struct drm_format_info *info = drm_format_info(format->pixel_format); in mdp5_smp_calculate()
122 int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg); in mdp5_smp_calculate()
126 nplanes = info->num_planes; in mdp5_smp_calculate()
127 hsub = info->hsub; in mdp5_smp_calculate()
132 /* Newer MDPs have split/packing logic, which fetches sub-sampled in mdp5_smp_calculate()
136 if ((rev > 0) && (format->chroma_sample > CHROMA_FULL)) { in mdp5_smp_calculate()
140 * sub sampled chroma components in mdp5_smp_calculate()
149 cpp = info->cpp[i]; in mdp5_smp_calculate()
152 n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size); in mdp5_smp_calculate()
168 struct drm_device *dev = mdp5_kms->dev; in mdp5_smp_assign()
181 DRM_DEV_ERROR(dev->dev, "Cannot allocate %d SMP blocks: %d\n", in mdp5_smp_assign()
189 state->assigned |= (1 << pipe); in mdp5_smp_assign()
199 int cnt = smp->blk_cnt; in mdp5_smp_release()
203 void *cs = state->client_state[cid]; in mdp5_smp_release()
206 bitmap_andnot(state->state, state->state, cs, cnt); in mdp5_smp_release()
212 state->released |= (1 << pipe); in mdp5_smp_release()
221 int cnt = smp->blk_cnt; in update_smp_state()
229 val = smp->alloc_w[idx]; in update_smp_state()
246 smp->alloc_w[idx] = val; in update_smp_state()
247 smp->alloc_r[idx] = val; in update_smp_state()
260 num_regs = smp->blk_cnt / 3 + 1; in write_smp_alloc_regs()
264 smp->alloc_w[i]); in write_smp_alloc_regs()
266 smp->alloc_r[i]); in write_smp_alloc_regs()
275 for (i = 0; i < mdp5_kms->num_hwpipes; i++) { in write_smp_fifo_regs()
276 struct mdp5_hw_pipe *hwpipe = mdp5_kms->hwpipes[i]; in write_smp_fifo_regs()
277 enum mdp5_pipe pipe = hwpipe->pipe; in write_smp_fifo_regs()
280 smp->pipe_reqprio_fifo_wm0[pipe]); in write_smp_fifo_regs()
282 smp->pipe_reqprio_fifo_wm1[pipe]); in write_smp_fifo_regs()
284 smp->pipe_reqprio_fifo_wm2[pipe]); in write_smp_fifo_regs()
292 for_each_set_bit(pipe, &state->assigned, sizeof(state->assigned) * 8) { in mdp5_smp_prepare_commit()
297 void *cs = state->client_state[cid]; in mdp5_smp_prepare_commit()
311 state->assigned = 0; in mdp5_smp_prepare_commit()
318 for_each_set_bit(pipe, &state->released, sizeof(state->released) * 8) { in mdp5_smp_complete_commit()
325 state->released = 0; in mdp5_smp_complete_commit()
337 drm_printf(p, "----\t-----\t-----\n"); in mdp5_smp_dump()
340 hwpstate = &global_state->hwpipe; in mdp5_smp_dump()
341 state = &global_state->smp; in mdp5_smp_dump()
343 for (i = 0; i < mdp5_kms->num_hwpipes; i++) { in mdp5_smp_dump()
344 struct mdp5_hw_pipe *hwpipe = mdp5_kms->hwpipes[i]; in mdp5_smp_dump()
345 struct drm_plane *plane = hwpstate->hwpipe_to_plane[hwpipe->idx]; in mdp5_smp_dump()
346 enum mdp5_pipe pipe = hwpipe->pipe; in mdp5_smp_dump()
349 void *cs = state->client_state[cid]; in mdp5_smp_dump()
350 int inuse = bitmap_weight(cs, smp->blk_cnt); in mdp5_smp_dump()
354 plane ? plane->name : "(null)"); in mdp5_smp_dump()
360 drm_printf(p, "TOTAL:\t%d\t(of %d)\n", total, smp->blk_cnt); in mdp5_smp_dump()
361 drm_printf(p, "AVAIL:\t%d\n", smp->blk_cnt - in mdp5_smp_dump()
362 bitmap_weight(state->state, smp->blk_cnt)); in mdp5_smp_dump()
368 struct drm_device *dev = mdp5_kms->dev; in mdp5_smp_init()
373 smp = devm_kzalloc(dev->dev, sizeof(*smp), GFP_KERNEL); in mdp5_smp_init()
375 return ERR_PTR(-ENOMEM); in mdp5_smp_init()
377 smp->dev = mdp5_kms->dev; in mdp5_smp_init()
378 smp->blk_cnt = cfg->mmb_count; in mdp5_smp_init()
379 smp->blk_size = cfg->mmb_size; in mdp5_smp_init()
382 state = &global_state->smp; in mdp5_smp_init()
384 /* statically tied MMBs cannot be re-allocated: */ in mdp5_smp_init()
385 bitmap_copy(state->state, cfg->reserved_state, smp->blk_cnt); in mdp5_smp_init()
386 memcpy(smp->reserved, cfg->reserved, sizeof(smp->reserved)); in mdp5_smp_init()