Lines Matching full:graph
226 * Graph traversal
279 static void stack_push(struct media_graph *graph, in stack_push() argument
282 if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) { in stack_push()
286 graph->top++; in stack_push()
287 graph->stack[graph->top].link = entity->links.next; in stack_push()
288 graph->stack[graph->top].entity = entity; in stack_push()
291 static struct media_entity *stack_pop(struct media_graph *graph) in stack_pop() argument
295 entity = graph->stack[graph->top].entity; in stack_pop()
296 graph->top--; in stack_pop()
305 * media_graph_walk_init - Allocate resources for graph walk
306 * @graph: Media graph structure that will be used to walk the graph
309 * Reserve resources for graph walk in media device's current
316 struct media_graph *graph, struct media_device *mdev) in media_graph_walk_init() argument
318 return media_entity_enum_init(&graph->ent_enum, mdev); in media_graph_walk_init()
323 * media_graph_walk_cleanup - Release resources related to graph walking
324 * @graph: Media graph structure that was used to walk the graph
326 void media_graph_walk_cleanup(struct media_graph *graph) in media_graph_walk_cleanup() argument
328 media_entity_enum_cleanup(&graph->ent_enum); in media_graph_walk_cleanup()
332 void media_graph_walk_start(struct media_graph *graph, in media_graph_walk_start() argument
335 media_entity_enum_zero(&graph->ent_enum); in media_graph_walk_start()
336 media_entity_enum_set(&graph->ent_enum, entity); in media_graph_walk_start()
338 graph->top = 0; in media_graph_walk_start()
339 graph->stack[graph->top].entity = NULL; in media_graph_walk_start()
340 stack_push(graph, entity); in media_graph_walk_start()
342 "begin graph walk at '%s'\n", entity->name); in media_graph_walk_start()
346 static void media_graph_walk_iter(struct media_graph *graph) in media_graph_walk_iter() argument
348 struct media_entity *entity = stack_top(graph); in media_graph_walk_iter()
352 link = list_entry(link_top(graph), typeof(*link), list); in media_graph_walk_iter()
356 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
362 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
374 if (media_entity_enum_test_and_set(&graph->ent_enum, next)) { in media_graph_walk_iter()
375 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
383 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
384 stack_push(graph, next); in media_graph_walk_iter()
390 struct media_entity *media_graph_walk_next(struct media_graph *graph) in media_graph_walk_next() argument
394 if (stack_top(graph) == NULL) in media_graph_walk_next()
402 while (link_top(graph) != &stack_top(graph)->links) in media_graph_walk_next()
403 media_graph_walk_iter(graph); in media_graph_walk_next()
405 entity = stack_pop(graph); in media_graph_walk_next()
418 * The pipeline traversal stack stores pads that are reached during graph
424 * internal pad dependencies in the entity, and then links in the graph. It
713 * Populate the media pipeline by walking the media graph, starting in media_pipeline_populate()
786 * with media_pipeline_pad instances for each pad found during graph in __media_pipeline_start()
887 * Link validation on graph failed. We revert what we did and in __media_pipeline_start()
1147 /* Initialize graph object embedded at the new link */ in media_create_pad_link()
1151 /* Create the backlink. Backlinks are used to help graph traversal and in media_create_pad_link()
1165 /* Initialize graph object embedded at the new link */ in media_create_pad_link()
1573 /* Initialize graph object embedded at the new link */ in media_create_intf_link()
1641 /* Initialize graph object embedded in the new link */ in media_create_ancillary_link()