drm: Populate fb->dev from drm_helper_mode_fill_fb_struct()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 18 Nov 2016 19:52:54 +0000 (21:52 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 15 Dec 2016 12:55:29 +0000 (14:55 +0200)
commit95bce76015819e546528c13fe25d31771427c9d5
treea9174c6399227ee146cfba4b4115d53cb6b009f4
parentd2e9f5fcc646d3b2e41cfef79b3c8e720d28e230
drm: Populate fb->dev from drm_helper_mode_fill_fb_struct()

Populating fb->dev before drm_framebuffer_init() allows us to use
fb->dev already while validating the framebuffer. Let's have
drm_helper_mode_fill_fb_struct() do that for us.

Also make drm_framebuffer_init() warn us if a different device
pointer is passed to it than was passed to
drm_helper_mode_fill_fb_struct().

v2: Reject fbs with invalid fb->dev (Laurent)

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-19-git-send-email-ville.syrjala@linux.intel.com
drivers/gpu/drm/drm_framebuffer.c
drivers/gpu/drm/drm_modeset_helper.c