/* * Copyright 2021 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.
*/ #define nvkm_uchan(p) container_of((p), struct nvkm_uchan, object) #include"priv.h" #include"cgrp.h" #include"chan.h" #include"chid.h" #include"runl.h"
/* Unbind engine context from channel, if no longer required. */ if (refcount_dec_and_mutex_lock(&cctx->uses, &chan->cgrp->mutex)) {
nvkm_chan_cctx_bind(chan, ectx->engn, NULL);
if (refcount_dec_and_test(&ectx->uses))
nvkm_object_fini(ectx->object, false);
mutex_unlock(&chan->cgrp->mutex);
}
/* Bind engine context to channel, if it hasn't been already. */ if (!refcount_inc_not_zero(&cctx->uses)) {
mutex_lock(&chan->cgrp->mutex); if (!refcount_inc_not_zero(&cctx->uses)) { if (!refcount_inc_not_zero(&ectx->uses)) {
ret = nvkm_object_init(ectx->object); if (ret == 0)
refcount_set(&ectx->uses, 1);
}
nvkm_runl_foreach_engn(engn, chan->cgrp->runl) { struct nvkm_engine *engine = engn->engine; int c = 0;
/* Each runqueue, on runlists with multiple, has its own LCE. */ if (engn->runl->func->runqs) { if (engine->subdev.type == NVKM_ENGINE_CE) { if (chan->runq != runq++) continue;
}
}
oclass->engine = engine;
oclass->base.oclass = 0;
if (engine->func->fifo.sclass) {
ret = engine->func->fifo.sclass(oclass, index); if (oclass->base.oclass) { if (!oclass->base.ctor)
oclass->base.ctor = nvkm_object_new;
oclass->ctor = nvkm_uchan_object_new; return 0;
}
index -= ret; continue;
}
while (engine->func->sclass[c].oclass) { if (c++ == index) {
oclass->base = engine->func->sclass[index]; if (!oclass->base.ctor)
oclass->base.ctor = nvkm_object_new;
oclass->ctor = nvkm_uchan_object_new; return 0;
}
}
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.