提交 6c5d064a 编写于 作者: L Laurent Pinchart 提交者: Archit Taneja

drm: vmwgfx: Replace drm_fb_get_bpp_depth() with drm_format_info()

The driver is the last users of the drm_fb_get_bpp_depth() function. It
should ideally be converted to use struct drm_mode_fb_cmd2 instead of
the legacy struct drm_mode_fb_cmd internally, but that will require
broad changes across the code base. As a first step, replace
drm_fb_get_bpp_depth() with drm_format_info() in order to stop exporting
the function to drivers.

The new DRM_ERROR() message comes from the vmw_create_dmabuf_proxy(),
vmw_kms_new_framebuffer_surface() and vmw_kms_new_framebuffer_dmabuf()
functions that currently print an error if the pixel format is
unsupported.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: NSinclair Yeh <syeh@vmware.com>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NArchit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1476744081-24485-12-git-send-email-laurent.pinchart@ideasonboard.com
上级 802aaf76
...@@ -980,14 +980,22 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, ...@@ -980,14 +980,22 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
struct vmw_dma_buffer *bo = NULL; struct vmw_dma_buffer *bo = NULL;
struct ttm_base_object *user_obj; struct ttm_base_object *user_obj;
struct drm_mode_fb_cmd mode_cmd; struct drm_mode_fb_cmd mode_cmd;
const struct drm_format_info *info;
int ret; int ret;
info = drm_format_info(mode_cmd2->pixel_format);
if (!info || !info->depth) {
DRM_ERROR("Unsupported framebuffer format %s\n",
drm_get_format_name(mode_cmd2->pixel_format));
return ERR_PTR(-EINVAL);
}
mode_cmd.width = mode_cmd2->width; mode_cmd.width = mode_cmd2->width;
mode_cmd.height = mode_cmd2->height; mode_cmd.height = mode_cmd2->height;
mode_cmd.pitch = mode_cmd2->pitches[0]; mode_cmd.pitch = mode_cmd2->pitches[0];
mode_cmd.handle = mode_cmd2->handles[0]; mode_cmd.handle = mode_cmd2->handles[0];
drm_fb_get_bpp_depth(mode_cmd2->pixel_format, &mode_cmd.depth, mode_cmd.depth = info->depth;
&mode_cmd.bpp); mode_cmd.bpp = info->cpp[0] * 8;
/** /**
* This code should be conditioned on Screen Objects not being used. * This code should be conditioned on Screen Objects not being used.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册