]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/mgag200: Add an option to disable Write-Combine
authorJocelyn Falempe <jfalempe@redhat.com>
Fri, 17 May 2024 15:09:58 +0000 (17:09 +0200)
committerJocelyn Falempe <jfalempe@redhat.com>
Tue, 21 May 2024 07:38:47 +0000 (09:38 +0200)
Unfortunately, the G200 ioburst workaround doesn't work on some
servers like Dell poweredge XR11, XR5610, or HPE XL260. In this case
completely disabling WC is the only option to achieve low-latency.
So this adds a new Kconfig option to disable WC mapping of the G200.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517151050.624797-3-jfalempe@redhat.com
drivers/gpu/drm/mgag200/Kconfig
drivers/gpu/drm/mgag200/mgag200_drv.c

index b28c5e4828f47bc3b46666d31a26d02f9cb71752..3096944a8f0ab76ab8ac2e8b85c7123e05bf6419 100644 (file)
@@ -11,3 +11,13 @@ config DRM_MGAG200
         MGA G200 desktop chips and the server variants. It requires 0.3.0
         of the modesetting userspace driver, and a version of mga driver
         that will fail on KMS enabled devices.
+
+config DRM_MGAG200_DISABLE_WRITECOMBINE
+       bool "Disable Write Combine mapping of VRAM"
+       depends on DRM_MGAG200 && PREEMPT_RT
+       help
+         The VRAM of the G200 is mapped with Write-Combine to improve
+         performances. This can interfere with real-time tasks; even if they
+         are running on other CPU cores than the graphics output.
+         Enable this option only if you run realtime tasks on a server with a
+         Matrox G200.
\ No newline at end of file
index 3883f25ca4d8bd0dea8c5adf7e4f608ae5b2de72..62080cf0f2da497f652f54089ec344acaa635c60 100644 (file)
@@ -146,12 +146,18 @@ int mgag200_device_preinit(struct mga_device *mdev)
        }
        mdev->vram_res = res;
 
+#if defined(CONFIG_DRM_MGAG200_DISABLE_WRITECOMBINE)
+       mdev->vram = devm_ioremap(dev->dev, res->start, resource_size(res));
+       if (!mdev->vram)
+               return -ENOMEM;
+#else
        mdev->vram = devm_ioremap_wc(dev->dev, res->start, resource_size(res));
        if (!mdev->vram)
                return -ENOMEM;
 
        /* Don't fail on errors, but performance might be reduced. */
        devm_arch_phys_wc_add(dev->dev, res->start, resource_size(res));
+#endif
 
        return 0;
 }