From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: praneeth@ti.com, Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org, peter.ujfalusi@ti.com,
tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com,
sam@ravnborg.org
Subject: Re: [PATCH] drm/tidss: dispc: Rewrite naive plane positioning code
Date: Mon, 10 Feb 2020 18:03:36 +0200 [thread overview]
Message-ID: <20200210160336.GT13686@intel.com> (raw)
In-Reply-To: <1f396d11-2ce0-ef01-dd6e-8c563568800b@ti.com>
On Mon, Feb 10, 2020 at 05:44:19PM +0200, Jyri Sarha wrote:
> On 10/02/2020 15:21, Ville Syrjälä wrote:
> > On Sun, Feb 09, 2020 at 02:50:09PM +0200, Jyri Sarha wrote:
> >> On 07/02/2020 20:45, Ville Syrjälä wrote:
> >>> On Fri, Feb 07, 2020 at 08:26:17PM +0200, Jyri Sarha wrote:
> >>>> On 07/02/2020 20:18, Jyri Sarha wrote:
> >>>>> The old implementation of placing planes on the CRTC while configuring
> >>>>> the planes was naive and relied on the order in which the planes were
> >>>>> configured, enabled, and disabled. The situation where a plane's zpos
> >>>>> was changed on the fly was completely broken. The usual symptoms of
> >>>>> this problem was scrambled display and a flood of sync lost errors,
> >>>>> when a plane was active in two layers at the same time, or a missing
> >>>>> plane, in case when a layer was accidentally disabled.
> >>>>>
> >>>>> The rewrite takes a more straight forward approach when when HW is
> >>>>> concerned. The plane positioning registers are in the CRTC (or
> >>>>> actually OVR) register space and it is more natural to configure them
> >>>>> in a one go when configuring the CRTC. This is easy since we have
> >>>>> access to the whole atomic state when updating the CRTC configuration.
> >>>>>
> >>>>
> >>>> While implementing this fix it caught me by surprise that
> >>>> crtc->state->state (pointer up to full atomic state) is NULL when
> >>>> crtc_enable() or -flush() is called. So I take the plane-state directly
> >>>> from the plane->state and just assume that it is pointing to the same
> >>>> atomic state with the crtc state I am having. I that alraight?
> >>>
> >>> IMO you should never use plane->state etc. Better pass down the
> >>> full atomic state everywhere. Otherwise you can never even consider
> >>> increasing the commit queue depth since you'd end up accessing the
> >>> wrong state.
> >>>
> >>
> >> Ok. I did explore this a bit and it starts to look like that I have to
> >> store the planes' zpos values in the driver after all. Only the changes
> >> are available in the drm_atomic_state being commited so I have to
> >> maintain the full state myself. That is if I should not use plane->state
> >> in crtc_enable() or -flush().
> >
> > You have the full old and new states around for each
> > crtc/plane/connector in the state. So not sure what you mean
> > by having only the changes available?
> >
>
> If (by using the drm_atomic_state pointer in old_crtc_state paremeter)
> I loop the planes trough with for_each_oldnew_plane_in_state(), I will
> only see the planes that were part of the drm atomic request sent from
> the user-space. I just tested that again.
>
> But is it a requirement that an user-space applications should always
> send the full state, and that the driver should assume that all
> mode_config objects that are not there in drm_atomic_state should be
> disabled?
No.
The usual approach we follow in i915 for things that affect more
than one plane is is to collect that state into the crtc state.
That way we get to remember it for the planes that are not part
of the current commit.
And when we have state that affects more than one crtc that again
get collected up one level up in what we call global state
(basically drm_private_obj with less heavy handed locking scheme).
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-02-10 16:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 18:18 [PATCH] drm/tidss: dispc: Rewrite naive plane positioning code Jyri Sarha
2020-02-07 18:26 ` Jyri Sarha
2020-02-07 18:45 ` Ville Syrjälä
2020-02-09 12:50 ` Jyri Sarha
2020-02-10 13:21 ` Ville Syrjälä
2020-02-10 15:44 ` Jyri Sarha
2020-02-10 16:03 ` Ville Syrjälä [this message]
2020-02-11 9:11 ` Tomi Valkeinen
2020-02-11 13:00 ` Ville Syrjälä
2020-02-11 15:40 ` Daniel Vetter
2020-02-11 15:41 ` Daniel Vetter
2020-02-12 13:51 ` Jyri Sarha
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=20200210160336.GT13686@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=peter.ujfalusi@ti.com \
--cc=praneeth@ti.com \
--cc=sam@ravnborg.org \
--cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.