diff mbox

vsync + vaapi question

Message ID 20151223133826.GU5896@nuc-i3427.alporthouse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Dec. 23, 2015, 1:38 p.m. UTC
On Wed, Dec 23, 2015 at 01:13:46PM +0100, Lukas Hejtmanek wrote:
> On Wed, Dec 23, 2015 at 12:01:44PM +0000, Chris Wilson wrote:
> > The clipped extents of the va-api Window is used to determine which CRTC
> > to use as the vblank source. Hmm, the Primary Output is used as the
> > preference (i.e. if any part of that Window is on the Primary, it is
> > used as the CRTC - the idea being that Primary is important and this
> > should share the vblank source for more Windows and prevent arbitrary
> > jumps between vblank sources as the Window moves).
> 
> just tested, with xv output, vsync seems to be quite ok. however, with va-api
> it not ok on both LVDS and HDMI. HDMI seems to be far worse with va-api (i.e.
> out of sync). Maybe a bug in va-api sync code?

Try (libva):

Comments

Lukas Hejtmanek Dec. 24, 2015, 9:44 a.m. UTC | #1
On Wed, Dec 23, 2015 at 01:38:26PM +0000, Chris Wilson wrote:
> Try (libva):

seems to be much better. I got one lockup though but it may be unrelated.
Thanks, hope you push it into mainstream.
 
> diff --git a/va/x11/dri2_util.c b/va/x11/dri2_util.c
> index d076fb3..9ff5e95 100644
> --- a/va/x11/dri2_util.c
> +++ b/va/x11/dri2_util.c
> @@ -95,8 +95,9 @@ dri2SwapBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable)
>      if (dri2_drawable->has_backbuffer) {
>          if (gsDRI2SwapAvailable) {
>              CARD64 ret;
> -            VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable, 0, 0,
> -                               0, &ret);
> +            VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable,
> +                              0, 1, 0,
> +                              &ret);
>          } else {
>              xrect.x = 0;
>              xrect.y = 0;
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
Chris Wilson Dec. 24, 2015, 3:50 p.m. UTC | #2
On Thu, Dec 24, 2015 at 10:44:46AM +0100, Lukas Hejtmanek wrote:
> On Wed, Dec 23, 2015 at 01:38:26PM +0000, Chris Wilson wrote:
> > Try (libva):
> 
> seems to be much better. I got one lockup though but it may be unrelated.

Unfortunately probably related, since we now enforce synchronisation to
vblank there are a few more bit and pieces involved. 

> Thanks, hope you push it into mainstream.

Patch sent.
-Chris
Lukas Hejtmanek Dec. 24, 2015, 7:28 p.m. UTC | #3
On Thu, Dec 24, 2015 at 03:50:17PM +0000, Chris Wilson wrote:
> On Thu, Dec 24, 2015 at 10:44:46AM +0100, Lukas Hejtmanek wrote:
> > On Wed, Dec 23, 2015 at 01:38:26PM +0000, Chris Wilson wrote:
> > > Try (libva):
> > 
> > seems to be much better. I got one lockup though but it may be unrelated.
> 
> Unfortunately probably related, since we now enforce synchronisation to
> vblank there are a few more bit and pieces involved. 
> 
> > Thanks, hope you push it into mainstream.
> 
> Patch sent.

huh, maybe it is not good idea. Had to revert it because of number of hard 
lockups :(

or are there any patches I can try to fix those lockups?
Chris Wilson Dec. 24, 2015, 7:37 p.m. UTC | #4
On Thu, Dec 24, 2015 at 08:28:25PM +0100, Lukas Hejtmanek wrote:
> On Thu, Dec 24, 2015 at 03:50:17PM +0000, Chris Wilson wrote:
> > On Thu, Dec 24, 2015 at 10:44:46AM +0100, Lukas Hejtmanek wrote:
> > > On Wed, Dec 23, 2015 at 01:38:26PM +0000, Chris Wilson wrote:
> > > > Try (libva):
> > > 
> > > seems to be much better. I got one lockup though but it may be unrelated.
> > 
> > Unfortunately probably related, since we now enforce synchronisation to
> > vblank there are a few more bit and pieces involved. 
> > 
> > > Thanks, hope you push it into mainstream.
> > 
> > Patch sent.
> 
> huh, maybe it is not good idea. Had to revert it because of number of hard 
> lockups :(
> 
> or are there any patches I can try to fix those lockups?

Hard? The fault isn't in libva this time at least.
-Chris
Lukas Hejtmanek Dec. 24, 2015, 7:42 p.m. UTC | #5
On Thu, Dec 24, 2015 at 07:37:18PM +0000, Chris Wilson wrote:
> > huh, maybe it is not good idea. Had to revert it because of number of hard 
> > lockups :(
> > 
> > or are there any patches I can try to fix those lockups?
> 
> Hard? The fault isn't in libva this time at least.

applied patch results in hard lockup when playing a movie (short sound loop
and even sysrq keys are not working). I thought that driver would reset gpu
eventualy but it seems to be completely dead. 

So I reverted the patch and it seems lockups are gone.
Chris Wilson Dec. 24, 2015, 7:55 p.m. UTC | #6
On Thu, Dec 24, 2015 at 08:42:01PM +0100, Lukas Hejtmanek wrote:
> On Thu, Dec 24, 2015 at 07:37:18PM +0000, Chris Wilson wrote:
> > > huh, maybe it is not good idea. Had to revert it because of number of hard 
> > > lockups :(
> > > 
> > > or are there any patches I can try to fix those lockups?
> > 
> > Hard? The fault isn't in libva this time at least.
> 
> applied patch results in hard lockup when playing a movie (short sound loop
> and even sysrq keys are not working). I thought that driver would reset gpu
> eventualy but it seems to be completely dead. 

That's a kernel panic or total machine lockup. Do you have a few
different kernels you can try? Hopefully it's a recent regression.
-Chris
Lukas Hejtmanek Dec. 24, 2015, 7:59 p.m. UTC | #7
On Thu, Dec 24, 2015 at 07:55:42PM +0000, Chris Wilson wrote:
> That's a kernel panic or total machine lockup. Do you have a few
> different kernels you can try? Hopefully it's a recent regression.

the same for ubuntu's kernel 4.2.0 and 4.3.0.
Chris Wilson Dec. 24, 2015, 8:05 p.m. UTC | #8
On Thu, Dec 24, 2015 at 08:59:49PM +0100, Lukas Hejtmanek wrote:
> On Thu, Dec 24, 2015 at 07:55:42PM +0000, Chris Wilson wrote:
> > That's a kernel panic or total machine lockup. Do you have a few
> > different kernels you can try? Hopefully it's a recent regression.
> 
> the same for ubuntu's kernel 4.2.0 and 4.3.0. 

Keep going... Jump to about 3.19
-Chris
Lukas Hejtmanek Dec. 24, 2015, 10:15 p.m. UTC | #9
On Thu, Dec 24, 2015 at 08:05:33PM +0000, Chris Wilson wrote:
> On Thu, Dec 24, 2015 at 08:59:49PM +0100, Lukas Hejtmanek wrote:
> > On Thu, Dec 24, 2015 at 07:55:42PM +0000, Chris Wilson wrote:
> > > That's a kernel panic or total machine lockup. Do you have a few
> > > different kernels you can try? Hopefully it's a recent regression.
> > 
> > the same for ubuntu's kernel 4.2.0 and 4.3.0. 
> 
> Keep going... Jump to about 3.19

tried 3.19.0-42 from ubuntu. lockup as well it just took more time..
Chris Wilson Dec. 24, 2015, 10:22 p.m. UTC | #10
On Thu, Dec 24, 2015 at 11:15:57PM +0100, Lukas Hejtmanek wrote:
> On Thu, Dec 24, 2015 at 08:05:33PM +0000, Chris Wilson wrote:
> > On Thu, Dec 24, 2015 at 08:59:49PM +0100, Lukas Hejtmanek wrote:
> > > On Thu, Dec 24, 2015 at 07:55:42PM +0000, Chris Wilson wrote:
> > > > That's a kernel panic or total machine lockup. Do you have a few
> > > > different kernels you can try? Hopefully it's a recent regression.
> > > 
> > > the same for ubuntu's kernel 4.2.0 and 4.3.0. 
> > 
> > Keep going... Jump to about 3.19
> 
> tried 3.19.0-42 from ubuntu. lockup as well it just took more time..

Hmm. What hardware? Baytrail?
-Chris
Lukas Hejtmanek Dec. 24, 2015, 10:25 p.m. UTC | #11
On Thu, Dec 24, 2015 at 10:22:24PM +0000, Chris Wilson wrote:
> > tried 3.19.0-42 from ubuntu. lockup as well it just took more time..
> 
> Hmm. What hardware? Baytrail?

Lenovo X1 Carbon 2015. Intel(R) HD Graphics 5500 (according to log) 
pci id 8086:1616 (rev 09)
Robert Hooker Dec. 24, 2015, 11:54 p.m. UTC | #12
On Thu, Dec 24, 2015 at 5:25 PM, Lukas Hejtmanek <xhejtman@ics.muni.cz> wrote:
> On Thu, Dec 24, 2015 at 10:22:24PM +0000, Chris Wilson wrote:
>> > tried 3.19.0-42 from ubuntu. lockup as well it just took more time..
>>
>> Hmm. What hardware? Baytrail?
>
> Lenovo X1 Carbon 2015. Intel(R) HD Graphics 5500 (according to log)
> pci id 8086:1616 (rev 09)
>
> --
> Lukáš Hejtmánek
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

The 3.19 distro kernel in ubuntu is using 4.2-ish drm backported on broadwell,
try http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.8-ckt12-vivid/
instead which is stock upstream.
Lukas Hejtmanek Dec. 26, 2015, 3:40 p.m. UTC | #13
On Thu, Dec 24, 2015 at 06:54:44PM -0500, Robert Hooker wrote:
> The 3.19 distro kernel in ubuntu is using 4.2-ish drm backported on broadwell,
> try http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.8-ckt12-vivid/
> instead which is stock upstream.

tried, lockup as well..
Lukas Hejtmanek Jan. 13, 2016, 1:12 p.m. UTC | #14
Hi,

On Thu, Dec 24, 2015 at 08:42:01PM +0100, Lukas Hejtmanek wrote:
> > Hard? The fault isn't in libva this time at least.
> 
> applied patch results in hard lockup when playing a movie (short sound loop
> and even sysrq keys are not working). I thought that driver would reset gpu
> eventualy but it seems to be completely dead. 
> 
> So I reverted the patch and it seems lockups are gone.

For ubuntu, that vaapi sync patch just landed. Had to switch to xv from vaapi
to avoid frequent lockup. Anything out there I can try to fix lockups?
diff mbox

Patch

diff --git a/va/x11/dri2_util.c b/va/x11/dri2_util.c
index d076fb3..9ff5e95 100644
--- a/va/x11/dri2_util.c
+++ b/va/x11/dri2_util.c
@@ -95,8 +95,9 @@  dri2SwapBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable)
     if (dri2_drawable->has_backbuffer) {
         if (gsDRI2SwapAvailable) {
             CARD64 ret;
-            VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable, 0, 0,
-                               0, &ret);
+            VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable,
+                              0, 1, 0,
+                              &ret);
         } else {
             xrect.x = 0;
             xrect.y = 0;