[Beignet] beignet-openCL and libva/VAAPI

Weng, Chuanbo chuanbo.weng at intel.com
Wed Jun 18 19:58:01 PDT 2014


Hi Nikita,
	If I understand correctly, you want the buffer sharing between a cl_mem and
a VASurface, right?
	So you have two ways to do so:
1. Get the file description of cl_mem by extension clGetMemObjectFdIntel
    Then use vaCreateSurfaces to create a VASurface from external GPU buffer object
    by filling the parameters "VASurfaceAttrib    *attrib_list" and " unsigned int   num_attribs "
    correctly. (Don't forget to close fd after using it.)
2. Create a VASURFACE in normal way by vaCreateSurfaces, then get its handle by 
     vaAcquireBufferHandle. After that, you can create a cl_mem by clCreateImageFromLibvaIntel/
    clCreateBufferFromLibvaIntel.

The second way need support from libva and libva-intel-driver, and part of code still in
review. You should checkout to libva's offical staging branch, checkout to libva-intel-driver's official 
staging branch and apply this patch to libva-intel-driver:
http://lists.freedesktop.org/archives/libva/2014-June/002463.html

Thanks,
Chuanbo Weng

-----Original Message-----
From: Nikita Orlov [mailto:nikitos1550 at yandex.ru] 
Sent: Tuesday, June 17, 2014 17:44
To: Weng, Chuanbo; beignet at lists.freedesktop.org
Subject: Re: [Beignet] beignet-openCL and libva/VAAPI

Hi!

I will try. But in my task I need, not post-processing, but pre-processing.
I mean at first I am processing frame via some OpenCL kernel and than put it to encoder.
Now I am downloading frame from GPU and than putting it to libva.
Is it possible with this versions to skip downloading in pre-processing case?

17.06.2014, 13:40, "Weng, Chuanbo" <chuanbo.weng at intel.com>:
> Hi Nikita,
>         As the mail that you found said, currently libva/OpenCL buffer 
> sharing is integrated in libva. Please note, you should clone the correct libva repo as following (not official libva):
> git://people.freedesktop.org/~yakuiz/libva
> Then you will see cl_branch in the tree. Then you can follow the steps 
> to build and try OpenCL post-processing enabled libva.
>
> Thanks,
> Chuanbo Weng
>
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf 
> Of Nikita Orlov
> Sent: Saturday, June 14, 2014 21:32
> To: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] beignet-openCL and libva/VAAPI
>
> By the way, I have found this
> http://lists.freedesktop.org/archives/beignet/2013-October/001899.html
>
> So, as I understand libva can use beignet, but it is not very clear how latest versions are reliable for this feature.
> For example there is not ocl branch in libva repo.
>
> 14.06.2014, 17:07, "Nikita Orlov" <nikitos1550 at yandex.ru>:
>>  Hello!
>>
>>  Anybody knows how are beignet and libva/vaapi related?
>>  As I understand both of them use open source intel drivers.
>>  Both of them can work without X.org or with it.
>>
>>  But, will they share gpu resources? or video encoder/decoder in intel cpu is separated from gpu unit?
>>
>>  --
>>  Nikita Orlov
>>  Skype: nik_stet
>>  QQ: 2717846083
>>  _______________________________________________
>>  Beignet mailing list
>>  Beignet at lists.freedesktop.org
>>  http://lists.freedesktop.org/mailman/listinfo/beignet
>
> --
> Nikita Orlov
> Skype: nik_stet
> QQ: 2717846083
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet

--
Nikita Orlov
Skype: nik_stet
QQ: 2717846083


More information about the Beignet mailing list