Re: [PATCH 1/3] drm/i915: Downgrade incorrect engine constructor usage warnings to development

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/19/2018 2:00 AM, Tvrtko Ursulin wrote:
From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

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@xxxxxxxxx>
Cc: Michel Thierry <michel.thierry@xxxxxxxxx>
---
  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@xxxxxxxxx>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux