From b56a9415bd47b0a36370f9e60ef3c2d4ce53151f Mon Sep 17 00:00:00 2001 From: Mahadevan Date: Sat, 15 Apr 2023 13:31:43 +0530 Subject: [PATCH] disp: msm: initialize and register drm device after splash_config If continuous splash is enabled crtc_state active is set to true from the driver. During the handoff commit this new_state is compared with the older state and active change will be set to false. If there is a race condition between the continuous splash config and atomic check of the first commit, an improper state with active change to true is formed leading to commit failure. This change makes sure drm device will get initialized and registered after continuous splash config which will block the userspace from the handoff commit. Change-Id: I91aa64c480a3341488f1e2c9422c9a2b8200fe53 Signed-off-by: Mahadevan --- msm/msm_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/msm/msm_drv.c b/msm/msm_drv.c index 54ccb167..23e1c7ff 100644 --- a/msm/msm_drv.c +++ b/msm/msm_drv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark @@ -977,11 +977,6 @@ static int msm_drm_component_init(struct device *dev) drm_mode_config_reset(ddev); - ret = drm_dev_register(ddev, 0); - if (ret) - goto fail; - priv->registered = true; - if (kms && kms->funcs && kms->funcs->cont_splash_config) { ret = kms->funcs->cont_splash_config(kms, NULL); if (ret) { @@ -990,6 +985,11 @@ static int msm_drm_component_init(struct device *dev) } } + ret = drm_dev_register(ddev, 0); + if (ret) + goto fail; + priv->registered = true; + #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) if (fbdev) priv->fbdev = msm_fbdev_init(ddev);