summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mediatek/mtk_drm_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-12-03 13:13:32 +1000
committerDave Airlie <airlied@redhat.com>2020-12-03 13:23:57 +1000
commite6c7c9d01f5b1ca3141dca43159a909a596a60a2 (patch)
treec48d84054dc33f273cec6050b79426249e7d417f /drivers/gpu/drm/mediatek/mtk_drm_drv.c
parent207665fd37561f97591e74d0ee80f24bdf06b789 (diff)
parenta4423bec44744ce556e91fe8efffbd10327f79fd (diff)
Merge tag 'mediatek-drm-next-5.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next
Mediatek DRM Next for Linux 5.11-2 1. Add MT8167 support 2. Cleanup function 3. Convert the dpi bindings to yaml 4. Drop local dma_parms 5. Fix formatting and provide missing member description 6. Introduce GEM object functions 7. Fix aliases name 8. Move MIPI DSI phy driver to phy folder Signed-off-by: Dave Airlie <airlied@redhat.com> From: Chun-Kuang Hu <chunkuang.hu@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201130234807.936-1-chunkuang.hu@kernel.org
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_drv.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_drv.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 401311453e7d..2f717df28a77 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -241,21 +241,10 @@ static int mtk_drm_kms_init(struct drm_device *drm)
* Configure the DMA segment size to make sure we get contiguous IOVA
* when importing PRIME buffers.
*/
- if (!dma_dev->dma_parms) {
- private->dma_parms_allocated = true;
- dma_dev->dma_parms =
- devm_kzalloc(drm->dev, sizeof(*dma_dev->dma_parms),
- GFP_KERNEL);
- }
- if (!dma_dev->dma_parms) {
- ret = -ENOMEM;
- goto put_dma_dev;
- }
-
- ret = dma_set_max_seg_size(dma_dev, (unsigned int)DMA_BIT_MASK(32));
+ ret = dma_set_max_seg_size(dma_dev, UINT_MAX);
if (ret) {
dev_err(dma_dev, "Failed to set DMA segment size\n");
- goto err_unset_dma_parms;
+ goto err_component_unbind;
}
/*
@@ -266,18 +255,13 @@ static int mtk_drm_kms_init(struct drm_device *drm)
drm->irq_enabled = true;
ret = drm_vblank_init(drm, MAX_CRTC);
if (ret < 0)
- goto err_unset_dma_parms;
+ goto err_component_unbind;
drm_kms_helper_poll_init(drm);
drm_mode_config_reset(drm);
return 0;
-err_unset_dma_parms:
- if (private->dma_parms_allocated)
- dma_dev->dma_parms = NULL;
-put_dma_dev:
- put_device(private->dma_dev);
err_component_unbind:
component_unbind_all(drm->dev, drm);
put_mutex_dev:
@@ -287,14 +271,9 @@ put_mutex_dev:
static void mtk_drm_kms_deinit(struct drm_device *drm)
{
- struct mtk_drm_private *private = drm->dev_private;
-
drm_kms_helper_poll_fini(drm);
drm_atomic_helper_shutdown(drm);
- if (private->dma_parms_allocated)
- private->dma_dev->dma_parms = NULL;
-
component_unbind_all(drm->dev, drm);
}
@@ -631,7 +610,6 @@ static struct platform_driver * const mtk_drm_drivers[] = {
&mtk_disp_rdma_driver,
&mtk_dpi_driver,
&mtk_drm_platform_driver,
- &mtk_mipi_tx_driver,
&mtk_dsi_driver,
};