Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131678
b: refs/heads/master
c: 5669fca
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes authored and Dave Airlie committed Feb 23, 2009
1 parent f1826c2 commit 669a7e9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 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: efbeed96f7e20783b22d9529ef536b61f7ea8637
refs/heads/master: 5669fcacc58bf3a7386057addffd280d75380858
23 changes: 22 additions & 1 deletion trunk/drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*
*/

#include <linux/device.h>
#include "drmP.h"
#include "drm.h"
#include "i915_drm.h"
Expand Down Expand Up @@ -66,6 +67,12 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)

i915_save_state(dev);

/* If KMS is active, we do the leavevt stuff here */
if (drm_core_check_feature(dev, DRIVER_MODESET) && i915_gem_idle(dev)) {
dev_err(&dev->pdev->dev, "GEM idle failed, aborting suspend\n");
return -EBUSY;
}

intel_opregion_free(dev);

if (state.event == PM_EVENT_SUSPEND) {
Expand All @@ -79,6 +86,9 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)

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

pci_set_power_state(dev->pdev, PCI_D0);
pci_restore_state(dev->pdev);
if (pci_enable_device(dev->pdev))
Expand All @@ -89,7 +99,18 @@ static int i915_resume(struct drm_device *dev)

intel_opregion_init(dev);

return 0;
/* KMS EnterVT equivalent */
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
dev_priv->mm.suspended = 0;

ret = i915_gem_init_ringbuffer(dev);
if (ret != 0)
ret = -1;
mutex_unlock(&dev->struct_mutex);
}

return ret;
}

static struct vm_operations_struct i915_gem_vm_ops = {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ int i915_gem_init_ringbuffer(struct drm_device *dev);
void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
int i915_gem_do_init(struct drm_device *dev, unsigned long start,
unsigned long end);
int i915_gem_idle(struct drm_device *dev);
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
int write);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2973,7 +2973,7 @@ i915_gem_evict_from_list(struct drm_device *dev, struct list_head *head)
return 0;
}

static int
int
i915_gem_idle(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
Expand Down

0 comments on commit 669a7e9

Please sign in to comment.