summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorHsin-Yi Wang <hsinyi@chromium.org>2019-05-29 18:25:55 +0800
committerCK Hu <ck.hu@mediatek.com>2019-06-04 09:29:22 +0800
commita4cd1d2b016d5d043ab2c4b9c4ec50a5805f5396 (patch)
treea6240c1f982f7906299bacd57b6f8415cfb6e183 /drivers/gpu
parentcf49b24ffa62766f8f04cd1c4cf17b75d29b240a (diff)
downloadlinux-a4cd1d2b016d5d043ab2c4b9c4ec50a5805f5396.tar.gz
linux-a4cd1d2b016d5d043ab2c4b9c4ec50a5805f5396.tar.bz2
linux-a4cd1d2b016d5d043ab2c4b9c4ec50a5805f5396.zip
drm/mediatek: clear num_pipes when unbind driver
num_pipes is used for mutex created in mtk_drm_crtc_create(). If we don't clear num_pipes count, when rebinding driver, the count will be accumulated. From mtk_disp_mutex_get(), there can only be at most 10 mutex id. Clear this number so it starts from 0 in every rebind. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Signed-off-by: CK Hu <ck.hu@mediatek.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_drv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 8718d123ccaa..bbfe3a464aea 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -400,6 +400,7 @@ static void mtk_drm_unbind(struct device *dev)
drm_dev_unregister(private->drm);
mtk_drm_kms_deinit(private->drm);
drm_dev_put(private->drm);
+ private->num_pipes = 0;
private->drm = NULL;
}