All the mail mirrored from 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 3/3] drm/i915: Remove counter productive REGION_* wrappers
Date: Thu, 2 May 2024 08:54:22 -0400	[thread overview]
Message-ID: <ZjOM_qrzgWv_GqHQ@intel.com> (raw)
In-Reply-To: <20240502121423.1002-3-ville.syrjala@linux.intel.com>

On Thu, May 02, 2024 at 03:14:23PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> This extra macro level between the region IDs and their bitmasks
> just makes it harder to see what is used where. Get rid of the
> wrappers.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/i915/i915_pci.c                  | 6 +++---
>  drivers/gpu/drm/i915/intel_memory_region.h       | 5 -----
>  drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +-
>  3 files changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 405ca17a990b..b5a056c9cb79 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -76,7 +76,7 @@ __diag_ignore_all("-Woverride-init", "Allow field initialization overrides for d
>  	.__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K
>  
>  #define GEN_DEFAULT_REGIONS \
> -	.memory_regions = REGION_SMEM | REGION_STOLEN_SMEM
> +	.memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_STOLEN_SMEM)
>  
>  #define I830_FEATURES \
>  	GEN(2), \
> @@ -655,7 +655,7 @@ static const struct intel_device_info rkl_info = {
>  };
>  
>  #define DGFX_FEATURES \
> -	.memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \
> +	.memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_LMEM_0) | BIT(INTEL_REGION_STOLEN_LMEM), \
>  	.has_llc = 0, \
>  	.has_pxp = 0, \
>  	.has_snoop = 1, \
> @@ -781,7 +781,7 @@ static const struct intel_device_info mtl_info = {
>  	.has_snoop = 1,
>  	.max_pat_index = 4,
>  	.has_pxp = 1,
> -	.memory_regions = REGION_SMEM | REGION_STOLEN_LMEM,
> +	.memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_STOLEN_LMEM),
>  	.platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(CCS0),
>  	MTL_CACHELEVEL,
>  };
> diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
> index 8c927e303c4a..5973b6fe13cf 100644
> --- a/drivers/gpu/drm/i915/intel_memory_region.h
> +++ b/drivers/gpu/drm/i915/intel_memory_region.h
> @@ -38,11 +38,6 @@ enum intel_region_id {
>  	INTEL_REGION_UNKNOWN, /* Should be last */
>  };
>  
> -#define REGION_SMEM     BIT(INTEL_REGION_SMEM)
> -#define REGION_LMEM     BIT(INTEL_REGION_LMEM_0)
> -#define REGION_STOLEN_SMEM   BIT(INTEL_REGION_STOLEN_SMEM)
> -#define REGION_STOLEN_LMEM   BIT(INTEL_REGION_STOLEN_LMEM)
> -
>  #define I915_ALLOC_CONTIGUOUS     BIT(0)
>  
>  #define for_each_memory_region(mr, i915, id) \
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index af349fd9abc2..0bd29846873b 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -122,7 +122,7 @@ static const struct intel_device_info mock_info = {
>  	.__runtime.page_sizes = (I915_GTT_PAGE_SIZE_4K |
>  				 I915_GTT_PAGE_SIZE_64K |
>  				 I915_GTT_PAGE_SIZE_2M),
> -	.memory_regions = REGION_SMEM,
> +	.memory_regions = BIT(INTEL_REGION_SMEM),
>  	.platform_engine_mask = BIT(0),
>  
>  	/* simply use legacy cache level for mock device */
> -- 
> 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
2024-05-02 12:14 ` [PATCH 3/3] drm/i915: Remove counter productive REGION_* wrappers Ville Syrjala
2024-05-02 12:54   ` Rodrigo Vivi [this message]
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=ZjOM_qrzgWv_GqHQ@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 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.