dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Daniel Vetter <daniel@ffwll.ch>, Chen-Yu Tsai <wens@csie.org>,
	"open list:ARM/SHMOBILE ARM..."
	<linux-renesas-soc@vger.kernel.org>,
	"moderated list:ARM/SAMSUNG EXYNO..."
	<linux-samsung-soc@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending
Date: Thu, 20 Jul 2017 12:39:54 +0200	[thread overview]
Message-ID: <20170720103954.lxrkz3jt23p7sqrv@phenom.ffwll.local> (raw)
In-Reply-To: <20170720095339.lkyufn6qq5rnra4n@flea>

On Thu, Jul 20, 2017 at 11:53:39AM +0200, Maxime Ripard wrote:
> Hi Daniel,
> 
> On Tue, Jul 18, 2017 at 09:35:03AM +0200, Daniel Vetter wrote:
> > On Tue, Jul 18, 2017 at 9:07 AM, Maxime Ripard
> > <maxime.ripard@free-electrons.com> wrote:
> > > On Mon, Jul 17, 2017 at 02:57:19PM +0800, Chen-Yu Tsai wrote:
> > >> On Mon, Jul 17, 2017 at 2:55 PM, Maxime Ripard
> > >> <maxime.ripard@free-electrons.com> wrote:
> > >> > On Fri, Jul 14, 2017 at 04:56:01PM +0800, Chen-Yu Tsai wrote:
> > >> >> Hi,
> > >> >>
> > >> >> On Thu, Jul 13, 2017 at 10:41 PM, Maxime Ripard
> > >> >> <maxime.ripard@free-electrons.com> wrote:
> > >> >> > In the earlier display engine designs, any register access while a commit
> > >> >> > is pending is forbidden.
> > >> >> >
> > >> >> > One of the symptoms is that reading a register will return another, random,
> > >> >> > register value which can lead to register corruptions if we ever do a
> > >> >> > read/modify/write cycle.
> > >> >>
> > >> >> Alternatively, if changes to the backend (layers) are guaranteed to happen
> > >> >> while the CRTC is disabled (which seems to be the case after looking at
> > >> >> drm_atomic_helper_commit_planes and drm_atomic_helper_commit_tail), we
> > >> >> could just turn on register auto-commit all the time and not deal with
> > >> >> this.
> > >> >
> > >> > As far as I understand, it will only be the case if we need a new
> > >> > modeset or we changed the active CRTC or connectors. But if you change
> > >> > only the format, buffers or properties it won't be the case, and we'll
> > >> > need to commit.
> > >>
> > >> So in other words, if someone were to use it for actual compositing and
> > >> moved the upper composited layer around, we would need commit support to be
> > >> safe.
> > >>
> > >> Sounds more or less like something a video player would do.
> > >
> > > Not only that. A change of buffer will happen every frame or so, and
> > > we can change the format whenever we want too (even if it's usually
> > > going to be in sync with a new buffer). Changing a property can happen
> > > any time too (like zpos for example).
> > 
> > You can upgrade any property change to an atomic modeset by e.g.
> > setting connector->mode_changed (and then making sure to call
> > check_modeset() helper again perhaps). This is for cases where your hw
> > can't handle a property change within 1 vblank. The default is just
> > the solution for most common hw.
> > 
> > The other way round works too, you can clear these flags in your
> > atomic_check callbacks. But that requires a bit more care (to make
> > sure you never clear it when there's something else also changing that
> > still needs a full modeset sequence to commit to hw).
> 
> Hmm, that's good to know, but that would imply disabling the CRTC each
> time we change even a small property, with all the visual artifacts it
> might imply, right?

This isn't black&white, you only need to set this when needed. Of course
that means you need to have code (and hopefully testcases) to make sure
you only set it when needed. And userspace can ask the driver whether a
given change requires a full modeset or not and then decided whether it
wants to do that switch or not.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2017-07-20 10:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 14:41 [PATCH 0/4] drm/sun4i: Fix a register access bug Maxime Ripard
2017-07-13 14:41 ` [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail for runtime_pm users Maxime Ripard
2017-07-13 19:39   ` Daniel Vetter
2017-07-13 23:43   ` Laurent Pinchart
2017-07-14  5:37     ` Daniel Vetter
2017-07-18  7:05     ` Maxime Ripard
2017-07-18 10:14       ` Laurent Pinchart
2017-07-18 12:08         ` Daniel Vetter
2017-07-18 12:47           ` Laurent Pinchart
2017-07-18 13:04             ` Daniel Vetter
2017-07-13 14:41 ` [PATCH 2/4] drm/sun4i: Use the runtime_pm commit_tail variant Maxime Ripard
2017-07-13 14:41 ` [PATCH 3/4] drm/sun4i: engine: Add commit_poll function Maxime Ripard
2017-07-13 14:41 ` [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Maxime Ripard
2017-07-14  8:56   ` Chen-Yu Tsai
2017-07-17  6:55     ` Maxime Ripard
2017-07-17  6:57       ` Chen-Yu Tsai
2017-07-18  7:07         ` Maxime Ripard
2017-07-18  7:35           ` Daniel Vetter
2017-07-20  9:53             ` Maxime Ripard
2017-07-20 10:39               ` Daniel Vetter [this message]

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=20170720103954.lxrkz3jt23p7sqrv@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=sw0312.kim@samsung.com \
    --cc=wens@csie.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).