On Mon, 2007-06-11 at 15:20 -0700, Jesse Barnes wrote:

> +static u32 last_vblank; /* protected by dev->vbl_lock */

uh. per crtc?

> +     atomic_add(diff, &dev->vblank_count[crtc]);

Ok, I think this is reasonable, although different from what I
suggested.

> +     seq = atomic_read(&dev->vblank_count[crtc]);

Isn't this way too early? Seems like you'd want to get a reasonably
up-to-date value here; should this be after drm_vblank_get?

> +u32 i915_get_vblank_counter(drm_device_t *dev, int crtc)
> +{
> +     drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
> +     return i915_vblank_counter(dev, crtc) + dev_priv->vblank_offset[crtc];
> +}

I thought you were doing the offset stuff in core?

> +
> +int i915_premodeset(DRM_IOCTL_ARGS)
> +{
> +     DRM_DEVICE;
> +     drm_i915_private_t *dev_priv = dev->dev_private;
> +
> +     int crtc = data;
> +
> +     if (crtc > 1) {
> +             DRM_ERROR("bad crtc\n");
> +             return -EINVAL;
> +     }
> +
> +     dev_priv->vblank_premodeset[crtc] = i915_vblank_counter(dev, crtc);
> +     return 0;
> +}
> +
> +int i915_postmodeset(DRM_IOCTL_ARGS)
> +{
> +     DRM_DEVICE;
> +     drm_i915_private_t *dev_priv = dev->dev_private;
> +     u32 new;
> +     int crtc = data;
> +
> +     if (crtc > 1) {
> +             DRM_ERROR("bad crtc\n");
> +             return -EINVAL;
> +     }
> +
> +     new = i915_vblank_counter(dev, crtc);
> +     dev_priv->vblank_offset[crtc] = dev_priv->vblank_premodeset[crtc] - new;
> +     return 0;
> +}

Ah, ok, offsets in driver.

-- 
[EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to