Commit da558398 authored by Takashi Iwai's avatar Takashi Iwai Committed by Dave Airlie

drm/mgag200: Fix framebuffer pitch calculation

The framebuffer pitch calculation needs to be done differently for bpp == 24
- check xf86-video-mga for reference.
Signed-off-by: default avatarEgbert Eich <eich@suse.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 3d5a1c5e
...@@ -877,7 +877,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, ...@@ -877,7 +877,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,
pitch = crtc->fb->pitches[0] / (crtc->fb->bits_per_pixel / 8); pitch = crtc->fb->pitches[0] / (crtc->fb->bits_per_pixel / 8);
if (crtc->fb->bits_per_pixel == 24) if (crtc->fb->bits_per_pixel == 24)
pitch = pitch >> (4 - bppshift); pitch = (pitch * 3) >> (4 - bppshift);
else else
pitch = pitch >> (4 - bppshift); pitch = pitch >> (4 - bppshift);
......
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