This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can I create a opencl buffer from a GraphicBuffer or a raw ion buffer

Hello,

      I found out that on qcom platform, there's a extension,

https://www.khronos.org/registry/cl/extensions/qcom/cl_qcom_ion_host_ptr.txt

Can I do the same on mali T760, android platform?

Songmao

Parents
  • Hi songmao,

    OpenCL will not do any kind of data interpretation on the data sampled from the image (Assuming you're not using any kind of interpolation on the image sampled), therefore you could use an RGBA8888 format for your GraphicBuffer and re-interpret it as YUY2 in your OpenCL kernel, do you see what I mean ?

    Alternatively if you have a recent enough version of the driver ( >= r7p0) then you could use clImportMemoryARM to import a dma_buf allocation as a CL buffer.

    Usually you will have a dma_buf file descriptor as part of the private data inside your Gralloc allocation. (However this is platform dependent, so this will depend on what device you're using).

    Hope this helps,

    Anthony

Reply
  • Hi songmao,

    OpenCL will not do any kind of data interpretation on the data sampled from the image (Assuming you're not using any kind of interpolation on the image sampled), therefore you could use an RGBA8888 format for your GraphicBuffer and re-interpret it as YUY2 in your OpenCL kernel, do you see what I mean ?

    Alternatively if you have a recent enough version of the driver ( >= r7p0) then you could use clImportMemoryARM to import a dma_buf allocation as a CL buffer.

    Usually you will have a dma_buf file descriptor as part of the private data inside your Gralloc allocation. (However this is platform dependent, so this will depend on what device you're using).

    Hope this helps,

    Anthony

Children