From ab39bf4513a99a4ecd5dd2a2eccb03432e24da51 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Mon, 18 Jun 2007 00:26:01 +0200 Subject: avivo: make scan out buffer witdh * bpp 256 bytes aligned X_LENGHT & Y_LENGHT is display buffer dimension (virtual dimension if they are bigger than display mode dimension) and pitch should be 256 bytes aligned. --- xorg/avivo.c | 3 +++ xorg/avivo_crtc.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'xorg') diff --git a/xorg/avivo.c b/xorg/avivo.c index f66853a..322a53d 100644 --- a/xorg/avivo.c +++ b/xorg/avivo.c @@ -741,6 +741,9 @@ avivo_screen_init(int index, ScreenPtr screen, int argc, char **argv) if (screen_info->virtualX > screen_info->displayWidth) screen_info->displayWidth = screen_info->virtualX; + screen_info->displayWidth = ceil(screen_info->displayWidth * avivo->bpp + / 256.0) * 256 / avivo->bpp; + /* mi layer */ miClearVisualTypes(); if (!xf86SetDefaultVisual(screen_info, -1)) { diff --git a/xorg/avivo_crtc.c b/xorg/avivo_crtc.c index 6f93dc6..612aeab 100644 --- a/xorg/avivo_crtc.c +++ b/xorg/avivo_crtc.c @@ -252,10 +252,11 @@ avivo_crtc_mode_set(xf86CrtcPtr crtc, OUTREG(AVIVO_CRTC1_65C0 + avivo_crtc->crtc_offset, AVIVO_CRTC1_65C0_VALUE); OUTREG(AVIVO_CRTC1_X_LENGTH + avivo_crtc->crtc_offset, - avivo_crtc->fb_width); + crtc->scrn->virtualX); OUTREG(AVIVO_CRTC1_Y_LENGTH + avivo_crtc->crtc_offset, - avivo_crtc->fb_height); - OUTREG(AVIVO_CRTC1_PITCH + avivo_crtc->crtc_offset, avivo_crtc->fb_pitch); + crtc->scrn->virtualY); + OUTREG(AVIVO_CRTC1_PITCH + avivo_crtc->crtc_offset, + crtc->scrn->displayWidth); OUTREG(AVIVO_CRTC1_H_TOTAL + avivo_crtc->crtc_offset, avivo_crtc->h_total); OUTREG(AVIVO_CRTC1_H_BLANK + avivo_crtc->crtc_offset, avivo_crtc->h_blank); OUTREG(AVIVO_CRTC1_H_SYNC_WID + avivo_crtc->crtc_offset, -- cgit v1.2.3