From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 12/17] drm: convert crtc to properties/state Date: Mon, 26 May 2014 17:37:57 +0200 Message-ID: <20140526153757.GZ14357@phenom.ffwll.local> References: <1400956226-28053-1-git-send-email-robdclark@gmail.com> <1400956226-28053-13-git-send-email-robdclark@gmail.com> <20140526093110.GC14357@phenom.ffwll.local> <20140526152305.GJ27580@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A7276E5E0 for ; Mon, 26 May 2014 08:38:02 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id l18so8112787wgh.23 for ; Mon, 26 May 2014 08:38:01 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140526152305.GJ27580@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, May 26, 2014 at 06:23:05PM +0300, Ville Syrj=E4l=E4 wrote: > On Mon, May 26, 2014 at 11:31:10AM +0200, Daniel Vetter wrote: > > On Sat, May 24, 2014 at 02:30:21PM -0400, Rob Clark wrote: > > > @@ -92,7 +100,18 @@ int drm_atomic_set_event(struct drm_device *dev, > > > struct drm_atomic_state *state, struct drm_mode_object *obj, > > > struct drm_pending_vblank_event *event) > > > { > > > - return -EINVAL; /* for now */ > > > + switch (obj->type) { > > > + case DRM_MODE_OBJECT_CRTC: { > > > + struct drm_crtc_state *cstate =3D > > > + drm_atomic_get_crtc_state(obj_to_crtc(obj), state); > > > + if (IS_ERR(cstate)) > > > + return PTR_ERR(cstate); > > > + cstate->event =3D event; > > > + return 0; > > > + } > > > + default: > > > + return -EINVAL; > > > + } > > = > > Hm, I think if we only want completion events on crtcs (which I agree o= n) > = > I don't. Unless you have a nice way of passing some kind of "fbs now > available for rendering" list back to userland in the single crtc > event. Last time I looked making the drm event stuff deal with > variable length events looked more painful than just adding per > plane events. But I must admit that I didn't really try to do it. Hm, why can't userspace keep a list of fb ids involved in a given crtc pageflip around and index those with the cookie we pass around? I really don't see why the kernel has to implement a half-baked event multiplexer (which just copies the same thing n times), while userspace is perfectly capable of doing that itself? Now if the timestamps would be genuinely different then I'd agree, but then that's not an atomic update. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch