All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Kristian Høgsberg" <krh@bitplanet.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [RFC 1/4] time: export getnstime_raw_and_real for DRM
Date: Tue, 09 Oct 2012 13:25:29 +0300	[thread overview]
Message-ID: <1349778329.9882.9.camel@localhost> (raw)
In-Reply-To: <CAOeoa-dQFmNZ-LnNSVzAiuvLrLA26+=MsCNFPgLuvui834b=Uw@mail.gmail.com>

On Fri, 2012-10-05 at 12:14 -0400, Kristian Høgsberg wrote:
> On Fri, Oct 5, 2012 at 9:36 AM, Imre Deak <imre.deak@intel.com> wrote:
> > Needed by the upcoming DRM raw monotonic timestamp support.
> 
> I just had a quick look at driver/input/evdev.c, since evdev devices
> did a similar change recently to allow evdev timestamp from the
> monotonic clock.  They're using a different time API:
> 
> 	time_mono = ktime_get();
>         time_real = ktime_sub(time_mono, ktime_get_monotonic_offset());
> 
> and
> 
>         event->time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ?
> 			                mono : real);
> 
> I'm not really up-to-date on kernel time APIs, but I wonder if that
> may be better?  At least, I suspect we wouldn't need changes outside
> drm if we use this API.


Thanks, I will use this instead of getnstime_raw_and_real.

The reason is as discussed on #intel-gfx that this provides a monotonic
vs. raw monotonic time and that as you say it won't require a change in
the time keeping code.

--Imre

> 
> Kristian
> 
> 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  kernel/time/timekeeping.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> > index d3b91e7..073d262 100644
> > --- a/kernel/time/timekeeping.c
> > +++ b/kernel/time/timekeeping.c
> > @@ -365,7 +365,7 @@ void ktime_get_ts(struct timespec *ts)
> >  }
> >  EXPORT_SYMBOL_GPL(ktime_get_ts);
> >
> > -#ifdef CONFIG_NTP_PPS
> > +#if defined(CONFIG_NTP_PPS) || defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
> >
> >  /**
> >   * getnstime_raw_and_real - get day and raw monotonic time in timespec format
> > --
> > 1.7.9.5
> >


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2012-10-09 10:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 13:36 [RFC 0/4] drm: add raw monotonic timestamp support Imre Deak
2012-10-05 13:36 ` [RFC 1/4] time: export getnstime_raw_and_real for DRM Imre Deak
2012-10-05 16:14   ` Kristian Høgsberg
2012-10-09 10:25     ` Imre Deak [this message]
2012-10-05 13:37 ` [RFC 2/4] drm: make memset/calloc for _vblank_time more robust Imre Deak
2012-10-05 13:37 ` [RFC 3/4] drm: use raw time in drm_calc_vbltimestamp_from_scanoutpos Imre Deak
2012-10-05 13:37 ` [RFC 4/4] drm: add support for raw monotonic vblank timestamps Imre Deak
2012-10-05 13:55   ` Michel Dänzer
2012-10-05 13:59     ` Imre Deak
2012-10-05 14:14       ` Michel Dänzer
2012-10-05 14:21         ` Imre Deak
2012-10-05 22:18   ` Rob Clark
2012-10-05 23:41     ` Imre Deak
2012-10-06  0:09       ` Rob Clark
2012-10-06  0:49         ` Imre Deak
2012-10-07 20:33           ` Daniel Vetter
2012-10-05 23:07 ` [RFC 0/4] drm: add raw monotonic timestamp support Eric Anholt
2012-10-08 11:22   ` Imre Deak
2012-10-11 10:29 ` Laurent Pinchart
2012-10-11 11:21   ` Imre Deak
2012-10-11 10:32 ` Laurent Pinchart
2012-10-11 11:22   ` Imre Deak
2012-10-23 18:53 ` [PATCH 0/2] drm: add " Imre Deak
2012-10-23 18:53 ` [PATCH 1/2] drm: use monotonic time in drm_calc_vbltimestamp_from_scanoutpos Imre Deak
2012-10-24 23:05   ` Mario Kleiner
2012-10-25 10:28     ` Imre Deak
2012-10-25 19:45       ` Mario Kleiner
2012-10-23 18:53 ` [PATCH 2/2] drm: add support for monotonic vblank timestamps Imre Deak
2012-10-24  8:08   ` Michel Dänzer
2012-10-24 11:40     ` Imre Deak
     [not found] <mailman.20114.1349454139.16659.intel-gfx@lists.freedesktop.org>
2012-10-06  1:41 ` [RFC 1/4] time: export getnstime_raw_and_real for DRM Mario Kleiner
2012-10-08 11:35   ` Imre Deak
2012-10-08 23:00     ` Mario Kleiner
2012-10-23 11:50       ` Imre Deak

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=1349778329.9882.9.camel@localhost \
    --to=imre.deak@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=krh@bitplanet.net \
    /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.