All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG
@ 2016-10-04 12:42 Joonas Lahtinen
  2016-10-04 12:42 ` [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Joonas Lahtinen @ 2016-10-04 12:42 UTC (permalink / raw)
  To: Intel graphics driver community testing & development

Get rid of SEP_SEMICOLON and SEP_BLANK in DEV_INFO_FOR_EACH_FLAG.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c      |  6 +-
 drivers/gpu/drm/i915/i915_drv.h          | 98 +++++++++++++++-----------------
 drivers/gpu/drm/i915/i915_gpu_error.c    |  6 +-
 drivers/gpu/drm/i915/intel_device_info.c | 11 ++--
 4 files changed, 55 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 4fb9d82..4119235 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -68,11 +68,9 @@ static int i915_capabilities(struct seq_file *m, void *data)
 
 	seq_printf(m, "gen: %d\n", INTEL_GEN(dev_priv));
 	seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev_priv));
-#define PRINT_FLAG(x)  seq_printf(m, #x ": %s\n", yesno(info->x))
-#define SEP_SEMICOLON ;
-	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_SEMICOLON);
+#define PRINT_FLAG(x)  seq_printf(m, #x ": %s\n", yesno(info->x));
+	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
 #undef PRINT_FLAG
-#undef SEP_SEMICOLON
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 91ff3d7..f13b958 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -634,55 +634,52 @@ struct intel_csr {
 	uint32_t allowed_dc_mask;
 };
 
-#define DEV_INFO_FOR_EACH_FLAG(func, sep) \
-	func(is_mobile) sep \
-	func(is_i85x) sep \
-	func(is_i915g) sep \
-	func(is_i945gm) sep \
-	func(is_g33) sep \
-	func(hws_needs_physical) sep \
-	func(is_g4x) sep \
-	func(is_pineview) sep \
-	func(is_broadwater) sep \
-	func(is_crestline) sep \
-	func(is_ivybridge) sep \
-	func(is_valleyview) sep \
-	func(is_cherryview) sep \
-	func(is_haswell) sep \
-	func(is_broadwell) sep \
-	func(is_skylake) sep \
-	func(is_broxton) sep \
-	func(is_kabylake) sep \
-	func(is_preliminary) sep \
-	func(has_fbc) sep \
-	func(has_psr) sep \
-	func(has_runtime_pm) sep \
-	func(has_csr) sep \
-	func(has_resource_streamer) sep \
-	func(has_rc6) sep \
-	func(has_rc6p) sep \
-	func(has_dp_mst) sep \
-	func(has_gmbus_irq) sep \
-	func(has_hw_contexts) sep \
-	func(has_logical_ring_contexts) sep \
-	func(has_l3_dpf) sep \
-	func(has_gmch_display) sep \
-	func(has_guc) sep \
-	func(has_pipe_cxsr) sep \
-	func(has_hotplug) sep \
-	func(cursor_needs_physical) sep \
-	func(has_overlay) sep \
-	func(overlay_needs_physical) sep \
-	func(supports_tv) sep \
-	func(has_llc) sep \
-	func(has_snoop) sep \
-	func(has_ddi) sep \
-	func(has_fpga_dbg) sep \
+#define DEV_INFO_FOR_EACH_FLAG(func) \
+	func(is_mobile) \
+	func(is_i85x) \
+	func(is_i915g) \
+	func(is_i945gm) \
+	func(is_g33) \
+	func(hws_needs_physical) \
+	func(is_g4x) \
+	func(is_pineview) \
+	func(is_broadwater) \
+	func(is_crestline) \
+	func(is_ivybridge) \
+	func(is_valleyview) \
+	func(is_cherryview) \
+	func(is_haswell) \
+	func(is_broadwell) \
+	func(is_skylake) \
+	func(is_broxton) \
+	func(is_kabylake) \
+	func(is_preliminary) \
+	func(has_fbc) \
+	func(has_psr) \
+	func(has_runtime_pm) \
+	func(has_csr) \
+	func(has_resource_streamer) \
+	func(has_rc6) \
+	func(has_rc6p) \
+	func(has_dp_mst) \
+	func(has_gmbus_irq) \
+	func(has_hw_contexts) \
+	func(has_logical_ring_contexts) \
+	func(has_l3_dpf) \
+	func(has_gmch_display) \
+	func(has_guc) \
+	func(has_pipe_cxsr) \
+	func(has_hotplug) \
+	func(cursor_needs_physical) \
+	func(has_overlay) \
+	func(overlay_needs_physical) \
+	func(supports_tv) \
+	func(has_llc) \
+	func(has_snoop) \
+	func(has_ddi) \
+	func(has_fpga_dbg) \
 	func(has_pooled_eu)
 
-#define DEFINE_FLAG(name) u8 name:1
-#define SEP_SEMICOLON ;
-
 struct sseu_dev_info {
 	u8 slice_mask;
 	u8 subslice_mask;
@@ -710,7 +707,9 @@ struct intel_device_info {
 	u16 gen_mask;
 	u8 ring_mask; /* Rings supported by the HW */
 	u8 num_rings;
-	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON);
+#define DEFINE_FLAG(name) u8 name:1;
+	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG)
+#undef DEFINE_FLAG
 	u16 ddb_size; /* in blocks */
 	/* Register offsets for the various display pipes and transcoders */
 	int pipe_offsets[I915_MAX_TRANSCODERS];
@@ -727,9 +726,6 @@ struct intel_device_info {
 	} color;
 };
 
-#undef DEFINE_FLAG
-#undef SEP_SEMICOLON
-
 struct intel_display_error_state;
 
 struct drm_i915_error_state {
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 2bbab22..37fcd34 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -355,11 +355,9 @@ static void print_error_obj(struct drm_i915_error_state_buf *m,
 static void err_print_capabilities(struct drm_i915_error_state_buf *m,
 				   const struct intel_device_info *info)
 {
-#define PRINT_FLAG(x)  err_printf(m, #x ": %s\n", yesno(info->x))
-#define SEP_SEMICOLON ;
-	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_SEMICOLON);
+#define PRINT_FLAG(x)  err_printf(m, #x ": %s\n", yesno(info->x));
+	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
 #undef PRINT_FLAG
-#undef SEP_SEMICOLON
 }
 
 int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 73b6858..decdc8e 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -29,19 +29,16 @@ void intel_device_info_dump(struct drm_i915_private *dev_priv)
 	const struct intel_device_info *info = &dev_priv->info;
 
 #define PRINT_S(name) "%s"
-#define SEP_EMPTY
-#define PRINT_FLAG(name) info->name ? #name "," : ""
-#define SEP_COMMA ,
+#define PRINT_FLAG(name) info->name ? #name "," : "",
 	DRM_DEBUG_DRIVER("i915 device info: gen=%i, pciid=0x%04x rev=0x%02x flags="
-			 DEV_INFO_FOR_EACH_FLAG(PRINT_S, SEP_EMPTY),
+			 DEV_INFO_FOR_EACH_FLAG(PRINT_S) "%s",
 			 info->gen,
 			 dev_priv->drm.pdev->device,
 			 dev_priv->drm.pdev->revision,
-			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_COMMA));
+			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
+			 "");
 #undef PRINT_S
-#undef SEP_EMPTY
 #undef PRINT_FLAG
-#undef SEP_COMMA
 }
 
 static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv)
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG
  2016-10-04 12:42 [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
@ 2016-10-04 12:42 ` Joonas Lahtinen
  2016-10-04 13:32   ` Chris Wilson
  2016-10-04 13:23 ` [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Chris Wilson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Joonas Lahtinen @ 2016-10-04 12:42 UTC (permalink / raw)
  To: Intel graphics driver community testing & development

Sort DEV_INFO_FOR_EACH_FLAG to alphabetical order (except is_*).

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f13b958..2ce1171 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -640,7 +640,6 @@ struct intel_csr {
 	func(is_i915g) \
 	func(is_i945gm) \
 	func(is_g33) \
-	func(hws_needs_physical) \
 	func(is_g4x) \
 	func(is_pineview) \
 	func(is_broadwater) \
@@ -654,31 +653,32 @@ struct intel_csr {
 	func(is_broxton) \
 	func(is_kabylake) \
 	func(is_preliminary) \
-	func(has_fbc) \
-	func(has_psr) \
-	func(has_runtime_pm) \
 	func(has_csr) \
-	func(has_resource_streamer) \
-	func(has_rc6) \
-	func(has_rc6p) \
+	func(has_ddi) \
 	func(has_dp_mst) \
+	func(has_fbc) \
+	func(has_fpga_dbg) \
 	func(has_gmbus_irq) \
-	func(has_hw_contexts) \
-	func(has_logical_ring_contexts) \
-	func(has_l3_dpf) \
 	func(has_gmch_display) \
 	func(has_guc) \
-	func(has_pipe_cxsr) \
 	func(has_hotplug) \
-	func(cursor_needs_physical) \
-	func(has_overlay) \
-	func(overlay_needs_physical) \
-	func(supports_tv) \
+	func(has_hw_contexts) \
+	func(has_l3_dpf) \
 	func(has_llc) \
+	func(has_logical_ring_contexts) \
+	func(has_overlay) \
+	func(has_pipe_cxsr) \
+	func(has_pooled_eu) \
+	func(has_psr) \
+	func(has_rc6) \
+	func(has_rc6p) \
+	func(has_resource_streamer) \
+	func(has_runtime_pm) \
 	func(has_snoop) \
-	func(has_ddi) \
-	func(has_fpga_dbg) \
-	func(has_pooled_eu)
+	func(hws_needs_physical) \
+	func(cursor_needs_physical) \
+	func(overlay_needs_physical) \
+	func(supports_tv)
 
 struct sseu_dev_info {
 	u8 slice_mask;
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG
  2016-10-04 12:42 [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
  2016-10-04 12:42 ` [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
@ 2016-10-04 13:23 ` Chris Wilson
  2016-10-04 13:49 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " Patchwork
  2016-10-04 14:19 ` [PATCH 1/2] " Jani Nikula
  3 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2016-10-04 13:23 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: Intel graphics driver community testing & development

On Tue, Oct 04, 2016 at 03:42:57PM +0300, Joonas Lahtinen wrote:
>  #define PRINT_S(name) "%s"
> -#define SEP_EMPTY
> -#define PRINT_FLAG(name) info->name ? #name "," : ""
> -#define SEP_COMMA ,
> +#define PRINT_FLAG(name) info->name ? #name "," : "",
>  	DRM_DEBUG_DRIVER("i915 device info: gen=%i, pciid=0x%04x rev=0x%02x flags="
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_S, SEP_EMPTY),
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_S) "%s",
>  			 info->gen,
>  			 dev_priv->drm.pdev->device,
>  			 dev_priv->drm.pdev->revision,
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_COMMA));
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
> +			 "");

Why did we need the trailing fmt + arg? Oh. PRINT_FLAG has the trailing
'.' so needs a sentinel.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG
  2016-10-04 12:42 ` [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
@ 2016-10-04 13:32   ` Chris Wilson
  2016-10-06 10:10     ` Tvrtko Ursulin
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2016-10-04 13:32 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: Intel graphics driver community testing & development

On Tue, Oct 04, 2016 at 03:42:58PM +0300, Joonas Lahtinen wrote:
> Sort DEV_INFO_FOR_EACH_FLAG to alphabetical order (except is_*).
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Ok. Looks like it should be easier to read.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Could you add something like:

/* Keep is_* in chronological order */
....
/* Keep has_* in alphabetical order */
...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG
  2016-10-04 12:42 [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
  2016-10-04 12:42 ` [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
  2016-10-04 13:23 ` [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Chris Wilson
@ 2016-10-04 13:49 ` Patchwork
  2016-10-04 14:19 ` [PATCH 1/2] " Jani Nikula
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-10-04 13:49 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG
URL   : https://patchwork.freedesktop.org/series/13278/
State : warning

== Summary ==

Series 13278v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/13278/revisions/1/mbox/

Test drv_module_reload_basic:
                pass       -> SKIP       (fi-snb-2520m)
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> DMESG-WARN (fi-ilk-650)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (fi-byt-j1900)

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
fi-bxt-t5700     total:244  pass:214  dwarn:0   dfail:0   fail:0   skip:30 
fi-byt-j1900     total:244  pass:212  dwarn:0   dfail:0   fail:1   skip:31 
fi-byt-n2820     total:244  pass:208  dwarn:0   dfail:0   fail:1   skip:35 
fi-hsw-4770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ilk-650       total:244  pass:181  dwarn:1   dfail:0   fail:2   skip:60 
fi-ivb-3520m     total:244  pass:219  dwarn:0   dfail:0   fail:0   skip:25 
fi-ivb-3770      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:221  dwarn:1   dfail:0   fail:0   skip:22 
fi-skl-6700k     total:244  pass:219  dwarn:1   dfail:0   fail:0   skip:24 
fi-skl-6770hq    total:244  pass:228  dwarn:1   dfail:0   fail:1   skip:14 
fi-snb-2520m     total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 
fi-snb-2600      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_2622/

cedbdecff4c878309133e066f696ea63d41cee73 drm-intel-nightly: 2016y-10m-04d-10h-53m-20s UTC integration manifest
b1a39fa drm/i915: Sort DEV_INFO_FOR_EACH_FLAG
dcd5eeb drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG
  2016-10-04 12:42 [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
                   ` (2 preceding siblings ...)
  2016-10-04 13:49 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " Patchwork
@ 2016-10-04 14:19 ` Jani Nikula
  3 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2016-10-04 14:19 UTC (permalink / raw)
  To: Joonas Lahtinen,
	Intel graphics driver community testing & development

On Tue, 04 Oct 2016, Joonas Lahtinen <joonas.lahtinen@linux.intel.com> wrote:
> Get rid of SEP_SEMICOLON and SEP_BLANK in DEV_INFO_FOR_EACH_FLAG.
>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c      |  6 +-
>  drivers/gpu/drm/i915/i915_drv.h          | 98 +++++++++++++++-----------------
>  drivers/gpu/drm/i915/i915_gpu_error.c    |  6 +-
>  drivers/gpu/drm/i915/intel_device_info.c | 11 ++--
>  4 files changed, 55 insertions(+), 66 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 4fb9d82..4119235 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -68,11 +68,9 @@ static int i915_capabilities(struct seq_file *m, void *data)
>  
>  	seq_printf(m, "gen: %d\n", INTEL_GEN(dev_priv));
>  	seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev_priv));
> -#define PRINT_FLAG(x)  seq_printf(m, #x ": %s\n", yesno(info->x))
> -#define SEP_SEMICOLON ;
> -	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_SEMICOLON);
> +#define PRINT_FLAG(x)  seq_printf(m, #x ": %s\n", yesno(info->x));
> +	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)

NAK.

Leaving out the semicolon throws off a bunch of editor autoidenting
stuff. And is aesthetically displeasing.

BR,
Jani.


>  #undef PRINT_FLAG
> -#undef SEP_SEMICOLON
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 91ff3d7..f13b958 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -634,55 +634,52 @@ struct intel_csr {
>  	uint32_t allowed_dc_mask;
>  };
>  
> -#define DEV_INFO_FOR_EACH_FLAG(func, sep) \
> -	func(is_mobile) sep \
> -	func(is_i85x) sep \
> -	func(is_i915g) sep \
> -	func(is_i945gm) sep \
> -	func(is_g33) sep \
> -	func(hws_needs_physical) sep \
> -	func(is_g4x) sep \
> -	func(is_pineview) sep \
> -	func(is_broadwater) sep \
> -	func(is_crestline) sep \
> -	func(is_ivybridge) sep \
> -	func(is_valleyview) sep \
> -	func(is_cherryview) sep \
> -	func(is_haswell) sep \
> -	func(is_broadwell) sep \
> -	func(is_skylake) sep \
> -	func(is_broxton) sep \
> -	func(is_kabylake) sep \
> -	func(is_preliminary) sep \
> -	func(has_fbc) sep \
> -	func(has_psr) sep \
> -	func(has_runtime_pm) sep \
> -	func(has_csr) sep \
> -	func(has_resource_streamer) sep \
> -	func(has_rc6) sep \
> -	func(has_rc6p) sep \
> -	func(has_dp_mst) sep \
> -	func(has_gmbus_irq) sep \
> -	func(has_hw_contexts) sep \
> -	func(has_logical_ring_contexts) sep \
> -	func(has_l3_dpf) sep \
> -	func(has_gmch_display) sep \
> -	func(has_guc) sep \
> -	func(has_pipe_cxsr) sep \
> -	func(has_hotplug) sep \
> -	func(cursor_needs_physical) sep \
> -	func(has_overlay) sep \
> -	func(overlay_needs_physical) sep \
> -	func(supports_tv) sep \
> -	func(has_llc) sep \
> -	func(has_snoop) sep \
> -	func(has_ddi) sep \
> -	func(has_fpga_dbg) sep \
> +#define DEV_INFO_FOR_EACH_FLAG(func) \
> +	func(is_mobile) \
> +	func(is_i85x) \
> +	func(is_i915g) \
> +	func(is_i945gm) \
> +	func(is_g33) \
> +	func(hws_needs_physical) \
> +	func(is_g4x) \
> +	func(is_pineview) \
> +	func(is_broadwater) \
> +	func(is_crestline) \
> +	func(is_ivybridge) \
> +	func(is_valleyview) \
> +	func(is_cherryview) \
> +	func(is_haswell) \
> +	func(is_broadwell) \
> +	func(is_skylake) \
> +	func(is_broxton) \
> +	func(is_kabylake) \
> +	func(is_preliminary) \
> +	func(has_fbc) \
> +	func(has_psr) \
> +	func(has_runtime_pm) \
> +	func(has_csr) \
> +	func(has_resource_streamer) \
> +	func(has_rc6) \
> +	func(has_rc6p) \
> +	func(has_dp_mst) \
> +	func(has_gmbus_irq) \
> +	func(has_hw_contexts) \
> +	func(has_logical_ring_contexts) \
> +	func(has_l3_dpf) \
> +	func(has_gmch_display) \
> +	func(has_guc) \
> +	func(has_pipe_cxsr) \
> +	func(has_hotplug) \
> +	func(cursor_needs_physical) \
> +	func(has_overlay) \
> +	func(overlay_needs_physical) \
> +	func(supports_tv) \
> +	func(has_llc) \
> +	func(has_snoop) \
> +	func(has_ddi) \
> +	func(has_fpga_dbg) \
>  	func(has_pooled_eu)
>  
> -#define DEFINE_FLAG(name) u8 name:1
> -#define SEP_SEMICOLON ;
> -
>  struct sseu_dev_info {
>  	u8 slice_mask;
>  	u8 subslice_mask;
> @@ -710,7 +707,9 @@ struct intel_device_info {
>  	u16 gen_mask;
>  	u8 ring_mask; /* Rings supported by the HW */
>  	u8 num_rings;
> -	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON);
> +#define DEFINE_FLAG(name) u8 name:1;
> +	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG)
> +#undef DEFINE_FLAG
>  	u16 ddb_size; /* in blocks */
>  	/* Register offsets for the various display pipes and transcoders */
>  	int pipe_offsets[I915_MAX_TRANSCODERS];
> @@ -727,9 +726,6 @@ struct intel_device_info {
>  	} color;
>  };
>  
> -#undef DEFINE_FLAG
> -#undef SEP_SEMICOLON
> -
>  struct intel_display_error_state;
>  
>  struct drm_i915_error_state {
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 2bbab22..37fcd34 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -355,11 +355,9 @@ static void print_error_obj(struct drm_i915_error_state_buf *m,
>  static void err_print_capabilities(struct drm_i915_error_state_buf *m,
>  				   const struct intel_device_info *info)
>  {
> -#define PRINT_FLAG(x)  err_printf(m, #x ": %s\n", yesno(info->x))
> -#define SEP_SEMICOLON ;
> -	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_SEMICOLON);
> +#define PRINT_FLAG(x)  err_printf(m, #x ": %s\n", yesno(info->x));
> +	DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
>  #undef PRINT_FLAG
> -#undef SEP_SEMICOLON
>  }
>  
>  int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 73b6858..decdc8e 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -29,19 +29,16 @@ void intel_device_info_dump(struct drm_i915_private *dev_priv)
>  	const struct intel_device_info *info = &dev_priv->info;
>  
>  #define PRINT_S(name) "%s"
> -#define SEP_EMPTY
> -#define PRINT_FLAG(name) info->name ? #name "," : ""
> -#define SEP_COMMA ,
> +#define PRINT_FLAG(name) info->name ? #name "," : "",
>  	DRM_DEBUG_DRIVER("i915 device info: gen=%i, pciid=0x%04x rev=0x%02x flags="
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_S, SEP_EMPTY),
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_S) "%s",
>  			 info->gen,
>  			 dev_priv->drm.pdev->device,
>  			 dev_priv->drm.pdev->revision,
> -			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG, SEP_COMMA));
> +			 DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG)
> +			 "");
>  #undef PRINT_S
> -#undef SEP_EMPTY
>  #undef PRINT_FLAG
> -#undef SEP_COMMA
>  }
>  
>  static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv)

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG
  2016-10-04 13:32   ` Chris Wilson
@ 2016-10-06 10:10     ` Tvrtko Ursulin
  0 siblings, 0 replies; 7+ messages in thread
From: Tvrtko Ursulin @ 2016-10-06 10:10 UTC (permalink / raw)
  To: Chris Wilson, Joonas Lahtinen,
	Intel graphics driver community testing & development


On 04/10/2016 14:32, Chris Wilson wrote:
> On Tue, Oct 04, 2016 at 03:42:58PM +0300, Joonas Lahtinen wrote:
>> Sort DEV_INFO_FOR_EACH_FLAG to alphabetical order (except is_*).
>>
>> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Ok. Looks like it should be easier to read.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> Could you add something like:
>
> /* Keep is_* in chronological order */
> ....
> /* Keep has_* in alphabetical order */
> ...

You could also push is_mobile and is_preliminary to the end of the is_ 
block which would be a micro-opt for the "IS_SKYLAKE || IS_KABYLAKE" 
code and similar for the checks for the earlier hardware. If flags for 
things of similar age end up in the same byte then checking for compound 
conditions is shorter. :) As it stands they are just split across byte 
boundaries. :))

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-10-06 10:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 12:42 [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
2016-10-04 12:42 ` [PATCH 2/2] drm/i915: Sort DEV_INFO_FOR_EACH_FLAG Joonas Lahtinen
2016-10-04 13:32   ` Chris Wilson
2016-10-06 10:10     ` Tvrtko Ursulin
2016-10-04 13:23 ` [PATCH 1/2] drm/i915: Reduce trickery in DEV_INFO_FOR_EACH_FLAG Chris Wilson
2016-10-04 13:49 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " Patchwork
2016-10-04 14:19 ` [PATCH 1/2] " Jani Nikula

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.