patches for -next
Subsystems (2)
cover patches for -next
This was all I could find regarding fairly stable patches which are fixes only. I feel like I'm missing one, but I gave up on looking
Ben Widawsky (4):
drm/i915: relative_constants_mode race fix
drm/i915: Force sync command ordering (Gen6+)
drm/i915: Update GEN6_RP_CONTROL definitions
drm/i915: drpc debugfs update for gen6
drivers/gpu/drm/i915/i915_debugfs.c | 86 +++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 32 +++++++---- drivers/gpu/drm/i915/i915_reg.h | 20 ++++++- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 5 ++ 5 files changed, 129 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.8
PATCH 1/4 drm/i915: relative_constants_mode race fix
dev_priv keeps track of the current addressing mode that gets set at execbuffer time. Unfortunately the existing code was doing this before acquiring struct_mutex which leaves a race with another thread also doing an execbuffer. If that wasn't bad enough, relocate_slow drops struct_mutex which opens a much more likely error where another thread comes in and modifies the state while relocate_slow is being slow.
The solution here is to just defer setting this state until we absolutely need it, and we know we'll have struct_mutex for the remainder of our code path.
v2: Keith noticed a bug in the original patch.
--- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 29 +++++++++++++++------------ 1 files changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +16 -13
@@ -1016,19 +1016,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,if (INTEL_INFO (dev)->gen >5 && mode ==I915_EXEC_CONSTANTS_REL_SURFACE )return -EINVAL ; - - ret =intel_ring_begin (ring,4 ); -if (ret) -return ret; - -intel_ring_emit (ring,MI_NOOP ); -intel_ring_emit (ring,MI_LOAD_REGISTER_IMM (1 )); -intel_ring_emit (ring,INSTPM ); -intel_ring_emit (ring, -I915_EXEC_CONSTANTS_MASK <<16 | mode); -intel_ring_advance (ring); - - dev_priv->relative_constants_mode = mode; }break ;default :
@@ -1159,6 +1146,22 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, } } +if (ring == &dev_priv->ring[RCS ] && + mode != dev_priv->relative_constants_mode) { + ret =intel_ring_begin (ring,4 ); +if (ret) + goto err; + +intel_ring_emit (ring,MI_NOOP ); +intel_ring_emit (ring,MI_LOAD_REGISTER_IMM (1 )); +intel_ring_emit (ring,INSTPM ); +intel_ring_emit (ring, +I915_EXEC_CONSTANTS_MASK <<16 | mode); +intel_ring_advance (ring); + + dev_priv->relative_constants_mode = mode; + } +trace_i915_gem_ring_dispatch (ring, seqno); exec_start = batch_obj->gtt_offset + args->batch_start_offset;
Signature · 1 line
1.7.8
PATCH 2/4 drm/i915: Force sync command ordering (Gen6+)
In reply to Ben WidawskyThe docs say this is required for Gen7, and since the bit was added for Gen6, we are also setting it there pit pf paranoia. Particularly as Chris points out, if PIPE_CONTROL counts as a 3d state packet.
This was found through doc inspection by Ken and applies to Gen6+;
--- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 9 +++++++-- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_ringbuffer.c | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +7 -2
@@ -967,6 +967,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,struct intel_ring_buffer *ring;u32 exec_start, exec_len;u32 seqno; +u32 mask;int ret, mode, i;if (!i915_gem_check_execbuffer (args)) {
@@ -1004,6 +1005,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, } mode = args->flags &I915_EXEC_CONSTANTS_MASK ; + mask =I915_EXEC_CONSTANTS_MASK ;switch (mode) {case I915_EXEC_CONSTANTS_REL_GENERAL :case I915_EXEC_CONSTANTS_ABSOLUTE :
@@ -1016,6 +1018,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,if (INTEL_INFO (dev)->gen >5 && mode ==I915_EXEC_CONSTANTS_REL_SURFACE )return -EINVAL ; + +/* The HW changed the meaning on this bit on gen6 */ +if (INTEL_INFO (dev)->gen >=6 ) + mask &= ~I915_EXEC_CONSTANTS_REL_SURFACE ; }break ;default :
@@ -1155,8 +1161,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,intel_ring_emit (ring,MI_NOOP );intel_ring_emit (ring,MI_LOAD_REGISTER_IMM (1 ));intel_ring_emit (ring,INSTPM ); -intel_ring_emit (ring, -I915_EXEC_CONSTANTS_MASK <<16 | mode); +intel_ring_emit (ring, mask <<16 | mode);intel_ring_advance (ring); dev_priv->relative_constants_mode = mode;
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -442,6 +442,7 @@#define INSTPM_AGPBUSY_DIS (1<<11)/* gen3: when disabled, pending interrupts will not assert AGPBUSY# and will only be delivered when out of C3. */ +#define INSTPM_FORCE_ORDERING (1<<7)/* GEN6+ */ #define ACTHD 0x020c8#define FW_BLC 0x020d8#define FW_BLC2 0x020dc
drivers/gpu/drm/i915/intel_ringbuffer.c +5 -0
@@ -414,6 +414,11 @@ static int init_render_ring(struct intel_ring_buffer *ring)return ret; } +if (INTEL_INFO (dev)->gen >=6 ) { +I915_WRITE (INSTPM , +INSTPM_FORCE_ORDERING <<16 |INSTPM_FORCE_ORDERING ); + } +return ret; }
Signature · 1 line
1.7.8
PATCH 3/4 drm/i915: Update GEN6_RP_CONTROL definitions
In reply to Ben WidawskyThis matches the modern specs more accurately.
This will be used by the following patch to fix the way we display RC status.
--- drivers/gpu/drm/i915/i915_reg.h | 6 +++++- drivers/gpu/drm/i915/intel_display.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +5 -1
@@ -3479,7 +3479,11 @@#define GEN6_CAGF_MASK (0x7f << GEN6_CAGF_SHIFT)#define GEN6_RP_CONTROL 0xA024#define GEN6_RP_MEDIA_TURBO (1<<11) -#define GEN6_RP_USE_NORMAL_FREQ (1<<9) +#define GEN6_RP_MEDIA_MODE_MASK (3<<9) +#define GEN6_RP_MEDIA_HW_TURBO_MODE (3<<9) +#define GEN6_RP_MEDIA_HW_NORMAL_MODE (2<<9) +#define GEN6_RP_MEDIA_HW_MODE (1<<9) +#define GEN6_RP_MEDIA_SW_MODE (0<<9)#define GEN6_RP_MEDIA_IS_GFX (1<<8)#define GEN6_RP_ENABLE (1<<7)#define GEN6_RP_UP_IDLE_MIN (0x1<<3)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -7950,7 +7950,7 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)I915_WRITE (GEN6_RP_IDLE_HYSTERSIS ,10 ); I915_WRITE(GEN6_RP_CONTROL, GEN6_RP_MEDIA_TURBO | - GEN6_RP_USE_NORMAL_FREQ | + GEN6_RP_MEDIA_HW_MODE | GEN6_RP_MEDIA_IS_GFX | GEN6_RP_ENABLE | GEN6_RP_UP_BUSY_AVG |
Signature · 1 line
1.7.8
Re: [PATCH 3/4] drm/i915: Update GEN6_RP_CONTROL definitions
Quoted 7 lines · On Mon, 12 Dec 2011 19:21:59 -0800 Ben Widawsky <[email protected]> wrote:
This matches the modern specs more accurately.
This will be used by the following patch to fix the way we display RC status.
Signed-off-by Ben Widawsky <[email protected]>---
Looks good.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915: Update GEN6_RP_CONTROL definitions
In reply to Ben WidawskyQuoted 7 lines · Ben Widawsky
This matches the modern specs more accurately.
This will be used by the following patch to fix the way we display RC status.
Signed-off-by Ben Widawsky <[email protected]>
Signature · 2 lines
Eugeni Dodonov <http://eugeni.dodonov.net/>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: drpc debugfs update for gen6
In reply to Ben WidawskyMany of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
--- drivers/gpu/drm/i915/i915_debugfs.c | 86 ++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 13 +++++- 2 files changed, 97 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +85 -1
@@ -999,7 +999,7 @@ static int i915_inttoext_table(struct seq_file *m, void *unused)return 0 ; } -static int i915_drpc_info (struct seq_file *m,void *unused) +static int ironlake_drpc_info (struct seq_file *m) {struct drm_info_node *node = (struct drm_info_node *) m->private;struct drm_device *dev = node->minor->dev;
@@ -1066,6 +1066,90 @@ static int i915_drpc_info(struct seq_file *m, void *unused)return 0 ; } +static int gen6_drpc_info (struct seq_file *m) +{ + +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; +u32 rpmodectl1, gt_core_status, rcctl1; +int count=0 , ret; + + + ret =mutex_lock_interruptible (&dev->struct_mutex); +if (ret) +return ret; + +if (atomic_read (&dev_priv->forcewake_count)) { +seq_printf (m,"RC information inaccurate because userspace " +"holds a reference \n" ); + }else { +/* NB: we cannot use forcewake, else we read the wrong values */ +while (count++ <50 && (I915_READ_NOTRACE (FORCEWAKE_ACK ) &1 )) +udelay (10 ); +seq_printf (m,"RC information accurate: %s\n" ,yesno (count <51 )); + } + + gt_core_status =readl (dev_priv->regs +GEN6_GT_CORE_STATUS ); +trace_i915_reg_rw (false,GEN6_GT_CORE_STATUS , gt_core_status,4 ); + + rpmodectl1 =I915_READ (GEN6_RP_CONTROL ); + rcctl1 =I915_READ (GEN6_RC_CONTROL ); +mutex_unlock (&dev->struct_mutex); + +seq_printf (m,"Video Turbo Mode: %s\n" , +yesno (rpmodectl1 &GEN6_RP_MEDIA_TURBO )); +seq_printf (m,"HW control enabled: %s\n" , +yesno (rpmodectl1 &GEN6_RP_ENABLE )); +seq_printf (m,"SW control enabled: %s\n" , +yesno ((rpmodectl1 &GEN6_RP_MEDIA_MODE_MASK ) == +GEN6_RP_MEDIA_SW_MODE )); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC1e_ENABLE)); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 &GEN6_RC_CTL_RC6_ENABLE )); +seq_printf (m,"Deep RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6p_ENABLE)); +seq_printf (m,"Deepest RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6pp_ENABLE)); +seq_printf (m,"Current RC state: " ); +switch (gt_core_status & GEN6_RCn_MASK) { +case GEN6_RC0 : +if (gt_core_status &GEN6_CORE_CPD_STATE_MASK ) +seq_printf (m,"Core Power Down\n" ); +else +seq_printf (m,"on\n" ); +break ; +case GEN6_RC3 : +seq_printf (m,"RC3\n" ); +break ; +case GEN6_RC6 : +seq_printf (m,"RC6\n" ); +break ; +case GEN6_RC7 : +seq_printf (m,"RC7\n" ); +break ; +default : +seq_printf (m,"Unknown\n" ); +break ; + } + +seq_printf (m,"Core Power Down: %s\n" , +yesno (gt_core_status &GEN6_CORE_CPD_STATE_MASK )); +return 0 ; +} + +static int i915_drpc_info (struct seq_file *m,void *unused) +{ +struct drm_info_node *node = (struct drm_info_node *) m->private; +struct drm_device *dev = node->minor->dev; + +if (IS_GEN6 (dev) ||IS_GEN7 (dev)) +return gen6_drpc_info (m); +else +return ironlake_drpc_info (m); +} +static int i915_fbc_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
drivers/gpu/drm/i915/i915_reg.h +12 -1
@@ -3459,8 +3459,11 @@# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)#define GEN6_RPNSWREQ 0xA008 +#define GEN6_GT_THREAD_P_REQ 0x13807C#define GEN6_TURBO_DISABLE (1<<31) -#define GEN6_FREQUENCY (x) ((x)<<25) +#define GEN6_FREQUENCY_SHIFT 25 +#define GEN6_FREQUENCY_MASK 0x3f +#define GEN6_FREQUENCY (x) ((x)<<GEN6_FREQUENCY_SHIFT)#define GEN6_OFFSET (x) ((x)<<19)#define GEN6_AGGRESSIVE_TURBO (0<<15)#define GEN6_RC_VIDEO_FREQ 0xA00C
@@ -3540,6 +3543,14 @@#define GEN6_PCODE_DATA 0x138128#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 +#define GEN6_GT_CORE_STATUS 0x138060 +#define GEN6_CORE_CPD_STATE_MASK (7<<4) +#define GEN6_RCn_MASK 7 +#define GEN6_RC0 0 +#define GEN6_RC3 2 +#define GEN6_RC6 3 +#define GEN6_RC7 4 +#define G4X_AUD_VID_DID 0x62020#define INTEL_AUDIO_DEVCL 0x808629FB#define INTEL_AUDIO_DEVBLC 0x80862801
Signature · 1 line
1.7.8
Re: [PATCH 4/4] drm/i915: drpc debugfs update for gen6
Quoted 10 lines · Ben Widawsky
Many of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
Signed-off-by Ben Widawsky <[email protected]>
Nak this because of a merge error.
Re: [PATCH 4/4] drm/i915: drpc debugfs update for gen6
In reply to Ben WidawskyQuoted 11 lines · On Mon, 12 Dec 2011 19:22:00 -0800 Ben Widawsky <[email protected]> wrote:
Many of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
Signed-off-by Ben Widawsky <[email protected]>---
Aside from the merge error:
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Eugeni Dodonov
Reviewed-byRe: [PATCH 4/4] drm/i915: drpc debugfs update for gen6
Quoted 11 lines · Jesse Barnes
Quoted 8 lines · On Mon, 12 Dec 2011 19:22:00 -0800 Ben Widawsky <[email protected]> wrote:
Many of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU.
Quoted 8 lines
Quoted 3 lines
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
Signed-off-by Ben Widawsky <[email protected]>---
Aside from the merge error:
Reviewed-by Jesse Barnes <[email protected]>
Signature · 2 lines
Eugeni Dodonov <http://eugeni.dodonov.net/>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/4 drm/i915: drpc debugfs update for gen6
In reply to Ben WidawskyMany of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
--- drivers/gpu/drm/i915/i915_debugfs.c | 86 ++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 8 +++ 2 files changed, 93 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +85 -1
@@ -999,7 +999,7 @@ static int i915_inttoext_table(struct seq_file *m, void *unused)return 0 ; } -static int i915_drpc_info (struct seq_file *m,void *unused) +static int ironlake_drpc_info (struct seq_file *m) {struct drm_info_node *node = (struct drm_info_node *) m->private;struct drm_device *dev = node->minor->dev;
@@ -1066,6 +1066,90 @@ static int i915_drpc_info(struct seq_file *m, void *unused)return 0 ; } +static int gen6_drpc_info (struct seq_file *m) +{ + +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; +u32 rpmodectl1, gt_core_status, rcctl1; +int count=0 , ret; + + + ret =mutex_lock_interruptible (&dev->struct_mutex); +if (ret) +return ret; + +if (atomic_read (&dev_priv->forcewake_count)) { +seq_printf (m,"RC information inaccurate because userspace " +"holds a reference \n" ); + }else { +/* NB: we cannot use forcewake, else we read the wrong values */ +while (count++ <50 && (I915_READ_NOTRACE (FORCEWAKE_ACK ) &1 )) +udelay (10 ); +seq_printf (m,"RC information accurate: %s\n" ,yesno (count <51 )); + } + + gt_core_status =readl (dev_priv->regs +GEN6_GT_CORE_STATUS ); +trace_i915_reg_rw (false,GEN6_GT_CORE_STATUS , gt_core_status,4 ); + + rpmodectl1 =I915_READ (GEN6_RP_CONTROL ); + rcctl1 =I915_READ (GEN6_RC_CONTROL ); +mutex_unlock (&dev->struct_mutex); + +seq_printf (m,"Video Turbo Mode: %s\n" , +yesno (rpmodectl1 &GEN6_RP_MEDIA_TURBO )); +seq_printf (m,"HW control enabled: %s\n" , +yesno (rpmodectl1 &GEN6_RP_ENABLE )); +seq_printf (m,"SW control enabled: %s\n" , +yesno ((rpmodectl1 &GEN6_RP_MEDIA_MODE_MASK ) == +GEN6_RP_MEDIA_SW_MODE )); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC1e_ENABLE)); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 &GEN6_RC_CTL_RC6_ENABLE )); +seq_printf (m,"Deep RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6p_ENABLE)); +seq_printf (m,"Deepest RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6pp_ENABLE)); +seq_printf (m,"Current RC state: " ); +switch (gt_core_status & GEN6_RCn_MASK) { +case GEN6_RC0 : +if (gt_core_status &GEN6_CORE_CPD_STATE_MASK ) +seq_printf (m,"Core Power Down\n" ); +else +seq_printf (m,"on\n" ); +break ; +case GEN6_RC3 : +seq_printf (m,"RC3\n" ); +break ; +case GEN6_RC6 : +seq_printf (m,"RC6\n" ); +break ; +case GEN6_RC7 : +seq_printf (m,"RC7\n" ); +break ; +default : +seq_printf (m,"Unknown\n" ); +break ; + } + +seq_printf (m,"Core Power Down: %s\n" , +yesno (gt_core_status &GEN6_CORE_CPD_STATE_MASK )); +return 0 ; +} + +static int i915_drpc_info (struct seq_file *m,void *unused) +{ +struct drm_info_node *node = (struct drm_info_node *) m->private; +struct drm_device *dev = node->minor->dev; + +if (IS_GEN6 (dev) ||IS_GEN7 (dev)) +return gen6_drpc_info (m); +else +return ironlake_drpc_info (m); +} +static int i915_fbc_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
drivers/gpu/drm/i915/i915_reg.h +8 -0
@@ -3540,6 +3540,14 @@#define GEN6_PCODE_DATA 0x138128#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 +#define GEN6_GT_CORE_STATUS 0x138060 +#define GEN6_CORE_CPD_STATE_MASK (7<<4) +#define GEN6_RCn_MASK 7 +#define GEN6_RC0 0 +#define GEN6_RC3 2 +#define GEN6_RC6 3 +#define GEN6_RC7 4 +#define G4X_AUD_VID_DID 0x62020#define INTEL_AUDIO_DEVCL 0x808629FB#define INTEL_AUDIO_DEVBLC 0x80862801
Signature · 1 line
1.7.8