From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 10/20] drm/i915: Convert suspend/resume to atomic.
Date: Tue, 7 Jul 2015 15:14:57 +0200 [thread overview]
Message-ID: <20150707131457.GR7568@phenom.ffwll.local> (raw)
In-Reply-To: <559BAAF5.5060807@linux.intel.com>
On Tue, Jul 07, 2015 at 12:33:25PM +0200, Maarten Lankhorst wrote:
> Op 07-07-15 om 11:57 schreef Daniel Vetter:
> > On Tue, Jul 07, 2015 at 09:08:21AM +0200, Maarten Lankhorst wrote:
> >> @@ -10421,10 +10414,6 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
> >> if (IS_ERR(crtc_state))
> >> goto fail;
> >>
> >> - to_intel_connector(connector)->new_encoder = NULL;
> >> - intel_encoder->new_crtc = NULL;
> >> - intel_crtc->new_enabled = false;
> > load_detect changes should be a separate patch. Or the commit message
> > needs to explain why this needs to be one.
> These members no longer exist. ;-) all the new_ stuff was to restore things pre-atomic, the atomic updates are good enough here.
>
> Making it a separate patch's probably ok.
Yeah I think splitting out the new_* removal would address most of my
concerns here.
[snip]
> >> + struct intel_connector *conn;
> >> + struct intel_plane *plane;
> >> + struct drm_crtc *crtc;
> >> + int ret;
> >>
> >> - /*
> >> - * We need to use raw interfaces for restoring state to avoid
> >> - * checking (bogus) intermediate states.
> >> - */
> >> - for_each_pipe(dev_priv, pipe) {
> >> - struct drm_crtc *crtc =
> >> - dev_priv->pipe_to_crtc_mapping[pipe];
> >> + if (!state)
> > debug output missing that the state alloc failed. Perhaps just goto fail;
> > since state_free can cope with a NULL state.
> It can only fail because of kmalloc, which prints its own warnings.
Might still be useful just to have unified error reporting - you need to
guess the caller otherwise which would make debug (if this ever happesn)
harder. But really just a bikeshed.
>
> >> + return;
> >>
> >> - intel_crtc_restore_mode(crtc);
> >> - }
> >> - } else {
> >> - intel_modeset_update_staged_output_state(dev);
> >> + state->acquire_ctx = dev->mode_config.acquire_ctx;
> >> +
> >> + /* preserve complete old state, including dpll */
> >> + intel_atomic_get_shared_dpll_state(state);
> >> +
> >> + for_each_crtc(dev, crtc) {
> >> + struct drm_crtc_state *crtc_state =
> >> + drm_atomic_get_crtc_state(state, crtc);
> >> +
> >> + ret = PTR_ERR_OR_ZERO(crtc_state);
> >> + if (ret)
> >> + goto err;
> >> +
> >> + /* force a restore */
> >> + crtc_state->mode_changed = true;
> >> + }
> >> +
> >> + for_each_intel_plane(dev, plane) {
> >> + ret = PTR_ERR_OR_ZERO(drm_atomic_get_plane_state(state, &plane->base));
> >> + if (ret)
> >> + goto err;
> >> + }
> >> +
> >> + for_each_intel_connector(dev, conn) {
> >> + ret = PTR_ERR_OR_ZERO(drm_atomic_get_connector_state(state, &conn->base));
> >> + if (ret)
> >> + goto err;
> >> }
> >>
> >> - intel_modeset_check_state(dev);
> >> + intel_modeset_setup_hw_state(dev);
> >> +
> >> + i915_redisable_vga(dev);
> > Since we've only badly bruised escape this trap I think this deserves a
> > comment:
> >
> > /*
> > * WARNING: We can't do a full atomic modeset including
> > * compute/check phase here since especially encoder
> > * compute_config functions depend upon output detection state.
> > * And that's just not yet available at driver load. Therefore we
> > * must read out the entire relevant hw state (including any
> > * driver internal state) faithfully here and only apply the
> > * commit side.
> > */
> >
> > Hm, makes me think ... should we end up calling just dev->atomic_commit(state) here
> > once atomic modeset is fully working?
> Not for initial hw readout unless you want to call detect in this function for all encoders.. resume's fine probably.
I meant calling dev->mode_config.funcs->atomic_commit(state) directly,
without calling ->atomic_check at all. That should avoid any state
recomputation (otherwise our check/commit split is botched) and hence be
exactly what we need here. I didn't check how close intel_set_mode is
compared our ->atomic_commit implementation after this series (didn't
apply them all). But I think from a semantic pov those two should match.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-07-07 13:12 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 7:08 [PATCH v2 00/20] Convert to atomic, part 4 Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 01/20] drm/atomic: add connectors_changed to separate it from mode_changed Maarten Lankhorst
2015-07-07 8:59 ` Daniel Vetter
2015-07-07 10:05 ` Maarten Lankhorst
2015-07-07 12:03 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 02/20] drm: Don't update plane properties for atomic planes if it stays the same Maarten Lankhorst
2015-07-07 9:18 ` [Intel-gfx] " Daniel Vetter
2015-07-07 10:20 ` Maarten Lankhorst
2015-07-07 12:10 ` [Intel-gfx] " Daniel Vetter
2015-07-07 14:32 ` Maarten Lankhorst
2015-07-07 16:40 ` Daniel Vetter
2015-07-07 15:08 ` Maarten Lankhorst
2015-07-07 16:43 ` Daniel Vetter
2015-07-08 8:00 ` [Intel-gfx] " Maarten Lankhorst
2015-07-08 8:55 ` Daniel Vetter
2015-07-08 16:35 ` Maarten Lankhorst
2015-07-08 17:52 ` [Intel-gfx] " Daniel Vetter
2015-07-08 18:25 ` Maarten Lankhorst
2015-07-08 20:12 ` Daniel Vetter
2015-07-13 8:59 ` Maarten Lankhorst
2015-07-13 9:13 ` [Intel-gfx] " Daniel Vetter
2015-07-13 9:23 ` Maarten Lankhorst
2015-07-13 9:45 ` Daniel Vetter
2015-07-13 9:49 ` Maarten Lankhorst
2015-07-13 10:06 ` [Intel-gfx] " Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 03/20] drm/i915: Fix noatomic crtc disabling Maarten Lankhorst
2015-07-07 9:18 ` Daniel Vetter
2015-07-07 10:22 ` Maarten Lankhorst
2015-07-07 12:39 ` Patrik Jakobsson
2015-07-07 14:14 ` Maarten Lankhorst
2015-07-08 8:12 ` Patrik Jakobsson
2015-07-08 8:50 ` Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 04/20] drm/i915: Do not update pfit state when toggling crtc enabled Maarten Lankhorst
2015-07-07 9:26 ` Daniel Vetter
2015-07-07 10:46 ` Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 05/20] drm/i915: Do not use plane_config in intel_fbdev.c Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 06/20] drm/i915: Allow fuzzy matching in pipe_config_compare Maarten Lankhorst
2015-07-07 10:11 ` Daniel Vetter
2015-07-08 8:38 ` Maarten Lankhorst
2015-07-08 9:09 ` Daniel Vetter
2015-07-08 9:18 ` Maarten Lankhorst
2015-07-08 9:33 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 07/20] drm/i915: Rework primary plane stuff slightly Maarten Lankhorst
2015-07-07 11:16 ` Daniel Vetter
2015-07-07 14:02 ` Maarten Lankhorst
2015-07-08 9:27 ` Daniel Vetter
2015-07-08 12:36 ` Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 08/20] drm/i915: fill in more mode members Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 09/20] drm/i915: Fill in more crtc state, v2 Maarten Lankhorst
2015-07-07 10:28 ` Daniel Vetter
2015-07-13 9:32 ` Maarten Lankhorst
2015-07-13 9:48 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 10/20] drm/i915: Convert suspend/resume to atomic Maarten Lankhorst
2015-07-07 9:57 ` Daniel Vetter
2015-07-07 10:33 ` Maarten Lankhorst
2015-07-07 13:14 ` Daniel Vetter [this message]
2015-07-07 13:20 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 11/20] drm/i915: Update power domains on readout Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 12/20] drm/i915: skip modeset if compatible, and enable fastboot for everyone, v2 Maarten Lankhorst
2015-07-07 10:14 ` Daniel Vetter
2015-07-07 10:34 ` Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 13/20] drm/i915: Always reset in intel_crtc_restore_mode Maarten Lankhorst
2015-07-07 10:17 ` Daniel Vetter
2015-07-07 10:48 ` Maarten Lankhorst
2015-07-07 13:16 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 14/20] drm/i915: Make intel_display_suspend atomic, try 2 Maarten Lankhorst
2015-07-07 9:48 ` Daniel Vetter
2015-07-07 10:50 ` Maarten Lankhorst
2015-07-07 13:21 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 15/20] drm/i915: Use full atomic modeset Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 16/20] drm/i915: Call plane update functions directly from intel_atomic_commit Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 17/20] drm/i915: always disable irqs in intel_pipe_update_start Maarten Lankhorst
2015-07-07 7:08 ` [PATCH v2 18/20] drm/i915: Only commit planes on crtc's that have changed planes Maarten Lankhorst
2015-07-07 9:33 ` Daniel Vetter
2015-07-07 10:51 ` Maarten Lankhorst
2015-07-07 13:22 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 19/20] drm/i915: Remove use of runtime pm in atomic commit functions Maarten Lankhorst
2015-07-07 10:19 ` Daniel Vetter
2015-07-07 7:08 ` [PATCH v2 20/20] drm/i915: Skip modeset checks when modeset is prevented Maarten Lankhorst
2015-07-07 13:42 ` [PATCH v2 00/20] Convert to atomic, part 4 Daniel Vetter
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=20150707131457.GR7568@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/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