[Intel-gfx] [PATCH 6/7] drm/i915: Remove regfile code&data for UMS suspend/resume
Rodrigo Vivi
rodrigo.vivi at gmail.com
Thu Feb 26 17:16:00 PST 2015
On Mon, Feb 23, 2015 at 3:03 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> Lots of lines to remove!
Great clean up! :)
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 133 ---------
> drivers/gpu/drm/i915/i915_suspend.c | 215 +-------------
> drivers/gpu/drm/i915/i915_ums.c | 552 ------------------------------------
> 3 files changed, 2 insertions(+), 898 deletions(-)
> delete mode 100644 drivers/gpu/drm/i915/i915_ums.c
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 3f210aa7652e..e4a988ef7f16 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -889,150 +889,21 @@ struct intel_gmbus {
> };
>
> struct i915_suspend_saved_registers {
> - u8 saveLBB;
> - u32 saveDSPACNTR;
> - u32 saveDSPBCNTR;
> u32 saveDSPARB;
> - u32 savePIPEACONF;
> - u32 savePIPEBCONF;
> - u32 savePIPEASRC;
> - u32 savePIPEBSRC;
> - u32 saveFPA0;
> - u32 saveFPA1;
> - u32 saveDPLL_A;
> - u32 saveDPLL_A_MD;
> - u32 saveHTOTAL_A;
> - u32 saveHBLANK_A;
> - u32 saveHSYNC_A;
> - u32 saveVTOTAL_A;
> - u32 saveVBLANK_A;
> - u32 saveVSYNC_A;
> - u32 saveBCLRPAT_A;
> - u32 saveTRANSACONF;
> - u32 saveTRANS_HTOTAL_A;
> - u32 saveTRANS_HBLANK_A;
> - u32 saveTRANS_HSYNC_A;
> - u32 saveTRANS_VTOTAL_A;
> - u32 saveTRANS_VBLANK_A;
> - u32 saveTRANS_VSYNC_A;
> - u32 savePIPEASTAT;
> - u32 saveDSPASTRIDE;
> - u32 saveDSPASIZE;
> - u32 saveDSPAPOS;
> - u32 saveDSPAADDR;
> - u32 saveDSPASURF;
> - u32 saveDSPATILEOFF;
> - u32 savePFIT_PGM_RATIOS;
> - u32 saveBLC_HIST_CTL;
> - u32 saveBLC_PWM_CTL;
> - u32 saveBLC_PWM_CTL2;
> - u32 saveBLC_CPU_PWM_CTL;
> - u32 saveBLC_CPU_PWM_CTL2;
> - u32 saveFPB0;
> - u32 saveFPB1;
> - u32 saveDPLL_B;
> - u32 saveDPLL_B_MD;
> - u32 saveHTOTAL_B;
> - u32 saveHBLANK_B;
> - u32 saveHSYNC_B;
> - u32 saveVTOTAL_B;
> - u32 saveVBLANK_B;
> - u32 saveVSYNC_B;
> - u32 saveBCLRPAT_B;
> - u32 saveTRANSBCONF;
> - u32 saveTRANS_HTOTAL_B;
> - u32 saveTRANS_HBLANK_B;
> - u32 saveTRANS_HSYNC_B;
> - u32 saveTRANS_VTOTAL_B;
> - u32 saveTRANS_VBLANK_B;
> - u32 saveTRANS_VSYNC_B;
> - u32 savePIPEBSTAT;
> - u32 saveDSPBSTRIDE;
> - u32 saveDSPBSIZE;
> - u32 saveDSPBPOS;
> - u32 saveDSPBADDR;
> - u32 saveDSPBSURF;
> - u32 saveDSPBTILEOFF;
> - u32 saveVGA0;
> - u32 saveVGA1;
> - u32 saveVGA_PD;
> - u32 saveVGACNTRL;
> - u32 saveADPA;
> u32 saveLVDS;
> u32 savePP_ON_DELAYS;
> u32 savePP_OFF_DELAYS;
> - u32 saveDVOA;
> - u32 saveDVOB;
> - u32 saveDVOC;
> u32 savePP_ON;
> u32 savePP_OFF;
> u32 savePP_CONTROL;
> u32 savePP_DIVISOR;
> - u32 savePFIT_CONTROL;
> - u32 save_palette_a[256];
> - u32 save_palette_b[256];
> u32 saveFBC_CONTROL;
> - u32 saveIER;
> - u32 saveIIR;
> - u32 saveIMR;
> - u32 saveDEIER;
> - u32 saveDEIMR;
> - u32 saveGTIER;
> - u32 saveGTIMR;
> - u32 saveFDI_RXA_IMR;
> - u32 saveFDI_RXB_IMR;
> u32 saveCACHE_MODE_0;
> u32 saveMI_ARB_STATE;
> u32 saveSWF0[16];
> u32 saveSWF1[16];
> u32 saveSWF2[3];
> - u8 saveMSR;
> - u8 saveSR[8];
> - u8 saveGR[25];
> - u8 saveAR_INDEX;
> - u8 saveAR[21];
> - u8 saveDACMASK;
> - u8 saveCR[37];
> uint64_t saveFENCE[I915_MAX_NUM_FENCES];
> - u32 saveCURACNTR;
> - u32 saveCURAPOS;
> - u32 saveCURABASE;
> - u32 saveCURBCNTR;
> - u32 saveCURBPOS;
> - u32 saveCURBBASE;
> - u32 saveCURSIZE;
> - u32 saveDP_B;
> - u32 saveDP_C;
> - u32 saveDP_D;
> - u32 savePIPEA_GMCH_DATA_M;
> - u32 savePIPEB_GMCH_DATA_M;
> - u32 savePIPEA_GMCH_DATA_N;
> - u32 savePIPEB_GMCH_DATA_N;
> - u32 savePIPEA_DP_LINK_M;
> - u32 savePIPEB_DP_LINK_M;
> - u32 savePIPEA_DP_LINK_N;
> - u32 savePIPEB_DP_LINK_N;
> - u32 saveFDI_RXA_CTL;
> - u32 saveFDI_TXA_CTL;
> - u32 saveFDI_RXB_CTL;
> - u32 saveFDI_TXB_CTL;
> - u32 savePFA_CTL_1;
> - u32 savePFB_CTL_1;
> - u32 savePFA_WIN_SZ;
> - u32 savePFB_WIN_SZ;
> - u32 savePFA_WIN_POS;
> - u32 savePFB_WIN_POS;
> - u32 savePCH_DREF_CONTROL;
> - u32 saveDISP_ARB_CTL;
> - u32 savePIPEA_DATA_M1;
> - u32 savePIPEA_DATA_N1;
> - u32 savePIPEA_LINK_M1;
> - u32 savePIPEA_LINK_N1;
> - u32 savePIPEB_DATA_M1;
> - u32 savePIPEB_DATA_N1;
> - u32 savePIPEB_LINK_M1;
> - u32 savePIPEB_LINK_N1;
> - u32 saveMCHBAR_RENDER_STANDBY;
> u32 savePCH_PORT_HOTPLUG;
> u16 saveGCDGMBUS;
> };
I didn't check reg by reg, but I believe on your gcc ;)
so Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> @@ -3124,10 +2995,6 @@ int i915_parse_cmds(struct intel_engine_cs *ring,
> extern int i915_save_state(struct drm_device *dev);
> extern int i915_restore_state(struct drm_device *dev);
>
> -/* i915_ums.c */
> -void i915_save_display_reg(struct drm_device *dev);
> -void i915_restore_display_reg(struct drm_device *dev);
> -
> /* i915_sysfs.c */
> void i915_setup_sysfs(struct drm_device *dev_priv);
> void i915_teardown_sysfs(struct drm_device *dev_priv);
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 9f19ed38cdc3..cf67f82f7b7f 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -29,166 +29,6 @@
> #include "intel_drv.h"
> #include "i915_reg.h"
>
> -static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> -
> - I915_WRITE8(index_port, reg);
> - return I915_READ8(data_port);
> -}
> -
> -static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> -
> - I915_READ8(st01);
> - I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
> - return I915_READ8(VGA_AR_DATA_READ);
> -}
> -
> -static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> -
> - I915_READ8(st01);
> - I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
> - I915_WRITE8(VGA_AR_DATA_WRITE, val);
> -}
> -
> -static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> -
> - I915_WRITE8(index_port, reg);
> - I915_WRITE8(data_port, val);
> -}
> -
> -static void i915_save_vga(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - int i;
> - u16 cr_index, cr_data, st01;
> -
> - /* VGA state */
> - dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> - dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> - dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
> - dev_priv->regfile.saveVGACNTRL = I915_READ(i915_vgacntrl_reg(dev));
> -
> - /* VGA color palette registers */
> - dev_priv->regfile.saveDACMASK = I915_READ8(VGA_DACMASK);
> -
> - /* MSR bits */
> - dev_priv->regfile.saveMSR = I915_READ8(VGA_MSR_READ);
> - if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) {
> - cr_index = VGA_CR_INDEX_CGA;
> - cr_data = VGA_CR_DATA_CGA;
> - st01 = VGA_ST01_CGA;
> - } else {
> - cr_index = VGA_CR_INDEX_MDA;
> - cr_data = VGA_CR_DATA_MDA;
> - st01 = VGA_ST01_MDA;
> - }
> -
> - /* CRT controller regs */
> - i915_write_indexed(dev, cr_index, cr_data, 0x11,
> - i915_read_indexed(dev, cr_index, cr_data, 0x11) &
> - (~0x80));
> - for (i = 0; i <= 0x24; i++)
> - dev_priv->regfile.saveCR[i] =
> - i915_read_indexed(dev, cr_index, cr_data, i);
> - /* Make sure we don't turn off CR group 0 writes */
> - dev_priv->regfile.saveCR[0x11] &= ~0x80;
> -
> - /* Attribute controller registers */
> - I915_READ8(st01);
> - dev_priv->regfile.saveAR_INDEX = I915_READ8(VGA_AR_INDEX);
> - for (i = 0; i <= 0x14; i++)
> - dev_priv->regfile.saveAR[i] = i915_read_ar(dev, st01, i, 0);
> - I915_READ8(st01);
> - I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX);
> - I915_READ8(st01);
> -
> - /* Graphics controller registers */
> - for (i = 0; i < 9; i++)
> - dev_priv->regfile.saveGR[i] =
> - i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i);
> -
> - dev_priv->regfile.saveGR[0x10] =
> - i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10);
> - dev_priv->regfile.saveGR[0x11] =
> - i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11);
> - dev_priv->regfile.saveGR[0x18] =
> - i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18);
> -
> - /* Sequencer registers */
> - for (i = 0; i < 8; i++)
> - dev_priv->regfile.saveSR[i] =
> - i915_read_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i);
> -}
> -
> -static void i915_restore_vga(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - int i;
> - u16 cr_index, cr_data, st01;
> -
> - /* VGA state */
> - I915_WRITE(i915_vgacntrl_reg(dev), dev_priv->regfile.saveVGACNTRL);
> -
> - I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
> - I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
> - I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
> - POSTING_READ(VGA_PD);
> - udelay(150);
> -
> - /* MSR bits */
> - I915_WRITE8(VGA_MSR_WRITE, dev_priv->regfile.saveMSR);
> - if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) {
> - cr_index = VGA_CR_INDEX_CGA;
> - cr_data = VGA_CR_DATA_CGA;
> - st01 = VGA_ST01_CGA;
> - } else {
> - cr_index = VGA_CR_INDEX_MDA;
> - cr_data = VGA_CR_DATA_MDA;
> - st01 = VGA_ST01_MDA;
> - }
> -
> - /* Sequencer registers, don't write SR07 */
> - for (i = 0; i < 7; i++)
> - i915_write_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i,
> - dev_priv->regfile.saveSR[i]);
> -
> - /* CRT controller regs */
> - /* Enable CR group 0 writes */
> - i915_write_indexed(dev, cr_index, cr_data, 0x11, dev_priv->regfile.saveCR[0x11]);
> - for (i = 0; i <= 0x24; i++)
> - i915_write_indexed(dev, cr_index, cr_data, i, dev_priv->regfile.saveCR[i]);
> -
> - /* Graphics controller regs */
> - for (i = 0; i < 9; i++)
> - i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i,
> - dev_priv->regfile.saveGR[i]);
> -
> - i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10,
> - dev_priv->regfile.saveGR[0x10]);
> - i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11,
> - dev_priv->regfile.saveGR[0x11]);
> - i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18,
> - dev_priv->regfile.saveGR[0x18]);
> -
> - /* Attribute controller registers */
> - I915_READ8(st01); /* switch back to index mode */
> - for (i = 0; i <= 0x14; i++)
> - i915_write_ar(dev, st01, i, dev_priv->regfile.saveAR[i], 0);
> - I915_READ8(st01); /* switch back to index mode */
> - I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX | 0x20);
> - I915_READ8(st01);
> -
> - /* VGA color palette registers */
> - I915_WRITE8(VGA_DACMASK, dev_priv->regfile.saveDACMASK);
> -}
> -
> static void i915_save_display(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -197,11 +37,6 @@ static void i915_save_display(struct drm_device *dev)
> if (INTEL_INFO(dev)->gen <= 4)
> dev_priv->regfile.saveDSPARB = I915_READ(DSPARB);
>
> - /* This is only meaningful in non-KMS mode */
> - /* Don't regfile.save them in KMS mode */
> - if (!drm_core_check_feature(dev, DRIVER_MODESET))
> - i915_save_display_reg(dev);
> -
> /* LVDS state */
> if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
> dev_priv->regfile.saveLVDS = I915_READ(PCH_LVDS);
> @@ -224,9 +59,6 @@ static void i915_save_display(struct drm_device *dev)
> /* save FBC interval */
> if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
> dev_priv->regfile.saveFBC_CONTROL = I915_READ(FBC_CONTROL);
> -
> - if (!drm_core_check_feature(dev, DRIVER_MODESET))
> - i915_save_vga(dev);
> }
>
> static void i915_restore_display(struct drm_device *dev)
> @@ -238,11 +70,7 @@ static void i915_restore_display(struct drm_device *dev)
> if (INTEL_INFO(dev)->gen <= 4)
> I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
>
> - if (!drm_core_check_feature(dev, DRIVER_MODESET))
> - i915_restore_display_reg(dev);
> -
> - if (drm_core_check_feature(dev, DRIVER_MODESET))
> - mask = ~LVDS_PORT_EN;
> + mask = ~LVDS_PORT_EN;
>
> /* LVDS state */
> if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
> @@ -270,10 +98,7 @@ static void i915_restore_display(struct drm_device *dev)
> if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
> I915_WRITE(FBC_CONTROL, dev_priv->regfile.saveFBC_CONTROL);
>
> - if (!drm_core_check_feature(dev, DRIVER_MODESET))
> - i915_restore_vga(dev);
> - else
> - i915_redisable_vga(dev);
> + i915_redisable_vga(dev);
> }
>
> int i915_save_state(struct drm_device *dev)
> @@ -285,24 +110,6 @@ int i915_save_state(struct drm_device *dev)
>
> i915_save_display(dev);
>
> - if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
> - /* Interrupt state */
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.saveDEIER = I915_READ(DEIER);
> - dev_priv->regfile.saveDEIMR = I915_READ(DEIMR);
> - dev_priv->regfile.saveGTIER = I915_READ(GTIER);
> - dev_priv->regfile.saveGTIMR = I915_READ(GTIMR);
> - dev_priv->regfile.saveFDI_RXA_IMR = I915_READ(_FDI_RXA_IMR);
> - dev_priv->regfile.saveFDI_RXB_IMR = I915_READ(_FDI_RXB_IMR);
> - dev_priv->regfile.saveMCHBAR_RENDER_STANDBY =
> - I915_READ(RSTDBYCTL);
> - dev_priv->regfile.savePCH_PORT_HOTPLUG = I915_READ(PCH_PORT_HOTPLUG);
> - } else {
> - dev_priv->regfile.saveIER = I915_READ(IER);
> - dev_priv->regfile.saveIMR = I915_READ(IMR);
> - }
> - }
> -
> if (IS_GEN4(dev))
> pci_read_config_word(dev->pdev, GCDGMBUS,
> &dev_priv->regfile.saveGCDGMBUS);
> @@ -341,24 +148,6 @@ int i915_restore_state(struct drm_device *dev)
> dev_priv->regfile.saveGCDGMBUS);
> i915_restore_display(dev);
>
> - if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
> - /* Interrupt state */
> - if (HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(DEIER, dev_priv->regfile.saveDEIER);
> - I915_WRITE(DEIMR, dev_priv->regfile.saveDEIMR);
> - I915_WRITE(GTIER, dev_priv->regfile.saveGTIER);
> - I915_WRITE(GTIMR, dev_priv->regfile.saveGTIMR);
> - I915_WRITE(_FDI_RXA_IMR, dev_priv->regfile.saveFDI_RXA_IMR);
> - I915_WRITE(_FDI_RXB_IMR, dev_priv->regfile.saveFDI_RXB_IMR);
> - I915_WRITE(PCH_PORT_HOTPLUG, dev_priv->regfile.savePCH_PORT_HOTPLUG);
> - I915_WRITE(RSTDBYCTL,
> - dev_priv->regfile.saveMCHBAR_RENDER_STANDBY);
> - } else {
> - I915_WRITE(IER, dev_priv->regfile.saveIER);
> - I915_WRITE(IMR, dev_priv->regfile.saveIMR);
> - }
> - }
> -
> /* Cache mode state */
> if (INTEL_INFO(dev)->gen < 7)
> I915_WRITE(CACHE_MODE_0, dev_priv->regfile.saveCACHE_MODE_0 |
> diff --git a/drivers/gpu/drm/i915/i915_ums.c b/drivers/gpu/drm/i915/i915_ums.c
> deleted file mode 100644
> index d10fe3e9c49f..000000000000
> --- a/drivers/gpu/drm/i915/i915_ums.c
> +++ /dev/null
> @@ -1,552 +0,0 @@
> -/*
> - *
> - * Copyright 2008 (c) Intel Corporation
> - * Jesse Barnes <jbarnes at virtuousgeek.org>
> - * Copyright 2013 (c) Intel Corporation
> - * Daniel Vetter <daniel.vetter at ffwll.ch>
> - *
> - * 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 bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - u32 dpll_reg;
> -
> - /* On IVB, 3rd pipe shares PLL with another one */
> - if (pipe > 1)
> - return false;
> -
> - if (HAS_PCH_SPLIT(dev))
> - dpll_reg = PCH_DPLL(pipe);
> - else
> - dpll_reg = (pipe == PIPE_A) ? _DPLL_A : _DPLL_B;
> -
> - return (I915_READ(dpll_reg) & DPLL_VCO_ENABLE);
> -}
> -
> -static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - unsigned long reg = (pipe == PIPE_A ? _PALETTE_A : _PALETTE_B);
> - u32 *array;
> - int i;
> -
> - if (!i915_pipe_enabled(dev, pipe))
> - return;
> -
> - if (HAS_PCH_SPLIT(dev))
> - reg = (pipe == PIPE_A) ? _LGC_PALETTE_A : _LGC_PALETTE_B;
> -
> - if (pipe == PIPE_A)
> - array = dev_priv->regfile.save_palette_a;
> - else
> - array = dev_priv->regfile.save_palette_b;
> -
> - for (i = 0; i < 256; i++)
> - array[i] = I915_READ(reg + (i << 2));
> -}
> -
> -static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - unsigned long reg = (pipe == PIPE_A ? _PALETTE_A : _PALETTE_B);
> - u32 *array;
> - int i;
> -
> - if (!i915_pipe_enabled(dev, pipe))
> - return;
> -
> - if (HAS_PCH_SPLIT(dev))
> - reg = (pipe == PIPE_A) ? _LGC_PALETTE_A : _LGC_PALETTE_B;
> -
> - if (pipe == PIPE_A)
> - array = dev_priv->regfile.save_palette_a;
> - else
> - array = dev_priv->regfile.save_palette_b;
> -
> - for (i = 0; i < 256; i++)
> - I915_WRITE(reg + (i << 2), array[i]);
> -}
> -
> -void i915_save_display_reg(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - int i;
> -
> - /* Cursor state */
> - dev_priv->regfile.saveCURACNTR = I915_READ(_CURACNTR);
> - dev_priv->regfile.saveCURAPOS = I915_READ(_CURAPOS);
> - dev_priv->regfile.saveCURABASE = I915_READ(_CURABASE);
> - dev_priv->regfile.saveCURBCNTR = I915_READ(_CURBCNTR);
> - dev_priv->regfile.saveCURBPOS = I915_READ(_CURBPOS);
> - dev_priv->regfile.saveCURBBASE = I915_READ(_CURBBASE);
> - if (IS_GEN2(dev))
> - dev_priv->regfile.saveCURSIZE = I915_READ(CURSIZE);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL);
> - dev_priv->regfile.saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL);
> - }
> -
> - /* Pipe & plane A info */
> - dev_priv->regfile.savePIPEACONF = I915_READ(_PIPEACONF);
> - dev_priv->regfile.savePIPEASRC = I915_READ(_PIPEASRC);
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.saveFPA0 = I915_READ(_PCH_FPA0);
> - dev_priv->regfile.saveFPA1 = I915_READ(_PCH_FPA1);
> - dev_priv->regfile.saveDPLL_A = I915_READ(_PCH_DPLL_A);
> - } else {
> - dev_priv->regfile.saveFPA0 = I915_READ(_FPA0);
> - dev_priv->regfile.saveFPA1 = I915_READ(_FPA1);
> - dev_priv->regfile.saveDPLL_A = I915_READ(_DPLL_A);
> - }
> - if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev))
> - dev_priv->regfile.saveDPLL_A_MD = I915_READ(_DPLL_A_MD);
> - dev_priv->regfile.saveHTOTAL_A = I915_READ(_HTOTAL_A);
> - dev_priv->regfile.saveHBLANK_A = I915_READ(_HBLANK_A);
> - dev_priv->regfile.saveHSYNC_A = I915_READ(_HSYNC_A);
> - dev_priv->regfile.saveVTOTAL_A = I915_READ(_VTOTAL_A);
> - dev_priv->regfile.saveVBLANK_A = I915_READ(_VBLANK_A);
> - dev_priv->regfile.saveVSYNC_A = I915_READ(_VSYNC_A);
> - if (!HAS_PCH_SPLIT(dev))
> - dev_priv->regfile.saveBCLRPAT_A = I915_READ(_BCLRPAT_A);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.savePIPEA_DATA_M1 = I915_READ(_PIPEA_DATA_M1);
> - dev_priv->regfile.savePIPEA_DATA_N1 = I915_READ(_PIPEA_DATA_N1);
> - dev_priv->regfile.savePIPEA_LINK_M1 = I915_READ(_PIPEA_LINK_M1);
> - dev_priv->regfile.savePIPEA_LINK_N1 = I915_READ(_PIPEA_LINK_N1);
> -
> - dev_priv->regfile.saveFDI_TXA_CTL = I915_READ(_FDI_TXA_CTL);
> - dev_priv->regfile.saveFDI_RXA_CTL = I915_READ(_FDI_RXA_CTL);
> -
> - dev_priv->regfile.savePFA_CTL_1 = I915_READ(_PFA_CTL_1);
> - dev_priv->regfile.savePFA_WIN_SZ = I915_READ(_PFA_WIN_SZ);
> - dev_priv->regfile.savePFA_WIN_POS = I915_READ(_PFA_WIN_POS);
> -
> - dev_priv->regfile.saveTRANSACONF = I915_READ(_PCH_TRANSACONF);
> - dev_priv->regfile.saveTRANS_HTOTAL_A = I915_READ(_PCH_TRANS_HTOTAL_A);
> - dev_priv->regfile.saveTRANS_HBLANK_A = I915_READ(_PCH_TRANS_HBLANK_A);
> - dev_priv->regfile.saveTRANS_HSYNC_A = I915_READ(_PCH_TRANS_HSYNC_A);
> - dev_priv->regfile.saveTRANS_VTOTAL_A = I915_READ(_PCH_TRANS_VTOTAL_A);
> - dev_priv->regfile.saveTRANS_VBLANK_A = I915_READ(_PCH_TRANS_VBLANK_A);
> - dev_priv->regfile.saveTRANS_VSYNC_A = I915_READ(_PCH_TRANS_VSYNC_A);
> - }
> -
> - dev_priv->regfile.saveDSPACNTR = I915_READ(_DSPACNTR);
> - dev_priv->regfile.saveDSPASTRIDE = I915_READ(_DSPASTRIDE);
> - dev_priv->regfile.saveDSPASIZE = I915_READ(_DSPASIZE);
> - dev_priv->regfile.saveDSPAPOS = I915_READ(_DSPAPOS);
> - dev_priv->regfile.saveDSPAADDR = I915_READ(_DSPAADDR);
> - if (INTEL_INFO(dev)->gen >= 4) {
> - dev_priv->regfile.saveDSPASURF = I915_READ(_DSPASURF);
> - dev_priv->regfile.saveDSPATILEOFF = I915_READ(_DSPATILEOFF);
> - }
> - i915_save_palette(dev, PIPE_A);
> - dev_priv->regfile.savePIPEASTAT = I915_READ(_PIPEASTAT);
> -
> - /* Pipe & plane B info */
> - dev_priv->regfile.savePIPEBCONF = I915_READ(_PIPEBCONF);
> - dev_priv->regfile.savePIPEBSRC = I915_READ(_PIPEBSRC);
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.saveFPB0 = I915_READ(_PCH_FPB0);
> - dev_priv->regfile.saveFPB1 = I915_READ(_PCH_FPB1);
> - dev_priv->regfile.saveDPLL_B = I915_READ(_PCH_DPLL_B);
> - } else {
> - dev_priv->regfile.saveFPB0 = I915_READ(_FPB0);
> - dev_priv->regfile.saveFPB1 = I915_READ(_FPB1);
> - dev_priv->regfile.saveDPLL_B = I915_READ(_DPLL_B);
> - }
> - if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev))
> - dev_priv->regfile.saveDPLL_B_MD = I915_READ(_DPLL_B_MD);
> - dev_priv->regfile.saveHTOTAL_B = I915_READ(_HTOTAL_B);
> - dev_priv->regfile.saveHBLANK_B = I915_READ(_HBLANK_B);
> - dev_priv->regfile.saveHSYNC_B = I915_READ(_HSYNC_B);
> - dev_priv->regfile.saveVTOTAL_B = I915_READ(_VTOTAL_B);
> - dev_priv->regfile.saveVBLANK_B = I915_READ(_VBLANK_B);
> - dev_priv->regfile.saveVSYNC_B = I915_READ(_VSYNC_B);
> - if (!HAS_PCH_SPLIT(dev))
> - dev_priv->regfile.saveBCLRPAT_B = I915_READ(_BCLRPAT_B);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.savePIPEB_DATA_M1 = I915_READ(_PIPEB_DATA_M1);
> - dev_priv->regfile.savePIPEB_DATA_N1 = I915_READ(_PIPEB_DATA_N1);
> - dev_priv->regfile.savePIPEB_LINK_M1 = I915_READ(_PIPEB_LINK_M1);
> - dev_priv->regfile.savePIPEB_LINK_N1 = I915_READ(_PIPEB_LINK_N1);
> -
> - dev_priv->regfile.saveFDI_TXB_CTL = I915_READ(_FDI_TXB_CTL);
> - dev_priv->regfile.saveFDI_RXB_CTL = I915_READ(_FDI_RXB_CTL);
> -
> - dev_priv->regfile.savePFB_CTL_1 = I915_READ(_PFB_CTL_1);
> - dev_priv->regfile.savePFB_WIN_SZ = I915_READ(_PFB_WIN_SZ);
> - dev_priv->regfile.savePFB_WIN_POS = I915_READ(_PFB_WIN_POS);
> -
> - dev_priv->regfile.saveTRANSBCONF = I915_READ(_PCH_TRANSBCONF);
> - dev_priv->regfile.saveTRANS_HTOTAL_B = I915_READ(_PCH_TRANS_HTOTAL_B);
> - dev_priv->regfile.saveTRANS_HBLANK_B = I915_READ(_PCH_TRANS_HBLANK_B);
> - dev_priv->regfile.saveTRANS_HSYNC_B = I915_READ(_PCH_TRANS_HSYNC_B);
> - dev_priv->regfile.saveTRANS_VTOTAL_B = I915_READ(_PCH_TRANS_VTOTAL_B);
> - dev_priv->regfile.saveTRANS_VBLANK_B = I915_READ(_PCH_TRANS_VBLANK_B);
> - dev_priv->regfile.saveTRANS_VSYNC_B = I915_READ(_PCH_TRANS_VSYNC_B);
> - }
> -
> - dev_priv->regfile.saveDSPBCNTR = I915_READ(_DSPBCNTR);
> - dev_priv->regfile.saveDSPBSTRIDE = I915_READ(_DSPBSTRIDE);
> - dev_priv->regfile.saveDSPBSIZE = I915_READ(_DSPBSIZE);
> - dev_priv->regfile.saveDSPBPOS = I915_READ(_DSPBPOS);
> - dev_priv->regfile.saveDSPBADDR = I915_READ(_DSPBADDR);
> - if (INTEL_INFO(dev)->gen >= 4) {
> - dev_priv->regfile.saveDSPBSURF = I915_READ(_DSPBSURF);
> - dev_priv->regfile.saveDSPBTILEOFF = I915_READ(_DSPBTILEOFF);
> - }
> - i915_save_palette(dev, PIPE_B);
> - dev_priv->regfile.savePIPEBSTAT = I915_READ(_PIPEBSTAT);
> -
> - /* Fences */
> - switch (INTEL_INFO(dev)->gen) {
> - case 7:
> - case 6:
> - for (i = 0; i < 16; i++)
> - dev_priv->regfile.saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
> - break;
> - case 5:
> - case 4:
> - for (i = 0; i < 16; i++)
> - dev_priv->regfile.saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8));
> - break;
> - case 3:
> - if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
> - for (i = 0; i < 8; i++)
> - dev_priv->regfile.saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4));
> - case 2:
> - for (i = 0; i < 8; i++)
> - dev_priv->regfile.saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4));
> - break;
> - }
> -
> - /* CRT state */
> - if (HAS_PCH_SPLIT(dev))
> - dev_priv->regfile.saveADPA = I915_READ(PCH_ADPA);
> - else
> - dev_priv->regfile.saveADPA = I915_READ(ADPA);
> -
> - /* Display Port state */
> - if (SUPPORTS_INTEGRATED_DP(dev)) {
> - dev_priv->regfile.saveDP_B = I915_READ(DP_B);
> - dev_priv->regfile.saveDP_C = I915_READ(DP_C);
> - dev_priv->regfile.saveDP_D = I915_READ(DP_D);
> - dev_priv->regfile.savePIPEA_GMCH_DATA_M = I915_READ(_PIPEA_DATA_M_G4X);
> - dev_priv->regfile.savePIPEB_GMCH_DATA_M = I915_READ(_PIPEB_DATA_M_G4X);
> - dev_priv->regfile.savePIPEA_GMCH_DATA_N = I915_READ(_PIPEA_DATA_N_G4X);
> - dev_priv->regfile.savePIPEB_GMCH_DATA_N = I915_READ(_PIPEB_DATA_N_G4X);
> - dev_priv->regfile.savePIPEA_DP_LINK_M = I915_READ(_PIPEA_LINK_M_G4X);
> - dev_priv->regfile.savePIPEB_DP_LINK_M = I915_READ(_PIPEB_LINK_M_G4X);
> - dev_priv->regfile.savePIPEA_DP_LINK_N = I915_READ(_PIPEA_LINK_N_G4X);
> - dev_priv->regfile.savePIPEB_DP_LINK_N = I915_READ(_PIPEB_LINK_N_G4X);
> - }
> - /* FIXME: regfile.save TV & SDVO state */
> -
> - /* Panel fitter */
> - if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.savePFIT_CONTROL = I915_READ(PFIT_CONTROL);
> - dev_priv->regfile.savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
> - }
> -
> - /* Backlight */
> - if (INTEL_INFO(dev)->gen <= 4)
> - pci_read_config_byte(dev->pdev, PCI_LBPC,
> - &dev_priv->regfile.saveLBB);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - dev_priv->regfile.saveBLC_PWM_CTL = I915_READ(BLC_PWM_PCH_CTL1);
> - dev_priv->regfile.saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_PCH_CTL2);
> - dev_priv->regfile.saveBLC_CPU_PWM_CTL = I915_READ(BLC_PWM_CPU_CTL);
> - dev_priv->regfile.saveBLC_CPU_PWM_CTL2 = I915_READ(BLC_PWM_CPU_CTL2);
> - } else {
> - dev_priv->regfile.saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
> - if (INTEL_INFO(dev)->gen >= 4)
> - dev_priv->regfile.saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
> - dev_priv->regfile.saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL);
> - }
> -
> - return;
> -}
> -
> -void i915_restore_display_reg(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - int dpll_a_reg, fpa0_reg, fpa1_reg;
> - int dpll_b_reg, fpb0_reg, fpb1_reg;
> - int i;
> -
> - /* Backlight */
> - if (INTEL_INFO(dev)->gen <= 4)
> - pci_write_config_byte(dev->pdev, PCI_LBPC,
> - dev_priv->regfile.saveLBB);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->regfile.saveBLC_PWM_CTL);
> - I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2);
> - /* NOTE: BLC_PWM_CPU_CTL must be written after BLC_PWM_CPU_CTL2;
> - * otherwise we get blank eDP screen after S3 on some machines
> - */
> - I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->regfile.saveBLC_CPU_PWM_CTL2);
> - I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->regfile.saveBLC_CPU_PWM_CTL);
> - } else {
> - if (INTEL_INFO(dev)->gen >= 4)
> - I915_WRITE(BLC_PWM_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2);
> - I915_WRITE(BLC_PWM_CTL, dev_priv->regfile.saveBLC_PWM_CTL);
> - I915_WRITE(BLC_HIST_CTL, dev_priv->regfile.saveBLC_HIST_CTL);
> - }
> -
> - /* Panel fitter */
> - if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(PFIT_PGM_RATIOS, dev_priv->regfile.savePFIT_PGM_RATIOS);
> - I915_WRITE(PFIT_CONTROL, dev_priv->regfile.savePFIT_CONTROL);
> - }
> -
> - /* Display port ratios (must be done before clock is set) */
> - if (SUPPORTS_INTEGRATED_DP(dev)) {
> - I915_WRITE(_PIPEA_DATA_M_G4X, dev_priv->regfile.savePIPEA_GMCH_DATA_M);
> - I915_WRITE(_PIPEB_DATA_M_G4X, dev_priv->regfile.savePIPEB_GMCH_DATA_M);
> - I915_WRITE(_PIPEA_DATA_N_G4X, dev_priv->regfile.savePIPEA_GMCH_DATA_N);
> - I915_WRITE(_PIPEB_DATA_N_G4X, dev_priv->regfile.savePIPEB_GMCH_DATA_N);
> - I915_WRITE(_PIPEA_LINK_M_G4X, dev_priv->regfile.savePIPEA_DP_LINK_M);
> - I915_WRITE(_PIPEB_LINK_M_G4X, dev_priv->regfile.savePIPEB_DP_LINK_M);
> - I915_WRITE(_PIPEA_LINK_N_G4X, dev_priv->regfile.savePIPEA_DP_LINK_N);
> - I915_WRITE(_PIPEB_LINK_N_G4X, dev_priv->regfile.savePIPEB_DP_LINK_N);
> - }
> -
> - /* Fences */
> - switch (INTEL_INFO(dev)->gen) {
> - case 7:
> - case 6:
> - for (i = 0; i < 16; i++)
> - I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->regfile.saveFENCE[i]);
> - break;
> - case 5:
> - case 4:
> - for (i = 0; i < 16; i++)
> - I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->regfile.saveFENCE[i]);
> - break;
> - case 3:
> - case 2:
> - if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
> - for (i = 0; i < 8; i++)
> - I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->regfile.saveFENCE[i+8]);
> - for (i = 0; i < 8; i++)
> - I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->regfile.saveFENCE[i]);
> - break;
> - }
> -
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - dpll_a_reg = _PCH_DPLL_A;
> - dpll_b_reg = _PCH_DPLL_B;
> - fpa0_reg = _PCH_FPA0;
> - fpb0_reg = _PCH_FPB0;
> - fpa1_reg = _PCH_FPA1;
> - fpb1_reg = _PCH_FPB1;
> - } else {
> - dpll_a_reg = _DPLL_A;
> - dpll_b_reg = _DPLL_B;
> - fpa0_reg = _FPA0;
> - fpb0_reg = _FPB0;
> - fpa1_reg = _FPA1;
> - fpb1_reg = _FPB1;
> - }
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(PCH_DREF_CONTROL, dev_priv->regfile.savePCH_DREF_CONTROL);
> - I915_WRITE(DISP_ARB_CTL, dev_priv->regfile.saveDISP_ARB_CTL);
> - }
> -
> - /* Pipe & plane A info */
> - /* Prime the clock */
> - if (dev_priv->regfile.saveDPLL_A & DPLL_VCO_ENABLE) {
> - I915_WRITE(dpll_a_reg, dev_priv->regfile.saveDPLL_A &
> - ~DPLL_VCO_ENABLE);
> - POSTING_READ(dpll_a_reg);
> - udelay(150);
> - }
> - I915_WRITE(fpa0_reg, dev_priv->regfile.saveFPA0);
> - I915_WRITE(fpa1_reg, dev_priv->regfile.saveFPA1);
> - /* Actually enable it */
> - I915_WRITE(dpll_a_reg, dev_priv->regfile.saveDPLL_A);
> - POSTING_READ(dpll_a_reg);
> - udelay(150);
> - if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(_DPLL_A_MD, dev_priv->regfile.saveDPLL_A_MD);
> - POSTING_READ(_DPLL_A_MD);
> - }
> - udelay(150);
> -
> - /* Restore mode */
> - I915_WRITE(_HTOTAL_A, dev_priv->regfile.saveHTOTAL_A);
> - I915_WRITE(_HBLANK_A, dev_priv->regfile.saveHBLANK_A);
> - I915_WRITE(_HSYNC_A, dev_priv->regfile.saveHSYNC_A);
> - I915_WRITE(_VTOTAL_A, dev_priv->regfile.saveVTOTAL_A);
> - I915_WRITE(_VBLANK_A, dev_priv->regfile.saveVBLANK_A);
> - I915_WRITE(_VSYNC_A, dev_priv->regfile.saveVSYNC_A);
> - if (!HAS_PCH_SPLIT(dev))
> - I915_WRITE(_BCLRPAT_A, dev_priv->regfile.saveBCLRPAT_A);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(_PIPEA_DATA_M1, dev_priv->regfile.savePIPEA_DATA_M1);
> - I915_WRITE(_PIPEA_DATA_N1, dev_priv->regfile.savePIPEA_DATA_N1);
> - I915_WRITE(_PIPEA_LINK_M1, dev_priv->regfile.savePIPEA_LINK_M1);
> - I915_WRITE(_PIPEA_LINK_N1, dev_priv->regfile.savePIPEA_LINK_N1);
> -
> - I915_WRITE(_FDI_RXA_CTL, dev_priv->regfile.saveFDI_RXA_CTL);
> - I915_WRITE(_FDI_TXA_CTL, dev_priv->regfile.saveFDI_TXA_CTL);
> -
> - I915_WRITE(_PFA_CTL_1, dev_priv->regfile.savePFA_CTL_1);
> - I915_WRITE(_PFA_WIN_SZ, dev_priv->regfile.savePFA_WIN_SZ);
> - I915_WRITE(_PFA_WIN_POS, dev_priv->regfile.savePFA_WIN_POS);
> -
> - I915_WRITE(_PCH_TRANSACONF, dev_priv->regfile.saveTRANSACONF);
> - I915_WRITE(_PCH_TRANS_HTOTAL_A, dev_priv->regfile.saveTRANS_HTOTAL_A);
> - I915_WRITE(_PCH_TRANS_HBLANK_A, dev_priv->regfile.saveTRANS_HBLANK_A);
> - I915_WRITE(_PCH_TRANS_HSYNC_A, dev_priv->regfile.saveTRANS_HSYNC_A);
> - I915_WRITE(_PCH_TRANS_VTOTAL_A, dev_priv->regfile.saveTRANS_VTOTAL_A);
> - I915_WRITE(_PCH_TRANS_VBLANK_A, dev_priv->regfile.saveTRANS_VBLANK_A);
> - I915_WRITE(_PCH_TRANS_VSYNC_A, dev_priv->regfile.saveTRANS_VSYNC_A);
> - }
> -
> - /* Restore plane info */
> - I915_WRITE(_DSPASIZE, dev_priv->regfile.saveDSPASIZE);
> - I915_WRITE(_DSPAPOS, dev_priv->regfile.saveDSPAPOS);
> - I915_WRITE(_PIPEASRC, dev_priv->regfile.savePIPEASRC);
> - I915_WRITE(_DSPAADDR, dev_priv->regfile.saveDSPAADDR);
> - I915_WRITE(_DSPASTRIDE, dev_priv->regfile.saveDSPASTRIDE);
> - if (INTEL_INFO(dev)->gen >= 4) {
> - I915_WRITE(_DSPASURF, dev_priv->regfile.saveDSPASURF);
> - I915_WRITE(_DSPATILEOFF, dev_priv->regfile.saveDSPATILEOFF);
> - }
> -
> - I915_WRITE(_PIPEACONF, dev_priv->regfile.savePIPEACONF);
> -
> - i915_restore_palette(dev, PIPE_A);
> - /* Enable the plane */
> - I915_WRITE(_DSPACNTR, dev_priv->regfile.saveDSPACNTR);
> - I915_WRITE(_DSPAADDR, I915_READ(_DSPAADDR));
> -
> - /* Pipe & plane B info */
> - if (dev_priv->regfile.saveDPLL_B & DPLL_VCO_ENABLE) {
> - I915_WRITE(dpll_b_reg, dev_priv->regfile.saveDPLL_B &
> - ~DPLL_VCO_ENABLE);
> - POSTING_READ(dpll_b_reg);
> - udelay(150);
> - }
> - I915_WRITE(fpb0_reg, dev_priv->regfile.saveFPB0);
> - I915_WRITE(fpb1_reg, dev_priv->regfile.saveFPB1);
> - /* Actually enable it */
> - I915_WRITE(dpll_b_reg, dev_priv->regfile.saveDPLL_B);
> - POSTING_READ(dpll_b_reg);
> - udelay(150);
> - if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(_DPLL_B_MD, dev_priv->regfile.saveDPLL_B_MD);
> - POSTING_READ(_DPLL_B_MD);
> - }
> - udelay(150);
> -
> - /* Restore mode */
> - I915_WRITE(_HTOTAL_B, dev_priv->regfile.saveHTOTAL_B);
> - I915_WRITE(_HBLANK_B, dev_priv->regfile.saveHBLANK_B);
> - I915_WRITE(_HSYNC_B, dev_priv->regfile.saveHSYNC_B);
> - I915_WRITE(_VTOTAL_B, dev_priv->regfile.saveVTOTAL_B);
> - I915_WRITE(_VBLANK_B, dev_priv->regfile.saveVBLANK_B);
> - I915_WRITE(_VSYNC_B, dev_priv->regfile.saveVSYNC_B);
> - if (!HAS_PCH_SPLIT(dev))
> - I915_WRITE(_BCLRPAT_B, dev_priv->regfile.saveBCLRPAT_B);
> -
> - if (HAS_PCH_SPLIT(dev)) {
> - I915_WRITE(_PIPEB_DATA_M1, dev_priv->regfile.savePIPEB_DATA_M1);
> - I915_WRITE(_PIPEB_DATA_N1, dev_priv->regfile.savePIPEB_DATA_N1);
> - I915_WRITE(_PIPEB_LINK_M1, dev_priv->regfile.savePIPEB_LINK_M1);
> - I915_WRITE(_PIPEB_LINK_N1, dev_priv->regfile.savePIPEB_LINK_N1);
> -
> - I915_WRITE(_FDI_RXB_CTL, dev_priv->regfile.saveFDI_RXB_CTL);
> - I915_WRITE(_FDI_TXB_CTL, dev_priv->regfile.saveFDI_TXB_CTL);
> -
> - I915_WRITE(_PFB_CTL_1, dev_priv->regfile.savePFB_CTL_1);
> - I915_WRITE(_PFB_WIN_SZ, dev_priv->regfile.savePFB_WIN_SZ);
> - I915_WRITE(_PFB_WIN_POS, dev_priv->regfile.savePFB_WIN_POS);
> -
> - I915_WRITE(_PCH_TRANSBCONF, dev_priv->regfile.saveTRANSBCONF);
> - I915_WRITE(_PCH_TRANS_HTOTAL_B, dev_priv->regfile.saveTRANS_HTOTAL_B);
> - I915_WRITE(_PCH_TRANS_HBLANK_B, dev_priv->regfile.saveTRANS_HBLANK_B);
> - I915_WRITE(_PCH_TRANS_HSYNC_B, dev_priv->regfile.saveTRANS_HSYNC_B);
> - I915_WRITE(_PCH_TRANS_VTOTAL_B, dev_priv->regfile.saveTRANS_VTOTAL_B);
> - I915_WRITE(_PCH_TRANS_VBLANK_B, dev_priv->regfile.saveTRANS_VBLANK_B);
> - I915_WRITE(_PCH_TRANS_VSYNC_B, dev_priv->regfile.saveTRANS_VSYNC_B);
> - }
> -
> - /* Restore plane info */
> - I915_WRITE(_DSPBSIZE, dev_priv->regfile.saveDSPBSIZE);
> - I915_WRITE(_DSPBPOS, dev_priv->regfile.saveDSPBPOS);
> - I915_WRITE(_PIPEBSRC, dev_priv->regfile.savePIPEBSRC);
> - I915_WRITE(_DSPBADDR, dev_priv->regfile.saveDSPBADDR);
> - I915_WRITE(_DSPBSTRIDE, dev_priv->regfile.saveDSPBSTRIDE);
> - if (INTEL_INFO(dev)->gen >= 4) {
> - I915_WRITE(_DSPBSURF, dev_priv->regfile.saveDSPBSURF);
> - I915_WRITE(_DSPBTILEOFF, dev_priv->regfile.saveDSPBTILEOFF);
> - }
> -
> - I915_WRITE(_PIPEBCONF, dev_priv->regfile.savePIPEBCONF);
> -
> - i915_restore_palette(dev, PIPE_B);
> - /* Enable the plane */
> - I915_WRITE(_DSPBCNTR, dev_priv->regfile.saveDSPBCNTR);
> - I915_WRITE(_DSPBADDR, I915_READ(_DSPBADDR));
> -
> - /* Cursor state */
> - I915_WRITE(_CURAPOS, dev_priv->regfile.saveCURAPOS);
> - I915_WRITE(_CURACNTR, dev_priv->regfile.saveCURACNTR);
> - I915_WRITE(_CURABASE, dev_priv->regfile.saveCURABASE);
> - I915_WRITE(_CURBPOS, dev_priv->regfile.saveCURBPOS);
> - I915_WRITE(_CURBCNTR, dev_priv->regfile.saveCURBCNTR);
> - I915_WRITE(_CURBBASE, dev_priv->regfile.saveCURBBASE);
> - if (IS_GEN2(dev))
> - I915_WRITE(CURSIZE, dev_priv->regfile.saveCURSIZE);
> -
> - /* CRT state */
> - if (HAS_PCH_SPLIT(dev))
> - I915_WRITE(PCH_ADPA, dev_priv->regfile.saveADPA);
> - else
> - I915_WRITE(ADPA, dev_priv->regfile.saveADPA);
> -
> - /* Display Port state */
> - if (SUPPORTS_INTEGRATED_DP(dev)) {
> - I915_WRITE(DP_B, dev_priv->regfile.saveDP_B);
> - I915_WRITE(DP_C, dev_priv->regfile.saveDP_C);
> - I915_WRITE(DP_D, dev_priv->regfile.saveDP_D);
> - }
> - /* FIXME: restore TV & SDVO state */
> -
> - return;
> -}
> --
> 2.1.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
More information about the Intel-gfx
mailing list