diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-22 22:51:49 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-22 22:51:49 -0400 |
| commit | d8524ae9d6f492a9c6db9f4d89c5f9b8782fa2d5 (patch) | |
| tree | 18c9f6fbf80000e8be35b593d8008e904c9036b5 | |
| parent | 68cf8d0c720cdb76dc912c983d8dae9de6d6e5cf (diff) | |
| parent | 6ddf2ed6e00396883b3123032ccb4416205aac7c (diff) | |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
- some small fixes for msm and exynos
- a regression revert affecting nouveau users with old userspace
- intel pageflip deadlock and gpu hang fixes, hsw modesetting hangs
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits)
Revert "drm: mark context support as a legacy subsystem"
drm/i915: Don't enable the cursor on a disable pipe
drm/i915: do not update cursor in crtc mode set
drm/exynos: fix return value check in lowlevel_buffer_allocate()
drm/exynos: Fix address space warnings in exynos_drm_fbdev.c
drm/exynos: Fix address space warning in exynos_drm_buf.c
drm/exynos: Remove redundant OF dependency
drm/msm: drop unnecessary set_need_resched()
drm/i915: kill set_need_resched
drm/msm: fix potential NULL pointer dereference
drm/i915/dvo: set crtc timings again for panel fixed modes
drm/i915/sdvo: Robustify the dtd<->drm_mode conversions
drm/msm: workaround for missing irq
drm/msm: return -EBUSY if bo still active
drm/msm: fix return value check in ERR_PTR()
drm/msm: fix cmdstream size check
drm/msm: hangcheck harder
drm/msm: handle read vs write fences
drm/i915/sdvo: Fully translate sync flags in the dtd->mode conversion
drm/i915: Use proper print format for debug prints
...
23 files changed, 276 insertions, 197 deletions
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index b4fb86d89850..224ff965bcf7 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c | |||
| @@ -42,6 +42,10 @@ | |||
| 42 | 42 | ||
| 43 | #include <drm/drmP.h> | 43 | #include <drm/drmP.h> |
| 44 | 44 | ||
| 45 | /******************************************************************/ | ||
| 46 | /** \name Context bitmap support */ | ||
| 47 | /*@{*/ | ||
| 48 | |||
| 45 | /** | 49 | /** |
| 46 | * Free a handle from the context bitmap. | 50 | * Free a handle from the context bitmap. |
| 47 | * | 51 | * |
| @@ -52,48 +56,13 @@ | |||
| 52 | * in drm_device::ctx_idr, while holding the drm_device::struct_mutex | 56 | * in drm_device::ctx_idr, while holding the drm_device::struct_mutex |
| 53 | * lock. | 57 | * lock. |
| 54 | */ | 58 | */ |
| 55 | static void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle) | 59 | void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle) |
| 56 | { | 60 | { |
| 57 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 58 | return; | ||
| 59 | |||
| 60 | mutex_lock(&dev->struct_mutex); | 61 | mutex_lock(&dev->struct_mutex); |
| 61 | idr_remove(&dev->ctx_idr, ctx_handle); | 62 | idr_remove(&dev->ctx_idr, ctx_handle); |
| 62 | mutex_unlock(&dev->struct_mutex); | 63 | mutex_unlock(&dev->struct_mutex); |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | /******************************************************************/ | ||
| 66 | /** \name Context bitmap support */ | ||
| 67 | /*@{*/ | ||
| 68 | |||
| 69 | void drm_legacy_ctxbitmap_release(struct drm_device *dev, | ||
| 70 | struct drm_file *file_priv) | ||
| 71 | { | ||
| 72 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 73 | return; | ||
| 74 | |||
| 75 | mutex_lock(&dev->ctxlist_mutex); | ||
| 76 | if (!list_empty(&dev->ctxlist)) { | ||
| 77 | struct drm_ctx_list *pos, *n; | ||
| 78 | |||
| 79 | list_for_each_entry_safe(pos, n, &dev->ctxlist, head) { | ||
| 80 | if (pos->tag == file_priv && | ||
| 81 | pos->handle != DRM_KERNEL_CONTEXT) { | ||
| 82 | if (dev->driver->context_dtor) | ||
| 83 | dev->driver->context_dtor(dev, | ||
| 84 | pos->handle); | ||
| 85 | |||
| 86 | drm_ctxbitmap_free(dev, pos->handle); | ||
| 87 | |||
| 88 | list_del(&pos->head); | ||
| 89 | kfree(pos); | ||
| 90 | --dev->ctx_count; | ||
| 91 | } | ||
| 92 | } | ||
| 93 | } | ||
| 94 | mutex_unlock(&dev->ctxlist_mutex); | ||
| 95 | } | ||
| 96 | |||
| 97 | /** | 66 | /** |
| 98 | * Context bitmap allocation. | 67 | * Context bitmap allocation. |
| 99 | * | 68 | * |
| @@ -121,12 +90,10 @@ static int drm_ctxbitmap_next(struct drm_device * dev) | |||
| 121 | * | 90 | * |
| 122 | * Initialise the drm_device::ctx_idr | 91 | * Initialise the drm_device::ctx_idr |
| 123 | */ | 92 | */ |
| 124 | void drm_legacy_ctxbitmap_init(struct drm_device * dev) | 93 | int drm_ctxbitmap_init(struct drm_device * dev) |
| 125 | { | 94 | { |
| 126 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 127 | return; | ||
| 128 | |||
| 129 | idr_init(&dev->ctx_idr); | 95 | idr_init(&dev->ctx_idr); |
| 96 | return 0; | ||
| 130 | } | 97 | } |
| 131 | 98 | ||
| 132 | /** | 99 | /** |
| @@ -137,7 +104,7 @@ void drm_legacy_ctxbitmap_init(struct drm_device * dev) | |||
| 137 | * Free all idr members using drm_ctx_sarea_free helper function | 104 | * Free all idr members using drm_ctx_sarea_free helper function |
| 138 | * while holding the drm_device::struct_mutex lock. | 105 | * while holding the drm_device::struct_mutex lock. |
| 139 | */ | 106 | */ |
| 140 | void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev) | 107 | void drm_ctxbitmap_cleanup(struct drm_device * dev) |
| 141 | { | 108 | { |
| 142 | mutex_lock(&dev->struct_mutex); | 109 | mutex_lock(&dev->struct_mutex); |
| 143 | idr_destroy(&dev->ctx_idr); | 110 | idr_destroy(&dev->ctx_idr); |
| @@ -169,9 +136,6 @@ int drm_getsareactx(struct drm_device *dev, void *data, | |||
| 169 | struct drm_local_map *map; | 136 | struct drm_local_map *map; |
| 170 | struct drm_map_list *_entry; | 137 | struct drm_map_list *_entry; |
| 171 | 138 | ||
| 172 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 173 | return -EINVAL; | ||
| 174 | |||
| 175 | mutex_lock(&dev->struct_mutex); | 139 | mutex_lock(&dev->struct_mutex); |
| 176 | 140 | ||
| 177 | map = idr_find(&dev->ctx_idr, request->ctx_id); | 141 | map = idr_find(&dev->ctx_idr, request->ctx_id); |
| @@ -216,9 +180,6 @@ int drm_setsareactx(struct drm_device *dev, void *data, | |||
| 216 | struct drm_local_map *map = NULL; | 180 | struct drm_local_map *map = NULL; |
| 217 | struct drm_map_list *r_list = NULL; | 181 | struct drm_map_list *r_list = NULL; |
| 218 | 182 | ||
| 219 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 220 | return -EINVAL; | ||
| 221 | |||
| 222 | mutex_lock(&dev->struct_mutex); | 183 | mutex_lock(&dev->struct_mutex); |
| 223 | list_for_each_entry(r_list, &dev->maplist, head) { | 184 | list_for_each_entry(r_list, &dev->maplist, head) { |
| 224 | if (r_list->map | 185 | if (r_list->map |
| @@ -319,9 +280,6 @@ int drm_resctx(struct drm_device *dev, void *data, | |||
| 319 | struct drm_ctx ctx; | 280 | struct drm_ctx ctx; |
| 320 | int i; | 281 | int i; |
| 321 | 282 | ||
| 322 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 323 | return -EINVAL; | ||
| 324 | |||
| 325 | if (res->count >= DRM_RESERVED_CONTEXTS) { | 283 | if (res->count >= DRM_RESERVED_CONTEXTS) { |
| 326 | memset(&ctx, 0, sizeof(ctx)); | 284 | memset(&ctx, 0, sizeof(ctx)); |
| 327 | for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { | 285 | for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { |
| @@ -352,9 +310,6 @@ int drm_addctx(struct drm_device *dev, void *data, | |||
| 352 | struct drm_ctx_list *ctx_entry; | 310 | struct drm_ctx_list *ctx_entry; |
| 353 | struct drm_ctx *ctx = data; | 311 | struct drm_ctx *ctx = data; |
| 354 | 312 | ||
| 355 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 356 | return -EINVAL; | ||
| 357 | |||
| 358 | ctx->handle = drm_ctxbitmap_next(dev); | 313 | ctx->handle = drm_ctxbitmap_next(dev); |
| 359 | if (ctx->handle == DRM_KERNEL_CONTEXT) { | 314 | if (ctx->handle == DRM_KERNEL_CONTEXT) { |
| 360 | /* Skip kernel's context and get a new one. */ | 315 | /* Skip kernel's context and get a new one. */ |
| @@ -398,9 +353,6 @@ int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
| 398 | { | 353 | { |
| 399 | struct drm_ctx *ctx = data; | 354 | struct drm_ctx *ctx = data; |
| 400 | 355 | ||
| 401 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 402 | return -EINVAL; | ||
| 403 | |||
| 404 | /* This is 0, because we don't handle any context flags */ | 356 | /* This is 0, because we don't handle any context flags */ |
| 405 | ctx->flags = 0; | 357 | ctx->flags = 0; |
| 406 | 358 | ||
| @@ -423,9 +375,6 @@ int drm_switchctx(struct drm_device *dev, void *data, | |||
| 423 | { | 375 | { |
| 424 | struct drm_ctx *ctx = data; | 376 | struct drm_ctx *ctx = data; |
| 425 | 377 | ||
