<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - VAAPI vaDeriveImage returns VA_STATUS_ERROR_OPERATION_FAILED"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=111622">111622</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>VAAPI vaDeriveImage returns VA_STATUS_ERROR_OPERATION_FAILED
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>19.1
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>not set
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/Gallium/radeonsi
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>reject5514@naver.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=145311" name="attach_145311" title="Sample C code to reproduce error">attachment 145311</a> <a href="attachment.cgi?id=145311&action=edit" title="Sample C code to reproduce error">[details]</a></span>
Sample C code to reproduce error

Operating System: archlinux 5.2.13-arch1-1-ARCH
GPU: Radeon RX 570
Mesa version: 19.1.6
Libva version: 2.5.0

vaDeriveImage() VAAPI returns VA_STATUS_ERROR_OPERATION_FAILED when
radeonsi_drv_video.so used as driver. It runs successfully with
i965_drv_video.so on intel integrated GPU.

<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Vlc fails to decode video using vaapi"
   href="show_bug.cgi?id=110850">https://bugs.freedesktop.org/show_bug.cgi?id=110850</a> related to this.

I found by debugging that error return occurs in the vlVaDeriveImage function.
//vlVaDeriveImage function is in src/gallium/state_trackers/va/image.c
if (surf->buffer->interlaced)
     return VA_STATUS_ERROR_OPERATION_FAILED;

Is there a problem with interlaced video in Mesa? I don't know much about
computer graphics and how Mesa works, but Intel driver has no problem about it,
so I think it's a bug.

Sample C code attached to reproduce error. This code was written by referring
to the VLC's VAAPI source code. Compile command: gcc -o va va.c -lX11 -lva
-lva-x11 -g

Result on Radeon GPU system:
libva info: VA-API version 1.5.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_5
libva info: va_openDriver() returns 0
vendor string : Mesa Gallium driver 19.1.6 for Radeon RX 570 Series (POLARIS10,
DRM 3.32.0, 5.2.13-arch1-1-ARCH, LLVM 8.0.1)
vaDeriveImage error : operation failed

Result on Intel GPU system:
libva info: VA-API version 1.5.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_3
libva info: va_openDriver() returns 0
vendor string : Intel i965 driver for Intel(R) Broadwell - 2.3.0

vaDeriveImage : success (no error)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>