aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2017-11-15 09:19:55 -0500
committerNoralf Trønnes <noralf@tronnes.org>2017-12-08 08:47:42 -0500
commit4f054fcf4779a70888a397aa2e5a662e72e9b9e8 (patch)
treeed3097f6ec2f8fb064b383a588a926fb037a62f0
parent50b45f2137243712e8d7e0c3abcc700827fed0db (diff)
drm/tve200: 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: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20171115142001.45358-17-noralf@tronnes.org
-rw-r--r--drivers/gpu/drm/tve200/tve200_drm.h1
-rw-r--r--drivers/gpu/drm/tve200/tve200_drv.c16
2 files changed, 4 insertions, 13 deletions
diff --git a/drivers/gpu/drm/tve200/tve200_drm.h b/drivers/gpu/drm/tve200/tve200_drm.h
index 628b79324c48..5c270055bd58 100644
--- a/drivers/gpu/drm/tve200/tve200_drm.h
+++ b/drivers/gpu/drm/tve200/tve200_drm.h
@@ -103,7 +103,6 @@ struct tve200_drm_dev_private {
103 struct drm_panel *panel; 103 struct drm_panel *panel;
104 struct drm_bridge *bridge; 104 struct drm_bridge *bridge;
105 struct drm_simple_display_pipe pipe; 105 struct drm_simple_display_pipe pipe;
106 struct drm_fbdev_cma *fbdev;
107 106
108 void *regs; 107 void *regs;
109 struct clk *pclk; 108 struct clk *pclk;
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index bd6c9454d767..44911d921864 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -46,6 +46,7 @@
46#include <drm/drm_crtc_helper.h> 46#include <drm/drm_crtc_helper.h>
47#include <drm/drm_gem_cma_helper.h> 47#include <drm/drm_gem_cma_helper.h>
48#include <drm/drm_gem_framebuffer_helper.h> 48#include <drm/drm_gem_framebuffer_helper.h>
49#include <drm/drm_fb_helper.h>
49#include <drm/drm_fb_cma_helper.h> 50#include <drm/drm_fb_cma_helper.h>
50#include <drm/drm_panel.h> 51#include <drm/drm_panel.h>
51#include <drm/drm_of.h> 52#include <drm/drm_of.h>
@@ -130,8 +131,7 @@ static int tve200_modeset_init(struct drm_device *dev)
130 * Passing in 16 here will make the RGB656 mode the default 131 * Passing in 16 here will make the RGB656 mode the default
131 * Passing in 32 will use XRGB8888 mode 132 * Passing in 32 will use XRGB8888 mode
132 */ 133 */
133 priv->fbdev = drm_fbdev_cma_init(dev, 16, 134 drm_fb_cma_fbdev_init(dev, 16, 0);
134 dev->mode_config.num_connector);
135 drm_kms_helper_poll_init(dev); 135 drm_kms_helper_poll_init(dev);
136 136
137 goto finish; 137 goto finish;
@@ -146,17 +146,10 @@ finish:
146 146
147DEFINE_DRM_GEM_CMA_FOPS(drm_fops); 147DEFINE_DRM_GEM_CMA_FOPS(drm_fops);
148 148
149static void tve200_lastclose(struct drm_device *dev)
150{
151 struct tve200_drm_dev_private *priv = dev->dev_private;
152
153 drm_fbdev_cma_restore_mode(priv->fbdev);
154}
155
156static struct drm_driver tve200_drm_driver = { 149static struct drm_driver tve200_drm_driver = {
157 .driver_features = 150 .driver_features =
158 DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC, 151 DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC,
159 .lastclose = tve200_lastclose, 152 .lastclose = drm_fb_helper_lastclose,
160 .ioctls = NULL, 153 .ioctls = NULL,
161 .fops = &drm_fops, 154 .fops = &drm_fops,
162 .name = "tve200", 155 .name = "tve200",
@@ -270,8 +263,7 @@ static int tve200_remove(struct platform_device *pdev)
270 struct tve200_drm_dev_private *priv = drm->dev_private; 263 struct tve200_drm_dev_private *priv = drm->dev_private;
271 264
272 drm_dev_unregister(drm); 265 drm_dev_unregister(drm);
273 if (priv->fbdev) 266 drm_fb_cma_fbdev_fini(drm);
274 drm_fbdev_cma_fini(priv->fbdev);
275 if (priv->panel) 267 if (priv->panel)
276 drm_panel_bridge_remove(priv->bridge); 268 drm_panel_bridge_remove(priv->bridge);
277 drm_mode_config_cleanup(drm); 269 drm_mode_config_cleanup(drm);