diff options
Diffstat (limited to 'drivers/gpu/drm/meson/meson_drv.c')
| -rw-r--r-- | drivers/gpu/drm/meson/meson_drv.c | 29 | 
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 1b70938cfd2c..3b24a924b7b9 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -19,7 +19,7 @@  #include <drm/drm_atomic_helper.h>  #include <drm/drm_drv.h>  #include <drm/drm_fb_helper.h> -#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_dma_helper.h>  #include <drm/drm_gem_framebuffer_helper.h>  #include <drm/drm_modeset_helper_vtables.h>  #include <drm/drm_module.h> @@ -87,16 +87,16 @@ static int meson_dumb_create(struct drm_file *file, struct drm_device *dev,  	args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), SZ_64);  	args->size = PAGE_ALIGN(args->pitch * args->height); -	return drm_gem_cma_dumb_create_internal(file, dev, args); +	return drm_gem_dma_dumb_create_internal(file, dev, args);  } -DEFINE_DRM_GEM_CMA_FOPS(fops); +DEFINE_DRM_GEM_DMA_FOPS(fops);  static const struct drm_driver meson_driver = {  	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, -	/* CMA Ops */ -	DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(meson_dumb_create), +	/* DMA Ops */ +	DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE(meson_dumb_create),  	/* Misc */  	.fops			= &fops, @@ -115,8 +115,11 @@ static bool meson_vpu_has_available_connectors(struct device *dev)  	for_each_endpoint_of_node(dev->of_node, ep) {  		/* If the endpoint node exists, consider it enabled */  		remote = of_graph_get_remote_port(ep); -		if (remote) +		if (remote) { +			of_node_put(remote); +			of_node_put(ep);  			return true; +		}  	}  	return false; @@ -385,10 +388,14 @@ static void meson_drv_unbind(struct device *dev)  	drm_dev_unregister(drm);  	drm_kms_helper_poll_fini(drm);  	drm_atomic_helper_shutdown(drm); -	component_unbind_all(dev, drm);  	free_irq(priv->vsync_irq, drm);  	drm_dev_put(drm); +	meson_encoder_hdmi_remove(priv); +	meson_encoder_cvbs_remove(priv); + +	component_unbind_all(dev, drm); +  	if (priv->afbcd.ops)  		priv->afbcd.ops->exit(priv);  } @@ -490,6 +497,13 @@ static int meson_drv_probe(struct platform_device *pdev)  	return 0;  }; +static int meson_drv_remove(struct platform_device *pdev) +{ +	component_master_del(&pdev->dev, &meson_drv_master_ops); + +	return 0; +} +  static struct meson_drm_match_data meson_drm_gxbb_data = {  	.compat = VPU_COMPATIBLE_GXBB,  }; @@ -527,6 +541,7 @@ static const struct dev_pm_ops meson_drv_pm_ops = {  static struct platform_driver meson_drm_platform_driver = {  	.probe      = meson_drv_probe, +	.remove     = meson_drv_remove,  	.shutdown   = meson_drv_shutdown,  	.driver     = {  		.name	= "meson-drm",  |