31 #include <drm/exynos_drm.h>
44 #define DRIVER_NAME "exynos"
45 #define DRIVER_DESC "Samsung SoC DRM"
46 #define DRIVER_DATE "20110530"
47 #define DRIVER_MAJOR 1
48 #define DRIVER_MINOR 0
50 #define VBLANK_OFF_DELAY 50000
58 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
62 DRM_ERROR(
"failed to allocate private\n");
66 INIT_LIST_HEAD(&private->pageflip_event_list);
67 dev->dev_private = (
void *)
private;
117 DRM_ERROR(
"failed to initialize drm fbdev\n");
138 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
145 kfree(dev->dev_private);
147 dev->dev_private =
NULL;
156 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
158 file_priv = kzalloc(
sizeof(*file_priv),
GFP_KERNEL);
162 file->driver_priv = file_priv;
167 static void exynos_drm_preclose(
struct drm_device *dev,
168 struct drm_file *file)
171 struct drm_pending_vblank_event *
e, *
t;
174 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
180 if (e->base.file_priv == file) {
182 e->base.destroy(&e->base);
185 spin_unlock_irqrestore(&dev->event_lock, flags);
190 static void exynos_drm_postclose(
struct drm_device *dev,
struct drm_file *file)
192 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
194 if (!file->driver_priv)
197 kfree(file->driver_priv);
198 file->driver_priv =
NULL;
201 static void exynos_drm_lastclose(
struct drm_device *dev)
203 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
208 static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
214 static struct drm_ioctl_desc exynos_ioctls[] = {
216 DRM_UNLOCKED | DRM_AUTH),
217 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP_OFFSET,
220 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MMAP,
222 DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET,
224 DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION,
226 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
228 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
230 DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
247 static struct drm_driver exynos_drm_driver = {
248 .driver_features = DRIVER_HAVE_IRQ | DRIVER_MODESET |
249 DRIVER_GEM | DRIVER_PRIME,
250 .load = exynos_drm_load,
251 .unload = exynos_drm_unload,
252 .open = exynos_drm_open,
253 .preclose = exynos_drm_preclose,
254 .lastclose = exynos_drm_lastclose,
255 .postclose = exynos_drm_postclose,
261 .gem_vm_ops = &exynos_drm_gem_vm_ops,
269 .ioctls = exynos_ioctls,
270 .fops = &exynos_drm_driver_fops,
280 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
282 exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls);
289 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
297 .probe = exynos_drm_platform_probe,
301 .name =
"exynos-drm",
305 static int __init exynos_drm_init(
void)
309 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
311 #ifdef CONFIG_DRM_EXYNOS_FIMD
317 #ifdef CONFIG_DRM_EXYNOS_HDMI
326 goto out_common_hdmi;
329 #ifdef CONFIG_DRM_EXYNOS_VIDI
335 #ifdef CONFIG_DRM_EXYNOS_G2D
348 #ifdef CONFIG_DRM_EXYNOS_G2D
353 #ifdef CONFIG_DRM_EXYNOS_VIDI
358 #ifdef CONFIG_DRM_EXYNOS_HDMI
367 #ifdef CONFIG_DRM_EXYNOS_FIMD
374 static void __exit exynos_drm_exit(
void)
376 DRM_DEBUG_DRIVER(
"%s\n", __FILE__);
380 #ifdef CONFIG_DRM_EXYNOS_G2D
384 #ifdef CONFIG_DRM_EXYNOS_HDMI
390 #ifdef CONFIG_DRM_EXYNOS_VIDI
394 #ifdef CONFIG_DRM_EXYNOS_FIMD