| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * shmob_drm_drv.c -- SH Mobile DRM driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 Renesas Electronics Corporation |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Laurent Pinchart (laurent.pinchart@ideasonboard.com) |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 19 | 15 | #include <linux/pm.h> |
|---|
| 20 | 16 | #include <linux/slab.h> |
|---|
| 21 | 17 | |
|---|
| 22 | | -#include <drm/drmP.h> |
|---|
| 23 | 18 | #include <drm/drm_crtc_helper.h> |
|---|
| 19 | +#include <drm/drm_drv.h> |
|---|
| 24 | 20 | #include <drm/drm_gem_cma_helper.h> |
|---|
| 21 | +#include <drm/drm_irq.h> |
|---|
| 22 | +#include <drm/drm_probe_helper.h> |
|---|
| 23 | +#include <drm/drm_vblank.h> |
|---|
| 25 | 24 | |
|---|
| 26 | 25 | #include "shmob_drm_drv.h" |
|---|
| 27 | 26 | #include "shmob_drm_kms.h" |
|---|
| .. | .. |
|---|
| 130 | 129 | DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops); |
|---|
| 131 | 130 | |
|---|
| 132 | 131 | static struct drm_driver shmob_drm_driver = { |
|---|
| 133 | | - .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET |
|---|
| 134 | | - | DRIVER_PRIME, |
|---|
| 132 | + .driver_features = DRIVER_GEM | DRIVER_MODESET, |
|---|
| 135 | 133 | .irq_handler = shmob_drm_irq, |
|---|
| 136 | | - .gem_free_object_unlocked = drm_gem_cma_free_object, |
|---|
| 137 | | - .gem_vm_ops = &drm_gem_cma_vm_ops, |
|---|
| 138 | | - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
|---|
| 139 | | - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, |
|---|
| 140 | | - .gem_prime_import = drm_gem_prime_import, |
|---|
| 141 | | - .gem_prime_export = drm_gem_prime_export, |
|---|
| 142 | | - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, |
|---|
| 143 | | - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, |
|---|
| 144 | | - .gem_prime_vmap = drm_gem_cma_prime_vmap, |
|---|
| 145 | | - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, |
|---|
| 146 | | - .gem_prime_mmap = drm_gem_cma_prime_mmap, |
|---|
| 147 | | - .dumb_create = drm_gem_cma_dumb_create, |
|---|
| 134 | + DRM_GEM_CMA_DRIVER_OPS, |
|---|
| 148 | 135 | .fops = &shmob_drm_fops, |
|---|
| 149 | 136 | .name = "shmob-drm", |
|---|
| 150 | 137 | .desc = "Renesas SH Mobile DRM", |
|---|
| .. | .. |
|---|
| 196 | 183 | |
|---|
| 197 | 184 | drm_dev_unregister(ddev); |
|---|
| 198 | 185 | drm_kms_helper_poll_fini(ddev); |
|---|
| 199 | | - drm_mode_config_cleanup(ddev); |
|---|
| 200 | 186 | drm_irq_uninstall(ddev); |
|---|
| 201 | | - drm_dev_unref(ddev); |
|---|
| 187 | + drm_dev_put(ddev); |
|---|
| 202 | 188 | |
|---|
| 203 | 189 | return 0; |
|---|
| 204 | 190 | } |
|---|
| .. | .. |
|---|
| 292 | 278 | drm_irq_uninstall(ddev); |
|---|
| 293 | 279 | err_modeset_cleanup: |
|---|
| 294 | 280 | drm_kms_helper_poll_fini(ddev); |
|---|
| 295 | | - drm_mode_config_cleanup(ddev); |
|---|
| 296 | 281 | err_free_drm_dev: |
|---|
| 297 | | - drm_dev_unref(ddev); |
|---|
| 282 | + drm_dev_put(ddev); |
|---|
| 298 | 283 | |
|---|
| 299 | 284 | return ret; |
|---|
| 300 | 285 | } |
|---|