Message ID | 20180119100005.9072-1-tvrtko.ursulin@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 1/19/2018 2:00 AM, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > Render engine constructor helpers must only be called from the render > engine constructors, but there is no need to burden the production > binaries with warnings which can only be triggered during development. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Cc: Michel Thierry <michel.thierry@intel.com> > --- > drivers/gpu/drm/i915/intel_engine_cs.c | 3 ++- > drivers/gpu/drm/i915/intel_lrc.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c > index d572b18d39eb..da05d38ba000 100644 > --- a/drivers/gpu/drm/i915/intel_engine_cs.c > +++ b/drivers/gpu/drm/i915/intel_engine_cs.c > @@ -1389,7 +1389,8 @@ int init_workarounds_ring(struct intel_engine_cs *engine) > struct drm_i915_private *dev_priv = engine->i915; > int err; > > - WARN_ON(engine->id != RCS); > + if (GEM_WARN_ON(engine->id != RCS)) > + return -EINVAL; > > dev_priv->workarounds.count = 0; > dev_priv->workarounds.hw_whitelist_count[engine->id] = 0; > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c > index 24ce781d39b7..334d44d415ab 100644 > --- a/drivers/gpu/drm/i915/intel_lrc.c > +++ b/drivers/gpu/drm/i915/intel_lrc.c > @@ -1416,7 +1416,7 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine) > unsigned int i; > int ret; > > - if (WARN_ON(engine->id != RCS || !engine->scratch)) > + if (GEM_WARN_ON(engine->id != RCS || !engine->scratch)) > return -EINVAL; > > switch (INTEL_GEN(engine->i915)) { > As Chris said in patch 2/3, do you want to remove the !scratch check here too? Otherwise both patches are also Reviewed-by: Michel Thierry <michel.thierry@intel.com>
On 19/01/2018 10:43, Patchwork wrote: > == Series Details == > > Series: series starting with [1/3] drm/i915: Downgrade incorrect engine constructor usage warnings to development > URL : https://patchwork.freedesktop.org/series/36771/ > State : success > > == Summary == > > Series 36771v1 series starting with [1/3] drm/i915: Downgrade incorrect engine constructor usage warnings to development > https://patchwork.freedesktop.org/api/1.0/series/36771/revisions/1/mbox/ > > Test gem_mmap_gtt: > Subgroup basic-small-bo-tiledx: > fail -> PASS (fi-gdg-551) fdo#102575 > > fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575 > > fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:427s > fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:427s > fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:371s > fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:487s > fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:282s > fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:484s > fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:483s > fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:465s > fi-elk-e7500 total:224 pass:168 dwarn:10 dfail:0 fail:0 skip:45 > fi-gdg-551 total:288 pass:180 dwarn:0 dfail:0 fail:0 skip:108 time:279s > fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:517s > fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:393s > fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:403s > fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:411s > fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:461s > fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:410s > fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:458s > fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:494s > fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:454s > fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:502s > fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:576s > fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:434s > fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:516s > fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:525s > fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:485s > fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:494s > fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:433s > fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:526s > fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:394s > Blacklisted hosts: > fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:570s > fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:469s > fi-skl-guc total:288 pass:212 dwarn:48 dfail:0 fail:0 skip:28 time:407s > > 3ddf5cf5ba662407c1d233e73bd783c548cc973b drm-tip: 2018y-01m-19d-10h-03m-03s UTC integration manifest > 900552342868 drm/i915: Stop ignoring failure to set up workaround batch buffers > c25d70919bc2 drm/i915: Per-engine scratch VMA is mandatory > fd11054b3673 drm/i915: Downgrade incorrect engine constructor usage warnings to development Pushed first two, for whatever miniscule improvement. Thanks for the reviews! Regards, Tvrtko
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c index d572b18d39eb..da05d38ba000 100644 --- a/drivers/gpu/drm/i915/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/intel_engine_cs.c @@ -1389,7 +1389,8 @@ int init_workarounds_ring(struct intel_engine_cs *engine) struct drm_i915_private *dev_priv = engine->i915; int err; - WARN_ON(engine->id != RCS); + if (GEM_WARN_ON(engine->id != RCS)) + return -EINVAL; dev_priv->workarounds.count = 0; dev_priv->workarounds.hw_whitelist_count[engine->id] = 0; diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 24ce781d39b7..334d44d415ab 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1416,7 +1416,7 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine) unsigned int i; int ret; - if (WARN_ON(engine->id != RCS || !engine->scratch)) + if (GEM_WARN_ON(engine->id != RCS || !engine->scratch)) return -EINVAL; switch (INTEL_GEN(engine->i915)) {