Skip to content

Commit c52bf21

Browse files
committed
drm: apple: Remove conflicting devices as late as possible
Call aperture_remove_conflicting_devices() just before drm_dev_register(). This reduces the the time at startup without KMS drm device to a minimum. sddm/kwin(-wayland) fails with "kwin_wayland_drm: No suitable DRM devices have been found" in this case and never retries. Reverts commit "drm/apple: Remove simpledrm framebuffer before DRM device alloc". User space needs to deal with KMS device not being card0. The attempt to take card0 over from simpledrm was futile as the GPU driver is racing for this and won in many cases. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent d7f45a0 commit c52bf21

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/gpu/drm/apple/apple_drv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,6 @@ static int apple_drm_init(struct device *dev)
624624
if (ret)
625625
return ret;
626626

627-
fb_size = fb_r.end - fb_r.start + 1;
628-
ret = aperture_remove_conflicting_devices(fb_r.start, fb_size,
629-
apple_drm_driver.name);
630-
if (ret) {
631-
dev_err(dev, "Failed remove fb: %d\n", ret);
632-
goto err_unbind;
633-
}
634-
635627
apple = devm_drm_dev_alloc(dev, &apple_drm_driver,
636628
struct apple_drm_private, drm);
637629
if (IS_ERR(apple))
@@ -673,6 +665,14 @@ static int apple_drm_init(struct device *dev)
673665

674666
drm_mode_config_reset(&apple->drm);
675667

668+
fb_size = fb_r.end - fb_r.start + 1;
669+
ret = aperture_remove_conflicting_devices(fb_r.start, fb_size,
670+
apple_drm_driver.name);
671+
if (ret) {
672+
dev_err(dev, "Failed remove fb: %d\n", ret);
673+
goto err_unbind;
674+
}
675+
676676
ret = drm_dev_register(&apple->drm, 0);
677677
if (ret)
678678
goto err_unbind;

0 commit comments

Comments
 (0)