Lines Matching full:graph
237 * Graph traversal
250 static void stack_push(struct media_graph *graph, in stack_push() argument
253 if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) { in stack_push()
257 graph->top++; in stack_push()
258 graph->stack[graph->top].link = entity->links.next; in stack_push()
259 graph->stack[graph->top].entity = entity; in stack_push()
262 static struct media_entity *stack_pop(struct media_graph *graph) in stack_pop() argument
266 entity = graph->stack[graph->top].entity; in stack_pop()
267 graph->top--; in stack_pop()
276 * media_graph_walk_init - Allocate resources for graph walk
277 * @graph: Media graph structure that will be used to walk the graph
280 * Reserve resources for graph walk in media device's current
287 struct media_graph *graph, struct media_device *mdev) in media_graph_walk_init() argument
289 return media_entity_enum_init(&graph->ent_enum, mdev); in media_graph_walk_init()
294 * media_graph_walk_cleanup - Release resources related to graph walking
295 * @graph: Media graph structure that was used to walk the graph
297 void media_graph_walk_cleanup(struct media_graph *graph) in media_graph_walk_cleanup() argument
299 media_entity_enum_cleanup(&graph->ent_enum); in media_graph_walk_cleanup()
303 void media_graph_walk_start(struct media_graph *graph, in media_graph_walk_start() argument
306 media_entity_enum_zero(&graph->ent_enum); in media_graph_walk_start()
307 media_entity_enum_set(&graph->ent_enum, entity); in media_graph_walk_start()
309 graph->top = 0; in media_graph_walk_start()
310 graph->stack[graph->top].entity = NULL; in media_graph_walk_start()
311 stack_push(graph, entity); in media_graph_walk_start()
313 "begin graph walk at '%s'\n", entity->name); in media_graph_walk_start()
317 static void media_graph_walk_iter(struct media_graph *graph) in media_graph_walk_iter() argument
319 struct media_entity *entity = stack_top(graph); in media_graph_walk_iter()
323 link = list_entry(link_top(graph), typeof(*link), list); in media_graph_walk_iter()
327 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
339 if (media_entity_enum_test_and_set(&graph->ent_enum, next)) { in media_graph_walk_iter()
340 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
348 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
349 stack_push(graph, next); in media_graph_walk_iter()
354 struct media_entity *media_graph_walk_next(struct media_graph *graph) in media_graph_walk_next() argument
358 if (stack_top(graph) == NULL) in media_graph_walk_next()
366 while (link_top(graph) != &stack_top(graph)->links) in media_graph_walk_next()
367 media_graph_walk_iter(graph); in media_graph_walk_next()
369 entity = stack_pop(graph); in media_graph_walk_next()
420 struct media_graph *graph = &pipe->graph; in __media_pipeline_start() local
426 ret = media_graph_walk_init(&pipe->graph, mdev); in __media_pipeline_start()
431 media_graph_walk_start(&pipe->graph, entity); in __media_pipeline_start()
433 while ((entity = media_graph_walk_next(graph))) { in __media_pipeline_start()
509 * Link validation on graph failed. We revert what we did and in __media_pipeline_start()
512 media_graph_walk_start(graph, entity_err); in __media_pipeline_start()
514 while ((entity_err = media_graph_walk_next(graph))) { in __media_pipeline_start()
532 media_graph_walk_cleanup(graph); in __media_pipeline_start()
553 struct media_graph *graph = &entity->pipe->graph; in __media_pipeline_stop() local
563 media_graph_walk_start(graph, entity); in __media_pipeline_stop()
565 while ((entity = media_graph_walk_next(graph))) { in __media_pipeline_stop()
575 media_graph_walk_cleanup(graph); in __media_pipeline_stop()
684 /* Initialize graph object embedded at the new link */ in media_create_pad_link()
688 /* Create the backlink. Backlinks are used to help graph traversal and in media_create_pad_link()
702 /* Initialize graph object embedded at the new link */ in media_create_pad_link()
983 /* Initialize graph object embedded at the new link */ in media_create_intf_link()