Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] drm/i915: Pass the region ID rather than a bitmask to HAS_REGION()
Date: Thu, 2 May 2024 08:54:11 -0400	[thread overview]
Message-ID: <ZjOM8xgskaxCRrf0@intel.com> (raw)
In-Reply-To: <20240502121423.1002-2-ville.syrjala@linux.intel.com>

On Thu, May 02, 2024 at 03:14:22PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The name 'HAS_REGION()' suggests we are checking for a single
> region, so seem more sensible to pass in the region ID rather
> than a bitmask.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_gt.c         | 2 +-
>  drivers/gpu/drm/i915/i915_drv.h            | 4 ++--
>  drivers/gpu/drm/i915/intel_memory_region.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 5a7ecf823ae6..626b166e67ef 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -105,7 +105,7 @@ static int intel_gt_probe_lmem(struct intel_gt *gt)
>  
>  	intel_memory_region_set_name(mem, "local%u", mem->instance);
>  
> -	GEM_BUG_ON(!HAS_REGION(i915, BIT(id)));
> +	GEM_BUG_ON(!HAS_REGION(i915, id));
>  	GEM_BUG_ON(i915->mm.regions[id]);
>  	i915->mm.regions[id] = mem;
>  
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index ee0d7d5f135d..5cae1fe42c2a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -715,8 +715,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
>   */
>  #define HAS_64K_PAGES(i915) (INTEL_INFO(i915)->has_64k_pages)
>  
> -#define HAS_REGION(i915, i) (INTEL_INFO(i915)->memory_regions & (i))
> -#define HAS_LMEM(i915) HAS_REGION(i915, REGION_LMEM)
> +#define HAS_REGION(i915, id) (INTEL_INFO(i915)->memory_regions & BIT(id))
> +#define HAS_LMEM(i915) HAS_REGION(i915, INTEL_REGION_LMEM_0)
>  
>  #define HAS_EXTRA_GT_LIST(i915)   (INTEL_INFO(i915)->extra_gt_list)
>  
> diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c
> index 52d998e5c21a..172dfa7c3588 100644
> --- a/drivers/gpu/drm/i915/intel_memory_region.c
> +++ b/drivers/gpu/drm/i915/intel_memory_region.c
> @@ -332,7 +332,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
>  		struct intel_memory_region *mem = ERR_PTR(-ENODEV);
>  		u16 type, instance;
>  
> -		if (!HAS_REGION(i915, BIT(i)))
> +		if (!HAS_REGION(i915, i))
>  			continue;
>  
>  		type = intel_region_map[i].class;
> -- 
> 2.43.2
> 

  reply	other threads:[~2024-05-02 12:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 12:14 [PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem() Ville Syrjala
2024-05-02 12:14 ` [PATCH 2/3] drm/i915: Pass the region ID rather than a bitmask to HAS_REGION() Ville Syrjala
2024-05-02 12:54   ` Rodrigo Vivi [this message]
2024-05-02 12:14 ` [PATCH 3/3] drm/i915: Remove counter productive REGION_* wrappers Ville Syrjala
2024-05-02 12:54   ` Rodrigo Vivi
2024-05-02 12:52 ` [PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem() Rodrigo Vivi
2024-05-02 12:59 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2024-05-02 12:59 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-05-02 13:06 ` ✓ Fi.CI.BAT: success " Patchwork
2024-05-03  0:11 ` ✗ Fi.CI.IGT: failure " Patchwork

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=ZjOM8xgskaxCRrf0@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox