Lines Matching refs:stack

278 /* push an entity to traversal stack */
287 graph->stack[graph->top].link = entity->links.next;
288 graph->stack[graph->top].entity = entity;
295 entity = graph->stack[graph->top].entity;
301 #define link_top(en) ((en)->stack[(en)->top].link)
302 #define stack_top(en) ((en)->stack[(en)->top].entity)
339 graph->stack[graph->top].entity = NULL;
382 /* Push the new entity to stack and start over. */
385 dev_dbg(entity->graph_obj.mdev->dev, "walk: pushing '%s' on stack\n",
398 * Depth first search. Push entity to stack and continue from
399 * top of the stack until no more entities on the level can be
418 * The pipeline traversal stack stores pads that are reached during graph
420 * When a new pad is reached, an entry is pushed on the top of the stack and
431 * struct media_pipeline_walk_entry - Entry in the pipeline traversal stack
446 * @stack: Depth-first search stack
447 * @stack.size: Number of allocated entries in @stack.entries
448 * @stack.top: Index of the top stack entry (-1 if the stack is empty)
449 * @stack.entries: Stack entries
458 } stack;
466 return &walk->stack.entries[walk->stack.top];
471 return walk->stack.top == -1;
474 /* Increase the stack size by MEDIA_PIPELINE_STACK_GROW_STEP elements. */
480 /* Safety check, to avoid stack overflows in case of bugs. */
481 if (walk->stack.size >= 256)
484 new_size = walk->stack.size + MEDIA_PIPELINE_STACK_GROW_STEP;
486 entries = krealloc(walk->stack.entries,
487 new_size * sizeof(*walk->stack.entries),
492 walk->stack.entries = entries;
493 walk->stack.size = new_size;
498 /* Push a new entry on the stack. */
505 if (walk->stack.top + 1 >= walk->stack.size) {
511 walk->stack.top++;
518 walk->stack.top, pad->entity->name, pad->index);
532 if (WARN_ON(walk->stack.top < 0))
540 walk->stack.top);
542 walk->stack.top--;
550 walk->stack.top);
558 kfree(walk->stack.entries);
561 /* Add a pad to the pipeline and push it to the stack. */
593 /* Explore the next link of the entity at the top of the stack. */
637 * stack, if not already present.
714 walk.stack.top = -1;
720 * Use a depth-first search algorithm: as long as the stack is not
739 WARN_ON(walk.stack.top != -1);