0

I have a requirement for large video frame buffer that needs to be physically contiguous. So my question is when kernel driver request physical contig memory, the virtual address returned by kernel will be contiguous or non-contig?

Update: My apology, let me add more details. For a video buffer of resolution 640x480 with each pixel of 1 byte, the total memory expected 307200 bytes (640x480). For a system that works on 4KiB page, the total pages needed by above buffer will be 75.

Now lets assume in some way this 307200 memory block requested is physically contiguous. But when virtual address of each page is being returned by kernel, will those pages be contiguous or non-contiguous?

kudi
  • 1
  • 2
  • If virtual address, pointed to the memory region, is not contiguous ... then it doesn't point to the memory region **actually**. – Tsyvarev Sep 19 '17 at 19:10
  • 1
    *"the virtual address returned by kernel will be contiguous or non-contig?"* -- Contiguous with what? You're over-thinking the possibilities, and/or not properly reasoning this out. If the virtual addresses (of the block) were not contiguous, then you would have to know *all* of those address in order to access them. IOW when a *block* of memory is allocated, only the (virtual) address of the of the start of the block is returned because the block does occupy a contiguous region of virtual memory. Now this block of memory may not be contiguous with any other virtual memory. – sawdust Sep 19 '17 at 22:28
  • virtual address will be contiguous, because you will get only start address of the virtual memory for respective phy memory. – Rajeshkumar Sep 20 '17 at 08:25

1 Answers1

0

Contiguous - the kernel virtual address space mapping is generally 1-1 with physical memory (ie V = P + offset)

lunix
  • 305
  • 1
  • 6