All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm: Fix off-by-one in vblank hardware counter wraparound handling
Date: Wed, 27 May 2015 16:17:05 +0900	[thread overview]
Message-ID: <55656F71.1040704@daenzer.net> (raw)
In-Reply-To: <20150526114811.GL12971@phenom.ffwll.local>

On 26.05.2015 20:48, Daniel Vetter wrote:
> On Tue, May 26, 2015 at 05:53:38PM +0900, Michel Dänzer wrote:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> dev->max_vblank_count contains the largest value that can be represented
>> by the hardware counter. When the hardware counter wraps around, we have
>> to add that value + 1 to get the same value as if the hardware counter
>> didn't wrap around.
>>
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> 
> Well there's two users of this really, one wants the max (this one here)
> and the other a mask.

Well, this one has been around much longer. :) Looks like drm_vblank_on
added a (probably valid, see below) assumption without updating the
field name to reflect that.


> And all the drivers use it as a mask.

How so? They just assign the value, which happens to work for both
meanings above in all cases.


> Maybe rename it to vblank_counter_mask or similar while at it to
> prevent further confusion?

I'm just fixing an off-by-one bug here; I invite you or anyone else to
be my guest for anything more. :)


-- 
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:[~2015-05-27  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26  8:53 [PATCH 1/2] drm: Fix off-by-one in vblank hardware counter wraparound handling Michel Dänzer
2015-05-26  8:53 ` [PATCH 2/2] drm/radeon: Fix max_vblank_count value for current display engines Michel Dänzer
2015-05-28  4:17   ` Alex Deucher
2015-05-26  8:57 ` [PATCH 1/2] drm: Fix off-by-one in vblank hardware counter wraparound handling Christian König
2015-05-26 11:48 ` Daniel Vetter
2015-05-27  7:17   ` Michel Dänzer [this message]
2015-05-27 11:03     ` Daniel Vetter
2015-05-27  7:42   ` Ville Syrjälä

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=55656F71.1040704@daenzer.net \
    --to=michel@daenzer.net \
    --cc=daniel@ffwll.ch \
    --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 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.