search for: nouveau_event_handler_destroy

Displaying 5 results from an estimated 5 matches for "nouveau_event_handler_destroy".

2013 Aug 27
0
[PATCH 3/9] drm/nouveau: Allocate local event handlers
...*priv, struct nouveau_eventh **phandler) +{ + struct nouveau_eventh *handler; + + handler = *phandler = kzalloc(sizeof(*handler), GFP_KERNEL); + if (!handler) + return -ENOMEM; + handler->func = func; + handler->priv = priv; + nouveau_event_get(event, index, handler); + return 0; +} + +void +nouveau_event_handler_destroy(struct nouveau_event *event, int index, + struct nouveau_eventh *handler) +{ + nouveau_event_put(event, index, handler); + kfree(handler); +} + static void nouveau_event_put_locked(struct nouveau_event *event, int index, struct nouveau_eventh *handler) diff --git a/drivers/gpu/drm/no...
2013 Aug 27
11
[PATCH 0/9] drm/nouveau: Cleanup event/handler design
This series was originally motivated by a deadlock, introduced in commit 1d7c71a3e2f77336df536855b0efd2dc5bdeb41b 'drm/nouveau/disp: port vblank handling to event interface', due to inverted lock order between nouveau_drm_vblank_enable() and nouveau_drm_vblank_handler() (the complete lockdep report is included in the patch 4/5 changelog). Because this series fixes the vblank event
2013 Aug 27
0
[PATCH 5/9] drm/nouveau: Add install/remove semantics for event handlers
...(&event->lock, flags); + list_add(&handler->head, &event->index[index].list); + if (!event->index[index].refs++) { + if (event->enable) + event->enable(event, index); + } + spin_unlock_irqrestore(&event->lock, flags); return 0; } @@ -43,7 +84,18 @@ void nouveau_event_handler_destroy(struct nouveau_event *event, int index, struct nouveau_eventh *handler) { - nouveau_event_put(event, index, handler); + unsigned long flags; + + if (index >= event->index_nr) + return; + + spin_lock_irqsave(&event->lock, flags); + if (!--event->index[index].refs) { + if...
2013 Aug 27
0
[PATCH 7/9] drm/nouveau: Fold nouveau_event_put_locked into caller
...-- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/core/event.c b/drivers/gpu/drm/nouveau/core/core/event.c index ce0a0ef..45bcb37 100644 --- a/drivers/gpu/drm/nouveau/core/core/event.c +++ b/drivers/gpu/drm/nouveau/core/core/event.c @@ -100,18 +100,6 @@ nouveau_event_handler_destroy(struct nouveau_event *event, int index, kfree_rcu(handler, rcu); } -static void -nouveau_event_put_locked(struct nouveau_event *event, int index, - struct nouveau_eventh *handler) -{ - if (__test_and_clear_bit(NVKM_EVENT_ENABLE, &handler->flags)) { - if (!--event->index[index].re...
2013 Aug 27
0
[PATCH 6/9] drm/nouveau: Convert event handler list to RCU
...k_irqsave(&event->lock, flags); - list_add(&handler->head, &event->index[index].list); + list_add_rcu(&handler->head, &event->index[index].list); if (!event->index[index].refs++) { if (event->enable) event->enable(event, index); @@ -94,9 +95,9 @@ nouveau_event_handler_destroy(struct nouveau_event *event, int index, if (event->disable) event->disable(event, index); } - list_del(&handler->head); + list_del_rcu(&handler->head); spin_unlock_irqrestore(&event->lock, flags); - kfree(handler); + kfree_rcu(handler, rcu); } static void @...