mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/rockchip: drv: fix encoder possible_clones check failed
possible_clones is used to indicate which other encoders can share
a CRTC with the current encoder. The default logic is that an encoder
can exclusively occupy one CRTC. However, in scenarios such as writeback
or connector mirroring, we can support multiple encoders sharing one
CRTC, hence this logic is introduced.
If less this commit, the writeback or connector mirror will commit
failed at the drm_atomic_check_valid_clones(), which is introduced by
the following commit:
commit ffb55ddf26 ("drm: Add valid clones check")
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6b962a3eee80b6fbe80d0dbea1d765b219d70719
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user