Discussion:
problem when tiling is disabled on decoded surfaces
(too old to reply)
Julien Isorce
2016-10-06 08:20:03 UTC
Permalink
Hi,

In intel vaapi driver I tried disabling tiling with:

--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;

But then gst-launch-1.0 filesrc location=~/Downloads/simpson.mp4 ! qtdemux
! vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.

I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.

Also see vainfo output below.

Thx
Julien

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /home/julien/gst/master/
prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
Sean V Kelley
2016-10-07 18:00:55 UTC
Permalink
Post by Julien Isorce
Hi,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose. We were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering. I was using two
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were tiled. Since
IMG was not tiled, we needed a way to pass through. I'll look at this
more closely.

But for hardware GEN decoding we assume the surface to be tiled. The
intent was never to allow disabling tilint for purposes of actual h264
decode.

I'll have to refresh my memory a bit. I'll let Haihao chime in.

Sean
Post by Julien Isorce
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Sean V. Kelley <***@intel.com>
Open Source Technology Center / SSG
Intel Corp.
Sean V Kelley
2016-10-07 18:13:01 UTC
Permalink
Post by Sean V Kelley
Post by Julien Isorce
Hi,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose. We were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering. I was using two
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were tiled. Since
IMG was not tiled, we needed a way to pass through. I'll look at this
more closely.
But for hardware GEN decoding we assume the surface to be tiled. The
intent was never to allow disabling tilint for purposes of actual h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding. The flag
is historical and used with other drivers (remember VA-API can be used
with IMG). In my
case I triggered it by our having added a new VA memory type for when
I needed to share surfaces.

But again, we don't decode non-tiled. We simply give you the
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I gave you.

Sean
Post by Sean V Kelley
I'll have to refresh my memory a bit. I'll let Haihao chime in.
Sean
Post by Julien Isorce
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Open Source Technology Center / SSG
Intel Corp.
--
Sean V. Kelley <***@intel.com>
Open Source Technology Center / SSG
Intel Corp.
Zhao Yakui
2016-10-08 00:33:23 UTC
Permalink
Post by Sean V Kelley
Post by Sean V Kelley
Post by Julien Isorce
Hi,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose. We were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering. I was using two
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were tiled. Since
IMG was not tiled, we needed a way to pass through. I'll look at this
more closely.
But for hardware GEN decoding we assume the surface to be tiled. The
intent was never to allow disabling tilint for purposes of actual h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding. The flag
is historical and used with other drivers (remember VA-API can be used
with IMG). In my
case I triggered it by our having added a new VA memory type for when
I needed to share surfaces.
But again, we don't decode non-tiled. We simply give you the
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I gave you.
Hi, Julien

What Sean said is correct. When the surface is used for the
decoding, it should be tiled, which is the hardware requirement. If it
is non-tiled, the hardware can't work as expected.
The non-tiled surface can be used for the other purpose. For
example: buffer sharing (Some other componenets/driver wants to share
the NV12 buffer with libva driver. And it requires that it is non-tiled.
The default buffer for NV12 format is tiled. So one option is added so
that the non-tiled NV12 buffer is created).

BTW: the tiling or non-tiling surface is transparent to the upper
middleware. Although one tiling buffer is created internally, the upper
middleware can map it and then access it based on width/pitch.

Not sure whether it helps to clarify your concerns.

Thanks
Yakui
Post by Sean V Kelley
Sean
Post by Sean V Kelley
I'll have to refresh my memory a bit. I'll let Haihao chime in.
Sean
Post by Julien Isorce
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Open Source Technology Center / SSG
Intel Corp.
Xiang, Haihao
2016-10-08 03:09:03 UTC
Permalink
Hi Julien,

Please do not set obj_surface->user_disable_tiling to true unless you
know the usage, e.g. your applicate allocates a VA surface via libva
and shares this surface between libva and camera, some cameras only
support linear memory.

In your case, it is the right behavior if you saw garbage because all
surfaces are linear however HW requires a tiled surface for decoding.

Thanks
Haihao
Post by Zhao Yakui
Post by Sean V Kelley
Hi,
---   a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
          obj_surface->orig_height = height;
-        obj_surface->user_disable_tiling = false;
+       obj_surface->user_disable_tiling = true;
          obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc
location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose.  We
were
sharing surfaces decoded via Imagination Tech driver on a
Baytrail,
and wrapped that for the X11 backend rendering.  I was using two
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were
tiled.  Since
IMG was not tiled, we needed a way to pass through.  I'll look at
this
more closely.
But for hardware GEN decoding we assume the surface to be
tiled.  The
intent was never to allow disabling tilint for purposes of actual h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding.  The flag
is historical and used with other drivers (remember VA-API can be used
with IMG).  In my
case I triggered it by our having added a new VA memory type for when
I needed to share surfaces.
But again, we don't decode non-tiled.  We simply give you the
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I gave you.
Hi, Julien
     What Sean said is correct. When the surface is used for the
decoding, it should be tiled, which is the hardware requirement. If it
is non-tiled, the hardware can't work as expected.
     The non-tiled surface can be used for the other purpose. For
example: buffer sharing (Some other componenets/driver wants to share
the NV12 buffer with libva driver. And it requires that it is non-
tiled.
The default buffer for NV12 format is tiled. So one option is added so
that the non-tiled NV12 buffer is created).
     BTW: the tiling or non-tiling surface is transparent to the
upper
middleware. Although one tiling buffer is created internally, the upper
middleware can map it and then access it based on width/pitch.
     Not sure whether it helps to clarify your concerns.
Thanks
    Yakui
Post by Sean V Kelley
Sean
I'll have to refresh my memory a bit.  I'll let Haihao chime in.
Sean
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
       VAProfileMPEG2Simple            :    VAEntrypointVLD
       VAProfileMPEG2Simple            :    VAEntrypointEncSlic
e
       VAProfileMPEG2Main              :    VAEntrypointVLD
       VAProfileMPEG2Main              :    VAEntrypointEncSlic
e
       VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
       VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlic
e
       VAProfileH264Main               :    VAEntrypointVLD
       VAProfileH264Main               :    VAEntrypointEncSlic
e
       VAProfileH264High               :    VAEntrypointVLD
       VAProfileH264High               :    VAEntrypointEncSlic
e
       VAProfileH264MultiviewHigh      :    VAEntrypointVLD
       VAProfileH264MultiviewHigh      :    VAEntrypointEncSlic
e
       VAProfileH264StereoHigh         :    VAEntrypointVLD
       VAProfileH264StereoHigh         :    VAEntrypointEncSlic
e
       VAProfileVC1Simple              :    VAEntrypointVLD
       VAProfileVC1Main                :    VAEntrypointVLD
       VAProfileVC1Advanced            :    VAEntrypointVLD
       VAProfileNone                   :    VAEntrypointVideoPr
oc
       VAProfileJPEGBaseline           :    VAEntrypointVLD
       VAProfileVP9Profile0            :    VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Open Source Technology Center / SSG
Intel Corp.
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Julien Isorce
2016-10-26 08:42:56 UTC
Permalink
Hi,

Thx for the detailed.

If I understand correctly, the intel HW video decoder can only output a
tiled layout. But if I export the surface as a dmabuf and I use mmap on it,
I will still be able to access pixels using width/pitch like if it was
linear.
If I need to share it with a non-intel gpu I would need VPP since this unit
can output a linear layout (I can configure it by clearing the flag
VA_SURFACE_EXTBUF_DESC_ENABLE_TILING when calling vaCreateSurfaces)

Is it correct ?

Cheers
Julien
Hi Julien,
Please do not set obj_surface->user_disable_tiling to true unless you
know the usage, e.g. your applicate allocates a VA surface via libva
and shares this surface between libva and camera, some cameras only
support linear memory.
In your case, it is the right behavior if you saw garbage because all
surfaces are linear however HW requires a tiled surface for decoding.
Thanks
Haihao
Post by Zhao Yakui
Post by Sean V Kelley
Post by Sean V Kelley
Post by Julien Isorce
Hi,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc
location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose. We were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering. I was using two
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were
tiled. Since
IMG was not tiled, we needed a way to pass through. I'll look at this
more closely.
But for hardware GEN decoding we assume the surface to be tiled. The
intent was never to allow disabling tilint for purposes of actual h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding. The flag
is historical and used with other drivers (remember VA-API can be used
with IMG). In my
case I triggered it by our having added a new VA memory type for when
I needed to share surfaces.
But again, we don't decode non-tiled. We simply give you the
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I gave you.
Hi, Julien
What Sean said is correct. When the surface is used for the
decoding, it should be tiled, which is the hardware requirement. If it
is non-tiled, the hardware can't work as expected.
The non-tiled surface can be used for the other purpose. For
example: buffer sharing (Some other componenets/driver wants to share
the NV12 buffer with libva driver. And it requires that it is non-
tiled.
The default buffer for NV12 format is tiled. So one option is added so
that the non-tiled NV12 buffer is created).
BTW: the tiling or non-tiling surface is transparent to the upper
middleware. Although one tiling buffer is created internally, the upper
middleware can map it and then access it based on width/pitch.
Not sure whether it helps to clarify your concerns.
Thanks
Yakui
Post by Sean V Kelley
Sean
Post by Sean V Kelley
I'll have to refresh my memory a bit. I'll let Haihao chime in.
Sean
Post by Julien Isorce
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlic
e
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlic
e
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlic
e
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlic
e
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlic
e
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlic
e
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlic
e
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoPr
oc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Open Source Technology Center / SSG
Intel Corp.
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Xiang, Haihao
2016-10-27 16:00:40 UTC
Permalink
-----Original Message-----
Sent: Wednesday, October 26, 2016 4:43 PM
Subject: Re: [Libva] problem when tiling is disabled on decoded surfaces
Hi,
Thx for the detailed.
If I understand correctly, the intel HW video decoder can only output a tiled
layout. But if I export the surface as a dmabuf and I use mmap on it, I will still
be able to access pixels using width/pitch like if it was linear.
You do not need to export the surface as a dmabuf if you only want to access pixels in your program.
the purpose of exporting a surface as a dmabuf is for buffer sharing.
If I need to share it with a non-intel gpu I would need VPP since this unit can
output a linear layout (I can configure it by clearing the flag
VA_SURFACE_EXTBUF_DESC_ENABLE_TILING when calling vaCreateSurfaces)
Yes.
Is it correct ?
Cheers
Julien
Hi Julien,
Please do not set obj_surface->user_disable_tiling to true unless you
know the usage, e.g. your applicate allocates a VA surface via libva
and shares this surface between libva and camera, some cameras only
support linear memory.
In your case, it is the right behavior if you saw garbage because all
surfaces are linear however HW requires a tiled surface for decoding.
Thanks
Haihao
Post by Zhao Yakui
Post by Sean V Kelley
Post by Sean V Kelley
Post by Julien Isorce
Hi,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
obj_surface->orig_height = height;
- obj_surface->user_disable_tiling = false;
+ obj_surface->user_disable_tiling = true;
obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc
location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the memory was still
tiled.
We implemented disable tiling for a very specific purpose. We were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering. I was using
two
Post by Zhao Yakui
Post by Sean V Kelley
Post by Sean V Kelley
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were
tiled. Since
IMG was not tiled, we needed a way to pass through. I'll look at this
more closely.
But for hardware GEN decoding we assume the surface to be tiled. The
intent was never to allow disabling tilint for purposes of actual h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding. The flag
is historical and used with other drivers (remember VA-API can be used
with IMG). In my
case I triggered it by our having added a new VA memory type for when
I needed to share surfaces.
But again, we don't decode non-tiled. We simply give you the
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I gave you.
Hi, Julien
What Sean said is correct. When the surface is used for the
decoding, it should be tiled, which is the hardware requirement. If it
is non-tiled, the hardware can't work as expected.
The non-tiled surface can be used for the other purpose. For
example: buffer sharing (Some other componenets/driver wants to
share
Post by Zhao Yakui
the NV12 buffer with libva driver. And it requires that it is non-
tiled.
The default buffer for NV12 format is tiled. So one option is added so
that the non-tiled NV12 buffer is created).
BTW: the tiling or non-tiling surface is transparent to the upper
middleware. Although one tiling buffer is created internally, the upper
middleware can map it and then access it based on width/pitch.
Not sure whether it helps to clarify your concerns.
Thanks
Yakui
Post by Sean V Kelley
Sean
Post by Sean V Kelley
I'll have to refresh my memory a bit. I'll let Haihao chime in.
Sean
Post by Julien Isorce
I tried to debug it and but all calls to dri_bo_get_tiling returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlic
e
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlic
e
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlic
e
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlic
e
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlic
e
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlic
e
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlic
e
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoPr
oc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
Post by Zhao Yakui
Post by Sean V Kelley
Post by Sean V Kelley
--
Open Source Technology Center / SSG
Intel Corp.
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
Sean V Kelley
2016-10-27 18:43:55 UTC
Permalink
Post by Xiang, Haihao
-----Original Message-----
Sent: Wednesday, October 26, 2016 4:43 PM
Subject: Re: [Libva] problem when tiling is disabled on decoded surfaces
Hi,
Thx for the detailed.
If I understand correctly, the intel HW video decoder can only output a tiled
layout. But if I export the surface as a dmabuf and I use mmap on it, I will still
be able to access pixels using width/pitch like if it was linear.
You do not need to export the surface as a dmabuf if you only want to
access pixels in your program.
the purpose of exporting a surface as a dmabuf is for buffer sharing.
Indeed, if you do need to use dmabuf export in a non VA_SURFACE
context, we do have changes we need to make in the fugure for better
sharing of the export.
Post by Xiang, Haihao
If I need to share it with a non-intel gpu I would need VPP since this unit can
output a linear layout (I can configure it by clearing the flag
VA_SURFACE_EXTBUF_DESC_ENABLE_TILING when calling vaCreateSurfaces)
Yes.
Agreed.

Thanks,

Sean
Post by Xiang, Haihao
Is it correct ?
Cheers
Julien
Hi Julien,
Please do not set obj_surface->user_disable_tiling to true
unless you
know the usage, e.g. your applicate allocates a VA surface via libva
and shares this surface between libva and camera, some cameras only
support linear memory.
In your case, it is the right behavior if you saw garbage
because all
surfaces are linear however HW requires a tiled surface for
decoding.
Thanks
Haihao
Post by Zhao Yakui
On Fri, Oct 7, 2016 at 11:00 AM, Sean V Kelley<sean.v.kelle
On Thu, Oct 6, 2016 at 1:20 AM, Julien Isorce<julien.isor
Hi,
---   a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1534,7 +1534,7 @@ i965_CreateSurfaces2(
           obj_surface->orig_height = height;
-        obj_surface->user_disable_tiling = false;
+       obj_surface->user_disable_tiling = true;
           obj_surface->user_h_stride_set = false;
But then gst-launch-1.0 filesrc
location=~/Downloads/simpson.mp4 ! qtdemux !
vaapih264dec ! xvimagesink shows garbage, like if the
memory
Post by Zhao Yakui
was still
tiled.
We implemented disable tiling for a very specific
purpose.  We
Post by Zhao Yakui
were
sharing surfaces decoded via Imagination Tech driver on a Baytrail,
and wrapped that for the X11 backend rendering.  I was
using
two
Post by Zhao Yakui
drivers (IMG and GEN).
At the time, the driver assumed that all surfaces were
tiled.  Since
IMG was not tiled, we needed a way to pass through.  I'll
look at
Post by Zhao Yakui
this
more closely.
But for hardware GEN decoding we assume the surface to be
tiled.  The
intent was never to allow disabling tilint for purposes
of actual
Post by Zhao Yakui
h264
decode.
The GEN hardware really only uses the tiling format for
decoding/encoding.  The flag
is historical and used with other drivers (remember VA-API
can be
Post by Zhao Yakui
used
with IMG).  In my
case I triggered it by our having added a new VA memory
type for
Post by Zhao Yakui
when
I needed to share surfaces.
But again, we don't decode non-tiled.  We simply give you
the
Post by Zhao Yakui
flexibility to create those surfaces non-tiled
for historical and conversion reasons as the one above I
gave you.
Post by Zhao Yakui
Hi, Julien
      What Sean said is correct. When the surface is used for
the
Post by Zhao Yakui
decoding, it should be tiled, which is the hardware
requirement. If
Post by Zhao Yakui
it
is non-tiled, the hardware can't work as expected.
      The non-tiled surface can be used for the other purpose.
For
Post by Zhao Yakui
example: buffer sharing (Some other componenets/driver wants
to
share
Post by Zhao Yakui
the NV12 buffer with libva driver. And it requires that it is
non-
Post by Zhao Yakui
tiled.
The default buffer for NV12 format is tiled. So one option is
added
Post by Zhao Yakui
so
that the non-tiled NV12 buffer is created).
      BTW: the tiling or non-tiling surface is transparent to
the
Post by Zhao Yakui
upper
middleware. Although one tiling buffer is created internally,
the
Post by Zhao Yakui
upper
middleware can map it and then access it based on
width/pitch.
Post by Zhao Yakui
      Not sure whether it helps to clarify your concerns.
Thanks
     Yakui
Sean
I'll have to refresh my memory a bit.  I'll let Haihao
chime in.
Post by Zhao Yakui
Sean
I tried to debug it and but all calls to
dri_bo_get_tiling
Post by Zhao Yakui
returns
I915_TILING_NONE as expected.
Also see vainfo output below.
Thx
Julien
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open
/home/julien/gst/master/prefix/lib/dri/i965_drv_video.so
Post by Zhao Yakui
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R)
Haswell
Post by Zhao Yakui
Mobile -
1.7.3.pre1 (1.7.2-115-gfa3d1c3)
vainfo: Supported profile and entrypoints
        VAProfileMPEG2Simple            :    VAEntrypointVLD
        VAProfileMPEG2Simple            :    VAEntrypointEncSlic
e
        VAProfileMPEG2Main              :    VAEntrypointVLD
        VAProfileMPEG2Main              :    VAEntrypointEncSlic
e
        VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
        VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlic
e
        VAProfileH264Main               :    VAEntrypointVLD
        VAProfileH264Main               :    VAEntrypointEncSlic
e
        VAProfileH264High               :    VAEntrypointVLD
        VAProfileH264High               :    VAEntrypointEncSlic
e
        VAProfileH264MultiviewHigh      :    VAEntrypointVLD
        VAProfileH264MultiviewHigh      :    VAEntrypointEncSlic
e
        VAProfileH264StereoHigh         :    VAEntrypointVLD
        VAProfileH264StereoHigh         :    VAEntrypointEncSlic
e
        VAProfileVC1Simple              :    VAEntrypointVLD
        VAProfileVC1Main                :    VAEntrypointVLD
        VAProfileVC1Advanced            :    VAEntrypointVLD
        VAProfileNone                   :    VAEntrypointVideoPr
oc
        VAProfileJPEGBaseline           :    VAEntrypointVLD
        VAProfileVP9Profile0            :    VAEntrypointVLD
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
Post by Zhao Yakui
--
Open Source Technology Center / SSG
Intel Corp.
_______________________________________________
Libva mailing list
rg>
Post by Zhao Yakui
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
<https://lists.freedesktop.org/mailman/listinfo/libva>
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Loading...