Skip to content

Commit 2847814

Browse files
jcescamirodrigovivi
authored andcommitted
drm/i915/gt: Use rc6.supported flag from intel_gt for rc6_enable sysfs
Currently if rc6 is supported, it gets enabled and the sysfs files for rc6_enable_show and rc6_enable_dev_show uses masks to check information from drm_i915_private. However rc6_support functions take more variables and conditions into consideration and thus these masks are not enough for most of the modern hardware and it is simpley lyting to the user. Let's fix it by at least use the rc6.supported flag from intel_gt information. Signed-off-by: Juan Escamilla <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0e00a88 commit 2847814

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,27 +176,13 @@ static u32 get_residency(struct intel_gt *gt, enum intel_rc6_res_type id)
176176
return DIV_ROUND_CLOSEST_ULL(res, 1000);
177177
}
178178

179-
static u8 get_rc6_mask(struct intel_gt *gt)
180-
{
181-
u8 mask = 0;
182-
183-
if (HAS_RC6(gt->i915))
184-
mask |= BIT(0);
185-
if (HAS_RC6p(gt->i915))
186-
mask |= BIT(1);
187-
if (HAS_RC6pp(gt->i915))
188-
mask |= BIT(2);
189-
190-
return mask;
191-
}
192-
193179
static ssize_t rc6_enable_show(struct kobject *kobj,
194180
struct kobj_attribute *attr,
195181
char *buff)
196182
{
197183
struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
198184

199-
return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
185+
return sysfs_emit(buff, "%x\n", gt->rc6.supported);
200186
}
201187

202188
static ssize_t rc6_enable_dev_show(struct device *dev,
@@ -205,7 +191,7 @@ static ssize_t rc6_enable_dev_show(struct device *dev,
205191
{
206192
struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name);
207193

208-
return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
194+
return sysfs_emit(buff, "%x\n", gt->rc6.supported);
209195
}
210196

211197
static u32 __rc6_residency_ms_show(struct intel_gt *gt)

0 commit comments

Comments
 (0)