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.

Access CMEM Physical Adress from within Kernel Driver?



Greetings,

I'm currently trying to access a memory block allocated using CMEM from within a kernel driver.

The setup is the following:

CMEM allocates memory block. Memory will be passed to the GPU using the eglCreateImageKHR. The GPU renders something into the memory block
and I want to transfer the result via GPMC to an FPGA.

Rendering works flawlessly. I can read out the results in the user-space application by using the pointer returned by CMEM_alloc.

But when I pass the physical address returned by CMEM_getPhys (0x87000000) to the driver I wrote for the FPGA communication, I got a kernel oops
telling me: Unable to handle kernel paging request at virtual address 87000000

So it seems, like the kernel driver is not able to directly access a physical address. I guess that's because you can only access addresses in kernel space, which is obviously not within the CMEM physical address space.

Now my question is, how can I access the memory where the rendered image is located, from within a kernel driver?

Is there something like map physical address to kernel space? I read about phys_to_virt but it seem like the physical address passed as argument has to be already within the kernel space, so a CMEM address probably won't work.

Any help is appreciated!