drm/i915/bxt: fix RC6 residency time calculation
Subsystems (2)
PATCH 1/1 drm/i915/bxt: fix RC6 residency time calculation
The RC6 residency time unit is 833.33ns on BXT according to the specification, so update the calculation accordingly. Use the same way as CHV/VLV to divide by the corresponding frequency, as I think this is the more natural unit for what the HW does internally.
Testcase: igt/pm_rc6_residency
--- drivers/gpu/drm/i915/i915_sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +3 -0
@@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)if (I915_READ (VLV_COUNTER_CONTROL ) &VLV_COUNT_RANGE_HIGH ) units <<=8 ; + }else { + units =1 ; + div =1200 ;/* 833.33ns */ } raw_time =I915_READ (reg) * units;
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · Imre Deak
The RC6 residency time unit is 833.33ns on BXT according to the specification, so update the calculation accordingly. Use the same way as CHV/VLV to divide by the corresponding frequency, as I think this is the more natural unit for what the HW does internally.
Testcase: igt/pm_rc6_residency
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/i915_sysfs.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/i915_sysfs.c +0
-0
drivers/gpu/drm/i915/i915_sysfs.c static u32 calc_residency(struct drm_device *dev, const u32 reg) · line 57
Quoted 4 lines
drivers/gpu/drm/i915/i915_sysfs.c +1
-0@@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)if (I915_READ (VLV_COUNTER_CONTROL ) &VLV_COUNT_RANGE_HIGH ) units <<=8 ; + }else {
missing IS_BROXTON()
drivers/gpu/drm/i915/i915_sysfs.c static u32 calc_residency(struct drm_device *dev, const u32 reg) · line 59
Quoted 2 lines
drivers/gpu/drm/i915/i915_sysfs.c +2
-0+ units =1 ; + div =1200 ;/* 833.33ns */
Yeah, so based on Bspec "Timestamp bases" section, this is in fact 16 19.2MHz clocks.
With the bxt check added this is
Quoted 10 lines
drivers/gpu/drm/i915/i915_sysfs.c +0
-0} raw_time =I915_READ (reg) * units;Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915/bxt: fix RC6 residency time calculation
In reply to Imre DeakThe RC6 residency time unit is 833.33ns on BXT according to the specification, so update the calculation accordingly. Use the same way as CHV/VLV to divide by the corresponding frequency, as I think this is the more natural unit for what the HW does internally.
v2:
- add missing IS_BROXTON check (Ville)
Testcase: igt/pm_rc6_residency
--- drivers/gpu/drm/i915/i915_sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +3 -0
@@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)if (I915_READ (VLV_COUNTER_CONTROL ) &VLV_COUNT_RANGE_HIGH ) units <<=8 ; + }else if (IS_BROXTON (dev)) { + units =1 ; + div =1200 ;/* 833.33ns */ } raw_time =I915_READ (reg) * units;
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Imre Deak
The RC6 residency time unit is 833.33ns on BXT according to the specification, so update the calculation accordingly. Use the same way as CHV/VLV to divide by the corresponding frequency, as I think this is the more natural unit for what the HW does internally.
v2:
- add missingIS_BROXTONcheck (Ville)Testcase: igt/pm_rc6_residency
Signed-off-by Imre Deak <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/i915/i915_sysfs.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/i915_sysfs.c +3
-0@@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)if (I915_READ (VLV_COUNTER_CONTROL ) &VLV_COUNT_RANGE_HIGH ) units <<=8 ; + }else if (IS_BROXTON (dev)) { + units =1 ; + div =1200 ;/* 833.33ns */ } raw_time =I915_READ (reg) * units;Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedQuoted 6 lines · Ville Syrjälä
Quoted 5 lines · Imre Deak
The RC6 residency time unit is 833.33ns on BXT according to the specification, so update the calculation accordingly. Use the same way as CHV/VLV to divide by the corresponding frequency, as I think this is the more natural unit for what the HW does internally.
Quoted 7 lines
Quoted 5 lines
v2:
- add missingIS_BROXTONcheck (Ville)Testcase: igt/pm_rc6_residency
Signed-off-by Imre Deak <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 29 lines
Quoted 21 lines
--- drivers/gpu/drm/i915/i915_sysfs.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/i915_sysfs.c +3
-0@@ -54,6 +54,9 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)if (I915_READ (VLV_COUNTER_CONTROL ) &VLV_COUNT_RANGE_HIGH ) units <<=8 ; + }else if (IS_BROXTON (dev)) { + units =1 ; + div =1200 ;/* 833.33ns */ } raw_time =I915_READ (reg) * units;Signature · 1 line
2.1.4Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx