From 6e28f80f94699ebd2cea4f3029c0b0a67eba167d Mon Sep 17 00:00:00 2001 From: Sandy Huang Date: Thu, 26 Aug 2021 10:43:18 +0800 Subject: [PATCH] drm/rockchip: drv: sync with linux-4.19 Signed-off-by: Sandy Huang Change-Id: Iaaea4f8067fbded3c135b5a992134c77d7b0bf05 --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index fa81441082a1..4665e990f303 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -527,6 +527,7 @@ static void rockchip_drm_set_property_default(struct drm_device *drm) WARN_ON(ret == -EDEADLK); if (ret) DRM_ERROR("Failed to update properties\n"); + drm_atomic_state_put(state); err_unlock: drm_modeset_unlock_all(drm); @@ -630,7 +631,7 @@ static int rockchip_drm_bind(struct device *dev) /* Try to bind all sub drivers. */ ret = component_bind_all(dev, drm_dev); if (ret) - goto err_iommu_cleanup; + goto err_mode_config_cleanup; rockchip_attach_connector_property(drm_dev); ret = drm_vblank_init(drm_dev, drm_dev->mode_config.num_crtc); @@ -673,9 +674,13 @@ err_kms_helper_poll_fini: rockchip_drm_fbdev_fini(drm_dev); err_unbind_all: component_unbind_all(dev, drm_dev); +err_mode_config_cleanup: + drm_mode_config_cleanup(drm_dev); err_iommu_cleanup: rockchip_iommu_cleanup(drm_dev); err_free: + drm_dev->dev_private = NULL; + dev_set_drvdata(dev, NULL); drm_dev_put(drm_dev); return ret; } @@ -692,8 +697,11 @@ static void rockchip_drm_unbind(struct device *dev) drm_atomic_helper_shutdown(drm_dev); component_unbind_all(dev, drm_dev); + drm_mode_config_cleanup(drm_dev); rockchip_iommu_cleanup(drm_dev); + drm_dev->dev_private = NULL; + dev_set_drvdata(dev, NULL); drm_dev_put(drm_dev); } @@ -730,12 +738,10 @@ static void rockchip_drm_postclose(struct drm_device *dev, static void rockchip_drm_lastclose(struct drm_device *dev) { -#if 0 /* todo */ struct rockchip_drm_private *priv = dev->dev_private; if (!priv->logo) drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev_helper); -#endif } static struct drm_pending_vblank_event *