Skip to contentSkip to conversation

drm/gma500: Remove generic DRM drivers in probe function

PATCH In review Thomas Zimmermann 2 participants 2 messages Oct 19, 2021

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/gma500: Remove generic DRM drivers in probe function

Gma500 currently removes generic fbdev drivers, but ignores generic DRM drivers. Use aperture helpers to remove all generic graphics drivers before loading gma500. Makes gma500 compatible with simpledrm.

---
 drivers/gpu/drm/gma500/psb_drv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/gma500/psb_drv.c +12 -0
index 7a10bb39ef0b..7ea82d7ddfcc 100644
@@ -19,6 +19,7 @@
 #include <acpi/video.h>
 
 #include <drm/drm.h>
+#include <drm/drm_aperture.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_file.h>
@@ -448,6 +449,17 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct drm_device *dev;
 	int ret;
 
+	/*
+	 * We cannot yet easily find the framebuffer's location in memory. So
+	 * remove all framebuffers here.
+	 *
+	 * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we
+	 *       might be able to read the framebuffer range from the device.
+	 */
+	ret = drm_aperture_remove_framebuffers(true, &driver);
+	if (ret)
+		return ret;
+
 	ret = pcim_enable_device(pdev);
 	if (ret)
 		return ret;

base-commit: 762b53b56af425f89f892e99583dfd84c73d731c --
2.33.0

Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thomas Zimmermann

Gma500 currently removes generic fbdev drivers, but ignores generic DRM drivers. Use aperture helpers to remove all generic graphics drivers before loading gma500. Makes gma500 compatible with simpledrm.

Quoted 39 lines
---
 drivers/gpu/drm/gma500/psb_drv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/gma500/psb_drv.c +12 -0
index 7a10bb39ef0b..7ea82d7ddfcc 100644
@@ -19,6 +19,7 @@
 #include <acpi/video.h>
 
 #include <drm/drm.h>
+#include <drm/drm_aperture.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_file.h>
@@ -448,6 +449,17 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct drm_device *dev;
 	int ret;
 
+	/*
+	 * We cannot yet easily find the framebuffer's location in memory. So
+	 * remove all framebuffers here.
+	 *
+	 * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we
+	 *       might be able to read the framebuffer range from the device.
+	 */
+	ret = drm_aperture_remove_framebuffers(true, &driver);
+	if (ret)
+		return ret;
+
 	ret = pcim_enable_device(pdev);
 	if (ret)
 		return ret;

base-commit: 762b53b56af425f89f892e99583dfd84c73d731c --
2.33.0

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch