[Intel-gfx] [PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-19 Thread Mario Kleiner
On 03/19/2015 04:04 PM, Ville Syrjälä wrote: > On Thu, Mar 19, 2015 at 03:33:11PM +0100, Daniel Vetter wrote: >> On Wed, Mar 18, 2015 at 03:52:56PM +0100, Mario Kleiner wrote: >>> On 03/18/2015 10:30 AM, Chris Wilson wrote: On Wed, Mar 18, 2015 at 11:53:16AM +0900, Michel Dänzer wrote:

[Intel-gfx] [PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-19 Thread Ville Syrjälä
On Thu, Mar 19, 2015 at 03:33:11PM +0100, Daniel Vetter wrote: > On Wed, Mar 18, 2015 at 03:52:56PM +0100, Mario Kleiner wrote: > > On 03/18/2015 10:30 AM, Chris Wilson wrote: > > >On Wed, Mar 18, 2015 at 11:53:16AM +0900, Michel Dänzer wrote: > > >>drm_vblank_count_and_time() doesn't return the

[Intel-gfx] [PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-19 Thread Chris Wilson
On Thu, Mar 19, 2015 at 03:13:15PM +, Chris Wilson wrote: > Pretty much an igt that compared the speed of just querying the hw > counter vs querying with a regular vblank interrupt would be ideal for > measuring the impact here. ickle at crystalwell:/usr/src/intel-gpu-tools$ sudo

[Intel-gfx] [PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-19 Thread Daniel Vetter
On Wed, Mar 18, 2015 at 03:52:56PM +0100, Mario Kleiner wrote: > On 03/18/2015 10:30 AM, Chris Wilson wrote: > >On Wed, Mar 18, 2015 at 11:53:16AM +0900, Michel Dänzer wrote: > >>drm_vblank_count_and_time() doesn't return the correct sequence number > >>while the vblank interrupt is disabled,

[Intel-gfx] [PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-19 Thread Chris Wilson
On Thu, Mar 19, 2015 at 05:04:19PM +0200, Ville Syrjälä wrote: > Is enabling the interrupts the expensive part, or is it the actual > double timestamp read + scanout pos read? Or is it due to the several > spinlocks we have in this code? Chiefly it was the read during disable, then the

[PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-18 Thread Mario Kleiner
On 03/18/2015 10:30 AM, Chris Wilson wrote: > On Wed, Mar 18, 2015 at 11:53:16AM +0900, Michel Dänzer wrote: >> drm_vblank_count_and_time() doesn't return the correct sequence number >> while the vblank interrupt is disabled, does it? It returns the sequence >> number from the last time

[PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-18 Thread Michel Dänzer
On 18.03.2015 11:53, Michel Dänzer wrote: > On 18.03.2015 00:44, Chris Wilson wrote: >> When userspace queries the current vblank for the CRTC, we can reply >> with the cached value (using atomic reads to serialise with the vblank >> interrupt as necessary) without having to touch registers. In

[PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-18 Thread Michel Dänzer
On 18.03.2015 00:44, Chris Wilson wrote: > When userspace queries the current vblank for the CRTC, we can reply > with the cached value (using atomic reads to serialise with the vblank > interrupt as necessary) without having to touch registers. In the > instant disable case, this saves us from

[PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-18 Thread Chris Wilson
On Wed, Mar 18, 2015 at 11:53:16AM +0900, Michel Dänzer wrote: > drm_vblank_count_and_time() doesn't return the correct sequence number > while the vblank interrupt is disabled, does it? It returns the sequence > number from the last time vblank_disable_and_save() was called (when the > vblank

[PATCH] drm: Return current vblank value for drmWaitVBlank queries

2015-03-17 Thread Chris Wilson
When userspace queries the current vblank for the CRTC, we can reply with the cached value (using atomic reads to serialise with the vblank interrupt as necessary) without having to touch registers. In the instant disable case, this saves us from enabling/disabling the vblank around every query,