* [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
@ 2018-02-08 8:55 Maarten Lankhorst
2018-02-08 9:05 ` Chris Wilson
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Maarten Lankhorst @ 2018-02-08 8:55 UTC (permalink / raw)
To: intel-gfx
References: https://bugs.freedesktop.org/show_bug.cgi?id=104975
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/i915_reg.h | 3 +++
drivers/gpu/drm/i915/intel_display.c | 1 +
drivers/gpu/drm/i915/intel_sprite.c | 16 ++++++++++++++++
4 files changed, 22 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d5e695da2fc4..11251e0107f4 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1967,6 +1967,8 @@ struct drm_i915_private {
/* Display functions */
struct drm_i915_display_funcs display;
+ spinlock_t display_evasion_lock;
+
/* PCH chipset type */
enum intel_pch pch_type;
unsigned short pch_id;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 93f6ec2ea8f2..20af56644844 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6594,6 +6594,9 @@ enum {
#define DIGITAL_PORTA_HOTPLUG_SHORT_DETECT (1 << 0)
#define DIGITAL_PORTA_HOTPLUG_LONG_DETECT (2 << 0)
+#define DOUBLE_BUFFER_CTL _MMIO(0x44500)
+#define DOUBLE_BUFFER_CTL_GLOBAL_DISABLE (1 << 0)
+
/* refresh rate hardware control */
#define RR_HW_CTL _MMIO(0x45300)
#define RR_HW_LOW_POWER_FRAMES_MASK 0xff
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 707406d1bf57..81087722bc49 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14476,6 +14476,7 @@ int intel_modeset_init(struct drm_device *dev)
dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
drm_mode_config_init(dev);
+ spin_lock_init(&dev_priv->display_evasion_lock);
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index ac0a4f9c1954..4d1e9b166d57 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -98,6 +98,13 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
intel_crtc_has_type(new_crtc_state, INTEL_OUTPUT_DSI);
DEFINE_WAIT(wait);
+ if (INTEL_GEN(dev_priv) >= 9) {
+ spin_lock_irq(&dev_priv->display_evasion_lock);
+ I915_WRITE(DOUBLE_BUFFER_CTL, DOUBLE_BUFFER_CTL_GLOBAL_DISABLE);
+ scanline = intel_get_crtc_scanline(crtc);
+ goto done;
+ }
+
vblank_start = adjusted_mode->crtc_vblank_start;
if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
vblank_start = DIV_ROUND_UP(vblank_start, 2);
@@ -166,6 +173,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
while (need_vlv_dsi_wa && scanline == vblank_start)
scanline = intel_get_crtc_scanline(crtc);
+done:
crtc->debug.scanline_start = scanline;
crtc->debug.start_vbl_time = ktime_get();
crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
@@ -192,6 +200,9 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end);
+ if (INTEL_GEN(dev_priv) >= 9)
+ I915_WRITE(DOUBLE_BUFFER_CTL, 0);
+
/* We're still in the vblank-evade critical section, this can't race.
* Would be slightly nice to just grab the vblank count and arm the
* event outside of the critical section - the spinlock might spin for a
@@ -206,6 +217,11 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
new_crtc_state->base.event = NULL;
}
+ if (INTEL_GEN(dev_priv) >= 9) {
+ spin_unlock_irq(&dev_priv->display_evasion_lock);
+ return;
+ }
+
local_irq_enable();
if (intel_vgpu_active(dev_priv))
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
2018-02-08 8:55 [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+ Maarten Lankhorst
@ 2018-02-08 9:05 ` Chris Wilson
2018-02-08 9:46 ` ✓ Fi.CI.BAT: success for " Patchwork
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-02-08 9:05 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
Quoting Maarten Lankhorst (2018-02-08 08:55:38)
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104975
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 707406d1bf57..81087722bc49 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14476,6 +14476,7 @@ int intel_modeset_init(struct drm_device *dev)
> dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
Noticed in passing, no error handling for a failed kmalloc here.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
2018-02-08 8:55 [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+ Maarten Lankhorst
2018-02-08 9:05 ` Chris Wilson
@ 2018-02-08 9:46 ` Patchwork
2018-02-08 14:01 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-08 18:27 ` [RFC] " Ville Syrjälä
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-08 9:46 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
URL : https://patchwork.freedesktop.org/series/37879/
State : success
== Summary ==
Series 37879v1 drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
https://patchwork.freedesktop.org/api/1.0/series/37879/revisions/1/mbox/
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass -> FAIL (fi-gdg-551) fdo#102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
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:415s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:423s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:374s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:492s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:285s
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:487s
fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:468s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:457s
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:573s
fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:578s
fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:285s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:513s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:390s
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:458s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:417s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:455s
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:450s
fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:499s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:600s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:427s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:503s
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:483s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:471s
fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:415s
fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:427s
fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:523s
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:392s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:471s
ede4b1ac40b2c32511532ddb6849b11c0183020e drm-tip: 2018y-02m-08d-07h-43m-06s UTC integration manifest
0438ef524341 drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7941/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
2018-02-08 8:55 [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+ Maarten Lankhorst
2018-02-08 9:05 ` Chris Wilson
2018-02-08 9:46 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-02-08 14:01 ` Patchwork
2018-02-08 18:27 ` [RFC] " Ville Syrjälä
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-08 14:01 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
URL : https://patchwork.freedesktop.org/series/37879/
State : success
== Summary ==
Test gem_exec_suspend:
Subgroup basic-s4:
fail -> SKIP (shard-hsw) fdo#103375
Test kms_flip:
Subgroup flip-vs-panning-vs-hang-interruptible:
dmesg-warn -> PASS (shard-snb) fdo#103821
Subgroup plain-flip-fb-recreate-interruptible:
fail -> PASS (shard-hsw) fdo#100368
Subgroup blocking-wf_vblank:
fail -> PASS (shard-hsw) fdo#103928
Test kms_cursor_crc:
Subgroup cursor-64x64-suspend:
skip -> FAIL (shard-snb) fdo#102365
Test kms_plane_lowres:
Subgroup pipe-b-tiling-y:
pass -> FAIL (shard-apl) fdo#103166
Test kms_cursor_legacy:
Subgroup 2x-long-flip-vs-cursor-legacy:
pass -> FAIL (shard-hsw) fdo#104873
Subgroup cursor-vs-flip-legacy:
pass -> FAIL (shard-apl) fdo#103355
Test kms_rotation_crc:
Subgroup sprite-rotation-90-flip:
pass -> FAIL (shard-apl) fdo#103356
Test drv_selftest:
Subgroup live_gtt:
pass -> INCOMPLETE (shard-apl) fdo#103927
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103356 https://bugs.freedesktop.org/show_bug.cgi?id=103356
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
shard-apl total:3332 pass:1713 dwarn:1 dfail:0 fail:22 skip:1594 time:11947s
shard-hsw total:3444 pass:1760 dwarn:1 dfail:0 fail:10 skip:1672 time:11834s
shard-snb total:3444 pass:1350 dwarn:1 dfail:0 fail:11 skip:2082 time:6572s
Blacklisted hosts:
shard-kbl total:3380 pass:1855 dwarn:21 dfail:0 fail:20 skip:1483 time:9492s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7941/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
2018-02-08 8:55 [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+ Maarten Lankhorst
` (2 preceding siblings ...)
2018-02-08 14:01 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-02-08 18:27 ` Ville Syrjälä
2018-02-09 9:05 ` Maarten Lankhorst
3 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2018-02-08 18:27 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Thu, Feb 08, 2018 at 09:55:38AM +0100, Maarten Lankhorst wrote:
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104975
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 2 ++
> drivers/gpu/drm/i915/i915_reg.h | 3 +++
> drivers/gpu/drm/i915/intel_display.c | 1 +
> drivers/gpu/drm/i915/intel_sprite.c | 16 ++++++++++++++++
> 4 files changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index d5e695da2fc4..11251e0107f4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1967,6 +1967,8 @@ struct drm_i915_private {
> /* Display functions */
> struct drm_i915_display_funcs display;
>
> + spinlock_t display_evasion_lock;
> +
> /* PCH chipset type */
> enum intel_pch pch_type;
> unsigned short pch_id;
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 93f6ec2ea8f2..20af56644844 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -6594,6 +6594,9 @@ enum {
> #define DIGITAL_PORTA_HOTPLUG_SHORT_DETECT (1 << 0)
> #define DIGITAL_PORTA_HOTPLUG_LONG_DETECT (2 << 0)
>
> +#define DOUBLE_BUFFER_CTL _MMIO(0x44500)
> +#define DOUBLE_BUFFER_CTL_GLOBAL_DISABLE (1 << 0)
> +
> /* refresh rate hardware control */
> #define RR_HW_CTL _MMIO(0x45300)
> #define RR_HW_LOW_POWER_FRAMES_MASK 0xff
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 707406d1bf57..81087722bc49 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14476,6 +14476,7 @@ int intel_modeset_init(struct drm_device *dev)
> dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
>
> drm_mode_config_init(dev);
> + spin_lock_init(&dev_priv->display_evasion_lock);
>
> dev->mode_config.min_width = 0;
> dev->mode_config.min_height = 0;
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index ac0a4f9c1954..4d1e9b166d57 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -98,6 +98,13 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
> intel_crtc_has_type(new_crtc_state, INTEL_OUTPUT_DSI);
> DEFINE_WAIT(wait);
>
> + if (INTEL_GEN(dev_priv) >= 9) {
> + spin_lock_irq(&dev_priv->display_evasion_lock);
> + I915_WRITE(DOUBLE_BUFFER_CTL, DOUBLE_BUFFER_CTL_GLOBAL_DISABLE);
> + scanline = intel_get_crtc_scanline(crtc);
> + goto done;
> + }
I think we still want to do the vblank evasion. It gives us more accurate
infromation on which frame the operation will complete. If we don't do
it we may end up signalling the completion one frame late. Although I
suppose it doesn't matter too much from the user POV since in each case
we'd end up dropping a frame. Maybe for av sync etc. it might matter
in some cases.
It would become even more important if we allowed flips to be overridden
because then we'd really need to know whether the previous flip happened
at all or not (so that we could signal fences and whatnot correctly to
keep userspace informed on which framebuffer is actually being scanned
out). And we might end up holding the lock across every vblank start,
thus preventing the display from updating at all.
So I think we should use DOUBLE_BUFFER_CTL just make missing the
deadline bit less dangerous in the presence of fragile hardware. I do
think we should still try to optimize plane/pipe updates more to reduce
the chances of that happening in general.
Also IIRC there are some "(dis)allow double buffer disable" bits in various
hardware blocks which have to set correctly for this to work. Did you check
whether we're setting them appropriately?
> +
> vblank_start = adjusted_mode->crtc_vblank_start;
> if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
> vblank_start = DIV_ROUND_UP(vblank_start, 2);
> @@ -166,6 +173,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
> while (need_vlv_dsi_wa && scanline == vblank_start)
> scanline = intel_get_crtc_scanline(crtc);
>
> +done:
> crtc->debug.scanline_start = scanline;
> crtc->debug.start_vbl_time = ktime_get();
> crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
> @@ -192,6 +200,9 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
>
> trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end);
>
> + if (INTEL_GEN(dev_priv) >= 9)
> + I915_WRITE(DOUBLE_BUFFER_CTL, 0);
> +
> /* We're still in the vblank-evade critical section, this can't race.
> * Would be slightly nice to just grab the vblank count and arm the
> * event outside of the critical section - the spinlock might spin for a
> @@ -206,6 +217,11 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
> new_crtc_state->base.event = NULL;
> }
>
> + if (INTEL_GEN(dev_priv) >= 9) {
> + spin_unlock_irq(&dev_priv->display_evasion_lock);
> + return;
> + }
> +
> local_irq_enable();
>
> if (intel_vgpu_active(dev_priv))
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+.
2018-02-08 18:27 ` [RFC] " Ville Syrjälä
@ 2018-02-09 9:05 ` Maarten Lankhorst
0 siblings, 0 replies; 6+ messages in thread
From: Maarten Lankhorst @ 2018-02-09 9:05 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
Op 08-02-18 om 19:27 schreef Ville Syrjälä:
> On Thu, Feb 08, 2018 at 09:55:38AM +0100, Maarten Lankhorst wrote:
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=104975
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_drv.h | 2 ++
>> drivers/gpu/drm/i915/i915_reg.h | 3 +++
>> drivers/gpu/drm/i915/intel_display.c | 1 +
>> drivers/gpu/drm/i915/intel_sprite.c | 16 ++++++++++++++++
>> 4 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index d5e695da2fc4..11251e0107f4 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -1967,6 +1967,8 @@ struct drm_i915_private {
>> /* Display functions */
>> struct drm_i915_display_funcs display;
>>
>> + spinlock_t display_evasion_lock;
>> +
>> /* PCH chipset type */
>> enum intel_pch pch_type;
>> unsigned short pch_id;
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>> index 93f6ec2ea8f2..20af56644844 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -6594,6 +6594,9 @@ enum {
>> #define DIGITAL_PORTA_HOTPLUG_SHORT_DETECT (1 << 0)
>> #define DIGITAL_PORTA_HOTPLUG_LONG_DETECT (2 << 0)
>>
>> +#define DOUBLE_BUFFER_CTL _MMIO(0x44500)
>> +#define DOUBLE_BUFFER_CTL_GLOBAL_DISABLE (1 << 0)
>> +
>> /* refresh rate hardware control */
>> #define RR_HW_CTL _MMIO(0x45300)
>> #define RR_HW_LOW_POWER_FRAMES_MASK 0xff
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 707406d1bf57..81087722bc49 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -14476,6 +14476,7 @@ int intel_modeset_init(struct drm_device *dev)
>> dev_priv->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
>>
>> drm_mode_config_init(dev);
>> + spin_lock_init(&dev_priv->display_evasion_lock);
>>
>> dev->mode_config.min_width = 0;
>> dev->mode_config.min_height = 0;
>> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
>> index ac0a4f9c1954..4d1e9b166d57 100644
>> --- a/drivers/gpu/drm/i915/intel_sprite.c
>> +++ b/drivers/gpu/drm/i915/intel_sprite.c
>> @@ -98,6 +98,13 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
>> intel_crtc_has_type(new_crtc_state, INTEL_OUTPUT_DSI);
>> DEFINE_WAIT(wait);
>>
>> + if (INTEL_GEN(dev_priv) >= 9) {
>> + spin_lock_irq(&dev_priv->display_evasion_lock);
>> + I915_WRITE(DOUBLE_BUFFER_CTL, DOUBLE_BUFFER_CTL_GLOBAL_DISABLE);
>> + scanline = intel_get_crtc_scanline(crtc);
>> + goto done;
>> + }
> I think we still want to do the vblank evasion. It gives us more accurate
> infromation on which frame the operation will complete. If we don't do
> it we may end up signalling the completion one frame late. Although I
> suppose it doesn't matter too much from the user POV since in each case
> we'd end up dropping a frame. Maybe for av sync etc. it might matter
> in some cases.
>
> It would become even more important if we allowed flips to be overridden
> because then we'd really need to know whether the previous flip happened
> at all or not (so that we could signal fences and whatnot correctly to
> keep userspace informed on which framebuffer is actually being scanned
> out). And we might end up holding the lock across every vblank start,
> thus preventing the display from updating at all.
>
> So I think we should use DOUBLE_BUFFER_CTL just make missing the
> deadline bit less dangerous in the presence of fragile hardware. I do
> think we should still try to optimize plane/pipe updates more to reduce
> the chances of that happening in general.
>
> Also IIRC there are some "(dis)allow double buffer disable" bits in various
> hardware blocks which have to set correctly for this to work. Did you check
> whether we're setting them appropriately?
The global switch doesn't mention this at least. It only mentions that
async MMIO and command flips are not affected.
~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-09 9:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 8:55 [RFC] drm/i915: Use DOUBLE_BUFFER_CTL instead of vblank evasion for GEN9+ Maarten Lankhorst
2018-02-08 9:05 ` Chris Wilson
2018-02-08 9:46 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-08 14:01 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-08 18:27 ` [RFC] " Ville Syrjälä
2018-02-09 9:05 ` Maarten Lankhorst
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.