Release 4.11 drivers/gpu/drm/i915/i915_suspend.c
/*
*
* Copyright 2008 (c) Intel Corporation
* Jesse Barnes <jbarnes@virtuousgeek.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <drm/drmP.h>
#include <drm/i915_drm.h>
#include "intel_drv.h"
#include "i915_reg.h"
static void i915_save_display(struct drm_i915_private *dev_priv)
{
/* Display arbitration control */
if (INTEL_GEN(dev_priv) <= 4)
dev_priv->regfile.saveDSPARB = I915_READ(DSPARB);
/* save FBC interval */
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv))
dev_priv->regfile.saveFBC_CONTROL = I915_READ(FBC_CONTROL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Chris Wilson | 14 | 21.88% | 1 | 6.67% |
Yakui Zhao | 13 | 20.31% | 3 | 20.00% |
Tvrtko A. Ursulin | 8 | 12.50% | 2 | 13.33% |
Paulo Zanoni | 7 | 10.94% | 1 | 6.67% |
Ville Syrjälä | 7 | 10.94% | 1 | 6.67% |
Daniel Vetter | 7 | 10.94% | 3 | 20.00% |
Jesse Barnes | 5 | 7.81% | 2 | 13.33% |
Ben Gamari | 2 | 3.12% | 1 | 6.67% |
Keith Packard | 1 | 1.56% | 1 | 6.67% |
Total | 64 | 100.00% | 15 | 100.00% |
static void i915_restore_display(struct drm_i915_private *dev_priv)
{
/* Display arbitration */
if (INTEL_GEN(dev_priv) <= 4)
I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
/* only restore FBC info on the platform that supports FBC*/
intel_fbc_global_disable(dev_priv);
/* restore FBC interval */
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv))
I915_WRITE(FBC_CONTROL, dev_priv->regfile.saveFBC_CONTROL);
i915_redisable_vga(dev_priv);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Gamari | 19 | 25.33% | 1 | 5.88% |
Yakui Zhao | 17 | 22.67% | 3 | 17.65% |
Paulo Zanoni | 9 | 12.00% | 3 | 17.65% |
Tvrtko A. Ursulin | 9 | 12.00% | 2 | 11.76% |
Ville Syrjälä | 7 | 9.33% | 1 | 5.88% |
Daniel Vetter | 6 | 8.00% | 3 | 17.65% |
Jesse Barnes | 4 | 5.33% | 2 | 11.76% |
Chris Wilson | 3 | 4.00% | 1 | 5.88% |
Keith Packard | 1 | 1.33% | 1 | 5.88% |
Total | 75 | 100.00% | 17 | 100.00% |
int i915_save_state(struct drm_i915_private *dev_priv)
{
struct pci_dev *pdev = dev_priv->drm.pdev;
int i;
mutex_lock(&dev_priv->drm.struct_mutex);
i915_save_display(dev_priv);
if (IS_GEN4(dev_priv))
pci_read_config_word(pdev, GCDGMBUS,
&dev_priv->regfile.saveGCDGMBUS);
/* Cache mode state */
if (INTEL_GEN(dev_priv) < 7)
dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
/* Memory Arbitration state */
dev_priv->regfile.saveMI_ARB_STATE = I915_READ(MI_ARB_STATE);
/* Scratch space */
if (IS_GEN2(dev_priv) && IS_MOBILE(dev_priv)) {
for (i = 0; i < 7; i++) {
dev_priv->regfile.saveSWF0[i] = I915_READ(SWF0(i));
dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
}
for (i = 0; i < 3; i++)
dev_priv->regfile.saveSWF3[i] = I915_READ(SWF3(i));
} else if (IS_GEN2(dev_priv)) {
for (i = 0; i < 7; i++)
dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
} else if (HAS_GMCH_DISPLAY(dev_priv)) {
for (i = 0; i < 16; i++) {
dev_priv->regfile.saveSWF0[i] = I915_READ(SWF0(i));
dev_priv->regfile.saveSWF1[i] = I915_READ(SWF1(i));
}
for (i = 0; i < 3; i++)
dev_priv->regfile.saveSWF3[i] = I915_READ(SWF3(i));
}
mutex_unlock(&dev_priv->drm.struct_mutex);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ville Syrjälä | 153 | 46.50% | 1 | 7.69% |
Ben Gamari | 91 | 27.66% | 1 | 7.69% |
Jesse Barnes | 27 | 8.21% | 3 | 23.08% |
Keith Packard | 14 | 4.26% | 1 | 7.69% |
Daniel Vetter | 12 | 3.65% | 2 | 15.38% |
Tvrtko A. Ursulin | 12 | 3.65% | 3 | 23.08% |
David Weinehall | 11 | 3.34% | 1 | 7.69% |
Yakui Zhao | 9 | 2.74% | 1 | 7.69% |
Total | 329 | 100.00% | 13 | 100.00% |
int i915_restore_state(struct drm_i915_private *dev_priv)
{
struct pci_dev *pdev = dev_priv->drm.pdev;
int i;
mutex_lock(&dev_priv->drm.struct_mutex);
i915_gem_restore_fences(dev_priv);
if (IS_GEN4(dev_priv))
pci_write_config_word(pdev, GCDGMBUS,
dev_priv->regfile.saveGCDGMBUS);
i915_restore_display(dev_priv);
/* Cache mode state */
if (INTEL_GEN(dev_priv) < 7)
I915_WRITE(CACHE_MODE_0, dev_priv->regfile.saveCACHE_MODE_0 |
0xffff0000);
/* Memory arbitration state */
I915_WRITE(MI_ARB_STATE, dev_priv->regfile.saveMI_ARB_STATE | 0xffff0000);
/* Scratch space */
if (IS_GEN2(dev_priv) && IS_MOBILE(dev_priv)) {
for (i = 0; i < 7; i++) {
I915_WRITE(SWF0(i), dev_priv->regfile.saveSWF0[i]);
I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
}
for (i = 0; i < 3; i++)
I915_WRITE(SWF3(i), dev_priv->regfile.saveSWF3[i]);
} else if (IS_GEN2(dev_priv)) {
for (i = 0; i < 7; i++)
I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
} else if (HAS_GMCH_DISPLAY(dev_priv)) {
for (i = 0; i < 16; i++) {
I915_WRITE(SWF0(i), dev_priv->regfile.saveSWF0[i]);
I915_WRITE(SWF1(i), dev_priv->regfile.saveSWF1[i]);
}
for (i = 0; i < 3; i++)
I915_WRITE(SWF3(i), dev_priv->regfile.saveSWF3[i]);
}
mutex_unlock(&dev_priv->drm.struct_mutex);
intel_i2c_reset(dev_priv);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ville Syrjälä | 154 | 45.03% | 1 | 6.67% |
Jesse Barnes | 120 | 35.09% | 3 | 20.00% |
Keith Packard | 14 | 4.09% | 1 | 6.67% |
Tvrtko A. Ursulin | 14 | 4.09% | 4 | 26.67% |
Ben Gamari | 11 | 3.22% | 1 | 6.67% |
David Weinehall | 11 | 3.22% | 1 | 6.67% |
Daniel Vetter | 10 | 2.92% | 1 | 6.67% |
Chris Wilson | 5 | 1.46% | 2 | 13.33% |
Eric Anholt | 3 | 0.88% | 1 | 6.67% |
Total | 342 | 100.00% | 15 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ville Syrjälä | 321 | 39.00% | 2 | 6.25% |
Jesse Barnes | 163 | 19.81% | 4 | 12.50% |
Ben Gamari | 123 | 14.95% | 1 | 3.12% |
Tvrtko A. Ursulin | 43 | 5.22% | 5 | 15.62% |
Yakui Zhao | 39 | 4.74% | 3 | 9.38% |
Daniel Vetter | 35 | 4.25% | 5 | 15.62% |
Keith Packard | 30 | 3.65% | 1 | 3.12% |
Chris Wilson | 22 | 2.67% | 4 | 12.50% |
David Weinehall | 22 | 2.67% | 1 | 3.12% |
Paulo Zanoni | 16 | 1.94% | 3 | 9.38% |
Eric Anholt | 4 | 0.49% | 1 | 3.12% |
Eugeni Dodonov | 3 | 0.36% | 1 | 3.12% |
David Howells | 2 | 0.24% | 1 | 3.12% |
Total | 823 | 100.00% | 32 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.