[PATCH v14 1/2] drm: add kms driver for loongson display controller

Sui Jingfeng suijingfeng at loongson.cn
Tue Jun 13 16:20:58 UTC 2023


Hi,

On 2023/5/21 20:21, WANG Xuerui wrote:
>> +
>> +static int __init loongson_module_init(void)
>> +{
>> +    struct pci_dev *pdev = NULL;
>> +
>> +    if (video_firmware_drivers_only())
>> +        return -ENODEV;
>> +
>> +    /* Multiple video card workaround */
>> +    while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev))) {
>> +        if (pdev->vendor != PCI_VENDOR_ID_LOONGSON) {
>> +            pr_info("Discrete graphic card detected, abort\n");
>
> Why is it that the iGPU cannot be used together with a dGPU? I can't 
> see why this is technically the case so some more explanations could 
> be beneficial to other readers and LoongArch devs.


We will remote this workaround at next version. we find some way to keep 
multiple GPU driver co-exixt in the system. The reason we choose to 
workaround is because it  is both easy and effective to solve bugs.


After the dGPU is mounted on the motherboard,

1) the integrate register don't receive write or read access anymore.  
sometime cause its can't receive vblank interrupt, causing vblank 
timeout etc.

Have something to do with the PCI driver layer and/or PCI/vgaarb layer.


2) For ls7a1000, both the display controller and gpu is special,

     when dGPU is mounted, we are multiple gpu system.

     we should made the vgaarb works correct , this is relay on firmware 
and efi  support to be complete.

    In the past, our system don't support firmware framebuffer even.

3) It need us we implement PRIME, for cross driver buffer sharing.

      loongson display don't has scatter-gather able DMA. Can't access 
non physical contiguous GTT buffer.

     We can only expect

    1) the CPU do the copy.

    2) DC driver export dumb buffer, and GPU driver import this buffer, 
and resolve the tiled buffer to the linear.

    3) shared buffer has to pinned at GTT


4) Using space X server also has bug for parser the PCI device on 
complex patch.


5) Even on X86, there are motherboard vendor choose to black the iGPU 
when the dGPU is mounted.

It perhaps better black the iGPU at firmware layer.

But our firmware engineer don't know about this for a very long time.


But as its already as is, we will try to improve this at the next version.

-- 
Jingfeng



More information about the dri-devel mailing list