All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 105145] vaExportSurfaceHandle interaction with surface interlaced flag prevents switching on vaapi deinterlacing dynamically
Date: Sat, 17 Feb 2018 12:47:13 +0000	[thread overview]
Message-ID: <bug-105145-502@http.bugs.freedesktop.org/> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3326 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=105145

            Bug ID: 105145
           Summary: vaExportSurfaceHandle interaction with surface
                    interlaced flag prevents switching on vaapi
                    deinterlacing dynamically
           Product: Mesa
           Version: git
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: medium
         Component: Drivers/Gallium/radeonsi
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: k.philipp@gmail.com
        QA Contact: dri-devel@lists.freedesktop.org

When decoding interlaced video with VAAPI and least when using the radeonsi
driver, it is impossible to postproc-deinterlace a frame from a surface that
was used with vaExportSurfaceHandle() before.

This effectively means that it is impossible to dynamically switch on
deinterlacing mid-stream, i.e. after an *interlaced* frame has been shown
unprocessed with vaExportSurfaceHandle.

Try for example with mpv from git:
mpv -vo gpu --hwdec=vaapi /path/to/interlaced/video.mkv
(add --gpu-context=wayland when running under Wayland, else vaapi will not
work)
give it a few seconds and then switch on deinterlacing with the 'd' key.
You will see the error mesage "vaRenderPicture() failed (invalid VASurfaceID)"
and not get any deinterlacing. Having deinterlacing enabled from the beginning
(e.g. with "--deinterlace=yes") works, since no unprocesssed surface is
exported then.

The chain of events seems to be:
- Create surfaces for decoding. They are marked interlaced by default on
radeonsi. (see
https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeonsi/si_get.c?id=9d21dbeb88bc99ca0e153c11265e19536ad36b61#n655
- PREFERS_INTERLACED is always returned as true)
- Export the decoded surfaces with vaExportSurfaceHandle() and present them to
the user. This has the side-effect of making the surfaces non-interlaced (see
https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/va/surface.c?id=9d21dbeb88bc99ca0e153c11265e19536ad36b61#n966)
- Now we want to turn on postproc.
- Create surfaces for postproc. They are, again, marked interlaced by default
- Trying to deinterlace gives VA_STATUS_ERROR_INVALID_SURFACE_ID since it
thinks that the source surface is not interlaced, and that the destination
surface is - both of which is wrong (see
https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/va/postproc.c?id=9d21dbeb88bc99ca0e153c11265e19536ad36b61#n131)

Reporting this against the radeonsi driver since I couldn't test with anything
else, but the issue may really be in how vlVaExportSurfaceHandle works on all
drivers.
On a related note, since the radeonsi driver by default generates interlaced
surfaces when using vaCreateSurfaces, vlVaExportSurfaceHandle making them
progressive seems to be the only reason it correctly bob-deinterlaces at the
moment (MADI seems to be fine because it uses another code path). At least
after all output surfaces have been exported once, before that it just blits. I
also consider this a bug that could now be solved at the same time. If not, I
can open a new ticket for that.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 5185 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2018-02-17 12:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 12:47 bugzilla-daemon [this message]
2018-02-17 13:48 ` [Bug 105145] vaExportSurfaceHandle interaction with surface interlaced flag prevents switching on vaapi deinterlacing dynamically bugzilla-daemon
2018-02-18  8:31 ` bugzilla-daemon
2018-02-19  7:49 ` bugzilla-daemon
2018-02-20 11:55 ` bugzilla-daemon
2018-02-20 12:56 ` bugzilla-daemon
2018-02-20 12:56 ` bugzilla-daemon
2018-02-20 13:51 ` bugzilla-daemon
2018-02-20 14:23 ` bugzilla-daemon
2018-03-07  7:43 ` bugzilla-daemon
2018-04-14 10:14 ` bugzilla-daemon
2018-06-11 12:58 ` bugzilla-daemon
2018-06-11 13:09 ` bugzilla-daemon
2018-06-13 11:15 ` bugzilla-daemon
2019-02-03 12:41 ` bugzilla-daemon
2019-09-25 18:02 ` bugzilla-daemon

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=bug-105145-502@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --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.