drm/i915: IVB/HSW have 32 fence register
Subsystems (2)
PATCH 1/2 drm/i915: IVB/HSW have 32 fence register
From: Ville Syrjälä <[email protected]>
Increase the number of fence registers to 32 on IVB/HSW. VLV however only has 16 fence registers according to the docs.
--- drivers/gpu/drm/i915/i915_drv.h | 6 +++--- drivers/gpu/drm/i915/i915_gem.c | 4 +++- drivers/gpu/drm/i915/i915_irq.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -3
@@ -195,9 +195,9 @@ struct drm_i915_master_private {struct _drm_i915_sarea *sarea_priv; };#define I915_FENCE_REG_NONE -1 -#define I915_MAX_NUM_FENCES 16 -/* 16 fences + sign bit for FENCE_REG_NONE */ -#define I915_MAX_NUM_FENCE_BITS 5 +#define I915_MAX_NUM_FENCES 32 +/* 32 fences + sign bit for FENCE_REG_NONE */ +#define I915_MAX_NUM_FENCE_BITS 6struct drm_i915_fence_reg {struct list_head lru_list;
drivers/gpu/drm/i915/i915_gem.c +3 -1
@@ -4184,7 +4184,9 @@ i915_gem_load(struct drm_device *dev)if (!drm_core_check_feature (dev,DRIVER_MODESET )) dev_priv->fence_reg_start =3 ; -if (INTEL_INFO (dev)->gen >=4 ||IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) +if (INTEL_INFO (dev)->gen >=7 && !IS_VALLEYVIEW (dev)) + dev_priv->num_fence_regs =32 ; +else if (INTEL_INFO (dev)->gen >=4 ||IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) dev_priv->num_fence_regs =16 ;else dev_priv->num_fence_regs =8 ;
drivers/gpu/drm/i915/i915_irq.c +1 -1
@@ -1217,7 +1217,7 @@ static void i915_gem_record_fences(struct drm_device *dev,switch (INTEL_INFO (dev)->gen) {case 7 :case 6 : -for (i =0 ; i <16 ; i++) +for (i =0 ; i < dev_priv->num_fence_regs; i++) error->fence[i] =I915_READ64 (FENCE_REG_SANDYBRIDGE_0 + (i *8 ));break ;case 5 :
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: Increase max fence pitch limit to 256KB on IVB+
From: Ville Syrjälä <[email protected]>
BSpec contains several scattered notes which state that the maximum fence stride was increased to 256KB on IVB.
Testing on real hardware agrees.
--- drivers/gpu/drm/i915/i915_gem_tiling.c | 9 ++++++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_gem_tiling.c +6 -3
@@ -217,9 +217,12 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) tile_width =512 ;/* check maximum stride & object size */ -if (INTEL_INFO (dev)->gen >=4 ) { -/* i965 stores the end address of the gtt mapping in the fence -* reg, so dont bother to check the size */ +/* i965+ stores the end address of the gtt mapping in the fence +* reg, so dont bother to check the size */ +if (INTEL_INFO (dev)->gen >=7 ) { +if (stride /128 >GEN7_FENCE_MAX_PITCH_VAL ) +return false; + }else if (INTEL_INFO (dev)->gen >=4 ) {if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; }else {
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -424,6 +424,7 @@#define FENCE_REG_SANDYBRIDGE_0 0x100000#define SANDYBRIDGE_FENCE_PITCH_SHIFT 32 +#define GEN7_FENCE_MAX_PITCH_VAL 0x0800/* control register for cpu gtt access */ #define TILECTL 0x101000
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: Increase max fence pitch limit to 256KB on IVB+
Quoted 18 lines · On Tue, Apr 09, 2013 at 11:45:05AM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
BSpec contains several scattered notes which state that the maximum fence stride was increased to 256KB on IVB.
Testing on real hardware agrees.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_gem_tiling.c | 9 ++++++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_gem_tiling.c +0
-0
drivers/gpu/drm/i915/i915_gem_tiling.c i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) · line 222
Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-3@@ -217,9 +217,12 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) tile_width =512 ;/* check maximum stride & object size */ -if (INTEL_INFO (dev)->gen >=4 ) { -/* i965 stores the end address of the gtt mapping in the fence -* reg, so dont bother to check the size */ +/* i965+ stores the end address of the gtt mapping in the fence +* reg, so dont bother to check the size */ +if (INTEL_INFO (dev)->gen >=7 ) {
I've thought that his does not apply to vlv? Or has that now changed? -Daniel
Quoted 25 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-0+if (stride /128 >GEN7_FENCE_MAX_PITCH_VAL ) +return false; + }else if (INTEL_INFO (dev)->gen >=4 ) {if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; }else {drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -424,6 +424,7 @@#define FENCE_REG_SANDYBRIDGE_0 0x100000#define SANDYBRIDGE_FENCE_PITCH_SHIFT 32 +#define GEN7_FENCE_MAX_PITCH_VAL 0x0800/* control register for cpu gtt access */ #define TILECTL 0x101000Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Re: [PATCH 2/2] drm/i915: Increase max fence pitch limit to 256KB on IVB+
Quoted 21 lines · Daniel Vetter
Quoted 20 lines · On Tue, Apr 09, 2013 at 11:45:05AM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
BSpec contains several scattered notes which state that the maximum fence stride was increased to 256KB on IVB.
Testing on real hardware agrees.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_gem_tiling.c | 9 ++++++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_gem_tiling.c +0
-0@@ -217,9 +217,12 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) tile_width =512 ;
Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_tiling.c i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) · line 222
Quoted 7 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-3/* check maximum stride & object size */ -if (INTEL_INFO (dev)->gen >=4 ) { -/* i965 stores the end address of the gtt mapping in the fence -* reg, so dont bother to check the size */ +/* i965+ stores the end address of the gtt mapping in the fence +* reg, so dont bother to check the size */ +if (INTEL_INFO (dev)->gen >=7 ) {I've thought that his does not apply to vlv? Or has that now changed?
The docs are telling me that VLV also has 256KB max stride.
Quoted 32 lines
-Daniel
Quoted 25 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-0+if (stride /128 >GEN7_FENCE_MAX_PITCH_VAL ) +return false; + }else if (INTEL_INFO (dev)->gen >=4 ) {if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; }else {drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -424,6 +424,7 @@#define FENCE_REG_SANDYBRIDGE_0 0x100000#define SANDYBRIDGE_FENCE_PITCH_SHIFT 32 +#define GEN7_FENCE_MAX_PITCH_VAL 0x0800/* control register for cpu gtt access */ #define TILECTL 0x101000Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 2 lines
Ville Syrjälä Intel OTC
Daniel Vetter
AppliedRe: [PATCH 2/2] drm/i915: Increase max fence pitch limit to 256KB on IVB+
Quoted 32 lines · Ville Syrjälä
Quoted 21 lines · Daniel Vetter
Quoted 20 lines · On Tue, Apr 09, 2013 at 11:45:05AM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
BSpec contains several scattered notes which state that the maximum fence stride was increased to 256KB on IVB.
Testing on real hardware agrees.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_gem_tiling.c | 9 ++++++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_gem_tiling.c +0
-0@@ -217,9 +217,12 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) tile_width =512 ;Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_tiling.c i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) · line 222
Quoted 7 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-3/* check maximum stride & object size */ -if (INTEL_INFO (dev)->gen >=4 ) { -/* i965 stores the end address of the gtt mapping in the fence -* reg, so dont bother to check the size */ +/* i965+ stores the end address of the gtt mapping in the fence +* reg, so dont bother to check the size */ +if (INTEL_INFO (dev)->gen >=7 ) {I've thought that his does not apply to vlv? Or has that now changed?
Quoted 1 line
The docs are telling me that VLV also has 256KB max stride.
Queued for -next, thanks for the patch.
-Daniel
Quoted 37 lines
Quoted 33 lines
-Daniel
Quoted 25 lines
drivers/gpu/drm/i915/i915_gem_tiling.c +3
-0+if (stride /128 >GEN7_FENCE_MAX_PITCH_VAL ) +return false; + }else if (INTEL_INFO (dev)->gen >=4 ) {if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; }else {drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -424,6 +424,7 @@#define FENCE_REG_SANDYBRIDGE_0 0x100000#define SANDYBRIDGE_FENCE_PITCH_SHIFT 32 +#define GEN7_FENCE_MAX_PITCH_VAL 0x0800/* control register for cpu gtt access */ #define TILECTL 0x101000Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.chSignature · 2 lines
Ville Syrjälä Intel OTC
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
PATCH v2 1/1 drm/i915: IVB/HSW have 32 fence register
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Increase the number of fence registers to 32 on IVB/HSW. VLV however only has 16 fence registers according to the docs.
Increasing the number of fences was attempted before [1], but there was some uncertainty about the maximum CPU fence number for FBC. Since then BSpec has been updated to state that there are in fact 32 fence registers, and the CPU fence number field in the SNB_DPFC_CTL_SA register is 5 bits, and the CPU fence number field in the ILK_DPFC_CONTROL register must be zero. So now it all makes sense.
[1] http://lists.freedesktop.org/archives/intel-gfx/2011-October/012865.html
v2: Include some background information based on the previous attempt
--- drivers/gpu/drm/i915/i915_drv.h | 6 +++--- drivers/gpu/drm/i915/i915_gem.c | 4 +++- drivers/gpu/drm/i915/i915_irq.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -3
@@ -195,9 +195,9 @@ struct drm_i915_master_private {struct _drm_i915_sarea *sarea_priv; };#define I915_FENCE_REG_NONE -1 -#define I915_MAX_NUM_FENCES 16 -/* 16 fences + sign bit for FENCE_REG_NONE */ -#define I915_MAX_NUM_FENCE_BITS 5 +#define I915_MAX_NUM_FENCES 32 +/* 32 fences + sign bit for FENCE_REG_NONE */ +#define I915_MAX_NUM_FENCE_BITS 6struct drm_i915_fence_reg {struct list_head lru_list;
drivers/gpu/drm/i915/i915_gem.c +3 -1
@@ -4184,7 +4184,9 @@ i915_gem_load(struct drm_device *dev)if (!drm_core_check_feature (dev,DRIVER_MODESET )) dev_priv->fence_reg_start =3 ; -if (INTEL_INFO (dev)->gen >=4 ||IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) +if (INTEL_INFO (dev)->gen >=7 && !IS_VALLEYVIEW (dev)) + dev_priv->num_fence_regs =32 ; +else if (INTEL_INFO (dev)->gen >=4 ||IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) dev_priv->num_fence_regs =16 ;else dev_priv->num_fence_regs =8 ;
drivers/gpu/drm/i915/i915_irq.c +1 -1
@@ -1217,7 +1217,7 @@ static void i915_gem_record_fences(struct drm_device *dev,switch (INTEL_INFO (dev)->gen) {case 7 :case 6 : -for (i =0 ; i <16 ; i++) +for (i =0 ; i < dev_priv->num_fence_regs; i++) error->fence[i] =I915_READ64 (FENCE_REG_SANDYBRIDGE_0 + (i *8 ));break ;case 5 :
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedQuoted 12 lines · On Tue, Apr 09, 2013 at 01:02:47PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Increase the number of fence registers to 32 on IVB/HSW. VLV however only has 16 fence registers according to the docs.
Increasing the number of fences was attempted before [1], but there was some uncertainty about the maximum CPU fence number for FBC. Since then BSpec has been updated to state that there are in fact 32 fence registers, and the CPU fence number field in the
SNB_DPFC_CTL_SAregister is 5 bits, and the CPU fence number field in theILK_DPFC_CONTROLregister must be zero. So now it all makes sense.
Quoted 5 lines
[1] http://lists.freedesktop.org/archives/intel-gfx/2011-October/012865.html
v2: Include some background information based on the previous attempt
Signed-off-by Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch