Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345284
b: refs/heads/master
c: 1abd02e
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes authored and Daniel Vetter committed Nov 11, 2012
1 parent 081e024 commit 105491c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 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: 4fc688ce79772496503d22263d61b071a8fb596e
refs/heads/master: 1abd02e2dd7e0bd577000301fb2fd47780637387
1 change: 0 additions & 1 deletion trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
intel_setup_gmbus(dev);
intel_opregion_setup(dev);

/* Make sure the bios did its job and set up vital registers */
intel_setup_bios(dev);

i915_gem_load(dev);
Expand Down
43 changes: 33 additions & 10 deletions trunk/drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,19 +537,11 @@ void intel_console_resume(struct work_struct *work)
console_unlock();
}

static int i915_drm_thaw(struct drm_device *dev)
static int __i915_drm_thaw(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int error = 0;

intel_gt_reset(dev);

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev);
mutex_unlock(&dev->struct_mutex);
}

i915_restore_state(dev);
intel_opregion_setup(dev);

Expand Down Expand Up @@ -588,8 +580,26 @@ static int i915_drm_thaw(struct drm_device *dev)
return error;
}

static int i915_drm_thaw(struct drm_device *dev)
{
int error = 0;

intel_gt_reset(dev);

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev);
mutex_unlock(&dev->struct_mutex);
}

__i915_drm_thaw(dev);

return error;
}

int i915_resume(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;

if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
Expand All @@ -600,7 +610,20 @@ int i915_resume(struct drm_device *dev)

pci_set_master(dev->pdev);

ret = i915_drm_thaw(dev);
intel_gt_reset(dev);

/*
* Platforms with opregion should have sane BIOS, older ones (gen3 and
* earlier) need this since the BIOS might clear all our scratch PTEs.
*/
if (drm_core_check_feature(dev, DRIVER_MODESET) &&
!dev_priv->opregion.header) {
mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev);
mutex_unlock(&dev->struct_mutex);
}

ret = __i915_drm_thaw(dev);
if (ret)
return ret;

Expand Down

0 comments on commit 105491c

Please sign in to comment.