[PATCH 1/3] drm: Send pending vblank events before disabling vblank.

Jesse Barnes jbarnes at virtuousgeek.org
Thu Apr 28 13:53:26 PDT 2011

On Thu, 28 Apr 2011 13:46:30 -0700
Jesse Barnes <jbarnes at virtuousgeek.org> wrote:

> On Thu, 28 Apr 2011 18:09:58 +1000
> Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
> wrote:
> > Ok.  This appears to be surprisingly difficult.  Particularly, the
> > vblank code indexes crtcs based on the driver-private numbering, and
> > there doesn't appear to be a generic interface to grab this number;
> > Intel uses the DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl, radeon uses
> > something different.
> > 
> > I'll see what I can come up with, but I don't think I'm sufficiently
> > familiar with the kms code to quickly come up with a nice API.
> Yeah, unfortunately the vblank code pre-dates the KMS code by quite a
> bit, so the IDs don't match.
> But with the events emitted as in your previous patch, this should be a
> harder case to hit, but it sounds like we need to make sure the flip
> waits are dealt with too to avoid this from triggering at all on
> Intel.  Or did you see other cases where the refcount was nonzero at
> this point?

Actually it looks like we wait for any outstanding flips before
disabling so that seems correct (though I didn't check the locking,
it's possible we could race a completion and a new flip if the flip
ioctl and the dpms code don't exclude each other).

Jesse Barnes, Intel Open Source Technology Center

More information about the dri-devel mailing list