Commit d18df744 authored by Noralf Trønnes's avatar Noralf Trønnes

drm/pl111: 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: Eric Anholt <eric@anholt.net>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171115142001.45358-11-noralf@tronnes.org
parent b2ad9472
...@@ -53,7 +53,6 @@ struct pl111_drm_dev_private { ...@@ -53,7 +53,6 @@ struct pl111_drm_dev_private {
struct drm_panel *panel; struct drm_panel *panel;
struct drm_bridge *bridge; struct drm_bridge *bridge;
struct drm_simple_display_pipe pipe; struct drm_simple_display_pipe pipe;
struct drm_fbdev_cma *fbdev;
void *regs; void *regs;
u32 ienb; u32 ienb;
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc_helper.h>
#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_cma_helper.h>
#include <drm/drm_of.h> #include <drm/drm_of.h>
#include <drm/drm_bridge.h> #include <drm/drm_bridge.h>
...@@ -137,8 +138,7 @@ static int pl111_modeset_init(struct drm_device *dev) ...@@ -137,8 +138,7 @@ static int pl111_modeset_init(struct drm_device *dev)
drm_mode_config_reset(dev); drm_mode_config_reset(dev);
priv->fbdev = drm_fbdev_cma_init(dev, 32, drm_fb_cma_fbdev_init(dev, 32, 0);
dev->mode_config.num_connector);
drm_kms_helper_poll_init(dev); drm_kms_helper_poll_init(dev);
...@@ -155,17 +155,10 @@ static int pl111_modeset_init(struct drm_device *dev) ...@@ -155,17 +155,10 @@ static int pl111_modeset_init(struct drm_device *dev)
DEFINE_DRM_GEM_CMA_FOPS(drm_fops); DEFINE_DRM_GEM_CMA_FOPS(drm_fops);
static void pl111_lastclose(struct drm_device *dev)
{
struct pl111_drm_dev_private *priv = dev->dev_private;
drm_fbdev_cma_restore_mode(priv->fbdev);
}
static struct drm_driver pl111_drm_driver = { static struct drm_driver pl111_drm_driver = {
.driver_features = .driver_features =
DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC, DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC,
.lastclose = pl111_lastclose, .lastclose = drm_fb_helper_lastclose,
.ioctls = NULL, .ioctls = NULL,
.fops = &drm_fops, .fops = &drm_fops,
.name = "pl111", .name = "pl111",
...@@ -281,8 +274,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev) ...@@ -281,8 +274,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
struct pl111_drm_dev_private *priv = drm->dev_private; struct pl111_drm_dev_private *priv = drm->dev_private;
drm_dev_unregister(drm); drm_dev_unregister(drm);
if (priv->fbdev) drm_fb_cma_fbdev_fini(drm);
drm_fbdev_cma_fini(priv->fbdev);
if (priv->panel) if (priv->panel)
drm_panel_bridge_remove(priv->bridge); drm_panel_bridge_remove(priv->bridge);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment