From: Philipp Zabel <p.zabel@pengutronix.de>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 4/6] drm/irq: Unexport drm_vblank_count
Date: Mon, 14 Nov 2016 18:51:58 +0100 [thread overview]
Message-ID: <1479145918.2473.32.camel@pengutronix.de> (raw)
In-Reply-To: <20161114090255.31595-4-daniel.vetter@ffwll.ch>
Am Montag, den 14.11.2016, 10:02 +0100 schrieb Daniel Vetter:
> No one outside of drm_irq.c should ever need this. The correct way to
> implement get_vblank_count for hw lacking a vblank counter is
> drm_vblank_no_hw_counter. Fix this up in mtk, which is the only
> offender left over.
>
> Cc: CK Hu <ck.hu@mediatek.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
> ---
> drivers/gpu/drm/drm_irq.c | 37 +++++++++-------------------------
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +-
> 2 files changed, 11 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 2fb5861b04b7..1681e919b866 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -234,6 +234,16 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
> store_vblank(dev, pipe, diff, &t_vblank, cur_vblank);
> }
>
> +static u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> +{
> + struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> +
> + if (WARN_ON(pipe >= dev->num_crtcs))
> + return 0;
> +
> + return vblank->count;
> +}
> +
> /**
> * drm_accurate_vblank_count - retrieve the master vblank counter
> * @crtc: which counter to retrieve
> @@ -888,31 +898,6 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> }
>
> /**
> - * drm_vblank_count - retrieve "cooked" vblank counter value
> - * @dev: DRM device
> - * @pipe: index of CRTC for which to retrieve the counter
> - *
> - * Fetches the "cooked" vblank count value that represents the number of
> - * vblank events since the system was booted, including lost events due to
> - * modesetting activity.
> - *
> - * This is the legacy version of drm_crtc_vblank_count().
> - *
> - * Returns:
> - * The software vblank counter.
> - */
> -u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> -{
> - struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> -
> - if (WARN_ON(pipe >= dev->num_crtcs))
> - return 0;
> -
> - return vblank->count;
> -}
> -EXPORT_SYMBOL(drm_vblank_count);
> -
> -/**
> * drm_crtc_vblank_count - retrieve "cooked" vblank counter value
> * @crtc: which counter to retrieve
> *
> @@ -920,8 +905,6 @@ EXPORT_SYMBOL(drm_vblank_count);
> * vblank events since the system was booted, including lost events due to
> * modesetting activity.
> *
> - * This is the native KMS version of drm_vblank_count().
> - *
> * Returns:
> * The software vblank counter.
> */
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index d90152e85ed0..4b7fe7eaec01 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -256,7 +256,7 @@ static struct drm_driver mtk_drm_driver = {
> .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
> DRIVER_ATOMIC,
>
> - .get_vblank_counter = drm_vblank_count,
> + .get_vblank_counter = drm_vblank_no_hw_counter,
> .enable_vblank = mtk_drm_crtc_enable_vblank,
> .disable_vblank = mtk_drm_crtc_disable_vblank,
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-11-14 17:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
2016-11-14 9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
2016-11-14 11:41 ` [PATCH] " Daniel Vetter
2016-11-15 21:59 ` Daniel Vetter
2016-11-16 7:39 ` Ben Skeggs
2016-11-14 9:02 ` [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal Daniel Vetter
2016-11-14 9:02 ` [PATCH 4/6] drm/irq: Unexport drm_vblank_count Daniel Vetter
2016-11-14 17:51 ` Philipp Zabel [this message]
2016-11-14 9:02 ` [PATCH 5/6] drm/irq: Unexport drm_vblank_on/off Daniel Vetter
2016-11-14 9:02 ` [PATCH 6/6] drm: drm_irq.h header cleanup Daniel Vetter
2016-11-14 15:35 ` Alex Deucher
2016-11-15 22:02 ` Daniel Vetter
2016-11-14 10:02 ` [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Christian König
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=1479145918.2473.32.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).