diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index aa4020b6e6ed..68342fd95cb5 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -1802,10 +1802,22 @@ int rockchip_drm_panel_loader_protect(struct drm_panel *panel, bool on) } EXPORT_SYMBOL(rockchip_drm_panel_loader_protect); +static void rockchip_drm_fix_encoder_possible_clones(struct drm_encoder *encoder) +{ + struct drm_device *drm_dev = encoder->dev; + struct drm_encoder *other; + + drm_for_each_encoder(other, drm_dev) { + if (other->possible_crtcs & encoder->possible_crtcs) + encoder->possible_clones |= drm_encoder_mask(other); + } +} + static int rockchip_drm_bind(struct device *dev) { struct drm_device *drm_dev; struct rockchip_drm_private *private; + struct drm_encoder *encoder; int ret; /* Remove existing drivers that may own the framebuffer memory. */ @@ -1895,6 +1907,9 @@ static int rockchip_drm_bind(struct device *dev) if (ret) goto err_kms_helper_poll_fini; + drm_for_each_encoder(encoder, drm_dev) + rockchip_drm_fix_encoder_possible_clones(encoder); + rockchip_drm_show_logo(drm_dev); ret = rockchip_drm_fbdev_init(drm_dev);