int msm_context_set_sysprof(struct msm_context *ctx, struct msm_gpu *gpu, int sysprof)
{ /* * Since pm_runtime and sysprof_active are both refcounts, we * call apply the new value first, and then unwind the previous * value
*/
switch (sysprof) { default: return UERR(EINVAL, gpu->dev, "Invalid sysprof: %d", sysprof); case 2:
pm_runtime_get_sync(&gpu->pdev->dev);
fallthrough; case 1:
refcount_inc(&gpu->sysprof_active);
fallthrough; case 0: break;
}
/* unwind old value: */ switch (ctx->sysprof) { case 2:
pm_runtime_put_autosuspend(&gpu->pdev->dev);
fallthrough; case 1:
refcount_dec(&gpu->sysprof_active);
fallthrough; case 0: break;
}
/* * No lock needed in close and there won't * be any more user ioctls coming our way
*/
list_for_each_entry_safe(queue, tmp, &ctx->submitqueues, node) { if (queue->entity == &queue->_vm_bind_entity[0])
drm_sched_entity_flush(queue->entity, MAX_WAIT_SCHED_ENTITY_Q_EMPTY);
list_del(&queue->node);
msm_submitqueue_put(queue);
}
/* We should have already validated that the requested priority is * valid by the time we get here.
*/ if (WARN_ON(idx >= ARRAY_SIZE(ctx->entities))) return ERR_PTR(-EINVAL);
mutex_lock(&entity_lock);
if (!ctx->entities[idx]) { struct drm_sched_entity *entity; struct drm_gpu_scheduler *sched = &ring->sched; int ret;
/* * Create the default submit-queue (id==0), used for backwards compatibility * for userspace that pre-dates the introduction of submitqueues.
*/ int msm_submitqueue_init(struct drm_device *drm, struct msm_context *ctx)
{ struct msm_drm_private *priv = drm->dev_private; int default_prio, max_priority;
/* * Pick a medium priority level as default. Lower numeric value is * higher priority, so round-up to pick a priority that is not higher * than the middle priority level.
*/
default_prio = DIV_ROUND_UP(max_priority, 2);
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.