diff options
author | Sinclair Yeh <syeh@vmware.com> | 2017-01-18 23:14:01 +0100 |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2017-01-27 04:53:34 +0100 |
commit | 242ef5d483594a2bed6b8a2685849c83e7810d17 (patch) | |
tree | 7ed12099198823ccb1d41180be6b85cee5ecce3f /drivers | |
parent | Revert "drm/probe-helpers: Drop locking from poll_enable" (diff) | |
download | linux-242ef5d483594a2bed6b8a2685849c83e7810d17.tar.xz linux-242ef5d483594a2bed6b8a2685849c83e7810d17.zip |
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: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 723fd763da8e..7a96798b9c0a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info) mode_cmd.height = var->yres; mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; mode_cmd.pixel_format = - drm_mode_legacy_fb_format(var->bits_per_pixel, - ((var->bits_per_pixel + 7) / 8) * mode_cmd.width); + drm_mode_legacy_fb_format(var->bits_per_pixel, depth); cur_fb = par->set_fb; if (cur_fb && cur_fb->width == mode_cmd.width && |