소스 검색

drm/tidss: use drm_fbdev_generic_setup

The driver crashes when calling drm_fbdev_cma_fini(), and the reason
seems to be that drm_dev_unregister() already releases the fbdev, or
parts of it. The exact problem is unclear.

The DRM framework has a new way to setup the fbdev, by calling
drm_fbdev_generic_setup. This is used in the mainline, e.g.
2f690fad237adea1bdce8ed9026cbf43cd9d8c46 ("drm/rcar-du: Use
drm_fbdev_generic_setup()").

This patch does a similar change to tidss, which also seems to get rid
of the crash problem.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Tomi Valkeinen 6 년 전
부모
커밋
2ba449d432
1개의 변경된 파일2개의 추가작업 그리고 26개의 파일을 삭제
  1. 2 26
      drivers/gpu/drm/tidss/tidss_drv.c

+ 2 - 26
drivers/gpu/drm/tidss/tidss_drv.c

@@ -13,7 +13,6 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 
@@ -177,22 +176,6 @@ static int tidss_probe(struct platform_device *pdev)
 		goto err_modeset_cleanup;
 	}
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-	if (ddev->mode_config.num_connector) {
-		struct drm_fbdev_cma *fbdev;
-
-		fbdev = drm_fbdev_cma_init(ddev, 32,
-					   ddev->mode_config.num_connector);
-		if (IS_ERR(fbdev)) {
-			dev_err(tidss->dev, "fbdev init failed\n");
-			ret =  PTR_ERR(fbdev);
-			goto err_irq_uninstall;
-		}
-
-		tidss->fbdev = fbdev;
-	}
-#endif
-
 	drm_kms_helper_poll_init(ddev);
 
 	ret = drm_dev_register(ddev, 0);
@@ -201,6 +184,8 @@ static int tidss_probe(struct platform_device *pdev)
 		goto err_poll_fini;
 	}
 
+	drm_fbdev_generic_setup(ddev, 32);
+
 	dev_dbg(dev, "%s done\n", __func__);
 
 	return 0;
@@ -208,14 +193,8 @@ static int tidss_probe(struct platform_device *pdev)
 err_poll_fini:
 	drm_kms_helper_poll_fini(ddev);
 
-	if (tidss->fbdev)
-		drm_fbdev_cma_fini(tidss->fbdev);
-
 	drm_atomic_helper_shutdown(ddev);
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-err_irq_uninstall:
-#endif
 	drm_irq_uninstall(ddev);
 
 err_modeset_cleanup:
@@ -249,9 +228,6 @@ static int tidss_remove(struct platform_device *pdev)
 
 	drm_kms_helper_poll_fini(ddev);
 
-	if (tidss->fbdev)
-		drm_fbdev_cma_fini(tidss->fbdev);
-
 	drm_atomic_helper_shutdown(ddev);
 
 	drm_irq_uninstall(ddev);