[PATCH 13/16] drm/mgag200: Fix framebuffer pitch calculation

Egbert Eich eich at suse.com
Wed Jul 17 06:07:26 PDT 2013


From: Takashi Iwai <tiwai at suse.com>

The framebuffer pitch calculation needs to be done differently for bpp == 24
- check xf86-video-mga for reference.

Signed-off-by: Egbert Eich <eich at suse.de>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 020a623..c8983f9 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -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);
 
-- 
1.8.1.4



More information about the dri-devel mailing list