ValleyView patches
Subsystems (3)
Updated patchset addressing comments. I dropped some:
- display reg offset (we're going to fix this up differently)
- cache handling (not needed)
along with the ones Daniel has already queued.
Hopefully these ones look ok to people and we can get them queued up as well.
Thanks,
Jesse
PATCH 1/22 drm/i915: add ValleyView driver structs and IS_VALLEYVIEW macro
For use by the rest of the ValleyView code.
v2: fix desktop variant to not set is_mobile (Ben)
--- drivers/gpu/drm/i915/i915_drv.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ 2 files changed, 20 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +18 -0
@@ -254,6 +254,24 @@ static const struct intel_device_info intel_ivybridge_m_info = { .has_llc = 1, }; +static const struct intel_device_info intel_valleyview_m_info = { + .gen =7 , .is_mobile =1 , + .need_gfx_hws =1 , .has_hotplug =1 , + .has_fbc =0 , + .has_bsd_ring =1 , + .has_blt_ring =1 , + .is_valleyview =1 , +}; + +static const struct intel_device_info intel_valleyview_d_info = { + .gen =7 , + .need_gfx_hws =1 , .has_hotplug =1 , + .has_fbc =0 , + .has_bsd_ring =1 , + .has_blt_ring =1 , + .is_valleyview =1 , +}; +static const struct pci_device_id pciidlist[] = {/* aka */ INTEL_VGA_DEVICE (0x3577 , &intel_i830_info),/* I830_M */ INTEL_VGA_DEVICE (0x2562 , &intel_845g_info),/* 845_G */
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -255,6 +255,7 @@ struct intel_device_info { u8 is_broadwater:1; u8 is_crestline:1; u8 is_ivybridge:1; + u8 is_valleyview:1; u8 has_fbc:1; u8 has_pipe_cxsr:1; u8 has_hotplug:1;
@@ -1002,6 +1003,7 @@ struct drm_i915_file_private {#define IS_IRONLAKE_D (dev) ((dev)->pci_device == 0x0042)#define IS_IRONLAKE_M (dev) ((dev)->pci_device == 0x0046)#define IS_IVYBRIDGE (dev) (INTEL_INFO(dev)->is_ivybridge) +#define IS_VALLEYVIEW (dev) (INTEL_INFO(dev)->is_valleyview)#define IS_MOBILE (dev) (INTEL_INFO(dev)->is_mobile)/*
Signature · 1 line
1.7.5.4
PATCH 2/22 drm/i915: ValleyView watermark support
In reply to Jesse BarnesAdd support for ValleyView watermark handling.
v2: remove unused reg & bit definitions (Ben)
--- drivers/gpu/drm/i915/i915_reg.h | 6 +++ drivers/gpu/drm/i915/intel_display.c | 65 ++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +6 -0
@@ -1043,6 +1043,9 @@#define RAMCLK_GATE_D 0x6210/* CRL only */ #define DEUC 0x6214/* CRL only */ +#define FW_BLC_SELF_VLV 0x6500 +#define FW_CSPWRDWNEN (1<<15) +/* * Palette regs */
@@ -2495,6 +2498,7 @@#define I915_FIFO_LINE_SIZE 64#define I830_FIFO_LINE_SIZE 32 +#define VALLEYVIEW_FIFO_SIZE 255#define G4X_FIFO_SIZE 127#define I965_FIFO_SIZE 512#define I945_FIFO_SIZE 127
@@ -2502,6 +2506,7 @@#define I855GM_FIFO_SIZE 127/* In cachelines */ #define I830_FIFO_SIZE 95 +#define VALLEYVIEW_MAX_WM 0xff#define G4X_MAX_WM 0x3f#define I915_MAX_WM 0x3f
@@ -2516,6 +2521,7 @@#define PINEVIEW_CURSOR_DFT_WM 0#define PINEVIEW_CURSOR_GUARD_WM 5 +#define VALLEYVIEW_CURSOR_MAX_WM 64#define I965_CURSOR_FIFO 64#define I965_CURSOR_MAX_WM 32#define I965_CURSOR_DFT_WM 8
drivers/gpu/drm/i915/intel_display.c +65 -0
83 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 3/22 drm/i915: PLL defines for VLV
In reply to Jesse BarnesAdd register definitions for the new VLV PLL bits.
v2: remove unused bits & regs (Ben)
--- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_display.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -796,7 +796,9 @@#define DPLL (pipe) _PIPE(pipe, _DPLL_A, _DPLL_B)#define DPLL_VCO_ENABLE (1 << 31)#define DPLL_DVO_HIGH_SPEED (1 << 30) +#define DPLL_EXT_BUFFER_ENABLE_VLV (1 << 30)#define DPLL_SYNCLOCK_ENABLE (1 << 29) +#define DPLL_REFA_CLK_ENABLE_VLV (1 << 29)#define DPLL_VGA_MODE_DIS (1 << 28)#define DPLLB_MODE_DAC_SERIAL (1 << 26)/* i915 */ #define DPLLB_MODE_LVDS (2 << 26)/* i915 */
@@ -808,6 +810,7 @@#define DPLL_P2_CLOCK_DIV_MASK 0x03000000/* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000/* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW 0x00ff8000/* Pineview */ +#define DPLL_INTEGRATED_CLOCK_VLV (1<<13)#define SRX_INDEX 0x3c4#define SRX_DATA 0x3c5
@@ -903,6 +906,7 @@#define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0#define _DPLL_B_MD 0x06020/* 965+ only */ #define DPLL_MD (pipe) _PIPE(pipe, _DPLL_A_MD, _DPLL_B_MD) +#define _FPA0 0x06040#define _FPA1 0x06044#define _FPB0 0x06048
drivers/gpu/drm/i915/intel_display.c +9 -1
@@ -3487,6 +3487,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,return true; } +static int valleyview_get_display_clock_speed (struct drm_device *dev) +{ +return 400000 ;/* FIXME */ +} +static int i945_get_display_clock_speed (struct drm_device *dev) {return 400000 ;
@@ -8915,7 +8920,10 @@ static void intel_init_display(struct drm_device *dev) }/* Returns the core display clock speed */ -if (IS_I945G (dev) || (IS_G33 (dev) && !IS_PINEVIEW_M (dev))) +if (IS_VALLEYVIEW (dev)) + dev_priv->display.get_display_clock_speed = + valleyview_get_display_clock_speed; +else if (IS_I945G (dev) || (IS_G33 (dev) && !IS_PINEVIEW_M (dev))) dev_priv->display.get_display_clock_speed = i945_get_display_clock_speed;else if (IS_I915G (dev))
Signature · 1 line
1.7.5.4
PATCH 4/22 drm/i915: interrupt bit definitions for VLV
In reply to Jesse Barnes--- drivers/gpu/drm/i915/i915_reg.h | 41 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +41 -0
@@ -2427,23 +2427,30 @@#define PIPECONF_DITHER_TYPE_TEMP (3<<2)#define _PIPEASTAT 0x70024#define PIPE_FIFO_UNDERRUN_STATUS (1UL<<31) +#define SPRITE1_FLIPDONE_INT_EN_VLV (1UL<<30)#define PIPE_CRC_ERROR_ENABLE (1UL<<29)#define PIPE_CRC_DONE_ENABLE (1UL<<28)#define PIPE_GMBUS_EVENT_ENABLE (1UL<<27) +#define PLANE_FLIP_DONE_INT_EN_VLV (1UL<<26)#define PIPE_HOTPLUG_INTERRUPT_ENABLE (1UL<<26)#define PIPE_VSYNC_INTERRUPT_ENABLE (1UL<<25)#define PIPE_DISPLAY_LINE_COMPARE_ENABLE (1UL<<24)#define PIPE_DPST_EVENT_ENABLE (1UL<<23) +#define SPRITE0_FLIP_DONE_INT_EN_VLV (1UL<<26)#define PIPE_LEGACY_BLC_EVENT_ENABLE (1UL<<22)#define PIPE_ODD_FIELD_INTERRUPT_ENABLE (1UL<<21)#define PIPE_EVEN_FIELD_INTERRUPT_ENABLE (1UL<<20)#define PIPE_HOTPLUG_TV_INTERRUPT_ENABLE (1UL<<18)/* pre-965 */ #define PIPE_START_VBLANK_INTERRUPT_ENABLE (1UL<<18)/* 965 or later */ #define PIPE_VBLANK_INTERRUPT_ENABLE (1UL<<17) +#define PIPEA_HBLANK_INT_EN_VLV (1UL<<16)#define PIPE_OVERLAY_UPDATED_ENABLE (1UL<<16) +#define SPRITE1_FLIPDONE_INT_STATUS_VLV (1UL<<15) +#define SPRITE0_FLIPDONE_INT_STATUS_VLV (1UL<<15)#define PIPE_CRC_ERROR_INTERRUPT_STATUS (1UL<<13)#define PIPE_CRC_DONE_INTERRUPT_STATUS (1UL<<12)#define PIPE_GMBUS_INTERRUPT_STATUS (1UL<<11) +#define PLANE_FLIPDONE_INT_STATUS_VLV (1UL<<10)#define PIPE_HOTPLUG_INTERRUPT_STATUS (1UL<<10)#define PIPE_VSYNC_INTERRUPT_STATUS (1UL<<9)#define PIPE_DISPLAY_LINE_COMPARE_STATUS (1UL<<8)
@@ -2468,6 +2475,40 @@#define PIPEFRAMEPIXEL (pipe) _PIPE(pipe, _PIPEAFRAMEPIXEL, _PIPEBFRAMEPIXEL)#define PIPESTAT (pipe) _PIPE(pipe, _PIPEASTAT, _PIPEBSTAT) +#define DPFLIPSTAT_VLV 0x70028 +#define PIPEB_LINE_COMPARE_STATUS (1<<29) +#define PIPEB_HLINE_INT_EN (1<<28) +#define PIPEB_VBLANK_INT_EN (1<<27) +#define SPRITED_FLIPDONE_INT_EN (1<<26) +#define SPRITEC_FLIPDONE_INT_EN (1<<25) +#define PLANEB_FLIPDONE_INT_EN (1<<24) +#define PIPEA_LINE_COMPARE_STATUS (1<<21) +#define PIPEA_HLINE_INT_EN (1<<20) +#define PIPEA_VBLANK_INT_EN (1<<19) +#define SPRITEB_FLIPDONE_INT_EN (1<<18) +#define SPRITEA_FLIPDONE_INT_EN (1<<17) +#define PLANEA_FLIPDONE_INT_EN (1<<16) + +#define DPINVGTT 0x7002c/* VLV only */ +#define CURSORB_INVALID_GTT_INT_EN (1<<23) +#define CURSORA_INVALID_GTT_INT_EN (1<<22) +#define SPRITED_INVALID_GTT_INT_EN (1<<21) +#define SPRITEC_INVALID_GTT_INT_EN (1<<20) +#define PLANEB_INVALID_GTT_INT_EN (1<<19) +#define SPRITEB_INVALID_GTT_INT_EN (1<<18) +#define SPRITEA_INVALID_GTT_INT_EN (1<<17) +#define PLANEA_INVALID_GTT_INT_EN (1<<16) +#define DPINVGTT_EN_MASK 0xff0000 +#define CURSORB_INVALID_GTT_STATUS (1<<7) +#define CURSORA_INVALID_GTT_STATUS (1<<6) +#define SPRITED_INVALID_GTT_STATUS (1<<5) +#define SPRITEC_INVALID_GTT_STATUS (1<<4) +#define PLANEB_INVALID_GTT_STATUS (1<<3) +#define SPRITEB_INVALID_GTT_STATUS (1<<2) +#define SPRITEA_INVALID_GTT_STATUS (1<<1) +#define PLANEA_INVALID_GTT_STATUS (1<<0) +#define DPINVGTT_STATUS_MASK 0xff +#define DSPARB 0x70030#define DSPARB_CSTART_MASK (0x7f << 7)#define DSPARB_CSTART_SHIFT 7
Signature · 1 line
1.7.5.4
Re: [PATCH 04/22] drm/i915: interrupt bit definitions for VLV
This patch looks more like a random set of registers than interrupt definitions. Also it's missing the sob line. Please clarify a bit what this is about.
-Daniel
Quoted 87 lines · Jesse Barnes
--- drivers/gpu/drm/i915/i915_reg.h | 41 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)drivers/gpu/drm/i915/i915_reg.h +41
-0@@ -2427,23 +2427,30 @@#define PIPECONF_DITHER_TYPE_TEMP (3<<2)#define _PIPEASTAT 0x70024#define PIPE_FIFO_UNDERRUN_STATUS (1UL<<31) +#define SPRITE1_FLIPDONE_INT_EN_VLV (1UL<<30)#define PIPE_CRC_ERROR_ENABLE (1UL<<29)#define PIPE_CRC_DONE_ENABLE (1UL<<28)#define PIPE_GMBUS_EVENT_ENABLE (1UL<<27) +#define PLANE_FLIP_DONE_INT_EN_VLV (1UL<<26)#define PIPE_HOTPLUG_INTERRUPT_ENABLE (1UL<<26)#define PIPE_VSYNC_INTERRUPT_ENABLE (1UL<<25)#define PIPE_DISPLAY_LINE_COMPARE_ENABLE (1UL<<24)#define PIPE_DPST_EVENT_ENABLE (1UL<<23) +#define SPRITE0_FLIP_DONE_INT_EN_VLV (1UL<<26)#define PIPE_LEGACY_BLC_EVENT_ENABLE (1UL<<22)#define PIPE_ODD_FIELD_INTERRUPT_ENABLE (1UL<<21)#define PIPE_EVEN_FIELD_INTERRUPT_ENABLE (1UL<<20)#define PIPE_HOTPLUG_TV_INTERRUPT_ENABLE (1UL<<18)/* pre-965 */ #define PIPE_START_VBLANK_INTERRUPT_ENABLE (1UL<<18)/* 965 or later */ #define PIPE_VBLANK_INTERRUPT_ENABLE (1UL<<17) +#define PIPEA_HBLANK_INT_EN_VLV (1UL<<16)#define PIPE_OVERLAY_UPDATED_ENABLE (1UL<<16) +#define SPRITE1_FLIPDONE_INT_STATUS_VLV (1UL<<15) +#define SPRITE0_FLIPDONE_INT_STATUS_VLV (1UL<<15)#define PIPE_CRC_ERROR_INTERRUPT_STATUS (1UL<<13)#define PIPE_CRC_DONE_INTERRUPT_STATUS (1UL<<12)#define PIPE_GMBUS_INTERRUPT_STATUS (1UL<<11) +#define PLANE_FLIPDONE_INT_STATUS_VLV (1UL<<10)#define PIPE_HOTPLUG_INTERRUPT_STATUS (1UL<<10)#define PIPE_VSYNC_INTERRUPT_STATUS (1UL<<9)#define PIPE_DISPLAY_LINE_COMPARE_STATUS (1UL<<8)@@ -2468,6 +2475,40 @@#define PIPEFRAMEPIXEL (pipe) _PIPE(pipe, _PIPEAFRAMEPIXEL, _PIPEBFRAMEPIXEL)#define PIPESTAT (pipe) _PIPE(pipe, _PIPEASTAT, _PIPEBSTAT) +#define DPFLIPSTAT_VLV 0x70028 +#define PIPEB_LINE_COMPARE_STATUS (1<<29) +#define PIPEB_HLINE_INT_EN (1<<28) +#define PIPEB_VBLANK_INT_EN (1<<27) +#define SPRITED_FLIPDONE_INT_EN (1<<26) +#define SPRITEC_FLIPDONE_INT_EN (1<<25) +#define PLANEB_FLIPDONE_INT_EN (1<<24) +#define PIPEA_LINE_COMPARE_STATUS (1<<21) +#define PIPEA_HLINE_INT_EN (1<<20) +#define PIPEA_VBLANK_INT_EN (1<<19) +#define SPRITEB_FLIPDONE_INT_EN (1<<18) +#define SPRITEA_FLIPDONE_INT_EN (1<<17) +#define PLANEA_FLIPDONE_INT_EN (1<<16) + +#define DPINVGTT 0x7002c/* VLV only */ +#define CURSORB_INVALID_GTT_INT_EN (1<<23) +#define CURSORA_INVALID_GTT_INT_EN (1<<22) +#define SPRITED_INVALID_GTT_INT_EN (1<<21) +#define SPRITEC_INVALID_GTT_INT_EN (1<<20) +#define PLANEB_INVALID_GTT_INT_EN (1<<19) +#define SPRITEB_INVALID_GTT_INT_EN (1<<18) +#define SPRITEA_INVALID_GTT_INT_EN (1<<17) +#define PLANEA_INVALID_GTT_INT_EN (1<<16) +#define DPINVGTT_EN_MASK 0xff0000 +#define CURSORB_INVALID_GTT_STATUS (1<<7) +#define CURSORA_INVALID_GTT_STATUS (1<<6) +#define SPRITED_INVALID_GTT_STATUS (1<<5) +#define SPRITEC_INVALID_GTT_STATUS (1<<4) +#define PLANEB_INVALID_GTT_STATUS (1<<3) +#define SPRITEB_INVALID_GTT_STATUS (1<<2) +#define SPRITEA_INVALID_GTT_STATUS (1<<1) +#define PLANEA_INVALID_GTT_STATUS (1<<0) +#define DPINVGTT_STATUS_MASK 0xff +#define DSPARB 0x70030#define DSPARB_CSTART_MASK (0x7f << 7)#define DSPARB_CSTART_SHIFT 7Signature · 6 lines
1.7.5.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Re: [PATCH 04/22] drm/i915: interrupt bit definitions for VLV
Quoted 3 lines · On Wed, 28 Mar 2012 23:33:54 +0200 Daniel Vetter <[email protected]> wrote:
This patch looks more like a random set of registers than interrupt definitions. Also it's missing the sob line. Please clarify a bit what this is about.
Should probably be mashed in with the IRQ patch; do you want to do that when you apply?
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Re: [PATCH 04/22] drm/i915: interrupt bit definitions for VLV
Quoted 9 lines · Jesse Barnes
Quoted 3 lines · On Wed, 28 Mar 2012 23:33:54 +0200 Daniel Vetter <[email protected]> wrote:
This patch looks more like a random set of registers than interrupt definitions. Also it's missing the sob line. Please clarify a bit what this is about.
Should probably be mashed in with the IRQ patch; do you want to do that when you apply?
On re-reading it looks like they're indeed all irq related - I've been confused with all this SPRITE stuff in them. So I guess just your sob line is awol.
-Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Re: [PATCH 04/22] drm/i915: interrupt bit definitions for VLV
Quoted 8 lines · On Wed, 28 Mar 2012 23:47:13 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 7 lines · Jesse Barnes
Quoted 3 lines · On Wed, 28 Mar 2012 23:33:54 +0200 Daniel Vetter <[email protected]> wrote:
This patch looks more like a random set of registers than interrupt definitions. Also it's missing the sob line. Please clarify a bit what this is about.
Quoted 6 lines
Quoted 2 lines
Should probably be mashed in with the IRQ patch; do you want to do that when you apply?
On re-reading it looks like they're indeed all irq related - I've been confused with all this SPRITE stuff in them. So I guess just your sob line is awol.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 5/22 drm/i915: add DPIO support
In reply to Jesse BarnesValleyView puts some display related registers like the PLL controls and dividers behind the DPIO bus. Add simple indirect register access routines to get to those registers.
v2: move new wait_for macro to intel_drv.h (Ben)
fix DPIO_PKT double write (Ben)
add debugfs file
--- drivers/gpu/drm/i915/i915_debugfs.c | 48 ++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 4 ++ drivers/gpu/drm/i915/i915_reg.h | 55 ++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 61 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 14 ++++++++ 5 files changed, 182 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +48 -0
@@ -1503,6 +1503,53 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)return 0 ; } +static int i915_dpio_info (struct seq_file *m,void *data) +{ +struct drm_info_node *node = (struct drm_info_node *) m->private; +struct drm_device *dev = node->minor->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int ret; + + +if (!IS_VALLEYVIEW (dev)) { +seq_printf (m,"unsupported\n" ); +return 0 ; + } + + ret =mutex_lock_interruptible (&dev->mode_config.mutex); +if (ret) +return ret; + +seq_printf (m,"DPIO_CTL: 0x%08x\n" ,I915_READ (DPIO_CTL )); + +seq_printf (m,"DPIO_DIV_A: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_DIV_A)); +seq_printf (m,"DPIO_DIV_B: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_DIV_B)); + +seq_printf (m,"DPIO_REFSFR_A: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_REFSFR_A)); +seq_printf (m,"DPIO_REFSFR_B: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_REFSFR_B)); + +seq_printf (m,"DPIO_CORE_CLK_A: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_CORE_CLK_A)); +seq_printf (m,"DPIO_CORE_CLK_B: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_CORE_CLK_B)); + +seq_printf (m,"DPIO_LFP_COEFF_A: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_LFP_COEFF_A)); +seq_printf (m,"DPIO_LFP_COEFF_B: 0x%08x\n" , +intel_dpio_read (dev_priv, _DPIO_LFP_COEFF_B)); + +seq_printf (m,"DPIO_FASTCLK_DISABLE: 0x%08x\n" , +intel_dpio_read (dev_priv,DPIO_FASTCLK_DISABLE )); + +mutex_unlock (&dev->mode_config.mutex); + +return 0 ; +} +static int i915_debugfs_common_open (struct inode *inode,struct file *filp)
@@ -1845,6 +1892,7 @@ static struct drm_info_list i915_debugfs_list[] = { {"i915_gen6_forcewake_count", i915_gen6_forcewake_count_info, 0}, {"i915_swizzle_info", i915_swizzle_info, 0}, {"i915_ppgtt_info", i915_ppgtt_info, 0}, + {"i915_dpio", i915_dpio_info, 0}, };#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
drivers/gpu/drm/i915/i915_drv.h +4 -0
@@ -360,6 +360,10 @@ typedef struct drm_i915_private {/* protects the irq masks */ spinlock_t irq_lock; + +/* DPIO indirect register protection */ +spinlock_t dpio_lock; +/** Cached value of IMR to avoid reads in updating the bitfield */ u32 pipestat[2 ];u32 irq_mask;
drivers/gpu/drm/i915/i915_reg.h +55 -0
61 lines not on this page · raw message
drivers/gpu/drm/i915/intel_display.c +61 -0
73 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +14 -0
@@ -45,6 +45,18 @@ ret__; \ }) +#define wait_for_atomic_us (COND ,US ) ({ \ + int i, ret__ = -ETIMEDOUT; \ + for (i = 0; i < (US); i++) { \ + if ((COND)) { \ + ret__ = 0; \ + break; \ + } \ + udelay(1); \ + } \ + ret__; \ +}) +#define wait_for (COND ,MS ) _wait_for(COND, MS, 1)#define wait_for_atomic (COND ,MS ) _wait_for(COND, MS, 0)
@@ -420,4 +432,6 @@ extern int intel_sprite_set_colorkey(struct drm_device *dev, void *data,extern int intel_sprite_get_colorkey (struct drm_device *dev,void *data,struct drm_file *file_priv); +extern u32 intel_dpio_read (struct drm_i915_private *dev_priv,int reg); +#endif /* __INTEL_DRV_H__ */
Signature · 1 line
1.7.5.4
PATCH 6/22 drm/i915: add ValleyView clock gating init
In reply to Jesse BarnesSet required clock gating and chicken bits on VLV.
v2: set PIXEL_SUBSPAN_COLLECT_OPT_DISABLE too (Ben)
move function below ivb version to pretend to be consistent (Ben)
--- drivers/gpu/drm/i915/i915_reg.h | 18 ++++++++++++ drivers/gpu/drm/i915/intel_display.c | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +18 -0
@@ -633,6 +633,9 @@#define ECO_GATING_CX_ONLY (1<<3)#define ECO_FLIP_DONE (1<<0) +#define CACHE_MODE_1 0x7004/* IVB+ */ +#define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1<<6) +/* GEN6 interrupt control */ #define GEN6_RENDER_HWSTAM 0x2098#define GEN6_RENDER_IMR 0x20a8
@@ -3225,6 +3228,20 @@#define DISP_TILE_SURFACE_SWIZZLING (1<<13)#define DISP_FBC_WM_DIS (1<<15) +/* GEN7 chicken */ +#define GEN7_COMMON_SLICE_CHICKEN1 0x7010 +# define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) + +#define GEN7_L3CNTLREG1 0xB01C +#define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C + +#define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030 +#define GEN7_WA_L3_CHICKEN_MODE 0x20000000 + +/* WaCatErrorRejectionIssue */ +#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 +#define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) +/* PCH */ /* south display engine interrupt */
@@ -3828,6 +3845,7 @@#define GT_FIFO_NUM_RESERVED_ENTRIES 20#define GEN6_UCGCTL2 0x9404 +# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
drivers/gpu/drm/i915/intel_display.c +50 -0
62 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 7/22 drm/i915: split PLL update code out of i9xx_crtc_mode_set
In reply to Jesse BarnesMakes it more readable and maintainable. ValleyView will add its own PLL update function in a later patch.
v2: split LVDS bits out of this patch (Daniel)
v3: fix dropped DP dithering hunk (Daniel)
--- drivers/gpu/drm/i915/intel_display.c | 278 ++++++++++++++++++++-------------- 1 files changed, 167 insertions(+), 111 deletions(-)
drivers/gpu/drm/i915/intel_display.c +167 -111
@@ -5260,6 +5260,163 @@ static void i9xx_update_pll_dividers(struct drm_crtc *crtc, } } +static void i9xx_update_pll (struct drm_crtc *crtc, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode, +intel_clock_t *clock,intel_clock_t *reduced_clock, +int num_connectors) +{ +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe; +u32 dpll; +bool is_sdvo; + + is_sdvo =intel_pipe_has_type (crtc,INTEL_OUTPUT_SDVO ) || +intel_pipe_has_type (crtc,INTEL_OUTPUT_HDMI ); + + dpll =DPLL_VGA_MODE_DIS ; + +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS )) + dpll |=DPLLB_MODE_LVDS ; +else + dpll |=DPLLB_MODE_DAC_SERIAL ; +if (is_sdvo) { +int pixel_multiplier =intel_mode_get_pixel_multiplier (adjusted_mode); +if (pixel_multiplier >1 ) { +if (IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) + dpll |= (pixel_multiplier -1 ) <<SDVO_MULTIPLIER_SHIFT_HIRES ; + } + dpll |=DPLL_DVO_HIGH_SPEED ; + } +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_DISPLAYPORT )) + dpll |=DPLL_DVO_HIGH_SPEED ; + +/* compute bitmask from p1 value */ +if (IS_PINEVIEW (dev)) + dpll |= (1 << (clock->p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW ; +else { + dpll |= (1 << (clock->p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; +if (IS_G4X (dev) && reduced_clock) + dpll |= (1 << (reduced_clock->p1 -1 )) <<DPLL_FPA1_P1_POST_DIV_SHIFT ; + } +switch (clock->p2) { +case 5 : + dpll |=DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 ; +break ; +case 7 : + dpll |=DPLLB_LVDS_P2_CLOCK_DIV_7 ; +break ; +case 10 : + dpll |=DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 ; +break ; +case 14 : + dpll |=DPLLB_LVDS_P2_CLOCK_DIV_14 ; +break ; + } +if (INTEL_INFO (dev)->gen >=4 ) + dpll |= (6 <<PLL_LOAD_PULSE_PHASE_SHIFT ); + +if (is_sdvo &&intel_pipe_has_type (crtc,INTEL_OUTPUT_TVOUT )) + dpll |=PLL_REF_INPUT_TVCLKINBC ; +else if (intel_pipe_has_type (crtc,INTEL_OUTPUT_TVOUT )) +/* XXX: just matching BIOS for now */ +/* dpll |= PLL_REF_INPUT_TVCLKINBC; */ + dpll |=3 ; +else if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS ) && +intel_panel_use_ssc (dev_priv) && num_connectors <2 ) + dpll |=PLLB_REF_INPUT_SPREADSPECTRUMIN ; +else + dpll |=PLL_REF_INPUT_DREFCLK ; + + dpll |=DPLL_VCO_ENABLE ; +I915_WRITE (DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); +POSTING_READ (DPLL (pipe)); +udelay (150 ); + +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_DISPLAYPORT )) +intel_dp_set_m_n (crtc, mode, adjusted_mode); + +I915_WRITE (DPLL (pipe), dpll); + +/* Wait for the clocks to stabilize. */ +POSTING_READ (DPLL (pipe)); +udelay (150 ); + +if (INTEL_INFO (dev)->gen >=4 ) { +u32 temp =0 ; +if (is_sdvo) { + temp =intel_mode_get_pixel_multiplier (adjusted_mode); +if (temp >1 ) + temp = (temp -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; +else + temp =0 ; + } +I915_WRITE (DPLL_MD (pipe), temp); + }else { +/* The pixel multiplier can only be updated once the +* DPLL is enabled and the clocks are stable. +* +* So write it again. +*/ +I915_WRITE (DPLL (pipe), dpll); + } +} + +static void i8xx_update_pll (struct drm_crtc *crtc, +struct drm_display_mode *adjusted_mode, +intel_clock_t *clock, +int num_connectors) +{ +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe; +u32 dpll; + + dpll =DPLL_VGA_MODE_DIS ; + +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS )) { + dpll |= (1 << (clock->p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; + }else { +if (clock->p1 ==2 ) + dpll |=PLL_P1_DIVIDE_BY_TWO ; +else + dpll |= (clock->p1 -2 ) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; +if (clock->p2 ==4 ) + dpll |=PLL_P2_DIVIDE_BY_4 ; + } + +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_TVOUT )) +/* XXX: just matching BIOS for now */ +/* dpll |= PLL_REF_INPUT_TVCLKINBC; */ + dpll |=3 ; +else if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS ) && +intel_panel_use_ssc (dev_priv) && num_connectors <2 ) + dpll |=PLLB_REF_INPUT_SPREADSPECTRUMIN ; +else + dpll |=PLL_REF_INPUT_DREFCLK ; + + dpll |=DPLL_VCO_ENABLE ; +I915_WRITE (DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); +POSTING_READ (DPLL (pipe)); +udelay (150 ); + +I915_WRITE (DPLL (pipe), dpll); + +/* Wait for the clocks to stabilize. */ +POSTING_READ (DPLL (pipe)); +udelay (150 ); + +/* The pixel multiplier can only be updated once the +* DPLL is enabled and the clocks are stable. +* +* So write it again. +*/ +I915_WRITE (DPLL (pipe), dpll); +} + static int i9xx_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode,
@@ -5273,9 +5430,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,int plane = intel_crtc->plane;int refclk, num_connectors =0 ;intel_clock_t clock, reduced_clock; -u32 dpll, dspcntr, pipeconf, vsyncshift; -bool ok, has_reduced_clock = false, is_sdvo = false, is_dvo = false; -bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false; +u32 dspcntr, pipeconf, vsyncshift; +bool ok, has_reduced_clock = false, is_sdvo = false; +bool is_lvds = false, is_tv = false, is_dp = false;struct drm_mode_config *mode_config = &dev->mode_config;struct intel_encoder *encoder;const intel_limit_t *limit;
@@ -5297,15 +5454,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,if (encoder->needs_tv_clock) is_tv = true;break ; -case INTEL_OUTPUT_DVO : - is_dvo = true; -break ;case INTEL_OUTPUT_TVOUT : is_tv = true;break ; -case INTEL_OUTPUT_ANALOG : - is_crt = true; -break ;case INTEL_OUTPUT_DISPLAYPORT : is_dp = true;break ;
@@ -5352,71 +5503,12 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,i9xx_update_pll_dividers (crtc, &clock, has_reduced_clock ? &reduced_clock :NULL ); - dpll =DPLL_VGA_MODE_DIS ; - -if (!IS_GEN2 (dev)) { -if (is_lvds) - dpll |=DPLLB_MODE_LVDS ; -else - dpll |=DPLLB_MODE_DAC_SERIAL ; -if (is_sdvo) { -int pixel_multiplier =intel_mode_get_pixel_multiplier (adjusted_mode); -if (pixel_multiplier >1 ) { -if (IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) - dpll |= (pixel_multiplier -1 ) <<SDVO_MULTIPLIER_SHIFT_HIRES ; - } - dpll |=DPLL_DVO_HIGH_SPEED ; - } -if (is_dp) - dpll |=DPLL_DVO_HIGH_SPEED ; - -/* compute bitmask from p1 value */ -if (IS_PINEVIEW (dev)) - dpll |= (1 << (clock.p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW ; -else { - dpll |= (1 << (clock.p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; -if (IS_G4X (dev) && has_reduced_clock) - dpll |= (1 << (reduced_clock.p1 -1 )) <<DPLL_FPA1_P1_POST_DIV_SHIFT ; - } -switch (clock.p2) { -case 5 : - dpll |=DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 ; -break ; -case 7 : - dpll |=DPLLB_LVDS_P2_CLOCK_DIV_7 ; -break ; -case 10 : - dpll |=DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 ; -break ; -case 14 : - dpll |=DPLLB_LVDS_P2_CLOCK_DIV_14 ; -break ; - } -if (INTEL_INFO (dev)->gen >=4 ) - dpll |= (6 <<PLL_LOAD_PULSE_PHASE_SHIFT ); - }else { -if (is_lvds) { - dpll |= (1 << (clock.p1 -1 )) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; - }else { -if (clock.p1 ==2 ) - dpll |=PLL_P1_DIVIDE_BY_TWO ; -else - dpll |= (clock.p1 -2 ) <<DPLL_FPA01_P1_POST_DIV_SHIFT ; -if (clock.p2 ==4 ) - dpll |=PLL_P2_DIVIDE_BY_4 ; - } - } - -if (is_sdvo && is_tv) - dpll |=PLL_REF_INPUT_TVCLKINBC ; -else if (is_tv) -/* XXX: just matching BIOS for now */ -/* dpll |= PLL_REF_INPUT_TVCLKINBC; */ - dpll |=3 ; -else if (is_lvds &&intel_panel_use_ssc (dev_priv) && num_connectors <2 ) - dpll |=PLLB_REF_INPUT_SPREADSPECTRUMIN ; +if (IS_GEN2 (dev)) +i8xx_update_pll (crtc, adjusted_mode, &clock, num_connectors);else - dpll |=PLL_REF_INPUT_DREFCLK ; +i9xx_update_pll (crtc, mode, adjusted_mode, &clock, + has_reduced_clock ? &reduced_clock :NULL , + num_connectors);/* setup pipeconf */ pipeconf =I915_READ (PIPECONF (pipe));
@@ -5448,21 +5540,14 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,if (is_dp) {if (mode->private_flags &INTEL_MODE_DP_FORCE_6BPC ) { pipeconf |=PIPECONF_BPP_6 | -PIPECONF_DITHER_EN | -PIPECONF_DITHER_TYPE_SP ; +PIPECONF_DITHER_EN | +PIPECONF_DITHER_TYPE_SP ; } } - dpll |=DPLL_VCO_ENABLE ; -DRM_DEBUG_KMS ("Mode for pipe %c:\n" , pipe ==0 ?'A' :'B' );drm_mode_debug_printmodeline (mode); -I915_WRITE (DPLL (pipe), dpll & ~DPLL_VCO_ENABLE ); - -POSTING_READ (DPLL (pipe)); -udelay (150 ); -/* The LVDS pin pair needs to be on before the DPLLs are enabled. * This is an exception to the general rule that mode_set doesn't turn * things on.
@@ -5515,35 +5600,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,I915_WRITE (LVDS , temp); } -if (is_dp) { -intel_dp_set_m_n (crtc, mode, adjusted_mode); - } - -I915_WRITE (DPLL (pipe), dpll); - -/* Wait for the clocks to stabilize. */ -POSTING_READ (DPLL (pipe)); -udelay (150 ); - -if (INTEL_INFO (dev)->gen >=4 ) { - temp =0 ; -if (is_sdvo) { - temp =intel_mode_get_pixel_multiplier (adjusted_mode); -if (temp >1 ) - temp = (temp -1 ) <<DPLL_MD_UDI_MULTIPLIER_SHIFT ; -else - temp =0 ; - } -I915_WRITE (DPLL_MD (pipe), temp); - }else { -/* The pixel multiplier can only be updated once the -* DPLL is enabled and the clocks are stable. -* -* So write it again. -*/ -I915_WRITE (DPLL (pipe), dpll); - } -if (HAS_PIPE_CXSR (dev)) {if (intel_crtc->lowfreq_avail) {DRM_DEBUG_KMS ("enabling CxSR downclocking\n" );
Signature · 1 line
1.7.5.4
PATCH 8/22 drm/i915: split LVDS update code out of i9xx_crtc_mode_set
In reply to Jesse BarnesJust to make things clearer and reduce the size of this monstrosity.
v2: make sure 8xx PLL update function calls update_lvds too (Daniel)
--- drivers/gpu/drm/i915/intel_display.c | 124 +++++++++++++++++++--------------- 1 files changed, 70 insertions(+), 54 deletions(-)
drivers/gpu/drm/i915/intel_display.c +70 -54
@@ -5260,6 +5260,62 @@ static void i9xx_update_pll_dividers(struct drm_crtc *crtc, } } +static void intel_update_lvds (struct drm_crtc *crtc,intel_clock_t *clock, +struct drm_display_mode *adjusted_mode) +{ +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe; +u32 temp, lvds_sync =0 ; + + temp =I915_READ (LVDS ); + temp |=LVDS_PORT_EN |LVDS_A0A2_CLKA_POWER_UP ; +if (pipe ==1 ) { + temp |=LVDS_PIPEB_SELECT ; + }else { + temp &= ~LVDS_PIPEB_SELECT ; + } +/* set the corresponsding LVDS_BORDER bit */ + temp |= dev_priv->lvds_border_bits; +/* Set the B0-B3 data pairs corresponding to whether we're going to +* set the DPLLs for dual-channel mode or not. +*/ +if (clock->p2 ==7 ) + temp |=LVDS_B0B3_POWER_UP |LVDS_CLKB_POWER_UP ; +else + temp &= ~(LVDS_B0B3_POWER_UP |LVDS_CLKB_POWER_UP ); + +/* It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP) +* appropriately here, but we need to look more thoroughly into how +* panels behave in the two modes. +*/ +/* set the dithering flag on LVDS as needed */ +if (INTEL_INFO (dev)->gen >=4 ) { +if (dev_priv->lvds_dither) + temp |=LVDS_ENABLE_DITHER ; +else + temp &= ~LVDS_ENABLE_DITHER ; + } +if (adjusted_mode->flags &DRM_MODE_FLAG_NHSYNC ) + lvds_sync |=LVDS_HSYNC_POLARITY ; +if (adjusted_mode->flags &DRM_MODE_FLAG_NVSYNC ) + lvds_sync |=LVDS_VSYNC_POLARITY ; +if ((temp & (LVDS_HSYNC_POLARITY |LVDS_VSYNC_POLARITY )) + != lvds_sync) { +char flags[2 ] ="-+" ; +DRM_INFO ("Changing LVDS panel from " +"(%chsync, %cvsync) to (%chsync, %cvsync)\n" , + flags[!(temp &LVDS_HSYNC_POLARITY )], + flags[!(temp &LVDS_VSYNC_POLARITY )], + flags[!(lvds_sync &LVDS_HSYNC_POLARITY )], + flags[!(lvds_sync &LVDS_VSYNC_POLARITY )]); + temp &= ~(LVDS_HSYNC_POLARITY |LVDS_VSYNC_POLARITY ); + temp |= lvds_sync; + } +I915_WRITE (LVDS , temp); +} + static void i9xx_update_pll(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode,
@@ -5335,6 +5391,13 @@ static void i9xx_update_pll(struct drm_crtc *crtc,POSTING_READ (DPLL (pipe));udelay (150 ); +/* The LVDS pin pair needs to be on before the DPLLs are enabled. +* This is an exception to the general rule that mode_set doesn't turn +* things on. +*/ +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS )) +intel_update_lvds (crtc, clock, adjusted_mode); +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_DISPLAYPORT ))intel_dp_set_m_n (crtc, mode, adjusted_mode);
@@ -5409,6 +5472,13 @@ static void i8xx_update_pll(struct drm_crtc *crtc,POSTING_READ (DPLL (pipe));udelay (150 ); +/* The LVDS pin pair needs to be on before the DPLLs are enabled. +* This is an exception to the general rule that mode_set doesn't turn +* things on. +*/ +if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS )) +intel_update_lvds (crtc, clock, adjusted_mode); +/* The pixel multiplier can only be updated once the * DPLL is enabled and the clocks are stable. *
@@ -5437,8 +5507,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,struct intel_encoder *encoder;const intel_limit_t *limit;int ret; -u32 temp; -u32 lvds_sync =0 ;list_for_each_entry (encoder, &mode_config->encoder_list, base.head) {if (encoder->base.crtc != crtc)
@@ -5548,58 +5616,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,DRM_DEBUG_KMS ("Mode for pipe %c:\n" , pipe ==0 ?'A' :'B' );drm_mode_debug_printmodeline (mode); -/* The LVDS pin pair needs to be on before the DPLLs are enabled. -* This is an exception to the general rule that mode_set doesn't turn -* things on. -*/ -if (is_lvds) { - temp =I915_READ (LVDS ); - temp |=LVDS_PORT_EN |LVDS_A0A2_CLKA_POWER_UP ; -if (pipe ==1 ) { - temp |=LVDS_PIPEB_SELECT ; - }else { - temp &= ~LVDS_PIPEB_SELECT ; - } -/* set the corresponsding LVDS_BORDER bit */ - temp |= dev_priv->lvds_border_bits; -/* Set the B0-B3 data pairs corresponding to whether we're going to -* set the DPLLs for dual-channel mode or not. -*/ -if (clock.p2 ==7 ) - temp |=LVDS_B0B3_POWER_UP |LVDS_CLKB_POWER_UP ; -else - temp &= ~(LVDS_B0B3_POWER_UP |LVDS_CLKB_POWER_UP ); - -/* It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP) -* appropriately here, but we need to look more thoroughly into how -* panels behave in the two modes. -*/ -/* set the dithering flag on LVDS as needed */ -if (INTEL_INFO (dev)->gen >=4 ) { -if (dev_priv->lvds_dither) - temp |=LVDS_ENABLE_DITHER ; -else - temp &= ~LVDS_ENABLE_DITHER ; - } -if (adjusted_mode->flags &DRM_MODE_FLAG_NHSYNC ) - lvds_sync |=LVDS_HSYNC_POLARITY ; -if (adjusted_mode->flags &DRM_MODE_FLAG_NVSYNC ) - lvds_sync |=LVDS_VSYNC_POLARITY ; -if ((temp & (LVDS_HSYNC_POLARITY |LVDS_VSYNC_POLARITY )) - != lvds_sync) { -char flags[2 ] ="-+" ; -DRM_INFO ("Changing LVDS panel from " -"(%chsync, %cvsync) to (%chsync, %cvsync)\n" , - flags[!(temp &LVDS_HSYNC_POLARITY )], - flags[!(temp &LVDS_VSYNC_POLARITY )], - flags[!(lvds_sync &LVDS_HSYNC_POLARITY )], - flags[!(lvds_sync &LVDS_VSYNC_POLARITY )]); - temp &= ~(LVDS_HSYNC_POLARITY |LVDS_VSYNC_POLARITY ); - temp |= lvds_sync; - } -I915_WRITE (LVDS , temp); - } -if (HAS_PIPE_CXSR (dev)) {if (intel_crtc->lowfreq_avail) {DRM_DEBUG_KMS ("enabling CxSR downclocking\n" );
Signature · 1 line
1.7.5.4
PATCH 9/22 drm/i915: ValleyView mode setting limits and PLL functions
In reply to Jesse BarnesAdd some VLV limit structures and update the PLL code.
v2: resolve conflicts, Vijay to re-post with PLL valid checks and fixed limits
--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_display.c | 231 +++++++++++++++++++++++++++++++++- 2 files changed, 229 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -868,6 +868,7 @@#define DPLL_P2_CLOCK_DIV_MASK 0x03000000/* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000/* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW 0x00ff8000/* Pineview */ +#define DPLL_LOCK_VLV (1<<15)#define DPLL_INTEGRATED_CLOCK_VLV (1<<13)#define SRX_INDEX 0x3c4
drivers/gpu/drm/i915/intel_display.c +228 -3
291 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 10/22 drm/i915: program drain latency regs on ValleyView
In reply to Jesse BarnesFrom: Gajanan Bhat <[email protected]>
This patch adds support for programming drain latency registers of Pondicherry memory arbiter of Valleyview.
v2: clarify function names (Daniel)
fix summary typo (Daniel)
v3: add parens (Ben)
make drain function return bool (Ben)
--- drivers/gpu/drm/i915/i915_reg.h | 16 +++++++ drivers/gpu/drm/i915/intel_display.c | 77 ++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +16 -0
@@ -2597,6 +2597,22 @@#define DSPFW_HPLL_CURSOR_MASK (0x3f<<16)#define DSPFW_HPLL_SR_MASK (0x1ff) +/* drain latency register values*/ +#define DRAIN_LATENCY_PRECISION_32 32 +#define DRAIN_LATENCY_PRECISION_16 16 +#define VLV_DDL1 0x70050 +#define DDL_CURSORA_PRECISION_32 (1<<31) +#define DDL_CURSORA_PRECISION_16 (0<<31) +#define DDL_CURSORA_SHIFT 24 +#define DDL_PLANEA_PRECISION_32 (1<<7) +#define DDL_PLANEA_PRECISION_16 (0<<7) +#define VLV_DDL2 0x70054 +#define DDL_CURSORB_PRECISION_32 (1<<31) +#define DDL_CURSORB_PRECISION_16 (0<<31) +#define DDL_CURSORB_SHIFT 24 +#define DDL_PLANEB_PRECISION_32 (1<<7) +#define DDL_PLANEB_PRECISION_16 (0<<7) +/* FIFO watermark sizes etc */ #define G4X_FIFO_LINE_SIZE 64#define I915_FIFO_LINE_SIZE 64
drivers/gpu/drm/i915/intel_display.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 11/22 drm/i915: Enable DP panel power sequencing for ValleyView
In reply to Jesse BarnesFrom: Shobhit Kumar <[email protected]>
VLV supports two dp panels, there are two set of panel power sequence registers which needed to be programmed based on the configured pipe. This patch add supports for the same
--- drivers/gpu/drm/i915/i915_reg.h | 12 ++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -0
@@ -3726,6 +3726,18 @@#define BLC_PWM_PCH_CTL2 0xc8254 +#define PIPEA_PP_STATUS 0x61200 +#define PIPEA_PP_CONTROL 0x61204 +#define PIPEA_PP_ON_DELAYS 0x61208 +#define PIPEA_PP_OFF_DELAYS 0x6120c +#define PIPEA_PP_DIVISOR 0x61210 + +#define PIPEB_PP_STATUS 0x61300 +#define PIPEB_PP_CONTROL 0x61304 +#define PIPEB_PP_ON_DELAYS 0x61308 +#define PIPEB_PP_OFF_DELAYS 0x6130c +#define PIPEB_PP_DIVISOR 0x61310 +#define PCH_PP_STATUS 0xc7200#define PCH_PP_CONTROL 0xc7204#define PANEL_UNLOCK_REGS (0xabcd << 16)
drivers/gpu/drm/i915/intel_dp.c +7 -1
@@ -311,7 +311,13 @@ static bool ironlake_edp_have_panel_power(struct intel_dp *intel_dp)struct drm_device *dev = intel_dp->base.base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -return (I915_READ (PCH_PP_STATUS ) &PP_ON ) !=0 ; +if (IS_VALLEYVIEW (dev)) { +if (I915_READ (intel_dp->output_reg) &DP_PIPEB_SELECT ) +return (I915_READ (PIPEB_PP_STATUS ) &PP_ON ) !=0 ; +else +return (I915_READ (PIPEA_PP_STATUS ) &PP_ON ) !=0 ; + }else +return (I915_READ (PCH_PP_STATUS ) &PP_ON ) !=0 ; }static bool ironlake_edp_have_panel_vdd (struct intel_dp *intel_dp)
Signature · 1 line
1.7.5.4
Re: [PATCH 11/22] drm/i915: Enable DP panel power sequencing for ValleyView
Quoted 11 lines · Jesse Barnes
From: Shobhit Kumar <[email protected]>
VLV supports two dp panels, there are two set of panel power sequence registers which needed to be programmed based on the configured pipe. This patch add supports for the same
Signed-off-by Beeresh G <[email protected]>Reviewed-by Vijay Purushothaman <[email protected]>Reviewed-by Jesse Barnes <[email protected]>Signed-off-by Jesse Barnes <[email protected]>
Afaics we use these PP_ regs at tons of other places. Do we not need them there or will that follow in a later patch?
-Daniel
Quoted 54 lines
--- drivers/gpu/drm/i915/i915_reg.h | 12 ++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletions(-)drivers/gpu/drm/i915/i915_reg.h +12
-0@@ -3726,6 +3726,18 @@#define BLC_PWM_PCH_CTL2 0xc8254 +#define PIPEA_PP_STATUS 0x61200 +#define PIPEA_PP_CONTROL 0x61204 +#define PIPEA_PP_ON_DELAYS 0x61208 +#define PIPEA_PP_OFF_DELAYS 0x6120c +#define PIPEA_PP_DIVISOR 0x61210 + +#define PIPEB_PP_STATUS 0x61300 +#define PIPEB_PP_CONTROL 0x61304 +#define PIPEB_PP_ON_DELAYS 0x61308 +#define PIPEB_PP_OFF_DELAYS 0x6130c +#define PIPEB_PP_DIVISOR 0x61310 +#define PCH_PP_STATUS 0xc7200#define PCH_PP_CONTROL 0xc7204#define PANEL_UNLOCK_REGS (0xabcd << 16)drivers/gpu/drm/i915/intel_dp.c +7
-1@@ -311,7 +311,13 @@ static bool ironlake_edp_have_panel_power(struct intel_dp *intel_dp)struct drm_device *dev = intel_dp->base.base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -return (I915_READ (PCH_PP_STATUS ) &PP_ON ) !=0 ; +if (IS_VALLEYVIEW (dev)) { +if (I915_READ (intel_dp->output_reg) &DP_PIPEB_SELECT ) +return (I915_READ (PIPEB_PP_STATUS ) &PP_ON ) !=0 ; +else +return (I915_READ (PIPEA_PP_STATUS ) &PP_ON ) !=0 ; + }else +return (I915_READ (PCH_PP_STATUS ) &PP_ON ) !=0 ; }static bool ironlake_edp_have_panel_vdd (struct intel_dp *intel_dp)Signature · 6 lines
1.7.5.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Re: [PATCH 11/22] drm/i915: Enable DP panel power sequencing for ValleyView
Quoted 13 lines · On Wed, 28 Mar 2012 23:59:33 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 11 lines · Jesse Barnes
From: Shobhit Kumar <[email protected]>
VLV supports two dp panels, there are two set of panel power sequence registers which needed to be programmed based on the configured pipe. This patch add supports for the same
Signed-off-by Beeresh G <[email protected]>Reviewed-by Vijay Purushothaman <[email protected]>Reviewed-by Jesse Barnes <[email protected]>Signed-off-by Jesse Barnes <[email protected]>
Quoted 3 lines
Afaics we use these
PP_regs at tons of other places. Do we not need them there or will that follow in a later patch?
-Daniel
Later patch; this one hasn't been tested yet either.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 12/22 drm/i915: Enable HDMI on ValleyView
In reply to Jesse BarnesFrom: Shobhit Kumar <[email protected]>
HDMI register offsets are different in Valleyview. Add support for the same.
v2: drop superfluous comments in HDMI init (Daniel)
--- drivers/gpu/drm/i915/i915_reg.h | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_hdmi.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +16 -0
@@ -3461,6 +3461,21 @@#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_DATA_A 0x60208 +#define VLV_VIDEO_DIP_GDCP_PAYLOAD_A 0x60210 + +#define VLV_VIDEO_DIP_CTL_B 0x61170 +#define VLV_VIDEO_DIP_DATA_B 0x61174 +#define VLV_VIDEO_DIP_GDCP_PAYLOAD_B 0x61178 + +#define VLV_TVIDEO_DIP_CTL (pipe) \ + _PIPE(pipe, VLV_VIDEO_DIP_CTL_A, VLV_VIDEO_DIP_CTL_B) +#define VLV_TVIDEO_DIP_DATA (pipe) \ + _PIPE(pipe, VLV_VIDEO_DIP_DATA_A, VLV_VIDEO_DIP_DATA_B) +#define VLV_TVIDEO_DIP_GCP (pipe) \ + _PIPE(pipe, VLV_VIDEO_DIP_GDCP_PAYLOAD_A, VLV_VIDEO_DIP_GDCP_PAYLOAD_B) +#define _TRANS_HTOTAL_B 0xe1000#define _TRANS_HBLANK_B 0xe1004#define _TRANS_HSYNC_B 0xe1008
@@ -3681,6 +3696,7 @@#define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16)/* or SDVOB */ +#define VLV_HDMIB 0x61140#define HDMIB 0xe1140#define PORT_ENABLE (1 << 31)#define TRANSCODER (pipe) ((pipe) << 30)
drivers/gpu/drm/i915/intel_hdmi.c +36 -1
@@ -177,6 +177,37 @@ static void ironlake_write_infoframe(struct drm_encoder *encoder,I915_WRITE (reg,VIDEO_DIP_ENABLE | val | flags); } + +static void vlv_write_infoframe (struct drm_encoder *encoder, +struct dip_infoframe *frame) +{ +uint32_t *data = (uint32_t *)frame; +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int reg =VLV_TVIDEO_DIP_CTL (intel_crtc->pipe); +unsigned i, len =DIP_HEADER_SIZE + frame->len; +u32 flags, val =I915_READ (reg); + +intel_wait_for_vblank (dev, intel_crtc->pipe); + + flags =intel_infoframe_index (frame); + + val &= ~(VIDEO_DIP_SELECT_MASK |0xf );/* clear DIP data offset */ + +I915_WRITE (reg,VIDEO_DIP_ENABLE | val | flags); + +for (i =0 ; i < len; i +=4 ) { +I915_WRITE (VLV_TVIDEO_DIP_DATA (intel_crtc->pipe), *data); + data++; + } + + flags |=intel_infoframe_flags (frame); + +I915_WRITE (reg,VIDEO_DIP_ENABLE | val | flags); +} +static void intel_set_infoframe (struct drm_encoder *encoder,struct dip_infoframe *frame) {
@@ -552,7 +583,11 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)if (!HAS_PCH_SPLIT (dev)) { intel_hdmi->write_infoframe = i9xx_write_infoframe;I915_WRITE (VIDEO_DIP_CTL ,0 ); - }else { + }else if (IS_VALLEYVIEW (dev)) { + intel_hdmi->write_infoframe = vlv_write_infoframe; +for_each_pipe (i) +I915_WRITE (VLV_TVIDEO_DIP_CTL (i),0 ); + }else { intel_hdmi->write_infoframe = ironlake_write_infoframe;for_each_pipe (i)I915_WRITE (TVIDEO_DIP_CTL (i),0 );
Signature · 1 line
1.7.5.4
PATCH 13/22 agp/intel: map more registers for use by the GTT code
In reply to Jesse BarnesWe need to flush the Gunit TLB when we update GTT PTEs on VLV, but the register for doing so is above the range we normally map. Map the whole register space to make sure we can get it.
v2: only map the larger space on gen7+ (Daniel)
--- drivers/char/agp/intel-gtt.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/char/agp/intel-gtt.c +5 -1
@@ -1206,12 +1206,16 @@ static inline int needs_idle_maps(void)static int i9xx_setup (void ) {u32 reg_addr; +int size =KB (512 );pci_read_config_dword (intel_private.pcidev,I915_MMADDR , ®_addr); reg_addr &=0xfff80000 ; - intel_private.registers =ioremap (reg_addr,128 *4096 ); +if (INTEL_GTT_GEN >=7 ) + size =MB (2 ); + + intel_private.registers =ioremap (reg_addr, size);if (!intel_private.registers)return -ENOMEM ;
Signature · 1 line
1.7.5.4
PATCH 14/22 agp/intel: add ValleyView AGP driver
In reply to Jesse BarnesBut don't bind the PCI ID yet.
--- drivers/char/agp/intel-agp.c | 1 + drivers/char/agp/intel-agp.h | 3 +++ drivers/char/agp/intel-gtt.c | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 0 deletions(-)
drivers/char/agp/intel-agp.c +1 -0
@@ -907,6 +907,7 @@ static struct pci_device_id agp_intel_pci_table[] = {ID (PCI_DEVICE_ID_INTEL_IVYBRIDGE_HB ),ID (PCI_DEVICE_ID_INTEL_IVYBRIDGE_M_HB ),ID (PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB ), + ID(PCI_DEVICE_ID_INTEL_VALLEYVIEW_HB), { } };
drivers/char/agp/intel-agp.h +3 -0
@@ -96,6 +96,7 @@#define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN)#define GFX_FLSH_CNTL 0x2170/* 915+ */ +#define GFX_FLSH_CNTL_VLV 0x101008#define I810_DRAM_CTL 0x3000#define I810_DRAM_ROW_0 0x00000001
@@ -234,6 +235,8 @@#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_M_GT2_IG 0x0166#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB 0x0158/* Server */ #define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT1_IG 0x015A +#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_HB 0x0F00/* VLV1 */ +#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG 0x0F30int intel_gmch_probe (struct pci_dev *pdev,struct agp_bridge_data *bridge);
drivers/char/agp/intel-gtt.c +23 -0
@@ -1179,6 +1179,20 @@ static void gen6_write_entry(dma_addr_t addr, unsigned int entry,writel (addr | pte_flags, intel_private.gtt + entry); } +static void valleyview_write_entry (dma_addr_t addr,unsigned int entry, +unsigned int flags) +{ +u32 pte_flags; + + pte_flags =GEN6_PTE_UNCACHED |I810_PTE_VALID ; + +/* gen6 has bit11-4 for physical addr bit39-32 */ + addr |= (addr >>28 ) &0xff0 ; +writel (addr | pte_flags, intel_private.gtt + entry); + +writel (1 , intel_private.registers +GFX_FLSH_CNTL_VLV ); +} +static void gen6_cleanup (void ) { }
@@ -1359,6 +1373,15 @@ static const struct intel_gtt_driver sandybridge_gtt_driver = { .check_flags = gen6_check_flags, .chipset_flush = i9xx_chipset_flush, }; +static const struct intel_gtt_driver valleyview_gtt_driver = { + .gen =7 , + .setup = i9xx_setup, + .cleanup = gen6_cleanup, + .write_entry = valleyview_write_entry, + .dma_mask_size =40 , + .check_flags = gen6_check_flags, + .chipset_flush = i9xx_chipset_flush, +};/* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of * driver and gmch_driver must be non-null, and find_gmch will determine
Signature · 1 line
1.7.5.4
PATCH 15/22 agp/intel: bind ValleyView AGP driver
In reply to Jesse BarnesWith the code in place, we can bind this driver.
--- drivers/char/agp/intel-gtt.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/char/agp/intel-gtt.c +2 -0
@@ -1486,6 +1486,8 @@ static const struct intel_gtt_driver_description { "Ivybridge", &sandybridge_gtt_driver }, {PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT1_IG , "Ivybridge", &sandybridge_gtt_driver }, + { PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG, + "ValleyView", &valleyview_gtt_driver }, { 0, NULL, NULL } };
Signature · 1 line
1.7.5.4
PATCH 16/22 drm/i915: add ValleyView specific CRT detect function
In reply to Jesse BarnesMight be able to merge this back in at some point, but we're seeing bugs with ADPA based detection, so keep it separate for now with explicit hotplug trigger usage.
v2: drop superfluous debug message
v3: comment forced detection, need to debug (Eugeni)
--- drivers/gpu/drm/i915/intel_crt.c | 39 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +39 -0
@@ -212,6 +212,42 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)return ret; } +static bool valleyview_crt_detect_hotplug (struct drm_connector *connector) +{ +struct drm_device *dev = connector->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +u32 adpa; +bool ret; +u32 save_adpa; + + save_adpa = adpa =I915_READ (ADPA ); +DRM_DEBUG_KMS ("trigger hotplug detect cycle: adpa=0x%x\n" , adpa); + + adpa |=ADPA_CRT_HOTPLUG_FORCE_TRIGGER ; + +I915_WRITE (ADPA , adpa); + +if (wait_for ((I915_READ (ADPA ) &ADPA_CRT_HOTPLUG_FORCE_TRIGGER ) ==0 , +1000 )) { +DRM_DEBUG_KMS ("timed out waiting for FORCE_TRIGGER" ); +I915_WRITE (ADPA , save_adpa); + } + +/* Check the status to see if both blue and green are on now */ + adpa =I915_READ (ADPA ); +if ((adpa &ADPA_CRT_HOTPLUG_MONITOR_MASK ) !=0 ) + ret = true; +else + ret = false; + +DRM_DEBUG_KMS ("valleyview hotplug adpa=0x%x, result %d\n" , adpa, ret); + +/* FIXME: debug force function and remove */ + ret = true; + +return ret; +} +/** * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence. *
@@ -231,6 +267,9 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)if (HAS_PCH_SPLIT (dev))return intel_ironlake_crt_detect_hotplug (connector); +if (IS_VALLEYVIEW (dev)) +return valleyview_crt_detect_hotplug (connector); +/* * On 4 series desktop, CRT detect sequence need to be done twice * to get a reliable result.
Signature · 1 line
1.7.5.4
PATCH 17/22 drm/i915: add ValleyView specific force wake get/put functions
In reply to Jesse BarnesValleyView handles force wake differently than previous chipsets, so add a couple of new functions for it. But leave it disabled by default until we test it (need a chip with the Punit enabled first).
--- drivers/gpu/drm/i915/i915_drv.c | 28 +++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 2 ++ 4 files changed, 34 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +27 -1
@@ -465,6 +465,31 @@ int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)return ret; } +void vlv_force_wake_get (struct drm_i915_private *dev_priv) +{ +int count; + + count =0 ; + +/* Already awake? */ +if ((I915_READ (0x130094 ) &0xa1 ) ==0xa1 ) +return ; + +I915_WRITE_NOTRACE (FORCEWAKE_VLV ,0xffffffff ); +POSTING_READ (FORCEWAKE_VLV ); + + count =0 ; +while (count++ <50 && (I915_READ_NOTRACE (FORCEWAKE_ACK_VLV ) &1 ) ==0 ) +udelay (10 ); +} + +void vlv_force_wake_put (struct drm_i915_private *dev_priv) +{ +I915_WRITE_NOTRACE (FORCEWAKE_VLV ,0xffff0000 ); +/* FIXME: confirm VLV behavior with Punit folks */ +POSTING_READ (FORCEWAKE_VLV ); +} +static int i915_drm_freeze (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1007,7 +1032,8 @@ MODULE_LICENSE("GPL and additional rights");#define NEEDS_FORCE_WAKE (dev_priv, reg) \ (((dev_priv)->info->gen >= 6) && \ ((reg) < 0x40000) && \ - ((reg) != FORCEWAKE)) + ((reg) != FORCEWAKE)) && \ + (!IS_VALLEYVIEW((dev_priv)->dev))#define __i915_read (x, y) \ u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \
drivers/gpu/drm/i915/i915_drv.h +3 -0
@@ -1406,6 +1406,9 @@ extern void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv);extern void __gen6_gt_force_wake_put (struct drm_i915_private *dev_priv);extern void __gen6_gt_force_wake_mt_put (struct drm_i915_private *dev_priv); +extern void vlv_force_wake_get (struct drm_i915_private *dev_priv); +extern void vlv_force_wake_put (struct drm_i915_private *dev_priv); +/* overlay */ #ifdef CONFIG_DEBUG_FS extern struct intel_overlay_error_state *intel_overlay_capture_error_state (struct drm_device *dev);
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -3874,6 +3874,8 @@#define EDP_LINK_TRAIN_VOL_EMP_MASK_IVB (0x3f<<22)#define FORCEWAKE 0xA18C +#define FORCEWAKE_VLV 0x1300b0 +#define FORCEWAKE_ACK_VLV 0x1300b4#define FORCEWAKE_ACK 0x130090#define FORCEWAKE_MT 0xa188/* multi-threaded */ #define FORCEWAKE_MT_ACK 0x130040
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -9502,6 +9502,8 @@ static void intel_init_display(struct drm_device *dev) dev_priv->display.update_wm = valleyview_update_wm; dev_priv->display.init_clock_gating = valleyview_init_clock_gating; + dev_priv->display.force_wake_get = vlv_force_wake_get; + dev_priv->display.force_wake_put = vlv_force_wake_put; } else if (IS_PINEVIEW(dev)) { if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev), dev_priv->is_ddr3,
Signature · 1 line
1.7.5.4
PATCH 18/22 drm/i915: ValleyView IRQ support
In reply to Jesse BarnesValleyView has a new interrupt architecture; best to put it in a new set of functions. Also make sure the ring mask functions handle ValleyView.
FIXME: fix flipping; need to enable interrupts and call prepare/finish
--- drivers/gpu/drm/i915/i915_debugfs.c | 40 ++++- drivers/gpu/drm/i915/i915_irq.c | 338 ++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 7 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 4 +- 4 files changed, 383 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +39 -1
@@ -468,7 +468,45 @@ static int i915_interrupt_info(struct seq_file *m, void *data)if (ret)return ret; -if (!HAS_PCH_SPLIT (dev)) { +if (IS_VALLEYVIEW (dev)) { +seq_printf (m,"Display IER:\t%08x\n" , +I915_READ (VLV_IER )); +seq_printf (m,"Display IIR:\t%08x\n" , +I915_READ (VLV_IIR )); +seq_printf (m,"Display IIR_RW:\t%08x\n" , +I915_READ (VLV_IIR_RW )); +seq_printf (m,"Display IMR:\t%08x\n" , +I915_READ (VLV_IMR )); +for_each_pipe (pipe) +seq_printf (m,"Pipe %c stat:\t%08x\n" , +pipe_name (pipe), +I915_READ (PIPESTAT (pipe))); + +seq_printf (m,"Master IER:\t%08x\n" , +I915_READ (VLV_MASTER_IER )); + +seq_printf (m,"Render IER:\t%08x\n" , +I915_READ (GTIER )); +seq_printf (m,"Render IIR:\t%08x\n" , +I915_READ (GTIIR )); +seq_printf (m,"Render IMR:\t%08x\n" , +I915_READ (GTIMR )); + +seq_printf (m,"PM IER:\t\t%08x\n" , +I915_READ (GEN6_PMIER )); +seq_printf (m,"PM IIR:\t\t%08x\n" , +I915_READ (GEN6_PMIIR )); +seq_printf (m,"PM IMR:\t\t%08x\n" , +I915_READ (GEN6_PMIMR )); + +seq_printf (m,"Port hotplug:\t%08x\n" , +I915_READ (PORT_HOTPLUG_EN )); +seq_printf (m,"DPFLIPSTAT:\t%08x\n" , +I915_READ (VLV_DPFLIPSTAT )); +seq_printf (m,"DPINVGTT:\t%08x\n" , +I915_READ (DPINVGTT )); + + }else if (!HAS_PCH_SPLIT (dev)) {seq_printf (m,"Interrupt enable: %08x\n" ,I915_READ (IER )); seq_printf(m, "Interrupt identity: %08x\n",
drivers/gpu/drm/i915/i915_irq.c +336 -2
392 lines not on this page · raw message
drivers/gpu/drm/i915/i915_reg.h +6 -1
@@ -510,6 +510,11 @@#define IIR 0x020a4#define IMR 0x020a8#define ISR 0x020ac +#define VLV_IIR_RW 0x182084 +#define VLV_IER 0x1820a0 +#define VLV_IIR 0x1820a4 +#define VLV_IMR 0x1820a8 +#define VLV_ISR 0x1820ac#define I915_PIPE_CONTROL_NOTIFY_INTERRUPT (1<<18)#define I915_DISPLAY_PORT_INTERRUPT (1<<17)#define I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT (1<<15)
@@ -2534,7 +2539,7 @@#define PIPEFRAMEPIXEL (pipe) _PIPE(pipe, _PIPEAFRAMEPIXEL, _PIPEBFRAMEPIXEL)#define PIPESTAT (pipe) _PIPE(pipe, _PIPEASTAT, _PIPEBSTAT) -#define DPFLIPSTAT_VLV 0x70028 +#define VLV_DPFLIPSTAT 0x70028#define PIPEB_LINE_COMPARE_STATUS (1<<29)#define PIPEB_HLINE_INT_EN (1<<28)#define PIPEB_VBLANK_INT_EN (1<<27)
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -2
@@ -687,7 +687,7 @@ render_ring_get_irq(struct intel_ring_buffer *ring)spin_lock (&ring->irq_lock);if (ring->irq_refcount++ ==0 ) { -if (HAS_PCH_SPLIT (dev)) +if (HAS_PCH_SPLIT (dev) ||IS_VALLEYVIEW (dev))ironlake_enable_irq (dev_priv,GT_PIPE_NOTIFY |GT_USER_INTERRUPT );else
@@ -706,7 +706,7 @@ render_ring_put_irq(struct intel_ring_buffer *ring)spin_lock (&ring->irq_lock);if (--ring->irq_refcount ==0 ) { -if (HAS_PCH_SPLIT (dev)) +if (HAS_PCH_SPLIT (dev) ||IS_VALLEYVIEW (dev))ironlake_disable_irq (dev_priv,GT_USER_INTERRUPT |GT_PIPE_NOTIFY );
Signature · 1 line
1.7.5.4
Re: [PATCH 18/22] drm/i915: ValleyView IRQ support
Quoted 114 lines · Jesse Barnes
ValleyView has a new interrupt architecture; best to put it in a new set of functions. Also make sure the ring mask functions handle ValleyView.
FIXME: fix flipping; need to enable interrupts and call prepare/finish
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 40 ++++- drivers/gpu/drm/i915/i915_irq.c | 338 ++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 7 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 4 +- 4 files changed, 383 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +39
-1@@ -468,7 +468,45 @@ static int i915_interrupt_info(struct seq_file *m, void *data)if (ret)return ret; -if (!HAS_PCH_SPLIT (dev)) { +if (IS_VALLEYVIEW (dev)) { +seq_printf (m,"Display IER:\t%08x\n" , +I915_READ (VLV_IER )); +seq_printf (m,"Display IIR:\t%08x\n" , +I915_READ (VLV_IIR )); +seq_printf (m,"Display IIR_RW:\t%08x\n" , +I915_READ (VLV_IIR_RW )); +seq_printf (m,"Display IMR:\t%08x\n" , +I915_READ (VLV_IMR )); +for_each_pipe (pipe) +seq_printf (m,"Pipe %c stat:\t%08x\n" , +pipe_name (pipe), +I915_READ (PIPESTAT (pipe))); + +seq_printf (m,"Master IER:\t%08x\n" , +I915_READ (VLV_MASTER_IER )); + +seq_printf (m,"Render IER:\t%08x\n" , +I915_READ (GTIER )); +seq_printf (m,"Render IIR:\t%08x\n" , +I915_READ (GTIIR )); +seq_printf (m,"Render IMR:\t%08x\n" , +I915_READ (GTIMR )); + +seq_printf (m,"PM IER:\t\t%08x\n" , +I915_READ (GEN6_PMIER )); +seq_printf (m,"PM IIR:\t\t%08x\n" , +I915_READ (GEN6_PMIIR )); +seq_printf (m,"PM IMR:\t\t%08x\n" , +I915_READ (GEN6_PMIMR )); + +seq_printf (m,"Port hotplug:\t%08x\n" , +I915_READ (PORT_HOTPLUG_EN )); +seq_printf (m,"DPFLIPSTAT:\t%08x\n" , +I915_READ (VLV_DPFLIPSTAT )); +seq_printf (m,"DPINVGTT:\t%08x\n" , +I915_READ (DPINVGTT )); + + }else if (!HAS_PCH_SPLIT (dev)) {seq_printf (m,"Interrupt enable: %08x\n" ,I915_READ (IER )); seq_printf(m, "Interrupt identity: %08x\n",drivers/gpu/drm/i915/i915_irq.c +35
-0@@ -120,6 +120,10 @@ void intel_enable_asle(struct drm_device *dev)drm_i915_private_t *dev_priv = dev->dev_private;unsigned long irqflags; +/* FIXME: opregion/asle for VLV */ +if (IS_VALLEYVIEW (dev)) +return ; +spin_lock_irqsave (&dev_priv->irq_lock, irqflags);if (HAS_PCH_SPLIT (dev))@@ -426,6 +430,119 @@ static void gen6_pm_rps_work(struct work_struct *work)mutex_unlock (&dev_priv->dev->struct_mutex); } +static irqreturn_t valleyview_irq_handler (DRM_IRQ_ARGS ) +{ +struct drm_device *dev = (struct drm_device *) arg; +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +u32 iir, gt_iir, pm_iir; +irqreturn_t ret =IRQ_NONE ; +unsigned long irqflags; +int pipe; +u32 pipe_stats[I915_MAX_PIPES ]; +u32 vblank_status; +int vblank =0 ; +bool blc_event; + +atomic_inc (&dev_priv->irq_received); + + vblank_status =PIPE_START_VBLANK_INTERRUPT_STATUS | +PIPE_VBLANK_INTERRUPT_STATUS ; + +while (true) { + iir =I915_READ (VLV_IIR ); + gt_iir =I915_READ (GTIIR ); + pm_iir =I915_READ (GEN6_PMIIR ); + +if (gt_iir ==0 && pm_iir ==0 && iir ==0 ) + goto out; + + ret =IRQ_HANDLED ; + +if (gt_iir & (GT_USER_INTERRUPT |GT_PIPE_NOTIFY )) +notify_ring (dev, &dev_priv->ring[RCS ]); +if (gt_iir >_GEN6_BSD_USER_INTERRUPT )
drivers/gpu/drm/i915/i915_irq.c static void gen6_pm_rps_work(struct work_struct *work) · line 473
Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +10
-0+notify_ring (dev, &dev_priv->ring[VCS ]); +if (gt_iir >_BLT_USER_INTERRUPT ) +notify_ring (dev, &dev_priv->ring[BCS ]); + +if (gt_iir & (GT_GEN6_BLT_CS_ERROR_INTERRUPT | +GT_GEN6_BSD_CS_ERROR_INTERRUPT | +GT_RENDER_CS_ERROR_INTERRUPT )) { +DRM_ERROR ("GT error interrupt 0x%08x\n" , gt_iir); +i915_handle_error (dev, false); + }
Ben just cleaned up this code slightly (well, the reg definitions mostly in i915_irq.c). I'm also wondering whether we should share the gt_iir handling a bit - after all we share the gt core with ilk. But this can easily be done in a follow-up patch.
Quoted 158 lines
drivers/gpu/drm/i915/i915_irq.c +137
-0+ +spin_lock_irqsave (&dev_priv->irq_lock, irqflags); +for_each_pipe (pipe) { +int reg =PIPESTAT (pipe); + pipe_stats[pipe] =I915_READ (reg); + +/* +* Clear the PIPE*STAT regs before the IIR +*/ +if (pipe_stats[pipe] &0x8000ffff ) { +if (pipe_stats[pipe] &PIPE_FIFO_UNDERRUN_STATUS ) +DRM_DEBUG_DRIVER ("pipe %c underrun\n" , +pipe_name (pipe)); +I915_WRITE (reg, pipe_stats[pipe]); + } + } +spin_unlock_irqrestore (&dev_priv->irq_lock, irqflags); + +/* Consume port. Then clear IIR or we'll miss events */ +if (iir &I915_DISPLAY_PORT_INTERRUPT ) { +u32 hotplug_status =I915_READ (PORT_HOTPLUG_STAT ); + +DRM_DEBUG_DRIVER ("hotplug event received, stat 0x%08x\n" , + hotplug_status); +if (hotplug_status & dev_priv->hotplug_supported_mask) +queue_work (dev_priv->wq, + &dev_priv->hotplug_work); + +I915_WRITE (PORT_HOTPLUG_STAT , hotplug_status); +I915_READ (PORT_HOTPLUG_STAT ); + } + + +if (iir &I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT ) { +drm_handle_vblank (dev,0 ); + vblank++; +if (!dev_priv->flip_pending_is_done) { +intel_finish_page_flip (dev,0 ); + } + } + +if (iir &I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT ) { +drm_handle_vblank (dev,1 ); + vblank++; +if (!dev_priv->flip_pending_is_done) { +intel_finish_page_flip (dev,0 ); + } + } + +if (pipe_stats[pipe] &PIPE_LEGACY_BLC_EVENT_STATUS ) + blc_event = true; + +if (pm_iir &GEN6_PM_DEFERRED_EVENTS ) { +unsigned long flags; +spin_lock_irqsave (&dev_priv->rps_lock, flags); +WARN (dev_priv->pm_iir & pm_iir,"Missed a PM interrupt\n" ); + dev_priv->pm_iir |= pm_iir; +I915_WRITE (GEN6_PMIMR , dev_priv->pm_iir); +POSTING_READ (GEN6_PMIMR ); +spin_unlock_irqrestore (&dev_priv->rps_lock, flags); +queue_work (dev_priv->wq, &dev_priv->rps_work); + } + +I915_WRITE (GTIIR , gt_iir); +I915_WRITE (GEN6_PMIIR , pm_iir); +I915_WRITE (VLV_IIR , iir); + } + +out: +return ret; +} +static void pch_irq_handler (struct drm_device *dev) {drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;@@ -1567,6 +1684,32 @@ static int ivybridge_enable_vblank(struct drm_device *dev, int pipe)return 0 ; } +static int valleyview_enable_vblank (struct drm_device *dev,int pipe) +{ +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +unsigned long irqflags; +u32 dpfl, imr; + +if (!i915_pipe_enabled (dev, pipe)) +return -EINVAL ; + +spin_lock_irqsave (&dev_priv->irq_lock, irqflags); + dpfl =I915_READ (VLV_DPFLIPSTAT ); + imr =I915_READ (VLV_IMR ); +if (pipe ==0 ) { + dpfl |=PIPEA_VBLANK_INT_EN ; + imr &= ~I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT ; + }else { + dpfl |=PIPEA_VBLANK_INT_EN ; + imr &= ~I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT ; + } +I915_WRITE (VLV_DPFLIPSTAT , dpfl); +I915_WRITE (VLV_IMR , imr); +spin_unlock_irqrestore (&dev_priv->irq_lock, irqflags); + +return 0 ; +} +/* Called from drm generic code, passed 'crtc' which * we use as a pipe index */ @@ -1608,6 +1751,28 @@ static void ivybridge_disable_vblank(struct drm_device *dev, int pipe)spin_unlock_irqrestore (&dev_priv->irq_lock, irqflags); } +static void valleyview_disable_vblank (struct drm_device *dev,int pipe) +{ +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +unsigned long irqflags; +u32 dpfl, imr; + +spin_lock_irqsave (&dev_priv->irq_lock, irqflags); + dpfl =I915_READ (VLV_DPFLIPSTAT ); + imr =I915_READ (VLV_IMR ); +if (pipe ==0 ) { + dpfl &= ~PIPEA_VBLANK_INT_EN ; + imr |=I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT ; + }else { + dpfl &= ~PIPEB_VBLANK_INT_EN ; + imr |=I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT ; + } +I915_WRITE (VLV_IMR , imr); +I915_WRITE (VLV_DPFLIPSTAT , dpfl); +spin_unlock_irqrestore (&dev_priv->irq_lock, irqflags); +} + +/* Set the vblank monitor pipe */ int i915_vblank_pipe_set(struct drm_device *dev, void *data,@@ -1817,6 +1982,53 @@ static void ironlake_irq_preinstall(struct drm_device *dev)POSTING_READ (SDEIER ); } +static void valleyview_irq_preinstall (struct drm_device *dev) +{ +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +int pipe; + +atomic_set (&dev_priv->irq_received,0 ); + +INIT_WORK (&dev_priv->hotplug_work, i915_hotplug_work_func); +INIT_WORK (&dev_priv->error_work, i915_error_work_func); + +/* VLV magic */ +I915_WRITE (VLV_IMR ,0 ); +I915_WRITE (RING_IMR (RENDER_RING_BASE ),0 ); +I915_WRITE (RING_IMR (GEN6_BSD_RING_BASE ),0 ); +I915_WRITE (RING_IMR (BLT_RING_BASE ),0 ); + +if (IS_GEN6 (dev) ||IS_GEN7 (dev)) {
drivers/gpu/drm/i915/i915_irq.c static void ironlake_irq_preinstall(struct drm_device *dev) · line 2011
Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +10
-0+/* Workaround stalls observed on Sandy Bridge GPUs by +* making the blitter command streamer generate a +* write to the Hardware Status Page for +* MI_USER_INTERRUPT. This appears to serialize the +* previous seqno write out before the interrupt +* happens. +*/ +I915_WRITE (GEN6_BLITTER_HWSTAM , ~GEN6_BLITTER_USER_INTERRUPT ); +I915_WRITE (GEN6_BSD_HWSTAM , ~GEN6_BSD_USER_INTERRUPT ); + }
That wa hopefully doesn't apply to vlv. And it's dead by now anyway. Please kill it.
Quoted 207 lines
drivers/gpu/drm/i915/i915_irq.c +144
-2+ +/* and GT */ +I915_WRITE (GTIIR ,I915_READ (GTIIR )); +I915_WRITE (GTIIR ,I915_READ (GTIIR )); +I915_WRITE (GTIMR ,0xffffffff ); +I915_WRITE (GTIER ,0x0 ); +POSTING_READ (GTIER ); + +I915_WRITE (DPINVGTT ,0xff ); + +I915_WRITE (PORT_HOTPLUG_EN ,0 ); +I915_WRITE (PORT_HOTPLUG_STAT ,I915_READ (PORT_HOTPLUG_STAT )); +for_each_pipe (pipe) +I915_WRITE (PIPESTAT (pipe),0xffff ); +I915_WRITE (VLV_IIR ,0xffffffff ); +I915_WRITE (VLV_IMR ,0xffffffff ); +I915_WRITE (VLV_IER ,0x0 ); +POSTING_READ (VLV_IER ); +} +/* * Enable digital hotplug on the PCH, and configure the DP short pulse * duration to 2ms (which is the minimum in the Display Port spec) @@ -1963,6 +2175,96 @@ static int ivybridge_irq_postinstall(struct drm_device *dev)return 0 ; } +static int valleyview_irq_postinstall (struct drm_device *dev) +{ +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +u32 render_irqs; +u32 enable_mask; +u32 hotplug_en =I915_READ (PORT_HOTPLUG_EN ); +u16 msid; + + enable_mask =I915_DISPLAY_PORT_INTERRUPT ; + enable_mask |=I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT | +I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT ; + + dev_priv->irq_mask = ~enable_mask; + + +DRM_INIT_WAITQUEUE (&dev_priv->ring[RCS ].irq_queue); +DRM_INIT_WAITQUEUE (&dev_priv->ring[VCS ].irq_queue); +DRM_INIT_WAITQUEUE (&dev_priv->ring[BCS ].irq_queue); + + dev_priv->pipestat[0 ] =0 ; + dev_priv->pipestat[1 ] =0 ; + + dev_priv->vblank_pipe =DRM_I915_VBLANK_PIPE_A |DRM_I915_VBLANK_PIPE_B ; + +/* Hack for broken MSIs on VLV */ +pci_write_config_dword (dev_priv->dev->pdev,0x94 ,0xfee00000 ); +pci_read_config_word (dev->pdev,0x98 , &msid); + msid &=0xff ;/* mask out delivery bits */ + msid |= (1 <<14 ); +pci_write_config_word (dev_priv->dev->pdev,0x98 , msid); + +I915_WRITE (VLV_IMR , dev_priv->irq_mask); +I915_WRITE (VLV_IER , enable_mask); +I915_WRITE (VLV_IIR ,0xffffffff ); +I915_WRITE (PIPESTAT (0 ),0xffff ); +I915_WRITE (PIPESTAT (1 ),0xffff ); +POSTING_READ (VLV_IER ); + +I915_WRITE (VLV_IIR ,0xffffffff ); +I915_WRITE (VLV_IIR ,0xffffffff ); + + render_irqs =GT_GEN6_BLT_FLUSHDW_NOTIFY_INTERRUPT | +GT_GEN6_BLT_CS_ERROR_INTERRUPT | +GT_BLT_USER_INTERRUPT | +GT_GEN6_BSD_USER_INTERRUPT | +GT_GEN6_BSD_CS_ERROR_INTERRUPT | +GT_GEN7_L3_PARITY_ERROR_INTERRUPT | +GT_PIPE_NOTIFY | +GT_RENDER_CS_ERROR_INTERRUPT | +GT_SYNC_STATUS | +GT_USER_INTERRUPT ; + + dev_priv->gt_irq_mask = ~render_irqs; + +I915_WRITE (GTIIR ,I915_READ (GTIIR )); +I915_WRITE (GTIIR ,I915_READ (GTIIR )); +I915_WRITE (GTIMR ,0 ); +I915_WRITE (GTIER , render_irqs); +POSTING_READ (GTIER ); + +/* ack & enable invalid PTE error interrupts */ +#if 0 /* FIXME: add support to irq handler for checking these bits */ +I915_WRITE (DPINVGTT ,DPINVGTT_STATUS_MASK ); +I915_WRITE (DPINVGTT ,DPINVGTT_EN_MASK ); +#endif + +I915_WRITE (VLV_MASTER_IER ,MASTER_INTERRUPT_ENABLE ); +#if 0 /* FIXME: check register definitions; some have moved */ +/* Note HDMI and DP share bits */ +if (dev_priv->hotplug_supported_mask &HDMIB_HOTPLUG_INT_STATUS ) + hotplug_en |=HDMIB_HOTPLUG_INT_EN ; +if (dev_priv->hotplug_supported_mask &HDMIC_HOTPLUG_INT_STATUS ) + hotplug_en |=HDMIC_HOTPLUG_INT_EN ; +if (dev_priv->hotplug_supported_mask &HDMID_HOTPLUG_INT_STATUS ) + hotplug_en |=HDMID_HOTPLUG_INT_EN ; +if (dev_priv->hotplug_supported_mask &SDVOC_HOTPLUG_INT_STATUS ) + hotplug_en |=SDVOC_HOTPLUG_INT_EN ; +if (dev_priv->hotplug_supported_mask &SDVOB_HOTPLUG_INT_STATUS ) + hotplug_en |=SDVOB_HOTPLUG_INT_EN ; +if (dev_priv->hotplug_supported_mask &CRT_HOTPLUG_INT_STATUS ) { + hotplug_en |=CRT_HOTPLUG_INT_EN ; + hotplug_en |=CRT_HOTPLUG_VOLTAGE_COMPARE_50 ; + } +#endif + +I915_WRITE (PORT_HOTPLUG_EN , hotplug_en); + +return 0 ; +} +static void i915_driver_irq_preinstall (struct drm_device * dev) {drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;@@ -2066,6 +2368,30 @@ static int i915_driver_irq_postinstall(struct drm_device *dev)return 0 ; } +static void valleyview_irq_uninstall (struct drm_device *dev) +{ +drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; +int pipe; + +if (!dev_priv) +return ; + + dev_priv->vblank_pipe =0 ; + +for_each_pipe (pipe) +I915_WRITE (PIPESTAT (pipe),0xffff ); + +I915_WRITE (HWSTAM ,0xffffffff ); +I915_WRITE (PORT_HOTPLUG_EN ,0 ); +I915_WRITE (PORT_HOTPLUG_STAT ,I915_READ (PORT_HOTPLUG_STAT )); +for_each_pipe (pipe) +I915_WRITE (PIPESTAT (pipe),0xffff ); +I915_WRITE (VLV_IIR ,0xffffffff ); +I915_WRITE (VLV_IMR ,0xffffffff ); +I915_WRITE (VLV_IER ,0x0 ); +POSTING_READ (VLV_IER ); +} +static void ironlake_irq_uninstall (struct drm_device *dev) {drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;@@ -2121,7 +2447,8 @@ void intel_irq_init(struct drm_device *dev) { dev->driver->get_vblank_counter = i915_get_vblank_counter; dev->max_vblank_count =0xffffff ;/* only 24 bits of frame count */ -if (IS_G4X (dev) ||IS_GEN5 (dev) ||IS_GEN6 (dev) ||IS_IVYBRIDGE (dev)) { +if (IS_G4X (dev) ||IS_GEN5 (dev) ||IS_GEN6 (dev) ||IS_IVYBRIDGE (dev) || +IS_VALLEYVIEW (dev)) { dev->max_vblank_count =0xffffffff ;/* full 32 bit counter */ dev->driver->get_vblank_counter = gm45_get_vblank_counter; }@@ -2132,7 +2459,14 @@ void intel_irq_init(struct drm_device *dev) dev->driver->get_vblank_timestamp =NULL ; dev->driver->get_scanout_position = i915_get_crtc_scanoutpos; -if (IS_IVYBRIDGE (dev)) { +if (IS_VALLEYVIEW (dev)) { + dev->driver->irq_handler = valleyview_irq_handler; + dev->driver->irq_preinstall = valleyview_irq_preinstall; + dev->driver->irq_postinstall = valleyview_irq_postinstall; + dev->driver->irq_uninstall = valleyview_irq_uninstall; + dev->driver->enable_vblank = valleyview_enable_vblank; + dev->driver->disable_vblank = valleyview_disable_vblank; + }else if (IS_IVYBRIDGE (dev)) {/* Share pre & uninstall handlers with ILK/SNB */ dev->driver->irq_handler = ivybridge_irq_handler; dev->driver->irq_preinstall = ironlake_irq_preinstall;drivers/gpu/drm/i915/i915_reg.h +6
-1@@ -510,6 +510,11 @@#define IIR 0x020a4#define IMR 0x020a8#define ISR 0x020ac +#define VLV_IIR_RW 0x182084 +#define VLV_IER 0x1820a0 +#define VLV_IIR 0x1820a4 +#define VLV_IMR 0x1820a8 +#define VLV_ISR 0x1820ac#define I915_PIPE_CONTROL_NOTIFY_INTERRUPT (1<<18)#define I915_DISPLAY_PORT_INTERRUPT (1<<17)#define I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT (1<<15)@@ -2534,7 +2539,7 @@#define PIPEFRAMEPIXEL (pipe) _PIPE(pipe, _PIPEAFRAMEPIXEL, _PIPEBFRAMEPIXEL)#define PIPESTAT (pipe) _PIPE(pipe, _PIPEASTAT, _PIPEBSTAT) -#define DPFLIPSTAT_VLV 0x70028 +#define VLV_DPFLIPSTAT 0x70028#define PIPEB_LINE_COMPARE_STATUS (1<<29)#define PIPEB_HLINE_INT_EN (1<<28)#define PIPEB_VBLANK_INT_EN (1<<27)drivers/gpu/drm/i915/intel_ringbuffer.c +0
-0
drivers/gpu/drm/i915/intel_ringbuffer.c render_ring_get_irq(struct intel_ring_buffer *ring) · line 690
Quoted 5 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +1
-1@@ -687,7 +687,7 @@ render_ring_get_irq(struct intel_ring_buffer *ring)spin_lock (&ring->irq_lock);if (ring->irq_refcount++ ==0 ) { -if (HAS_PCH_SPLIT (dev)) +if (HAS_PCH_SPLIT (dev) ||IS_VALLEYVIEW (dev))
Bikeshed I've just noticed: Imo irq handling is core gt stuff, so makes sense to check for gen >=5 instead of HAS_PCH_SPLIT (which is just an output feature). I know, the master irq control is associated with the display crap, but these functions here just frob around with ring (i.e. gt) stuff.
-Daniel
Quoted 19 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +1
-1ironlake_enable_irq (dev_priv,GT_PIPE_NOTIFY |GT_USER_INTERRUPT ); else@@ -706,7 +706,7 @@ render_ring_put_irq(struct intel_ring_buffer *ring)spin_lock (&ring->irq_lock);if (--ring->irq_refcount ==0 ) { -if (HAS_PCH_SPLIT (dev)) +if (HAS_PCH_SPLIT (dev) ||IS_VALLEYVIEW (dev))ironlake_disable_irq (dev_priv,GT_USER_INTERRUPT |GT_PIPE_NOTIFY );Signature · 6 lines
1.7.5.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Re: [PATCH 18/22] drm/i915: ValleyView IRQ support
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Jesse Barnes
ValleyView has a new interrupt architecture; best to put it in a new set of functions. Also make sure the ring mask functions handle ValleyView.
FIXME: fix flipping; need to enable interrupts and call prepare/finish
Signed-off-by Jesse Barnes <[email protected]>
Meh, just noticed that I've already applied this. I'll write a few patches
...
-Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
PATCH 19/22 drm/i915: check for disabled interrupts on ValleyView
In reply to Jesse BarnesHaven't seen this yet, but it doesn't hurt.
--- drivers/gpu/drm/i915/i915_gem.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +2 -0
@@ -1875,6 +1875,8 @@ i915_wait_request(struct intel_ring_buffer *ring,if (!i915_seqno_passed (ring->get_seqno (ring), seqno)) {if (HAS_PCH_SPLIT (ring->dev)) ier =I915_READ (DEIER ) |I915_READ (GTIER ); +else if (IS_VALLEYVIEW (ring->dev)) + ier =I915_READ (GTIER ) |I915_READ (VLV_IER );else ier =I915_READ (IER );if (!ier) {
Signature · 1 line
1.7.5.4
PATCH 20/22 drm/i915: add HDMI and DP port enumeration on ValleyView
In reply to Jesse BarnesValleyView is similar to IbexPeak here, but with different register offsets.
--- drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +18 -0
@@ -8329,6 +8329,24 @@ static void intel_setup_outputs(struct drm_device *dev)if (!dpd_is_edp && (I915_READ (PCH_DP_D ) &DP_DETECTED ))intel_dp_init (dev,PCH_DP_D ); + }else if (IS_VALLEYVIEW (dev)) { +int found; + +if (I915_READ (VLV_HDMIB ) &PORT_DETECTED ) { +/* SDVOB multiplex with HDMIB */ + found =intel_sdvo_init (dev,VLV_HDMIB ); +if (!found) +intel_hdmi_init (dev,VLV_HDMIB ); +if (!found && (I915_READ (DP_B ) &DP_DETECTED )) +intel_dp_init (dev,DP_B ); + } + +if (I915_READ (SDVOC ) &PORT_DETECTED ) +intel_hdmi_init (dev,SDVOC ); + +/* Shares lanes with HDMI on SDVOC */ +if (!dpd_is_edp && (I915_READ (DP_C ) &DP_DETECTED )) +intel_dp_init (dev,DP_C ); }else if (SUPPORTS_DIGITAL_OUTPUTS (dev)) {bool found = false;
Signature · 1 line
1.7.5.4
PATCH 21/22 drm/i915: disable turbo on ValleyView for now
In reply to Jesse BarnesWe'll probably need new init functions and will need to test it.
--- drivers/gpu/drm/i915/i915_suspend.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +1 -1
@@ -886,7 +886,7 @@ int i915_restore_state(struct drm_device *dev)intel_init_emon (dev); } -if (INTEL_INFO (dev)->gen >=6 ) { +if (INTEL_INFO (dev)->gen >=6 && !IS_VALLEYVIEW (dev)) {gen6_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv); }
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -9756,7 +9756,7 @@ void intel_modeset_init(struct drm_device *dev)intel_init_emon (dev); } -if (IS_GEN6 (dev) ||IS_GEN7 (dev)) { +if ((IS_GEN6 (dev) &&IS_GEN7 (dev)) && !IS_VALLEYVIEW (dev)) {gen6_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv); }
@@ -9799,7 +9799,7 @@ void intel_modeset_cleanup(struct drm_device *dev)if (IS_IRONLAKE_M (dev))ironlake_disable_drps (dev); -if (IS_GEN6 (dev) ||IS_GEN7 (dev)) +if ((IS_GEN6 (dev) ||IS_GEN7 (dev)) && !IS_VALLEYVIEW (dev))gen6_disable_rps (dev);if (IS_IRONLAKE_M (dev))
Signature · 1 line
1.7.5.4
Re: [PATCH 21/22] drm/i915: disable turbo on ValleyView for now
Quoted 26 lines · Jesse Barnes
We'll probably need new init functions and will need to test it.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -886,7 +886,7 @@ int i915_restore_state(struct drm_device *dev)intel_init_emon (dev); } -if (INTEL_INFO (dev)->gen >=6 ) { +if (INTEL_INFO (dev)->gen >=6 && !IS_VALLEYVIEW (dev)) {gen6_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv); }drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c void intel_modeset_init(struct drm_device *dev) · line 9759
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -9756,7 +9756,7 @@ void intel_modeset_init(struct drm_device *dev)intel_init_emon (dev); } -if (IS_GEN6 (dev) ||IS_GEN7 (dev)) { +if ((IS_GEN6 (dev) &&IS_GEN7 (dev)) && !IS_VALLEYVIEW (dev)) {
IS_GEN6 && IS_GEN7 is unlikely to exist ...
-Daniel
Quoted 19 lines
drivers/gpu/drm/i915/intel_display.c +1
-1gen6_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv); }@@ -9799,7 +9799,7 @@ void intel_modeset_cleanup(struct drm_device *dev)if (IS_IRONLAKE_M (dev))ironlake_disable_drps (dev); -if (IS_GEN6 (dev) ||IS_GEN7 (dev)) +if ((IS_GEN6 (dev) ||IS_GEN7 (dev)) && !IS_VALLEYVIEW (dev))gen6_disable_rps (dev);if (IS_IRONLAKE_M (dev))Signature · 6 lines
1.7.5.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Re: [PATCH 21/22] drm/i915: disable turbo on ValleyView for now
Quoted 30 lines · On Thu, 29 Mar 2012 00:02:03 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 29 lines · Jesse Barnes
We'll probably need new init functions and will need to test it.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -886,7 +886,7 @@ int i915_restore_state(struct drm_device *dev)intel_init_emon (dev); } -if (INTEL_INFO (dev)->gen >=6 ) { +if (INTEL_INFO (dev)->gen >=6 && !IS_VALLEYVIEW (dev)) {gen6_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv); }drivers/gpu/drm/i915/intel_display.c +0
-0@@ -9756,7 +9756,7 @@ void intel_modeset_init(struct drm_device *dev)intel_init_emon (dev); }
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c void intel_modeset_init(struct drm_device *dev) · line 9759
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +1
-1-if (IS_GEN6 (dev) ||IS_GEN7 (dev)) { +if ((IS_GEN6 (dev) &&IS_GEN7 (dev)) && !IS_VALLEYVIEW (dev)) {
IS_GEN6&&IS_GEN7is unlikely to exist ...
Haha, how did that happen
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 22/22 drm/i915: bind driver to ValleyView chipsets
In reply to Jesse BarnesWith the code in place, we can bind the driver, should make bisect possible.
--- drivers/gpu/drm/i915/i915_drv.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +3 -0
@@ -316,6 +316,9 @@ static const struct pci_device_id pciidlist[] = { /* aka */INTEL_VGA_DEVICE (0x0152 , &intel_ivybridge_d_info),/* GT1 desktop */ INTEL_VGA_DEVICE (0x0162 , &intel_ivybridge_d_info),/* GT2 desktop */ INTEL_VGA_DEVICE (0x015a , &intel_ivybridge_d_info),/* GT1 server */ +INTEL_VGA_DEVICE (0x0f30 , &intel_valleyview_m_info), +INTEL_VGA_DEVICE (0x0157 , &intel_valleyview_m_info), +INTEL_VGA_DEVICE (0x0155 , &intel_valleyview_d_info), {0, 0, 0} };
Signature · 1 line
1.7.5.4
Quoted 7 lines · Jesse Barnes
Updated patchset addressing comments. I dropped some:
- display reg offset (we're going to fix this up differently)
- cache handling (not needed)
along with the ones Daniel has already queued.Hopefully these ones look ok to people and we can get them queued up as well.
Ok, I've picked up quite a few of these here. Three patches (the one I've sent out to the m-l) are slightly changed, just to increase the chance we don't break bisect. I've complained here or on irc about a few others. I also haven't picked up most of the output handling changes - I think we should wait until you have access to real hw again and until we have a clearer picture how we're gonna solve the mmio_base problem. I obviously also left out the device id binding patch.
For further merging I'd like to have basic vlv working before applying the dev id binding patch. Now the mmio_base disaster is a bit big, so would concentrating on just one output (intel_hdmi.c looks the most mmio_base clean already) help?
This way we'd only need to wrestle with getting core i9xx modesetting stuff mmio_base aware. I'd then merge the dev id binding patch right after we have support for this. Tackling the mess in intel_crt.c and intel_dp.c (and the panel stuff like the PP_ regs) would then happen in a second step.
My issue here is that atm we have 2 new platforms to merge at the same time, so I'd like to get basic vlv working asap. We have intel_display.c to clean up after merging hsw and vlv, after all ...
If you prefer a different plan, ideas highly welcome.
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48