Skip to contentSkip to conversation

drm/i915: use BUILD_BUG_ON to ensure platform name has been set up

PATCH In review Jani Nikula 4 participants 6 messages Feb 28, 2017 – Mar 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: use BUILD_BUG_ON to ensure platform name has been set up

Leave the runtime check in place in case the platform variable itself comes from bogus sources.

---
 drivers/gpu/drm/i915/i915_drv.h          | 1 +
 drivers/gpu/drm/i915/intel_device_info.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index bc9283beda3e..cf06e41ffb01 100644
@@ -890,6 +890,7 @@ enum intel_platform {
 	INTEL_BROXTON,
 	INTEL_KABYLAKE,
 	INTEL_GEMINILAKE,
+	INTEL_MAX_PLATFORMS
 };
 
 struct intel_device_info {
drivers/gpu/drm/i915/intel_device_info.c +2 -0
index 2e1fd857e625..9fc6ab783008 100644
@@ -56,6 +56,8 @@ static const char * const platform_names[] = {
 
 const char *intel_platform_name(enum intel_platform platform)
 {
+	BUILD_BUG_ON(ARRAY_SIZE(platform_names) != INTEL_MAX_PLATFORMS);
+
 	if (WARN_ON_ONCE(platform >= ARRAY_SIZE(platform_names) ||
 			 platform_names[platform] == NULL))
 		return "<unknown>";
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jani Nikula

Leave the runtime check in place in case the platform variable itself comes from bogus sources.

Neat.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 8 lines · Chris Wilson
Quoted 4 lines · Jani Nikula

Leave the runtime check in place in case the platform variable itself comes from bogus sources.

Neat.

Pushed, thanks for the review.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#3 lore raw
In reply to Jani Nikula
Quoted 4 lines · Jani Nikula

Leave the runtime check in place in case the platform variable itself comes from bogus sources.

<SNIP>

drivers/gpu/drm/i915/i915_drv.h enum intel_platform { · line 894

Quoted 6 lines
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -890,6 +890,7 @@ enum intel_platform {
  	INTEL_BROXTON,
  	INTEL_KABYLAKE,
  	INTEL_GEMINILAKE,
+	INTEL_MAX_PLATFORMS
  };

Easily confused to be be off by one, INTEL_MAX_PLATFORMS = INTEL_GEMINILAKE, so I suggest changing it to INTEL_NUM_PLATFORMS which is explicit.

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 8 lines · Joonas Lahtinen
Quoted 4 lines · Jani Nikula

Leave the runtime check in place in case the platform variable itself comes from bogus sources.

<SNIP>

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.h enum intel_platform { · line 894

Quoted 6 lines
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -890,6 +890,7 @@ enum intel_platform {
  	INTEL_BROXTON,
  	INTEL_KABYLAKE,
  	INTEL_GEMINILAKE,
+	INTEL_MAX_PLATFORMS
  };

Easily confused to be be off by one, INTEL_MAX_PLATFORMS = INTEL_GEMINILAKE, so I suggest changing it to INTEL_NUM_PLATFORMS which is explicit.

...and wrong. INTEL_MAX_PLATFORMS is not the same as number of supported platforms.

BR,
Jani.

Quoted 2 lines

Regards, Joonas

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

✗ Fi.CI.BAT: failure for drm/i915: use BUILD_BUG_ON to ensure platform name has been set up

In reply to Jani Nikula
== Series Details ==

== Series Details ==

Series: drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
URL : https://patchwork.freedesktop.org/series/20373/
State : failure

== Summary ==

Series 20373v1 drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
https://patchwork.freedesktop.org/api/1.0/series/20373/revisions/1/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                fail       -> PASS       (fi-snb-2600) fdo#100007
Test gem_exec_suspend:
        Subgroup basic-s3:
                dmesg-warn -> PASS       (fi-ivb-3520m) fdo#100004
                pass       -> DMESG-WARN (fi-bxt-j4205) fdo#100004
                pass       -> DMESG-WARN (fi-byt-j1900) fdo#100004
                pass       -> DMESG-WARN (fi-snb-2520m) fdo#100004
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-ivb-3770)
Test kms_flip:
        Subgroup basic-plain-flip:
                pass       -> INCOMPLETE (fi-byt-j1900)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (fi-bxt-j4205) fdo#100004
                dmesg-warn -> PASS       (fi-snb-2520m) fdo#100004
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-ivb-3520m) fdo#100004

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#100004 https://bugs.freedesktop.org/show_bug.cgi?id=100004

fi-bdw-5557u     total:278  pass:266  dwarn:1   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:278  pass:238  dwarn:1   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:278  pass:258  dwarn:1   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:108  pass:95   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:210  pass:190  dwarn:1   dfail:0   fail:0   skip:18 
fi-byt-n2820     total:278  pass:246  dwarn:1   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:278  pass:261  dwarn:1   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:278  pass:261  dwarn:1   dfail:0   fail:0   skip:16 
fi-ilk-650       total:278  pass:227  dwarn:1   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:278  pass:258  dwarn:2   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:278  pass:260  dwarn:1   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:278  pass:249  dwarn:1   dfail:0   fail:0   skip:28 
fi-snb-2600      total:278  pass:248  dwarn:1   dfail:0   fail:0   skip:29 

b2a0b6040942a2844abfe5098aaef584529f3ed3 drm-tip: 2017y-02m-28d-12h-31m-07s UTC integration manifest c318577 drm/i915: use BUILD_BUG_ON to ensure platform name has been set up

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3999/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx