summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2013-07-04 20:28:14 (GMT)
committerVivek Dasmohapatra <vivek@collabora.co.uk>2013-07-04 20:28:14 (GMT)
commit9b1bba3c690c26f43cfab82446d805795162e60f (patch)
tree335d7982383bd220dcfc1d0fc8733b722d342a79
parent91342c71e4d6f898916fe4b93d037cd08a11c8d3 (diff)
downloadi915-3.9-3.8-ubuntu-9b1bba3c690c26f43cfab82446d805795162e60f.tar.gz
i915-3.9-3.8-ubuntu-9b1bba3c690c26f43cfab82446d805795162e60f.tar.xz
Fixed some idr related bugs introduced during the backport
-rw-r--r--drivers/gpu/drm/drm_gem.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c6
-rw-r--r--drivers/gpu/drm/i915/i915_trace_points.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index f58ab3a..0a8620e 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -563,6 +563,8 @@ drm_gem_release(struct drm_device *dev, struct drm_file *file_private)
{
idr_for_each(&file_private->object_idr,
&drm_gem_object_release_handle, file_private);
+
+ idr_remove_all(&file_private->object_idr);
idr_destroy(&file_private->object_idr);
}
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index adf2817..28f80b5 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -128,8 +128,13 @@ static int get_context_size(struct drm_device *dev)
static void do_destroy(struct i915_hw_context *ctx)
{
+ struct drm_device *dev = ctx->obj->base.dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+
if (ctx->file_priv)
idr_remove(&ctx->file_priv->context_idr, ctx->id);
+ else
+ WARN_ON(ctx != dev_priv->ring[RCS].default_context);
drm_gem_object_unreference(&ctx->obj->base);
kfree(ctx);
@@ -189,7 +194,6 @@ again:
goto again;
else if (ret)
goto err_out;
- ctx->id = ret;
return ctx;
diff --git a/drivers/gpu/drm/i915/i915_trace_points.c b/drivers/gpu/drm/i915/i915_trace_points.c
index 2f5a40d..05120f3 100644
--- a/drivers/gpu/drm/i915/i915_trace_points.c
+++ b/drivers/gpu/drm/i915/i915_trace_points.c
@@ -11,5 +11,6 @@
#define CREATE_TRACE_POINTS
#include "i915_trace.h"
-#include "backport-check.h"
#endif
+
+#include "backport-check.h"