| .. | .. |
|---|
| 25 | 25 | * |
|---|
| 26 | 26 | **************************************************************************/ |
|---|
| 27 | 27 | |
|---|
| 28 | | -#include <drm/drmP.h> |
|---|
| 28 | +#include <linux/sched/signal.h> |
|---|
| 29 | + |
|---|
| 29 | 30 | #include "vmwgfx_drv.h" |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | #define VMW_FENCE_WRAP (1 << 31) |
|---|
| .. | .. |
|---|
| 184 | 185 | |
|---|
| 185 | 186 | spin_lock(f->lock); |
|---|
| 186 | 187 | |
|---|
| 188 | + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &f->flags)) |
|---|
| 189 | + goto out; |
|---|
| 190 | + |
|---|
| 187 | 191 | if (intr && signal_pending(current)) { |
|---|
| 188 | 192 | ret = -ERESTARTSYS; |
|---|
| 189 | 193 | goto out; |
|---|
| .. | .. |
|---|
| 306 | 310 | INIT_LIST_HEAD(&fman->cleanup_list); |
|---|
| 307 | 311 | INIT_WORK(&fman->work, &vmw_fence_work_func); |
|---|
| 308 | 312 | fman->fifo_down = true; |
|---|
| 309 | | - fman->user_fence_size = ttm_round_pot(sizeof(struct vmw_user_fence)); |
|---|
| 313 | + fman->user_fence_size = ttm_round_pot(sizeof(struct vmw_user_fence)) + |
|---|
| 314 | + TTM_OBJ_EXTRA_SIZE; |
|---|
| 310 | 315 | fman->fence_size = ttm_round_pot(sizeof(struct vmw_fence_obj)); |
|---|
| 311 | 316 | fman->event_fence_action_size = |
|---|
| 312 | 317 | ttm_round_pot(sizeof(struct vmw_event_fence_action)); |
|---|
| .. | .. |
|---|
| 510 | 515 | struct vmw_fence_manager *fman = fman_from_fence(fence); |
|---|
| 511 | 516 | |
|---|
| 512 | 517 | if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->base.flags)) |
|---|
| 513 | | - return 1; |
|---|
| 518 | + return true; |
|---|
| 514 | 519 | |
|---|
| 515 | 520 | vmw_fences_update(fman); |
|---|
| 516 | 521 | |
|---|
| .. | .. |
|---|
| 650 | 655 | } |
|---|
| 651 | 656 | |
|---|
| 652 | 657 | *p_fence = &ufence->fence; |
|---|
| 653 | | - *p_handle = ufence->base.hash.key; |
|---|
| 658 | + *p_handle = ufence->base.handle; |
|---|
| 654 | 659 | |
|---|
| 655 | 660 | return 0; |
|---|
| 656 | 661 | out_err: |
|---|
| .. | .. |
|---|
| 905 | 910 | container_of(action, struct vmw_event_fence_action, action); |
|---|
| 906 | 911 | struct drm_device *dev = eaction->dev; |
|---|
| 907 | 912 | struct drm_pending_event *event = eaction->event; |
|---|
| 908 | | - struct drm_file *file_priv; |
|---|
| 909 | | - |
|---|
| 910 | 913 | |
|---|
| 911 | 914 | if (unlikely(event == NULL)) |
|---|
| 912 | 915 | return; |
|---|
| 913 | 916 | |
|---|
| 914 | | - file_priv = event->file_priv; |
|---|
| 915 | 917 | spin_lock_irq(&dev->event_lock); |
|---|
| 916 | 918 | |
|---|
| 917 | 919 | if (likely(eaction->tv_sec != NULL)) { |
|---|
| .. | .. |
|---|
| 1137 | 1139 | "object.\n"); |
|---|
| 1138 | 1140 | goto out_no_ref_obj; |
|---|
| 1139 | 1141 | } |
|---|
| 1140 | | - handle = base->hash.key; |
|---|
| 1142 | + handle = base->handle; |
|---|
| 1141 | 1143 | } |
|---|
| 1142 | 1144 | ttm_base_object_unref(&base); |
|---|
| 1143 | 1145 | } |
|---|