Re: Memory allocation in Video4Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wen,

On Thursday 10 February 2011 10:44:58 Wang, Wen W wrote:
> Hi Laurent,
> 
> You make this very clear, thank you!
> 
> The ISP on Medfield do have its own IOMMU. And I also think an IOMMU layer
> for ISP is needed.
> 
> I'm not quite understand "unless hardware design doesn't give you a choice
> about that,". Can you explain more on that?

Basically, Linux aims for driver reusability. That means that separate pieces 
of hardware, even when they are designed to work together, should be handled 
by separate, indepedent drivers. This might make the initial development a bit 
longer, as proper abstraction APIs need to be designed when they don't exist, 
but it cuts down time to market later when a hardware block is reused in a 
different silicon or board.

A good example of that approach is I2C sensors. They're supported by drivers 
that are completely independent of the ISP they are connected to, and use the 
V4L2 subdev in-kernel API to communicate with the ISP in a hardware-indepedent 
way.

IOMMU is such an API. It lets you implement support for your particular IOMMU 
in a self-contained drivers, which can then be used by device drivers (such as 
the ISP driver).

For this to work, the hardware needs to have at least some level of separation 
between the different components. With I2C that's easy, the sensor can be 
controlled completely indepedently from the ISP. With the ISP IOMMU, it would 
more or less depend on how the registers are layed out in memory. If the ISP 
IOMMU registers are grouped together and separated from the other ISP 
registers, you should be fine. If they are mixed with ISP registers (an 
hypotetical bad case would for instance be if the ISP IOMMU required you to 
set bits in the TLB entries that describe the format of the video data stored 
in a page), such an abstraction would be much more difficult to achieve, and 
sometimes even impossible.

> Also regarding to the VCMM (Virtual Contiguous Memory Manager) or CMA, is
> it also an option?

I'm not sure about VCMM, it seems to be an attempt to unify memory management 
across IOMMUs and system MMU. I don't think you need to worry about it now, 
IOMMU should be enough for your needs.

CMA, as its name implies, is a contiguous memory allocator. As your ISP has an 
IOMMU, you don't need to allocate contiguous memory, so CMA isn't useful for 
your hardware.

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux