Hi,
On 2024/2/7 17:35, Daniel Vetter wrote:
On Wed, Feb 07, 2024 at 01:27:59AM +0800, Sui Jingfeng wrote:
The component helper functions are the glue, which is used to bind multiple
GPU cores to a virtual master platform device. Which is fine and works well
for the SoCs who contains multiple GPU cores.
The problem is that usperspace programs (such as X server and Mesa) will
search the PCIe device to use if it is exist. In other words, usperspace
programs open the PCIe device with higher priority. Creating a virtual
master platform device for PCI(e) GPUs is unnecessary, as the PCI device
has been created by the time drm/etnaviv is loaded.
we create virtual platform devices as a representation for the vivante GPU
ip core. As all of subcomponent are attached via the PCIe master device,
we reflect this hardware layout by binding all of the virtual child to the
the real master.
Signed-off-by: Sui Jingfeng <sui.jingf...@linux.dev>
Uh so my understanding is that drivers really shouldn't create platform
devices of their own.
Yes,
At least for DT-based systems, this driver can be modified
to let the core to create the virtual master for us. We don't
have to create platform devices by our own(refer to the drm/etnaviv
driver).
I means that we could put the following example device node
into the .dts file.
gpu_2d: gpu@A0000 {
compatible = "vivante,gc";
reg = <0xA0000 0x4000>;
};
gpu_3d: gpu@90000 {
compatible = "vivante,gc";
reg = <0x90000 0x4000>;
};
gpu@0 {
compatible = "etnaviv";
cores = <&gpu_2d &gpu_3d>;
dma-coherent;
dma-mask = <0xffffffff>
virtual_master;
};
But now, I'm afraid it's too late. Because the DTS/DTB may already have been
burned into board's BIOS for years. I guess, nowadays, modifying(changes)
this driver have to take the backward compatibility constraint into
consideration.
Since we only have one chance to form the spec, that happens when this driver
was
initially merged. Apparently, we miss it.