configure.ac | 8 ++ src/AtomBios/includes/CD_Common_Types.h | 4 + src/atombios_crtc.c | 2 src/atombios_output.c | 94 ++++++++++++++++---------------- src/legacy_output.c | 4 - src/radeon_accel.c | 2 src/radeon_atombios.c | 24 ++++---- src/radeon_commonfuncs.c | 25 +++++--- src/radeon_crtc.c | 16 +++++ src/radeon_cursor.c | 31 +++++++++- src/radeon_driver.c | 44 ++++++++++++++ src/radeon_exa.c | 4 - src/radeon_exa_funcs.c | 7 ++ src/radeon_exa_render.c | 22 ++++--- src/radeon_output.c | 53 ++++++++++++++++++ src/radeon_probe.h | 4 + src/radeon_reg.h | 21 ++++++- src/radeon_textured_video.c | 2 src/radeon_textured_videofuncs.c | 2 src/radeon_video.c | 17 ++++- 20 files changed, 286 insertions(+), 100 deletions(-)
New commits: commit 94bf8f01bd43cb103fffecfe04d04a214f892baf Author: Dave Airlie <[EMAIL PROTECTED]> Date: Mon May 12 20:02:51 2008 +1000 radeon: fix set_cursor_colours remove fb offset diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index 42f9a85..d68d64b 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -256,7 +256,7 @@ radeon_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg) ScrnInfoPtr pScrn = crtc->scrn; RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(pScrn); - CARD32 *pixels = (CARD32 *)(pointer)(info->FB + radeon_crtc->cursor_offset + pScrn->fbOffset); + CARD32 *pixels = (CARD32 *)(pointer)(info->FB + radeon_crtc->cursor_offset); int pixel, i; CURSOR_SWAPPING_DECL_MMIO commit 1d0f1d31e2ed1d91ee87cb3e02ce48c8c07aa418 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Mon May 12 15:44:35 2008 +1000 radeon: rs485 vs rs485m.. mobile? non-mobile? bi? So it appears we have in the wild two chipsets with the same PCI ID (0x1002:0x5974) that are mobile and non-mobile. the RH bug references is a desktop system. The Dell Vostro 1100 also has this chipset with LVDS bits. diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 2701f57..2acc1e9 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1624,6 +1624,13 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DELL server detected, force to special setup\n"); } break; + case PCI_CHIP_RS482_5974: + /* RH BZ 444586 - non mobility version + * Dell appear to have the Vostro 1100 with a mobility part with the same pci-id */ + if ((PCI_SUB_VENDOR_ID(info->PciInfo) == 0x1462) && + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x7141)) { + info->IsMobility = FALSE; + } default: break; } commit 25e0c3945a51ae8c14b3a847ec75a256e1397f24 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Mon May 12 10:28:33 2008 +1000 radeon: add initial support for cloning outputs. (single-CRTC cards only) airlied - This code was originally written by Alex, and I've modified it to only run on single-CRTC cards for now until we can test it some more. diff --git a/src/radeon_output.c b/src/radeon_output.c index 907d824..9b2494b 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -2676,10 +2676,48 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn) #endif /* __powerpc__ */ +static int +radeon_output_clones (ScrnInfoPtr pScrn, xf86OutputPtr output) +{ + RADEONOutputPrivatePtr radeon_output = output->driver_private; + RADEONEntPtr pRADEONEnt = RADEONEntPriv(output->scrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (pScrn); + int o; + int index_mask = 0; + + /* + * cards without a CRTC2 really need cloning enabled + * for cards with 2 CRTC this may need more testing + */ + if (pRADEONEnt->HasCRTC2) + return index_mask; + + /* LVDS is too wacky */ + if (radeon_output->type == OUTPUT_LVDS) + return index_mask; + + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr clone = config->output[o]; + RADEONOutputPrivatePtr radeon_clone = clone->driver_private; + if (output == clone) /* don't clone yourself */ + continue; + else if (radeon_clone->type == OUTPUT_LVDS) /* LVDS */ + continue; + else if ((radeon_output->DACType == DAC_TVDAC) && + (radeon_clone->DACType == DAC_TVDAC)) /* shared tvdac */ + continue; + else + index_mask |= (1 << o); + } + + return index_mask; +} + /* * initialise the static data sos we don't have to re-do at randr change */ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); RADEONInfoPtr info = RADEONPTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); xf86OutputPtr output; @@ -2881,6 +2919,12 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) } } + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + + output->possible_clones = radeon_output_clones(pScrn, output); + } + return TRUE; } commit 94405eb1c9e4e0ababc6aef03b753d6ed9eb7838 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Fri May 9 05:28:44 2008 -0400 RADEON: fixup ifdef from last commit diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index ab890ad..1a55e28 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -537,9 +537,11 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration " "unsupported on R600 and newer cards.\n"); else if (IS_R300_3D || IS_R500_3D) { + if ((info->ChipFamily < CHIP_FAMILY_RS400) #ifdef XF86DRI - if ((info->ChipFamily < CHIP_FAMILY_RS400) || (info->directRenderingEnabled)) { + || (info->directRenderingEnabled) #endif + ) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration " "enabled for R300/R400/R500 type cards.\n"); info->exa->CheckComposite = R300CheckComposite; @@ -547,10 +549,8 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) FUNC_NAME(R300PrepareComposite); info->exa->Composite = FUNC_NAME(RadeonComposite); info->exa->DoneComposite = FUNC_NAME(RadeonDoneComposite); -#ifdef XF86DRI } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EXA Composite requires CP on R5xx/IGP\n"); -#endif } else if ((info->ChipFamily == CHIP_FAMILY_RV250) || (info->ChipFamily == CHIP_FAMILY_RV280) || (info->ChipFamily == CHIP_FAMILY_RS300) || diff --git a/src/radeon_video.c b/src/radeon_video.c index 1c13dcd..4cd3513 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -286,19 +286,19 @@ void RADEONInitVideo(ScreenPtr pScreen) } if (info->ChipFamily != CHIP_FAMILY_RV250) { + if ((info->ChipFamily < CHIP_FAMILY_RS400) #ifdef XF86DRI - if ((info->ChipFamily < CHIP_FAMILY_RS400) || (info->directRenderingEnabled)) { + || (info->directRenderingEnabled) #endif - texturedAdaptor = RADEONSetupImageTexturedVideo(pScreen); - if (texturedAdaptor != NULL) { - adaptors[num_adaptors++] = texturedAdaptor; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up textured video\n"); + ) { + texturedAdaptor = RADEONSetupImageTexturedVideo(pScreen); + if (texturedAdaptor != NULL) { + adaptors[num_adaptors++] = texturedAdaptor; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up textured video\n"); + } else + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set up textured video\n"); } else - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set up textured video\n"); -#ifdef XF86DRI - } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textured video requires CP on R5xx/IGP\n"); -#endif } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textured video disabled on RV250 due to HW bug\n"); commit 18e20bc22a55ecfee9798c01079d7b24d19f0051 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Thu May 8 08:45:51 2008 -0400 RADEON: disable MMIO paths for EXA composite/texvid on IGP/R5xx The MMIO paths eventually lead to a hang on r5xx/IGP. I haven't been able to find out why yet. diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index 272ffa9..ab890ad 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -537,6 +537,9 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration " "unsupported on R600 and newer cards.\n"); else if (IS_R300_3D || IS_R500_3D) { +#ifdef XF86DRI + if ((info->ChipFamily < CHIP_FAMILY_RS400) || (info->directRenderingEnabled)) { +#endif xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration " "enabled for R300/R400/R500 type cards.\n"); info->exa->CheckComposite = R300CheckComposite; @@ -544,6 +547,10 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) FUNC_NAME(R300PrepareComposite); info->exa->Composite = FUNC_NAME(RadeonComposite); info->exa->DoneComposite = FUNC_NAME(RadeonDoneComposite); +#ifdef XF86DRI + } else + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EXA Composite requires CP on R5xx/IGP\n"); +#endif } else if ((info->ChipFamily == CHIP_FAMILY_RV250) || (info->ChipFamily == CHIP_FAMILY_RV280) || (info->ChipFamily == CHIP_FAMILY_RS300) || diff --git a/src/radeon_video.c b/src/radeon_video.c index 216cd65..1c13dcd 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -286,12 +286,19 @@ void RADEONInitVideo(ScreenPtr pScreen) } if (info->ChipFamily != CHIP_FAMILY_RV250) { +#ifdef XF86DRI + if ((info->ChipFamily < CHIP_FAMILY_RS400) || (info->directRenderingEnabled)) { +#endif texturedAdaptor = RADEONSetupImageTexturedVideo(pScreen); if (texturedAdaptor != NULL) { adaptors[num_adaptors++] = texturedAdaptor; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up textured video\n"); } else xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set up textured video\n"); +#ifdef XF86DRI + } else + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textured video requires CP on R5xx/IGP\n"); +#endif } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textured video disabled on RV250 due to HW bug\n"); commit c3532268875fd24e6519bea2fb1b814d612bbdb4 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 02:37:18 2008 +1000 radeon: fix zaphod EXA with texture video diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 9e5fc5b..fa6ac0d 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -402,7 +402,7 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) else screen_size = pScrn->virtualY * byteStride; - info->exa->memoryBase = info->FB + pScrn->fbOffset; + info->exa->memoryBase = info->FB; info->exa->memorySize = info->FbMapSize - info->FbSecureSize; info->exa->offScreenBase = screen_size; diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c index 0a6598d..5d153e7 100644 --- a/src/radeon_textured_video.c +++ b/src/radeon_textured_video.c @@ -226,7 +226,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn, left = (x1 >> 16) & ~1; npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; - pPriv->src_offset = pPriv->video_offset + info->fbLocation; + pPriv->src_offset = pPriv->video_offset + info->fbLocation + pScrn->fbOffset; pPriv->src_addr = (CARD8 *)(info->FB + pPriv->video_offset + (top * dstPitch)); pPriv->src_pitch = dstPitch; pPriv->size = size; commit ffc437f3606ab8ceba1ff152e4bb08988a58b54c Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 02:30:28 2008 +1000 avivo: fix zaphod cursor in theory diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index 983aefb..42f9a85 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -92,6 +92,7 @@ static void avivo_setup_cursor(xf86CrtcPtr crtc, Bool enable) { + ScrnInfoPtr pScrn = crtc->scrn; RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(crtc->scrn); unsigned char *RADEONMMIO = info->MMIO; @@ -100,7 +101,7 @@ avivo_setup_cursor(xf86CrtcPtr crtc, Bool enable) if (enable) { OUTREG(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, - info->fbLocation + radeon_crtc->cursor_offset); + info->fbLocation + radeon_crtc->cursor_offset + pScrn->fbOffset); OUTREG(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset, ((CURSOR_WIDTH - 1) << 16) | (CURSOR_HEIGHT - 1)); OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset, commit e36ef14e3a1087e1fe41baa26ade2937f396001f Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 01:39:28 2008 +1000 radeon: fix textured-xv on zaphod diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c index f7069f0..b0286a6 100644 --- a/src/radeon_textured_videofuncs.c +++ b/src/radeon_textured_videofuncs.c @@ -88,7 +88,7 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv #ifdef USE_EXA if (info->useEXA) { - dst_offset = exaGetPixmapOffset(pPixmap) + info->fbLocation; + dst_offset = exaGetPixmapOffset(pPixmap) + info->fbLocation + pScrn->fbOffset; dst_pitch = exaGetPixmapPitch(pPixmap); } else #endif commit 8fc19bee27c0f151d2ab3354f6ac0992b358436d Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 01:38:24 2008 +1000 radeon: zaphod: fix render accel for EXA diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c index ec3c06d..54b0272 100644 --- a/src/radeon_exa_render.c +++ b/src/radeon_exa_render.c @@ -362,7 +362,7 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix, ACCEL_PREAMBLE(); txpitch = exaGetPixmapPitch(pPix); - txoffset = exaGetPixmapOffset(pPix) + info->fbLocation; + txoffset = exaGetPixmapOffset(pPix) + info->fbLocation + pScrn->fbOffset; if ((txoffset & 0x1f) != 0) RADEON_FALLBACK(("Bad texture offset 0x%x\n", (int)txoffset)); @@ -544,13 +544,13 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op, pixel_shift = pDst->drawable.bitsPerPixel >> 4; - dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation; + dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset; dst_pitch = exaGetPixmapPitch(pDst); colorpitch = dst_pitch >> pixel_shift; if (RADEONPixmapIsColortiled(pDst)) colorpitch |= RADEON_COLOR_TILE_ENABLE; - dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation; + dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset; dst_pitch = exaGetPixmapPitch(pDst); if ((dst_offset & 0x0f) != 0) RADEON_FALLBACK(("Bad destination offset 0x%x\n", (int)dst_offset)); @@ -675,7 +675,7 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix, ACCEL_PREAMBLE(); txpitch = exaGetPixmapPitch(pPix); - txoffset = exaGetPixmapOffset(pPix) + info->fbLocation; + txoffset = exaGetPixmapOffset(pPix) + info->fbLocation + pScrn->fbOffset; if ((txoffset & 0x1f) != 0) RADEON_FALLBACK(("Bad texture offset 0x%x\n", (int)txoffset)); @@ -843,7 +843,7 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture, pixel_shift = pDst->drawable.bitsPerPixel >> 4; - dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation; + dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset; dst_pitch = exaGetPixmapPitch(pDst); colorpitch = dst_pitch >> pixel_shift; if (RADEONPixmapIsColortiled(pDst)) @@ -1001,7 +1001,7 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix, TRACE; txpitch = exaGetPixmapPitch(pPix); - txoffset = exaGetPixmapOffset(pPix) + info->fbLocation; + txoffset = exaGetPixmapOffset(pPix) + info->fbLocation + pScrn->fbOffset; if ((txoffset & 0x1f) != 0) RADEON_FALLBACK(("Bad texture offset 0x%x\n", (int)txoffset)); @@ -1198,7 +1198,7 @@ static Bool FUNC_NAME(R300PrepareComposite)(int op, PicturePtr pSrcPicture, pixel_shift = pDst->drawable.bitsPerPixel >> 4; - dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation; + dst_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset; dst_pitch = exaGetPixmapPitch(pDst); colorpitch = dst_pitch >> pixel_shift; commit fc41b9042a5220a8419cc7b69ca3850cae6b903c Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 01:32:23 2008 +1000 radeon: fix EXA pixmap offset on zaphod diff --git a/src/radeon_exa.c b/src/radeon_exa.c index a6ededa..9e5fc5b 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -189,7 +189,7 @@ Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix, CARD32 *pitch_offset) if (bpp == 24) bpp = 8; - offset = exaGetPixmapOffset(pPix) + info->fbLocation; + offset = exaGetPixmapOffset(pPix) + info->fbLocation + pScrn->fbOffset; pitch = exaGetPixmapPitch(pPix); return RADEONGetOffsetPitch(pPix, bpp, pitch_offset, offset, pitch); commit 4568cb820d567c6909a4be956d7e79b91232535e Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 01:19:39 2008 +1000 radeon: zaphod fixes for pciaccess not allowing multiple MMIO maps diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 202a190..2701f57 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -357,6 +357,12 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn) static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + + if (pRADEONEnt->MMIO) { + info->MMIO = pRADEONEnt->MMIO; + return TRUE; + } #ifndef XSERVER_LIBPCIACCESS @@ -367,7 +373,6 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) info->MMIOSize); if (!info->MMIO) return FALSE; - #else void** result = (void**)&info->MMIO; @@ -386,6 +391,7 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) #endif + pRADEONEnt->MMIO = info->MMIO; return TRUE; } @@ -395,6 +401,13 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) static Bool RADEONUnmapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + + if (info->IsPrimary || info->IsSecondary) { + /* never unmap on zaphod */ + info->MMIO = NULL; + return TRUE; + } #ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->MMIO, info->MMIOSize); @@ -402,6 +415,7 @@ static Bool RADEONUnmapMMIO(ScrnInfoPtr pScrn) pci_device_unmap_range(info->PciInfo, info->MMIO, info->MMIOSize); #endif + pRADEONEnt->MMIO = NULL; info->MMIO = NULL; return TRUE; } diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 7983970..f03e997 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -588,6 +588,7 @@ typedef struct RADEONSaveRec ModeReg; /* Current mode */ RADEONSaveRec SavedReg; /* Original (text) mode */ + void *MMIO; /* Map of MMIO region */ } RADEONEntRec, *RADEONEntPtr; /* radeon_probe.c */ commit ca81fa086b21633a7fd926833fb6d1d4fa080646 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed May 7 01:12:01 2008 +1000 radeon: zaphod fix for cursor on second head We don't need to add fbOffset here as the mmap we have of the framebuffer starts half way. diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index b82484e..983aefb 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -298,7 +298,7 @@ radeon_crtc_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(pScrn); CURSOR_SWAPPING_DECL_MMIO - CARD32 *d = (CARD32 *)(pointer)(info->FB + radeon_crtc->cursor_offset + pScrn->fbOffset); + CARD32 *d = (CARD32 *)(pointer)(info->FB + radeon_crtc->cursor_offset); RADEONCTRACE(("RADEONLoadCursorARGB\n")); commit 24b60c8965f6a0b3f0c2bb1e7236b4d6642c5918 Author: Julien Cristau <[EMAIL PROTECTED]> Date: Fri May 2 15:30:45 2008 -0400 Add a test for __GLIBC__ to CD_Common_Types.h. Atombios redefines the standard types but the definitions conflict with the ones from glibc (causes build failures on GNU/Hurd and GNU/kFreeBSD). diff --git a/src/AtomBios/includes/CD_Common_Types.h b/src/AtomBios/includes/CD_Common_Types.h index e80be23..c60b652 100644 --- a/src/AtomBios/includes/CD_Common_Types.h +++ b/src/AtomBios/includes/CD_Common_Types.h @@ -51,7 +51,9 @@ Revision History: // typedef __int64 int64_t; typedef unsigned __int32 uint32_t; typedef __int32 int32_t; -#elif defined (__linux__) || defined (__NetBSD__) || defined(__sun) || defined(__OpenBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) +#elif defined (__linux__) || defined (__NetBSD__) \ + || defined(__sun) || defined(__OpenBSD__) \ + || defined (__FreeBSD__) || defined(__DragonFly__) || defined(__GLIBC__) typedef unsigned int uint32_t; typedef int int32_t; #else commit f051359ac09c6b9416e39b9ca7d9dc0880aa1557 Author: thegraze <[EMAIL PROTECTED]> Date: Fri May 2 14:02:16 2008 -0400 ATOM: add support for DragonFlyBSD diff --git a/src/AtomBios/includes/CD_Common_Types.h b/src/AtomBios/includes/CD_Common_Types.h index bc18c42..e80be23 100644 --- a/src/AtomBios/includes/CD_Common_Types.h +++ b/src/AtomBios/includes/CD_Common_Types.h @@ -51,7 +51,7 @@ Revision History: // typedef __int64 int64_t; typedef unsigned __int32 uint32_t; typedef __int32 int32_t; -#elif defined (__linux__) || defined (__NetBSD__) || defined(__sun) || defined(__OpenBSD__) || defined (__FreeBSD__) +#elif defined (__linux__) || defined (__NetBSD__) || defined(__sun) || defined(__OpenBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) typedef unsigned int uint32_t; typedef int int32_t; #else commit 3d469cbc3225d890a895dac7cbc1ab7e08054b48 Author: Alex Deucher <[EMAIL PROTECTED](none)> Date: Wed Apr 30 18:33:04 2008 -0400 RADEON: lock the cursors when updating this should fix occasional corruption seen when updating the cursor. diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index de64dee..b82484e 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -108,6 +108,24 @@ avivo_setup_cursor(xf86CrtcPtr crtc, Bool enable) } } +static void +avivo_lock_cursor(xf86CrtcPtr crtc, Bool lock) +{ + RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; + RADEONInfoPtr info = RADEONPTR(crtc->scrn); + unsigned char *RADEONMMIO = info->MMIO; + CARD32 tmp; + + tmp = INREG(AVIVO_D1CUR_UPDATE + radeon_crtc->crtc_offset); + + if (lock) + tmp |= AVIVO_D1CURSOR_UPDATE_LOCK; + else + tmp &= ~AVIVO_D1CURSOR_UPDATE_LOCK; + + OUTREG(AVIVO_D1CUR_UPDATE + radeon_crtc->crtc_offset, tmp); +} + void radeon_crtc_show_cursor (xf86CrtcPtr crtc) { @@ -118,10 +136,12 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc) unsigned char *RADEONMMIO = info->MMIO; if (IS_AVIVO_VARIANT) { + avivo_lock_cursor(crtc, TRUE); OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset, INREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset) | AVIVO_D1CURSOR_EN); avivo_setup_cursor(crtc, TRUE); + avivo_lock_cursor(crtc, FALSE); } else { switch (crtc_id) { case 0: @@ -149,10 +169,12 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc) unsigned char *RADEONMMIO = info->MMIO; if (IS_AVIVO_VARIANT) { + avivo_lock_cursor(crtc, TRUE); OUTREG(AVIVO_D1CUR_CONTROL+ radeon_crtc->crtc_offset, INREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset) & ~(AVIVO_D1CURSOR_EN)); avivo_setup_cursor(crtc, FALSE); + avivo_lock_cursor(crtc, FALSE); } else { switch(crtc_id) { case 0: @@ -195,9 +217,11 @@ radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) /* avivo cursor spans the full fb width */ x += crtc->x; y += crtc->y; + avivo_lock_cursor(crtc, TRUE); OUTREG(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, ((xorigin ? 0 : x) << 16) | (yorigin ? 0 : y)); OUTREG(AVIVO_D1CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin); + avivo_lock_cursor(crtc, FALSE); } else { if (crtc_id == 0) { OUTREG(RADEON_CUR_HORZ_VERT_OFF, (RADEON_CUR_LOCK diff --git a/src/radeon_reg.h b/src/radeon_reg.h index 0d684a5..815bcaa 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -3540,6 +3540,8 @@ #define AVIVO_D1CUR_SIZE 0x6410 #define AVIVO_D1CUR_POSITION 0x6414 #define AVIVO_D1CUR_HOT_SPOT 0x6418 +#define AVIVO_D1CUR_UPDATE 0x6424 +# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) #define AVIVO_DC_LUT_RW_SELECT 0x6480 #define AVIVO_DC_LUT_RW_MODE 0x6484 commit 445b71021843665ba32f37b2ce5c9d2857c07cc7 Author: Alex Deucher <[EMAIL PROTECTED](none)> Date: Tue Apr 29 21:01:41 2008 -0400 RADEON: assorted fixes - free rotate pixmaps on VT switch - save crtc/output status so we only turn on crtcs/outputs if they are off - show/hide cursors when changing modes diff --git a/configure.ac b/configure.ac index b644348..ab8bd97 100644 --- a/configure.ac +++ b/configure.ac @@ -176,6 +176,14 @@ AC_CHECK_DECL(xf86_crtc_clip_video_helper, #include "xf86i2c.h" #include "xf86Crtc.h"]) +AC_CHECK_DECL(xf86RotateFreeShadow, + [AC_DEFINE(HAVE_FREE_SHADOW, 1, [have new FreeShadow API])], + [], + [#include <xorg-server.h> + #include <windowstr.h> + #include <xf86Crtc.h>]) + + AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], [#include "xorg-server.h"]) diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index e2d31eb..6a9a76d 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -67,6 +67,9 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode) RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; xf86CrtcPtr crtc0 = pRADEONEnt->pCrtc[0]; + if ((mode == DPMSModeOn) && radeon_crtc->enabled) + return; + if (IS_AVIVO_VARIANT) { atombios_crtc_dpms(crtc, mode); } else { @@ -86,6 +89,11 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode) legacy_crtc_dpms(crtc0, mode); } } + + if (mode == DPMSModeOn) + radeon_crtc->enabled = TRUE; + else + radeon_crtc->enabled = FALSE; } static Bool @@ -98,6 +106,10 @@ radeon_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, static void radeon_crtc_mode_prepare(xf86CrtcPtr crtc) { + RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; + + if (radeon_crtc->enabled) + crtc->funcs->hide_cursor(crtc); radeon_crtc_dpms(crtc, DPMSModeOff); } @@ -235,6 +247,10 @@ radeon_crtc_mode_commit(xf86CrtcPtr crtc) } radeon_crtc_dpms(crtc, DPMSModeOn); + + if (crtc->scrn->pScreen != NULL) + xf86_reload_cursors(crtc->scrn->pScreen); + } void diff --git a/src/radeon_driver.c b/src/radeon_driver.c index e77ea16..202a190 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -5253,6 +5253,10 @@ void RADEONLeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); +#ifndef HAVE_FREE_SHADOW + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int o; +#endif xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "RADEONLeaveVT\n"); @@ -5285,6 +5289,23 @@ void RADEONLeaveVT(int scrnIndex, int flags) } #endif +#ifndef HAVE_FREE_SHADOW + for (o = 0; o < config->num_crtc; o++) { + xf86CrtcPtr crtc = config->crtc[o]; + + if (crtc->rotatedPixmap || crtc->rotatedData) { + crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap, + crtc->rotatedData); + crtc->rotatedPixmap = NULL; + crtc->rotatedData = NULL; + } + } +#else + xf86RotateFreeShadow(pScrn); +#endif + + xf86_hide_cursors (pScrn); + RADEONRestore(pScrn); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, diff --git a/src/radeon_output.c b/src/radeon_output.c index 28539d4..907d824 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -481,6 +481,10 @@ static void radeon_dpms(xf86OutputPtr output, int mode) { RADEONInfoPtr info = RADEONPTR(output->scrn); + RADEONOutputPrivatePtr radeon_output = output->driver_private; + + if ((mode == DPMSModeOn) && radeon_output->enabled) + return; if (IS_AVIVO_VARIANT) { atombios_output_dpms(output, mode); @@ -489,6 +493,11 @@ radeon_dpms(xf86OutputPtr output, int mode) } radeon_bios_output_dpms(output, mode); + if (mode == DPMSModeOn) + radeon_output->enabled = TRUE; + else + radeon_output->enabled = FALSE; + } static void diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 0096ce0..7983970 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -193,6 +193,7 @@ typedef struct _RADEONCrtcPrivateRec { uint32_t crtc_offset; int can_tile; + Bool enabled; } RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr; typedef struct { @@ -261,6 +262,7 @@ typedef struct _RADEONOutputPrivateRec { char *name; int output_id; int devices; + Bool enabled; } RADEONOutputPrivateRec, *RADEONOutputPrivatePtr; struct avivo_pll_state { @@ -274,7 +276,6 @@ struct avivo_pll_state { CARD32 int_ss_cntl; }; - struct avivo_crtc_state { CARD32 pll_source; CARD32 h_total; commit 070cce5255a5c311f9d8b85ec54bd56655014933 Author: Stephan Wolf <[EMAIL PROTECTED]> Date: Mon Apr 28 11:26:37 2008 -0400 R3xx+: further fix for IGP chips see bug 15538 diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c index e504979..9a450f9 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -146,9 +146,14 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) FINISH_ACCEL(); /* setup the VAP */ - vap_cntl = ((5 << R300_PVS_NUM_SLOTS_SHIFT) | - (5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (9/*12*/ << R300_VF_MAX_VTX_NUM_SHIFT)); + if (info->has_tcl) + vap_cntl = ((5 << R300_PVS_NUM_SLOTS_SHIFT) | + (5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (9 << R300_VF_MAX_VTX_NUM_SHIFT)); + else + vap_cntl = ((10 << R300_PVS_NUM_SLOTS_SHIFT) | + (5 << R300_PVS_NUM_CNTLRS_SHIFT) | + (5 << R300_VF_MAX_VTX_NUM_SHIFT)); if (info->ChipFamily == CHIP_FAMILY_RV515) vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT); commit 211e0041c7fc2df494b77428553943a2b526ee4e Author: Alex Deucher <[EMAIL PROTECTED](none)> Date: Sun Apr 27 21:08:00 2008 -0400 IGP: fix EXA composite corruption diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c index e8ddff8..e504979 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -167,15 +167,15 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) if (info->has_tcl) BEGIN_ACCEL(15); else - BEGIN_ACCEL(8); + BEGIN_ACCEL(9); OUT_ACCEL_REG(R300_VAP_VTX_STATE_CNTL, 0); OUT_ACCEL_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0); - if (info->has_tcl) { + if (info->has_tcl) OUT_ACCEL_REG(R300_VAP_CNTL_STATUS, 0); - OUT_ACCEL_REG(R300_VAP_CNTL, vap_cntl); - }else + else OUT_ACCEL_REG(R300_VAP_CNTL_STATUS, R300_PVS_BYPASS); + OUT_ACCEL_REG(R300_VAP_CNTL, vap_cntl); OUT_ACCEL_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0); OUT_ACCEL_REG(R300_VAP_VTE_CNTL, R300_VTX_XY_FMT | R300_VTX_Z_FMT); OUT_ACCEL_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0); diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c index 138216f..ec3c06d 100644 --- a/src/radeon_exa_render.c +++ b/src/radeon_exa_render.c @@ -2108,8 +2108,12 @@ static void FUNC_NAME(RadeonDoneComposite)(PixmapPtr pDst) ENTER_DRAW(0); - if (IS_R500_3D) { - /* r500 shows corruption on small things like glyphs without a 3D idle */ + if (IS_R500_3D || ((info->ChipFamily == CHIP_FAMILY_RS400) || + (info->ChipFamily == CHIP_FAMILY_RS690) || + (info->ChipFamily == CHIP_FAMILY_RS740))) { + /* r500 shows corruption on small things like glyphs without a 3D idle + * IGP shows more substantial corruption + */ BEGIN_ACCEL(1); OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_3D_IDLECLEAN); FINISH_ACCEL(); commit 656b06bdde129ca4fc370f5a2cf7311c9179b0ff Author: Alex Deucher <[EMAIL PROTECTED]> Date: Sun Apr 27 20:20:49 2008 -0400 RADEON: remove duplicate register define Also add more bit defs to wait_until register diff --git a/src/radeon_accel.c b/src/radeon_accel.c index 9fecce6..9e7ea7a 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -409,7 +409,7 @@ void RADEONEngineInit(ScrnInfoPtr pScrn) } OUTREG(R300_GB_TILE_CONFIG, gb_tile_config); - OUTREG(R300_WAIT_UNTIL, R300_WAIT_2D_IDLECLEAN | R300_WAIT_3D_IDLECLEAN); + OUTREG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN); OUTREG(R300_DST_PIPE_CONFIG, INREG(R300_DST_PIPE_CONFIG) | R300_PIPE_AUTO_CONFIG); OUTREG(R300_RB2D_DSTCACHE_MODE, (INREG(R300_RB2D_DSTCACHE_MODE) | R300_DC_AUTOFLUSH_ENABLE | diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c index c249c43..e8ddff8 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -65,7 +65,7 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) BEGIN_ACCEL(3); OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D | R300_DC_FREE_3D); OUT_ACCEL_REG(R300_RB3D_ZCACHE_CTLSTAT, R300_ZC_FLUSH | R300_ZC_FREE); - OUT_ACCEL_REG(R300_WAIT_UNTIL, R300_WAIT_2D_IDLECLEAN | R300_WAIT_3D_IDLECLEAN); + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN); FINISH_ACCEL(); gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16 | R300_SUBPIXEL_1_16); @@ -80,7 +80,7 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) BEGIN_ACCEL(5); OUT_ACCEL_REG(R300_GB_TILE_CONFIG, gb_tile_config); - OUT_ACCEL_REG(R300_WAIT_UNTIL, R300_WAIT_2D_IDLECLEAN | R300_WAIT_3D_IDLECLEAN); + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN); OUT_ACCEL_REG(R300_DST_PIPE_CONFIG, R300_PIPE_AUTO_CONFIG); OUT_ACCEL_REG(R300_GB_SELECT, 0); OUT_ACCEL_REG(R300_GB_ENABLE, 0); @@ -97,7 +97,7 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) BEGIN_ACCEL(3); OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D | R300_DC_FREE_3D); OUT_ACCEL_REG(R300_RB3D_ZCACHE_CTLSTAT, R300_ZC_FLUSH | R300_ZC_FREE); - OUT_ACCEL_REG(R300_WAIT_UNTIL, R300_WAIT_2D_IDLECLEAN | R300_WAIT_3D_IDLECLEAN); + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN); FINISH_ACCEL(); BEGIN_ACCEL(5); diff --git a/src/radeon_reg.h b/src/radeon_reg.h index 5112872..0d684a5 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -1661,9 +1661,25 @@ #define RADEON_WAIT_UNTIL 0x1720 # define RADEON_WAIT_CRTC_PFLIP (1 << 0) +# define RADEON_WAIT_RE_CRTC_VLINE (1 << 1) +# define RADEON_WAIT_FE_CRTC_VLINE (1 << 2) +# define RADEON_WAIT_CRTC_VLINE (1 << 3) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]