All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [RFCv1 10/12] drm: convert crtc to properties/state
Date: Mon, 7 Oct 2013 19:51:08 +0200	[thread overview]
Message-ID: <20131007175100.GA2676@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGv_M_WzQ-3iaw9DXUdghPqOU5CtFU+GHNiVycmzmmpSKg@mail.gmail.com>

On Mon, Oct 07, 2013 at 10:29:06AM -0400, Rob Clark wrote:
> On Mon, Oct 7, 2013 at 10:19 AM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Mon, Oct 07, 2013 at 10:03:01AM -0400, Rob Clark wrote:
> >> On Mon, Oct 7, 2013 at 9:39 AM, Ville Syrjälä
> >> <ville.syrjala@linux.intel.com> wrote:
> >> > On Sat, Oct 05, 2013 at 08:45:48PM -0400, Rob Clark wrote:
> >> >> Break the mutable state of a crtc out into a separate structure
> >> >> and use atomic properties mechanism to set crtc attributes.  This
> >> >> makes it easier to have some helpers for crtc->set_property()
> >> >> and for checking for invalid params.  The idea is that individual
> >> >> drivers can wrap the state struct in their own struct which adds
> >> >> driver specific parameters, for easy build-up of state across
> >> >> multiple set_property() calls and for easy atomic commit or roll-
> >> >> back.
> >> >
> >> > I'm not sure how we're going to handle the mismatch in the behaviour of
> >> > the atomic modeset vs. the current setcrtc.
> >> >
> >> > The problem is that setcrtc ignore all kinds of conflicting
> >> > crtc->connector assignments, and just overwrites whatever was there
> >> > with the latest configuration. For the atomic case we want to return an
> >> > error if there's a conflict.
> >>
> >> Hmm, well currently we preserve the setcrtc behavior because it ends
> >> up going through crtc helpers (or whatever the driver uses).  So
> >> should be fine for setcrtc, but probably not what we want for atomic
> >> ioctl.
> >>
> >> I suppose we could solve some of this via internal flags, ie
> >> .atomic_begin(dev, LEGACY_SETCRTC_CHECK_MODE)
> >>
> >> it is a bit ugly, but it keeps the ugly in core and drivers don't have
> >> to care as much about it (which is my main concern)
> >
> > Well, it could be an entirely separate .legacy_crap() hook or something
> > that happens just before .check().
> 
> yeah, that could work too.. I'll think about it a bit and see what I
> can come up with

Why can't the legacy setcrtc ioctl implemenation just fiddle the current
state out of the connector/encoder pointers and then make a relevant
atomic call? So if it notices that some connectors would be disabled it
just adds an explicit clearing of the connector->crtc link  to the atomic
request.

> >> > And another thing is the DPMS handling. The
> >> > current API forces DPMS on when you do a modeset, but for the atomic
> >> > case I want to keep things nice and clean and avoid doing such silly
> >> > things.
> >>
> >> I guess the easy thing is to set DPMS property in setcrtc too ;-)
> >
> > That's what we do, but I don't want it for atomic.
> 
> yeah, I need think about how that could work if we are still using
> .set_config() from the commit, but I guess I should be able to sort
> out something..

Similarly here the legacy setcrtc simply needs to supply a dpms=ON request
for all connectors that are in the setcrtc request.

With those changes drivers can get rid of these hacks and legacy ioctl
quirks internally and we consolidate them into one single place ...

The real crux here is getting legacy pageflip semantics out of the new
interface. In any case I think if we're left with some non-helper
set_cursor, set_plane, setfoo/bar from yonder the new atomic interface is
probably not good enough. After all anything that current userspace does
with these ioctls it probably wants to keep on doing in the new world. So
imo making sure that all the old ioctls work in terms of the new driver
interface is a nice real-world test of their suitability.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-10-07 17:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06  0:45 [RFCv1 00/12] Atomic/nuclear modeset/pageflip Rob Clark
2013-10-06  0:45 ` [RFCv1 01/12] drm: add atomic fxns Rob Clark
2013-10-06  0:45 ` [RFCv1 02/12] drm: add object property type Rob Clark
2013-10-07 13:43   ` Ville Syrjälä
2013-10-07 14:44     ` Rob Clark
2013-10-06  0:45 ` [RFCv1 03/12] drm: add DRM_MODE_PROP_DYNAMIC property flag Rob Clark
2013-10-07 13:46   ` Ville Syrjälä
2013-10-07 14:46     ` Rob Clark
2013-10-06  0:45 ` [RFCv1 04/12] drm: add DRM_MODE_PROP_SIGNED " Rob Clark
2013-10-07 14:46   ` Matt Plumtree
2013-10-06  0:45 ` [RFCv1 05/12] drm: helpers to find mode objects (BEFORE drm: split property values out) Rob Clark
2013-10-06  0:48   ` Rob Clark
2013-10-06  0:45 ` [RFCv1 06/12] drm: split propvals out and blob property support Rob Clark
2013-10-06  0:45 ` [RFCv1 07/12] drm: Allow drm_mode_object_find() to look up an object of any type Rob Clark
2013-10-06  0:45 ` [RFCv1 08/12] drm: Refactor object property check code Rob Clark
2013-10-07 13:47   ` Ville Syrjälä
2013-10-06  0:45 ` [RFCv1 09/12] drm: convert plane to properties/state Rob Clark
2013-10-06  0:45 ` [RFCv1 10/12] drm: convert crtc " Rob Clark
2013-10-07 13:39   ` Ville Syrjälä
2013-10-07 14:03     ` Rob Clark
2013-10-07 14:19       ` Ville Syrjälä
2013-10-07 14:29         ` Rob Clark
2013-10-07 17:51           ` Daniel Vetter [this message]
2013-10-06  0:45 ` [RFCv1 11/12] drm: Atomic modeset ioctl Rob Clark
2013-10-07 13:28   ` Ville Syrjälä
2013-10-07 13:55     ` Rob Clark
2013-10-07 14:18       ` Ville Syrjälä
2013-10-07 14:39         ` Rob Clark
2013-10-07 15:05           ` Ville Syrjälä
2013-10-07 15:20             ` Rob Clark
2013-10-07 17:56               ` Daniel Vetter
2013-10-07 18:49                 ` Rob Clark
2013-10-08 18:35         ` Matt Roper
2013-10-08 18:46           ` Rob Clark
2013-10-06  0:45 ` [RFCv1 12/12] ARM: add get_user() support for 8 byte types Rob Clark
2013-10-06  8:53   ` Russell King - ARM Linux
2013-10-06 14:09     ` Rob Clark
2013-10-06 15:56       ` Russell King - ARM Linux

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=20131007175100.GA2676@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@gmail.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.