Skip to contentSkip to conversation

drm/i915: Do not WARN_ON with small framebuffers.

PATCH In review Maarten Lankhorst 3 participants 5 messages Jan 16, 2018 – Jan 17, 2018

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

PATCH 1/1 drm/i915: Do not WARN_ON with small framebuffers.

It's perfectly legal to create a fb with stride < 512, and one of the kms_plane_scaling subtests creates a very small fb.

Downgrade the WARN_ON to a simple check check, and because this function is potentially called on every atomic update/pageflip, downgrade the other WARN_ON to a WARN_ON_ONCE, and do the right thing here.

---
 drivers/gpu/drm/i915/intel_fbc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_fbc.c +5 -3
index 7a64405f4514..c4e924e41db3 100644
@@ -668,11 +668,13 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv)
 static bool stride_is_valid(struct drm_i915_private *dev_priv,
 			    unsigned int stride)
 {
-	/* These should have been caught earlier. */
-	WARN_ON(stride < 512);
-	WARN_ON((stride & (64 - 1)) != 0);
+	/* This should have been caught earlier. */
+	if (WARN_ON_ONCE((stride & (64 - 1)) != 0))
+		return false;
 
 	/* Below are the additional FBC restrictions. */
+	if (stride < 512)
+		return false;
 
 	if (IS_GEN2(dev_priv) || IS_GEN3(dev_priv))
 		return stride == 4096 || stride == 8192;
Signature · 6 lines
2.15.1

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

✓ Fi.CI.BAT: success for drm/i915: Do not WARN_ON with small framebuffers.

== Series Details ==

== Series Details ==

Series: drm/i915: Do not WARN_ON with small framebuffers.
URL : https://patchwork.freedesktop.org/series/36558/
State : success

== Summary ==

Series 36558v1 drm/i915: Do not WARN_ON with small framebuffers.
https://patchwork.freedesktop.org/api/1.0/series/36558/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:370s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:486s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:483s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:465s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:394s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:463s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:413s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:461s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:503s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:579s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:435s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:530s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:487s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:474s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
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:568s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:470s

a0ca279440c8d7c40d798fed9939a2a25b31434b drm-tip: 2018y-01m-16d-10h-49m-51s UTC integration manifest cc5821b66cc0 drm/i915: Do not WARN_ON with small framebuffers.

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7687/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.IGT: success for drm/i915: Do not WARN_ON with small framebuffers.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: drm/i915: Do not WARN_ON with small framebuffers.
URL : https://patchwork.freedesktop.org/series/36558/
State : success

== Summary ==

Test kms_flip:

        Subgroup vblank-vs-modeset-suspend:
                pass       -> SKIP       (shard-snb) fdo#102365
        Subgroup flip-vs-fences-interruptible:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> SKIP       (shard-snb) fdo#103880
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252

fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2729 pass:1549 dwarn:1   dfail:0   fail:10  skip:1169 time:9111s
shard-snb        total:2729 pass:1315 dwarn:1   dfail:0   fail:11  skip:1401 time:7479s
Blacklisted hosts:
shard-apl        total:2729 pass:1698 dwarn:1   dfail:0   fail:23  skip:1006 time:13527s
shard-kbl        total:2729 pass:1825 dwarn:1   dfail:0   fail:23  skip:880 time:10633s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7687/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Maarten Lankhorst
Quoted 10 lines · Maarten Lankhorst

It's perfectly legal to create a fb with stride < 512, and one of the kms_plane_scaling subtests creates a very small fb.

Downgrade the WARN_ON to a simple check check, and because this function is potentially called on every atomic update/pageflip, downgrade the other WARN_ON to a WARN_ON_ONCE, and do the right thing here.

Quoted 32 lines
---
 drivers/gpu/drm/i915/intel_fbc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_fbc.c +5 -3
index 7a64405f4514..c4e924e41db3 100644
@@ -668,11 +668,13 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv)
 static bool stride_is_valid(struct drm_i915_private *dev_priv,
 			    unsigned int stride)
 {
-	/* These should have been caught earlier. */
-	WARN_ON(stride < 512);
-	WARN_ON((stride & (64 - 1)) != 0);
+	/* This should have been caught earlier. */
+	if (WARN_ON_ONCE((stride & (64 - 1)) != 0))
+		return false;
 
 	/* Below are the additional FBC restrictions. */
+	if (stride < 512)
+		return false;
 
 	if (IS_GEN2(dev_priv) || IS_GEN3(dev_priv))
 		return stride == 4096 || stride == 8192;
Signature · 6 lines
2.15.1

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

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

#4 lore raw

Op 17-01-18 om 00:57 schreef Rodrigo Vivi:

Quoted 13 lines · Maarten Lankhorst
Quoted 10 lines

It's perfectly legal to create a fb with stride < 512, and one of the kms_plane_scaling subtests creates a very small fb.

Downgrade the WARN_ON to a simple check check, and because this function is potentially called on every atomic update/pageflip, downgrade the other WARN_ON to a WARN_ON_ONCE, and do the right thing here.

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