diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-08-18 14:19:34 -0600 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-08-18 14:19:34 -0600 |
commit | 38e868271bd24be7a884c8c56772b25cd6fa6f1d (patch) | |
tree | dfc6f8ab0e7f2c6c641d0bdb68cdaef5fa522b42 /src/lx_display.c | |
parent | d681a844e448712a9a419d2a4dca81930d39a80a (diff) |
lx: Add rotation for Randr 1.2 + cleanups
Enable rotation through RandR 1.2 and add the accelerated rotation blit
the EXA composite function. Also, fix a handful of critical bugs and
remove some more dead code.
Diffstat (limited to 'src/lx_display.c')
-rw-r--r-- | src/lx_display.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/lx_display.c b/src/lx_display.c index c53a9f5..fa74831 100644 --- a/src/lx_display.c +++ b/src/lx_display.c @@ -279,10 +279,16 @@ lx_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, vg_set_display_pitch(pGeode->Pitch); gp_set_bpp(pScrni->bitsPerPixel); + /* Set the acceleration offset if we are drawing to a shadow */ + if (crtc->rotatedData != NULL) + vg_set_display_offset((unsigned int)((char *)crtc->rotatedData - + (char *)pGeode->FBBase)); + else + vg_set_display_offset(0); + /* FIXME: Whats up with X and Y? Does that come into play * here? */ - vg_set_display_offset(0); df_configure_video_source(&vs_odd, &vs_even); vg_wait_vertical_blank(); @@ -358,7 +364,11 @@ lx_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height) if (lx_crtc->rotate_mem == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, - "Couldn't allocate shadow memory for rotated CRTC\n"); + "Couldn't allocate the shadow memory for rotation\n"); + xf86DrvMsg(pScrni->scrnIndex, X_ERROR, + " You need 0x%x bytes, but only 0x%x bytes are available\n", + size, GeodeOffscreenFreeSize(pGeode)); + return NULL; } @@ -370,16 +380,15 @@ static PixmapPtr lx_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { ScrnInfoPtr pScrni = crtc->scrn; + GeodeRec *pGeode = GEODEPTR(pScrni); PixmapPtr rpixmap; - unsigned int rpitch; if (!data) data = lx_crtc_shadow_allocate(crtc, width, height); - rpitch = pScrni->displayWidth * (pScrni->bitsPerPixel / 8); - rpixmap = GetScratchPixmapHeader(pScrni->pScreen, - width, height, pScrni->depth, pScrni->bitsPerPixel, rpitch, data); + width, height, pScrni->depth, pScrni->bitsPerPixel, pGeode->Pitch, + data); if (rpixmap == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, @@ -443,9 +452,7 @@ lx_crtc_hide_cursor(xf86CrtcPtr crtc) static void lx_crtc_load_cursor_image(xf86CrtcPtr crtc, unsigned char *src) { - ScrnInfoPtr pScrni = crtc->scrn; - - LXLoadCursorImage(pScrni, src); + LXLoadCursorImage(crtc->scrn, src); } static const xf86CrtcFuncsRec lx_crtc_funcs = { @@ -476,7 +483,7 @@ LXSetupCrtc(ScrnInfoPtr pScrni) crtc = xf86CrtcCreate(pScrni, &lx_crtc_funcs); if (crtc == NULL) { - ErrorF("ERROR - xf86CrtcCreate() fail %x\n", crtc); + ErrorF("ERROR - failed to create a CRTC\n"); return; } |