aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/imx-drm-core.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-09-27 19:31:03 -0400
committerDave Airlie <airlied@redhat.com>2018-09-27 19:36:48 -0400
commit156e60bc71aa31a3b42b1d66a822c2999bd0994c (patch)
treedbc2fa3c30c78b1465aa29ca37fefbb8a16bde8e /drivers/gpu/drm/imx/imx-drm-core.c
parentbf78296ab1cb215d0609ac6cff4e43e941e51265 (diff)
parentc2b70ffcd34eca60013d90bd6cd56e60b07adef8 (diff)
Merge tag 'drm-misc-next-2018-09-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 4.20: UAPI Changes: - None Cross-subsystem Changes: - MAINTAINERS: Move udl, mxsfb, and fsl-dcu into drm-misc (Stefan, Sean) Core Changes: - syncobj: Check condition before returning timeout in schedule() (Chris) Driver Changes: - various: First wave of drm_fbdev_generic_setup() conversions (Noralf) - bochs/virtio: More format byte-order improvements (Gerd) - mxsfb: A couple fixes + add runtime pm support (Leonard) - virtio: Add vmap support for prime objects (Ezequiel) Cc: Stefan Agner <stefan@agner.ch> Cc: Sean Paul <sean@poorly.run> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: Gerd Hoffman <kraxel@redhat.com> Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com> From: Sean Paul <sean@poorly.run> Link: https://patchwork.freedesktop.org/patch/msgid/20180927093950.GA180365@art_vandelay
Diffstat (limited to 'drivers/gpu/drm/imx/imx-drm-core.c')
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 5ea0c82f9957..a70f3131a377 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -86,7 +86,6 @@ static int imx_drm_atomic_check(struct drm_device *dev,
86 86
87static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = { 87static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
88 .fb_create = drm_gem_fb_create, 88 .fb_create = drm_gem_fb_create,
89 .output_poll_changed = drm_fb_helper_output_poll_changed,
90 .atomic_check = imx_drm_atomic_check, 89 .atomic_check = imx_drm_atomic_check,
91 .atomic_commit = drm_atomic_helper_commit, 90 .atomic_commit = drm_atomic_helper_commit,
92}; 91};
@@ -165,7 +164,6 @@ static const struct drm_ioctl_desc imx_drm_ioctls[] = {
165static struct drm_driver imx_drm_driver = { 164static struct drm_driver imx_drm_driver = {
166 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | 165 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
167 DRIVER_ATOMIC, 166 DRIVER_ATOMIC,
168 .lastclose = drm_fb_helper_lastclose,
169 .gem_free_object_unlocked = drm_gem_cma_free_object, 167 .gem_free_object_unlocked = drm_gem_cma_free_object,
170 .gem_vm_ops = &drm_gem_cma_vm_ops, 168 .gem_vm_ops = &drm_gem_cma_vm_ops,
171 .dumb_create = drm_gem_cma_dumb_create, 169 .dumb_create = drm_gem_cma_dumb_create,
@@ -263,30 +261,23 @@ static int imx_drm_bind(struct device *dev)
263 * The fb helper takes copies of key hardware information, so the 261 * The fb helper takes copies of key hardware information, so the
264 * crtcs/connectors/encoders must not change after this point. 262 * crtcs/connectors/encoders must not change after this point.
265 */ 263 */
266#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
267 if (legacyfb_depth != 16 && legacyfb_depth != 32) { 264 if (legacyfb_depth != 16 && legacyfb_depth != 32) {
268 dev_warn(dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n"); 265 dev_warn(dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
269 legacyfb_depth = 16; 266 legacyfb_depth = 16;
270 } 267 }
271 ret = drm_fb_cma_fbdev_init(drm, legacyfb_depth, MAX_CRTC);
272 if (ret)
273 goto err_unbind;
274#endif
275 268
276 drm_kms_helper_poll_init(drm); 269 drm_kms_helper_poll_init(drm);
277 270
278 ret = drm_dev_register(drm, 0); 271 ret = drm_dev_register(drm, 0);
279 if (ret) 272 if (ret)
280 goto err_fbhelper; 273 goto err_poll_fini;
274
275 drm_fbdev_generic_setup(drm, legacyfb_depth);
281 276
282 return 0; 277 return 0;
283 278
284err_fbhelper: 279err_poll_fini:
285 drm_kms_helper_poll_fini(drm); 280 drm_kms_helper_poll_fini(drm);
286#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
287 drm_fb_cma_fbdev_fini(drm);
288err_unbind:
289#endif
290 component_unbind_all(drm->dev, drm); 281 component_unbind_all(drm->dev, drm);
291err_kms: 282err_kms:
292 drm_mode_config_cleanup(drm); 283 drm_mode_config_cleanup(drm);
@@ -303,8 +294,6 @@ static void imx_drm_unbind(struct device *dev)
303 294
304 drm_kms_helper_poll_fini(drm); 295 drm_kms_helper_poll_fini(drm);
305 296
306 drm_fb_cma_fbdev_fini(drm);
307
308 drm_mode_config_cleanup(drm); 297 drm_mode_config_cleanup(drm);
309 298
310 component_unbind_all(drm->dev, drm); 299 component_unbind_all(drm->dev, drm);