Lines Matching refs:graph
241 static void stack_push(struct media_graph *graph,
244 if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) {
248 graph->top++;
249 graph->stack[graph->top].link = entity->links.next;
250 graph->stack[graph->top].entity = entity;
253 static struct media_entity *stack_pop(struct media_graph *graph)
257 entity = graph->stack[graph->top].entity;
258 graph->top--;
267 * media_graph_walk_init - Allocate resources for graph walk
268 * @graph: Media graph structure that will be used to walk the graph
271 * Reserve resources for graph walk in media device's current
278 struct media_graph *graph, struct media_device *mdev)
280 return media_entity_enum_init(&graph->ent_enum, mdev);
285 * media_graph_walk_cleanup - Release resources related to graph walking
286 * @graph: Media graph structure that was used to walk the graph
288 void media_graph_walk_cleanup(struct media_graph *graph)
290 media_entity_enum_cleanup(&graph->ent_enum);
294 void media_graph_walk_start(struct media_graph *graph,
297 media_entity_enum_zero(&graph->ent_enum);
298 media_entity_enum_set(&graph->ent_enum, entity);
300 graph->top = 0;
301 graph->stack[graph->top].entity = NULL;
302 stack_push(graph, entity);
304 "begin graph walk at '%s'\n", entity->name);
308 static void media_graph_walk_iter(struct media_graph *graph)
310 struct media_entity *entity = stack_top(graph);
314 link = list_entry(link_top(graph), typeof(*link), list);
318 link_top(graph) = link_top(graph)->next;
330 if (media_entity_enum_test_and_set(&graph->ent_enum, next)) {
331 link_top(graph) = link_top(graph)->next;
339 link_top(graph) = link_top(graph)->next;
340 stack_push(graph, next);
345 struct media_entity *media_graph_walk_next(struct media_graph *graph)
349 if (stack_top(graph) == NULL)
357 while (link_top(graph) != &stack_top(graph)->links)
358 media_graph_walk_iter(graph);
360 entity = stack_pop(graph);
411 struct media_graph *graph = &pipe->graph;
417 ret = media_graph_walk_init(&pipe->graph, mdev);
422 media_graph_walk_start(&pipe->graph, entity);
424 while ((entity = media_graph_walk_next(graph))) {
503 * Link validation on graph failed. We revert what we did and
506 media_graph_walk_start(graph, entity_err);
508 while ((entity_err = media_graph_walk_next(graph))) {
526 media_graph_walk_cleanup(graph);
547 struct media_graph *graph = &entity->pipe->graph;
557 media_graph_walk_start(graph, entity);
559 while ((entity = media_graph_walk_next(graph))) {
569 media_graph_walk_cleanup(graph);
682 /* Initialize graph object embedded at the new link */
686 /* Create the backlink. Backlinks are used to help graph traversal and
700 /* Initialize graph object embedded at the new link */
981 /* Initialize graph object embedded at the new link */