All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 7/8] drm/irq: Implement a generic vblank_wait function
Date: Wed, 30 Jul 2014 11:59:33 +0900	[thread overview]
Message-ID: <53D85F95.3050502@daenzer.net> (raw)
In-Reply-To: <1406669543-31213-8-git-send-email-daniel.vetter@ffwll.ch>

On 30.07.2014 06:32, Daniel Vetter wrote:
> As usual in both a crtc index and a struct drm_crtc * version.
> 
> The function assumes that no one drivers their display below 10Hz, and
> it will complain if the vblank wait takes longer than that.
> 
> v2: Also check dev->max_vblank_counter since some drivers register a
> fake get_vblank_counter function.

What does that refer to? Can't find any other reference to
max_vblank_counter in the patch.


> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 0de123afdb34..76024fdde452 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -999,6 +999,51 @@ void drm_crtc_vblank_put(struct drm_crtc *crtc)
>  EXPORT_SYMBOL(drm_crtc_vblank_put);
>  
>  /**
> + * drm_vblank_wait - wait for one vblank
> + * @dev: DRM device
> + * @crtc: crtc index
> + *
> + * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
> + * It is a failure to call this when the vblank irq for @crtc is disable, e.g.

Spelling: 'disabled'


> + * due to lack of driver support or because the crtc is off.
> + */
> +void drm_vblank_wait(struct drm_device *dev, int crtc)
> +{
> +	int ret;
> +	u32 last;
> +
> +	ret = drm_vblank_get(dev, crtc);
> +	if (WARN_ON(ret))
> +		return;
> +
> +	last = drm_vblank_count(dev, crtc);
> +
> +#define C (last != drm_vblank_count(dev, crtc))
> +	ret = wait_event_timeout(dev->vblank[crtc].queue,
> +				 C, msecs_to_jiffies(100));
> +
> +	WARN_ON(ret == 0);
> +#undef C

What's the point of the C macro?


> +	drm_vblank_put(dev, crtc);
> +}
> +EXPORT_SYMBOL(drm_vblank_wait);
> +
> +/**
> + * drm_crtc_vblank_wait - wait for one vblank
> + * @crtc: DRM crtc
> + *
> + * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
> + * It is a failure to call this when the vblank irq for @crtc is disable, e.g.

Same typo as above.


> + * due to lack of driver support or because the crtc is off.
> + */
> +void drm_crtc_vblank_wait(struct drm_crtc *crtc)
> +{
> +	drm_vblank_wait(crtc->dev, drm_crtc_index(crtc));
> +}
> +EXPORT_SYMBOL(drm_crtc_vblank_wait);
> +
> +/**

Maybe the function names should be *_vblank_wait_next() or something to
clarify the purpose and reduce potential confusion versus drm_wait_vblank().


Looks good to me other than that.


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-07-30  2:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 21:32 [PATCH 0/8] atomic prep work Daniel Vetter
2014-07-29 21:32 ` [PATCH 1/8] drm: Add drm_plane/connector_index Daniel Vetter
2014-07-29 22:59   ` [Intel-gfx] " Matt Roper
2014-07-30  8:31   ` [PATCH] " Daniel Vetter
2014-07-29 21:32 ` [PATCH 2/8] drm: Move modeset_lock_all helpers to drm_modeset_lock.[hc] Daniel Vetter
2014-07-29 23:27   ` Dave Airlie
2014-07-29 21:32 ` [PATCH 3/8] drm: Handle legacy per-crtc locking with full acquire ctx Daniel Vetter
2014-07-29 23:28   ` Dave Airlie
2014-07-30  8:34   ` [PATCH] " Daniel Vetter
2014-07-29 21:32 ` [PATCH 4/8] drm: Move ->old_fb from crtc to plane Daniel Vetter
2014-07-29 23:30   ` Dave Airlie
2014-07-29 23:46   ` [Intel-gfx] " Matt Roper
2014-07-30  8:14     ` Daniel Vetter
2014-07-30  8:34   ` [PATCH] " Daniel Vetter
2014-07-29 21:32 ` [PATCH 5/8] drm: trylock modest locking for fbdev panics Daniel Vetter
2014-07-30 15:56   ` Matt Roper
2014-07-30 16:12     ` Daniel Vetter
2014-07-29 21:32 ` [PATCH 6/8] drm: Add a plane->reset hook Daniel Vetter
2014-07-29 21:32 ` [PATCH 7/8] drm/irq: Implement a generic vblank_wait function Daniel Vetter
2014-07-30  2:59   ` Michel Dänzer [this message]
2014-07-30  8:22     ` Daniel Vetter
2014-07-30  8:32       ` Michel Dänzer
2014-07-30 14:20         ` Thierry Reding
2014-07-30 14:36           ` [Intel-gfx] " Ville Syrjälä
2014-07-30 15:07             ` Daniel Vetter
2014-07-30 15:21             ` [Intel-gfx] " Thierry Reding
2014-07-31  1:14               ` Michel Dänzer
2014-07-31  7:54                 ` Daniel Vetter
2014-07-31  8:56                   ` Michel Dänzer
2014-07-31  9:46                     ` Daniel Vetter
2014-07-30  9:25   ` [PATCH] " Daniel Vetter
2014-07-30  9:52     ` Michel Dänzer
2014-07-30 14:24   ` [PATCH 7/8] " Thierry Reding
2014-07-30 15:06     ` Daniel Vetter
2014-07-30 15:10       ` Thierry Reding
2014-07-29 21:32 ` [PATCH 8/8] drm/i915: Use generic vblank wait Daniel Vetter
2014-07-30  9:25   ` [PATCH] " Daniel Vetter
2014-07-30 13:36 ` [PATCH] drm: Docbook fixes Daniel Vetter
2014-08-05  2:51   ` [Intel-gfx] " Dave Airlie
2014-08-05  7:28     ` Daniel Vetter

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=53D85F95.3050502@daenzer.net \
    --to=michel@daenzer.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.