Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250597
b: refs/heads/master
c: 2c34b85
h: refs/heads/master
i:
  250595: 30259aa
v: v3
  • Loading branch information
Ben Widawsky authored and Keith Packard committed May 10, 2011
1 parent aec4452 commit e561cef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 273e27ca8081095a1bdf65276d4b645215ad1c57
refs/heads/master: 2c34b850ee1e9f86b41706149d0954eee58757a3
11 changes: 8 additions & 3 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -6713,13 +6713,14 @@ intel_alloc_context_page(struct drm_device *dev)
struct drm_i915_gem_object *ctx;
int ret;

WARN_ON(!mutex_is_locked(&dev->struct_mutex));

ctx = i915_gem_alloc_object(dev, 4096);
if (!ctx) {
DRM_DEBUG("failed to alloc power context, RC6 disabled\n");
return NULL;
}

mutex_lock(&dev->struct_mutex);
ret = i915_gem_object_pin(ctx, 4096, true);
if (ret) {
DRM_ERROR("failed to pin power context: %d\n", ret);
Expand All @@ -6731,7 +6732,6 @@ intel_alloc_context_page(struct drm_device *dev)
DRM_ERROR("failed to set-domain on power context: %d\n", ret);
goto err_unpin;
}
mutex_unlock(&dev->struct_mutex);

return ctx;

Expand Down Expand Up @@ -7295,9 +7295,12 @@ void ironlake_enable_rc6(struct drm_device *dev)
if (!i915_enable_rc6)
return;

mutex_lock(&dev->struct_mutex);
ret = ironlake_setup_rc6(dev);
if (ret)
if (ret) {
mutex_unlock(&dev->struct_mutex);
return;
}

/*
* GPU can automatically power down the render unit if given a page
Expand All @@ -7306,6 +7309,7 @@ void ironlake_enable_rc6(struct drm_device *dev)
ret = BEGIN_LP_RING(6);
if (ret) {
ironlake_teardown_rc6(dev);
mutex_unlock(&dev->struct_mutex);
return;
}

Expand All @@ -7323,6 +7327,7 @@ void ironlake_enable_rc6(struct drm_device *dev)

I915_WRITE(PWRCTXA, dev_priv->pwrctx->gtt_offset | PWRCTX_EN);
I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
mutex_unlock(&dev->struct_mutex);
}


Expand Down

0 comments on commit e561cef

Please sign in to comment.