Commit e14c23c6 authored by Ville Syrjälä's avatar Ville Syrjälä

drm: Store a pointer to drm_format_info under drm_framebuffer

To avoid having to look up the format information struct every time,
let's just store a pointer to it under drm_framebuffer.

v2: Don't populate the fb->format pointer in drm_framebuffer_init().
    instead we'll treat a NULL format as an error later

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-20-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 95bce760
...@@ -91,6 +91,7 @@ void drm_helper_mode_fill_fb_struct(struct drm_device *dev, ...@@ -91,6 +91,7 @@ void drm_helper_mode_fill_fb_struct(struct drm_device *dev,
} }
fb->dev = dev; fb->dev = dev;
fb->format = info;
fb->width = mode_cmd->width; fb->width = mode_cmd->width;
fb->height = mode_cmd->height; fb->height = mode_cmd->height;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
......
...@@ -121,6 +121,10 @@ struct drm_framebuffer { ...@@ -121,6 +121,10 @@ struct drm_framebuffer {
* @base: base modeset object structure, contains the reference count. * @base: base modeset object structure, contains the reference count.
*/ */
struct drm_mode_object base; struct drm_mode_object base;
/**
* @format: framebuffer format information
*/
const struct drm_format_info *format;
/** /**
* @funcs: framebuffer vfunc table * @funcs: framebuffer vfunc table
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment