Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/mediatek: Remove all conflicting aperture devices during probe

If a device has a framebuffer available it might be already used as
display by simple-framebuffer or simpledrm when mediatek-drm is probed.
This is actually helpful when porting to a new device as
framebuffers are simple to setup in device trees and fbcon can be
used to monitor the kernel boot process.

When drm-mediatek loads a new fb device is initialized, however
fbcon remains attached to the initial framebuffer which is no longer
connected to the actual display - the early fb is never removed.

We can gracefully transition from framebuffer handling to drm-managed
display by calling aperture_remove_all_conflicting_devices before
registering mediatek-drm. This takes care of unloading other fb
devices/drivers and disconnects fbcon which then automatically
reconnects to mediatekdrmfb as soon as it's available.

The function is invoked just before drm_dev_register() to kick out
the existing framebuffer as late as possible to reduce the time the
screen is unresponsive.

Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20260212192605.263160-1-l.scorcia@gmail.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

authored by

Luca Leonardo Scorcia and committed by
Chun-Kuang Hu
86d5f60d 76255024

+5
+5
drivers/gpu/drm/mediatek/mtk_drm_drv.c
··· 4 4 * Author: YT SHEN <yt.shen@mediatek.com> 5 5 */ 6 6 7 + #include <linux/aperture.h> 7 8 #include <linux/component.h> 8 9 #include <linux/module.h> 9 10 #include <linux/of.h> ··· 670 669 ret = mtk_drm_kms_init(drm); 671 670 if (ret < 0) 672 671 goto err_free; 672 + 673 + ret = aperture_remove_all_conflicting_devices(DRIVER_NAME); 674 + if (ret < 0) 675 + dev_err(dev, "Error %d while removing conflicting aperture devices", ret); 673 676 674 677 ret = drm_dev_register(drm, 0); 675 678 if (ret < 0)