Skip to contentSkip to conversation

drm/i915: Remove a couple pointless WARN_ONs

PATCH Superseded Tvrtko Ursulin 3 participants 5 messages Apr 15, 2016 – Apr 18, 2016

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

PATCH 1/1 drm/i915: Remove a couple pointless WARN_ONs

From: Tvrtko Ursulin <[email protected]>

Just two WARN_ONs followed by pointer dereference I spotted by accident.

---
 drivers/gpu/drm/i915/intel_lrc.c        | 2 --
 drivers/gpu/drm/i915/intel_ringbuffer.c | 7 +------
 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +0 -2
index 1562a75ac9d1..6179b591ee84 100644
@@ -892,8 +892,6 @@ int intel_logical_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
 {
 	int ret;
 
-	WARN_ON(req == NULL);
-
 	ret = logical_ring_prepare(req, num_dwords * sizeof(uint32_t));
 	if (ret)
 		return ret;
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -6
index 0d24494904ef..fa2dd7a9632e 100644
@@ -2489,14 +2489,9 @@ static int __intel_ring_prepare(struct intel_engine_cs *engine, int bytes)
 int intel_ring_begin(struct drm_i915_gem_request *req,
 		     int num_dwords)
 {
-	struct intel_engine_cs *engine;
-	struct drm_i915_private *dev_priv;
+	struct intel_engine_cs *engine = req->engine;
 	int ret;
 
-	WARN_ON(req == NULL);
-	engine = req->engine;
-	dev_priv = req->i915;
-
 	ret = __intel_ring_prepare(engine, num_dwords * sizeof(uint32_t));
 	if (ret)
 		return ret;
Signature · 6 lines
1.9.1

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

From: Tvrtko Ursulin <[email protected]>

Just two WARN_ONs followed by pointer dereference I spotted by accident.

I too keep removing these.

A couple more patch series and we'll be onto intel_ring_begin and intel_logical_ring_begin unification!
-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

PATCH v2 1/1 drm/i915: Remove a couple pointless WARN_ONs

From: Tvrtko Ursulin <[email protected]>

Just two WARN_ONs followed by pointer dereference I spotted by accident.

v2: Remove some more of the same.

---
 drivers/gpu/drm/i915/i915_gem.c         | 10 ++--------
 drivers/gpu/drm/i915/intel_lrc.c        |  2 --
 drivers/gpu/drm/i915/intel_ringbuffer.c |  7 +------
 3 files changed, 3 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +2 -8
index 6ce2c31b9a81..a14a98341a4b 100644
@@ -1444,18 +1444,13 @@ __i915_gem_request_retire__upto(struct drm_i915_gem_request *req)
 int
 i915_wait_request(struct drm_i915_gem_request *req)
 {
-	struct drm_device *dev;
-	struct drm_i915_private *dev_priv;
+	struct drm_i915_private *dev_priv = req->i915;
 	bool interruptible;
 	int ret;
 
-	BUG_ON(req == NULL);
-
-	dev = req->engine->dev;
-	dev_priv = dev->dev_private;
 	interruptible = dev_priv->mm.interruptible;
 
-	BUG_ON(!mutex_is_locked(&dev->struct_mutex));
+	BUG_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex));
 
 	ret = __i915_wait_request(req, interruptible, NULL, NULL);
 	if (ret)
@@ -4355,7 +4350,6 @@ i915_gem_object_ggtt_unpin_view(struct drm_i915_gem_object *obj,
 {
 	struct i915_vma *vma = i915_gem_obj_to_ggtt_view(obj, view);
 
-	BUG_ON(!vma);
 	WARN_ON(vma->pin_count == 0);
 	WARN_ON(!i915_gem_obj_ggtt_bound_view(obj, view));
 
drivers/gpu/drm/i915/intel_lrc.c +0 -2
index 1562a75ac9d1..6179b591ee84 100644
@@ -892,8 +892,6 @@ int intel_logical_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
 {
 	int ret;
 
-	WARN_ON(req == NULL);
-
 	ret = logical_ring_prepare(req, num_dwords * sizeof(uint32_t));
 	if (ret)
 		return ret;
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -6
index 0d24494904ef..fa2dd7a9632e 100644
@@ -2489,14 +2489,9 @@ static int __intel_ring_prepare(struct intel_engine_cs *engine, int bytes)
 int intel_ring_begin(struct drm_i915_gem_request *req,
 		     int num_dwords)
 {
-	struct intel_engine_cs *engine;
-	struct drm_i915_private *dev_priv;
+	struct intel_engine_cs *engine = req->engine;
 	int ret;
 
-	WARN_ON(req == NULL);
-	engine = req->engine;
-	dev_priv = req->i915;
-
 	ret = __intel_ring_prepare(engine, num_dwords * sizeof(uint32_t));
 	if (ret)
 		return ret;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Remove a couple pointless WARN_ONs

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: Remove a couple pointless WARN_ONs
URL : https://patchwork.freedesktop.org/series/5772/
State : failure

== Summary ==

Series 5772v1 drm/i915: Remove a couple pointless WARN_ONs
http://patchwork.freedesktop.org/api/1.0/series/5772/revisions/1/mbox/

Test gem_sync:

        Subgroup basic-each:
                pass       -> DMESG-FAIL (hsw-brixbox)
bdw-ultra        total:203  pass:179  dwarn:0   dfail:0   fail:1   skip:23 
bsw-nuc-2        total:202  pass:162  dwarn:0   dfail:0   fail:1   skip:39 
byt-nuc          total:202  pass:163  dwarn:0   dfail:0   fail:1   skip:38 
hsw-brixbox      total:203  pass:177  dwarn:0   dfail:1   fail:1   skip:24 
hsw-gt2          total:203  pass:183  dwarn:0   dfail:0   fail:1   skip:19 
ilk-hp8440p      total:203  pass:134  dwarn:0   dfail:0   fail:1   skip:68 
ivb-t430s        total:203  pass:174  dwarn:0   dfail:0   fail:1   skip:28 
skl-i7k-2        total:203  pass:177  dwarn:0   dfail:0   fail:1   skip:25 
skl-nuci5        total:203  pass:191  dwarn:0   dfail:0   fail:1   skip:11 
snb-x220t        total:203  pass:164  dwarn:0   dfail:0   fail:2   skip:37 

BOOT FAILED for bdw-nuci7
BOOT FAILED for snb-dellxps

Results at /archive/results/CI_IGT_test/Patchwork_1913/

93007879016173240c35d81572d1fec8c8376f07 drm-intel-nightly: 2016y-04m-15d-07h-43m-11s UTC integration manifest edcab94 drm/i915: Remove a couple pointless WARN_ONs

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Remove a couple pointless WARN_ONs (rev2)

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: Remove a couple pointless WARN_ONs (rev2)
URL : https://patchwork.freedesktop.org/series/5772/
State : failure

== Summary ==

Series 5772v2 drm/i915: Remove a couple pointless WARN_ONs
http://patchwork.freedesktop.org/api/1.0/series/5772/revisions/2/mbox/

Test gem_busy:

        Subgroup basic-blt:
                skip       -> PASS       (bsw-nuc-2)
bdw-nuci7        total:203  pass:191  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:203  pass:180  dwarn:0   dfail:0   fail:0   skip:23 
bsw-nuc-2        total:202  pass:163  dwarn:0   dfail:0   fail:0   skip:39 
byt-nuc          total:202  pass:164  dwarn:0   dfail:0   fail:0   skip:38 
hsw-brixbox      total:203  pass:179  dwarn:0   dfail:0   fail:0   skip:24 
hsw-gt2          total:203  pass:184  dwarn:0   dfail:0   fail:0   skip:19 
ilk-hp8440p      total:203  pass:135  dwarn:0   dfail:0   fail:0   skip:68 
ivb-t430s        total:203  pass:175  dwarn:0   dfail:0   fail:0   skip:28 
skl-i7k-2        total:203  pass:178  dwarn:0   dfail:0   fail:0   skip:25 
skl-nuci5        total:203  pass:192  dwarn:0   dfail:0   fail:0   skip:11 

BOOT FAILED for snb-dellxps

Results at /archive/results/CI_IGT_test/Patchwork_1925/

bcda59813a0c8cea72200c94bfd23f99342476cb drm-intel-nightly: 2016y-04m-18d-10h-25m-54s UTC integration manifest 2e2d91b drm/i915: Remove a couple pointless WARN_ONs

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx