impl-node: rename passive to runnable

Rename passive to runnable because we are using this variable to
determine if a node is runnable or not.
This commit is contained in:
Wim Taymans 2023-03-08 13:28:41 +01:00
parent 92a812e0ae
commit c04b3b3261
3 changed files with 19 additions and 19 deletions

View file

@ -794,9 +794,9 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *node,
spa_list_consume(n, &queue, sort_link) { spa_list_consume(n, &queue, sort_link) {
spa_list_remove(&n->sort_link); spa_list_remove(&n->sort_link);
spa_list_append(collect, &n->sort_link); spa_list_append(collect, &n->sort_link);
n->passive = !n->always_process; n->runnable = n->always_process;
pw_log_debug(" next node %p: '%s' passive:%u", n, n->name, n->passive); pw_log_debug(" next node %p: '%s' runnable:%u", n, n->name, n->runnable);
if (!n->active) if (!n->active)
continue; continue;
@ -814,7 +814,7 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *node,
continue; continue;
if (!l->passive) if (!l->passive)
n->passive = false; n->runnable = true;
if (!t->visited) { if (!t->visited) {
t->visited = true; t->visited = true;
@ -835,7 +835,7 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *node,
continue; continue;
if (!l->passive) if (!l->passive)
n->passive = false; n->runnable = true;
if (!t->visited) { if (!t->visited) {
t->visited = true; t->visited = true;
@ -865,13 +865,13 @@ static void move_to_driver(struct pw_context *context, struct spa_list *nodes,
struct pw_impl_node *driver) struct pw_impl_node *driver)
{ {
struct pw_impl_node *n; struct pw_impl_node *n;
pw_log_debug("driver: %p %s", driver, driver->name); pw_log_debug("driver: %p %s runnable:%u", driver, driver->name, driver->runnable);
spa_list_consume(n, nodes, sort_link) { spa_list_consume(n, nodes, sort_link) {
spa_list_remove(&n->sort_link); spa_list_remove(&n->sort_link);
if (!n->passive) if (n->runnable)
driver->passive = false; driver->runnable = true;
pw_log_debug(" follower: %p %s passive:%u driver-passive:%u", n, n->name, pw_log_debug(" follower: %p %s runnable:%u driver-runnable:%u", n, n->name,
n->passive, driver->passive); n->runnable, driver->runnable);
pw_impl_node_set_driver(n, driver); pw_impl_node_set_driver(n, driver);
} }
} }
@ -1133,7 +1133,7 @@ again:
if (fallback == NULL) if (fallback == NULL)
fallback = n; fallback = n;
if (n->passive) if (!n->runnable)
continue; continue;
spa_list_for_each(s, &n->follower_list, follower_link) { spa_list_for_each(s, &n->follower_list, follower_link) {
@ -1179,7 +1179,7 @@ again:
driver = NULL; driver = NULL;
spa_list_for_each(t, &collect, sort_link) { spa_list_for_each(t, &collect, sort_link) {
/* is any active and want a driver */ /* is any active and want a driver */
if (t->want_driver && t->active && !t->passive) { if (t->want_driver && t->active && t->runnable) {
driver = target; driver = target;
break; break;
} }
@ -1267,10 +1267,10 @@ again:
rate = s->rate; rate = s->rate;
if (s->active) if (s->active)
running = !n->passive; running = n->runnable;
pw_log_debug("%p: follower %p running:%d passive:%d rate:%u/%u latency %u/%u '%s'", pw_log_debug("%p: follower %p running:%d runnable:%d rate:%u/%u latency %u/%u '%s'",
context, s, running, s->passive, rate.num, rate.denom, context, s, running, s->runnable, rate.num, rate.denom,
latency.num, latency.denom, s->name); latency.num, latency.denom, s->name);
s->moved = false; s->moved = false;
@ -1379,8 +1379,8 @@ again:
n->current_pending = false; n->current_pending = false;
} }
pw_log_debug("%p: driver %p running:%d passive:%d quantum:%u '%s'", pw_log_debug("%p: driver %p running:%d runnable:%d quantum:%u '%s'",
context, n, running, n->passive, quantum, n->name); context, n, running, n->runnable, quantum, n->name);
/* first change the node states of the followers to the new target */ /* first change the node states of the followers to the new target */
spa_list_for_each(s, &n->follower_list, follower_link) { spa_list_for_each(s, &n->follower_list, follower_link) {

View file

@ -759,9 +759,9 @@ int pw_impl_link_prepare(struct pw_impl_link *this)
{ {
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
pw_log_debug("%p: prepared:%d preparing:%d in_active:%d out_active:%d", pw_log_debug("%p: prepared:%d preparing:%d in_active:%d out_active:%d passive:%u",
this, this->prepared, this->preparing, this, this->prepared, this->preparing,
impl->inode->active, impl->onode->active); impl->inode->active, impl->onode->active, this->passive);
if (!impl->inode->active || !impl->onode->active) if (!impl->inode->active || !impl->onode->active)
return 0; return 0;

View file

@ -686,7 +686,7 @@ struct pw_impl_node {
* is selected to drive the graph */ * is selected to drive the graph */
unsigned int visited:1; /**< for sorting */ unsigned int visited:1; /**< for sorting */
unsigned int want_driver:1; /**< this node wants to be assigned to a driver */ unsigned int want_driver:1; /**< this node wants to be assigned to a driver */
unsigned int passive:1; /**< driver graph only has passive links */ unsigned int runnable:1; /**< node is runnable */
unsigned int freewheel:1; /**< if this is the freewheel driver */ unsigned int freewheel:1; /**< if this is the freewheel driver */
unsigned int loopchecked:1; /**< for feedback loop checking */ unsigned int loopchecked:1; /**< for feedback loop checking */
unsigned int always_process:1; /**< this node wants to always be processing, even when idle */ unsigned int always_process:1; /**< this node wants to always be processing, even when idle */