* [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
@ 2017-02-28 11:11 Jani Nikula
2017-02-28 11:14 ` Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jani Nikula @ 2017-02-28 11:11 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Leave the runtime check in place in case the platform variable itself
comes from bogus sources.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/intel_device_info.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bc9283beda3e..cf06e41ffb01 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -890,6 +890,7 @@ enum intel_platform {
INTEL_BROXTON,
INTEL_KABYLAKE,
INTEL_GEMINILAKE,
+ INTEL_MAX_PLATFORMS
};
struct intel_device_info {
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 2e1fd857e625..9fc6ab783008 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -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>";
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
2017-02-28 11:11 [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up Jani Nikula
@ 2017-02-28 11:14 ` Chris Wilson
2017-03-01 13:25 ` Jani Nikula
2017-02-28 12:42 ` Joonas Lahtinen
2017-02-28 13:52 ` ✗ Fi.CI.BAT: failure for " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-02-28 11:14 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Tue, Feb 28, 2017 at 01:11:43PM +0200, Jani Nikula wrote:
> Leave the runtime check in place in case the platform variable itself
> comes from bogus sources.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Neat.
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] 6+ messages in thread
* Re: [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
2017-02-28 11:11 [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up Jani Nikula
2017-02-28 11:14 ` Chris Wilson
@ 2017-02-28 12:42 ` Joonas Lahtinen
2017-02-28 14:09 ` Jani Nikula
2017-02-28 13:52 ` ✗ Fi.CI.BAT: failure for " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Joonas Lahtinen @ 2017-02-28 12:42 UTC (permalink / raw)
To: Jani Nikula, intel-gfx
On ti, 2017-02-28 at 13:11 +0200, Jani Nikula wrote:
> Leave the runtime check in place in case the platform variable itself
> comes from bogus sources.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
<SNIP>
> @@ -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
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✗ Fi.CI.BAT: failure for drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
2017-02-28 11:11 [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up Jani Nikula
2017-02-28 11:14 ` Chris Wilson
2017-02-28 12:42 ` Joonas Lahtinen
@ 2017-02-28 13:52 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-02-28 13:52 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
2017-02-28 12:42 ` Joonas Lahtinen
@ 2017-02-28 14:09 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2017-02-28 14:09 UTC (permalink / raw)
To: Joonas Lahtinen, intel-gfx
On Tue, 28 Feb 2017, Joonas Lahtinen <joonas.lahtinen@linux.intel.com> wrote:
> On ti, 2017-02-28 at 13:11 +0200, Jani Nikula wrote:
>> Leave the runtime check in place in case the platform variable itself
>> comes from bogus sources.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> <SNIP>
>
>> @@ -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.
>
> Regards, Joonas
--
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] 6+ messages in thread
* Re: [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up
2017-02-28 11:14 ` Chris Wilson
@ 2017-03-01 13:25 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2017-03-01 13:25 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Tue, 28 Feb 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Tue, Feb 28, 2017 at 01:11:43PM +0200, Jani Nikula wrote:
>> Leave the runtime check in place in case the platform variable itself
>> comes from bogus sources.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Neat.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Pushed, thanks for the review.
BR,
Jani.
--
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] 6+ messages in thread
end of thread, other threads:[~2017-03-01 13:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 11:11 [PATCH] drm/i915: use BUILD_BUG_ON to ensure platform name has been set up Jani Nikula
2017-02-28 11:14 ` Chris Wilson
2017-03-01 13:25 ` Jani Nikula
2017-02-28 12:42 ` Joonas Lahtinen
2017-02-28 14:09 ` Jani Nikula
2017-02-28 13:52 ` ✗ Fi.CI.BAT: failure for " Patchwork
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.