diff options
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_crtc.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_g2d.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_rotator.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 14 |
12 files changed, 64 insertions, 77 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index e8894bc9e6d5..c200e4d71e3d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
@@ -48,6 +48,8 @@ struct exynos_drm_crtc { | |||
48 | unsigned int pipe; | 48 | unsigned int pipe; |
49 | unsigned int dpms; | 49 | unsigned int dpms; |
50 | enum exynos_crtc_mode mode; | 50 | enum exynos_crtc_mode mode; |
51 | wait_queue_head_t pending_flip_queue; | ||
52 | atomic_t pending_flip; | ||
51 | }; | 53 | }; |
52 | 54 | ||
53 | static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) | 55 | static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) |
@@ -61,6 +63,13 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
61 | return; | 63 | return; |
62 | } | 64 | } |
63 | 65 | ||
66 | if (mode > DRM_MODE_DPMS_ON) { | ||
67 | /* wait for the completion of page flip. */ | ||
68 | wait_event(exynos_crtc->pending_flip_queue, | ||
69 | atomic_read(&exynos_crtc->pending_flip) == 0); | ||
70 | drm_vblank_off(crtc->dev, exynos_crtc->pipe); | ||
71 | } | ||
72 | |||
64 | exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms); | 73 | exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms); |
65 | exynos_crtc->dpms = mode; | 74 | exynos_crtc->dpms = mode; |
66 | } | 75 | } |
@@ -217,7 +226,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
217 | ret = drm_vblank_get(dev, exynos_crtc->pipe); | 226 | ret = drm_vblank_get(dev, exynos_crtc->pipe); |
218 | if (ret) { | 227 | if (ret) { |
219 | DRM_DEBUG("failed to acquire vblank counter\n"); | 228 | DRM_DEBUG("failed to acquire vblank counter\n"); |
220 | list_del(&event->base.link); | ||
221 | 229 | ||
222 | goto out; | 230 | goto out; |
223 | } | 231 | } |
@@ -225,6 +233,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
225 | spin_lock_irq(&dev->event_lock); | 233 | spin_lock_irq(&dev->event_lock); |
226 | list_add_tail(&event->base.link, | 234 | list_add_tail(&event->base.link, |
227 | &dev_priv->pageflip_event_list); | 235 | &dev_priv->pageflip_event_list); |
236 | atomic_set(&exynos_crtc->pending_flip, 1); | ||
228 | spin_unlock_irq(&dev->event_lock); | 237 | spin_unlock_irq(&dev->event_lock); |
229 | 238 | ||
230 | crtc->fb = fb; | 239 | crtc->fb = fb; |
@@ -344,6 +353,8 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr) | |||
344 | 353 | ||
345 | exynos_crtc->pipe = nr; | 354 | exynos_crtc->pipe = nr; |
346 | exynos_crtc->dpms = DRM_MODE_DPMS_OFF; | 355 | exynos_crtc->dpms = DRM_MODE_DPMS_OFF; |
356 | init_waitqueue_head(&exynos_crtc->pending_flip_queue); | ||
357 | atomic_set(&exynos_crtc->pending_flip, 0); | ||
347 | exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true); | 358 | exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true); |
348 | if (!exynos_crtc->plane) { | 359 | if (!exynos_crtc->plane) { |
349 | kfree(exynos_crtc); | 360 | kfree(exynos_crtc); |
@@ -398,7 +409,8 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc) | |||
398 | { | 409 | { |
399 | struct exynos_drm_private *dev_priv = dev->dev_private; | 410 | struct exynos_drm_private *dev_priv = dev->dev_private; |
400 | struct drm_pending_vblank_event *e, *t; | 411 | struct drm_pending_vblank_event *e, *t; |
401 | struct timeval now; | 412 | struct drm_crtc *drm_crtc = dev_priv->crtc[crtc]; |
413 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc); | ||
402 | unsigned long flags; | 414 | unsigned long flags; |
403 | 415 | ||
404 | DRM_DEBUG_KMS("%s\n", __FILE__); | 416 | DRM_DEBUG_KMS("%s\n", __FILE__); |
@@ -411,14 +423,11 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc) | |||
411 | if (crtc != e->pipe) | 423 | if (crtc != e->pipe) |
412 | continue; | 424 | continue; |
413 | 425 | ||
414 | do_gettimeofday(&now); | 426 | list_del(&e->base.link); |
415 | e->event.sequence = 0; | 427 | drm_send_vblank_event(dev, -1, e); |
416 | e->event.tv_sec = now.tv_sec; | ||
417 | e->event.tv_usec = now.tv_usec; | ||
418 | |||
419 | list_move_tail(&e->base.link, &e->base.file_priv->event_list); | ||
420 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
421 | drm_vblank_put(dev, crtc); | 428 | drm_vblank_put(dev, crtc); |
429 | atomic_set(&exynos_crtc->pending_flip, 0); | ||
430 | wake_up(&exynos_crtc->pending_flip_queue); | ||
422 | } | 431 | } |
423 | 432 | ||
424 | spin_unlock_irqrestore(&dev->event_lock, flags); | 433 | spin_unlock_irqrestore(&dev->event_lock, flags); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 68f0045f86b8..8f007aaeffc3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -182,7 +182,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
182 | 182 | ||
183 | helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, | 183 | helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, |
184 | &exynos_gem_obj->base); | 184 | &exynos_gem_obj->base); |
185 | if (IS_ERR_OR_NULL(helper->fb)) { | 185 | if (IS_ERR(helper->fb)) { |
186 | DRM_ERROR("failed to create drm framebuffer.\n"); | 186 | DRM_ERROR("failed to create drm framebuffer.\n"); |
187 | ret = PTR_ERR(helper->fb); | 187 | ret = PTR_ERR(helper->fb); |
188 | goto err_destroy_gem; | 188 | goto err_destroy_gem; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 773f583fa964..4a1616a18ab7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -12,9 +12,9 @@ | |||
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/mfd/syscon.h> | ||
16 | #include <linux/module.h> | 15 | #include <linux/module.h> |
17 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mfd/syscon.h> | ||
18 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
@@ -1845,7 +1845,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | ctx->irq = res->start; | 1847 | ctx->irq = res->start; |
1848 | ret = request_threaded_irq(ctx->irq, NULL, fimc_irq_handler, | 1848 | ret = devm_request_threaded_irq(dev, ctx->irq, NULL, fimc_irq_handler, |
1849 | IRQF_ONESHOT, "drm_fimc", ctx); | 1849 | IRQF_ONESHOT, "drm_fimc", ctx); |
1850 | if (ret < 0) { | 1850 | if (ret < 0) { |
1851 | dev_err(dev, "failed to request irq.\n"); | 1851 | dev_err(dev, "failed to request irq.\n"); |
@@ -1854,7 +1854,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1854 | 1854 | ||
1855 | ret = fimc_setup_clocks(ctx); | 1855 | ret = fimc_setup_clocks(ctx); |
1856 | if (ret < 0) | 1856 | if (ret < 0) |
1857 | goto err_free_irq; | 1857 | return ret; |
1858 | 1858 | ||
1859 | ippdrv = &ctx->ippdrv; | 1859 | ippdrv = &ctx->ippdrv; |
1860 | ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops; | 1860 | ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops; |
@@ -1884,7 +1884,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1884 | goto err_pm_dis; | 1884 | goto err_pm_dis; |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | dev_info(&pdev->dev, "drm fimc registered successfully.\n"); | 1887 | dev_info(dev, "drm fimc registered successfully.\n"); |
1888 | 1888 | ||
1889 | return 0; | 1889 | return 0; |
1890 | 1890 | ||
@@ -1892,8 +1892,6 @@ err_pm_dis: | |||
1892 | pm_runtime_disable(dev); | 1892 | pm_runtime_disable(dev); |
1893 | err_put_clk: | 1893 | err_put_clk: |
1894 | fimc_put_clocks(ctx); | 1894 | fimc_put_clocks(ctx); |
1895 | err_free_irq: | ||
1896 | free_irq(ctx->irq, ctx); | ||
1897 | 1895 | ||
1898 | return ret; | 1896 | return ret; |
1899 | } | 1897 | } |
@@ -1911,8 +1909,6 @@ static int fimc_remove(struct platform_device *pdev) | |||
1911 | pm_runtime_set_suspended(dev); | 1909 | pm_runtime_set_suspended(dev); |
1912 | pm_runtime_disable(dev); | 1910 | pm_runtime_disable(dev); |
1913 | 1911 | ||
1914 | free_irq(ctx->irq, ctx); | ||
1915 | |||
1916 | return 0; | 1912 | return 0; |
1917 | } | 1913 | } |
1918 | 1914 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 746b282b343a..97c61dbffd82 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
885 | 885 | ||
886 | DRM_DEBUG_KMS("%s\n", __FILE__); | 886 | DRM_DEBUG_KMS("%s\n", __FILE__); |
887 | 887 | ||
888 | if (pdev->dev.of_node) { | 888 | if (dev->of_node) { |
889 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); | 889 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); |
890 | if (!pdata) { | 890 | if (!pdata) { |
891 | DRM_ERROR("memory allocation for pdata failed\n"); | 891 | DRM_ERROR("memory allocation for pdata failed\n"); |
@@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
899 | return ret; | 899 | return ret; |
900 | } | 900 | } |
901 | } else { | 901 | } else { |
902 | pdata = pdev->dev.platform_data; | 902 | pdata = dev->platform_data; |
903 | if (!pdata) { | 903 | if (!pdata) { |
904 | DRM_ERROR("no platform data specified\n"); | 904 | DRM_ERROR("no platform data specified\n"); |
905 | return -EINVAL; | 905 | return -EINVAL; |
@@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
912 | return -EINVAL; | 912 | return -EINVAL; |
913 | } | 913 | } |
914 | 914 | ||
915 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 915 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
916 | if (!ctx) | 916 | if (!ctx) |
917 | return -ENOMEM; | 917 | return -ENOMEM; |
918 | 918 | ||
@@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
930 | 930 | ||
931 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 931 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
932 | 932 | ||
933 | ctx->regs = devm_ioremap_resource(&pdev->dev, res); | 933 | ctx->regs = devm_ioremap_resource(dev, res); |
934 | if (IS_ERR(ctx->regs)) | 934 | if (IS_ERR(ctx->regs)) |
935 | return PTR_ERR(ctx->regs); | 935 | return PTR_ERR(ctx->regs); |
936 | 936 | ||
@@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
942 | 942 | ||
943 | ctx->irq = res->start; | 943 | ctx->irq = res->start; |
944 | 944 | ||
945 | ret = devm_request_irq(&pdev->dev, ctx->irq, fimd_irq_handler, | 945 | ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler, |
946 | 0, "drm_fimd", ctx); | 946 | 0, "drm_fimd", ctx); |
947 | if (ret) { | 947 | if (ret) { |
948 | dev_err(dev, "irq request failed.\n"); | 948 | dev_err(dev, "irq request failed.\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 47a493c8a71f..af75434ee4d7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1379 | struct exynos_drm_subdrv *subdrv; | 1379 | struct exynos_drm_subdrv *subdrv; |
1380 | int ret; | 1380 | int ret; |
1381 | 1381 | ||
1382 | g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL); | 1382 | g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL); |
1383 | if (!g2d) { | 1383 | if (!g2d) { |
1384 | dev_err(dev, "failed to allocate driver data\n"); | 1384 | dev_err(dev, "failed to allocate driver data\n"); |
1385 | return -ENOMEM; | 1385 | return -ENOMEM; |
@@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1417 | 1417 | ||
1418 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1418 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1419 | 1419 | ||
1420 | g2d->regs = devm_ioremap_resource(&pdev->dev, res); | 1420 | g2d->regs = devm_ioremap_resource(dev, res); |
1421 | if (IS_ERR(g2d->regs)) { | 1421 | if (IS_ERR(g2d->regs)) { |
1422 | ret = PTR_ERR(g2d->regs); | 1422 | ret = PTR_ERR(g2d->regs); |
1423 | goto err_put_clk; | 1423 | goto err_put_clk; |
@@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1430 | goto err_put_clk; | 1430 | goto err_put_clk; |
1431 | } | 1431 | } |
1432 | 1432 | ||
1433 | ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0, | 1433 | ret = devm_request_irq(dev, g2d->irq, g2d_irq_handler, 0, |
1434 | "drm_g2d", g2d); | 1434 | "drm_g2d", g2d); |
1435 | if (ret < 0) { | 1435 | if (ret < 0) { |
1436 | dev_err(dev, "irq request failed\n"); | 1436 | dev_err(dev, "irq request failed\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 7841c3b8a20e..762f40d548b7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1704,7 +1704,7 @@ static int gsc_probe(struct platform_device *pdev) | |||
1704 | } | 1704 | } |
1705 | 1705 | ||
1706 | ctx->irq = res->start; | 1706 | ctx->irq = res->start; |
1707 | ret = request_threaded_irq(ctx->irq, NULL, gsc_irq_handler, | 1707 | ret = devm_request_threaded_irq(dev, ctx->irq, NULL, gsc_irq_handler, |
1708 | IRQF_ONESHOT, "drm_gsc", ctx); | 1708 | IRQF_ONESHOT, "drm_gsc", ctx); |
1709 | if (ret < 0) { | 1709 | if (ret < 0) { |
1710 | dev_err(dev, "failed to request irq.\n"); | 1710 | dev_err(dev, "failed to request irq.\n"); |
@@ -1725,7 +1725,7 @@ static int gsc_probe(struct platform_device *pdev) | |||
1725 | ret = gsc_init_prop_list(ippdrv); | 1725 | ret = gsc_init_prop_list(ippdrv); |
1726 | if (ret < 0) { | 1726 | if (ret < 0) { |
1727 | dev_err(dev, "failed to init property list.\n"); | 1727 | dev_err(dev, "failed to init property list.\n"); |
1728 | goto err_get_irq; | 1728 | return ret; |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, | 1731 | DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, |
@@ -1743,15 +1743,12 @@ static int gsc_probe(struct platform_device *pdev) | |||
1743 | goto err_ippdrv_register; | 1743 | goto err_ippdrv_register; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | dev_info(&pdev->dev, "drm gsc registered successfully.\n"); | 1746 | dev_info(dev, "drm gsc registered successfully.\n"); |
1747 | 1747 | ||
1748 | return 0; | 1748 | return 0; |
1749 | 1749 | ||
1750 | err_ippdrv_register: | 1750 | err_ippdrv_register: |
1751 | devm_kfree(dev, ippdrv->prop_list); | ||
1752 | pm_runtime_disable(dev); | 1751 | pm_runtime_disable(dev); |
1753 | err_get_irq: | ||
1754 | free_irq(ctx->irq, ctx); | ||
1755 | return ret; | 1752 | return ret; |
1756 | } | 1753 | } |
1757 | 1754 | ||
@@ -1761,15 +1758,12 @@ static int gsc_remove(struct platform_device *pdev) | |||
1761 | struct gsc_context *ctx = get_gsc_context(dev); | 1758 | struct gsc_context *ctx = get_gsc_context(dev); |
1762 | struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; | 1759 | struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; |
1763 | 1760 | ||
1764 | devm_kfree(dev, ippdrv->prop_list); | ||
1765 | exynos_drm_ippdrv_unregister(ippdrv); | 1761 | exynos_drm_ippdrv_unregister(ippdrv); |
1766 | mutex_destroy(&ctx->lock); | 1762 | mutex_destroy(&ctx->lock); |
1767 | 1763 | ||
1768 | pm_runtime_set_suspended(dev); | 1764 | pm_runtime_set_suspended(dev); |
1769 | pm_runtime_disable(dev); | 1765 | pm_runtime_disable(dev); |
1770 | 1766 | ||
1771 | free_irq(ctx->irq, ctx); | ||
1772 | |||
1773 | return 0; | 1767 | return 0; |
1774 | } | 1768 | } |
1775 | 1769 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index ba2f0f1aa05f..437fb947e46d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c | |||
@@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev) | |||
442 | 442 | ||
443 | DRM_DEBUG_KMS("%s\n", __FILE__); | 443 | DRM_DEBUG_KMS("%s\n", __FILE__); |
444 | 444 | ||
445 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 445 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
446 | if (!ctx) { | 446 | if (!ctx) { |
447 | DRM_LOG_KMS("failed to alloc common hdmi context.\n"); | 447 | DRM_LOG_KMS("failed to alloc common hdmi context.\n"); |
448 | return -ENOMEM; | 448 | return -ENOMEM; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 29d2ad314490..be1e88463466 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -222,7 +222,7 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx, | |||
222 | /* find ipp driver using idr */ | 222 | /* find ipp driver using idr */ |
223 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, | 223 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, |
224 | ipp_id); | 224 | ipp_id); |
225 | if (IS_ERR_OR_NULL(ippdrv)) { | 225 | if (IS_ERR(ippdrv)) { |
226 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); | 226 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); |
227 | return ippdrv; | 227 | return ippdrv; |
228 | } | 228 | } |
@@ -388,7 +388,7 @@ static int ipp_find_and_set_property(struct drm_exynos_ipp_property *property) | |||
388 | DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id); | 388 | DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id); |
389 | 389 | ||
390 | ippdrv = ipp_find_drv_by_handle(prop_id); | 390 | ippdrv = ipp_find_drv_by_handle(prop_id); |
391 | if (IS_ERR_OR_NULL(ippdrv)) { | 391 | if (IS_ERR(ippdrv)) { |
392 | DRM_ERROR("failed to get ipp driver.\n"); | 392 | DRM_ERROR("failed to get ipp driver.\n"); |
393 | return -EINVAL; | 393 | return -EINVAL; |
394 | } | 394 | } |
@@ -492,7 +492,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, | |||
492 | 492 | ||
493 | /* find ipp driver using ipp id */ | 493 | /* find ipp driver using ipp id */ |
494 | ippdrv = ipp_find_driver(ctx, property); | 494 | ippdrv = ipp_find_driver(ctx, property); |
495 | if (IS_ERR_OR_NULL(ippdrv)) { | 495 | if (IS_ERR(ippdrv)) { |
496 | DRM_ERROR("failed to get ipp driver.\n"); | 496 | DRM_ERROR("failed to get ipp driver.\n"); |
497 | return -EINVAL; | 497 | return -EINVAL; |
498 | } | 498 | } |
@@ -521,19 +521,19 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, | |||
521 | c_node->state = IPP_STATE_IDLE; | 521 | c_node->state = IPP_STATE_IDLE; |
522 | 522 | ||
523 | c_node->start_work = ipp_create_cmd_work(); | 523 | c_node->start_work = ipp_create_cmd_work(); |
524 | if (IS_ERR_OR_NULL(c_node->start_work)) { | 524 | if (IS_ERR(c_node->start_work)) { |
525 | DRM_ERROR("failed to create start work.\n"); | 525 | DRM_ERROR("failed to create start work.\n"); |
526 | goto err_clear; | 526 | goto err_clear; |
527 | } | 527 | } |
528 | 528 | ||
529 | c_node->stop_work = ipp_create_cmd_work(); | 529 | c_node->stop_work = ipp_create_cmd_work(); |
530 | if (IS_ERR_OR_NULL(c_node->stop_work)) { | 530 | if (IS_ERR(c_node->stop_work)) { |
531 | DRM_ERROR("failed to create stop work.\n"); | 531 | DRM_ERROR("failed to create stop work.\n"); |
532 | goto err_free_start; | 532 | goto err_free_start; |
533 | } | 533 | } |
534 | 534 | ||
535 | c_node->event_work = ipp_create_event_work(); | 535 | c_node->event_work = ipp_create_event_work(); |
536 | if (IS_ERR_OR_NULL(c_node->event_work)) { | 536 | if (IS_ERR(c_node->event_work)) { |
537 | DRM_ERROR("failed to create event work.\n"); | 537 | DRM_ERROR("failed to create event work.\n"); |
538 | goto err_free_stop; | 538 | goto err_free_stop; |
539 | } | 539 | } |
@@ -915,7 +915,7 @@ static int ipp_queue_buf_with_run(struct device *dev, | |||
915 | DRM_DEBUG_KMS("%s\n", __func__); | 915 | DRM_DEBUG_KMS("%s\n", __func__); |
916 | 916 | ||
917 | ippdrv = ipp_find_drv_by_handle(qbuf->prop_id); | 917 | ippdrv = ipp_find_drv_by_handle(qbuf->prop_id); |
918 | if (IS_ERR_OR_NULL(ippdrv)) { | 918 | if (IS_ERR(ippdrv)) { |
919 | DRM_ERROR("failed to get ipp driver.\n"); | 919 | DRM_ERROR("failed to get ipp driver.\n"); |
920 | return -EFAULT; | 920 | return -EFAULT; |
921 | } | 921 | } |
@@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev) | |||
1909 | struct exynos_drm_subdrv *subdrv; | 1909 | struct exynos_drm_subdrv *subdrv; |
1910 | int ret; | 1910 | int ret; |
1911 | 1911 | ||
1912 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 1912 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
1913 | if (!ctx) | 1913 | if (!ctx) |
1914 | return -ENOMEM; | 1914 | return -ENOMEM; |
1915 | 1915 | ||
@@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev) | |||
1963 | goto err_cmd_workq; | 1963 | goto err_cmd_workq; |
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | dev_info(&pdev->dev, "drm ipp registered successfully.\n"); | 1966 | dev_info(dev, "drm ipp registered successfully.\n"); |
1967 | 1967 | ||
1968 | return 0; | 1968 | return 0; |
1969 | 1969 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 947f09f15ad1..9b6c70964d71 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -666,8 +666,8 @@ static int rotator_probe(struct platform_device *pdev) | |||
666 | return rot->irq; | 666 | return rot->irq; |
667 | } | 667 | } |
668 | 668 | ||
669 | ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler, | 669 | ret = devm_request_threaded_irq(dev, rot->irq, NULL, |
670 | IRQF_ONESHOT, "drm_rotator", rot); | 670 | rotator_irq_handler, IRQF_ONESHOT, "drm_rotator", rot); |
671 | if (ret < 0) { | 671 | if (ret < 0) { |
672 | dev_err(dev, "failed to request irq\n"); | 672 | dev_err(dev, "failed to request irq\n"); |
673 | return ret; | 673 | return ret; |
@@ -676,8 +676,7 @@ static int rotator_probe(struct platform_device *pdev) | |||
676 | rot->clock = devm_clk_get(dev, "rotator"); | 676 | rot->clock = devm_clk_get(dev, "rotator"); |
677 | if (IS_ERR(rot->clock)) { | 677 | if (IS_ERR(rot->clock)) { |
678 | dev_err(dev, "failed to get clock\n"); | 678 | dev_err(dev, "failed to get clock\n"); |
679 | ret = PTR_ERR(rot->clock); | 679 | return PTR_ERR(rot->clock); |
680 | goto err_clk_get; | ||
681 | } | 680 | } |
682 | 681 | ||
683 | pm_runtime_enable(dev); | 682 | pm_runtime_enable(dev); |
@@ -709,10 +708,7 @@ static int rotator_probe(struct platform_device *pdev) | |||
709 | return 0; | 708 | return 0; |
710 | 709 | ||
711 | err_ippdrv_register: | 710 | err_ippdrv_register: |
712 | devm_kfree(dev, ippdrv->prop_list); | ||
713 | pm_runtime_disable(dev); | 711 | pm_runtime_disable(dev); |
714 | err_clk_get: | ||
715 | free_irq(rot->irq, rot); | ||
716 | return ret; | 712 | return ret; |
717 | } | 713 | } |
718 | 714 | ||
@@ -722,13 +718,10 @@ static int rotator_remove(struct platform_device *pdev) | |||
722 | struct rot_context *rot = dev_get_drvdata(dev); | 718 | struct rot_context *rot = dev_get_drvdata(dev); |
723 | struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv; | 719 | struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv; |
724 | 720 | ||
725 | devm_kfree(dev, ippdrv->prop_list); | ||
726 | exynos_drm_ippdrv_unregister(ippdrv); | 721 | exynos_drm_ippdrv_unregister(ippdrv); |
727 | 722 | ||
728 | pm_runtime_disable(dev); | 723 | pm_runtime_disable(dev); |
729 | 724 | ||
730 | free_irq(rot->irq, rot); | ||
731 | |||
732 | return 0; | 725 | return 0; |
733 | } | 726 | } |
734 | 727 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 9504b0cd825a..24376c194a5e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -594,7 +594,7 @@ static int vidi_probe(struct platform_device *pdev) | |||
594 | 594 | ||
595 | DRM_DEBUG_KMS("%s\n", __FILE__); | 595 | DRM_DEBUG_KMS("%s\n", __FILE__); |
596 | 596 | ||
597 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 597 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
598 | if (!ctx) | 598 | if (!ctx) |
599 | return -ENOMEM; | 599 | return -ENOMEM; |
600 | 600 | ||
@@ -612,7 +612,7 @@ static int vidi_probe(struct platform_device *pdev) | |||
612 | 612 | ||
613 | platform_set_drvdata(pdev, ctx); | 613 | platform_set_drvdata(pdev, ctx); |
614 | 614 | ||
615 | ret = device_create_file(&pdev->dev, &dev_attr_connection); | 615 | ret = device_create_file(dev, &dev_attr_connection); |
616 | if (ret < 0) | 616 | if (ret < 0) |
617 | DRM_INFO("failed to create connection sysfs.\n"); | 617 | DRM_INFO("failed to create connection sysfs.\n"); |
618 | 618 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6652597586a1..fd1426dca882 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -1946,14 +1946,14 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1946 | 1946 | ||
1947 | DRM_DEBUG_KMS("[%d]\n", __LINE__); | 1947 | DRM_DEBUG_KMS("[%d]\n", __LINE__); |
1948 | 1948 | ||
1949 | if (pdev->dev.of_node) { | 1949 | if (dev->of_node) { |
1950 | pdata = drm_hdmi_dt_parse_pdata(dev); | 1950 | pdata = drm_hdmi_dt_parse_pdata(dev); |
1951 | if (IS_ERR(pdata)) { | 1951 | if (IS_ERR(pdata)) { |
1952 | DRM_ERROR("failed to parse dt\n"); | 1952 | DRM_ERROR("failed to parse dt\n"); |
1953 | return PTR_ERR(pdata); | 1953 | return PTR_ERR(pdata); |
1954 | } | 1954 | } |
1955 | } else { | 1955 | } else { |
1956 | pdata = pdev->dev.platform_data; | 1956 | pdata = dev->platform_data; |
1957 | } | 1957 | } |
1958 | 1958 | ||
1959 | if (!pdata) { | 1959 | if (!pdata) { |
@@ -1961,14 +1961,14 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1961 | return -EINVAL; | 1961 | return -EINVAL; |
1962 | } | 1962 | } |
1963 | 1963 | ||
1964 | drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), | 1964 | drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), |
1965 | GFP_KERNEL); | 1965 | GFP_KERNEL); |
1966 | if (!drm_hdmi_ctx) { | 1966 | if (!drm_hdmi_ctx) { |
1967 | DRM_ERROR("failed to allocate common hdmi context.\n"); | 1967 | DRM_ERROR("failed to allocate common hdmi context.\n"); |
1968 | return -ENOMEM; | 1968 | return -ENOMEM; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | hdata = devm_kzalloc(&pdev->dev, sizeof(struct hdmi_context), | 1971 | hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), |
1972 | GFP_KERNEL); | 1972 | GFP_KERNEL); |
1973 | if (!hdata) { | 1973 | if (!hdata) { |
1974 | DRM_ERROR("out of memory\n"); | 1974 | DRM_ERROR("out of memory\n"); |
@@ -1985,7 +1985,7 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1985 | if (dev->of_node) { | 1985 | if (dev->of_node) { |
1986 | const struct of_device_id *match; | 1986 | const struct of_device_id *match; |
1987 | match = of_match_node(of_match_ptr(hdmi_match_types), | 1987 | match = of_match_node(of_match_ptr(hdmi_match_types), |
1988 | pdev->dev.of_node); | 1988 | dev->of_node); |
1989 | if (match == NULL) | 1989 | if (match == NULL) |
1990 | return -ENODEV; | 1990 | return -ENODEV; |
1991 | hdata->type = (enum hdmi_type)match->data; | 1991 | hdata->type = (enum hdmi_type)match->data; |
@@ -2005,11 +2005,11 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2007 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2008 | hdata->regs = devm_ioremap_resource(&pdev->dev, res); | 2008 | hdata->regs = devm_ioremap_resource(dev, res); |
2009 | if (IS_ERR(hdata->regs)) | 2009 | if (IS_ERR(hdata->regs)) |
2010 | return PTR_ERR(hdata->regs); | 2010 | return PTR_ERR(hdata->regs); |
2011 | 2011 | ||
2012 | ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); | 2012 | ret = devm_gpio_request(dev, hdata->hpd_gpio, "HPD"); |
2013 | if (ret) { | 2013 | if (ret) { |
2014 | DRM_ERROR("failed to request HPD gpio\n"); | 2014 | DRM_ERROR("failed to request HPD gpio\n"); |
2015 | return ret; | 2015 | return ret; |
@@ -2041,7 +2041,7 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2041 | 2041 | ||
2042 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); | 2042 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); |
2043 | 2043 | ||
2044 | ret = request_threaded_irq(hdata->irq, NULL, | 2044 | ret = devm_request_threaded_irq(dev, hdata->irq, NULL, |
2045 | hdmi_irq_thread, IRQF_TRIGGER_RISING | | 2045 | hdmi_irq_thread, IRQF_TRIGGER_RISING | |
2046 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | 2046 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
2047 | "hdmi", drm_hdmi_ctx); | 2047 | "hdmi", drm_hdmi_ctx); |
@@ -2070,16 +2070,11 @@ err_ddc: | |||
2070 | static int hdmi_remove(struct platform_device *pdev) | 2070 | static int hdmi_remove(struct platform_device *pdev) |
2071 | { | 2071 | { |
2072 | struct device *dev = &pdev->dev; | 2072 | struct device *dev = &pdev->dev; |
2073 | struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev); | ||
2074 | struct hdmi_context *hdata = ctx->ctx; | ||
2075 | 2073 | ||
2076 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); | 2074 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); |
2077 | 2075 | ||
2078 | pm_runtime_disable(dev); | 2076 | pm_runtime_disable(dev); |
2079 | 2077 | ||
2080 | free_irq(hdata->irq, hdata); | ||
2081 | |||
2082 | |||
2083 | /* hdmiphy i2c driver */ | 2078 | /* hdmiphy i2c driver */ |
2084 | i2c_del_driver(&hdmiphy_driver); | 2079 | i2c_del_driver(&hdmiphy_driver); |
2085 | /* DDC i2c driver */ | 2080 | /* DDC i2c driver */ |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index ec3e376b7e01..7c197d3820c5 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -1061,7 +1061,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1061 | return -ENXIO; | 1061 | return -ENXIO; |
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | mixer_res->mixer_regs = devm_ioremap(&pdev->dev, res->start, | 1064 | mixer_res->mixer_regs = devm_ioremap(dev, res->start, |
1065 | resource_size(res)); | 1065 | resource_size(res)); |
1066 | if (mixer_res->mixer_regs == NULL) { | 1066 | if (mixer_res->mixer_regs == NULL) { |
1067 | dev_err(dev, "register mapping failed.\n"); | 1067 | dev_err(dev, "register mapping failed.\n"); |
@@ -1074,7 +1074,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1074 | return -ENXIO; | 1074 | return -ENXIO; |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | ret = devm_request_irq(&pdev->dev, res->start, mixer_irq_handler, | 1077 | ret = devm_request_irq(dev, res->start, mixer_irq_handler, |
1078 | 0, "drm_mixer", ctx); | 1078 | 0, "drm_mixer", ctx); |
1079 | if (ret) { | 1079 | if (ret) { |
1080 | dev_err(dev, "request interrupt failed.\n"); | 1080 | dev_err(dev, "request interrupt failed.\n"); |
@@ -1118,7 +1118,7 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1118 | return -ENXIO; | 1118 | return -ENXIO; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | mixer_res->vp_regs = devm_ioremap(&pdev->dev, res->start, | 1121 | mixer_res->vp_regs = devm_ioremap(dev, res->start, |
1122 | resource_size(res)); | 1122 | resource_size(res)); |
1123 | if (mixer_res->vp_regs == NULL) { | 1123 | if (mixer_res->vp_regs == NULL) { |
1124 | dev_err(dev, "register mapping failed.\n"); | 1124 | dev_err(dev, "register mapping failed.\n"); |
@@ -1169,14 +1169,14 @@ static int mixer_probe(struct platform_device *pdev) | |||
1169 | 1169 | ||
1170 | dev_info(dev, "probe start\n"); | 1170 | dev_info(dev, "probe start\n"); |
1171 | 1171 | ||
1172 | drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), | 1172 | drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), |
1173 | GFP_KERNEL); | 1173 | GFP_KERNEL); |
1174 | if (!drm_hdmi_ctx) { | 1174 | if (!drm_hdmi_ctx) { |
1175 | DRM_ERROR("failed to allocate common hdmi context.\n"); | 1175 | DRM_ERROR("failed to allocate common hdmi context.\n"); |
1176 | return -ENOMEM; | 1176 | return -ENOMEM; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 1179 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
1180 | if (!ctx) { | 1180 | if (!ctx) { |
1181 | DRM_ERROR("failed to alloc mixer context.\n"); | 1181 | DRM_ERROR("failed to alloc mixer context.\n"); |
1182 | return -ENOMEM; | 1182 | return -ENOMEM; |
@@ -1187,14 +1187,14 @@ static int mixer_probe(struct platform_device *pdev) | |||
1187 | if (dev->of_node) { | 1187 | if (dev->of_node) { |
1188 | const struct of_device_id *match; | 1188 | const struct of_device_id *match; |
1189 | match = of_match_node(of_match_ptr(mixer_match_types), | 1189 | match = of_match_node(of_match_ptr(mixer_match_types), |
1190 | pdev->dev.of_node); | 1190 | dev->of_node); |
1191 | drv = (struct mixer_drv_data *)match->data; | 1191 | drv = (struct mixer_drv_data *)match->data; |
1192 | } else { | 1192 | } else { |
1193 | drv = (struct mixer_drv_data *) | 1193 | drv = (struct mixer_drv_data *) |
1194 | platform_get_device_id(pdev)->driver_data; | 1194 | platform_get_device_id(pdev)->driver_data; |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | ctx->dev = &pdev->dev; | 1197 | ctx->dev = dev; |
1198 | ctx->parent_ctx = (void *)drm_hdmi_ctx; | 1198 | ctx->parent_ctx = (void *)drm_hdmi_ctx; |
1199 | drm_hdmi_ctx->ctx = (void *)ctx; | 1199 | drm_hdmi_ctx->ctx = (void *)ctx; |
1200 | ctx->vp_enabled = drv->is_vp_enabled; | 1200 | ctx->vp_enabled = drv->is_vp_enabled; |