Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 1 | /* |
| 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 | |
| 28 | #include "drmP.h" |
| 29 | #include "drm.h" |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 30 | #include "drm_crtc_helper.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 31 | |
| 32 | #include <drm/exynos_drm.h> |
| 33 | |
| 34 | #include "exynos_drm_drv.h" |
| 35 | #include "exynos_drm_crtc.h" |
Inki Dae | d081f56 | 2012-02-15 11:25:19 +0900 | [diff] [blame] | 36 | #include "exynos_drm_encoder.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 37 | #include "exynos_drm_fbdev.h" |
| 38 | #include "exynos_drm_fb.h" |
| 39 | #include "exynos_drm_gem.h" |
Joonyoung Shim | 864ee9e | 2011-12-08 17:54:07 +0900 | [diff] [blame] | 40 | #include "exynos_drm_plane.h" |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 41 | #include "exynos_drm_vidi.h" |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 42 | #include "exynos_drm_dmabuf.h" |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 43 | #include "exynos_drm_g2d.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 44 | |
Inki Dae | 0edf993 | 2011-12-15 17:31:24 +0900 | [diff] [blame] | 45 | #define DRIVER_NAME "exynos" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 46 | #define DRIVER_DESC "Samsung SoC DRM" |
| 47 | #define DRIVER_DATE "20110530" |
| 48 | #define DRIVER_MAJOR 1 |
| 49 | #define DRIVER_MINOR 0 |
| 50 | |
Inki Dae | 52c6881 | 2011-12-16 21:31:12 +0900 | [diff] [blame] | 51 | #define VBLANK_OFF_DELAY 50000 |
| 52 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 53 | static int exynos_drm_load(struct drm_device *dev, unsigned long flags) |
| 54 | { |
| 55 | struct exynos_drm_private *private; |
| 56 | int ret; |
| 57 | int nr; |
| 58 | |
| 59 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 60 | |
| 61 | private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); |
| 62 | if (!private) { |
| 63 | DRM_ERROR("failed to allocate private\n"); |
| 64 | return -ENOMEM; |
| 65 | } |
| 66 | |
| 67 | INIT_LIST_HEAD(&private->pageflip_event_list); |
| 68 | dev->dev_private = (void *)private; |
| 69 | |
| 70 | drm_mode_config_init(dev); |
| 71 | |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 72 | /* init kms poll for handling hpd */ |
| 73 | drm_kms_helper_poll_init(dev); |
| 74 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 75 | exynos_drm_mode_config_init(dev); |
| 76 | |
| 77 | /* |
| 78 | * EXYNOS4 is enough to have two CRTCs and each crtc would be used |
| 79 | * without dependency of hardware. |
| 80 | */ |
| 81 | for (nr = 0; nr < MAX_CRTC; nr++) { |
| 82 | ret = exynos_drm_crtc_create(dev, nr); |
| 83 | if (ret) |
| 84 | goto err_crtc; |
| 85 | } |
| 86 | |
Joonyoung Shim | 864ee9e | 2011-12-08 17:54:07 +0900 | [diff] [blame] | 87 | for (nr = 0; nr < MAX_PLANE; nr++) { |
| 88 | ret = exynos_plane_init(dev, nr); |
| 89 | if (ret) |
| 90 | goto err_crtc; |
| 91 | } |
| 92 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 93 | ret = drm_vblank_init(dev, MAX_CRTC); |
| 94 | if (ret) |
| 95 | goto err_crtc; |
| 96 | |
| 97 | /* |
| 98 | * probe sub drivers such as display controller and hdmi driver, |
| 99 | * that were registered at probe() of platform driver |
| 100 | * to the sub driver and create encoder and connector for them. |
| 101 | */ |
| 102 | ret = exynos_drm_device_register(dev); |
| 103 | if (ret) |
| 104 | goto err_vblank; |
| 105 | |
Inki Dae | d081f56 | 2012-02-15 11:25:19 +0900 | [diff] [blame] | 106 | /* setup possible_clones. */ |
| 107 | exynos_drm_encoder_setup(dev); |
| 108 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 109 | /* |
| 110 | * create and configure fb helper and also exynos specific |
| 111 | * fbdev object. |
| 112 | */ |
| 113 | ret = exynos_drm_fbdev_init(dev); |
| 114 | if (ret) { |
| 115 | DRM_ERROR("failed to initialize drm fbdev\n"); |
| 116 | goto err_drm_device; |
| 117 | } |
| 118 | |
Inki Dae | 52c6881 | 2011-12-16 21:31:12 +0900 | [diff] [blame] | 119 | drm_vblank_offdelay = VBLANK_OFF_DELAY; |
| 120 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 121 | return 0; |
| 122 | |
| 123 | err_drm_device: |
| 124 | exynos_drm_device_unregister(dev); |
| 125 | err_vblank: |
| 126 | drm_vblank_cleanup(dev); |
| 127 | err_crtc: |
| 128 | drm_mode_config_cleanup(dev); |
| 129 | kfree(private); |
| 130 | |
| 131 | return ret; |
| 132 | } |
| 133 | |
| 134 | static int exynos_drm_unload(struct drm_device *dev) |
| 135 | { |
| 136 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 137 | |
| 138 | exynos_drm_fbdev_fini(dev); |
| 139 | exynos_drm_device_unregister(dev); |
| 140 | drm_vblank_cleanup(dev); |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 141 | drm_kms_helper_poll_fini(dev); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 142 | drm_mode_config_cleanup(dev); |
| 143 | kfree(dev->dev_private); |
| 144 | |
| 145 | dev->dev_private = NULL; |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
Joonyoung Shim | 9084f7b | 2012-03-16 18:47:09 +0900 | [diff] [blame] | 150 | static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 151 | { |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 152 | struct drm_exynos_file_private *file_priv; |
| 153 | |
Joonyoung Shim | 6f81150 | 2012-02-15 11:25:18 +0900 | [diff] [blame] | 154 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 155 | |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 156 | file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); |
| 157 | if (!file_priv) |
| 158 | return -ENOMEM; |
| 159 | |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 160 | drm_prime_init_file_private(&file->prime); |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 161 | file->driver_priv = file_priv; |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 162 | |
Joonyoung Shim | 9084f7b | 2012-03-16 18:47:09 +0900 | [diff] [blame] | 163 | return exynos_drm_subdrv_open(dev, file); |
| 164 | } |
| 165 | |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 166 | static void exynos_drm_preclose(struct drm_device *dev, |
| 167 | struct drm_file *file) |
| 168 | { |
Joonyoung Shim | 3ab09435 | 2012-03-16 18:47:07 +0900 | [diff] [blame] | 169 | struct exynos_drm_private *private = dev->dev_private; |
| 170 | struct drm_pending_vblank_event *e, *t; |
| 171 | unsigned long flags; |
| 172 | |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 173 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 174 | |
Joonyoung Shim | 3ab09435 | 2012-03-16 18:47:07 +0900 | [diff] [blame] | 175 | /* release events of current file */ |
| 176 | spin_lock_irqsave(&dev->event_lock, flags); |
| 177 | list_for_each_entry_safe(e, t, &private->pageflip_event_list, |
| 178 | base.link) { |
| 179 | if (e->base.file_priv == file) { |
| 180 | list_del(&e->base.link); |
| 181 | e->base.destroy(&e->base); |
| 182 | } |
| 183 | } |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 184 | drm_prime_destroy_file_private(&file->prime); |
Joonyoung Shim | 3ab09435 | 2012-03-16 18:47:07 +0900 | [diff] [blame] | 185 | spin_unlock_irqrestore(&dev->event_lock, flags); |
Joonyoung Shim | 9084f7b | 2012-03-16 18:47:09 +0900 | [diff] [blame] | 186 | |
| 187 | exynos_drm_subdrv_close(dev, file); |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 188 | } |
| 189 | |
Inki Dae | 53ef299 | 2012-02-15 11:25:22 +0900 | [diff] [blame] | 190 | static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) |
| 191 | { |
| 192 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 193 | |
| 194 | if (!file->driver_priv) |
| 195 | return; |
| 196 | |
| 197 | kfree(file->driver_priv); |
| 198 | file->driver_priv = NULL; |
| 199 | } |
| 200 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 201 | static void exynos_drm_lastclose(struct drm_device *dev) |
| 202 | { |
| 203 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 204 | |
| 205 | exynos_drm_fbdev_restore_mode(dev); |
| 206 | } |
| 207 | |
Laurent Pinchart | 78b6855 | 2012-05-17 13:27:22 +0200 | [diff] [blame] | 208 | static const struct vm_operations_struct exynos_drm_gem_vm_ops = { |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 209 | .fault = exynos_drm_gem_fault, |
| 210 | .open = drm_gem_vm_open, |
| 211 | .close = drm_gem_vm_close, |
| 212 | }; |
| 213 | |
| 214 | static struct drm_ioctl_desc exynos_ioctls[] = { |
| 215 | DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl, |
| 216 | DRM_UNLOCKED | DRM_AUTH), |
| 217 | DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP_OFFSET, |
| 218 | exynos_drm_gem_map_offset_ioctl, DRM_UNLOCKED | |
| 219 | DRM_AUTH), |
| 220 | DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MMAP, |
| 221 | exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH), |
Inki Dae | 40cd7e0 | 2012-05-04 15:51:17 +0900 | [diff] [blame] | 222 | DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET, |
| 223 | exynos_drm_gem_get_ioctl, DRM_UNLOCKED), |
Joonyoung Shim | 864ee9e | 2011-12-08 17:54:07 +0900 | [diff] [blame] | 224 | DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl, |
| 225 | DRM_UNLOCKED | DRM_AUTH), |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 226 | DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION, |
| 227 | vidi_connection_ioctl, DRM_UNLOCKED | DRM_AUTH), |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 228 | DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER, |
| 229 | exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH), |
| 230 | DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST, |
| 231 | exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH), |
| 232 | DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, |
| 233 | exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 234 | }; |
| 235 | |
Joonyoung Shim | ac2bdf7 | 2011-12-08 15:00:20 +0900 | [diff] [blame] | 236 | static const struct file_operations exynos_drm_driver_fops = { |
| 237 | .owner = THIS_MODULE, |
| 238 | .open = drm_open, |
| 239 | .mmap = exynos_drm_gem_mmap, |
| 240 | .poll = drm_poll, |
| 241 | .read = drm_read, |
| 242 | .unlocked_ioctl = drm_ioctl, |
| 243 | .release = drm_release, |
| 244 | }; |
| 245 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 246 | static struct drm_driver exynos_drm_driver = { |
| 247 | .driver_features = DRIVER_HAVE_IRQ | DRIVER_BUS_PLATFORM | |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 248 | DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 249 | .load = exynos_drm_load, |
| 250 | .unload = exynos_drm_unload, |
Joonyoung Shim | 9084f7b | 2012-03-16 18:47:09 +0900 | [diff] [blame] | 251 | .open = exynos_drm_open, |
Inki Dae | ccf4d88 | 2011-10-14 13:29:51 +0900 | [diff] [blame] | 252 | .preclose = exynos_drm_preclose, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 253 | .lastclose = exynos_drm_lastclose, |
Inki Dae | 53ef299 | 2012-02-15 11:25:22 +0900 | [diff] [blame] | 254 | .postclose = exynos_drm_postclose, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 255 | .get_vblank_counter = drm_vblank_count, |
| 256 | .enable_vblank = exynos_drm_crtc_enable_vblank, |
| 257 | .disable_vblank = exynos_drm_crtc_disable_vblank, |
| 258 | .gem_init_object = exynos_drm_gem_init_object, |
| 259 | .gem_free_object = exynos_drm_gem_free_object, |
| 260 | .gem_vm_ops = &exynos_drm_gem_vm_ops, |
| 261 | .dumb_create = exynos_drm_gem_dumb_create, |
| 262 | .dumb_map_offset = exynos_drm_gem_dumb_map_offset, |
| 263 | .dumb_destroy = exynos_drm_gem_dumb_destroy, |
Inki Dae | b2df26c | 2012-04-23 21:01:28 +0900 | [diff] [blame] | 264 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
| 265 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, |
| 266 | .gem_prime_export = exynos_dmabuf_prime_export, |
| 267 | .gem_prime_import = exynos_dmabuf_prime_import, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 268 | .ioctls = exynos_ioctls, |
Joonyoung Shim | ac2bdf7 | 2011-12-08 15:00:20 +0900 | [diff] [blame] | 269 | .fops = &exynos_drm_driver_fops, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 270 | .name = DRIVER_NAME, |
| 271 | .desc = DRIVER_DESC, |
| 272 | .date = DRIVER_DATE, |
| 273 | .major = DRIVER_MAJOR, |
| 274 | .minor = DRIVER_MINOR, |
| 275 | }; |
| 276 | |
| 277 | static int exynos_drm_platform_probe(struct platform_device *pdev) |
| 278 | { |
| 279 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 280 | |
| 281 | exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls); |
| 282 | |
| 283 | return drm_platform_init(&exynos_drm_driver, pdev); |
| 284 | } |
| 285 | |
| 286 | static int exynos_drm_platform_remove(struct platform_device *pdev) |
| 287 | { |
| 288 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 289 | |
| 290 | drm_platform_exit(&exynos_drm_driver, pdev); |
| 291 | |
| 292 | return 0; |
| 293 | } |
| 294 | |
| 295 | static struct platform_driver exynos_drm_platform_driver = { |
| 296 | .probe = exynos_drm_platform_probe, |
| 297 | .remove = __devexit_p(exynos_drm_platform_remove), |
| 298 | .driver = { |
| 299 | .owner = THIS_MODULE, |
Marek Szyprowski | 9866b6c | 2012-03-05 12:02:30 +0100 | [diff] [blame] | 300 | .name = "exynos-drm", |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 301 | }, |
| 302 | }; |
| 303 | |
| 304 | static int __init exynos_drm_init(void) |
| 305 | { |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 306 | int ret; |
| 307 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 308 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 309 | |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 310 | #ifdef CONFIG_DRM_EXYNOS_FIMD |
| 311 | ret = platform_driver_register(&fimd_driver); |
| 312 | if (ret < 0) |
| 313 | goto out_fimd; |
| 314 | #endif |
| 315 | |
| 316 | #ifdef CONFIG_DRM_EXYNOS_HDMI |
| 317 | ret = platform_driver_register(&hdmi_driver); |
| 318 | if (ret < 0) |
| 319 | goto out_hdmi; |
| 320 | ret = platform_driver_register(&mixer_driver); |
| 321 | if (ret < 0) |
| 322 | goto out_mixer; |
| 323 | ret = platform_driver_register(&exynos_drm_common_hdmi_driver); |
| 324 | if (ret < 0) |
| 325 | goto out_common_hdmi; |
| 326 | #endif |
| 327 | |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 328 | #ifdef CONFIG_DRM_EXYNOS_VIDI |
| 329 | ret = platform_driver_register(&vidi_driver); |
| 330 | if (ret < 0) |
| 331 | goto out_vidi; |
| 332 | #endif |
| 333 | |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 334 | #ifdef CONFIG_DRM_EXYNOS_G2D |
| 335 | ret = platform_driver_register(&g2d_driver); |
| 336 | if (ret < 0) |
| 337 | goto out_g2d; |
| 338 | #endif |
| 339 | |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 340 | ret = platform_driver_register(&exynos_drm_platform_driver); |
| 341 | if (ret < 0) |
| 342 | goto out; |
| 343 | |
| 344 | return 0; |
| 345 | |
| 346 | out: |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 347 | #ifdef CONFIG_DRM_EXYNOS_G2D |
| 348 | platform_driver_unregister(&g2d_driver); |
| 349 | out_g2d: |
| 350 | #endif |
| 351 | |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 352 | #ifdef CONFIG_DRM_EXYNOS_VIDI |
| 353 | out_vidi: |
| 354 | platform_driver_unregister(&vidi_driver); |
| 355 | #endif |
| 356 | |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 357 | #ifdef CONFIG_DRM_EXYNOS_HDMI |
| 358 | platform_driver_unregister(&exynos_drm_common_hdmi_driver); |
| 359 | out_common_hdmi: |
| 360 | platform_driver_unregister(&mixer_driver); |
| 361 | out_mixer: |
| 362 | platform_driver_unregister(&hdmi_driver); |
| 363 | out_hdmi: |
| 364 | #endif |
| 365 | |
| 366 | #ifdef CONFIG_DRM_EXYNOS_FIMD |
| 367 | platform_driver_unregister(&fimd_driver); |
| 368 | out_fimd: |
| 369 | #endif |
| 370 | return ret; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | static void __exit exynos_drm_exit(void) |
| 374 | { |
| 375 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 376 | |
| 377 | platform_driver_unregister(&exynos_drm_platform_driver); |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 378 | |
Joonyoung Shim | d7f1642 | 2012-05-17 20:06:32 +0900 | [diff] [blame] | 379 | #ifdef CONFIG_DRM_EXYNOS_G2D |
| 380 | platform_driver_unregister(&g2d_driver); |
| 381 | #endif |
| 382 | |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 383 | #ifdef CONFIG_DRM_EXYNOS_HDMI |
| 384 | platform_driver_unregister(&exynos_drm_common_hdmi_driver); |
| 385 | platform_driver_unregister(&mixer_driver); |
| 386 | platform_driver_unregister(&hdmi_driver); |
| 387 | #endif |
| 388 | |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 389 | #ifdef CONFIG_DRM_EXYNOS_VIDI |
| 390 | platform_driver_unregister(&vidi_driver); |
| 391 | #endif |
| 392 | |
Joonyoung Shim | 132a5b9 | 2012-03-16 18:47:08 +0900 | [diff] [blame] | 393 | #ifdef CONFIG_DRM_EXYNOS_FIMD |
| 394 | platform_driver_unregister(&fimd_driver); |
| 395 | #endif |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | module_init(exynos_drm_init); |
| 399 | module_exit(exynos_drm_exit); |
| 400 | |
| 401 | MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>"); |
| 402 | MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>"); |
| 403 | MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>"); |
| 404 | MODULE_DESCRIPTION("Samsung SoC DRM Driver"); |
| 405 | MODULE_LICENSE("GPL"); |