From: Jesse Barnes Subject: Re: [RFC 1/9] drm: add atomic fxns Date: Wed, 12 Sep 2012 09:57:20 -0700 Message-ID: <20120912095720.495bf1ff@jbarnes-desktop> References: <1347246202-24249-1-git-send-email-rob.clark@linaro.org> <1347246202-24249-2-git-send-email-rob.clark@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy7-pub.bluehost.com (oproxy7-pub.bluehost.com [67.222.55.9]) by gabe.freedesktop.org (Postfix) with SMTP id 2D8759E830 for ; Wed, 12 Sep 2012 09:57:09 -0700 (PDT) In-Reply-To: <1347246202-24249-2-git-send-email-rob.clark@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Rob Clark Cc: daniel.vetter@ffwll.ch, Rob Clark , dri-devel@lists.freedesktop.org, patches@linaro.org List-Id: dri-devel@lists.freedesktop.org On Sun, 9 Sep 2012 22:03:14 -0500 Rob Clark wrote: > From: Rob Clark > > The 'atomic' mechanism allows for multiple properties to be updated, > checked, and commited atomically. This will be the basis of atomic- > modeset and nuclear-pageflip. > > The basic flow is: > > state = dev->atomic_begin(); > for (... one or more ...) > obj->set_property(obj, state, prop, value); > if (dev->atomic_check(state)) > dev->atomic_commit(state, event); > dev->atomic_end(state); I think the above is more suited to drm_crtc_helper code. I think the top level callback should contain the arrays and be a single "multi flip" hook (or maybe a check then set double callback). For some drivers that'll end up being a lot simpler, rather than sprinkling atomic handling code in all the set_property callbacks. Having a transactional API just seems a little messier with both the atomic state and per-property state to track and rollback in the case of failure. -- Jesse Barnes, Intel Open Source Technology Center