diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-11-15 17:19:54 +0300 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2017-12-08 16:47:42 +0300 |
commit | 50b45f2137243712e8d7e0c3abcc700827fed0db (patch) | |
tree | 51e66c485994ac485e0ca8406f4d2d5dc0871114 | |
parent | 22efc85b6ca5c2df26fc6fcba1d049927f0a0557 (diff) | |
download | linux-50b45f2137243712e8d7e0c3abcc700827fed0db.tar.xz |
drm/tilcdc: Use drm_fb_cma_fbdev_init/fini()
Use drm_fb_cma_fbdev_init() and drm_fb_cma_fbdev_fini() which relies on
the fact that drm_device holds a pointer to the drm_fb_helper structure.
This means that the driver doesn't have to keep track of that.
Also use the drm_fb_helper functions directly.
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Jyri Sarha <jsarha@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171115142001.45358-16-noralf@tronnes.org
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_drv.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_drv.h | 2 |
2 files changed, 5 insertions, 23 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index bc4feb3a84b9..1afde61f1247 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -69,12 +69,6 @@ static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev, return drm_gem_fb_create(dev, file_priv, mode_cmd); } -static void tilcdc_fb_output_poll_changed(struct drm_device *dev) -{ - struct tilcdc_drm_private *priv = dev->dev_private; - drm_fbdev_cma_hotplug_event(priv->fbdev); -} - static int tilcdc_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) { @@ -146,7 +140,7 @@ static int tilcdc_commit(struct drm_device *dev, static const struct drm_mode_config_funcs mode_config_funcs = { .fb_create = tilcdc_fb_create, - .output_poll_changed = tilcdc_fb_output_poll_changed, + .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = tilcdc_atomic_check, .atomic_commit = tilcdc_commit, }; @@ -198,8 +192,7 @@ static void tilcdc_fini(struct drm_device *dev) drm_kms_helper_poll_fini(dev); - if (priv->fbdev) - drm_fbdev_cma_fini(priv->fbdev); + drm_fb_cma_fbdev_fini(dev); drm_irq_uninstall(dev); drm_mode_config_cleanup(dev); @@ -405,12 +398,9 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) drm_mode_config_reset(ddev); - priv->fbdev = drm_fbdev_cma_init(ddev, bpp, - ddev->mode_config.num_connector); - if (IS_ERR(priv->fbdev)) { - ret = PTR_ERR(priv->fbdev); + ret = drm_fb_cma_fbdev_init(ddev, bpp, 0); + if (ret) goto init_failed; - } drm_kms_helper_poll_init(ddev); @@ -427,12 +417,6 @@ init_failed: return ret; } -static void tilcdc_lastclose(struct drm_device *dev) -{ - struct tilcdc_drm_private *priv = dev->dev_private; - drm_fbdev_cma_restore_mode(priv->fbdev); -} - static irqreturn_t tilcdc_irq(int irq, void *arg) { struct drm_device *dev = arg; @@ -537,7 +521,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops); static struct drm_driver tilcdc_driver = { .driver_features = (DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC), - .lastclose = tilcdc_lastclose, + .lastclose = drm_fb_helper_lastclose, .irq_handler = tilcdc_irq, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_print_info = drm_gem_cma_print_info, diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h index 8caa11bc7aec..ead512216669 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h @@ -79,8 +79,6 @@ struct tilcdc_drm_private { struct workqueue_struct *wq; - struct drm_fbdev_cma *fbdev; - struct drm_crtc *crtc; unsigned int num_encoders; |