Skip to content

Commit

Permalink
drm/fb-helper: Set/clear dev->fb_helper in dummy init/fini
Browse files Browse the repository at this point in the history
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: 29ad20b ("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
  • Loading branch information
Noralf Trønnes committed Dec 20, 2017
1 parent eb393db commit a65eb01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/drm/drm_fb_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a65eb01

Please sign in to comment.