mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
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
This commit is contained in:
parent
d2e9f5fcc6
commit
95bce76015
2 changed files with 5 additions and 1 deletions
|
@ -631,8 +631,11 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (WARN_ON_ONCE(fb->dev != dev))
|
||||
return -EINVAL;
|
||||
|
||||
INIT_LIST_HEAD(&fb->filp_head);
|
||||
fb->dev = dev;
|
||||
|
||||
fb->funcs = funcs;
|
||||
|
||||
ret = drm_mode_object_get_reg(dev, &fb->base, DRM_MODE_OBJECT_FB,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue