Re: [Intel-gfx] [PATCH 3/3] igt/kms_flip: Use new igt_spin_batch
On 10/28/2016 07:02 PM, Ville Syrjälä wrote: > On Fri, Oct 28, 2016 at 06:47:26PM +0300, Abdiel Janulgue wrote: >> Cc: Chris Wilson >> Cc: Daniel Vetter >> Signed-off-by: Abdiel Janulgue >> --- >> tests/kms_flip.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/tests/kms_flip.c b/tests/kms_flip.c >> index 9829b35..13cb262 100644 >> --- a/tests/kms_flip.c >> +++ b/tests/kms_flip.c >> @@ -866,10 +866,10 @@ static unsigned int run_test_step(struct test_output >> *o) >> o->current_fb_id = !o->current_fb_id; >> >> if (o->flags & TEST_WITH_DUMMY_BCS) >> -emit_dummy_load__bcs(o, 1); >> +igt_spin_batch_wait(drm_fd, 1, I915_EXEC_BLT); >> >> if (o->flags & TEST_WITH_DUMMY_RCS) >> -emit_dummy_load__rcs(o, 1); >> +igt_spin_batch_wait(drm_fd, 1, I915_EXEC_RENDER); > > NAK That's not going to add the required dependency between the load > and the bo used by the test. Right. For these cases would it be more straightforward to stick to the auto-tuned rendercopy/blit load operations on the bo instead of inserting a recursive batch on these situations? Any ideas? >> >> if (o->flags & TEST_FB_RECREATE) >> recreate_fb(o); >> -- >> 2.7.0 >> >> ___ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/intel-gfx > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [Regression report] Weekly regression report WW44
Total regressions: 47 This week regressions:3 +---+---+++ | BugId | Summary | Created on | Bisect | +---+---+++ | 98462 | [KBL] [IGT] [regression] kms_3d [drm:drm_dp_d | 2016-10-27 | No | | 98460 | [SNB] [regression] [igt] gem_busy@extended-pa | 2016-10-27 | No | | 98402 | [HSW] [regression] 4.9-rc1 shows corruption w | 2016-10-23 | No | +---+---+++ Previous regressions:44 +---+---+++ | BugId | Summary | Created on | Bisect | +---+---+++ | 98289 | [BDW] kms_flip / vblank-vs-suspend-interrupti | 2016-10-17 | No | | 98290 | [BDW] kms_frontbuffer_tracking fbc-suspend fa | 2016-10-17 | No | | 98282 | [skl][bisected] GPU Hangs on nightly | 2016-10-17 | Yes| | 98211 | i915 / drm crash when undocking from DP monit | 2016-10-12 | No | | 98036 | [BYT] constant screen flicker and rendering e | 2016-10-03 | No | | 97994 | [REGRESS] [BISECT] [i915] Monitor resolution | 2016-09-30 | Yes| | 97918 | [bdw regression 4.8] Severe graphics regressi | 2016-09-25 | No | | 97878 | [SKL][REGRESSION][BISECTED] Dropped frames an | 2016-09-20 | Yes| | 97867 | [HSW][Regression] 4.6.7 and beyond causes scr | 2016-09-19 | No | | 97666 | Kernel "NULL pointer dereference" with MST mo | 2016-09-08 | Yes| | 97017 | [SKL GT3e guc bisected] ~10% performance drop | 2016-07-21 | Yes| | 96938 | [HSW modeset regression] i915/drm locks up wh | 2016-07-15 | No | | 96916 | Regression: screen flashes with PSR enabled | 2016-07-13 | No | | 96800 | [regression] The drm-intel-nightly branch no | 2016-07-04 | No | | 96736 | kernel 4.6 regression: PSR causes screen to f | 2016-06-29 | Yes| | 96704 | kernel 4.6 regression: PSR on Haswell causes | 2016-06-28 | Yes| | 96645 | [regression 4.7] [BISECT]Low package c-states | 2016-06-22 | Yes| | 96428 | [IVB bisected] [drm:intel_dp_aux_ch]*ERROR* | 2016-06-07 | Yes| | 95736 | [IVB bisected]*ERROR* uncleared fifo underru | 2016-05-24 | Yes| | 95197 | [i915] regression in 4.6-rc5: GPU HANG: ecode | 2016-04-28 | No | | 95097 | [hdmi regression ilk] no signal to TV | 2016-04-24 | No | | 94590 | [KBL] igt/kms_fbcon_fbt/psr-suspend regressio | 2016-03-17 | No | | 94430 | [HSW+nvidia] regression: display becomes "dis | 2016-03-07 | No | | 94337 | Linux 4.5 regression: FIFO underruns on Skyla | 2016-02-29 | No | | 93971 | video framerate performance regression with U | 2016-02-02 | Yes| | 93802 | [IVB bisected] switching to tty1 causes fifo | 2016-01-20 | Yes| | 93782 | [i9xx TV][BISECT] vblank wait timeout on crtc | 2016-01-19 | Yes| | 93486 | [HP Compaq dc7800 Small Form Factor PC][REGRE | 2015-12-23 | No | | 93393 | Regression for Skylake modesetting in kernel | 2015-12-16 | No | | 93361 | 12bpc hdmi causes wrong real refresh rate (sw | 2015-12-12 | Yes| | 93263 | 945GM regression since 4.3| 2015-12-05 | No | | 92414 | [Intel-gfx] As of kernel 4.3-rc1 system will | 2015-10-10 | Yes| | 92237 | [SNB]Horrible noise (audio) via DisplayPort [ | 2015-10-02 | No | | 92050 | [regression]/bug introduced by commit [0e572f | 2015-09-19 | Yes| | 91974 | [bisected] unrecoverable black screen after k | 2015-09-11 | Yes| | 91959 | [865g Linux regression] GPU hang and disabled | 2015-09-10 | No | | 90134 | [BSW Bisected]GFXBench3_gl_driver/GFXBench3_g | 2015-04-22 | Yes| | 90112 | [BSW bisected] OglGSCloth/Lightsmark/CS/ Port | 2015-04-20 | Yes| | 89872 | [ HSW Bisected ] VGA was white screen when re | 2015-04-02 | Yes| | 89632 | [i965 regression]igt/kms_universal_plane/univ | 2015-03-18 | No | | 89629 | [i965 regression]igt/kms_rotation_crc/sprite- | 2015-03-18 | No | | 87726 | [BDW Bisected] OglDrvCtx performance reduced | 2014-12-26 | Yes| | 87725 | [BDW Bisected] OglBatch7 performance reduced | 2014-12-26 | Yes| | 87131 | [PNV regression] igt/gem_exec_lut_handle take | 2014-12-09 | No | +---+---+++ ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] ✗ Fi.CI.BAT: warning for drm/i915: Discard objects from mm global_list after being shrunk
== Series Details == Series: drm/i915: Discard objects from mm global_list after being shrunk URL : https://patchwork.freedesktop.org/series/14581/ State : warning == Summary == Series 14581v1 drm/i915: Discard objects from mm global_list after being shrunk https://patchwork.freedesktop.org/api/1.0/series/14581/revisions/1/mbox/ Test drv_module_reload_basic: pass -> DMESG-WARN (fi-ivb-3520m) Test gem_ringfill: Subgroup basic-default-hang: incomplete -> PASS (fi-hsw-4770r) Test kms_cursor_legacy: Subgroup basic-flip-after-cursor-varying-size: pass -> DMESG-WARN (fi-ilk-650) Subgroup basic-flip-before-cursor-varying-size: pass -> DMESG-WARN (fi-ilk-650) Test kms_pipe_crc_basic: Subgroup bad-pipe: pass -> DMESG-WARN (fi-ilk-650) Subgroup nonblocking-crc-pipe-a: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-a-frame-sequence: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-b: pass -> DMESG-WARN (fi-ilk-650) Subgroup suspend-read-crc-pipe-b: pass -> DMESG-WARN (fi-ilk-650) fi-bdw-5557u total:241 pass:226 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:241 pass:201 dwarn:0 dfail:0 fail:0 skip:40 fi-byt-j1900 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-n2820 total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-hsw-4770 total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-hsw-4770r total:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-ilk-650 total:241 pass:180 dwarn:7 dfail:0 fail:0 skip:54 fi-ivb-3520m total:241 pass:217 dwarn:1 dfail:0 fail:0 skip:23 fi-ivb-3770 total:241 pass:218 dwarn:0 dfail:0 fail:0 skip:23 fi-kbl-7200u total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6260u total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hqtotal:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6700k total:241 pass:219 dwarn:1 dfail:0 fail:0 skip:21 fi-skl-6770hqtotal:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-snb-2520m total:241 pass:208 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:241 pass:207 dwarn:0 dfail:0 fail:0 skip:34 bbb625b5b79bdbdefd87e68e15edaa120fe70d4f drm-intel-nightly: 2016y-10m-29d-12h-45m-44s UTC integration manifest ea8b30b drm/i915: Discard objects from mm global_list after being shrunk == Logs == For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2860/ ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] ✗ Fi.CI.BAT: warning for drm/i915: Track pages pinned due to swizzling quirk
== Series Details == Series: drm/i915: Track pages pinned due to swizzling quirk URL : https://patchwork.freedesktop.org/series/14580/ State : warning == Summary == Series 14580v1 drm/i915: Track pages pinned due to swizzling quirk https://patchwork.freedesktop.org/api/1.0/series/14580/revisions/1/mbox/ Test drv_module_reload_basic: pass -> DMESG-WARN (fi-bxt-t5700) pass -> DMESG-WARN (fi-skl-6770hq) Test gem_ringfill: Subgroup basic-default-hang: incomplete -> PASS (fi-hsw-4770r) Test kms_cursor_legacy: Subgroup basic-flip-before-cursor-legacy: pass -> DMESG-WARN (fi-ilk-650) Test kms_pipe_crc_basic: Subgroup bad-nb-words-1: pass -> DMESG-WARN (fi-ilk-650) Subgroup bad-nb-words-3: pass -> DMESG-WARN (fi-ilk-650) Subgroup bad-source: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-a-frame-sequence: pass -> DMESG-WARN (fi-ilk-650) fi-bdw-5557u total:241 pass:226 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:241 pass:201 dwarn:0 dfail:0 fail:0 skip:40 fi-bxt-t5700 total:241 pass:212 dwarn:1 dfail:0 fail:0 skip:28 fi-byt-j1900 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-n2820 total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-hsw-4770 total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-hsw-4770r total:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-ilk-650 total:241 pass:182 dwarn:5 dfail:0 fail:0 skip:54 fi-ivb-3520m total:241 pass:218 dwarn:0 dfail:0 fail:0 skip:23 fi-ivb-3770 total:241 pass:218 dwarn:0 dfail:0 fail:0 skip:23 fi-kbl-7200u total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6260u total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hqtotal:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6700k total:241 pass:219 dwarn:1 dfail:0 fail:0 skip:21 fi-skl-6770hqtotal:241 pass:226 dwarn:1 dfail:0 fail:0 skip:14 fi-snb-2520m total:241 pass:208 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:241 pass:207 dwarn:0 dfail:0 fail:0 skip:34 bbb625b5b79bdbdefd87e68e15edaa120fe70d4f drm-intel-nightly: 2016y-10m-29d-12h-45m-44s UTC integration manifest 584088b drm/i915: Track pages pinned due to swizzling quirk == Logs == For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2859/ ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Discard objects from mm global_list after being shrunk
In the shrinker, we can safely remove an empty object (obj->mm.pages == NULL) after having discarded the pages because we are holding the struct_mutex. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem_shrinker.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c index 0241658af16b..b504ba091c4f 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@ -226,6 +226,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv, mutex_lock(&obj->mm.lock); if (!obj->mm.pages) { __i915_gem_object_invalidate(obj); + list_del_init(&obj->global_list); count += obj->base.size >> PAGE_SHIFT; } mutex_unlock(&obj->mm.lock); -- 2.10.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Track pages pinned due to swizzling quirk
If we have a tiled object and an unknown CPU swizzle pattern, we pin the pages to prevent the object from being swapped out (and us corrupting the contents as we do not know the access pattern and so cannot convert it to linear and back to tiled on reuse). This requires us to remember to drop the extra pinning when freeing the object, or else we trigger warnings about the pin leak. In commit fbbd37b36fa5 ("drm/i915: Move object release to a freelist + worker"), the object free path was deferred to a work, but the unpinning of the quirk, along with marking the object as reclaimable, was left on the immediate path (so that if required we could reclaim the pages under memory pressure as early as possible). However, this split introduced a bug where the pages we no longer being unpinned if they were marked as unneeded. [ 231.800401] WARNING: CPU: 1 PID: 90 at drivers/gpu/drm/i915/i915_gem.c:4275 __i915_gem_free_objects+0x326/0x3c0 [i915] [ 231.800403] WARN_ON(i915_gem_object_has_pinned_pages(obj)) [ 231.800405] Modules linked in: [ 231.800406] snd_hda_intel i915 snd_hda_codec_generic mei_me snd_hda_codec coretemp snd_hwdep mei lpc_ich snd_hda_core snd_pcm e1000e ptp pps_core [last unloaded: i915] [ 231.800426] CPU: 1 PID: 90 Comm: kworker/1:4 Tainted: G U 4.9.0-rc2-CI-CI_DRM_1780+ #1 [ 231.800428] Hardware name: LENOVO 7465CTO/7465CTO, BIOS 6DET44WW (2.08 ) 04/22/2009 [ 231.800456] Workqueue: events __i915_gem_free_work [i915] [ 231.800459] c934fc80 8142dd65 c934fcd0 [ 231.800465] c934fcc0 8107e4e6 10b30001 1000 [ 231.800469] 88011d3db740 880130ef 880130ef5ea0 [ 231.800474] Call Trace: [ 231.800479] [] dump_stack+0x67/0x92 [ 231.800484] [] __warn+0xc6/0xe0 [ 231.800487] [] warn_slowpath_fmt+0x4a/0x50 [ 231.800491] [] ? kmem_cache_free+0x2dc/0x340 [ 231.800520] [] __i915_gem_free_objects+0x326/0x3c0 [i915] [ 231.800548] [] __i915_gem_free_work+0x2e/0x50 [i915] [ 231.800552] [] process_one_work+0x1ec/0x6b0 [ 231.800555] [] ? process_one_work+0x166/0x6b0 [ 231.800558] [] worker_thread+0x49/0x490 [ 231.800561] [] ? process_one_work+0x6b0/0x6b0 [ 231.800563] [] ? process_one_work+0x6b0/0x6b0 [ 231.800566] [] kthread+0xeb/0x110 [ 231.800569] [] ? kthread_park+0x60/0x60 [ 231.800573] [] ret_from_fork+0x27/0x40 Fixes: fbbd37b36fa5 ("drm/i915: Move object release to a freelist + worker") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_drv.h| 6 ++ drivers/gpu/drm/i915/i915_gem.c| 21 + drivers/gpu/drm/i915/i915_gem_tiling.c | 9 +++-- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 10c4bf7a0a64..6b9dd5d18ac2 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2304,6 +2304,12 @@ struct drm_i915_gem_object { * pages were last acquired. */ bool dirty:1; + + /** +* This is set if the object has been pinned due to unknown +* swizzling. +*/ + bool quirked:1; } mm; /** Breadcrumb of last rendering to the buffer. diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 976b8a77dcea..e443088e2177 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2376,8 +2376,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) i915_gem_object_do_bit_17_swizzle(obj, st); if (i915_gem_object_is_tiled(obj) && - dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES) + dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES) { __i915_gem_object_pin_pages(obj); + obj->mm.quirked = true; + } return st; @@ -4268,10 +4270,15 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data, if (obj->mm.pages && i915_gem_object_is_tiled(obj) && dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES) { - if (obj->mm.madv == I915_MADV_WILLNEED) + if (obj->mm.madv == I915_MADV_WILLNEED) { + GEM_BUG_ON(!obj->mm.quirked); __i915_gem_object_unpin_pages(obj); - if (args->madv == I915_MADV_WILLNEED) + obj->mm.quirked = false; + } + if (args->madv == I915_MADV_WILLNEED) { __i915_gem_object_pin_pages(obj); + obj->mm.quirked = true; + } } if (obj->mm.madv != __I915_MADV_PURGED) @@ -4512,14 +4519,12 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj) { struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); + if (obj->mm.quirked) + _
[Intel-gfx] ✗ Fi.CI.BAT: warning for drm/i915: Export a function to flush the context upon pinning
== Series Details == Series: drm/i915: Export a function to flush the context upon pinning URL : https://patchwork.freedesktop.org/series/14579/ State : warning == Summary == Series 14579v1 drm/i915: Export a function to flush the context upon pinning https://patchwork.freedesktop.org/api/1.0/series/14579/revisions/1/mbox/ Test gem_ringfill: Subgroup basic-default-hang: incomplete -> PASS (fi-hsw-4770r) Test kms_pipe_crc_basic: Subgroup bad-pipe: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-a: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-a-frame-sequence: pass -> DMESG-WARN (fi-ilk-650) Subgroup read-crc-pipe-b-frame-sequence: pass -> DMESG-WARN (fi-ilk-650) fi-bdw-5557u total:241 pass:226 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:241 pass:201 dwarn:0 dfail:0 fail:0 skip:40 fi-byt-j1900 total:241 pass:213 dwarn:0 dfail:0 fail:0 skip:28 fi-byt-n2820 total:241 pass:209 dwarn:0 dfail:0 fail:0 skip:32 fi-hsw-4770 total:241 pass:221 dwarn:0 dfail:0 fail:0 skip:20 fi-hsw-4770r total:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-ilk-650 total:241 pass:183 dwarn:4 dfail:0 fail:0 skip:54 fi-ivb-3520m total:241 pass:218 dwarn:0 dfail:0 fail:0 skip:23 fi-ivb-3770 total:241 pass:218 dwarn:0 dfail:0 fail:0 skip:23 fi-kbl-7200u total:241 pass:219 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6260u total:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hqtotal:241 pass:220 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6700k total:241 pass:219 dwarn:1 dfail:0 fail:0 skip:21 fi-skl-6770hqtotal:241 pass:227 dwarn:0 dfail:0 fail:0 skip:14 fi-snb-2520m total:241 pass:208 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:241 pass:207 dwarn:0 dfail:0 fail:0 skip:34 bbb625b5b79bdbdefd87e68e15edaa120fe70d4f drm-intel-nightly: 2016y-10m-29d-12h-45m-44s UTC integration manifest 653f434 drm/i915: Export a function to flush the context upon pinning == Logs == For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2858/ ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Export a function to flush the context upon pinning
For legacy contexts we employ an optimisation to only flush the context when binding into the global GTT. This avoids stalling onthe GPU when reloading an active context. Wrap this detail up into a helper and export it for a potential third user. (Longer term, context pinning needs to be reworked as the current handling of switch context pins too late and so risks eviction and corrupting the request. Plans, plans, plans.) Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/i915_gem_context.c | 36 +++-- drivers/gpu/drm/i915/intel_ringbuffer.c | 11 +- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index b79845911676..5267f72b5b91 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -3502,6 +3502,9 @@ int i915_gem_context_open(struct drm_device *dev, struct drm_file *file); void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); int i915_switch_context(struct drm_i915_gem_request *req); int i915_gem_switch_to_kernel_context(struct drm_i915_private *dev_priv); +struct i915_vma * +i915_gem_context_pin_legacy(struct i915_gem_context *ctx, + unsigned int flags); void i915_gem_context_free(struct kref *ctx_ref); struct drm_i915_gem_object * i915_gem_alloc_context_obj(struct drm_device *dev, size_t size); diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index d3e51d92e80a..dd226339470f 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -765,12 +765,33 @@ needs_pd_load_post(struct i915_hw_ppgtt *ppgtt, return false; } +struct i915_vma * +i915_gem_context_pin_legacy(struct i915_gem_context *ctx, + unsigned int flags) +{ + struct i915_vma *vma = ctx->engine[RCS].state; + int ret; + + /* Clear this page out of any CPU caches for coherent swap-in/out. */ + if (!(vma->flags & I915_VMA_GLOBAL_BIND)) { + ret = i915_gem_object_set_to_gtt_domain(vma->obj, false); + if (ret) + return ERR_PTR(ret); + } + + ret = i915_vma_pin(vma, 0, ctx->ggtt_alignment, PIN_GLOBAL | flags); + if (ret) + return ERR_PTR(ret); + + return vma; +} + static int do_rcs_switch(struct drm_i915_gem_request *req) { struct i915_gem_context *to = req->ctx; struct intel_engine_cs *engine = req->engine; struct i915_hw_ppgtt *ppgtt = to->ppgtt ?: req->i915->mm.aliasing_ppgtt; - struct i915_vma *vma = to->engine[RCS].state; + struct i915_vma *vma; struct i915_gem_context *from; u32 hw_flags; int ret, i; @@ -778,17 +799,10 @@ static int do_rcs_switch(struct drm_i915_gem_request *req) if (skip_rcs_switch(ppgtt, engine, to)) return 0; - /* Clear this page out of any CPU caches for coherent swap-in/out. */ - if (!(vma->flags & I915_VMA_GLOBAL_BIND)) { - ret = i915_gem_object_set_to_gtt_domain(vma->obj, false); - if (ret) - return ret; - } - /* Trying to pin first makes error handling easier. */ - ret = i915_vma_pin(vma, 0, to->ggtt_alignment, PIN_GLOBAL); - if (ret) - return ret; + vma = i915_gem_context_pin_legacy(to, 0); + if (IS_ERR(vma)) + return PTR_ERR(vma); /* * Pin can switch back to the default context if we end up calling into diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index d450d5a5326c..f91ee24e2763 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -1951,14 +1951,13 @@ static int intel_ring_context_pin(struct i915_gem_context *ctx, return 0; if (ce->state) { - ret = i915_gem_object_set_to_gtt_domain(ce->state->obj, false); - if (ret) - goto error; + struct i915_vma *vma; - ret = i915_vma_pin(ce->state, 0, ctx->ggtt_alignment, - PIN_GLOBAL | PIN_HIGH); - if (ret) + vma = i915_gem_context_pin_legacy(ctx, PIN_HIGH); + if (IS_ERR(vma)) { + ret = PTR_ERR(vma); goto error; + } } /* The kernel context is only used as a placeholder for flushing the -- 2.10.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 2/4 v4] lib/igt_gvt: Make use of libkmod helpers and fix reading gvt parameter.
On Sun, Oct 30, 2016 at 02:47:56PM +0200, Marius Vlad wrote: > On Fri, Oct 28, 2016 at 11:08:19AM +0100, Chris Wilson wrote: > > On Fri, Oct 28, 2016 at 12:31:27PM +0300, Marius Vlad wrote: > > > Signed-off-by: Marius Vlad > > > --- > > > lib/igt_gvt.c | 42 +++--- > > > tests/gvt_basic.c | 2 +- > > > 2 files changed, 36 insertions(+), 8 deletions(-) > > > > > > diff --git a/lib/igt_gvt.c b/lib/igt_gvt.c > > > index 8bbf9bd..d868cb3 100644 > > > --- a/lib/igt_gvt.c > > > +++ b/lib/igt_gvt.c > > > @@ -24,23 +24,26 @@ > > > #include "igt.h" > > > #include "igt_gvt.h" > > > #include "igt_sysfs.h" > > > +#include "igt_kmod.h" > > > > > > +#include > > > #include > > > #include > > > #include > > > +#include > > > > > > static bool is_gvt_enabled(void) > > > { > > > FILE *file; > > > - int value; > > > + char value; > > > bool enabled = false; > > > > > > file = fopen("/sys/module/i915/parameters/enable_gvt", "r"); > > > if (!file) > > > return false; > > > > > > - if (fscanf(file, "%d", &value) == 1) > > > - enabled = value; > > > + if (fscanf(file, "%c", &value) == 1) > > > + enabled = (value == 'Y' ? true : false); > > enabled = value == 'Y'; > > else if (fscanf(file, "%d", &value) == 1) > > enabled = value; > > > > Do I see a igt_kmod_parameter_get_boolean() in the future, I think I do! > > > > > fclose(file); > > > > > > errno = 0; > > > @@ -50,9 +53,20 @@ static bool is_gvt_enabled(void) > > > static void unload_i915(void) > > > { > > > kick_fbcon(false); > > > - /* pkill alsact */ > > > > > > - igt_ignore_warn(system("/sbin/modprobe -s -r i915")); > > > + > > > + if (igt_kmod_is_loaded("i915")) { > > > + > > > + if (igt_kmod_is_loaded("snd_hda_intel")) { > > > + igt_assert(!igt_pkill(SIGTERM, "alsactl")); > > > + igt_assert(!igt_kmod_unload("snd_hda_intel", 0)); > > > + } > > > + > > > + igt_assert(!igt_kmod_unload("i915", 0)); > > > + igt_assert(!igt_kmod_unload("drm_kms_helper", 0)); > > > + igt_assert(!igt_kmod_unload("drm", 0)); > > > > But don't we already have this routine... > > No. But I guess I can add a driver_load()/driver_unload() in > lib/igt_kmod which does that, if that is what you meant. This is the same sequence as required for reloading any kms driver. However, note here we only require i915 to be reloaded, we can avoid taking further risk in reloading the drm layer. So perhaps we don't want the same code here as drv_module_reload. (Or a more complete interface that gives finer control.) > > > > For this test, we shouldn't fail if we can't setup the environment as we > > need, but skip the test. > > Right, maybe I got it wrong, but you call > igt_require(igt_gvt_load_module()) which in turn calls is_gvt_enabled(). > igt_require will skip if igt_gvt_load_module() is false. That is why I > kept like that. Besides that, I haven't checked what happens when the > modules are built-in, so the assert might fail in that case. The asserts are indeed testing something unrelated to the test, only the setup of its environment. If we can't set up the environment for the test, we skip. -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
Re: [Intel-gfx] [PATCH i-g-t 2/4 v4] lib/igt_gvt: Make use of libkmod helpers and fix reading gvt parameter.
On Fri, Oct 28, 2016 at 11:08:19AM +0100, Chris Wilson wrote: > On Fri, Oct 28, 2016 at 12:31:27PM +0300, Marius Vlad wrote: > > Signed-off-by: Marius Vlad > > --- > > lib/igt_gvt.c | 42 +++--- > > tests/gvt_basic.c | 2 +- > > 2 files changed, 36 insertions(+), 8 deletions(-) > > > > diff --git a/lib/igt_gvt.c b/lib/igt_gvt.c > > index 8bbf9bd..d868cb3 100644 > > --- a/lib/igt_gvt.c > > +++ b/lib/igt_gvt.c > > @@ -24,23 +24,26 @@ > > #include "igt.h" > > #include "igt_gvt.h" > > #include "igt_sysfs.h" > > +#include "igt_kmod.h" > > > > +#include > > #include > > #include > > #include > > +#include > > > > static bool is_gvt_enabled(void) > > { > > FILE *file; > > - int value; > > + char value; > > bool enabled = false; > > > > file = fopen("/sys/module/i915/parameters/enable_gvt", "r"); > > if (!file) > > return false; > > > > - if (fscanf(file, "%d", &value) == 1) > > - enabled = value; > > + if (fscanf(file, "%c", &value) == 1) > > + enabled = (value == 'Y' ? true : false); > enabled = value == 'Y'; > else if (fscanf(file, "%d", &value) == 1) > enabled = value; > > Do I see a igt_kmod_parameter_get_boolean() in the future, I think I do! > > > fclose(file); > > > > errno = 0; > > @@ -50,9 +53,20 @@ static bool is_gvt_enabled(void) > > static void unload_i915(void) > > { > > kick_fbcon(false); > > - /* pkill alsact */ > > > > - igt_ignore_warn(system("/sbin/modprobe -s -r i915")); > > + > > + if (igt_kmod_is_loaded("i915")) { > > + > > + if (igt_kmod_is_loaded("snd_hda_intel")) { > > + igt_assert(!igt_pkill(SIGTERM, "alsactl")); > > + igt_assert(!igt_kmod_unload("snd_hda_intel", 0)); > > + } > > + > > + igt_assert(!igt_kmod_unload("i915", 0)); > > + igt_assert(!igt_kmod_unload("drm_kms_helper", 0)); > > + igt_assert(!igt_kmod_unload("drm", 0)); > > But don't we already have this routine... No. But I guess I can add a driver_load()/driver_unload() in lib/igt_kmod which does that, if that is what you meant. > > For this test, we shouldn't fail if we can't setup the environment as we > need, but skip the test. Right, maybe I got it wrong, but you call igt_require(igt_gvt_load_module()) which in turn calls is_gvt_enabled(). igt_require will skip if igt_gvt_load_module() is false. That is why I kept like that. Besides that, I haven't checked what happens when the modules are built-in, so the assert might fail in that case. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre signature.asc Description: PGP signature ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 4/4 v4] tests/kms_sysfs_edid_timing: Convert sh to C version.
On Fri, Oct 28, 2016 at 11:03:44AM +0100, Chris Wilson wrote: > On Fri, Oct 28, 2016 at 12:31:29PM +0300, Marius Vlad wrote: > > v2: > > - don't read cached values (Chris Wilson) > > - warn on per connector, and fail per mean (Chris Wilson) > > > > These are synthetic: 5us per connector, and 600us for all (as > > threshold). > > > > Signed-off-by: Marius Vlad > > --- > > tests/Makefile.sources| 2 +- > > tests/kms_sysfs_edid_timing | 25 -- > > tests/kms_sysfs_edid_timing.c | 107 > > ++ > > 3 files changed, 108 insertions(+), 26 deletions(-) > > delete mode 100755 tests/kms_sysfs_edid_timing > > create mode 100644 tests/kms_sysfs_edid_timing.c > > > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > > index b1511c6..8af455a 100644 > > --- a/tests/Makefile.sources > > +++ b/tests/Makefile.sources > > @@ -212,6 +212,7 @@ TESTS_progs = \ > > kms_sink_crc_basic \ > > prime_udl \ > > drv_module_reload \ > > + kms_sysfs_edid_timing \ > > $(NULL) > > > > # IMPORTANT: The ZZ_ tests need to be run last! > > @@ -222,7 +223,6 @@ TESTS_scripts_M = \ > > TESTS_scripts = \ > > debugfs_emon_crash \ > > drv_debugfs_reader \ > > - kms_sysfs_edid_timing \ > > sysfs_l3_parity \ > > test_rte_check \ > > tools_test \ > > diff --git a/tests/kms_sysfs_edid_timing b/tests/kms_sysfs_edid_timing > > deleted file mode 100755 > > index 46ea540..000 > > --- a/tests/kms_sysfs_edid_timing > > +++ /dev/null > > @@ -1,25 +0,0 @@ > > -#!/bin/bash > > -# > > -# This check the time we take to read the content of all the possible > > connectors. > > -# Without the edid -ENXIO patch > > (http://permalink.gmane.org/gmane.comp.video.dri.devel/62083), > > -# we sometimes take a *really* long time. So let's just check for some > > reasonable timing here > > -# > > - > > -DRM_LIB_ALLOW_NO_MASTER=1 > > - > > -SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" > > -. $SOURCE_DIR/drm_lib.sh > > - > > -TIME1=$(date +%s%N) > > -cat $(find /sys/devices/|grep drm | grep /status) > /dev/null > > -TIME2=$(date +%s%N) > > - > > -# time in ms > > -RES=$(((TIME2 - TIME1) / 100)) > > - > > -if [ $RES -gt 600 ]; then > > - echo "Talking to outputs took ${RES}ms, something is wrong" > > - exit $IGT_EXIT_FAILURE > > -fi > > - > > -exit $IGT_EXIT_SUCCESS > > diff --git a/tests/kms_sysfs_edid_timing.c b/tests/kms_sysfs_edid_timing.c > > new file mode 100644 > > index 000..3b8bca0 > > --- /dev/null > > +++ b/tests/kms_sysfs_edid_timing.c > > @@ -0,0 +1,107 @@ > > +/* > > + * Copyright © 2016 Intel Corporation > > + * > > + * Permission is hereby granted, free of charge, to any person obtaining a > > + * copy of this software and associated documentation files (the > > "Software"), > > + * to deal in the Software without restriction, including without > > limitation > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > > + * and/or sell copies of the Software, and to permit persons to whom the > > + * Software is furnished to do so, subject to the following conditions: > > + * > > + * The above copyright notice and this permission notice (including the > > next > > + * paragraph) shall be included in all copies or substantial portions of > > the > > + * Software. > > + * > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > > OR > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > > OTHER > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > > DEALINGS > > + * IN THE SOFTWARE. > > + */ > > +#include "igt.h" > > +#include "igt_debugfs.h" > > +#include "igt_sysfs.h" > > +#include "igt_core.h" > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#define USEC_PER_SEC (1000*1000) > > +#define THRESHOLD_PER_CONNECTOR5 > > +#define THRESHOLD_TOTAL600 > > + > > +IGT_TEST_DESCRIPTION("This check the time we take to read the content of > > all " > > +"the possible connectors. Without the edid -ENXIO patch " > > + > > "(http://permalink.gmane.org/gmane.comp.video.dri.devel/62083), " > > +"we sometimes take a *really* long time. " > > +"So let's just check for some reasonable timing here"); > > + > > +static uint64_t > > +mean(uint64_t *a, size_t a_len) > > +{ > > + int p; > > + uint64_t __sum; > > + > > + for (p = 0, __sum = 0; p < a_len; p++) { > > + __sum += a[p]; > > + } > > + > > + return (__sum / a_len); > > +} > > See igt_stats.h: igt_mean Alright will use that. > > > +igt_simple_main > > +{ > > + int dir = igt_sysfs_open(-1, NULL); > > Hmm, t
Re: [Intel-gfx] [PATCH i-g-t 3/4 v4] tests/drv_module_reload: Convert sh script to C version.
On Fri, Oct 28, 2016 at 10:48:33AM +0100, Chris Wilson wrote: > On Fri, Oct 28, 2016 at 12:31:28PM +0300, Marius Vlad wrote: > > + igt_subtest_group { > > + int fd; > > + > > + igt_fixture > > + fd = __drm_open_driver(DRIVER_INTEL); > > + > > + igt_subtest_group { > > + igt_subtest("basic-gem-info") > > + if ((err = gem_info(fd))) > > + igt_fail(err); > > + igt_subtest_group > > + if ((err = gem_exec_store(fd))) > > + igt_fail(err); > > This is a misinterpretation of the existing test. These are not > subtests, but a sanity check that reload() works. A call to > gem_exec_store() can just whither away, it doesn't reveal much about the > general sanity of the driver, but a quick call to an ioctl such as > gem_info() is enough to be sure the driver is there (i.e. the module load > worked as adverticed) and not hung upon load. Indeed, that's exactly what they are: sanity check that reloading of the driver works, just that grouping them as subtests/subgroups made embedding them easier and I thought that worked better given igt is centered around tests/subtests (gem_exec_store has a igt_skip_on_f() thus the subgroup) I guess that I can call them directly in "basic-reload" subtest. If either gem_info and gem_exec_store failed than reloading failed. Is that a reasonable approach and it is OK with you? > > One more thing about gem_info(), to be used in process it needs to be > something like: > > /* Check the driver load completed by seeing if it responds to an ioctl > * correctly. We pick an ioctl that calls i915_mutex_interruptible() > * first (before failing on the invalid arg) so that we can inspect its > * driver error detection (-EIO if already wedged, or -EINTR if stuck). > */ > void i915_gem_sanitycheck(void) > { > struct set_cacheing arg = {}; > int fd, err; > > fd = __drm_driver_open(DRIVER_INTEL); > igt_set_timeout(1, "module reload failed"); > > err = 0; > if (ioctl(fd, SET_CACHEING, &arg)) > err = -errno; > > igt_set_timeout(0, NULL); > close(fd); > > igt_assert_eq(err, -ENOENT); > > } Alright will do. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre signature.asc Description: PGP signature ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx