dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/i915: Nuke GEN macros
@ 2021-07-07 18:13 Lucas De Marchi
  2021-07-07 18:13 ` [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion Lucas De Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Lucas De Marchi @ 2021-07-07 18:13 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter

Finish the conversion to the new VER macros and nuke the old macros so
we don't have more changes sneaking in.

Initially I thought about waiting for a backmerge from drm-next in
drm-intel-next so I could use a topic branch to finish the conversion
and nuke the macro, merging the topic branch in both drm-intel-next and
drm-intel-gt-next. After the backmerge landed, I realized that would not
be possible anymore as we already have changes on top preventing the
merge-base to be used for a topic branch.

Therefore the plan is:
	- Apply patch 1 in drm-intel-gt-next
	- Apply patches 2 and 3 in drm-intel-next

Since patches are tested on drm-tip, CI should flag a build breakage if
someone uses the GEN macros. Another possibility is to simply apply the
3rd patch on both branches, but I don't see a real need for that.

Lucas De Marchi (3):
  drm/i915/gt: finish INTEL_GEN and friends conversion
  drm/i915: finish INTEL_GEN and friends conversion
  gpu/drm/i915: nuke old GEN macros

 .../drm/i915/display/intel_display_debugfs.c  |  3 ++-
 drivers/gpu/drm/i915/gt/intel_migrate.c       | 20 +++++++++----------
 drivers/gpu/drm/i915/i915_debugfs.c           |  2 +-
 drivers/gpu/drm/i915/i915_drv.h               | 15 --------------
 drivers/gpu/drm/i915/intel_uncore.c           |  2 +-
 5 files changed, 14 insertions(+), 28 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion
  2021-07-07 18:13 [PATCH 0/3] drm/i915: Nuke GEN macros Lucas De Marchi
@ 2021-07-07 18:13 ` Lucas De Marchi
  2021-07-07 19:36   ` Matt Roper
  2021-07-07 18:13 ` [PATCH 2/3] drm/i915: " Lucas De Marchi
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Lucas De Marchi @ 2021-07-07 18:13 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter

Commit c816723b6b8a ("drm/i915/gt: replace IS_GEN and friends with
GRAPHICS_VER") converted INTEL_GEN and friends to the new version check
macros.  Meanwhile, some changes sneaked in to use INTEL_GEN. Remove the
last users so we can remove the macros.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_migrate.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
index 23c59ce66cee..14afa1974ea5 100644
--- a/drivers/gpu/drm/i915/gt/intel_migrate.c
+++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
@@ -277,7 +277,7 @@ static int emit_pte(struct i915_request *rq,
 	u32 *hdr, *cs;
 	int pkt;
 
-	GEM_BUG_ON(INTEL_GEN(rq->engine->i915) < 8);
+	GEM_BUG_ON(GRAPHICS_VER(rq->engine->i915) < 8);
 
 	/* Compute the page directory offset for the target address range */
 	offset += (u64)rq->engine->instance << 32;
@@ -347,11 +347,11 @@ static int emit_pte(struct i915_request *rq,
 	return total;
 }
 
-static bool wa_1209644611_applies(int gen, u32 size)
+static bool wa_1209644611_applies(int ver, u32 size)
 {
 	u32 height = size >> PAGE_SHIFT;
 
-	if (gen != 11)
+	if (ver != 11)
 		return false;
 
 	return height % 4 == 3 && height <= 8;
@@ -359,15 +359,15 @@ static bool wa_1209644611_applies(int gen, u32 size)
 
 static int emit_copy(struct i915_request *rq, int size)
 {
-	const int gen = INTEL_GEN(rq->engine->i915);
+	const int ver = GRAPHICS_VER(rq->engine->i915);
 	u32 instance = rq->engine->instance;
 	u32 *cs;
 
-	cs = intel_ring_begin(rq, gen >= 8 ? 10 : 6);
+	cs = intel_ring_begin(rq, ver >= 8 ? 10 : 6);
 	if (IS_ERR(cs))
 		return PTR_ERR(cs);
 
-	if (gen >= 9 && !wa_1209644611_applies(gen, size)) {
+	if (ver >= 9 && !wa_1209644611_applies(ver, size)) {
 		*cs++ = GEN9_XY_FAST_COPY_BLT_CMD | (10 - 2);
 		*cs++ = BLT_DEPTH_32 | PAGE_SIZE;
 		*cs++ = 0;
@@ -378,7 +378,7 @@ static int emit_copy(struct i915_request *rq, int size)
 		*cs++ = PAGE_SIZE;
 		*cs++ = 0; /* src offset */
 		*cs++ = instance;
-	} else if (gen >= 8) {
+	} else if (ver >= 8) {
 		*cs++ = XY_SRC_COPY_BLT_CMD | BLT_WRITE_RGBA | (10 - 2);
 		*cs++ = BLT_DEPTH_32 | BLT_ROP_SRC_COPY | PAGE_SIZE;
 		*cs++ = 0;
@@ -491,17 +491,17 @@ intel_context_migrate_copy(struct intel_context *ce,
 
 static int emit_clear(struct i915_request *rq, int size, u32 value)
 {
-	const int gen = INTEL_GEN(rq->engine->i915);
+	const int ver = GRAPHICS_VER(rq->engine->i915);
 	u32 instance = rq->engine->instance;
 	u32 *cs;
 
 	GEM_BUG_ON(size >> PAGE_SHIFT > S16_MAX);
 
-	cs = intel_ring_begin(rq, gen >= 8 ? 8 : 6);
+	cs = intel_ring_begin(rq, ver >= 8 ? 8 : 6);
 	if (IS_ERR(cs))
 		return PTR_ERR(cs);
 
-	if (gen >= 8) {
+	if (ver >= 8) {
 		*cs++ = XY_COLOR_BLT_CMD | BLT_WRITE_RGBA | (7 - 2);
 		*cs++ = BLT_DEPTH_32 | BLT_ROP_COLOR_COPY | PAGE_SIZE;
 		*cs++ = 0;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] drm/i915: finish INTEL_GEN and friends conversion
  2021-07-07 18:13 [PATCH 0/3] drm/i915: Nuke GEN macros Lucas De Marchi
  2021-07-07 18:13 ` [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion Lucas De Marchi
@ 2021-07-07 18:13 ` Lucas De Marchi
  2021-07-07 19:39   ` Matt Roper
  2021-07-07 18:13 ` [PATCH 3/3] gpu/drm/i915: nuke old GEN macros Lucas De Marchi
  2021-07-07 18:27 ` [PATCH 0/3] drm/i915: Nuke " Jani Nikula
  3 siblings, 1 reply; 9+ messages in thread
From: Lucas De Marchi @ 2021-07-07 18:13 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter

Commit 161058fb899e ("drm/i915: Add remaining conversions to GRAPHICS_VER")
did the last conversions to the new macros for version checks, but some
some changes sneaked in to use INTEL_GEN. Remove the last users so
we can remove the macros.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_debugfs.c | 3 ++-
 drivers/gpu/drm/i915/i915_debugfs.c                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore.c                  | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index af9e58619667..d5af5708c9da 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -544,7 +544,8 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
 
 	seq_printf(m, "fw loaded: %s\n", yesno(intel_dmc_has_payload(dev_priv)));
 	seq_printf(m, "path: %s\n", dmc->fw_path);
-	seq_printf(m, "Pipe A fw support: %s\n", yesno(INTEL_GEN(dev_priv) >= 12));
+	seq_printf(m, "Pipe A fw support: %s\n",
+		   yesno(GRAPHICS_VER(dev_priv) >= 12));
 	seq_printf(m, "Pipe A fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEA].payload));
 	seq_printf(m, "Pipe B fw support: %s\n", yesno(IS_ALDERLAKE_P(dev_priv)));
 	seq_printf(m, "Pipe B fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEB].payload));
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index cc745751ac53..0529576f069c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -636,7 +636,7 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
 			   intel_uncore_read16(uncore, C0DRB3_BW));
 		seq_printf(m, "C1DRB3 = 0x%04x\n",
 			   intel_uncore_read16(uncore, C1DRB3_BW));
-	} else if (INTEL_GEN(dev_priv) >= 6) {
+	} else if (GRAPHICS_VER(dev_priv) >= 6) {
 		seq_printf(m, "MAD_DIMM_C0 = 0x%08x\n",
 			   intel_uncore_read(uncore, MAD_DIMM_C0));
 		seq_printf(m, "MAD_DIMM_C1 = 0x%08x\n",
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index d067524f9162..ee1c6fbc3d97 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1929,7 +1929,7 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
 		return -ENODEV;
 	}
 
-	if (INTEL_GEN(i915) > 5 && !intel_vgpu_active(i915))
+	if (GRAPHICS_VER(i915) > 5 && !intel_vgpu_active(i915))
 		uncore->flags |= UNCORE_HAS_FORCEWAKE;
 
 	if (!intel_uncore_has_forcewake(uncore)) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] gpu/drm/i915: nuke old GEN macros
  2021-07-07 18:13 [PATCH 0/3] drm/i915: Nuke GEN macros Lucas De Marchi
  2021-07-07 18:13 ` [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion Lucas De Marchi
  2021-07-07 18:13 ` [PATCH 2/3] drm/i915: " Lucas De Marchi
@ 2021-07-07 18:13 ` Lucas De Marchi
  2021-07-07 19:41   ` Matt Roper
  2021-07-07 18:27 ` [PATCH 0/3] drm/i915: Nuke " Jani Nikula
  3 siblings, 1 reply; 9+ messages in thread
From: Lucas De Marchi @ 2021-07-07 18:13 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter

Now that all the codebase is converted to the new *VER macros, remove
the old GEN ones.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6dff4ca01241..bc6799f75670 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1243,21 +1243,6 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
 
 #define INTEL_DEVID(dev_priv)	(RUNTIME_INFO(dev_priv)->device_id)
 
-/*
- * Deprecated: this will be replaced by individual IP checks:
- * GRAPHICS_VER(), MEDIA_VER() and DISPLAY_VER()
- */
-#define INTEL_GEN(dev_priv)		GRAPHICS_VER(dev_priv)
-/*
- * Deprecated: use IS_GRAPHICS_VER(), IS_MEDIA_VER() and IS_DISPLAY_VER() as
- * appropriate.
- */
-#define IS_GEN_RANGE(dev_priv, s, e)	IS_GRAPHICS_VER(dev_priv, (s), (e))
-/*
- * Deprecated: use GRAPHICS_VER(), MEDIA_VER() and DISPLAY_VER() as appropriate.
- */
-#define IS_GEN(dev_priv, n)		(GRAPHICS_VER(dev_priv) == (n))
-
 #define GRAPHICS_VER(i915)		(INTEL_INFO(i915)->graphics_ver)
 #define IS_GRAPHICS_VER(i915, from, until) \
 	(GRAPHICS_VER(i915) >= (from) && GRAPHICS_VER(i915) <= (until))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] drm/i915: Nuke GEN macros
  2021-07-07 18:13 [PATCH 0/3] drm/i915: Nuke GEN macros Lucas De Marchi
                   ` (2 preceding siblings ...)
  2021-07-07 18:13 ` [PATCH 3/3] gpu/drm/i915: nuke old GEN macros Lucas De Marchi
@ 2021-07-07 18:27 ` Jani Nikula
  3 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2021-07-07 18:27 UTC (permalink / raw)
  To: Lucas De Marchi, intel-gfx, dri-devel; +Cc: Daniel Vetter

On Wed, 07 Jul 2021, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> Finish the conversion to the new VER macros and nuke the old macros so
> we don't have more changes sneaking in.
>
> Initially I thought about waiting for a backmerge from drm-next in
> drm-intel-next so I could use a topic branch to finish the conversion
> and nuke the macro, merging the topic branch in both drm-intel-next and
> drm-intel-gt-next. After the backmerge landed, I realized that would not
> be possible anymore as we already have changes on top preventing the
> merge-base to be used for a topic branch.
>
> Therefore the plan is:
> 	- Apply patch 1 in drm-intel-gt-next
> 	- Apply patches 2 and 3 in drm-intel-next
>
> Since patches are tested on drm-tip, CI should flag a build breakage if
> someone uses the GEN macros. Another possibility is to simply apply the
> 3rd patch on both branches, but I don't see a real need for that.

Acked-by: Jani Nikula <jani.nikula@intel.com>


>
> Lucas De Marchi (3):
>   drm/i915/gt: finish INTEL_GEN and friends conversion
>   drm/i915: finish INTEL_GEN and friends conversion
>   gpu/drm/i915: nuke old GEN macros
>
>  .../drm/i915/display/intel_display_debugfs.c  |  3 ++-
>  drivers/gpu/drm/i915/gt/intel_migrate.c       | 20 +++++++++----------
>  drivers/gpu/drm/i915/i915_debugfs.c           |  2 +-
>  drivers/gpu/drm/i915/i915_drv.h               | 15 --------------
>  drivers/gpu/drm/i915/intel_uncore.c           |  2 +-
>  5 files changed, 14 insertions(+), 28 deletions(-)

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion
  2021-07-07 18:13 ` [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion Lucas De Marchi
@ 2021-07-07 19:36   ` Matt Roper
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Roper @ 2021-07-07 19:36 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Wed, Jul 07, 2021 at 11:13:23AM -0700, Lucas De Marchi wrote:
> Commit c816723b6b8a ("drm/i915/gt: replace IS_GEN and friends with
> GRAPHICS_VER") converted INTEL_GEN and friends to the new version check
> macros.  Meanwhile, some changes sneaked in to use INTEL_GEN. Remove the
> last users so we can remove the macros.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_migrate.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
> index 23c59ce66cee..14afa1974ea5 100644
> --- a/drivers/gpu/drm/i915/gt/intel_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
> @@ -277,7 +277,7 @@ static int emit_pte(struct i915_request *rq,
>  	u32 *hdr, *cs;
>  	int pkt;
>  
> -	GEM_BUG_ON(INTEL_GEN(rq->engine->i915) < 8);
> +	GEM_BUG_ON(GRAPHICS_VER(rq->engine->i915) < 8);
>  
>  	/* Compute the page directory offset for the target address range */
>  	offset += (u64)rq->engine->instance << 32;
> @@ -347,11 +347,11 @@ static int emit_pte(struct i915_request *rq,
>  	return total;
>  }
>  
> -static bool wa_1209644611_applies(int gen, u32 size)
> +static bool wa_1209644611_applies(int ver, u32 size)
>  {
>  	u32 height = size >> PAGE_SHIFT;
>  
> -	if (gen != 11)
> +	if (ver != 11)
>  		return false;
>  
>  	return height % 4 == 3 && height <= 8;
> @@ -359,15 +359,15 @@ static bool wa_1209644611_applies(int gen, u32 size)
>  
>  static int emit_copy(struct i915_request *rq, int size)
>  {
> -	const int gen = INTEL_GEN(rq->engine->i915);
> +	const int ver = GRAPHICS_VER(rq->engine->i915);
>  	u32 instance = rq->engine->instance;
>  	u32 *cs;
>  
> -	cs = intel_ring_begin(rq, gen >= 8 ? 10 : 6);
> +	cs = intel_ring_begin(rq, ver >= 8 ? 10 : 6);
>  	if (IS_ERR(cs))
>  		return PTR_ERR(cs);
>  
> -	if (gen >= 9 && !wa_1209644611_applies(gen, size)) {
> +	if (ver >= 9 && !wa_1209644611_applies(ver, size)) {
>  		*cs++ = GEN9_XY_FAST_COPY_BLT_CMD | (10 - 2);
>  		*cs++ = BLT_DEPTH_32 | PAGE_SIZE;
>  		*cs++ = 0;
> @@ -378,7 +378,7 @@ static int emit_copy(struct i915_request *rq, int size)
>  		*cs++ = PAGE_SIZE;
>  		*cs++ = 0; /* src offset */
>  		*cs++ = instance;
> -	} else if (gen >= 8) {
> +	} else if (ver >= 8) {
>  		*cs++ = XY_SRC_COPY_BLT_CMD | BLT_WRITE_RGBA | (10 - 2);
>  		*cs++ = BLT_DEPTH_32 | BLT_ROP_SRC_COPY | PAGE_SIZE;
>  		*cs++ = 0;
> @@ -491,17 +491,17 @@ intel_context_migrate_copy(struct intel_context *ce,
>  
>  static int emit_clear(struct i915_request *rq, int size, u32 value)
>  {
> -	const int gen = INTEL_GEN(rq->engine->i915);
> +	const int ver = GRAPHICS_VER(rq->engine->i915);
>  	u32 instance = rq->engine->instance;
>  	u32 *cs;
>  
>  	GEM_BUG_ON(size >> PAGE_SHIFT > S16_MAX);
>  
> -	cs = intel_ring_begin(rq, gen >= 8 ? 8 : 6);
> +	cs = intel_ring_begin(rq, ver >= 8 ? 8 : 6);
>  	if (IS_ERR(cs))
>  		return PTR_ERR(cs);
>  
> -	if (gen >= 8) {
> +	if (ver >= 8) {
>  		*cs++ = XY_COLOR_BLT_CMD | BLT_WRITE_RGBA | (7 - 2);
>  		*cs++ = BLT_DEPTH_32 | BLT_ROP_COLOR_COPY | PAGE_SIZE;
>  		*cs++ = 0;
> -- 
> 2.31.1
> 

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] drm/i915: finish INTEL_GEN and friends conversion
  2021-07-07 18:13 ` [PATCH 2/3] drm/i915: " Lucas De Marchi
@ 2021-07-07 19:39   ` Matt Roper
  2021-07-07 21:44     ` Lucas De Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Matt Roper @ 2021-07-07 19:39 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Wed, Jul 07, 2021 at 11:13:24AM -0700, Lucas De Marchi wrote:
> Commit 161058fb899e ("drm/i915: Add remaining conversions to GRAPHICS_VER")
> did the last conversions to the new macros for version checks, but some
> some changes sneaked in to use INTEL_GEN. Remove the last users so
> we can remove the macros.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

I think the third change here is just one we somehow missed during the
previous conversion rather than a new use, right?

> ---
>  drivers/gpu/drm/i915/display/intel_display_debugfs.c | 3 ++-
>  drivers/gpu/drm/i915/i915_debugfs.c                  | 2 +-
>  drivers/gpu/drm/i915/intel_uncore.c                  | 2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index af9e58619667..d5af5708c9da 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -544,7 +544,8 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
>  
>  	seq_printf(m, "fw loaded: %s\n", yesno(intel_dmc_has_payload(dev_priv)));
>  	seq_printf(m, "path: %s\n", dmc->fw_path);
> -	seq_printf(m, "Pipe A fw support: %s\n", yesno(INTEL_GEN(dev_priv) >= 12));
> +	seq_printf(m, "Pipe A fw support: %s\n",
> +		   yesno(GRAPHICS_VER(dev_priv) >= 12));
>  	seq_printf(m, "Pipe A fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEA].payload));
>  	seq_printf(m, "Pipe B fw support: %s\n", yesno(IS_ALDERLAKE_P(dev_priv)));
>  	seq_printf(m, "Pipe B fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEB].payload));
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index cc745751ac53..0529576f069c 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -636,7 +636,7 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
>  			   intel_uncore_read16(uncore, C0DRB3_BW));
>  		seq_printf(m, "C1DRB3 = 0x%04x\n",
>  			   intel_uncore_read16(uncore, C1DRB3_BW));
> -	} else if (INTEL_GEN(dev_priv) >= 6) {
> +	} else if (GRAPHICS_VER(dev_priv) >= 6) {
>  		seq_printf(m, "MAD_DIMM_C0 = 0x%08x\n",
>  			   intel_uncore_read(uncore, MAD_DIMM_C0));
>  		seq_printf(m, "MAD_DIMM_C1 = 0x%08x\n",
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index d067524f9162..ee1c6fbc3d97 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1929,7 +1929,7 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
>  		return -ENODEV;
>  	}
>  
> -	if (INTEL_GEN(i915) > 5 && !intel_vgpu_active(i915))
> +	if (GRAPHICS_VER(i915) > 5 && !intel_vgpu_active(i915))
>  		uncore->flags |= UNCORE_HAS_FORCEWAKE;
>  
>  	if (!intel_uncore_has_forcewake(uncore)) {
> -- 
> 2.31.1
> 

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] gpu/drm/i915: nuke old GEN macros
  2021-07-07 18:13 ` [PATCH 3/3] gpu/drm/i915: nuke old GEN macros Lucas De Marchi
@ 2021-07-07 19:41   ` Matt Roper
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Roper @ 2021-07-07 19:41 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Wed, Jul 07, 2021 at 11:13:25AM -0700, Lucas De Marchi wrote:
> Now that all the codebase is converted to the new *VER macros, remove
> the old GEN ones.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

We're still going to need another patch or two to kill off
IS_GEN9_{BC,LP}, but we can do that separately.  We're less likely to be
adding new instances of those macros now anyway.

> ---
>  drivers/gpu/drm/i915/i915_drv.h | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 6dff4ca01241..bc6799f75670 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1243,21 +1243,6 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
>  
>  #define INTEL_DEVID(dev_priv)	(RUNTIME_INFO(dev_priv)->device_id)
>  
> -/*
> - * Deprecated: this will be replaced by individual IP checks:
> - * GRAPHICS_VER(), MEDIA_VER() and DISPLAY_VER()
> - */
> -#define INTEL_GEN(dev_priv)		GRAPHICS_VER(dev_priv)
> -/*
> - * Deprecated: use IS_GRAPHICS_VER(), IS_MEDIA_VER() and IS_DISPLAY_VER() as
> - * appropriate.
> - */
> -#define IS_GEN_RANGE(dev_priv, s, e)	IS_GRAPHICS_VER(dev_priv, (s), (e))
> -/*
> - * Deprecated: use GRAPHICS_VER(), MEDIA_VER() and DISPLAY_VER() as appropriate.
> - */
> -#define IS_GEN(dev_priv, n)		(GRAPHICS_VER(dev_priv) == (n))
> -
>  #define GRAPHICS_VER(i915)		(INTEL_INFO(i915)->graphics_ver)
>  #define IS_GRAPHICS_VER(i915, from, until) \
>  	(GRAPHICS_VER(i915) >= (from) && GRAPHICS_VER(i915) <= (until))
> -- 
> 2.31.1
> 

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] drm/i915: finish INTEL_GEN and friends conversion
  2021-07-07 19:39   ` Matt Roper
@ 2021-07-07 21:44     ` Lucas De Marchi
  0 siblings, 0 replies; 9+ messages in thread
From: Lucas De Marchi @ 2021-07-07 21:44 UTC (permalink / raw)
  To: Matt Roper; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Wed, Jul 07, 2021 at 12:39:28PM -0700, Matt Roper wrote:
>On Wed, Jul 07, 2021 at 11:13:24AM -0700, Lucas De Marchi wrote:
>> Commit 161058fb899e ("drm/i915: Add remaining conversions to GRAPHICS_VER")
>> did the last conversions to the new macros for version checks, but some
>> some changes sneaked in to use INTEL_GEN. Remove the last users so
>> we can remove the macros.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
>Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
>
>I think the third change here is just one we somehow missed during the
>previous conversion rather than a new use, right?

yes, looking at git log again, yes. I missed that when doing the
conversion.

thanks
Lucas De Marchi

>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display_debugfs.c | 3 ++-
>>  drivers/gpu/drm/i915/i915_debugfs.c                  | 2 +-
>>  drivers/gpu/drm/i915/intel_uncore.c                  | 2 +-
>>  3 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
>> index af9e58619667..d5af5708c9da 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
>> @@ -544,7 +544,8 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
>>
>>  	seq_printf(m, "fw loaded: %s\n", yesno(intel_dmc_has_payload(dev_priv)));
>>  	seq_printf(m, "path: %s\n", dmc->fw_path);
>> -	seq_printf(m, "Pipe A fw support: %s\n", yesno(INTEL_GEN(dev_priv) >= 12));
>> +	seq_printf(m, "Pipe A fw support: %s\n",
>> +		   yesno(GRAPHICS_VER(dev_priv) >= 12));
>>  	seq_printf(m, "Pipe A fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEA].payload));
>>  	seq_printf(m, "Pipe B fw support: %s\n", yesno(IS_ALDERLAKE_P(dev_priv)));
>>  	seq_printf(m, "Pipe B fw loaded: %s\n", yesno(dmc->dmc_info[DMC_FW_PIPEB].payload));
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
>> index cc745751ac53..0529576f069c 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -636,7 +636,7 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
>>  			   intel_uncore_read16(uncore, C0DRB3_BW));
>>  		seq_printf(m, "C1DRB3 = 0x%04x\n",
>>  			   intel_uncore_read16(uncore, C1DRB3_BW));
>> -	} else if (INTEL_GEN(dev_priv) >= 6) {
>> +	} else if (GRAPHICS_VER(dev_priv) >= 6) {
>>  		seq_printf(m, "MAD_DIMM_C0 = 0x%08x\n",
>>  			   intel_uncore_read(uncore, MAD_DIMM_C0));
>>  		seq_printf(m, "MAD_DIMM_C1 = 0x%08x\n",
>> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
>> index d067524f9162..ee1c6fbc3d97 100644
>> --- a/drivers/gpu/drm/i915/intel_uncore.c
>> +++ b/drivers/gpu/drm/i915/intel_uncore.c
>> @@ -1929,7 +1929,7 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
>>  		return -ENODEV;
>>  	}
>>
>> -	if (INTEL_GEN(i915) > 5 && !intel_vgpu_active(i915))
>> +	if (GRAPHICS_VER(i915) > 5 && !intel_vgpu_active(i915))
>>  		uncore->flags |= UNCORE_HAS_FORCEWAKE;
>>
>>  	if (!intel_uncore_has_forcewake(uncore)) {
>> --
>> 2.31.1
>>
>
>-- 
>Matt Roper
>Graphics Software Engineer
>VTT-OSGC Platform Enablement
>Intel Corporation
>(916) 356-2795

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-07 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-07 18:13 [PATCH 0/3] drm/i915: Nuke GEN macros Lucas De Marchi
2021-07-07 18:13 ` [PATCH 1/3] drm/i915/gt: finish INTEL_GEN and friends conversion Lucas De Marchi
2021-07-07 19:36   ` Matt Roper
2021-07-07 18:13 ` [PATCH 2/3] drm/i915: " Lucas De Marchi
2021-07-07 19:39   ` Matt Roper
2021-07-07 21:44     ` Lucas De Marchi
2021-07-07 18:13 ` [PATCH 3/3] gpu/drm/i915: nuke old GEN macros Lucas De Marchi
2021-07-07 19:41   ` Matt Roper
2021-07-07 18:27 ` [PATCH 0/3] drm/i915: Nuke " Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox