blob: 09d884ba9e2e181e973aeea7e20c4e71f39672b6 [file] [log] [blame]
Inki Dae1c248b72011-10-04 19:19:01 +09001/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * Authors:
4 * Inki Dae <inki.dae@samsung.com>
5 * Joonyoung Shim <jy0922.shim@samsung.com>
6 * Seung-Woo Kim <sw0312.kim@samsung.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
David Howells760285e2012-10-02 18:01:07 +010028#include <drm/drmP.h>
29#include <drm/drm_crtc_helper.h>
Inki Dae1c248b72011-10-04 19:19:01 +090030
31#include <drm/exynos_drm.h>
32
33#include "exynos_drm_drv.h"
34#include "exynos_drm_crtc.h"
Inki Daed081f562012-02-15 11:25:19 +090035#include "exynos_drm_encoder.h"
Inki Dae1c248b72011-10-04 19:19:01 +090036#include "exynos_drm_fbdev.h"
37#include "exynos_drm_fb.h"
38#include "exynos_drm_gem.h"
Joonyoung Shim864ee9e2011-12-08 17:54:07 +090039#include "exynos_drm_plane.h"
Inki Daeb73d1232012-03-21 10:55:26 +090040#include "exynos_drm_vidi.h"
Inki Daeb2df26c2012-04-23 21:01:28 +090041#include "exynos_drm_dmabuf.h"
Joonyoung Shimd7f16422012-05-17 20:06:32 +090042#include "exynos_drm_g2d.h"
Eunchul Kimcb471f142012-12-14 18:10:31 +090043#include "exynos_drm_ipp.h"
Inki Dae0519f9a2012-10-20 07:53:42 -070044#include "exynos_drm_iommu.h"
Inki Dae1c248b72011-10-04 19:19:01 +090045
Inki Dae0edf9932011-12-15 17:31:24 +090046#define DRIVER_NAME "exynos"
Inki Dae1c248b72011-10-04 19:19:01 +090047#define DRIVER_DESC "Samsung SoC DRM"
48#define DRIVER_DATE "20110530"
49#define DRIVER_MAJOR 1
50#define DRIVER_MINOR 0
51
Inki Dae52c68812011-12-16 21:31:12 +090052#define VBLANK_OFF_DELAY 50000
53
Rahul Sharma422bd002012-10-16 05:50:12 +053054/* platform device pointer for eynos drm device. */
55static struct platform_device *exynos_drm_pdev;
56
Inki Dae1c248b72011-10-04 19:19:01 +090057static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
58{
59 struct exynos_drm_private *private;
60 int ret;
61 int nr;
62
63 DRM_DEBUG_DRIVER("%s\n", __FILE__);
64
65 private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
66 if (!private) {
67 DRM_ERROR("failed to allocate private\n");
68 return -ENOMEM;
69 }
70
71 INIT_LIST_HEAD(&private->pageflip_event_list);
72 dev->dev_private = (void *)private;
73
Inki Dae0519f9a2012-10-20 07:53:42 -070074 /*
75 * create mapping to manage iommu table and set a pointer to iommu
76 * mapping structure to iommu_mapping of private data.
77 * also this iommu_mapping can be used to check if iommu is supported
78 * or not.
79 */
80 ret = drm_create_iommu_mapping(dev);
81 if (ret < 0) {
82 DRM_ERROR("failed to create iommu mapping.\n");
83 goto err_crtc;
84 }
85
Inki Dae1c248b72011-10-04 19:19:01 +090086 drm_mode_config_init(dev);
87
Seung-Woo Kim7db3eba2011-10-18 16:58:05 +090088 /* init kms poll for handling hpd */
89 drm_kms_helper_poll_init(dev);
90
Inki Dae1c248b72011-10-04 19:19:01 +090091 exynos_drm_mode_config_init(dev);
92
93 /*
94 * EXYNOS4 is enough to have two CRTCs and each crtc would be used
95 * without dependency of hardware.
96 */
97 for (nr = 0; nr < MAX_CRTC; nr++) {
98 ret = exynos_drm_crtc_create(dev, nr);
99 if (ret)
Inki Dae0519f9a2012-10-20 07:53:42 -0700100 goto err_release_iommu_mapping;
Inki Dae1c248b72011-10-04 19:19:01 +0900101 }
102
Joonyoung Shim864ee9e2011-12-08 17:54:07 +0900103 for (nr = 0; nr < MAX_PLANE; nr++) {
Joonyoung Shimb5d2eb32012-06-27 14:27:04 +0900104 struct drm_plane *plane;
105 unsigned int possible_crtcs = (1 << MAX_CRTC) - 1;
106
107 plane = exynos_plane_init(dev, possible_crtcs, false);
108 if (!plane)
Inki Dae0519f9a2012-10-20 07:53:42 -0700109 goto err_release_iommu_mapping;
Joonyoung Shim864ee9e2011-12-08 17:54:07 +0900110 }
111
Inki Dae1c248b72011-10-04 19:19:01 +0900112 ret = drm_vblank_init(dev, MAX_CRTC);
113 if (ret)
Inki Dae0519f9a2012-10-20 07:53:42 -0700114 goto err_release_iommu_mapping;
Inki Dae1c248b72011-10-04 19:19:01 +0900115
116 /*
117 * probe sub drivers such as display controller and hdmi driver,
118 * that were registered at probe() of platform driver
119 * to the sub driver and create encoder and connector for them.
120 */
121 ret = exynos_drm_device_register(dev);
122 if (ret)
123 goto err_vblank;
124
Inki Daed081f562012-02-15 11:25:19 +0900125 /* setup possible_clones. */
126 exynos_drm_encoder_setup(dev);
127
Inki Dae1c248b72011-10-04 19:19:01 +0900128 /*
129 * create and configure fb helper and also exynos specific
130 * fbdev object.
131 */
132 ret = exynos_drm_fbdev_init(dev);
133 if (ret) {
134 DRM_ERROR("failed to initialize drm fbdev\n");
135 goto err_drm_device;
136 }
137
Inki Dae52c68812011-12-16 21:31:12 +0900138 drm_vblank_offdelay = VBLANK_OFF_DELAY;
139
Inki Dae1c248b72011-10-04 19:19:01 +0900140 return 0;
141
142err_drm_device:
143 exynos_drm_device_unregister(dev);
144err_vblank:
145 drm_vblank_cleanup(dev);
Inki Dae0519f9a2012-10-20 07:53:42 -0700146err_release_iommu_mapping:
147 drm_release_iommu_mapping(dev);
Inki Dae1c248b72011-10-04 19:19:01 +0900148err_crtc:
149 drm_mode_config_cleanup(dev);
150 kfree(private);
151
152 return ret;
153}
154
155static int exynos_drm_unload(struct drm_device *dev)
156{
157 DRM_DEBUG_DRIVER("%s\n", __FILE__);
158
159 exynos_drm_fbdev_fini(dev);
160 exynos_drm_device_unregister(dev);
161 drm_vblank_cleanup(dev);
Seung-Woo Kim7db3eba2011-10-18 16:58:05 +0900162 drm_kms_helper_poll_fini(dev);
Inki Dae1c248b72011-10-04 19:19:01 +0900163 drm_mode_config_cleanup(dev);
Inki Dae0519f9a2012-10-20 07:53:42 -0700164
165 drm_release_iommu_mapping(dev);
Inki Dae1c248b72011-10-04 19:19:01 +0900166 kfree(dev->dev_private);
167
168 dev->dev_private = NULL;
169
170 return 0;
171}
172
Joonyoung Shim9084f7b2012-03-16 18:47:09 +0900173static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
Inki Daeccf4d882011-10-14 13:29:51 +0900174{
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900175 struct drm_exynos_file_private *file_priv;
176
Joonyoung Shim6f811502012-02-15 11:25:18 +0900177 DRM_DEBUG_DRIVER("%s\n", __FILE__);
Inki Daeccf4d882011-10-14 13:29:51 +0900178
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900179 file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
180 if (!file_priv)
181 return -ENOMEM;
182
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900183 file->driver_priv = file_priv;
Inki Daeb2df26c2012-04-23 21:01:28 +0900184
Joonyoung Shim9084f7b2012-03-16 18:47:09 +0900185 return exynos_drm_subdrv_open(dev, file);
186}
187
Inki Daeccf4d882011-10-14 13:29:51 +0900188static void exynos_drm_preclose(struct drm_device *dev,
189 struct drm_file *file)
190{
Joonyoung Shim3ab094352012-03-16 18:47:07 +0900191 struct exynos_drm_private *private = dev->dev_private;
192 struct drm_pending_vblank_event *e, *t;
193 unsigned long flags;
194
Inki Daeccf4d882011-10-14 13:29:51 +0900195 DRM_DEBUG_DRIVER("%s\n", __FILE__);
196
Joonyoung Shim3ab094352012-03-16 18:47:07 +0900197 /* release events of current file */
198 spin_lock_irqsave(&dev->event_lock, flags);
199 list_for_each_entry_safe(e, t, &private->pageflip_event_list,
200 base.link) {
201 if (e->base.file_priv == file) {
202 list_del(&e->base.link);
203 e->base.destroy(&e->base);
204 }
205 }
206 spin_unlock_irqrestore(&dev->event_lock, flags);
Joonyoung Shim9084f7b2012-03-16 18:47:09 +0900207
208 exynos_drm_subdrv_close(dev, file);
Inki Daeccf4d882011-10-14 13:29:51 +0900209}
210
Inki Dae53ef2992012-02-15 11:25:22 +0900211static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
212{
213 DRM_DEBUG_DRIVER("%s\n", __FILE__);
214
215 if (!file->driver_priv)
216 return;
217
218 kfree(file->driver_priv);
219 file->driver_priv = NULL;
220}
221
Inki Dae1c248b72011-10-04 19:19:01 +0900222static void exynos_drm_lastclose(struct drm_device *dev)
223{
224 DRM_DEBUG_DRIVER("%s\n", __FILE__);
225
226 exynos_drm_fbdev_restore_mode(dev);
227}
228
Laurent Pinchart78b68552012-05-17 13:27:22 +0200229static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
Inki Dae1c248b72011-10-04 19:19:01 +0900230 .fault = exynos_drm_gem_fault,
231 .open = drm_gem_vm_open,
232 .close = drm_gem_vm_close,
233};
234
235static struct drm_ioctl_desc exynos_ioctls[] = {
236 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl,
237 DRM_UNLOCKED | DRM_AUTH),
238 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP_OFFSET,
239 exynos_drm_gem_map_offset_ioctl, DRM_UNLOCKED |
240 DRM_AUTH),
241 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MMAP,
242 exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
Inki Dae40cd7e02012-05-04 15:51:17 +0900243 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET,
244 exynos_drm_gem_get_ioctl, DRM_UNLOCKED),
Inki Daeb73d1232012-03-21 10:55:26 +0900245 DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION,
246 vidi_connection_ioctl, DRM_UNLOCKED | DRM_AUTH),
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900247 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
248 exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
249 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
250 exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH),
251 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
252 exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH),
Eunchul Kimcb471f142012-12-14 18:10:31 +0900253 DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_PROPERTY,
254 exynos_drm_ipp_get_property, DRM_UNLOCKED | DRM_AUTH),
255 DRM_IOCTL_DEF_DRV(EXYNOS_IPP_SET_PROPERTY,
256 exynos_drm_ipp_set_property, DRM_UNLOCKED | DRM_AUTH),
257 DRM_IOCTL_DEF_DRV(EXYNOS_IPP_QUEUE_BUF,
258 exynos_drm_ipp_queue_buf, DRM_UNLOCKED | DRM_AUTH),
259 DRM_IOCTL_DEF_DRV(EXYNOS_IPP_CMD_CTRL,
260 exynos_drm_ipp_cmd_ctrl, DRM_UNLOCKED | DRM_AUTH),
Inki Dae1c248b72011-10-04 19:19:01 +0900261};
262
Joonyoung Shimac2bdf72011-12-08 15:00:20 +0900263static const struct file_operations exynos_drm_driver_fops = {
264 .owner = THIS_MODULE,
265 .open = drm_open,
266 .mmap = exynos_drm_gem_mmap,
267 .poll = drm_poll,
268 .read = drm_read,
269 .unlocked_ioctl = drm_ioctl,
Keith Packard804d74a2012-07-09 15:40:07 -0700270#ifdef CONFIG_COMPAT
271 .compat_ioctl = drm_compat_ioctl,
272#endif
Joonyoung Shimac2bdf72011-12-08 15:00:20 +0900273 .release = drm_release,
274};
275
Inki Dae1c248b72011-10-04 19:19:01 +0900276static struct drm_driver exynos_drm_driver = {
Laurent Pinchart293a1c12012-05-16 17:08:53 +0200277 .driver_features = DRIVER_HAVE_IRQ | DRIVER_MODESET |
278 DRIVER_GEM | DRIVER_PRIME,
Inki Dae1c248b72011-10-04 19:19:01 +0900279 .load = exynos_drm_load,
280 .unload = exynos_drm_unload,
Joonyoung Shim9084f7b2012-03-16 18:47:09 +0900281 .open = exynos_drm_open,
Inki Daeccf4d882011-10-14 13:29:51 +0900282 .preclose = exynos_drm_preclose,
Inki Dae1c248b72011-10-04 19:19:01 +0900283 .lastclose = exynos_drm_lastclose,
Inki Dae53ef2992012-02-15 11:25:22 +0900284 .postclose = exynos_drm_postclose,
Inki Dae1c248b72011-10-04 19:19:01 +0900285 .get_vblank_counter = drm_vblank_count,
286 .enable_vblank = exynos_drm_crtc_enable_vblank,
287 .disable_vblank = exynos_drm_crtc_disable_vblank,
288 .gem_init_object = exynos_drm_gem_init_object,
289 .gem_free_object = exynos_drm_gem_free_object,
290 .gem_vm_ops = &exynos_drm_gem_vm_ops,
291 .dumb_create = exynos_drm_gem_dumb_create,
292 .dumb_map_offset = exynos_drm_gem_dumb_map_offset,
293 .dumb_destroy = exynos_drm_gem_dumb_destroy,
Inki Daeb2df26c2012-04-23 21:01:28 +0900294 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
295 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
296 .gem_prime_export = exynos_dmabuf_prime_export,
297 .gem_prime_import = exynos_dmabuf_prime_import,
Inki Dae1c248b72011-10-04 19:19:01 +0900298 .ioctls = exynos_ioctls,
Joonyoung Shimac2bdf72011-12-08 15:00:20 +0900299 .fops = &exynos_drm_driver_fops,
Inki Dae1c248b72011-10-04 19:19:01 +0900300 .name = DRIVER_NAME,
301 .desc = DRIVER_DESC,
302 .date = DRIVER_DATE,
303 .major = DRIVER_MAJOR,
304 .minor = DRIVER_MINOR,
305};
306
307static int exynos_drm_platform_probe(struct platform_device *pdev)
308{
309 DRM_DEBUG_DRIVER("%s\n", __FILE__);
310
Rahul Sharma422bd002012-10-16 05:50:12 +0530311 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
Inki Dae1c248b72011-10-04 19:19:01 +0900312 exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls);
313
314 return drm_platform_init(&exynos_drm_driver, pdev);
315}
316
317static int exynos_drm_platform_remove(struct platform_device *pdev)
318{
319 DRM_DEBUG_DRIVER("%s\n", __FILE__);
320
321 drm_platform_exit(&exynos_drm_driver, pdev);
322
323 return 0;
324}
325
326static struct platform_driver exynos_drm_platform_driver = {
327 .probe = exynos_drm_platform_probe,
328 .remove = __devexit_p(exynos_drm_platform_remove),
329 .driver = {
330 .owner = THIS_MODULE,
Marek Szyprowski9866b6c2012-03-05 12:02:30 +0100331 .name = "exynos-drm",
Inki Dae1c248b72011-10-04 19:19:01 +0900332 },
333};
334
335static int __init exynos_drm_init(void)
336{
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900337 int ret;
338
Inki Dae1c248b72011-10-04 19:19:01 +0900339 DRM_DEBUG_DRIVER("%s\n", __FILE__);
340
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900341#ifdef CONFIG_DRM_EXYNOS_FIMD
342 ret = platform_driver_register(&fimd_driver);
343 if (ret < 0)
344 goto out_fimd;
345#endif
346
347#ifdef CONFIG_DRM_EXYNOS_HDMI
348 ret = platform_driver_register(&hdmi_driver);
349 if (ret < 0)
350 goto out_hdmi;
351 ret = platform_driver_register(&mixer_driver);
352 if (ret < 0)
353 goto out_mixer;
354 ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
355 if (ret < 0)
356 goto out_common_hdmi;
Rahul Sharmaae9dace2012-10-16 05:50:13 +0530357
358 ret = exynos_platform_device_hdmi_register();
359 if (ret < 0)
360 goto out_common_hdmi_dev;
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900361#endif
362
Inki Daeb73d1232012-03-21 10:55:26 +0900363#ifdef CONFIG_DRM_EXYNOS_VIDI
364 ret = platform_driver_register(&vidi_driver);
365 if (ret < 0)
366 goto out_vidi;
367#endif
368
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900369#ifdef CONFIG_DRM_EXYNOS_G2D
370 ret = platform_driver_register(&g2d_driver);
371 if (ret < 0)
372 goto out_g2d;
373#endif
374
Eunchul Kim16102ed2012-12-14 17:58:55 +0900375#ifdef CONFIG_DRM_EXYNOS_FIMC
376 ret = platform_driver_register(&fimc_driver);
377 if (ret < 0)
378 goto out_fimc;
379#endif
380
Eunchul Kimbea8a422012-12-14 17:58:56 +0900381#ifdef CONFIG_DRM_EXYNOS_ROTATOR
382 ret = platform_driver_register(&rotator_driver);
383 if (ret < 0)
384 goto out_rotator;
385#endif
386
Eunchul Kimcb471f142012-12-14 18:10:31 +0900387#ifdef CONFIG_DRM_EXYNOS_IPP
388 ret = platform_driver_register(&ipp_driver);
389 if (ret < 0)
390 goto out_ipp;
391#endif
392
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900393 ret = platform_driver_register(&exynos_drm_platform_driver);
394 if (ret < 0)
Rahul Sharma422bd002012-10-16 05:50:12 +0530395 goto out_drm;
396
397 exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1,
398 NULL, 0);
399 if (IS_ERR_OR_NULL(exynos_drm_pdev)) {
400 ret = PTR_ERR(exynos_drm_pdev);
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900401 goto out;
Rahul Sharma422bd002012-10-16 05:50:12 +0530402 }
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900403
404 return 0;
405
406out:
Rahul Sharma422bd002012-10-16 05:50:12 +0530407 platform_driver_unregister(&exynos_drm_platform_driver);
408
409out_drm:
Eunchul Kimcb471f142012-12-14 18:10:31 +0900410#ifdef CONFIG_DRM_EXYNOS_IPP
411 platform_driver_unregister(&ipp_driver);
412out_ipp:
413#endif
414
Eunchul Kimbea8a422012-12-14 17:58:56 +0900415#ifdef CONFIG_DRM_EXYNOS_ROTATOR
416 platform_driver_unregister(&rotator_driver);
417out_rotator:
418#endif
419
Eunchul Kim16102ed2012-12-14 17:58:55 +0900420#ifdef CONFIG_DRM_EXYNOS_FIMC
421 platform_driver_unregister(&fimc_driver);
422out_fimc:
423#endif
424
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900425#ifdef CONFIG_DRM_EXYNOS_G2D
426 platform_driver_unregister(&g2d_driver);
427out_g2d:
428#endif
429
Inki Daeb73d1232012-03-21 10:55:26 +0900430#ifdef CONFIG_DRM_EXYNOS_VIDI
Inki Daeb73d1232012-03-21 10:55:26 +0900431 platform_driver_unregister(&vidi_driver);
Rahul Sharmaae9dace2012-10-16 05:50:13 +0530432out_vidi:
Inki Daeb73d1232012-03-21 10:55:26 +0900433#endif
434
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900435#ifdef CONFIG_DRM_EXYNOS_HDMI
Rahul Sharmaae9dace2012-10-16 05:50:13 +0530436 exynos_platform_device_hdmi_unregister();
437out_common_hdmi_dev:
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900438 platform_driver_unregister(&exynos_drm_common_hdmi_driver);
439out_common_hdmi:
440 platform_driver_unregister(&mixer_driver);
441out_mixer:
442 platform_driver_unregister(&hdmi_driver);
443out_hdmi:
444#endif
445
446#ifdef CONFIG_DRM_EXYNOS_FIMD
447 platform_driver_unregister(&fimd_driver);
448out_fimd:
449#endif
450 return ret;
Inki Dae1c248b72011-10-04 19:19:01 +0900451}
452
453static void __exit exynos_drm_exit(void)
454{
455 DRM_DEBUG_DRIVER("%s\n", __FILE__);
456
Rahul Sharma422bd002012-10-16 05:50:12 +0530457 platform_device_unregister(exynos_drm_pdev);
458
Inki Dae1c248b72011-10-04 19:19:01 +0900459 platform_driver_unregister(&exynos_drm_platform_driver);
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900460
Eunchul Kimcb471f142012-12-14 18:10:31 +0900461#ifdef CONFIG_DRM_EXYNOS_IPP
462 platform_driver_unregister(&ipp_driver);
463#endif
464
Eunchul Kimbea8a422012-12-14 17:58:56 +0900465#ifdef CONFIG_DRM_EXYNOS_ROTATOR
466 platform_driver_unregister(&rotator_driver);
467#endif
468
Eunchul Kim16102ed2012-12-14 17:58:55 +0900469#ifdef CONFIG_DRM_EXYNOS_FIMC
470 platform_driver_unregister(&fimc_driver);
471#endif
472
Joonyoung Shimd7f16422012-05-17 20:06:32 +0900473#ifdef CONFIG_DRM_EXYNOS_G2D
474 platform_driver_unregister(&g2d_driver);
475#endif
476
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900477#ifdef CONFIG_DRM_EXYNOS_HDMI
Rahul Sharmaae9dace2012-10-16 05:50:13 +0530478 exynos_platform_device_hdmi_unregister();
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900479 platform_driver_unregister(&exynos_drm_common_hdmi_driver);
480 platform_driver_unregister(&mixer_driver);
481 platform_driver_unregister(&hdmi_driver);
482#endif
483
Inki Daeb73d1232012-03-21 10:55:26 +0900484#ifdef CONFIG_DRM_EXYNOS_VIDI
485 platform_driver_unregister(&vidi_driver);
486#endif
487
Joonyoung Shim132a5b92012-03-16 18:47:08 +0900488#ifdef CONFIG_DRM_EXYNOS_FIMD
489 platform_driver_unregister(&fimd_driver);
490#endif
Inki Dae1c248b72011-10-04 19:19:01 +0900491}
492
493module_init(exynos_drm_init);
494module_exit(exynos_drm_exit);
495
496MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
497MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
498MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
499MODULE_DESCRIPTION("Samsung SoC DRM Driver");
500MODULE_LICENSE("GPL");