Lines Matching refs:graph

292 static void stack_push(struct media_graph *graph,  in stack_push()  argument
295 if (graph->top == MEDIA_ENTITY_ENUM_MAX_DEPTH - 1) { in stack_push()
299 graph->top++; in stack_push()
300 graph->stack[graph->top].link = entity->links.next; in stack_push()
301 graph->stack[graph->top].entity = entity; in stack_push()
304 static struct media_entity *stack_pop(struct media_graph *graph) in stack_pop() argument
308 entity = graph->stack[graph->top].entity; in stack_pop()
309 graph->top--; in stack_pop()
329 struct media_graph *graph, struct media_device *mdev) in media_graph_walk_init() argument
331 return media_entity_enum_init(&graph->ent_enum, mdev); in media_graph_walk_init()
339 void media_graph_walk_cleanup(struct media_graph *graph) in media_graph_walk_cleanup() argument
341 media_entity_enum_cleanup(&graph->ent_enum); in media_graph_walk_cleanup()
345 void media_graph_walk_start(struct media_graph *graph, in media_graph_walk_start() argument
348 media_entity_enum_zero(&graph->ent_enum); in media_graph_walk_start()
349 media_entity_enum_set(&graph->ent_enum, entity); in media_graph_walk_start()
351 graph->top = 0; in media_graph_walk_start()
352 graph->stack[graph->top].entity = NULL; in media_graph_walk_start()
353 stack_push(graph, entity); in media_graph_walk_start()
359 static void media_graph_walk_iter(struct media_graph *graph) in media_graph_walk_iter() argument
361 struct media_entity *entity = stack_top(graph); in media_graph_walk_iter()
365 link = list_entry(link_top(graph), typeof(*link), list); in media_graph_walk_iter()
369 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
375 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
387 if (media_entity_enum_test_and_set(&graph->ent_enum, next)) { in media_graph_walk_iter()
388 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
396 link_top(graph) = link_top(graph)->next; in media_graph_walk_iter()
397 stack_push(graph, next); in media_graph_walk_iter()
403 struct media_entity *media_graph_walk_next(struct media_graph *graph) in media_graph_walk_next() argument
407 if (stack_top(graph) == NULL) in media_graph_walk_next()
415 while (link_top(graph) != &stack_top(graph)->links) in media_graph_walk_next()
416 media_graph_walk_iter(graph); in media_graph_walk_next()
418 entity = stack_pop(graph); in media_graph_walk_next()