Skip to content

Commit

Permalink
drm/mgag200: Fix framebuffer pitch calculation
Browse files Browse the repository at this point in the history
The framebuffer pitch calculation needs to be done differently for bpp == 24
- check xf86-video-mga for reference.

Signed-off-by: Egbert Eich <eich@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Takashi Iwai authored and Dave Airlie committed Jul 29, 2013
1 parent 3d5a1c5 commit da55839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mgag200/mgag200_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (crtc->fb->bits_per_pixel == 24)
pitch = pitch >> (4 - bppshift);
pitch = (pitch * 3) >> (4 - bppshift);
else
pitch = pitch >> (4 - bppshift);

Expand Down

0 comments on commit da55839

Please sign in to comment.