All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Juan Escamilla <jcescami@wasd.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/gt: Use rc6.supported flag from intel_gt for rc6_enable sysfs
Date: Wed, 10 Jan 2024 15:11:11 -0500	[thread overview]
Message-ID: <ZZ753xDs2F_NrYPJ@intel.com> (raw)
In-Reply-To: <20240110010302.553597-1-jcescami@wasd.net>


On Tue, Jan 09, 2024 at 05:03:00PM -0800, Juan Escamilla wrote:
> 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 <jcescami@wasd.net>


Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
and pushing this right now, thanks for your patch

> ---
>  drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> index f0dea54880af..2d3c4dab6d21 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> @@ -176,27 +176,13 @@ static u32 get_residency(struct intel_gt *gt, enum intel_rc6_res_type id)
>  	return DIV_ROUND_CLOSEST_ULL(res, 1000);
>  }
>  
> -static u8 get_rc6_mask(struct intel_gt *gt)
> -{
> -	u8 mask = 0;
> -
> -	if (HAS_RC6(gt->i915))
> -		mask |= BIT(0);
> -	if (HAS_RC6p(gt->i915))
> -		mask |= BIT(1);
> -	if (HAS_RC6pp(gt->i915))
> -		mask |= BIT(2);
> -
> -	return mask;
> -}
> -
>  static ssize_t rc6_enable_show(struct kobject *kobj,
>  			       struct kobj_attribute *attr,
>  			       char *buff)
>  {
>  	struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
>  
> -	return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
> +	return sysfs_emit(buff, "%x\n", gt->rc6.supported);
>  }
>  
>  static ssize_t rc6_enable_dev_show(struct device *dev,
> @@ -205,7 +191,7 @@ static ssize_t rc6_enable_dev_show(struct device *dev,
>  {
>  	struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name);
>  
> -	return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
> +	return sysfs_emit(buff, "%x\n", gt->rc6.supported);
>  }
>  
>  static u32 __rc6_residency_ms_show(struct intel_gt *gt)
> -- 
> 2.43.0
> 

  parent reply	other threads:[~2024-01-10 20:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  1:03 [PATCH] drm/i915/gt: Use rc6.supported flag from intel_gt for rc6_enable sysfs Juan Escamilla
2024-01-10  1:36 ` ✓ Fi.CI.BAT: success for drm/i915/gt: Use rc6.supported flag from intel_gt for rc6_enable sysfs (rev2) Patchwork
2024-01-10  8:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-10 20:11 ` Rodrigo Vivi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-09  1:30 [PATCH] drm/i915/gt: Use rc6.supported flag from intel_gt for rc6_enable sysfs Juan Escamilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZZ753xDs2F_NrYPJ@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jcescami@wasd.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.