drm/i915: fix tiling on IGDNG
[pandora-kernel.git] / drivers / gpu / drm / i915 / i915_reg.h
index 6c08584..e38cd21 100644 (file)
@@ -55,7 +55,7 @@
 /* PCI config space */
 
 #define HPLLCC 0xc0 /* 855 only */
-#define   GC_CLOCK_CONTROL_MASK                (3 << 0)
+#define   GC_CLOCK_CONTROL_MASK                (0xf << 0)
 #define   GC_CLOCK_133_200             (0 << 0)
 #define   GC_CLOCK_100_200             (1 << 0)
 #define   GC_CLOCK_100_133             (2 << 0)
 #define   GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4)
 #define   GC_DISPLAY_CLOCK_333_MHZ     (4 << 4)
 #define   GC_DISPLAY_CLOCK_MASK                (7 << 4)
+#define   GM45_GC_RENDER_CLOCK_MASK    (0xf << 0)
+#define   GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0)
+#define   GM45_GC_RENDER_CLOCK_320_MHZ (9 << 0)
+#define   GM45_GC_RENDER_CLOCK_400_MHZ (0xb << 0)
+#define   GM45_GC_RENDER_CLOCK_533_MHZ (0xc << 0)
+#define   I965_GC_RENDER_CLOCK_MASK    (0xf << 0)
+#define   I965_GC_RENDER_CLOCK_267_MHZ (2 << 0)
+#define   I965_GC_RENDER_CLOCK_333_MHZ (3 << 0)
+#define   I965_GC_RENDER_CLOCK_444_MHZ (4 << 0)
+#define   I965_GC_RENDER_CLOCK_533_MHZ (5 << 0)
+#define   I945_GC_RENDER_CLOCK_MASK    (7 << 0)
+#define   I945_GC_RENDER_CLOCK_166_MHZ (0 << 0)
+#define   I945_GC_RENDER_CLOCK_200_MHZ (1 << 0)
+#define   I945_GC_RENDER_CLOCK_250_MHZ (3 << 0)
+#define   I945_GC_RENDER_CLOCK_400_MHZ (5 << 0)
+#define   I915_GC_RENDER_CLOCK_MASK    (7 << 0)
+#define   I915_GC_RENDER_CLOCK_166_MHZ (0 << 0)
+#define   I915_GC_RENDER_CLOCK_200_MHZ (1 << 0)
+#define   I915_GC_RENDER_CLOCK_333_MHZ (4 << 0)
 #define LBB    0xf4
 
 /* VGA stuff */
 #define   DPLLA_TEST_M_BYPASS          (1 << 2)
 #define   DPLLA_INPUT_BUFFER_ENABLE    (1 << 0)
 #define D_STATE                0x6104
-#define CG_2D_DIS      0x6200
-#define DPCUNIT_CLOCK_GATE_DISABLE     (1 << 24)
-#define CG_3D_DIS      0x6204
+#define  DSTATE_PLL_D3_OFF                     (1<<3)
+#define  DSTATE_GFX_CLOCK_GATING               (1<<1)
+#define  DSTATE_DOT_CLOCK_GATING               (1<<0)
+#define DSPCLK_GATE_D          0x6200
+# define DPUNIT_B_CLOCK_GATE_DISABLE           (1 << 30) /* 965 */
+# define VSUNIT_CLOCK_GATE_DISABLE             (1 << 29) /* 965 */
+# define VRHUNIT_CLOCK_GATE_DISABLE            (1 << 28) /* 965 */
+# define VRDUNIT_CLOCK_GATE_DISABLE            (1 << 27) /* 965 */
+# define AUDUNIT_CLOCK_GATE_DISABLE            (1 << 26) /* 965 */
+# define DPUNIT_A_CLOCK_GATE_DISABLE           (1 << 25) /* 965 */
+# define DPCUNIT_CLOCK_GATE_DISABLE            (1 << 24) /* 965 */
+# define TVRUNIT_CLOCK_GATE_DISABLE            (1 << 23) /* 915-945 */
+# define TVCUNIT_CLOCK_GATE_DISABLE            (1 << 22) /* 915-945 */
+# define TVFUNIT_CLOCK_GATE_DISABLE            (1 << 21) /* 915-945 */
+# define TVEUNIT_CLOCK_GATE_DISABLE            (1 << 20) /* 915-945 */
+# define DVSUNIT_CLOCK_GATE_DISABLE            (1 << 19) /* 915-945 */
+# define DSSUNIT_CLOCK_GATE_DISABLE            (1 << 18) /* 915-945 */
+# define DDBUNIT_CLOCK_GATE_DISABLE            (1 << 17) /* 915-945 */
+# define DPRUNIT_CLOCK_GATE_DISABLE            (1 << 16) /* 915-945 */
+# define DPFUNIT_CLOCK_GATE_DISABLE            (1 << 15) /* 915-945 */
+# define DPBMUNIT_CLOCK_GATE_DISABLE           (1 << 14) /* 915-945 */
+# define DPLSUNIT_CLOCK_GATE_DISABLE           (1 << 13) /* 915-945 */
+# define DPLUNIT_CLOCK_GATE_DISABLE            (1 << 12) /* 915-945 */
+# define DPOUNIT_CLOCK_GATE_DISABLE            (1 << 11)
+# define DPBUNIT_CLOCK_GATE_DISABLE            (1 << 10)
+# define DCUNIT_CLOCK_GATE_DISABLE             (1 << 9)
+# define DPUNIT_CLOCK_GATE_DISABLE             (1 << 8)
+# define VRUNIT_CLOCK_GATE_DISABLE             (1 << 7) /* 915+: reserved */
+# define OVHUNIT_CLOCK_GATE_DISABLE            (1 << 6) /* 830-865 */
+# define DPIOUNIT_CLOCK_GATE_DISABLE           (1 << 6) /* 915-945 */
+# define OVFUNIT_CLOCK_GATE_DISABLE            (1 << 5)
+# define OVBUNIT_CLOCK_GATE_DISABLE            (1 << 4)
+/**
+ * This bit must be set on the 830 to prevent hangs when turning off the
+ * overlay scaler.
+ */
+# define OVRUNIT_CLOCK_GATE_DISABLE            (1 << 3)
+# define OVCUNIT_CLOCK_GATE_DISABLE            (1 << 2)
+# define OVUUNIT_CLOCK_GATE_DISABLE            (1 << 1)
+# define ZVUNIT_CLOCK_GATE_DISABLE             (1 << 0) /* 830 */
+# define OVLUNIT_CLOCK_GATE_DISABLE            (1 << 0) /* 845,865 */
+
+#define RENCLK_GATE_D1         0x6204
+# define BLITTER_CLOCK_GATE_DISABLE            (1 << 13) /* 945GM only */
+# define MPEG_CLOCK_GATE_DISABLE               (1 << 12) /* 945GM only */
+# define PC_FE_CLOCK_GATE_DISABLE              (1 << 11)
+# define PC_BE_CLOCK_GATE_DISABLE              (1 << 10)
+# define WINDOWER_CLOCK_GATE_DISABLE           (1 << 9)
+# define INTERPOLATOR_CLOCK_GATE_DISABLE       (1 << 8)
+# define COLOR_CALCULATOR_CLOCK_GATE_DISABLE   (1 << 7)
+# define MOTION_COMP_CLOCK_GATE_DISABLE                (1 << 6)
+# define MAG_CLOCK_GATE_DISABLE                        (1 << 5)
+/** This bit must be unset on 855,865 */
+# define MECI_CLOCK_GATE_DISABLE               (1 << 4)
+# define DCMP_CLOCK_GATE_DISABLE               (1 << 3)
+# define MEC_CLOCK_GATE_DISABLE                        (1 << 2)
+# define MECO_CLOCK_GATE_DISABLE               (1 << 1)
+/** This bit must be set on 855,865. */
+# define SV_CLOCK_GATE_DISABLE                 (1 << 0)
+# define I915_MPEG_CLOCK_GATE_DISABLE          (1 << 16)
+# define I915_VLD_IP_PR_CLOCK_GATE_DISABLE     (1 << 15)
+# define I915_MOTION_COMP_CLOCK_GATE_DISABLE   (1 << 14)
+# define I915_BD_BF_CLOCK_GATE_DISABLE         (1 << 13)
+# define I915_SF_SE_CLOCK_GATE_DISABLE         (1 << 12)
+# define I915_WM_CLOCK_GATE_DISABLE            (1 << 11)
+# define I915_IZ_CLOCK_GATE_DISABLE            (1 << 10)
+# define I915_PI_CLOCK_GATE_DISABLE            (1 << 9)
+# define I915_DI_CLOCK_GATE_DISABLE            (1 << 8)
+# define I915_SH_SV_CLOCK_GATE_DISABLE         (1 << 7)
+# define I915_PL_DG_QC_FT_CLOCK_GATE_DISABLE   (1 << 6)
+# define I915_SC_CLOCK_GATE_DISABLE            (1 << 5)
+# define I915_FL_CLOCK_GATE_DISABLE            (1 << 4)
+# define I915_DM_CLOCK_GATE_DISABLE            (1 << 3)
+# define I915_PS_CLOCK_GATE_DISABLE            (1 << 2)
+# define I915_CC_CLOCK_GATE_DISABLE            (1 << 1)
+# define I915_BY_CLOCK_GATE_DISABLE            (1 << 0)
+
+# define I965_RCZ_CLOCK_GATE_DISABLE           (1 << 30)
+/** This bit must always be set on 965G/965GM */
+# define I965_RCC_CLOCK_GATE_DISABLE           (1 << 29)
+# define I965_RCPB_CLOCK_GATE_DISABLE          (1 << 28)
+# define I965_DAP_CLOCK_GATE_DISABLE           (1 << 27)
+# define I965_ROC_CLOCK_GATE_DISABLE           (1 << 26)
+# define I965_GW_CLOCK_GATE_DISABLE            (1 << 25)
+# define I965_TD_CLOCK_GATE_DISABLE            (1 << 24)
+/** This bit must always be set on 965G */
+# define I965_ISC_CLOCK_GATE_DISABLE           (1 << 23)
+# define I965_IC_CLOCK_GATE_DISABLE            (1 << 22)
+# define I965_EU_CLOCK_GATE_DISABLE            (1 << 21)
+# define I965_IF_CLOCK_GATE_DISABLE            (1 << 20)
+# define I965_TC_CLOCK_GATE_DISABLE            (1 << 19)
+# define I965_SO_CLOCK_GATE_DISABLE            (1 << 17)
+# define I965_FBC_CLOCK_GATE_DISABLE           (1 << 16)
+# define I965_MARI_CLOCK_GATE_DISABLE          (1 << 15)
+# define I965_MASF_CLOCK_GATE_DISABLE          (1 << 14)
+# define I965_MAWB_CLOCK_GATE_DISABLE          (1 << 13)
+# define I965_EM_CLOCK_GATE_DISABLE            (1 << 12)
+# define I965_UC_CLOCK_GATE_DISABLE            (1 << 11)
+# define I965_SI_CLOCK_GATE_DISABLE            (1 << 6)
+# define I965_MT_CLOCK_GATE_DISABLE            (1 << 5)
+# define I965_PL_CLOCK_GATE_DISABLE            (1 << 4)
+# define I965_DG_CLOCK_GATE_DISABLE            (1 << 3)
+# define I965_QC_CLOCK_GATE_DISABLE            (1 << 2)
+# define I965_FT_CLOCK_GATE_DISABLE            (1 << 1)
+# define I965_DM_CLOCK_GATE_DISABLE            (1 << 0)
+
+#define RENCLK_GATE_D2         0x6208
+#define VF_UNIT_CLOCK_GATE_DISABLE             (1 << 9)
+#define GS_UNIT_CLOCK_GATE_DISABLE             (1 << 7)
+#define CL_UNIT_CLOCK_GATE_DISABLE             (1 << 6)
+#define RAMCLK_GATE_D          0x6210          /* CRL only */
+#define DEUC                   0x6214          /* CRL only */
 
 /*
  * Palette regs
 #define   SDVOB_HOTPLUG_INT_EN                 (1 << 26)
 #define   SDVOC_HOTPLUG_INT_EN                 (1 << 25)
 #define   TV_HOTPLUG_INT_EN                    (1 << 18)
+#define   CRT_EOS_INT_EN                       (1 << 10)
 #define   CRT_HOTPLUG_INT_EN                   (1 << 9)
 #define   CRT_HOTPLUG_FORCE_DETECT             (1 << 3)
 #define CRT_HOTPLUG_ACTIVATION_PERIOD_32       (0 << 8)
 #define   DPC_HOTPLUG_INT_STATUS               (1 << 28)
 #define   HDMID_HOTPLUG_INT_STATUS             (1 << 27)
 #define   DPD_HOTPLUG_INT_STATUS               (1 << 27)
+#define   CRT_EOS_INT_STATUS                   (1 << 12)
 #define   CRT_HOTPLUG_INT_STATUS               (1 << 11)
 #define   TV_HOTPLUG_INT_STATUS                        (1 << 10)
 #define   CRT_HOTPLUG_MONITOR_MASK             (3 << 8)
 #define TV_V_CHROMA_42         0x684a8
 
 /* Display Port */
+#define DP_A                           0x64000 /* eDP */
 #define DP_B                           0x64100
 #define DP_C                           0x64200
 #define DP_D                           0x64300
 /* Mystic DPCD version 1.1 special mode */
 #define   DP_ENHANCED_FRAMING          (1 << 18)
 
+/* eDP */
+#define   DP_PLL_FREQ_270MHZ           (0 << 16)
+#define   DP_PLL_FREQ_160MHZ           (1 << 16)
+#define   DP_PLL_FREQ_MASK             (3 << 16)
+
 /** locked once port is enabled */
 #define   DP_PORT_REVERSAL             (1 << 15)
 
+/* eDP */
+#define   DP_PLL_ENABLE                        (1 << 14)
+
 /** sends the clock on lane 15 of the PEG for debug */
 #define   DP_CLOCK_OUTPUT_ENABLE       (1 << 13)
 
 #define   DP_SCRAMBLING_DISABLE                (1 << 12)
+#define   DP_SCRAMBLING_DISABLE_IGDNG  (1 << 7)
 
 /** limit RGB values to avoid confusing TVs */
 #define   DP_COLOR_RANGE_16_235                (1 << 8)
  * is 20 bytes in each direction, hence the 5 fixed
  * data registers
  */
+#define DPA_AUX_CH_CTL                 0x64010
+#define DPA_AUX_CH_DATA1               0x64014
+#define DPA_AUX_CH_DATA2               0x64018
+#define DPA_AUX_CH_DATA3               0x6401c
+#define DPA_AUX_CH_DATA4               0x64020
+#define DPA_AUX_CH_DATA5               0x64024
+
 #define DPB_AUX_CH_CTL                 0x64110
 #define DPB_AUX_CH_DATA1               0x64114
 #define DPB_AUX_CH_DATA2               0x64118
 #define   PIPECONF_PROGRESSIVE (0 << 21)
 #define   PIPECONF_INTERLACE_W_FIELD_INDICATION        (6 << 21)
 #define   PIPECONF_INTERLACE_FIELD_0_ONLY              (7 << 21)
+#define   PIPECONF_CXSR_DOWNCLOCK      (1<<16)
 #define PIPEASTAT              0x70024
 #define   PIPE_FIFO_UNDERRUN_STATUS            (1UL<<31)
 #define   PIPE_CRC_ERROR_ENABLE                        (1UL<<29)
 #define I830_FIFO_LINE_SIZE    32
 #define I945_FIFO_SIZE         127 /* 945 & 965 */
 #define I915_FIFO_SIZE         95
-#define I855GM_FIFO_SIZE       255
+#define I855GM_FIFO_SIZE       127 /* In cachelines */
 #define I830_FIFO_SIZE         95
 #define I915_MAX_WM            0x3f
 
 #define   DISPPLANE_NO_LINE_DOUBLE             0
 #define   DISPPLANE_STEREO_POLARITY_FIRST      0
 #define   DISPPLANE_STEREO_POLARITY_SECOND     (1<<18)
+#define   DISPPLANE_TRICKLE_FEED_DISABLE       (1<<14) /* IGDNG */
 #define   DISPPLANE_TILED                      (1<<10)
 #define DSPAADDR               0x70184
 #define DSPASTRIDE             0x70188
 #define PFA_CTL_1               0x68080
 #define PFB_CTL_1               0x68880
 #define  PF_ENABLE              (1<<31)
+#define PFA_WIN_SZ             0x68074
+#define PFB_WIN_SZ             0x68874
 
 /* legacy palette */
 #define LGC_PALETTE_A           0x4a000
 #define GTIIR   0x44018
 #define GTIER   0x4401c
 
+#define DISP_ARB_CTL   0x45000
+#define  DISP_TILE_SURFACE_SWIZZLING   (1<<13)
+
 /* PCH */
 
 /* south display engine interrupt */
 #define PCH_PP_OFF_DELAYS      0xc720c
 #define PCH_PP_DIVISOR         0xc7210
 
+#define PCH_DP_B               0xe4100
+#define PCH_DPB_AUX_CH_CTL     0xe4110
+#define PCH_DPB_AUX_CH_DATA1   0xe4114
+#define PCH_DPB_AUX_CH_DATA2   0xe4118
+#define PCH_DPB_AUX_CH_DATA3   0xe411c
+#define PCH_DPB_AUX_CH_DATA4   0xe4120
+#define PCH_DPB_AUX_CH_DATA5   0xe4124
+
+#define PCH_DP_C               0xe4200
+#define PCH_DPC_AUX_CH_CTL     0xe4210
+#define PCH_DPC_AUX_CH_DATA1   0xe4214
+#define PCH_DPC_AUX_CH_DATA2   0xe4218
+#define PCH_DPC_AUX_CH_DATA3   0xe421c
+#define PCH_DPC_AUX_CH_DATA4   0xe4220
+#define PCH_DPC_AUX_CH_DATA5   0xe4224
+
+#define PCH_DP_D               0xe4300
+#define PCH_DPD_AUX_CH_CTL     0xe4310
+#define PCH_DPD_AUX_CH_DATA1   0xe4314
+#define PCH_DPD_AUX_CH_DATA2   0xe4318
+#define PCH_DPD_AUX_CH_DATA3   0xe431c
+#define PCH_DPD_AUX_CH_DATA4   0xe4320
+#define PCH_DPD_AUX_CH_DATA5   0xe4324
+
 #endif /* _I915_REG_H_ */