From: Gustavo Padovan <gustavo@padovan.org>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Stone <daniels@collabora.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH v3 06/11] drm/i915: split intel_crtc_page_flip() into check() and commit()
Date: Wed, 24 Sep 2014 14:20:27 -0300 [thread overview]
Message-ID: <1411579232-8668-6-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1411579232-8668-1-git-send-email-gustavo@padovan.org>
From: Daniel Stone <daniels@collabora.com>
Start the work of splitting the intel_crtc_page_flip() for later use
by the atomic modesetting API.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
drivers/gpu/drm/i915/intel_display.c | 51 ++++++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a583abd..3cb092c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9641,23 +9641,11 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
spin_unlock(&dev->event_lock);
}
-static int intel_crtc_page_flip(struct drm_crtc *crtc,
- struct drm_framebuffer *fb,
- struct drm_pending_vblank_event *event,
- uint32_t page_flip_flags)
+static int intel_crtc_check_page_flip(struct drm_crtc *crtc,
+ struct drm_framebuffer *fb)
{
struct drm_device *dev = crtc->dev;
- struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_framebuffer *old_fb = crtc->primary->fb;
- struct drm_i915_gem_object *obj = intel_fb_obj(fb);
- struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
- enum pipe pipe = intel_crtc->pipe;
- struct intel_unpin_work *work;
- struct intel_engine_cs *ring;
- int ret;
-
- //trigger software GT busyness calculation
- gen8_flip_interrupt(dev);
/*
* drm_mode_page_flip_ioctl() should already catch this, but double
@@ -9680,6 +9668,27 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
fb->pitches[0] != crtc->primary->fb->pitches[0]))
return -EINVAL;
+ return 0;
+}
+
+static int intel_crtc_commit_page_flip(struct drm_crtc *crtc,
+ struct drm_framebuffer *fb,
+ struct drm_pending_vblank_event *event,
+ uint32_t page_flip_flags)
+{
+ struct drm_device *dev = crtc->dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_framebuffer *old_fb = crtc->primary->fb;
+ struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+ enum pipe pipe = intel_crtc->pipe;
+ struct intel_unpin_work *work;
+ struct intel_engine_cs *ring;
+ int ret;
+
+ /* trigger software GT busyness calculation */
+ gen8_flip_interrupt(dev);
+
if (i915_terminally_wedged(&dev_priv->gpu_error))
goto out_hang;
@@ -9823,6 +9832,20 @@ out_hang:
return ret;
}
+static int intel_crtc_page_flip(struct drm_crtc *crtc,
+ struct drm_framebuffer *fb,
+ struct drm_pending_vblank_event *event,
+ uint32_t page_flip_flags)
+{
+ int ret;
+
+ ret = intel_crtc_check_page_flip(crtc, fb);
+ if (ret)
+ return ret;
+
+ return intel_crtc_commit_page_flip(crtc, fb, event, page_flip_flags);
+}
+
static struct drm_crtc_helper_funcs intel_helper_funcs = {
.mode_set_base_atomic = intel_pipe_set_base_atomic,
.load_lut = intel_crtc_load_lut,
--
1.9.3
next prev parent reply other threads:[~2014-09-24 17:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 17:20 [PATCH v3 01/11] drm/i915: Merge of visible and !visible paths for primary planes Gustavo Padovan
2014-09-24 17:20 ` [PATCH v3 02/11] drm/i915: remove leftover from pre-universal planes days Gustavo Padovan
2014-09-24 17:20 ` [PATCH v3 03/11] drm/i915: Fix not checking cursor and object sizes Gustavo Padovan
2014-09-24 17:20 ` [PATCH v3 04/11] drm/i915: move check of intel_crtc_cursor_set_obj() out Gustavo Padovan
2014-10-07 14:47 ` Ville Syrjälä
2014-10-07 15:01 ` Ville Syrjälä
2014-10-08 9:03 ` [Intel-gfx] " Daniel Vetter
2014-09-24 17:20 ` [PATCH v3 05/11] drm/i915: remove intel_crtc_cursor_set_obj() Gustavo Padovan
2014-10-07 14:59 ` Ville Syrjälä
2014-10-24 13:23 ` Gustavo Padovan
2014-10-24 14:35 ` Ville Syrjälä
2014-09-24 17:20 ` Gustavo Padovan [this message]
2014-10-07 15:44 ` [PATCH v3 06/11] drm/i915: split intel_crtc_page_flip() into check() and commit() Ville Syrjälä
2014-09-24 17:20 ` [PATCH v3 07/11] drm: add helper to get crtc timings Gustavo Padovan
2014-10-07 15:21 ` Ville Syrjälä
2014-09-24 17:20 ` [PATCH v3 08/11] drm/i915: create a prepare step for primary planes updates Gustavo Padovan
2014-09-24 17:20 ` [PATCH v3 09/11] drm/i915: create a prepare phase for sprite plane updates Gustavo Padovan
2014-10-07 15:51 ` Ville Syrjälä
2014-09-24 17:20 ` [PATCH v3 10/11] drm/i915: use intel_fb_obj() macros to assign gem objects Gustavo Padovan
2014-10-07 15:52 ` [Intel-gfx] " Ville Syrjälä
2014-09-24 17:20 ` [PATCH v3 11/11] drm/i915: remove intel_pipe_set_base() Gustavo Padovan
2014-10-07 16:27 ` Ville Syrjälä
2014-10-24 13:59 ` Gustavo Padovan
2014-10-24 14:17 ` Ville Syrjälä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411579232-8668-6-git-send-email-gustavo@padovan.org \
--to=gustavo@padovan.org \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).