Rev 7144 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7144 | Rev 7173 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | static void __stdcall restore_cursor(int x, int y){}; |
59 | static void __stdcall restore_cursor(int x, int y){}; |
60 | static void disable_mouse(void){}; |
60 | static void disable_mouse(void){}; |
Line 61... | Line 61... | ||
61 | 61 | ||
62 | static void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor) |
62 | static void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor) |
- | 63 | { |
|
63 | { |
64 | struct drm_i915_private *dev_priv = main_device->dev_private; |
- | 65 | struct drm_i915_gem_object *obj = cursor->cobj; |
|
- | 66 | u32 ifl; |
|
- | 67 | ||
64 | struct drm_i915_gem_object *obj = cursor->cobj; |
68 | ifl = safe_cli(); |
- | 69 | list_del(&cursor->list); |
|
Line -... | Line 70... | ||
- | 70 | safe_sti(ifl); |
|
- | 71 | ||
65 | list_del(&cursor->list); |
72 | if (!dev_priv->info.cursor_needs_physical) |
Line 66... | Line 73... | ||
66 | 73 | { |
|
67 | i915_gem_object_ggtt_unpin(cursor->cobj); |
74 | i915_gem_object_ggtt_unpin(cursor->cobj); |
68 | 75 | ||
- | 76 | mutex_lock(&main_device->struct_mutex); |
|
- | 77 | drm_gem_object_unreference(&obj->base); |
|
- | 78 | mutex_unlock(&main_device->struct_mutex); |
|
- | 79 | } |
|
- | 80 | else |
|
- | 81 | { |
|
- | 82 | addr_t page = (addr_t)obj; |
|
Line 69... | Line 83... | ||
69 | mutex_lock(&main_device->struct_mutex); |
83 | for(addr_t i = 0; i < (KMS_CURSOR_WIDTH*KMS_CURSOR_HEIGHT*8)/4096; i+=4096) |
70 | drm_gem_object_unreference(&obj->base); |
84 | FreePage(page+i); |
Line 71... | Line 85... | ||
71 | mutex_unlock(&main_device->struct_mutex); |
85 | } |
Line 88... | Line 102... | ||
88 | 102 | ||
Line 89... | Line 103... | ||
89 | mutex_lock(&dev->struct_mutex); |
103 | mutex_lock(&dev->struct_mutex); |
90 | 104 | ||
91 | if (dev_priv->info.cursor_needs_physical) |
105 | if (dev_priv->info.cursor_needs_physical) |
92 | { |
106 | { |
93 | bits = (uint32_t*)KernelAlloc(KMS_CURSOR_WIDTH*KMS_CURSOR_HEIGHT*8); |
107 | mapped = bits = (uint32_t*)KernelAlloc(KMS_CURSOR_WIDTH*KMS_CURSOR_HEIGHT*8); |
94 | if (unlikely(bits == NULL)) |
108 | if (unlikely(bits == NULL)) |
95 | { |
109 | { |
96 | ret = -ENOMEM; |
110 | ret = -ENOMEM; |