public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Joe Konno <joe.konno@linux.intel.com>
Subject: Re: [PATCH] drm/i915: Redo WMs when cursor size changes
Date: Fri, 27 Feb 2015 15:53:10 +0100	[thread overview]
Message-ID: <20150227145309.GK24485@phenom.ffwll.local> (raw)
In-Reply-To: <20150227014735.GB18481@intel.com>

On Thu, Feb 26, 2015 at 05:47:35PM -0800, Matt Roper wrote:
> On Thu, Feb 26, 2015 at 02:48:44PM -0800, Joe Konno wrote:
> > From: Joe Konno <joe.konno@intel.com>
> > 
> > In instances where cursor sizes change, as in Chromium Ozone/Freon,
> > watermarks should be recomputed. There should be no hard-coded
> > assumptions about cursor widths. This was corrected originally here:
> > 
> >     commit 64f962e3e38bf6f40bbd2462f8380dee0369e1bf
> >     Author: Chris Wilson <chris@chris-wilson.co.uk>
> >     Date:   Wed Mar 26 12:38:15 2014 +0000
> > 
> >         drm/i915: Recompute WM when the cursor size changes
> > 
> > However, it seems the recompute logic got lost in refactoring.
> > Re-introduce the relevant WM re-compute code from the original patch.
> 
> I don't believe the recompute logic got lost, it just got moved around a
> bit so that it wouldn't happen during our time-sensitive vblank evasion
> while interrupts are disabled.  The old_width != intel_crtc->cursor_width
> check that you're re-adding below already happens in
> intel_check_cursor_plane():
> 
>    finish: 
>            if (intel_crtc->active) {
>                    if (intel_crtc->cursor_width != state->base.crtc_w)
>                            intel_crtc->atomic.update_wm = true;
> 
> We just set a flag so that we know whether we'll need to update
> watermarks later or not.  Then when we get to the commit phase, in
> intel_begin_crtc_commit(), we do the following before entering vblank
> evasion:
> 
>         if (intel_crtc->atomic.update_wm)
>                 intel_update_watermarks(crtc);
> 
> Some of the watermark code we have today sleeps, so we can't call it
> under vblank evasion (i.e., during the commit phase while interrupts are
> disabled).
> 
> Our high-level atomic workflow (which legacy plane ioctls also flow
> through internally) looks something like this:
> 
>  - Some userspace ioctl (SetCursor, SetPlane, etc.)
>       - intel_check_TYPE_plane()
>             - check validity of request, bail if invalid
>             - set flags in intel_crtc->atomic for various stuff we will
>               need to do before/after vblank evasion (e.g., wm's)
>       - intel_begin_crtc_commit()
>             - Perform sleepable operations noted in intel_crtc->atomic
>             - intel_pipe_update_start (interrupts are now disabled!)
>       - intel_commit_TYPE_plane()
>       - intel_finish_crtc_commit()
>             - intel_pipe_update_end (interrupts are now reenabled)
>             - Perform sleepable operations noted in intel_crtc->atomic
> 
> So your patch below could result in sleeps happening while vblanks are
> disabled, which is bad (IIRC, most of those sleeps are in the SKL
> codepath right now, but I think there's a workaround-related wait for
> IVB as well).
> 
> Our watermark code needs a lot of work to beat it into proper shape for
> atomic and that's what I'm working on at the moment.

Alternative issue is that wm recompute happens before we update all the
legacy state. Tvrkto just stumbled over that for some of his skl watermark
code, he had to switch a few places in the wm code from looking at
plane->fb to look at plane->state->fb.

Similar changes might be needed for the cursor wm code -
cursor_width/height is kinda redundant since universal planes support.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-02-27 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 22:48 [PATCH] drm/i915: Redo WMs when cursor size changes Joe Konno
2015-02-27  1:14 ` Ausmus, James
2015-02-27  1:47 ` Matt Roper
2015-02-27 14:53   ` Daniel Vetter [this message]
2015-02-27 16:21     ` Joe Konno
2015-02-27 16:24       ` Matt Roper

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=20150227145309.GK24485@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joe.konno@linux.intel.com \
    --cc=matthew.d.roper@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