drm vblank regression fixes for Linux 4.4+

2016-02-08 Thread Mario Kleiner
Here is the series of patches with fixes for regressions in vblank counting/timestamping caused by the rewrite of drm_update_vblank_count in Linux 4.4. These are all meant for stable 4.4 and later. I have tested them on radeon-kms and nouveau-kms by unplugging/replugging displays, manual dpms

[PATCH 1/2] drm/radeon: Use drm_vblank_off/on to fix vblank counter trouble.

2016-02-07 Thread Mario Kleiner
: > On 01/22/2016 06:08 PM, Mario Kleiner wrote: >> Anyway, some more hours of thinking and code browsing later, now i think >> i have a simple and safe solution which should hopefully restore the >> drm_vblank_pre/post_modeset behaviour with only a few lines of core >> code.

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-25 Thread Mario Kleiner
On 01/25/2016 09:32 PM, Daniel Vetter wrote: > On Mon, Jan 25, 2016 at 08:30:14PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 07:51 PM, Daniel Vetter wrote: >>> On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: >>>> Readding Dan

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-25 Thread Mario Kleiner
On 01/25/2016 07:51 PM, Daniel Vetter wrote: > On Mon, Jan 25, 2016 at 05:38:30PM +0100, Mario Kleiner wrote: >> Readding Daniel, which somehow got dropped from the cc. >> >> On 01/25/2016 03:53 PM, Ville Syrjälä wrote: >>> On Mon, Jan 25, 2016 at 02:44:5

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-25 Thread Mario Kleiner
Readding Daniel, which somehow got dropped from the cc. On 01/25/2016 03:53 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:44:53PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 02:23 PM, Ville Syrjälä wrote: >>> On Mon, Jan 25, 2016 at 02:16:4

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-25 Thread Mario Kleiner
On 01/25/2016 02:23 PM, Ville Syrjälä wrote: > On Mon, Jan 25, 2016 at 02:16:45PM +0100, Mario Kleiner wrote: >> >> >> On 01/25/2016 05:15 AM, Michel Dänzer wrote: >>> On 23.01.2016 00:18, Ville Syrjälä wrote: >>>> On Fri, Jan 22, 2016

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-25 Thread Mario Kleiner
On 01/25/2016 05:15 AM, Michel Dänzer wrote: > On 23.01.2016 00:18, Ville Syrjälä wrote: >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >>> >>> [ Trimming KDE folks from Cc ] >>> >>> On 21.01.2016 19:09, Daniel Vetter wrote: On Thu, Jan 21, 2016 at 05:36:46PM +0900,

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-23 Thread Mario Kleiner
On 01/22/2016 07:29 PM, Mario Kleiner wrote: > > > On 01/22/2016 04:18 PM, Ville Syrjälä wrote: >> On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >>> >>> [ Trimming KDE folks from Cc ] >>> >>> On 21.01.2016 19:09, Daniel Ve

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-22 Thread Mario Kleiner
On 01/22/2016 04:18 PM, Ville Syrjälä wrote: > On Fri, Jan 22, 2016 at 12:06:00PM +0900, Michel Dänzer wrote: >> >> [ Trimming KDE folks from Cc ] >> >> On 21.01.2016 19:09, Daniel Vetter wrote: >>> On Thu, Jan 21, 2016 at 05:36:46PM +0900, Michel Dänzer wrote: On 21.01.2016 16:58,

[PATCH 1/2] drm/radeon: Use drm_vblank_off/on to fix vblank counter trouble.

2016-01-22 Thread Mario Kleiner
On 01/22/2016 04:17 AM, Michel Dänzer wrote: > On 21.01.2016 18:16, Mario Kleiner wrote: >> On 01/21/2016 09:25 AM, Michel Dänzer wrote: >>> On 21.01.2016 17:16, Mario Kleiner wrote: >>>> >>>> This patch replaces calls to drm_vblank_pre/post_modese

[PATCH 1/2] drm/radeon: Use drm_vblank_off/on to fix vblank counter trouble.

2016-01-21 Thread Mario Kleiner
On 01/21/2016 09:25 AM, Michel Dänzer wrote: > On 21.01.2016 17:16, Mario Kleiner wrote: >> >> This patch replaces calls to drm_vblank_pre/post_modeset in the >> drivers dpms code with calls to drm_vblank_off/on, as recommended >> for drivers with hw counters that r

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-21 Thread Mario Kleiner
On 01/21/2016 07:38 AM, Michel Dänzer wrote: > On 21.01.2016 14:31, Mario Kleiner wrote: >> On 01/21/2016 04:43 AM, Michel Dänzer wrote: >>> On 21.01.2016 05:32, Mario Kleiner wrote: >>>> >>>> So the problem is that AMDs hardware frame counters reset

[PATCH 1/2] drm/radeon: Use drm_vblank_off/on to fix vblank counter trouble.

2016-01-21 Thread Mario Kleiner
ppen. However that glitch would hopefully be hidden by the blanking of the crtc during modeset. A small fix to power management makes sure to check for this and prevent unbalanced vblank reference counts due to mismatched drm_vblank_get/put. Reported-by: Vlastimil Babka Signed-off-by: Mario Kleine

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-21 Thread Mario Kleiner
On 01/21/2016 04:43 AM, Michel Dänzer wrote: > On 21.01.2016 05:32, Mario Kleiner wrote: >> >> So the problem is that AMDs hardware frame counters reset to >> zero during a modeset. The old DRM code dealt with drivers doing that by >> keeping vblank irqs enabled durin

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-20 Thread Mario Kleiner
On 01/18/2016 11:49 AM, Vlastimil Babka wrote: > On 01/16/2016 05:24 AM, Mario Kleiner wrote: >> >> >> On 01/15/2016 01:26 PM, Ville Syrjälä wrote: >>> On Fri, Jan 15, 2016 at 11:34:08AM +0100, Vlastimil Babka wrote: >> >> I'm currently running... &g

linux-4.4 bisected: kwin5 stuck on kde5 loading screen with radeon

2016-01-16 Thread Mario Kleiner
On 01/15/2016 01:26 PM, Ville Syrjälä wrote: > On Fri, Jan 15, 2016 at 11:34:08AM +0100, Vlastimil Babka wrote: >> Hi, >> >> since kernel 4.4 I'm unable to login to kde5 desktop (on openSUSE >> Tumbleweed). There's a screen with progressbar showing the startup, >> which normally fades away

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events

2015-12-01 Thread Mario Kleiner
happen before the actual vblank >>>>> period. Therefore that functionality got semi-disabled in >>>>> >>>>> commit af4870e406126b7ac0ae7c7ce5751f25ebe60f28 >>>>> Author: Mario Kleiner >>>>> Date: Tue May 13 00:42:08 20

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-27 Thread Mario Kleiner
On 11/25/2015 08:38 PM, Alex Deucher wrote: > On Wed, Nov 25, 2015 at 1:21 PM, Mario Kleiner > wrote: >> On 11/25/2015 06:58 PM, Ville Syrjälä wrote: >>> >>> On Wed, Nov 25, 2015 at 06:24:13PM +0100, Mario Kleiner wrote: >>>> >>

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-27 Thread Mario Kleiner
On 11/25/2015 08:36 PM, Ville Syrjälä wrote: > On Wed, Nov 25, 2015 at 08:04:26PM +0100, Mario Kleiner wrote: >> On 11/25/2015 06:46 PM, Ville Syrjälä wrote: ... >> Attached is my current patch i wanted to submit for the drm core's >> drm_update_vblank_count(). I th

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-25 Thread Mario Kleiner
On 11/25/2015 06:46 PM, Ville Syrjälä wrote: > On Wed, Nov 25, 2015 at 06:24:13PM +0100, Mario Kleiner wrote: >> On 11/23/2015 09:24 PM, Ville Syrjälä wrote: >>> On Mon, Nov 23, 2015 at 06:58:34PM +0100, Mario Kleiner wrote: >>>> >>>> >>

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-25 Thread Mario Kleiner
On 11/25/2015 06:58 PM, Ville Syrjälä wrote: > On Wed, Nov 25, 2015 at 06:24:13PM +0100, Mario Kleiner wrote: >> On 11/23/2015 09:24 PM, Ville Syrjälä wrote: >>> On Mon, Nov 23, 2015 at 06:58:34PM +0100, Mario Kleiner wrote: >>>> >>>> >>

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-25 Thread Mario Kleiner
On 11/23/2015 09:24 PM, Ville Syrjälä wrote: > On Mon, Nov 23, 2015 at 06:58:34PM +0100, Mario Kleiner wrote: >> >> >> On 11/23/2015 04:51 PM, Ville Syrjälä wrote: >>> On Mon, Nov 23, 2015 at 04:23:21PM +0100, Mario Kleiner wrote: >>>> On

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-23 Thread Mario Kleiner
t; that fix exists on radeon already. Michel should have more info on that. > > See other comments inline. > > Thanks, > Harry > > > On 2015-11-23 11:02 AM, Mario Kleiner wrote: >> On 11/20/2015 04:42 AM, Alex Deucher wrote: >>> On Thu, Nov 19, 2015 at 12:46 PM, Ma

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-23 Thread Mario Kleiner
On 11/23/2015 04:51 PM, Ville Syrjälä wrote: > On Mon, Nov 23, 2015 at 04:23:21PM +0100, Mario Kleiner wrote: >> On 11/20/2015 04:34 PM, Ville Syrjälä wrote: >>> On Fri, Nov 20, 2015 at 04:24:50PM +0100, Mario Kleiner wrote: >> >> ... >> Ok, but why would

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-23 Thread Mario Kleiner
On 11/20/2015 04:42 AM, Alex Deucher wrote: > On Thu, Nov 19, 2015 at 12:46 PM, Mario Kleiner > wrote: >> Hi Alex and Michel and Ville, >> >> it's "fix vblank stuff" time again ;-) > > Adding Harry from our display team. He might be able to fill in the &

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-23 Thread Mario Kleiner
On 11/20/2015 04:34 PM, Ville Syrjälä wrote: > On Fri, Nov 20, 2015 at 04:24:50PM +0100, Mario Kleiner wrote: ... >> What we do in radeon-kms is similar. If DRM_CALLED_FROM_VBLIRQ and we >> are no more than 1% of the display height away from start of vblank we >> f

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-20 Thread Mario Kleiner
On 11/19/2015 08:45 PM, Ville Syrjälä wrote: > On Thu, Nov 19, 2015 at 08:12:24PM +0100, Mario Kleiner wrote: >> On 11/19/2015 07:20 PM, Ville Syrjälä wrote: >>> On Thu, Nov 19, 2015 at 06:46:28PM +0100, Mario Kleiner wrote: >>>> Hi Alex and Michel and Ville, &g

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-19 Thread Mario Kleiner
On 11/19/2015 07:20 PM, Ville Syrjälä wrote: > On Thu, Nov 19, 2015 at 06:46:28PM +0100, Mario Kleiner wrote: >> Hi Alex and Michel and Ville, >> >> it's "fix vblank stuff" time again ;-) >> >> Ville's changes to the DRM's drm_handle_vblank() / >

Funky new vblank counter regressions in Linux 4.4-rc1

2015-11-19 Thread Mario Kleiner
Hi Alex and Michel and Ville, it's "fix vblank stuff" time again ;-) Ville's changes to the DRM's drm_handle_vblank() / drm_update_vblank_count() code in Linux 4.4 not only made that code more elegant, but also removed the robustness against the vblank irq quirks in AMD hw and similar

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events (v3)

2015-11-10 Thread Mario Kleiner
On 11/10/2015 05:00 PM, Thierry Reding wrote: > On Tue, Nov 10, 2015 at 03:54:52PM +0100, Mario Kleiner wrote: >> From: Daniel Vetter >> >> Apparently pre-nv50 pageflip events happen before the actual vblank >> period. Therefore that functionality got se

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events (v3)

2015-11-10 Thread Mario Kleiner
From: Daniel Vetter <daniel.vet...@ffwll.ch> Apparently pre-nv50 pageflip events happen before the actual vblank period. Therefore that functionality got semi-disabled in commit af4870e406126b7ac0ae7c7ce5751f25ebe60f28 Author: Mario Kleiner Date: Tue May 13 00:42:08 2014 +0200

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events (v2)

2015-11-09 Thread Mario Kleiner
On 11/09/2015 02:02 PM, Ilia Mirkin wrote: > On Mon, Nov 9, 2015 at 7:57 AM, Mario Kleiner > wrote: >> From: Daniel Vetter >> >> Apparently pre-nv50 pageflip events happen before the actual vblank >> period. Therefore that functionality got

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events

2015-11-09 Thread Mario Kleiner
On 11/06/2015 06:19 PM, Thierry Reding wrote: > Cc += Mario Kleiner, Mario, can you take a look whether this proposed > solution makes sense and fixes the issues you were seeing back when you > posted the patch in commit: > > commit af4870e406126b7ac0ae7c7ce5751f25ebe60f28 > Aut

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events (v2)

2015-11-09 Thread Mario Kleiner
From: Daniel Vetter <daniel.vet...@ffwll.ch> Apparently pre-nv50 pageflip events happen before the actual vblank period. Therefore that functionality got semi-disabled in commit af4870e406126b7ac0ae7c7ce5751f25ebe60f28 Author: Mario Kleiner Date: Tue May 13 00:42:08 2014 +0200

[PATCH] drm/nouveau: Fix pre-nv50 pageflip events

2015-11-08 Thread Mario Kleiner
Sorry for the late reply! Looking into it... -mario On 11/06/2015 06:19 PM, Thierry Reding wrote: > Cc += Mario Kleiner, Mario, can you take a look whether this proposed > solution makes sense and fixes the issues you were seeing back when you > posted the patch in commit: &

[PATCH] drm/i915: Only dither on 6bpc panels

2015-08-13 Thread Mario Kleiner
with my measurement equipment and on the internal laptop 6 bpc panel, and everything is fine now - No banding on the 6 bpc panel, no banding or equipment failure on the external 8 bpc output. Life is good again :) Reviewed-and-tested-by: Mario Kleiner thanks, -mario > Cc: Mario Kleine

Intel-kms in Linux-4.2rc causes regression due to dithering always on.

2015-08-12 Thread Mario Kleiner
On 08/07/2015 09:14 AM, Daniel Vetter wrote: > On Fri, Aug 07, 2015 at 12:45:52AM +0200, Mario Kleiner wrote: >> On 08/07/2015 12:12 AM, Daniel Vetter wrote: >>> On Thu, Aug 6, 2015 at 11:56 PM, Mario Kleiner >>> wrote: >>>> Hi Daniel and all, >>>&

Intel-kms in Linux-4.2rc causes regression due to dithering always on.

2015-08-07 Thread Mario Kleiner
On 08/07/2015 12:12 AM, Daniel Vetter wrote: > On Thu, Aug 6, 2015 at 11:56 PM, Mario Kleiner > wrote: >> Hi Daniel and all, >> >> since Linux 4.2 (tested with rc4), i think this commit >> d328c9d78d64ca11e744fe227096990430a88477 >> "drm/i915: Select star

Intel-kms in Linux-4.2rc causes regression due to dithering always on.

2015-08-07 Thread Mario Kleiner
Hi Daniel and all, since Linux 4.2 (tested with rc4), i think this commit d328c9d78d64ca11e744fe227096990430a88477 "drm/i915: Select starting pipe bpp irrespective or the primary plane" causes trouble for me and my users, as tested on Intel HD Ironlake and Ivy Bridge with

[PATCH 2/2] drm/amdgpu: Handle irqs only based on irq ring, not irq status regs.

2015-07-03 Thread Mario Kleiner
This is a translation of the patch ... "drm/radeon: Handle irqs only based on irq ring, not irq status regs." ... for the vblank irq handling, to fix the same problem described in that patch on the new driver. Only compile tested due to lack of suitable hw. Signed-off-by: Mario K

[PATCH 1/2] drm/radeon: Handle irqs only based on irq ring, not irq status regs.

2015-07-03 Thread Mario Kleiner
HD-5770 card tested on all three available crtcs (D1/D2/D3). The r600 and evergreen irq handling is therefore tested, but the cik an si handling is only compile tested due to lack of hw. Signed-off-by: Mario Kleiner CC: Michel Dänzer CC: Alex Deucher CC: # v3.16+ --- drivers/gpu/drm

[PATCH] drm/nouveau: Use drm_vblank_on/off consistently

2015-06-17 Thread Mario Kleiner
On 06/15/2015 08:07 AM, Daniel Vetter wrote: > In > > commit 9cba5efab5a8145ae6c52ea273553f069c294482 > Author: Mario Kleiner > Date: Tue Jul 29 02:36:44 2014 +0200 > > drm/nouveau: Dis/Enable vblank irqs during suspend/resume > > drm_vblank_on/off calls where

[PATCH 1/3] drm/nouveau: Use drm_vblank_on/off consistently

2015-06-05 Thread Mario Kleiner
On 05/29/2015 07:35 PM, Daniel Vetter wrote: > On Fri, May 29, 2015 at 07:23:35PM +0200, Mario Kleiner wrote: >> >> >> On 05/29/2015 07:19 PM, Daniel Vetter wrote: >>> On Fri, May 29, 2015 at 06:50:06PM +0200, Mario Kleiner wrote: >>>> O

[PATCH 1/3] drm/nouveau: Use drm_vblank_on/off consistently

2015-05-29 Thread Mario Kleiner
On 05/29/2015 07:19 PM, Daniel Vetter wrote: > On Fri, May 29, 2015 at 06:50:06PM +0200, Mario Kleiner wrote: >> On 05/27/2015 11:04 AM, Daniel Vetter wrote: >>> In >>> >>> commit 9cba5efab5a8145ae6c52ea273553f069c294482 >>> Author: Mario Kleine

[PATCH 1/3] drm/nouveau: Use drm_vblank_on/off consistently

2015-05-29 Thread Mario Kleiner
On 05/27/2015 11:04 AM, Daniel Vetter wrote: > In > > commit 9cba5efab5a8145ae6c52ea273553f069c294482 > Author: Mario Kleiner > Date: Tue Jul 29 02:36:44 2014 +0200 > > drm/nouveau: Dis/Enable vblank irqs during suspend/resume > > drm_vblank_on/off calls where

[Intel-gfx] [PATCH] drm/plane-helper: Adapt cursor hack to transitional helpers

2015-05-21 Thread Mario Kleiner
f (!crtc[i]) > continue; > > + if (crtc[i]->cursor == plane) > + continue; > + > /* There's no other way to figure out whether the crtc is > running. */ > ret = drm_crtc_vblank_get(crtc[i]); > i

[xf86-video-nouveau] dri2: Enable BufferAge support

2015-05-09 Thread Mario Kleiner
As nouveau does not exactly support TripleBuffer, we > don't have to worry about setting the copying the flags field when > injecting the third buffer. > > Signed-off-by: Chris Wilson > Cc: Maarten Lankhorst > Cc: Mario Kleiner > --- > src/nouveau_dri2.c | 7 +++ >

Tiny fixes - resent

2015-05-09 Thread Mario Kleiner
On 05/04/2015 11:15 AM, Daniel Vetter wrote: > On Mon, May 04, 2015 at 06:29:43AM +0200, Mario Kleiner wrote: >> Hi, a resend of updated versions of the earlier patches: >> >> Patch 1 should really get into Linux 4.1 to avoid tegra breaking >> user-space clients. >&

[Intel-gfx] [PATCH] drm/vblank: Fixup and document timestamp update/read barriers

2015-05-07 Thread Mario Kleiner
ote: >>>>> On 05/04/2015 12:52 AM, Mario Kleiner wrote: >>>>>> On 04/16/2015 03:03 PM, Daniel Vetter wrote: >>>>>>> On Thu, Apr 16, 2015 at 08:30:55AM -0400, Peter Hurley wrote: >>>>>>>> On 04/15/2015 01:31 PM, Danie

[PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off)

2015-05-04 Thread Mario Kleiner
On 04/15/2015 03:03 AM, Mario Kleiner wrote: > On 04/02/2015 01:34 PM, Chris Wilson wrote: >> On vblank instant-off systems, we can get into a situation where the cost >> of enabling and disabling the vblank IRQ around a drmWaitVblank query >> dominates. However, we know t

[Intel-gfx] [PATCH] drm/vblank: Fixup and document timestamp update/read barriers

2015-05-04 Thread Mario Kleiner
gt;write-side comment 3 times extract a little store_vblank() helper. >>>>>In that helper also assert that we do indeed hold >>>>>dev->vblank_time_lock, since in some cases the lock is acquired a >>>>

[PATCH 4/5] drm/qxl: Fix qxl_noop_get_vblank_counter()

2015-05-04 Thread Mario Kleiner
() is found in many of the new kms drivers, but it does exactly nothing different from returning any arbitrary constant - it's a no operation. Let's simply return 0 - Easy and fast. Signed-off-by: Mario Kleiner Cc: Dave Airlie --- drivers/gpu/drm/qxl/qxl_drv.c | 2 +- 1 file changed, 1 insertion

[PATCH 3/5] drm: Zero out invalid vblank timestamp in drm_update_vblank_count. (v2)

2015-05-04 Thread Mario Kleiner
to stable kernels. Signed-off-by: Mario Kleiner Cc: Ville Syrjälä Cc: Daniel Vetter Cc: Dave Airlie --- drivers/gpu/drm/drm_irq.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 152d1de..44e6a20b 100644

[PATCH 2/5] drm: Prevent invalid use of vblank_disable_immediate. (v2)

2015-05-04 Thread Mario Kleiner
-by: Mario Kleiner Reviewed-by: Michel Dänzer Cc: Dave Airlie --- drivers/gpu/drm/drm_irq.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 9c166b4..152d1de 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm

[PATCH 1/5] drm/tegra: Don't use vblank_disable_immediate on incapable driver.

2015-05-04 Thread Mario Kleiner
during vblank disable/enable if the scanout is inside vblank at en/disable time, and additionally clients will never see any useable vblank timestamps when querying via drmWaitVblank ioctl. This would negatively affect swap scheduling under X11 and Wayland. Signed-off-by: Mario Kleiner Cc: Thierry Redi

Tiny fixes - resent

2015-05-04 Thread Mario Kleiner
Hi, a resend of updated versions of the earlier patches: Patch 1 should really get into Linux 4.1 to avoid tegra breaking user-space clients. Patch 2 reviewed-by Michel, updated to take his feedback into account. Patch 3 is modified to not conflict with Daniel Vetter's patch "drm/vblank: Fixup

[PATCH] drm/vblank: Fixup and document timestamp update/read barriers

2015-04-16 Thread Mario Kleiner
On 04/16/2015 03:29 AM, Peter Hurley wrote: > On 04/15/2015 05:26 PM, Mario Kleiner wrote: >> A couple of questions to educate me and one review comment. >> >> On 04/15/2015 07:34 PM, Daniel Vetter wrote: >>> This was a bit too much cargo-culted, so lets make it soli

[PATCH] drm/vblank: Fixup and document timestamp update/read barriers

2015-04-16 Thread Mario Kleiner
2nd smp_wmb is redundant with the > implicit barrier in the spin_unlock. But that can only be proven by > auditing all callers and my point in extracting this little helper was > to localize all the locking into just one place. Hence I think that > additional optimization is too risky. >

[PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off)

2015-04-15 Thread Mario Kleiner
errupt will be disabled after every IRQ and the user > will enabled it again on the first query following the IRQ. > > Testcase: igt/kms_vblank > Signed-off-by: Chris Wilson > Cc: Ville Syrjälä > Cc: Daniel Vetter > Cc: Michel Dänzer > Cc: Laurent Pinchart > Cc: Dave Airl

[PATCH 1/2] drm: Shortcircuit vblank queries

2015-04-14 Thread Mario Kleiner
On 04/14/2015 08:36 PM, Chris Wilson wrote: > On Tue, Apr 14, 2015 at 08:22:20PM +0200, Mario Kleiner wrote: >> On 04/05/2015 05:40 PM, Chris Wilson wrote: >>> Avoid adding to the waitqueue and reprobing the current vblank if the >>> caller is only querying

[PATCH 2/2] drm: Shortcircuit vblank queries

2015-04-14 Thread Mario Kleiner
t; Cc: Ville Syrjälä > Cc: Daniel Vetter > Cc: Michel Dänzer > Cc: Laurent Pinchart > Cc: Dave Airlie , > Cc: Mario Kleiner > --- > drivers/gpu/drm/drm_irq.c | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git a/drivers/gpu/d

[PATCH 1/2] drm: Shortcircuit vblank queries

2015-04-14 Thread Mario Kleiner
gt; Cc: Daniel Vetter > Cc: Michel Dänzer > Cc: Laurent Pinchart > Cc: Dave Airlie , > Cc: Mario Kleiner > --- > drivers/gpu/drm/drm_irq.c | 18 ++ > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/drm_irq.c

[PATCH 1/2] drm: Shortcircuit vblank queries

2015-04-14 Thread Mario Kleiner
On 04/14/2015 04:21 PM, Chris Wilson wrote: > On Tue, Apr 14, 2015 at 06:42:03PM +0900, Michel Dänzer wrote: >> Also, the two patches should have different and more specific shortlogs. > > Second patch: > > drm: Query vblank counters directly for known accurate state > > ? > When i applied your

[PATCH 3/3] drm/tegra: Don't use vblank_disable_immediate on incapable driver.

2015-04-14 Thread Mario Kleiner
during vblank disable/enable if the scanout is inside vblank at en/disable time, and additionally clients will never see any useable vblank timestamps when querying via drmWaitVblank ioctl. This would negatively affect swap scheduling under X11 and Wayland. Signed-off-by: Mario Kleiner Cc: Thierry Redi

[PATCH 2/3] drm: Prevent invalid use of vblank_disable_immediate.

2015-04-14 Thread Mario Kleiner
which claims to be capable of vblank_disable_immediate at least supports high precision timestamping and prevent use of instant disable if that isn't present as a minimum requirement. Signed-off-by: Mario Kleiner Cc: Ville Syrjälä Cc: Michel Dänzer Cc: Thierry Reding Cc: Dave Airlie

[PATCH 1/3] drm: Zero out invalid vblank timestamp in drm_update_vblank_count.

2015-04-14 Thread Mario Kleiner
, but at the same time preserves the improvements made in the commit mentioned above. Signed-off-by: Mario Kleiner Cc: #v3.17+ Cc: Ville Syrjälä Cc: Daniel Vetter Cc: Dave Airlie --- drivers/gpu/drm/drm_irq.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu

[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:16

[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/qxl: Use drm_vblank_count()

2014-12-17 Thread Mario Kleiner
On 12/17/2014 10:37 AM, Ville Syrjälä wrote: > On Wed, Dec 17, 2014 at 03:57:51AM +0100, Mario Kleiner wrote: >> On 12/15/2014 04:56 PM, Thierry Reding wrote: >>> From: Thierry Reding >>> >>> The QXL driver duplicates part of the core's drm_vblank_count(), so

[PATCH] drm/qxl: Use drm_vblank_count()

2014-12-17 Thread Mario Kleiner
On 12/15/2014 04:56 PM, Thierry Reding wrote: > From: Thierry Reding > > The QXL driver duplicates part of the core's drm_vblank_count(), so it > might as well use the core's variant for the extra goodies. > > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/qxl/qxl_drv.c | 7 +-- >

[PATCH weston 1/1] compositor: Abort on bad page flip timestamps

2014-11-07 Thread Mario Kleiner
ston >>> with an appropriate exit code to help developers debug their drivers. >> >> That seems a bit harsh. IIRC, zero can be returned for the timestamp >> intermittently if no accurate timestamp value can be determined, e.g. >> because the CRTC is disabled. At the v

[Intel-gfx] [PATCH 14/19] drm: Don't update vblank timestamp when the counter didn't change

2014-09-23 Thread Mario Kleiner
On 23/09/14 15:51, Daniel Vetter wrote: > On Tue, Sep 23, 2014 at 03:48:25PM +0300, Jani Nikula wrote: >> On Mon, 15 Sep 2014, Daniel Vetter wrote: >>> On Sat, Sep 13, 2014 at 06:25:54PM +0200, Mario Kleiner wrote: >>>> The current drm-next misses Ville's origina

[PATCH 14/19] drm: Don't update vblank timestamp when the counter didn't change

2014-09-13 Thread Mario Kleiner
The current drm-next misses Ville's original Patch 14/19, the one i first objected, then objected to my objection. It is needed to avoid actual regressions. Attached a trivially rebased (v2) of Ville's patch to go on top of drm-next, also as tgz in case my e-mail client mangles the patch

[PATCH 3/4] drm: Simplify return value of drm_get_last_vbltimestamp

2014-09-11 Thread Mario Kleiner
Maybe then also remove EXPORT_SYMBOL(drm_get_last_vbltimestamp); in this patch if the method is now static to drm_irq.c ? Up to you. For all 4 patches... Reviewed-by: Mario Kleiner -mario > Cc: Mario Kleiner > Cc: Ville Syrj?l? > Signed-off-by: Daniel Vetter > --- >

[Intel-gfx] [PULL] topic/vblank-rework

2014-09-10 Thread Mario Kleiner
On Wed, Sep 10, 2014 at 5:29 PM, Daniel Vetter wrote: > On Wed, Sep 10, 2014 at 4:19 PM, Mario Kleiner > wrote: >> Hmm, not quite an ack from my side for the pull in its current form. I >> said if the two remaining issues i mentioned are addressed, then i'm >> happy

[Intel-gfx] [PULL] topic/vblank-rework

2014-09-10 Thread Mario Kleiner
or similar applied i'd be happy, otherwise it will inflict pain and real bugs on real users. thanks, -mario On Wed, Sep 10, 2014 at 4:19 PM, Mario Kleiner wrote: > Hmm, not quite an ack from my side for the pull in its current form. I > said if the two remaining issues i men

[Intel-gfx] [PULL] topic/vblank-rework

2014-09-10 Thread Mario Kleiner
/drm-intel tags/topic/vblank-rework-2014-09-10 > > for you to fetch changes up to 2368ffb18b1d2b04eb80478d225676caa7a3c4c8: > > drm: Use vblank_disable_and_save in drm_vblank_cleanup() (2014-09-10 > 09:41:29 +0200) > > > Mario

[PATCH 14/19] drm: Don't update vblank timestamp when the counter didn't change

2014-09-04 Thread Mario Kleiner
I thought about this one again and opposed to my previous comment now think it's fine, also for drivers without hw vblank counter queries. -mario On Wed, Aug 6, 2014 at 1:49 PM, wrote: > From: Ville Syrj?l? > > If we already have a timestamp for the current vblank counter, don't > update it

[PATCH 05/19] drm: Have the vblank counter account for the time between vblank irq disable and drm_vblank_off()

2014-09-02 Thread Mario Kleiner
that query, e.g., by never disabling vblank irq's, except in drm_vblank_off() when a kms-driver insists on disabling its irq during modeset/dpms off/suspend etc. With these remarks somehow taken into account you have my Reviewed-by: Mario Kleiner for the whole series, if you want. thanks, -mario

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-13 Thread Mario Kleiner
On 08/13/2014 03:50 AM, Michel D?nzer wrote: > On 12.08.2014 00:17, Jerome Glisse wrote: >> On Mon, Aug 11, 2014 at 12:11:21PM +0200, Thomas Hellstrom wrote: >>> On 08/10/2014 08:02 PM, Mario Kleiner wrote: >>>> On 08/10/2014 01:03 PM, Thomas Hellstrom wrote: >&

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-12 Thread Mario Kleiner
On 08/11/2014 05:17 PM, Jerome Glisse wrote: > On Mon, Aug 11, 2014 at 12:11:21PM +0200, Thomas Hellstrom wrote: >> On 08/10/2014 08:02 PM, Mario Kleiner wrote: >>> On 08/10/2014 01:03 PM, Thomas Hellstrom wrote: >>>> On 08/10/2014 05:11 AM, Mario Kleiner wrote: >&

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-10 Thread Mario Kleiner
On 08/10/2014 01:03 PM, Thomas Hellstrom wrote: > On 08/10/2014 05:11 AM, Mario Kleiner wrote: >> Resent this time without HTML formatting which lkml doesn't like. Sorry. >> >> On 08/09/2014 03:58 PM, Thomas Hellstrom wrote: >>> On 08/09/2014 03:33 PM, Konrad Rzeszute

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-10 Thread Mario Kleiner
against _manager->options.max_size), but before that check in line 954 there's an uncoditional assignment of npages = count; which seems to force freeing all pages as well, instead of recycling? Is this some debug code left over, or intentional and just me not understanding what happ

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-10 Thread Mario Kleiner
efore that check in line 954 there's an uncoditional assignment of npages = count; which seems to force freeing all pages as well, instead of recycling? Is this some debug code left over, or intentional and just me not understanding what happens there? thanks, -mario > >>> /Thomas >>>

CONFIG_DMA_CMA causes ttm performance problems/hangs.

2014-08-08 Thread Mario Kleiner
Hi all, there is a rather severe performance problem i accidentally found when trying to give Linux 3.16.0 a final test on a x86_64 MacBookPro under Ubuntu 14.04 LTS with nouveau as graphics driver. I was lazy and just installed the Ubuntu precompiled mainline kernel. That kernel happens to

[PATCH 3/3] drm: Use vblank_disable_and_save in drm_vblank_cleanup()

2014-08-07 Thread Mario Kleiner
On 08/07/2014 08:50 AM, Daniel Vetter wrote: > On Thu, Aug 7, 2014 at 2:50 AM, Mario Kleiner > wrote: >> I'm not sure about all the new embedded drivers, if they have hw vblank >> counters? > Quick grep says a lot don't have it or at least not implemented - they > use dr

[PATCH 3/3] drm: Use vblank_disable_and_save in drm_vblank_cleanup()

2014-08-07 Thread Mario Kleiner
On 08/06/2014 03:57 PM, Daniel Vetter wrote: > On Wed, Aug 06, 2014 at 01:51:41PM +0300, Ville Syrj?l? wrote: >> On Wed, Aug 06, 2014 at 03:22:46AM +0200, Mario Kleiner wrote: >>> Calling vblank_disable_fn() will cause that function to no-op >>> if !dev->vblank_disabl

[PATCH 3/3] drm: Use vblank_disable_and_save in drm_vblank_cleanup()

2014-08-06 Thread Mario Kleiner
after drm_vblank_cleanup() completes, it will cause use-after-free access to dev->vblank array. Call vblank_disable_and_save unconditionally, so vblank irqs are guaranteed to be off, before we delete the data structures on which they operate. Signed-off-by: Mario Kleiner Cc: stable at vger.k

[PATCH 2/3] drm: Fix emitted vblank timestamps in drm_vblank_off()

2014-08-06 Thread Mario Kleiner
-by: Mario Kleiner Cc: stable at vger.kernel.org --- drivers/gpu/drm/drm_irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 553a58c..89e91e3 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm

[PATCH 1/3] drm: Remove drm_vblank_cleanup from drm_vblank_init error path.

2014-08-06 Thread Mario Kleiner
drm_vblank_cleanup() would operate on non-existent dev->vblank data structure, as failure to allocate that data structure is what triggers the error path in the first place. Signed-off-by: Mario Kleiner Cc: stable at vger.kernel.org --- drivers/gpu/drm/drm_irq.c | 2 +- 1 file changed

drm vblank fixes

2014-08-06 Thread Mario Kleiner
Hi all, some small bug fixes for some small bugs i saw when looking at the current drm vblank handling code. All patches are rather simple, all compile-tested against drm-next, but only the drm_vblank_off() one (patch 2) tested in "real life" so far. thanks, -mario

[PATCH 13/14] drm/radeon: Move the early vblank IRQ fixup to radeon_get_crtc_scanoutpos()

2014-01-13 Thread Mario Kleiner
On 29/10/13 19:06, ville.syrjala at linux.intel.com wrote: > From: Ville Syrj?l? > > i915 doesn't need this kludge for most platforms. Although we do > appear to need something similar on certain platforms, but we can > be more accurate when we apply the adjustment since we know exactly > why the

[PATCH 12/14] drm: Pass 'flags' from the caller to .get_scanout_position()

2014-01-13 Thread Mario Kleiner
On 29/10/13 19:06, ville.syrjala at linux.intel.com wrote: > From: Ville Syrj?l? > > Preparation for moving the early vblank IRQ logic into > radeon_get_crtc_scanoutpos(). > > Signed-off-by: Ville Syrj?l? Tiny compile fix needed for this one. The function prototype for

[PATCH 00/14] drm: Some more vblank timestampi changes

2014-01-13 Thread Mario Kleiner
On 29/10/13 19:06, ville.syrjala at linux.intel.com wrote: > So I took another look at the vblank timestamping code, and got a bit > excited. The result is this patchset. > > Summary of changes: > - kill crtc->hwmode dependency > - eliminate a bunch of 64bit math > - fix timestamps for

[PATCH 00/14] drm: Some more vblank timestampi changes

2013-11-30 Thread Mario Kleiner
On 29/11/13 14:36, Ville Syrj?l? wrote: > On Wed, Nov 06, 2013 at 01:46:41PM +1000, Dave Airlie wrote: >> On Wed, Oct 30, 2013 at 4:06 AM, wrote: >>> So I took another look at the vblank timestamping code, and got a bit >>> excited. The result is this patchset. >> >> I'd like to merge this, I

[PATCH 4/4] drm/intel: Push get_scanout_position() timestamping into kms driver.

2013-10-30 Thread Mario Kleiner
ery retries. After : Typically 1 usec (98% of all samples), occassionally 2 usecs (2% of all samples), with maximum of 3 usecs (a handful). v2: Fix formatting of new multi-line code comments. Signed-off-by: Mario Kleiner Reviewed-by: Ville Syrj?l? Reviewed-by: Alex Deucher --- drivers/gpu/

[PATCH 3/4] drm/radeon: Push get_scanout_position() timestamping into kms driver.

2013-10-30 Thread Mario Kleiner
Move the ktime_get() clock readouts and potential preempt_disable() calls from drm core into kms driver to make it compatible with the api changes in the drm core. This should not introduce any change in functionality or behaviour in radeon-kms, just a reshuffling of code. Signed-off-by: Mario

[PATCH 2/4] drm: Push latency sensitive bits of vblank scanoutpos timestamping into kms drivers.

2013-10-30 Thread Mario Kleiner
sition ... ... no taking of locks allowed here! ... if (etime) *etime = ktime_get(); preempt_enable_rt(); // On PREEMPT_RT kernel, otherwise omit. spin_unlock...(...); v2: Fix formatting of new multi-line code comments. Signed-off-by: Mario Kleiner Reviewed-by: Ville Syrj?l? Reviewed-by: Alex D

[PATCH 1/4] drm: Remove preempt_disable() from vblank timestamping code.

2013-10-30 Thread Mario Kleiner
Preemption handling will get pushed into the kms drivers in followup patches, to make timestamping more robust and PREEMPT_RT friendly. Signed-off-by: Mario Kleiner Reviewed-by: Ville Syrj?l? Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_irq.c |7 --- 1 file changed, 7 deletions

Vblank timestamping improvements/fixes for Linux drm. [v2]

2013-10-30 Thread Mario Kleiner
Hi Dave, this is v2 of the patch set for improving/restoring accuracy and robustness of vblank timestamping and for fixing incompatibilities with the PREEMPT_RT patches. Could you please merge this for the next kernel? Would be good to have the old accuracy restored as soon as possible. Thanks.

<    1   2   3   4   5   6   >