[PATCH 03/11] drmmode: add drmmode_get_current_ust function

Ilija Hadzic ihadzic at research.bell-labs.com
Mon Apr 29 08:36:23 PDT 2013


On Sun, 28 Apr 2013, Richard Wilbur wrote:

> On Sun, Apr 28, 2013 at 2:07 PM, Ilija Hadzic <ilijahadzic at gmail.com> wrote:
>> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
>> index 13e65fa..2b61823 100644
>> --- a/src/drmmode_display.c
>> +++ b/src/drmmode_display.c
>> @@ -216,6 +217,30 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,
> [...]
>> +/*
>> + * Retrieves present time in milliseconds that is compatible
>> + * with units used by vblank timestamps. Depending on the kernel
>> + * version and DRM kernel module configuration, the vblank
>> + * timestamp can either be in real time or monotonic time
>> + */
>> +int drmmode_get_current_ust(int drm_fd, CARD64 *ust)
>> +{
> [...]
>> +       *ust = ((CARD64)now.tv_sec * 1000000) + ((CARD64)now.tv_nsec / 1000);
>> +       return 0;
>> +}
>
> I'd like to suggest changing the comment as follows   s/milli/micro/  ->
>> + * Retrieves present time in microseconds that is compatible
>
> so that the comment matches the math (millisecond = ms = 10^-3 s,
> microsecond = us = 10^-6 s) and the function name "*_ust".
>
> Sincerely,
>
> Richard
>

OK, I'll fix it, but I will give it a few more days before sending out v2 
of the patches to give others opportunity to comment. BTW, I now notice 
that the comment is actually wrong. The units are supposed to be 
microseconds. So, if it read like this would that address your concern:

/*
  * Retrieves present UST that is compatible with timestamps used for
  * vblank events. Depending on the kernel version and DRM kernel module
  * configuration, the vblank timestamp can either be real time or
  * monotonic.
  */

thanks,

-- Ilija



More information about the xorg-driver-ati mailing list