diff options
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_drv.c')
| -rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_drv.c | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 275f7e4a03ae..6eb1aabdb161 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -7,6 +7,7 @@   */  #include <linux/component.h> +#include <linux/dma-mapping.h>  #include <linux/kfifo.h>  #include <linux/module.h>  #include <linux/of_graph.h> @@ -73,7 +74,6 @@ static int sun4i_drv_bind(struct device *dev)  		goto free_drm;  	} -	dev_set_drvdata(dev, drm);  	drm->dev_private = drv;  	INIT_LIST_HEAD(&drv->frontend_list);  	INIT_LIST_HEAD(&drv->engine_list); @@ -114,6 +114,8 @@ static int sun4i_drv_bind(struct device *dev)  	drm_fbdev_generic_setup(drm, 32); +	dev_set_drvdata(dev, drm); +  	return 0;  finish_poll: @@ -130,6 +132,7 @@ static void sun4i_drv_unbind(struct device *dev)  {  	struct drm_device *drm = dev_get_drvdata(dev); +	dev_set_drvdata(dev, NULL);  	drm_dev_unregister(drm);  	drm_kms_helper_poll_fini(drm);  	drm_atomic_helper_shutdown(drm); @@ -367,6 +370,13 @@ static int sun4i_drv_probe(struct platform_device *pdev)  	INIT_KFIFO(list.fifo); +	/* +	 * DE2 and DE3 cores actually supports 40-bit addresses, but +	 * driver does not. +	 */ +	dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); +	dma_set_max_seg_size(&pdev->dev, UINT_MAX); +  	for (i = 0;; i++) {  		struct device_node *pipeline = of_parse_phandle(np,  								"allwinner,pipelines", | 
