diff options
author | Dave Airlie <airlied@redhat.com> | 2017-06-15 20:05:03 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-06-15 20:05:03 -0400 |
commit | 033fd3256f5aef7cbc0df0d747377be6c4349f48 (patch) | |
tree | c760059631b8e7a8ac06baa843175198d323ae36 | |
parent | 202dfa086dfa9a250d9ad0ec393251a8e23248d6 (diff) | |
parent | 09cedcb6d4c585336c5a75cbbb3a5addf710b03e (diff) |
Merge tag 'drm-fsl-dcu-for-v4.13' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next
some fsl-dcu cleanups
* tag 'drm-fsl-dcu-for-v4.13' of http://git.agner.ch/git/linux-drm-fsl-dcu:
drm/fsl-dcu: use new drm_atomic_helper_shutdown
drm/fsl-dcu: implement irq_preinstall/uninstall callbacks
drm/fsl: Drop drm_vblank_cleanup
-rw-r--r-- | drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 6e00f4b267f1..5cbde196895a 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | |||
@@ -51,19 +51,12 @@ static const struct regmap_config fsl_dcu_regmap_config = { | |||
51 | .volatile_reg = fsl_dcu_drm_is_volatile_reg, | 51 | .volatile_reg = fsl_dcu_drm_is_volatile_reg, |
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int fsl_dcu_drm_irq_init(struct drm_device *dev) | 54 | static void fsl_dcu_irq_uninstall(struct drm_device *dev) |
55 | { | 55 | { |
56 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; | 56 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; |
57 | int ret; | ||
58 | |||
59 | ret = drm_irq_install(dev, fsl_dev->irq); | ||
60 | if (ret < 0) | ||
61 | dev_err(dev->dev, "failed to install IRQ handler\n"); | ||
62 | 57 | ||
63 | regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0); | 58 | regmap_write(fsl_dev->regmap, DCU_INT_STATUS, ~0); |
64 | regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0); | 59 | regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0); |
65 | |||
66 | return ret; | ||
67 | } | 60 | } |
68 | 61 | ||
69 | static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) | 62 | static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) |
@@ -83,10 +76,11 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) | |||
83 | goto done; | 76 | goto done; |
84 | } | 77 | } |
85 | 78 | ||
86 | ret = fsl_dcu_drm_irq_init(dev); | 79 | ret = drm_irq_install(dev, fsl_dev->irq); |
87 | if (ret < 0) | 80 | if (ret < 0) { |
81 | dev_err(dev->dev, "failed to install IRQ handler\n"); | ||
88 | goto done; | 82 | goto done; |
89 | dev->irq_enabled = true; | 83 | } |
90 | 84 | ||
91 | if (legacyfb_depth != 16 && legacyfb_depth != 24 && | 85 | if (legacyfb_depth != 16 && legacyfb_depth != 24 && |
92 | legacyfb_depth != 32) { | 86 | legacyfb_depth != 32) { |
@@ -109,7 +103,6 @@ done: | |||
109 | drm_fbdev_cma_fini(fsl_dev->fbdev); | 103 | drm_fbdev_cma_fini(fsl_dev->fbdev); |
110 | 104 | ||
111 | drm_mode_config_cleanup(dev); | 105 | drm_mode_config_cleanup(dev); |
112 | drm_vblank_cleanup(dev); | ||
113 | drm_irq_uninstall(dev); | 106 | drm_irq_uninstall(dev); |
114 | dev->dev_private = NULL; | 107 | dev->dev_private = NULL; |
115 | 108 | ||
@@ -120,14 +113,13 @@ static void fsl_dcu_unload(struct drm_device *dev) | |||
120 | { | 113 | { |
121 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; | 114 | struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; |
122 | 115 | ||
123 | drm_crtc_force_disable_all(dev); | 116 | drm_atomic_helper_shutdown(dev); |
124 | drm_kms_helper_poll_fini(dev); | 117 | drm_kms_helper_poll_fini(dev); |
125 | 118 | ||
126 | if (fsl_dev->fbdev) | 119 | if (fsl_dev->fbdev) |
127 | drm_fbdev_cma_fini(fsl_dev->fbdev); | 120 | drm_fbdev_cma_fini(fsl_dev->fbdev); |
128 | 121 | ||
129 | drm_mode_config_cleanup(dev); | 122 | drm_mode_config_cleanup(dev); |
130 | drm_vblank_cleanup(dev); | ||
131 | drm_irq_uninstall(dev); | 123 | drm_irq_uninstall(dev); |
132 | 124 | ||
133 | dev->dev_private = NULL; | 125 | dev->dev_private = NULL; |
@@ -170,6 +162,8 @@ static struct drm_driver fsl_dcu_drm_driver = { | |||
170 | .load = fsl_dcu_load, | 162 | .load = fsl_dcu_load, |
171 | .unload = fsl_dcu_unload, | 163 | .unload = fsl_dcu_unload, |
172 | .irq_handler = fsl_dcu_drm_irq, | 164 | .irq_handler = fsl_dcu_drm_irq, |
165 | .irq_preinstall = fsl_dcu_irq_uninstall, | ||
166 | .irq_uninstall = fsl_dcu_irq_uninstall, | ||
173 | .gem_free_object_unlocked = drm_gem_cma_free_object, | 167 | .gem_free_object_unlocked = drm_gem_cma_free_object, |
174 | .gem_vm_ops = &drm_gem_cma_vm_ops, | 168 | .gem_vm_ops = &drm_gem_cma_vm_ops, |
175 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, | 169 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |