On Monday, January 1, 2018 10:45:24 PM CET Michal Suchánek wrote:
On Thu, 28 Dec 2017 16:35:51 +0100
Andreas Färber <afaerber@suse.de> wrote:
Am 28.12.2017 um 16:29 schrieb Michal Suchánek:
On Mon, 25 Dec 2017 22:18:45 +0100
Alexander Graf <agraf@suse.de> wrote:
On 25.12.17 18:36, Michal Suchánek wrote:
Can the kernel allocate the required size automatically?
Yes, if you tell it on the kernel command line :).
I do not have to tell the kernel I have an integrated Intel graphics card and it can still allocate its buffers just fine.
Really, CMA is all about reserving a range of memory space for contiguous allocations, so all allocations happening inside that range have to be movable and can be forced to move at any given point in time.
I'm not quite sure what the kernel should do more automatically than it already does.
Just allocate the buffer whenever there is a vc4 card :)
The RPi does not have an IOMMU, so it needs to pre-allocate a contiguous hunk of memory, unlike other Intel or Arm based systems.
AFAIK the iommu feature on Intel has the marketing name VT-d and there are many Intel systems with perfectly working integrated graphics that don't support VT-d.
Although a platform IOMMU is quite recent for Intel x86, address translation for graphics has been around for much longer. From https://bwidawsk.net/blog/index.php/2014/06/the-global-gtt-part-1/ --- What are the Global Graphics Translation Table The graphics translation tables provide the address mapping from the GPU’s virtual address space to a physical address. The GTT is somewhat a relic of the AGP days ( GART) with the distinction being that the GTT as it pertains to Intel GEN GPUs has logic that is contained within the GPU, and does not act as a platform IOMMU. I believe (and wikipedia seems to agree) that GTT and GART were used interchangeably in the AGP days. ---
Also the Intel boards with integraded graphics tend to have a BIOS setting for something like "memory reserved for on-board graphics" and the IGP is not enabled unless some memory is allocated for it. On RPi3 the memory map is fabricated somewhere between u-boot and Linux kernel so is completely under control. Which is of course the excuse to not allocate the IGP buffer and leave that to user configureation. The wonders of fully opensource implementation. It's so customizable that it's even unthinkable to suply a working default :->
There is no working default. Some people use the RPI3 headless and need no graphics memory at all, while others use it as a gaming console and need 256 MB. Contrary to other current systems, the memory has to be contigous and can not be freed after allocation.
So yes, I insist that the buffer for the IGP is allocated even in the case there is no proprietary BIOS and there is only opensource software involved in defining the memory map. Is that too much to ask?
IMHO your tone is too much. If you want something, provide patches. If you are not able to do that, ask kindly. Regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019