Merge tag 'v3.7-rc2' into drm-intel-next-queued
[pandora-kernel.git] / drivers / gpu / drm / i915 / i915_reg.h
index a4162dd..2a48e47 100644 (file)
 #define   MI_INVALIDATE_TLB    (1<<18)
 #define   MI_INVALIDATE_BSD    (1<<7)
 #define MI_BATCH_BUFFER                MI_INSTR(0x30, 1)
-#define   MI_BATCH_NON_SECURE  (1)
-#define   MI_BATCH_NON_SECURE_I965 (1<<8)
+#define   MI_BATCH_NON_SECURE          (1)
+/* for snb/ivb/vlv this also means "batch in ppgtt" when ppgtt is enabled. */
+#define   MI_BATCH_NON_SECURE_I965     (1<<8)
+#define   MI_BATCH_PPGTT_HSW           (1<<8)
+#define   MI_BATCH_NON_SECURE_HSW      (1<<13)
 #define MI_BATCH_BUFFER_START  MI_INSTR(0x31, 0)
 #define   MI_BATCH_GTT             (2<<6) /* aliased with (1<<7) on gen4 */
 #define MI_SEMAPHORE_MBOX      MI_INSTR(0x16, 1) /* gen6+ */
 #define   DPIO_PLL_MODESEL_SHIFT       24 /* 3 bits */
 #define   DPIO_BIAS_CURRENT_CTL_SHIFT  21 /* 3 bits, always 0x7 */
 #define   DPIO_PLL_REFCLK_SEL_SHIFT    16 /* 2 bits */
+#define   DPIO_PLL_REFCLK_SEL_MASK     3
 #define   DPIO_DRIVER_CTL_SHIFT                12 /* always set to 0x8 */
 #define   DPIO_CLK_BIAS_CTL_SHIFT      8 /* always set to 0x5 */
 #define _DPIO_REFSFR_B                 0x8034
 
 #define DPIO_FASTCLK_DISABLE           0x8100
 
+#define DPIO_DATA_CHANNEL1             0x8220
+#define DPIO_DATA_CHANNEL2             0x8420
+
 /*
  * Fence registers
  */
  */
 # define _3D_CHICKEN2_WM_READ_PIPELINED                        (1 << 14)
 #define _3D_CHICKEN3   0x02090
+#define  _3D_CHICKEN_SF_DISABLE_OBJEND_CULL            (1 << 10)
 #define  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL         (1 << 5)
 
 #define MI_MODE                0x0209c
 #define   PIPECONF_GAMMA               (1<<24)
 #define   PIPECONF_FORCE_BORDER        (1<<25)
 #define   PIPECONF_INTERLACE_MASK      (7 << 21)
+#define   PIPECONF_INTERLACE_MASK_HSW  (3 << 21)
 /* Note that pre-gen3 does not support interlaced display directly. Panel
  * fitting must be disabled on pre-ilk for interlaced. */
 #define   PIPECONF_PROGRESSIVE                 (0 << 21)
 #define DISPLAY_PORT_PLL_BIOS_1         0x46010
 #define DISPLAY_PORT_PLL_BIOS_2         0x46014
 
-#define PCH_DSPCLK_GATE_D      0x42020
-# define DPFCUNIT_CLOCK_GATE_DISABLE           (1 << 9)
-# define DPFCRUNIT_CLOCK_GATE_DISABLE          (1 << 8)
-# define DPFDUNIT_CLOCK_GATE_DISABLE           (1 << 7)
-# define DPARBUNIT_CLOCK_GATE_DISABLE          (1 << 5)
-
 #define PCH_3DCGDIS0           0x46020
 # define MARIUNIT_CLOCK_GATE_DISABLE           (1 << 18)
 # define SVSMUNIT_CLOCK_GATE_DISABLE           (1 << 1)
 #define  ILK_HDCP_DISABLE              (1<<25)
 #define  ILK_eDP_A_DISABLE             (1<<24)
 #define  ILK_DESKTOP                   (1<<23)
-#define ILK_DSPCLK_GATE                0x42020
-#define  IVB_VRHUNIT_CLK_GATE  (1<<28)
-#define  ILK_DPARB_CLK_GATE    (1<<5)
-#define  ILK_DPFD_CLK_GATE     (1<<7)
 
-/* According to spec this bit 7/8/9 of 0x42020 should be set to enable FBC */
-#define   ILK_CLK_FBC          (1<<7)
-#define   ILK_DPFC_DIS1                (1<<8)
-#define   ILK_DPFC_DIS2                (1<<9)
+#define ILK_DSPCLK_GATE_D                      0x42020
+#define   ILK_VRHUNIT_CLOCK_GATE_DISABLE       (1 << 28)
+#define   ILK_DPFCUNIT_CLOCK_GATE_DISABLE      (1 << 9)
+#define   ILK_DPFCRUNIT_CLOCK_GATE_DISABLE     (1 << 8)
+#define   ILK_DPFDUNIT_CLOCK_GATE_ENABLE       (1 << 7)
+#define   ILK_DPARBUNIT_CLOCK_GATE_ENABLE      (1 << 5)
 
 #define IVB_CHICKEN3   0x4200c
 # define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE     (1 << 5)
 #define GEN7_L3_CHICKEN_MODE_REGISTER          0xB030
 #define  GEN7_WA_L3_CHICKEN_MODE                               0x20000000
 
+#define GEN7_L3SQCREG4                         0xb034
+#define  L3SQ_URB_READ_CAM_MATCH_DISABLE       (1<<27)
+
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG         0x9030
 #define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB      (1<<11)
 
+#define HSW_FUSE_STRAP         0x42014
+#define  HSW_CDCLK_LIMIT       (1 << 24)
+
 /* PCH */
 
 /* south display engine interrupt: IBX */
 #define TVIDEO_DIP_DATA(pipe) _PIPE(pipe, _VIDEO_DIP_DATA_A, _VIDEO_DIP_DATA_B)
 #define TVIDEO_DIP_GCP(pipe) _PIPE(pipe, _VIDEO_DIP_GCP_A, _VIDEO_DIP_GCP_B)
 
-#define VLV_VIDEO_DIP_CTL_A            0x60220
+#define VLV_VIDEO_DIP_CTL_A            0x60200
 #define VLV_VIDEO_DIP_DATA_A           0x60208
 #define VLV_VIDEO_DIP_GDCP_PAYLOAD_A   0x60210
 
 #define  FORCEWAKE_ACK_HSW                     0x130044
 #define  FORCEWAKE_ACK                         0x130090
 #define  FORCEWAKE_MT                          0xa188 /* multi-threaded */
+#define   FORCEWAKE_KERNEL                     0x1
+#define   FORCEWAKE_USER                       0x2
 #define  FORCEWAKE_MT_ACK                      0x130040
 #define  ECOBUS                                        0xa180
 #define    FORCEWAKE_MT_ENABLE                 (1<<5)
 #define   GEN6_READ_OC_PARAMS                  0xc
 #define   GEN6_PCODE_WRITE_MIN_FREQ_TABLE      0x8
 #define   GEN6_PCODE_READ_MIN_FREQ_TABLE       0x9
+#define          GEN6_PCODE_WRITE_RC6VIDS              0x4
+#define          GEN6_PCODE_READ_RC6VIDS               0x5
+#define   GEN6_ENCODE_RC6_VID(mv)              (((mv) / 5) - 245) < 0 ?: 0
+#define   GEN6_DECODE_RC6_VID(vids)            (((vids) * 5) > 0 ? ((vids) * 5) + 245 : 0)
 #define GEN6_PCODE_DATA                                0x138128
 #define   GEN6_PCODE_FREQ_IA_RATIO_SHIFT       8
 
 /* Those bits are ignored by pipe EDP since it can only connect to DDI A */
 #define  PIPE_DDI_PORT_MASK            (7<<28)
 #define  PIPE_DDI_SELECT_PORT(x)       ((x)<<28)
+#define  PIPE_DDI_PORT_NONE            (0<<28)
 #define  PIPE_DDI_MODE_SELECT_MASK     (7<<24)
 #define  PIPE_DDI_MODE_SELECT_HDMI     (0<<24)
 #define  PIPE_DDI_MODE_SELECT_DVI      (1<<24)
 #define  DP_TP_CTL_LINK_TRAIN_MASK             (7<<8)
 #define  DP_TP_CTL_LINK_TRAIN_PAT1             (0<<8)
 #define  DP_TP_CTL_LINK_TRAIN_PAT2             (1<<8)
+#define  DP_TP_CTL_LINK_TRAIN_PAT3             (4<<8)
+#define  DP_TP_CTL_LINK_TRAIN_IDLE             (2<<8)
 #define  DP_TP_CTL_LINK_TRAIN_NORMAL           (3<<8)
+#define  DP_TP_CTL_SCRAMBLE_DISABLE            (1<<7)
 
 /* DisplayPort Transport Status */
 #define DP_TP_STATUS_A                 0x64044
 #define DP_TP_STATUS_B                 0x64144
 #define DP_TP_STATUS(port) _PORT(port, DP_TP_STATUS_A, DP_TP_STATUS_B)
+#define  DP_TP_STATUS_IDLE_DONE                (1<<25)
 #define  DP_TP_STATUS_AUTOTRAIN_DONE   (1<<12)
 
 /* DDI Buffer Control */
 /* SPLL */
 #define SPLL_CTL                       0x46020
 #define  SPLL_PLL_ENABLE               (1<<31)
-#define  SPLL_PLL_SCC                  (1<<28)
-#define  SPLL_PLL_NON_SCC              (2<<28)
+#define  SPLL_PLL_SSC                  (1<<28)
+#define  SPLL_PLL_NON_SSC              (2<<28)
 #define  SPLL_PLL_FREQ_810MHz          (0<<26)
 #define  SPLL_PLL_FREQ_1350MHz         (1<<26)
 
 #define WRPLL_CTL2                     0x46060
 #define  WRPLL_PLL_ENABLE              (1<<31)
 #define  WRPLL_PLL_SELECT_SSC          (0x01<<28)
-#define  WRPLL_PLL_SELECT_NON_SCC      (0x02<<28)
+#define  WRPLL_PLL_SELECT_NON_SSC      (0x02<<28)
 #define  WRPLL_PLL_SELECT_LCPLL_2700   (0x03<<28)
 /* WRPLL divider programming */
 #define  WRPLL_DIVIDER_REFERENCE(x)    ((x)<<0)
 #define  PORT_CLK_SEL_SPLL             (3<<29)
 #define  PORT_CLK_SEL_WRPLL1           (4<<29)
 #define  PORT_CLK_SEL_WRPLL2           (5<<29)
+#define  PORT_CLK_SEL_NONE             (7<<29)
 
 /* Pipe clock selection */
 #define PIPE_CLK_SEL_A                 0x46140
 #define  PIPE_CLK_SEL_DISABLED         (0x0<<29)
 #define  PIPE_CLK_SEL_PORT(x)          ((x+1)<<29)
 
+#define _PIPEA_MSA_MISC                        0x60410
+#define _PIPEB_MSA_MISC                        0x61410
+#define PIPE_MSA_MISC(pipe) _PIPE(pipe, _PIPEA_MSA_MISC, _PIPEB_MSA_MISC)
+#define  PIPE_MSA_SYNC_CLK             (1<<0)
+#define  PIPE_MSA_6_BPC                        (0<<5)
+#define  PIPE_MSA_8_BPC                        (1<<5)
+#define  PIPE_MSA_10_BPC               (2<<5)
+#define  PIPE_MSA_12_BPC               (3<<5)
+#define  PIPE_MSA_16_BPC               (4<<5)
+
 /* LCPLL Control */
 #define LCPLL_CTL                      0x130040
 #define  LCPLL_PLL_DISABLE             (1<<31)
 #define  LCPLL_PLL_LOCK                        (1<<30)
+#define  LCPLL_CLK_FREQ_MASK           (3<<26)
+#define  LCPLL_CLK_FREQ_450            (0<<26)
 #define  LCPLL_CD_CLOCK_DISABLE                (1<<25)
 #define  LCPLL_CD2X_CLOCK_DISABLE      (1<<23)
+#define  LCPLL_CD_SOURCE_FCLK          (1<<21)
 
 /* Pipe WM_LINETIME - watermark line time */
 #define PIPE_WM_LINETIME_A             0x45270