CHROMIUM: drm/rockchip: add GEM CPU acquire/release ioctls
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / rockchip / rockchip_drm_drv.c
1 /*
2  * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
3  * Author:Mark Yao <mark.yao@rock-chips.com>
4  *
5  * based on exynos_drm_drv.c
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
16
17 #include <linux/dma-iommu.h>
18
19 #include <drm/drmP.h>
20 #include <drm/drm_crtc_helper.h>
21 #include <drm/drm_fb_helper.h>
22 #include <drm/drm_sync_helper.h>
23 #include <linux/dma-mapping.h>
24 #include <linux/pm_runtime.h>
25 #include <linux/module.h>
26 #include <linux/of_graph.h>
27 #include <linux/component.h>
28 #include <linux/fence.h>
29
30 #include <drm/rockchip_drm.h>
31
32 #include "rockchip_drm_drv.h"
33 #include "rockchip_drm_fb.h"
34 #include "rockchip_drm_fbdev.h"
35 #include "rockchip_drm_gem.h"
36
37 #define DRIVER_NAME     "rockchip"
38 #define DRIVER_DESC     "RockChip Soc DRM"
39 #define DRIVER_DATE     "20140818"
40 #define DRIVER_MAJOR    1
41 #define DRIVER_MINOR    0
42
43 /*
44  * Attach a (component) device to the shared drm dma mapping from master drm
45  * device.  This is used by the VOPs to map GEM buffers to a common DMA
46  * mapping.
47  */
48 int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
49                                    struct device *dev)
50 {
51         struct rockchip_drm_private *private = drm_dev->dev_private;
52         struct iommu_domain *domain = private->domain;
53         int ret;
54
55         ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
56         if (ret)
57                 return ret;
58
59         dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
60         ret = iommu_attach_device(domain, dev);
61         if (ret) {
62                 dev_err(dev, "Failed to attach iommu device\n");
63                 return ret;
64         }
65
66         if (!common_iommu_setup_dma_ops(dev, 0x10000000, SZ_2G, domain->ops)) {
67                 dev_err(dev, "Failed to set dma_ops\n");
68                 iommu_detach_device(domain, dev);
69                 ret = -ENODEV;
70         }
71
72         return ret;
73 }
74
75 void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
76                                     struct device *dev)
77 {
78         struct rockchip_drm_private *private = drm_dev->dev_private;
79         struct iommu_domain *domain = private->domain;
80
81         iommu_detach_device(domain, dev);
82 }
83
84 int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
85                                  const struct rockchip_crtc_funcs *crtc_funcs)
86 {
87         int pipe = drm_crtc_index(crtc);
88         struct rockchip_drm_private *priv = crtc->dev->dev_private;
89
90         if (pipe > ROCKCHIP_MAX_CRTC)
91                 return -EINVAL;
92
93         priv->crtc_funcs[pipe] = crtc_funcs;
94
95         return 0;
96 }
97
98 void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc)
99 {
100         int pipe = drm_crtc_index(crtc);
101         struct rockchip_drm_private *priv = crtc->dev->dev_private;
102
103         if (pipe > ROCKCHIP_MAX_CRTC)
104                 return;
105
106         priv->crtc_funcs[pipe] = NULL;
107 }
108
109 static struct drm_crtc *rockchip_crtc_from_pipe(struct drm_device *drm,
110                                                 int pipe)
111 {
112         struct drm_crtc *crtc;
113         int i = 0;
114
115         list_for_each_entry(crtc, &drm->mode_config.crtc_list, head)
116                 if (i++ == pipe)
117                         return crtc;
118
119         return NULL;
120 }
121
122 static int rockchip_drm_crtc_enable_vblank(struct drm_device *dev,
123                                            unsigned int pipe)
124 {
125         struct rockchip_drm_private *priv = dev->dev_private;
126         struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe);
127
128         if (crtc && priv->crtc_funcs[pipe] &&
129             priv->crtc_funcs[pipe]->enable_vblank)
130                 return priv->crtc_funcs[pipe]->enable_vblank(crtc);
131
132         return 0;
133 }
134
135 static void rockchip_drm_crtc_disable_vblank(struct drm_device *dev,
136                                              unsigned int pipe)
137 {
138         struct rockchip_drm_private *priv = dev->dev_private;
139         struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe);
140
141         if (crtc && priv->crtc_funcs[pipe] &&
142             priv->crtc_funcs[pipe]->enable_vblank)
143                 priv->crtc_funcs[pipe]->disable_vblank(crtc);
144 }
145
146 static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
147 {
148         struct rockchip_drm_private *private;
149         struct device *dev = drm_dev->dev;
150         struct drm_connector *connector;
151         struct iommu_group *group;
152         int ret;
153
154         private = devm_kzalloc(drm_dev->dev, sizeof(*private), GFP_KERNEL);
155         if (!private)
156                 return -ENOMEM;
157
158         mutex_init(&private->commit.lock);
159         INIT_WORK(&private->commit.work, rockchip_drm_atomic_work);
160
161         drm_dev->dev_private = private;
162
163 #ifdef CONFIG_DRM_DMA_SYNC
164         private->cpu_fence_context = fence_context_alloc(1);
165         atomic_set(&private->cpu_fence_seqno, 0);
166 #endif
167
168         drm_mode_config_init(drm_dev);
169
170         rockchip_drm_mode_config_init(drm_dev);
171
172         dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
173                                       GFP_KERNEL);
174         if (!dev->dma_parms) {
175                 ret = -ENOMEM;
176                 goto err_config_cleanup;
177         }
178
179         private->domain = iommu_domain_alloc(&platform_bus_type);
180         if (!private->domain)
181                 return -ENOMEM;
182
183         ret = iommu_get_dma_cookie(private->domain);
184         if (ret)
185                 goto err_free_domain;
186
187         group = iommu_group_get(dev);
188         if (!group) {
189                 group = iommu_group_alloc();
190                 if (IS_ERR(group)) {
191                         dev_err(dev, "Failed to allocate IOMMU group\n");
192                         goto err_put_cookie;
193                 }
194
195                 ret = iommu_group_add_device(group, dev);
196                 iommu_group_put(group);
197                 if (ret) {
198                         dev_err(dev, "failed to add device to IOMMU group\n");
199                         goto err_put_cookie;
200                 }
201         }
202         /*
203          * Attach virtual iommu device, sub iommu device can share the same
204          * mapping with it.
205          */
206         ret = rockchip_drm_dma_attach_device(drm_dev, dev);
207         if (ret)
208                 goto err_group_remove_device;
209
210         /* Try to bind all sub drivers. */
211         ret = component_bind_all(dev, drm_dev);
212         if (ret)
213                 goto err_detach_device;
214
215         /*
216          * All components are now added, we can publish the connector sysfs
217          * entries to userspace.  This will generate hotplug events and so
218          * userspace will expect to be able to access DRM at this point.
219          */
220         list_for_each_entry(connector, &drm_dev->mode_config.connector_list,
221                         head) {
222                 ret = drm_connector_register(connector);
223                 if (ret) {
224                         dev_err(drm_dev->dev,
225                                 "[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
226                                 connector->base.id,
227                                 connector->name, ret);
228                         goto err_unbind;
229                 }
230         }
231
232         /* init kms poll for handling hpd */
233         drm_kms_helper_poll_init(drm_dev);
234
235         /*
236          * enable drm irq mode.
237          * - with irq_enabled = true, we can use the vblank feature.
238          */
239         drm_dev->irq_enabled = true;
240
241         ret = drm_vblank_init(drm_dev, ROCKCHIP_MAX_CRTC);
242         if (ret)
243                 goto err_kms_helper_poll_fini;
244
245         /*
246          * with vblank_disable_allowed = true, vblank interrupt will be disabled
247          * by drm timer once a current process gives up ownership of
248          * vblank event.(after drm_vblank_put function is called)
249          */
250         drm_dev->vblank_disable_allowed = true;
251
252         drm_mode_config_reset(drm_dev);
253
254         ret = rockchip_drm_fbdev_init(drm_dev);
255         if (ret)
256                 goto err_vblank_cleanup;
257
258         return 0;
259 err_vblank_cleanup:
260         drm_vblank_cleanup(drm_dev);
261 err_kms_helper_poll_fini:
262         drm_kms_helper_poll_fini(drm_dev);
263 err_unbind:
264         component_unbind_all(dev, drm_dev);
265 err_detach_device:
266         rockchip_drm_dma_detach_device(drm_dev, dev);
267 err_group_remove_device:
268         iommu_group_remove_device(dev);
269 err_put_cookie:
270         iommu_put_dma_cookie(private->domain);
271 err_free_domain:
272         iommu_domain_free(private->domain);
273 err_config_cleanup:
274         drm_mode_config_cleanup(drm_dev);
275         drm_dev->dev_private = NULL;
276         return ret;
277 }
278
279 static int rockchip_drm_unload(struct drm_device *drm_dev)
280 {
281         struct device *dev = drm_dev->dev;
282         struct rockchip_drm_private *private = drm_dev->dev_private;
283
284         rockchip_drm_fbdev_fini(drm_dev);
285         drm_vblank_cleanup(drm_dev);
286         drm_kms_helper_poll_fini(drm_dev);
287         component_unbind_all(dev, drm_dev);
288         rockchip_drm_dma_detach_device(drm_dev, dev);
289         iommu_group_remove_device(dev);
290         iommu_put_dma_cookie(private->domain);
291         iommu_domain_free(private->domain);
292         drm_mode_config_cleanup(drm_dev);
293         drm_dev->dev_private = NULL;
294
295         return 0;
296 }
297
298 static void rockchip_drm_crtc_cancel_pending_vblank(struct drm_crtc *crtc,
299                                                     struct drm_file *file_priv)
300 {
301         struct rockchip_drm_private *priv = crtc->dev->dev_private;
302         int pipe = drm_crtc_index(crtc);
303
304         if (pipe < ROCKCHIP_MAX_CRTC &&
305             priv->crtc_funcs[pipe] &&
306             priv->crtc_funcs[pipe]->cancel_pending_vblank)
307                 priv->crtc_funcs[pipe]->cancel_pending_vblank(crtc, file_priv);
308 }
309
310 static int rockchip_drm_open(struct drm_device *dev, struct drm_file *file)
311 {
312         struct rockchip_drm_file_private *file_priv;
313
314         file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
315         if (!file_priv)
316                 return -ENOMEM;
317         INIT_LIST_HEAD(&file_priv->gem_cpu_acquire_list);
318
319         file->driver_priv = file_priv;
320
321         return 0;
322 }
323
324 static void rockchip_drm_preclose(struct drm_device *dev,
325                                   struct drm_file *file_priv)
326 {
327         struct rockchip_drm_file_private *file_private = file_priv->driver_priv;
328         struct rockchip_gem_object_node *cur, *d;
329         struct drm_crtc *crtc;
330
331         list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
332                 rockchip_drm_crtc_cancel_pending_vblank(crtc, file_priv);
333
334         mutex_lock(&dev->struct_mutex);
335         list_for_each_entry_safe(cur, d,
336                         &file_private->gem_cpu_acquire_list, list) {
337 #ifdef CONFIG_DRM_DMA_SYNC
338                 BUG_ON(!cur->rockchip_gem_obj->acquire_fence);
339                 drm_fence_signal_and_put(&cur->rockchip_gem_obj->acquire_fence);
340 #endif
341                 drm_gem_object_unreference(&cur->rockchip_gem_obj->base);
342                 kfree(cur);
343         }
344         /* since we are deleting the whole list, just initialize the header
345          * instead of calling list_del for every element
346          */
347         INIT_LIST_HEAD(&file_private->gem_cpu_acquire_list);
348         mutex_unlock(&dev->struct_mutex);
349 }
350
351 static void rockchip_drm_postclose(struct drm_device *dev, struct drm_file *file)
352 {
353         kfree(file->driver_priv);
354         file->driver_priv = NULL;
355 }
356
357 void rockchip_drm_lastclose(struct drm_device *dev)
358 {
359         struct rockchip_drm_private *priv = dev->dev_private;
360
361         drm_fb_helper_restore_fbdev_mode_unlocked(&priv->fbdev_helper);
362 }
363
364 static const struct drm_ioctl_desc rockchip_ioctls[] = {
365         DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_CREATE, rockchip_gem_create_ioctl,
366                           DRM_UNLOCKED | DRM_AUTH),
367         DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_MAP_OFFSET,
368                           rockchip_gem_map_offset_ioctl,
369                           DRM_UNLOCKED | DRM_AUTH),
370         DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_CPU_ACQUIRE,
371                           rockchip_gem_cpu_acquire_ioctl,
372                           DRM_UNLOCKED | DRM_AUTH),
373         DRM_IOCTL_DEF_DRV(ROCKCHIP_GEM_CPU_RELEASE,
374                           rockchip_gem_cpu_release_ioctl,
375                           DRM_UNLOCKED | DRM_AUTH),
376 };
377
378 static const struct file_operations rockchip_drm_driver_fops = {
379         .owner = THIS_MODULE,
380         .open = drm_open,
381         .mmap = rockchip_gem_mmap,
382         .poll = drm_poll,
383         .read = drm_read,
384         .unlocked_ioctl = drm_ioctl,
385 #ifdef CONFIG_COMPAT
386         .compat_ioctl = drm_compat_ioctl,
387 #endif
388         .release = drm_release,
389 };
390
391 const struct vm_operations_struct rockchip_drm_vm_ops = {
392         .open = drm_gem_vm_open,
393         .close = drm_gem_vm_close,
394 };
395
396 static struct drm_driver rockchip_drm_driver = {
397         .driver_features        = DRIVER_MODESET | DRIVER_GEM |
398                                   DRIVER_PRIME | DRIVER_ATOMIC,
399         .load                   = rockchip_drm_load,
400         .unload                 = rockchip_drm_unload,
401         .preclose               = rockchip_drm_preclose,
402         .lastclose              = rockchip_drm_lastclose,
403         .get_vblank_counter     = drm_vblank_no_hw_counter,
404         .open                   = rockchip_drm_open,
405         .postclose              = rockchip_drm_postclose,
406         .enable_vblank          = rockchip_drm_crtc_enable_vblank,
407         .disable_vblank         = rockchip_drm_crtc_disable_vblank,
408         .gem_vm_ops             = &rockchip_drm_vm_ops,
409         .gem_free_object        = rockchip_gem_free_object,
410         .dumb_create            = rockchip_gem_dumb_create,
411         .dumb_map_offset        = rockchip_gem_dumb_map_offset,
412         .dumb_destroy           = drm_gem_dumb_destroy,
413         .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
414         .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
415         .gem_prime_import       = drm_gem_prime_import,
416         .gem_prime_export       = drm_gem_prime_export,
417         .gem_prime_get_sg_table = rockchip_gem_prime_get_sg_table,
418         .gem_prime_vmap         = rockchip_gem_prime_vmap,
419         .gem_prime_vunmap       = rockchip_gem_prime_vunmap,
420         .gem_prime_mmap         = rockchip_gem_mmap_buf,
421         .ioctls                 = rockchip_ioctls,
422         .num_ioctls             = ARRAY_SIZE(rockchip_ioctls),
423         .fops                   = &rockchip_drm_driver_fops,
424         .name   = DRIVER_NAME,
425         .desc   = DRIVER_DESC,
426         .date   = DRIVER_DATE,
427         .major  = DRIVER_MAJOR,
428         .minor  = DRIVER_MINOR,
429 };
430
431 #ifdef CONFIG_PM_SLEEP
432 static int rockchip_drm_sys_suspend(struct device *dev)
433 {
434         struct drm_device *drm = dev_get_drvdata(dev);
435         struct drm_connector *connector;
436
437         if (!drm)
438                 return 0;
439
440         drm_modeset_lock_all(drm);
441         list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
442                 int old_dpms = connector->dpms;
443
444                 if (connector->funcs->dpms)
445                         connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
446
447                 /* Set the old mode back to the connector for resume */
448                 connector->dpms = old_dpms;
449         }
450         drm_modeset_unlock_all(drm);
451
452         return 0;
453 }
454
455 static int rockchip_drm_sys_resume(struct device *dev)
456 {
457         struct drm_device *drm = dev_get_drvdata(dev);
458         struct drm_connector *connector;
459         enum drm_connector_status status;
460         bool changed = false;
461
462         if (!drm)
463                 return 0;
464
465         drm_modeset_lock_all(drm);
466         list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
467                 int desired_mode = connector->dpms;
468
469                 /*
470                  * at suspend time, we save dpms to connector->dpms,
471                  * restore the old_dpms, and at current time, the connector
472                  * dpms status must be DRM_MODE_DPMS_OFF.
473                  */
474                 connector->dpms = DRM_MODE_DPMS_OFF;
475
476                 /*
477                  * If the connector has been disconnected during suspend,
478                  * disconnect it from the encoder and leave it off. We'll notify
479                  * userspace at the end.
480                  */
481                 if (desired_mode == DRM_MODE_DPMS_ON) {
482                         status = connector->funcs->detect(connector, true);
483                         if (status == connector_status_disconnected) {
484                                 connector->encoder = NULL;
485                                 connector->status = status;
486                                 changed = true;
487                                 continue;
488                         }
489                 }
490                 if (connector->funcs->dpms)
491                         connector->funcs->dpms(connector, desired_mode);
492         }
493         drm_modeset_unlock_all(drm);
494
495         drm_helper_resume_force_mode(drm);
496
497         if (changed)
498                 drm_kms_helper_hotplug_event(drm);
499
500         return 0;
501 }
502 #endif
503
504 static const struct dev_pm_ops rockchip_drm_pm_ops = {
505         SET_SYSTEM_SLEEP_PM_OPS(rockchip_drm_sys_suspend,
506                                 rockchip_drm_sys_resume)
507 };
508
509 /*
510  * @node: device tree node containing encoder input ports
511  * @encoder: drm_encoder
512  */
513 int rockchip_drm_encoder_get_mux_id(struct device_node *node,
514                                     struct drm_encoder *encoder)
515 {
516         struct device_node *ep;
517         struct drm_crtc *crtc = encoder->crtc;
518         struct of_endpoint endpoint;
519         struct device_node *port;
520         int ret;
521
522         if (!node || !crtc)
523                 return -EINVAL;
524
525         for_each_endpoint_of_node(node, ep) {
526                 port = of_graph_get_remote_port(ep);
527                 of_node_put(port);
528                 if (port == crtc->port) {
529                         ret = of_graph_parse_endpoint(ep, &endpoint);
530                         of_node_put(ep);
531                         return ret ?: endpoint.id;
532                 }
533         }
534
535         return -EINVAL;
536 }
537 EXPORT_SYMBOL_GPL(rockchip_drm_encoder_get_mux_id);
538
539 static int compare_of(struct device *dev, void *data)
540 {
541         struct device_node *np = data;
542
543         return dev->of_node == np;
544 }
545
546 static void rockchip_add_endpoints(struct device *dev,
547                                    struct component_match **match,
548                                    struct device_node *port)
549 {
550         struct device_node *ep, *remote;
551
552         for_each_child_of_node(port, ep) {
553                 remote = of_graph_get_remote_port_parent(ep);
554                 if (!remote || !of_device_is_available(remote)) {
555                         of_node_put(remote);
556                         continue;
557                 } else if (!of_device_is_available(remote->parent)) {
558                         dev_warn(dev, "parent device of %s is not available\n",
559                                  remote->full_name);
560                         of_node_put(remote);
561                         continue;
562                 }
563
564                 component_match_add(dev, match, compare_of, remote);
565                 of_node_put(remote);
566         }
567 }
568
569 static int rockchip_drm_bind(struct device *dev)
570 {
571         struct drm_device *drm;
572         int ret;
573
574         drm = drm_dev_alloc(&rockchip_drm_driver, dev);
575         if (!drm)
576                 return -ENOMEM;
577
578         ret = drm_dev_set_unique(drm, "%s", dev_name(dev));
579         if (ret)
580                 goto err_free;
581
582         ret = drm_dev_register(drm, 0);
583         if (ret)
584                 goto err_free;
585
586         dev_set_drvdata(dev, drm);
587
588         return 0;
589
590 err_free:
591         drm_dev_unref(drm);
592         return ret;
593 }
594
595 static void rockchip_drm_unbind(struct device *dev)
596 {
597         struct drm_device *drm = dev_get_drvdata(dev);
598
599         drm_dev_unregister(drm);
600         drm_dev_unref(drm);
601         dev_set_drvdata(dev, NULL);
602 }
603
604 static const struct component_master_ops rockchip_drm_ops = {
605         .bind = rockchip_drm_bind,
606         .unbind = rockchip_drm_unbind,
607 };
608
609 static int rockchip_drm_platform_probe(struct platform_device *pdev)
610 {
611         struct device *dev = &pdev->dev;
612         struct component_match *match = NULL;
613         struct device_node *np = dev->of_node;
614         struct device_node *port;
615         int i;
616
617         if (!np)
618                 return -ENODEV;
619         /*
620          * Bind the crtc ports first, so that
621          * drm_of_find_possible_crtcs called from encoder .bind callbacks
622          * works as expected.
623          */
624         for (i = 0;; i++) {
625                 port = of_parse_phandle(np, "ports", i);
626                 if (!port)
627                         break;
628
629                 if (!of_device_is_available(port->parent)) {
630                         of_node_put(port);
631                         continue;
632                 }
633
634                 component_match_add(dev, &match, compare_of, port->parent);
635                 of_node_put(port);
636         }
637
638         if (i == 0) {
639                 dev_err(dev, "missing 'ports' property\n");
640                 return -ENODEV;
641         }
642
643         if (!match) {
644                 dev_err(dev, "No available vop found for display-subsystem.\n");
645                 return -ENODEV;
646         }
647         /*
648          * For each bound crtc, bind the encoders attached to its
649          * remote endpoint.
650          */
651         for (i = 0;; i++) {
652                 port = of_parse_phandle(np, "ports", i);
653                 if (!port)
654                         break;
655
656                 if (!of_device_is_available(port->parent)) {
657                         of_node_put(port);
658                         continue;
659                 }
660
661                 rockchip_add_endpoints(dev, &match, port);
662                 of_node_put(port);
663         }
664
665         return component_master_add_with_match(dev, &rockchip_drm_ops, match);
666 }
667
668 static int rockchip_drm_platform_remove(struct platform_device *pdev)
669 {
670         component_master_del(&pdev->dev, &rockchip_drm_ops);
671
672         return 0;
673 }
674
675 static const struct of_device_id rockchip_drm_dt_ids[] = {
676         { .compatible = "rockchip,display-subsystem", },
677         { /* sentinel */ },
678 };
679 MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids);
680
681 static struct platform_driver rockchip_drm_platform_driver = {
682         .probe = rockchip_drm_platform_probe,
683         .remove = rockchip_drm_platform_remove,
684         .driver = {
685                 .name = "rockchip-drm",
686                 .of_match_table = rockchip_drm_dt_ids,
687                 .pm = &rockchip_drm_pm_ops,
688         },
689 };
690
691 module_platform_driver(rockchip_drm_platform_driver);
692
693 MODULE_AUTHOR("Mark Yao <mark.yao@rock-chips.com>");
694 MODULE_DESCRIPTION("ROCKCHIP DRM Driver");
695 MODULE_LICENSE("GPL v2");