This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

J784S4XEVM: how to map physical address to a vx_rererence object

Part Number: J784S4XEVM

Tool/software:

background:

      In my project, it not support unix socket communication between two processes.

      we want to send the vx_image object to another process var fd may be limited by IPC.

      as TI mentioned:

                In Linux, we can only transfer fd (not physical or virtual) as the buffer is created using the dma-buf framework in Linux, which could only retrieve both phy and virt address from fd.

                In QNX, we send fd (just to keep the code same) but internally this fd is nothing but the physical address that is being sent across the process.

      so we want to use physical address in QNX OS to exchange vx_images between two processes.

here are two question need comfirm:

      1. after I got the vx_image object buffer's physical address, can I transfer this physical address var socket TCP(or other IPC like UDP) instead of unix socket。

          (fd must transfer with unix socket, is transfer physical address also need unix socket)

      2. if I can use other IPC like  socket TCP to transfer physical address to another process, how can I translate the physical address to a vx_image?

          in demo, it use below two APIs to translate fd to a vx_image, is there other APIs can translate physical address to vx_images?

              tivxMemTranslateFd(uint64_t dmaBufFduint32_t sizevoid **virtAddrvoid **phyAddr)

              tivxReferenceImportHandle(vx_reference refconst void *addr[]const uint32_t size[]uint32_t num_entries)

 

  • Hi,

        1. after I got the vx_image object buffer's physical address, can I transfer this physical address var socket TCP(or other IPC like UDP) instead of unix socket。

              (fd must transfer with unix socket, is transfer physical address also need unix socket)

    Yes,

      2. if I can use other IPC like  socket TCP to transfer physical address to another process, how can I translate the physical address to a vx_image?

              in demo, it use below two APIs to translate fd to a vx_image, is there other APIs can translate physical address to vx_images?

                  tivxMemTranslateFd(uint64_t dmaBufFduint32_t sizevoid **virtAddrvoid **phyAddr)

                  tivxReferenceImportHandle(vx_reference refconst void *addr[]const uint32_t size[]uint32_t num_entries)

    You can use the same APIs to do this on QNX. The internal implementation of the API tivxMemTranslateFd() for qnx considers dmaBufFd as physical address. Please refer the implementation of the API appMemTranslateDmaBufFd() that is used inside  tivxMemTranslateFd() for qnx in the file app_mem_qnx.c

    Regards,

    Nikhil

  • hello nikhil

            I check the API appMemGetDmaBufFd()  in app_mem_qnx.c and find the fd is a physical address actually:

                      physAddr = g_app_mem_bufs[i].buf.phy_addr;

            so I just need transfer the fd to another process and use it as demo right? 

    Best Regards

    jialei.zhang 

             

  • Yes, you are correct.