intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Make fb user dirty operation to invalidate frontbuffer
@ 2015-06-30 23:42 Rodrigo Vivi
  2015-06-30 23:42 ` [PATCH 2/3] drm/i915: PSR: Remove Low Power HW tracking mask Rodrigo Vivi
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Rodrigo Vivi @ 2015-06-30 23:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Rodrigo Vivi

Let's do a frontbuffer invalidation on dirty fb.
To be used for DIRTYFB drm ioctl.

This patch solves the biggest PSR known issue, that is
missed screen updates during boot, mainly when there is a splash
screen involved like plymouth.

Plymoth will do a modeset over ioctl that flushes frontbuffer
tracking and PSR gets back to work while it cannot track the
screen updates and exit properly. However plymouth also uses
a dirtyfb ioctl whenever updating the screen. So let's use it
to invalidate PSR back again.

v2: Remove ORIGIN_FB_DIRTY and use ORIGIN_GTT instead since dirty
    callback is just called after few screen updates and not on
    everyone as pointed by Daniel.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 724b0e3..b55b1b6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14393,9 +14393,27 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
 	return drm_gem_handle_create(file, &obj->base, handle);
 }
 
+static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
+					       struct drm_file *file,
+					       unsigned flags, unsigned color,
+					       struct drm_clip_rect *clips,
+					       unsigned num_clips)
+{
+	struct drm_device *dev = fb->dev;
+	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
+	struct drm_i915_gem_object *obj = intel_fb->obj;
+
+	mutex_lock(&dev->struct_mutex);
+	intel_fb_obj_invalidate(obj, ORIGIN_GTT);
+	mutex_unlock(&dev->struct_mutex);
+
+	return 0;
+}
+
 static const struct drm_framebuffer_funcs intel_fb_funcs = {
 	.destroy = intel_user_framebuffer_destroy,
 	.create_handle = intel_user_framebuffer_create_handle,
+	.dirty = intel_user_framebuffer_dirty,
 };
 
 static
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [PATCH 1/3] drm/i915: PSR also doesn't have link_entry_time on SKL.
@ 2015-12-10 16:28 Rodrigo Vivi
  2015-12-10 16:28 ` [PATCH 3/3] drm/i915: Enable PSR by default Rodrigo Vivi
  0 siblings, 1 reply; 21+ messages in thread
From: Rodrigo Vivi @ 2015-12-10 16:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi

This bit is also reserved on Skylake. Actually the only
platform that supports this is Haswell, so let's fix
this logic and apply this link entry time only for the
platform that supports it, i.e. Haswell.

This also changes the style to let more clear platform
differences outside the reg write. We would probably catch
this case sooner if separated, or not...

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 14cc2cf..9ccff30 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -276,10 +276,11 @@ static void hsw_psr_enable_source(struct intel_dp *intel_dp)
 	 */
 	uint32_t idle_frames = max(6, dev_priv->vbt.psr.idle_frames);
 	uint32_t val = 0x0;
-	const uint32_t link_entry_time = EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES;
+
+	if (IS_HASWELL(dev))
+		val |= EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES;
 
 	I915_WRITE(EDP_PSR_CTL, val |
-		   (IS_BROADWELL(dev) ? 0 : link_entry_time) |
 		   max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT |
 		   idle_frames << EDP_PSR_IDLE_FRAME_SHIFT |
 		   EDP_PSR_ENABLE);
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-12-11  0:28 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 23:42 [PATCH 1/3] drm/i915: Make fb user dirty operation to invalidate frontbuffer Rodrigo Vivi
2015-06-30 23:42 ` [PATCH 2/3] drm/i915: PSR: Remove Low Power HW tracking mask Rodrigo Vivi
2015-07-02 15:10   ` Paulo Zanoni
2015-06-30 23:42 ` [PATCH 3/3] drm/i915: Enable PSR by default Rodrigo Vivi
2015-07-02 18:58   ` shuang.he
2015-07-01  8:04 ` [PATCH 1/3] drm/i915: Make fb user dirty operation to invalidate frontbuffer Chris Wilson
2015-07-01 13:19   ` Daniel Vetter
2015-07-01 13:21     ` Chris Wilson
2015-07-01 14:09       ` Daniel Vetter
2015-07-01 14:26         ` Chris Wilson
2015-07-02 16:03 ` Paulo Zanoni
2015-07-02 16:41   ` Vivi, Rodrigo
2015-07-03  7:10     ` Daniel Vetter
2015-07-06 16:43       ` Vivi, Rodrigo
2015-07-06 17:11         ` Paulo Zanoni
2015-07-06 17:56           ` Daniel Vetter
2015-07-06 23:19             ` Vivi, Rodrigo
2015-07-07 11:24               ` Daniel Vetter
2015-07-07 20:23                 ` Vivi, Rodrigo
2015-07-08  9:05                   ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2015-12-10 16:28 [PATCH 1/3] drm/i915: PSR also doesn't have link_entry_time on SKL Rodrigo Vivi
2015-12-10 16:28 ` [PATCH 3/3] drm/i915: Enable PSR by default Rodrigo Vivi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).