|
@@ -71,7 +71,6 @@ struct vmw_user_fence {
|
|
*/
|
|
*/
|
|
struct vmw_event_fence_action {
|
|
struct vmw_event_fence_action {
|
|
struct vmw_fence_action action;
|
|
struct vmw_fence_action action;
|
|
- struct list_head fpriv_head;
|
|
|
|
|
|
|
|
struct drm_pending_event *event;
|
|
struct drm_pending_event *event;
|
|
struct vmw_fence_obj *fence;
|
|
struct vmw_fence_obj *fence;
|
|
@@ -807,44 +806,6 @@ int vmw_fence_obj_unref_ioctl(struct drm_device *dev, void *data,
|
|
TTM_REF_USAGE);
|
|
TTM_REF_USAGE);
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * vmw_event_fence_fpriv_gone - Remove references to struct drm_file objects
|
|
|
|
- *
|
|
|
|
- * @fman: Pointer to a struct vmw_fence_manager
|
|
|
|
- * @event_list: Pointer to linked list of struct vmw_event_fence_action objects
|
|
|
|
- * with pointers to a struct drm_file object about to be closed.
|
|
|
|
- *
|
|
|
|
- * This function removes all pending fence events with references to a
|
|
|
|
- * specific struct drm_file object about to be closed. The caller is required
|
|
|
|
- * to pass a list of all struct vmw_event_fence_action objects with such
|
|
|
|
- * events attached. This function is typically called before the
|
|
|
|
- * struct drm_file object's event management is taken down.
|
|
|
|
- */
|
|
|
|
-void vmw_event_fence_fpriv_gone(struct vmw_fence_manager *fman,
|
|
|
|
- struct list_head *event_list)
|
|
|
|
-{
|
|
|
|
- struct vmw_event_fence_action *eaction;
|
|
|
|
- struct drm_pending_event *event;
|
|
|
|
- unsigned long irq_flags;
|
|
|
|
-
|
|
|
|
- while (1) {
|
|
|
|
- spin_lock_irqsave(&fman->lock, irq_flags);
|
|
|
|
- if (list_empty(event_list))
|
|
|
|
- goto out_unlock;
|
|
|
|
- eaction = list_first_entry(event_list,
|
|
|
|
- struct vmw_event_fence_action,
|
|
|
|
- fpriv_head);
|
|
|
|
- list_del_init(&eaction->fpriv_head);
|
|
|
|
- event = eaction->event;
|
|
|
|
- eaction->event = NULL;
|
|
|
|
- spin_unlock_irqrestore(&fman->lock, irq_flags);
|
|
|
|
- event->destroy(event);
|
|
|
|
- }
|
|
|
|
-out_unlock:
|
|
|
|
- spin_unlock_irqrestore(&fman->lock, irq_flags);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* vmw_event_fence_action_seq_passed
|
|
* vmw_event_fence_action_seq_passed
|
|
*
|
|
*
|
|
@@ -879,7 +840,6 @@ static void vmw_event_fence_action_seq_passed(struct vmw_fence_action *action)
|
|
*eaction->tv_usec = tv.tv_usec;
|
|
*eaction->tv_usec = tv.tv_usec;
|
|
}
|
|
}
|
|
|
|
|
|
- list_del_init(&eaction->fpriv_head);
|
|
|
|
drm_send_event_locked(dev, eaction->event);
|
|
drm_send_event_locked(dev, eaction->event);
|
|
eaction->event = NULL;
|
|
eaction->event = NULL;
|
|
spin_unlock_irqrestore(&dev->event_lock, irq_flags);
|
|
spin_unlock_irqrestore(&dev->event_lock, irq_flags);
|
|
@@ -898,12 +858,6 @@ static void vmw_event_fence_action_cleanup(struct vmw_fence_action *action)
|
|
{
|
|
{
|
|
struct vmw_event_fence_action *eaction =
|
|
struct vmw_event_fence_action *eaction =
|
|
container_of(action, struct vmw_event_fence_action, action);
|
|
container_of(action, struct vmw_event_fence_action, action);
|
|
- struct vmw_fence_manager *fman = fman_from_fence(eaction->fence);
|
|
|
|
- unsigned long irq_flags;
|
|
|
|
-
|
|
|
|
- spin_lock_irqsave(&fman->lock, irq_flags);
|
|
|
|
- list_del(&eaction->fpriv_head);
|
|
|
|
- spin_unlock_irqrestore(&fman->lock, irq_flags);
|
|
|
|
|
|
|
|
vmw_fence_obj_unreference(&eaction->fence);
|
|
vmw_fence_obj_unreference(&eaction->fence);
|
|
kfree(eaction);
|
|
kfree(eaction);
|
|
@@ -983,8 +937,6 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv,
|
|
{
|
|
{
|
|
struct vmw_event_fence_action *eaction;
|
|
struct vmw_event_fence_action *eaction;
|
|
struct vmw_fence_manager *fman = fman_from_fence(fence);
|
|
struct vmw_fence_manager *fman = fman_from_fence(fence);
|
|
- struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv);
|
|
|
|
- unsigned long irq_flags;
|
|
|
|
|
|
|
|
eaction = kzalloc(sizeof(*eaction), GFP_KERNEL);
|
|
eaction = kzalloc(sizeof(*eaction), GFP_KERNEL);
|
|
if (unlikely(eaction == NULL))
|
|
if (unlikely(eaction == NULL))
|
|
@@ -1001,10 +953,6 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv,
|
|
eaction->tv_sec = tv_sec;
|
|
eaction->tv_sec = tv_sec;
|
|
eaction->tv_usec = tv_usec;
|
|
eaction->tv_usec = tv_usec;
|
|
|
|
|
|
- spin_lock_irqsave(&fman->lock, irq_flags);
|
|
|
|
- list_add_tail(&eaction->fpriv_head, &vmw_fp->fence_events);
|
|
|
|
- spin_unlock_irqrestore(&fman->lock, irq_flags);
|
|
|
|
-
|
|
|
|
vmw_fence_obj_add_action(fence, &eaction->action);
|
|
vmw_fence_obj_add_action(fence, &eaction->action);
|
|
|
|
|
|
return 0;
|
|
return 0;
|