From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: linux@treblig.org
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] drm/vblank: Remove unused drm_crtc_vblank_count_and_time
Date: Mon, 28 Oct 2024 18:13:34 +0200 [thread overview]
Message-ID: <Zx-4LsWPQEB_1mED@intel.com> (raw)
In-Reply-To: <20241022232934.238124-4-linux@treblig.org>
On Wed, Oct 23, 2024 at 12:29:32AM +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> drm_crtc_vblank_count_and_time() was explicitly added by
> commit cf6483050e9b ("drm/irq: Add drm_crtc_vblank_count_and_time()")
> in 2015, but never used.
I see a bunch of places that could trivially use it.
That might be the more sensible thing to do so that
we keep moving towards using the crtc for everything.
The EXPORT_SYMBOL() looks completely pointless though.
>
> Remove it, and rework comments that reference it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
> drivers/gpu/drm/drm_vblank.c | 44 +++++++-----------------------------
> include/drm/drm_vblank.h | 10 ++++----
> 2 files changed, 12 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 94e45ed6869d..67d6367e9f4b 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -908,10 +908,10 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> * drm_crtc_accurate_vblank_count() for such use-cases.
> *
> * Note that for a given vblank counter value drm_crtc_handle_vblank()
> - * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time()
> - * provide a barrier: Any writes done before calling
> - * drm_crtc_handle_vblank() will be visible to callers of the later
> - * functions, if the vblank count is the same or a later one.
> + * and drm_crtc_vblank_count() provide a barrier:
> + * Any writes done before calling drm_crtc_handle_vblank() will be
> + * visible to callers of the later functions, if the vblank count is
> + * the same or a later one.
> *
> * See also &drm_vblank_crtc.count.
> *
> @@ -936,7 +936,6 @@ EXPORT_SYMBOL(drm_crtc_vblank_count);
> * modesetting activity. Returns corresponding system timestamp of the time
> * of the vblank interval that corresponds to the current vblank counter value.
> *
> - * This is the legacy version of drm_crtc_vblank_count_and_time().
> */
> static u64 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
> ktime_t *vblanktime)
> @@ -959,33 +958,6 @@ static u64 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
> return vblank_count;
> }
>
> -/**
> - * drm_crtc_vblank_count_and_time - retrieve "cooked" vblank counter value
> - * and the system timestamp corresponding to that vblank counter value
> - * @crtc: which counter to retrieve
> - * @vblanktime: Pointer to time to receive the vblank timestamp.
> - *
> - * 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. Returns corresponding system timestamp of the time
> - * of the vblank interval that corresponds to the current vblank counter value.
> - *
> - * Note that for a given vblank counter value drm_crtc_handle_vblank()
> - * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time()
> - * provide a barrier: Any writes done before calling
> - * drm_crtc_handle_vblank() will be visible to callers of the later
> - * functions, if the vblank count is the same or a later one.
> - *
> - * See also &drm_vblank_crtc.count.
> - */
> -u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> - ktime_t *vblanktime)
> -{
> - return drm_vblank_count_and_time(crtc->dev, drm_crtc_index(crtc),
> - vblanktime);
> -}
> -EXPORT_SYMBOL(drm_crtc_vblank_count_and_time);
> -
> /**
> * drm_crtc_next_vblank_start - calculate the time of the next vblank
> * @crtc: the crtc for which to calculate next vblank time
> @@ -1978,10 +1950,10 @@ EXPORT_SYMBOL(drm_handle_vblank);
> * This is the native KMS version of drm_handle_vblank().
> *
> * Note that for a given vblank counter value drm_crtc_handle_vblank()
> - * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time()
> - * provide a barrier: Any writes done before calling
> - * drm_crtc_handle_vblank() will be visible to callers of the later
> - * functions, if the vblank count is the same or a later one.
> + * and drm_crtc_vblank_count() * provide a barrier:
> + * Any writes done before calling * drm_crtc_handle_vblank() will be
> + * visible to callers of the later functions, if the vblank count is
> + * the same or a later one.
> *
> * See also &drm_vblank_crtc.count.
> *
> diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h
> index 151ab1e85b1b..572e54425970 100644
> --- a/include/drm/drm_vblank.h
> +++ b/include/drm/drm_vblank.h
> @@ -141,10 +141,10 @@ struct drm_vblank_crtc {
> * Current software vblank counter.
> *
> * Note that for a given vblank counter value drm_crtc_handle_vblank()
> - * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time()
> - * provide a barrier: Any writes done before calling
> - * drm_crtc_handle_vblank() will be visible to callers of the later
> - * functions, iff the vblank count is the same or a later one.
> + * and drm_crtc_vblank_count() provide a barrier:
> + * Any writes done before calling drm_crtc_handle_vblank() will be
> + * visible to callers of the later functions, iff the vblank count is
> + * the same or a later one.
> *
> * IMPORTANT: This guarantee requires barriers, therefor never access
> * this field directly. Use drm_crtc_vblank_count() instead.
> @@ -260,8 +260,6 @@ struct drm_vblank_crtc *drm_crtc_vblank_crtc(struct drm_crtc *crtc);
> int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> bool drm_dev_has_vblank(const struct drm_device *dev);
> u64 drm_crtc_vblank_count(struct drm_crtc *crtc);
> -u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> - ktime_t *vblanktime);
> int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t *vblanktime);
> void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> struct drm_pending_vblank_event *e);
> --
> 2.47.0
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-10-28 16:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 23:29 [PATCH 0/5] DRM deadcode linux
2024-10-22 23:29 ` [PATCH 1/5] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc linux
2024-10-28 13:16 ` Dmitry Baryshkov
2024-10-22 23:29 ` [PATCH 2/5] drm/sysfs: Remove unused drm_class_device_(un)register linux
2024-10-28 13:16 ` Dmitry Baryshkov
2024-10-22 23:29 ` [PATCH 3/5] drm/vblank: Remove unused drm_crtc_vblank_count_and_time linux
2024-10-28 15:49 ` Dmitry Baryshkov
2024-10-28 16:13 ` Ville Syrjälä [this message]
2024-10-28 16:54 ` Dr. David Alan Gilbert
2024-10-22 23:29 ` [PATCH 4/5] drm/client: Remove unused drm_client_framebuffer_flush linux
2024-10-23 6:46 ` Thomas Zimmermann
2024-10-23 8:04 ` Jocelyn Falempe
2024-10-23 11:03 ` Dr. David Alan Gilbert
2024-10-22 23:29 ` [PATCH 5/5] drm/client: Remove unused drm_client_modeset_check linux
2024-10-28 13:24 ` Dmitry Baryshkov
2024-10-28 13:52 ` Dr. David Alan Gilbert
2024-10-29 23:48 ` Dr. David Alan Gilbert
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=Zx-4LsWPQEB_1mED@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@treblig.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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