提交 242ef5d4 编写于 作者: S Sinclair Yeh

drm/vmwgfx: Fix depth input into drm_mode_legacy_fb_format

Currently the pitch is passed in as depth.  This causes
drm_mode_legacy_fb_format() to return the wrong pixel format.

The wrong pixel format will be rejected by vmw_kms_new_framebuffer(),
thus leaving par->set_fb to NULL.

This eventually causes a crash in vmw_fb_setcolreg() when the code
tries to dereference par->set_fb.
Signed-off-by: NSinclair Yeh <syeh@vmware.com>
Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
上级 54a07c7b
...@@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info) ...@@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info)
mode_cmd.height = var->yres; mode_cmd.height = var->yres;
mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width;
mode_cmd.pixel_format = mode_cmd.pixel_format =
drm_mode_legacy_fb_format(var->bits_per_pixel, drm_mode_legacy_fb_format(var->bits_per_pixel, depth);
((var->bits_per_pixel + 7) / 8) * mode_cmd.width);
cur_fb = par->set_fb; cur_fb = par->set_fb;
if (cur_fb && cur_fb->width == mode_cmd.width && if (cur_fb && cur_fb->width == mode_cmd.width &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册