2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
22 static void msm_fb_output_poll_changed(struct drm_device
*dev
)
24 struct msm_drm_private
*priv
= dev
->dev_private
;
26 drm_fb_helper_hotplug_event(priv
->fbdev
);
29 static const struct drm_mode_config_funcs mode_config_funcs
= {
30 .fb_create
= msm_framebuffer_create
,
31 .output_poll_changed
= msm_fb_output_poll_changed
,
34 int msm_register_mmu(struct drm_device
*dev
, struct msm_mmu
*mmu
)
36 struct msm_drm_private
*priv
= dev
->dev_private
;
37 int idx
= priv
->num_mmus
++;
39 if (WARN_ON(idx
>= ARRAY_SIZE(priv
->mmus
)))
42 priv
->mmus
[idx
] = mmu
;
47 #ifdef CONFIG_DRM_MSM_REGISTER_LOGGING
48 static bool reglog
= false;
49 MODULE_PARM_DESC(reglog
, "Enable register read/write logging");
50 module_param(reglog
, bool, 0600);
56 MODULE_PARM_DESC(vram
, "Configure VRAM size (for devices without IOMMU/GPUMMU");
57 module_param(vram
, charp
, 0);
59 void __iomem
*msm_ioremap(struct platform_device
*pdev
, const char *name
,
67 res
= platform_get_resource_byname(pdev
, IORESOURCE_MEM
, name
);
69 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
72 dev_err(&pdev
->dev
, "failed to get memory resource: %s\n", name
);
73 return ERR_PTR(-EINVAL
);
76 size
= resource_size(res
);
78 ptr
= devm_ioremap_nocache(&pdev
->dev
, res
->start
, size
);
80 dev_err(&pdev
->dev
, "failed to ioremap: %s\n", name
);
81 return ERR_PTR(-ENOMEM
);
85 printk(KERN_DEBUG
"IO:region %s %08x %08lx\n", dbgname
, (u32
)ptr
, size
);
90 void msm_writel(u32 data
, void __iomem
*addr
)
93 printk(KERN_DEBUG
"IO:W %08x %08x\n", (u32
)addr
, data
);
97 u32
msm_readl(const void __iomem
*addr
)
99 u32 val
= readl(addr
);
101 printk(KERN_ERR
"IO:R %08x %08x\n", (u32
)addr
, val
);
109 static int msm_unload(struct drm_device
*dev
)
111 struct msm_drm_private
*priv
= dev
->dev_private
;
112 struct msm_kms
*kms
= priv
->kms
;
113 struct msm_gpu
*gpu
= priv
->gpu
;
115 drm_kms_helper_poll_fini(dev
);
116 drm_mode_config_cleanup(dev
);
117 drm_vblank_cleanup(dev
);
119 pm_runtime_get_sync(dev
->dev
);
120 drm_irq_uninstall(dev
);
121 pm_runtime_put_sync(dev
->dev
);
123 flush_workqueue(priv
->wq
);
124 destroy_workqueue(priv
->wq
);
127 pm_runtime_disable(dev
->dev
);
128 kms
->funcs
->destroy(kms
);
132 mutex_lock(&dev
->struct_mutex
);
133 gpu
->funcs
->pm_suspend(gpu
);
134 gpu
->funcs
->destroy(gpu
);
135 mutex_unlock(&dev
->struct_mutex
);
138 if (priv
->vram
.paddr
) {
139 DEFINE_DMA_ATTRS(attrs
);
140 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING
, &attrs
);
141 drm_mm_takedown(&priv
->vram
.mm
);
142 dma_free_attrs(dev
->dev
, priv
->vram
.size
, NULL
,
143 priv
->vram
.paddr
, &attrs
);
146 dev
->dev_private
= NULL
;
153 static int get_mdp_ver(struct platform_device
*pdev
)
156 const static struct of_device_id match_types
[] = { {
157 .compatible
= "qcom,mdss_mdp",
162 struct device
*dev
= &pdev
->dev
;
163 const struct of_device_id
*match
;
164 match
= of_match_node(match_types
, dev
->of_node
);
166 return (int)match
->data
;
171 static int msm_load(struct drm_device
*dev
, unsigned long flags
)
173 struct platform_device
*pdev
= dev
->platformdev
;
174 struct msm_drm_private
*priv
;
178 priv
= kzalloc(sizeof(*priv
), GFP_KERNEL
);
180 dev_err(dev
->dev
, "failed to allocate private data\n");
184 dev
->dev_private
= priv
;
186 priv
->wq
= alloc_ordered_workqueue("msm", 0);
187 init_waitqueue_head(&priv
->fence_event
);
189 INIT_LIST_HEAD(&priv
->inactive_list
);
190 INIT_LIST_HEAD(&priv
->fence_cbs
);
192 drm_mode_config_init(dev
);
194 /* if we have no IOMMU, then we need to use carveout allocator.
195 * Grab the entire CMA chunk carved out in early startup in
198 if (!iommu_present(&platform_bus_type
)) {
199 DEFINE_DMA_ATTRS(attrs
);
203 DBG("using %s VRAM carveout", vram
);
204 size
= memparse(vram
, NULL
);
205 priv
->vram
.size
= size
;
207 drm_mm_init(&priv
->vram
.mm
, 0, (size
>> PAGE_SHIFT
) - 1);
209 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING
, &attrs
);
210 dma_set_attr(DMA_ATTR_WRITE_COMBINE
, &attrs
);
212 /* note that for no-kernel-mapping, the vaddr returned
213 * is bogus, but non-null if allocation succeeded:
215 p
= dma_alloc_attrs(dev
->dev
, size
,
216 &priv
->vram
.paddr
, 0, &attrs
);
218 dev_err(dev
->dev
, "failed to allocate VRAM\n");
219 priv
->vram
.paddr
= 0;
224 dev_info(dev
->dev
, "VRAM: %08x->%08x\n",
225 (uint32_t)priv
->vram
.paddr
,
226 (uint32_t)(priv
->vram
.paddr
+ size
));
229 switch (get_mdp_ver(pdev
)) {
231 kms
= mdp4_kms_init(dev
);
234 kms
= mdp5_kms_init(dev
);
237 kms
= ERR_PTR(-ENODEV
);
243 * NOTE: once we have GPU support, having no kms should not
244 * be considered fatal.. ideally we would still support gpu
245 * and (for example) use dmabuf/prime to share buffers with
246 * imx drm driver on iMX5
248 dev_err(dev
->dev
, "failed to load kms\n");
256 pm_runtime_enable(dev
->dev
);
257 ret
= kms
->funcs
->hw_init(kms
);
259 dev_err(dev
->dev
, "kms hw init failed: %d\n", ret
);
264 dev
->mode_config
.min_width
= 0;
265 dev
->mode_config
.min_height
= 0;
266 dev
->mode_config
.max_width
= 2048;
267 dev
->mode_config
.max_height
= 2048;
268 dev
->mode_config
.funcs
= &mode_config_funcs
;
270 ret
= drm_vblank_init(dev
, 1);
272 dev_err(dev
->dev
, "failed to initialize vblank\n");
276 pm_runtime_get_sync(dev
->dev
);
277 ret
= drm_irq_install(dev
);
278 pm_runtime_put_sync(dev
->dev
);
280 dev_err(dev
->dev
, "failed to install IRQ handler\n");
284 platform_set_drvdata(pdev
, dev
);
286 #ifdef CONFIG_DRM_MSM_FBDEV
287 priv
->fbdev
= msm_fbdev_init(dev
);
290 drm_kms_helper_poll_init(dev
);
299 static void load_gpu(struct drm_device
*dev
)
301 struct msm_drm_private
*priv
= dev
->dev_private
;
307 mutex_lock(&dev
->struct_mutex
);
308 gpu
= a3xx_gpu_init(dev
);
310 dev_warn(dev
->dev
, "failed to load a3xx gpu\n");
314 mutex_unlock(&dev
->struct_mutex
);
318 gpu
->funcs
->pm_resume(gpu
);
319 ret
= gpu
->funcs
->hw_init(gpu
);
321 dev_err(dev
->dev
, "gpu hw init failed: %d\n", ret
);
322 gpu
->funcs
->destroy(gpu
);
330 static int msm_open(struct drm_device
*dev
, struct drm_file
*file
)
332 struct msm_file_private
*ctx
;
334 /* For now, load gpu on open.. to avoid the requirement of having
335 * firmware in the initrd.
339 ctx
= kzalloc(sizeof(*ctx
), GFP_KERNEL
);
343 file
->driver_priv
= ctx
;
348 static void msm_preclose(struct drm_device
*dev
, struct drm_file
*file
)
350 struct msm_drm_private
*priv
= dev
->dev_private
;
351 struct msm_file_private
*ctx
= file
->driver_priv
;
352 struct msm_kms
*kms
= priv
->kms
;
355 kms
->funcs
->preclose(kms
, file
);
357 mutex_lock(&dev
->struct_mutex
);
358 if (ctx
== priv
->lastctx
)
359 priv
->lastctx
= NULL
;
360 mutex_unlock(&dev
->struct_mutex
);
365 static void msm_lastclose(struct drm_device
*dev
)
367 struct msm_drm_private
*priv
= dev
->dev_private
;
369 drm_modeset_lock_all(dev
);
370 drm_fb_helper_restore_fbdev_mode(priv
->fbdev
);
371 drm_modeset_unlock_all(dev
);
375 static irqreturn_t
msm_irq(int irq
, void *arg
)
377 struct drm_device
*dev
= arg
;
378 struct msm_drm_private
*priv
= dev
->dev_private
;
379 struct msm_kms
*kms
= priv
->kms
;
381 return kms
->funcs
->irq(kms
);
384 static void msm_irq_preinstall(struct drm_device
*dev
)
386 struct msm_drm_private
*priv
= dev
->dev_private
;
387 struct msm_kms
*kms
= priv
->kms
;
389 kms
->funcs
->irq_preinstall(kms
);
392 static int msm_irq_postinstall(struct drm_device
*dev
)
394 struct msm_drm_private
*priv
= dev
->dev_private
;
395 struct msm_kms
*kms
= priv
->kms
;
397 return kms
->funcs
->irq_postinstall(kms
);
400 static void msm_irq_uninstall(struct drm_device
*dev
)
402 struct msm_drm_private
*priv
= dev
->dev_private
;
403 struct msm_kms
*kms
= priv
->kms
;
405 kms
->funcs
->irq_uninstall(kms
);
408 static int msm_enable_vblank(struct drm_device
*dev
, int crtc_id
)
410 struct msm_drm_private
*priv
= dev
->dev_private
;
411 struct msm_kms
*kms
= priv
->kms
;
414 DBG("dev=%p, crtc=%d", dev
, crtc_id
);
415 return kms
->funcs
->enable_vblank(kms
, priv
->crtcs
[crtc_id
]);
418 static void msm_disable_vblank(struct drm_device
*dev
, int crtc_id
)
420 struct msm_drm_private
*priv
= dev
->dev_private
;
421 struct msm_kms
*kms
= priv
->kms
;
424 DBG("dev=%p, crtc=%d", dev
, crtc_id
);
425 kms
->funcs
->disable_vblank(kms
, priv
->crtcs
[crtc_id
]);
432 #ifdef CONFIG_DEBUG_FS
433 static int msm_gpu_show(struct drm_device
*dev
, struct seq_file
*m
)
435 struct msm_drm_private
*priv
= dev
->dev_private
;
436 struct msm_gpu
*gpu
= priv
->gpu
;
439 seq_printf(m
, "%s Status:\n", gpu
->name
);
440 gpu
->funcs
->show(gpu
, m
);
446 static int msm_gem_show(struct drm_device
*dev
, struct seq_file
*m
)
448 struct msm_drm_private
*priv
= dev
->dev_private
;
449 struct msm_gpu
*gpu
= priv
->gpu
;
452 seq_printf(m
, "Active Objects (%s):\n", gpu
->name
);
453 msm_gem_describe_objects(&gpu
->active_list
, m
);
456 seq_printf(m
, "Inactive Objects:\n");
457 msm_gem_describe_objects(&priv
->inactive_list
, m
);
462 static int msm_mm_show(struct drm_device
*dev
, struct seq_file
*m
)
464 return drm_mm_dump_table(m
, &dev
->vma_offset_manager
->vm_addr_space_mm
);
467 static int msm_fb_show(struct drm_device
*dev
, struct seq_file
*m
)
469 struct msm_drm_private
*priv
= dev
->dev_private
;
470 struct drm_framebuffer
*fb
, *fbdev_fb
= NULL
;
473 seq_printf(m
, "fbcon ");
474 fbdev_fb
= priv
->fbdev
->fb
;
475 msm_framebuffer_describe(fbdev_fb
, m
);
478 mutex_lock(&dev
->mode_config
.fb_lock
);
479 list_for_each_entry(fb
, &dev
->mode_config
.fb_list
, head
) {
483 seq_printf(m
, "user ");
484 msm_framebuffer_describe(fb
, m
);
486 mutex_unlock(&dev
->mode_config
.fb_lock
);
491 static int show_locked(struct seq_file
*m
, void *arg
)
493 struct drm_info_node
*node
= (struct drm_info_node
*) m
->private;
494 struct drm_device
*dev
= node
->minor
->dev
;
495 int (*show
)(struct drm_device
*dev
, struct seq_file
*m
) =
496 node
->info_ent
->data
;
499 ret
= mutex_lock_interruptible(&dev
->struct_mutex
);
505 mutex_unlock(&dev
->struct_mutex
);
510 static struct drm_info_list msm_debugfs_list
[] = {
511 {"gpu", show_locked
, 0, msm_gpu_show
},
512 {"gem", show_locked
, 0, msm_gem_show
},
513 { "mm", show_locked
, 0, msm_mm_show
},
514 { "fb", show_locked
, 0, msm_fb_show
},
517 static int msm_debugfs_init(struct drm_minor
*minor
)
519 struct drm_device
*dev
= minor
->dev
;
522 ret
= drm_debugfs_create_files(msm_debugfs_list
,
523 ARRAY_SIZE(msm_debugfs_list
),
524 minor
->debugfs_root
, minor
);
527 dev_err(dev
->dev
, "could not install msm_debugfs_list\n");
534 static void msm_debugfs_cleanup(struct drm_minor
*minor
)
536 drm_debugfs_remove_files(msm_debugfs_list
,
537 ARRAY_SIZE(msm_debugfs_list
), minor
);
545 int msm_wait_fence_interruptable(struct drm_device
*dev
, uint32_t fence
,
546 struct timespec
*timeout
)
548 struct msm_drm_private
*priv
= dev
->dev_private
;
554 if (fence
> priv
->gpu
->submitted_fence
) {
555 DRM_ERROR("waiting on invalid fence: %u (of %u)\n",
556 fence
, priv
->gpu
->submitted_fence
);
562 ret
= fence_completed(dev
, fence
) ? 0 : -EBUSY
;
564 unsigned long timeout_jiffies
= timespec_to_jiffies(timeout
);
565 unsigned long start_jiffies
= jiffies
;
566 unsigned long remaining_jiffies
;
568 if (time_after(start_jiffies
, timeout_jiffies
))
569 remaining_jiffies
= 0;
571 remaining_jiffies
= timeout_jiffies
- start_jiffies
;
573 ret
= wait_event_interruptible_timeout(priv
->fence_event
,
574 fence_completed(dev
, fence
),
578 DBG("timeout waiting for fence: %u (completed: %u)",
579 fence
, priv
->completed_fence
);
581 } else if (ret
!= -ERESTARTSYS
) {
589 /* called from workqueue */
590 void msm_update_fence(struct drm_device
*dev
, uint32_t fence
)
592 struct msm_drm_private
*priv
= dev
->dev_private
;
594 mutex_lock(&dev
->struct_mutex
);
595 priv
->completed_fence
= max(fence
, priv
->completed_fence
);
597 while (!list_empty(&priv
->fence_cbs
)) {
598 struct msm_fence_cb
*cb
;
600 cb
= list_first_entry(&priv
->fence_cbs
,
601 struct msm_fence_cb
, work
.entry
);
603 if (cb
->fence
> priv
->completed_fence
)
606 list_del_init(&cb
->work
.entry
);
607 queue_work(priv
->wq
, &cb
->work
);
610 mutex_unlock(&dev
->struct_mutex
);
612 wake_up_all(&priv
->fence_event
);
615 void __msm_fence_worker(struct work_struct
*work
)
617 struct msm_fence_cb
*cb
= container_of(work
, struct msm_fence_cb
, work
);
625 static int msm_ioctl_get_param(struct drm_device
*dev
, void *data
,
626 struct drm_file
*file
)
628 struct msm_drm_private
*priv
= dev
->dev_private
;
629 struct drm_msm_param
*args
= data
;
632 /* for now, we just have 3d pipe.. eventually this would need to
633 * be more clever to dispatch to appropriate gpu module:
635 if (args
->pipe
!= MSM_PIPE_3D0
)
643 return gpu
->funcs
->get_param(gpu
, args
->param
, &args
->value
);
646 static int msm_ioctl_gem_new(struct drm_device
*dev
, void *data
,
647 struct drm_file
*file
)
649 struct drm_msm_gem_new
*args
= data
;
650 return msm_gem_new_handle(dev
, file
, args
->size
,
651 args
->flags
, &args
->handle
);
654 #define TS(t) ((struct timespec){ .tv_sec = (t).tv_sec, .tv_nsec = (t).tv_nsec })
656 static int msm_ioctl_gem_cpu_prep(struct drm_device
*dev
, void *data
,
657 struct drm_file
*file
)
659 struct drm_msm_gem_cpu_prep
*args
= data
;
660 struct drm_gem_object
*obj
;
663 obj
= drm_gem_object_lookup(dev
, file
, args
->handle
);
667 ret
= msm_gem_cpu_prep(obj
, args
->op
, &TS(args
->timeout
));
669 drm_gem_object_unreference_unlocked(obj
);
674 static int msm_ioctl_gem_cpu_fini(struct drm_device
*dev
, void *data
,
675 struct drm_file
*file
)
677 struct drm_msm_gem_cpu_fini
*args
= data
;
678 struct drm_gem_object
*obj
;
681 obj
= drm_gem_object_lookup(dev
, file
, args
->handle
);
685 ret
= msm_gem_cpu_fini(obj
);
687 drm_gem_object_unreference_unlocked(obj
);
692 static int msm_ioctl_gem_info(struct drm_device
*dev
, void *data
,
693 struct drm_file
*file
)
695 struct drm_msm_gem_info
*args
= data
;
696 struct drm_gem_object
*obj
;
702 obj
= drm_gem_object_lookup(dev
, file
, args
->handle
);
706 args
->offset
= msm_gem_mmap_offset(obj
);
708 drm_gem_object_unreference_unlocked(obj
);
713 static int msm_ioctl_wait_fence(struct drm_device
*dev
, void *data
,
714 struct drm_file
*file
)
716 struct drm_msm_wait_fence
*args
= data
;
717 return msm_wait_fence_interruptable(dev
, args
->fence
, &TS(args
->timeout
));
720 static const struct drm_ioctl_desc msm_ioctls
[] = {
721 DRM_IOCTL_DEF_DRV(MSM_GET_PARAM
, msm_ioctl_get_param
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
722 DRM_IOCTL_DEF_DRV(MSM_GEM_NEW
, msm_ioctl_gem_new
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
723 DRM_IOCTL_DEF_DRV(MSM_GEM_INFO
, msm_ioctl_gem_info
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
724 DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP
, msm_ioctl_gem_cpu_prep
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
725 DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI
, msm_ioctl_gem_cpu_fini
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
726 DRM_IOCTL_DEF_DRV(MSM_GEM_SUBMIT
, msm_ioctl_gem_submit
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
727 DRM_IOCTL_DEF_DRV(MSM_WAIT_FENCE
, msm_ioctl_wait_fence
, DRM_UNLOCKED
|DRM_AUTH
|DRM_RENDER_ALLOW
),
730 static const struct vm_operations_struct vm_ops
= {
731 .fault
= msm_gem_fault
,
732 .open
= drm_gem_vm_open
,
733 .close
= drm_gem_vm_close
,
736 static const struct file_operations fops
= {
737 .owner
= THIS_MODULE
,
739 .release
= drm_release
,
740 .unlocked_ioctl
= drm_ioctl
,
742 .compat_ioctl
= drm_compat_ioctl
,
747 .mmap
= msm_gem_mmap
,
750 static struct drm_driver msm_driver
= {
751 .driver_features
= DRIVER_HAVE_IRQ
|
757 .unload
= msm_unload
,
759 .preclose
= msm_preclose
,
760 .lastclose
= msm_lastclose
,
761 .irq_handler
= msm_irq
,
762 .irq_preinstall
= msm_irq_preinstall
,
763 .irq_postinstall
= msm_irq_postinstall
,
764 .irq_uninstall
= msm_irq_uninstall
,
765 .get_vblank_counter
= drm_vblank_count
,
766 .enable_vblank
= msm_enable_vblank
,
767 .disable_vblank
= msm_disable_vblank
,
768 .gem_free_object
= msm_gem_free_object
,
769 .gem_vm_ops
= &vm_ops
,
770 .dumb_create
= msm_gem_dumb_create
,
771 .dumb_map_offset
= msm_gem_dumb_map_offset
,
772 .dumb_destroy
= drm_gem_dumb_destroy
,
773 .prime_handle_to_fd
= drm_gem_prime_handle_to_fd
,
774 .prime_fd_to_handle
= drm_gem_prime_fd_to_handle
,
775 .gem_prime_export
= drm_gem_prime_export
,
776 .gem_prime_import
= drm_gem_prime_import
,
777 .gem_prime_pin
= msm_gem_prime_pin
,
778 .gem_prime_unpin
= msm_gem_prime_unpin
,
779 .gem_prime_get_sg_table
= msm_gem_prime_get_sg_table
,
780 .gem_prime_import_sg_table
= msm_gem_prime_import_sg_table
,
781 .gem_prime_vmap
= msm_gem_prime_vmap
,
782 .gem_prime_vunmap
= msm_gem_prime_vunmap
,
783 #ifdef CONFIG_DEBUG_FS
784 .debugfs_init
= msm_debugfs_init
,
785 .debugfs_cleanup
= msm_debugfs_cleanup
,
787 .ioctls
= msm_ioctls
,
788 .num_ioctls
= DRM_MSM_NUM_IOCTLS
,
791 .desc
= "MSM Snapdragon DRM",
797 #ifdef CONFIG_PM_SLEEP
798 static int msm_pm_suspend(struct device
*dev
)
800 struct drm_device
*ddev
= dev_get_drvdata(dev
);
802 drm_kms_helper_poll_disable(ddev
);
807 static int msm_pm_resume(struct device
*dev
)
809 struct drm_device
*ddev
= dev_get_drvdata(dev
);
811 drm_kms_helper_poll_enable(ddev
);
817 static const struct dev_pm_ops msm_pm_ops
= {
818 SET_SYSTEM_SLEEP_PM_OPS(msm_pm_suspend
, msm_pm_resume
)
825 static int msm_pdev_probe(struct platform_device
*pdev
)
827 pdev
->dev
.coherent_dma_mask
= DMA_BIT_MASK(32);
828 return drm_platform_init(&msm_driver
, pdev
);
831 static int msm_pdev_remove(struct platform_device
*pdev
)
833 drm_put_dev(platform_get_drvdata(pdev
));
838 static const struct platform_device_id msm_id
[] = {
843 static const struct of_device_id dt_match
[] = {
844 { .compatible
= "qcom,mdss_mdp" },
847 MODULE_DEVICE_TABLE(of
, dt_match
);
849 static struct platform_driver msm_platform_driver
= {
850 .probe
= msm_pdev_probe
,
851 .remove
= msm_pdev_remove
,
853 .owner
= THIS_MODULE
,
855 .of_match_table
= dt_match
,
861 static int __init
msm_drm_register(void)
866 return platform_driver_register(&msm_platform_driver
);
869 static void __exit
msm_drm_unregister(void)
872 platform_driver_unregister(&msm_platform_driver
);
877 module_init(msm_drm_register
);
878 module_exit(msm_drm_unregister
);
880 MODULE_AUTHOR("Rob Clark <robdclark@gmail.com");
881 MODULE_DESCRIPTION("MSM DRM Driver");
882 MODULE_LICENSE("GPL");