summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2017-12-15 18:51:13 +0100
committerNoralf Trønnes <noralf@tronnes.org>2017-12-20 14:50:19 +0100
commita65eb01ffcc50b42d1e4ea2e79c274e7f7a240c6 (patch)
treee67f9e3741bad8d02eccdb8b59fde4ed16b76905 /include/drm
parenteb393dbc8f5b2ca7c87749795fd49b8cf77ab04b (diff)
downloadlinux-stable-a65eb01ffcc50b42d1e4ea2e79c274e7f7a240c6.tar.gz
linux-stable-a65eb01ffcc50b42d1e4ea2e79c274e7f7a240c6.tar.bz2
linux-stable-a65eb01ffcc50b42d1e4ea2e79c274e7f7a240c6.zip
drm/fb-helper: Set/clear dev->fb_helper in dummy init/fini
Set dev->fb_helper even when fbdev emulation is compiled out, so drivers can use it to free the structure. Clear it for consistency. Fixes: 29ad20b22c8f ("drm: Add drm_device->fb_helper pointer") Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-2-noralf@tronnes.org
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_fb_helper.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 1494b12a984a..1bd624579db7 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -33,6 +33,7 @@
struct drm_fb_helper;
#include <drm/drm_crtc.h>
+#include <drm/drm_device.h>
#include <linux/kgdb.h>
enum mode_set_atomic {
@@ -332,11 +333,17 @@ static inline int drm_fb_helper_init(struct drm_device *dev,
struct drm_fb_helper *helper,
int max_conn)
{
+ /* So drivers can use it to free the struct */
+ helper->dev = dev;
+ dev->fb_helper = helper;
+
return 0;
}
static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
{
+ if (helper && helper->dev)
+ helper->dev->fb_helper = NULL;
}
static inline int drm_fb_helper_blank(int blank, struct fb_info *info)