n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size);
/* for hw rev v1.00 */ if (rev == 0)
n = roundup_pow_of_two(n);
blkcfg |= (n << (8 * i));
}
return blkcfg;
}
int mdp5_smp_assign(struct mdp5_smp *smp, struct mdp5_smp_state *state, enum mdp5_pipe pipe, uint32_t blkcfg)
{ struct mdp5_kms *mdp5_kms = get_kms(smp); struct drm_device *dev = mdp5_kms->dev; int i, ret;
for (i = 0; i < pipe2nclients(pipe); i++) {
u32 cid = pipe2client(pipe, i); int n = blkcfg & 0xff;
if (!n) continue;
DBG("%s[%d]: request %d SMP blocks", pipe2name(pipe), i, n);
ret = smp_request_block(smp, state, cid, n); if (ret) {
DRM_DEV_ERROR(dev->dev, "Cannot allocate %d SMP blocks: %d\n",
n, ret); return ret;
}
blkcfg >>= 8;
}
state->assigned |= (1 << pipe);
return0;
}
/* Release SMP blocks for all clients of the pipe */ void mdp5_smp_release(struct mdp5_smp *smp, struct mdp5_smp_state *state, enum mdp5_pipe pipe)
{ int i; int cnt = smp->blk_cnt;
for (i = 0; i < pipe2nclients(pipe); i++) {
u32 cid = pipe2client(pipe, i); void *cs = state->client_state[cid];
/* update global state: */
bitmap_andnot(state->state, state->state, cs, cnt);
/* clear client's state */
bitmap_zero(cs, cnt);
}
state->released |= (1 << pipe);
}
/* NOTE: SMP_ALLOC_* regs are *not* double buffered, so release has to *happenafterscanoutcompletes.
*/ staticunsigned update_smp_state(struct mdp5_smp *smp,
u32 cid, mdp5_smp_state_t *assigned)
{ int cnt = smp->blk_cnt; unsigned nblks = 0;
u32 blk, val;
for_each_set_bit(blk, *assigned, cnt) { int idx = blk / 3; int fld = blk % 3;
val = smp->alloc_w[idx];
switch (fld) { case0:
val &= ~MDP5_SMP_ALLOC_W_REG_CLIENT0__MASK;
val |= MDP5_SMP_ALLOC_W_REG_CLIENT0(cid); break; case1:
val &= ~MDP5_SMP_ALLOC_W_REG_CLIENT1__MASK;
val |= MDP5_SMP_ALLOC_W_REG_CLIENT1(cid); break; case2:
val &= ~MDP5_SMP_ALLOC_W_REG_CLIENT2__MASK;
val |= MDP5_SMP_ALLOC_W_REG_CLIENT2(cid); break;
}
smp->alloc_w[idx] = val;
smp->alloc_r[idx] = val;
nblks++;
}
return nblks;
}
staticvoid write_smp_alloc_regs(struct mdp5_smp *smp)
{ struct mdp5_kms *mdp5_kms = get_kms(smp); int i, num_regs;
num_regs = smp->blk_cnt / 3 + 1;
for (i = 0; i < num_regs; i++) {
mdp5_write(mdp5_kms, REG_MDP5_SMP_ALLOC_W_REG(i),
smp->alloc_w[i]);
mdp5_write(mdp5_kms, REG_MDP5_SMP_ALLOC_R_REG(i),
smp->alloc_r[i]);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.