diff --git a/radeon-modeset.patch b/radeon-modeset.patch index 2ff0aa4..85dd1f9 100644 --- a/radeon-modeset.patch +++ b/radeon-modeset.patch @@ -1,3 +1,9 @@ +commit 4ba990209bb2bd4070dcb160a63ecde05653bbb7 +Author: Dave Airlie +Date: Tue Nov 18 12:06:02 2008 +1000 + + radeon: workaround O(wtf) logic in post_submit bufmgr + commit ed2ddc61540453dc89b7bbacc8c2e7d1bc002bfe Author: Dave Airlie Date: Mon Nov 17 19:19:43 2008 +1000 @@ -1913,7 +1919,7 @@ index f7ae1a8..a437b55 100644 do { \ if (RADEON_VERBOSE) \ diff --git a/src/radeon_accel.c b/src/radeon_accel.c -index a6e332d..d40da24 100644 +index a6e332d..03b49c1 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -311,6 +311,9 @@ void RADEONEngineRestore(ScrnInfoPtr pScrn) @@ -2049,7 +2055,7 @@ index a6e332d..d40da24 100644 switch (info->CurrentLayout.pixel_code) { case 8: datatype = 2; break; -@@ -550,6 +556,153 @@ int RADEONCPStop(ScrnInfoPtr pScrn, RADEONInfoPtr info) +@@ -550,6 +556,163 @@ int RADEONCPStop(ScrnInfoPtr pScrn, RADEONInfoPtr info) } } @@ -2060,12 +2066,21 @@ index a6e332d..d40da24 100644 + + info->cp->relocs.size = getpagesize(); + info->cp->relocs.num_reloc = 0; ++ info->cp->relocs.max_bo = info->cp->relocs.size / RADEON_RELOC_SIZE; + info->cp->relocs.buf = xcalloc(1, info->cp->relocs.size); + if (!info->cp->relocs.buf) + return NULL; ++ ++ info->cp->relocs.bo_list = xcalloc(info->cp->relocs.max_bo, sizeof(dri_bo *)); ++ if (!info->cp->relocs.bo_list) { ++ xfree(info->cp->relocs.buf); ++ return NULL; ++ } ++ + info->cp->ib_gem_fake.address = xcalloc(1, RADEON_BUFFER_SIZE); + if (!info->cp->ib_gem_fake.address) { + xfree(info->cp->relocs.buf); ++ xfree(info->cp->relocs.bo_list); + return NULL; + } + @@ -2191,6 +2206,7 @@ index a6e332d..d40da24 100644 + if (!info->cp->indirectBuffer) return; + RADEONCSFlushIndirect(pScrn, 0); + xfree(info->cp->relocs.buf); ++ xfree(info->cp->relocs.bo_list); + info->cp->relocs.buf = 0; + info->cp->relocs.size = 0; + info->cp->relocs.num_reloc = 0; @@ -2203,7 +2219,7 @@ index a6e332d..d40da24 100644 /* Get an indirect buffer for the CP 2D acceleration commands */ drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn) { -@@ -560,6 +713,9 @@ drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn) +@@ -560,6 +723,9 @@ drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn) int size = 0; int i = 0; int ret; @@ -2213,7 +2229,7 @@ index a6e332d..d40da24 100644 #if 0 /* FIXME: pScrn->pScreen has not been initialized when this is first -@@ -625,6 +781,11 @@ void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard) +@@ -625,6 +791,11 @@ void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard) if (!buffer) return; if (start == buffer->used && !discard) return; @@ -2225,7 +2241,7 @@ index a6e332d..d40da24 100644 if (RADEON_VERBOSE) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flushing buffer %d\n", buffer->idx); -@@ -659,10 +820,16 @@ void RADEONCPReleaseIndirect(ScrnInfoPtr pScrn) +@@ -659,10 +830,16 @@ void RADEONCPReleaseIndirect(ScrnInfoPtr pScrn) int start = info->cp->indirectStart; drm_radeon_indirect_t indirect; @@ -2242,7 +2258,7 @@ index a6e332d..d40da24 100644 if (RADEON_VERBOSE) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Releasing buffer %d\n", -@@ -789,6 +956,7 @@ RADEONHostDataBlit( +@@ -789,6 +966,7 @@ RADEONHostDataBlit( ret = ( uint8_t* )&__head[__count]; __count += dwords; @@ -2250,7 +2266,7 @@ index a6e332d..d40da24 100644 ADVANCE_RING(); *y += *hpass; -@@ -926,7 +1094,7 @@ Bool RADEONAccelInit(ScreenPtr pScreen) +@@ -926,7 +1104,7 @@ Bool RADEONAccelInit(ScreenPtr pScreen) #ifdef USE_EXA if (info->useEXA) { # ifdef XF86DRI @@ -2259,7 +2275,7 @@ index a6e332d..d40da24 100644 if (!RADEONDrawInitCP(pScreen)) return FALSE; } else -@@ -947,7 +1115,7 @@ Bool RADEONAccelInit(ScreenPtr pScreen) +@@ -947,7 +1125,7 @@ Bool RADEONAccelInit(ScreenPtr pScreen) } #ifdef XF86DRI @@ -2268,7 +2284,7 @@ index a6e332d..d40da24 100644 RADEONAccelInitCP(pScreen, a); else #endif /* XF86DRI */ -@@ -969,11 +1137,13 @@ void RADEONInit3DEngine(ScrnInfoPtr pScrn) +@@ -969,11 +1147,13 @@ void RADEONInit3DEngine(ScrnInfoPtr pScrn) RADEONInfoPtr info = RADEONPTR (pScrn); #ifdef XF86DRI @@ -2286,7 +2302,7 @@ index a6e332d..d40da24 100644 RADEONInit3DEngineCP(pScrn); } else #endif -@@ -981,7 +1151,7 @@ void RADEONInit3DEngine(ScrnInfoPtr pScrn) +@@ -981,7 +1161,7 @@ void RADEONInit3DEngine(ScrnInfoPtr pScrn) info->accel_state->XInited3D = TRUE; } @@ -2328,10 +2344,10 @@ index 0000000..481c5cf +#endif diff --git a/src/radeon_bufmgr_gem.c b/src/radeon_bufmgr_gem.c new file mode 100644 -index 0000000..92fbaa8 +index 0000000..0591c42 --- /dev/null +++ b/src/radeon_bufmgr_gem.c -@@ -0,0 +1,600 @@ +@@ -0,0 +1,597 @@ +/************************************************************************** + * + * Copyright © 2007-2008 Red Hat Inc. @@ -2705,12 +2721,15 @@ index 0000000..92fbaa8 + reloc_info->buf = xrealloc(reloc_info->buf, reloc_info->size); + if (!reloc_info->buf) + FatalError("failed to increase reloc buffer size\n"); ++ reloc_info->max_bo = reloc_info->size / RADEON_RELOC_SIZE; ++ reloc_info->bo_list = xrealloc(reloc_info->bo_list, reloc_info->max_bo * (sizeof(dri_bo *))); + } + + dri_bo_reference(buf); + gem_bo->touched = 1; + + index = reloc_info->num_reloc * 4; ++ reloc_info->bo_list[index/4] = buf; + reloc_info->buf[index] = gem_bo->gem_handle; + reloc_info->buf[index + 1] = read_domains; + reloc_info->buf[index + 2] = write_domain; @@ -2880,16 +2899,10 @@ index 0000000..92fbaa8 + return; + + for (i = 0; i < reloc_info->num_reloc; i++) { -+ trav = bufmgr_gem->bo_list; -+ while (trav) { -+ prev = trav; -+ trav = trav->next; -+ -+ if (prev->gem_handle == reloc_info->buf[i * 4]) { -+ prev->space_accounted = 0; -+ dri_bo_unreference(&prev->bo); -+ } -+ } ++ trav = (dri_bo_gem *)reloc_info->bo_list[i]; ++ ++ trav->space_accounted = 0; ++ dri_bo_unreference(&trav->bo); + } + + bufmgr_gem->read_used = 0; @@ -3961,10 +3974,10 @@ index 0000000..12263c3 +} diff --git a/src/radeon_dri_bufmgr.h b/src/radeon_dri_bufmgr.h new file mode 100644 -index 0000000..041671f +index 0000000..026a751 --- /dev/null +++ b/src/radeon_dri_bufmgr.h -@@ -0,0 +1,279 @@ +@@ -0,0 +1,281 @@ +/************************************************************************** + * + * Copyright � 2007 Intel Corporation @@ -4012,7 +4025,9 @@ index 0000000..041671f +#define RADEON_RELOC_SIZE 4 +struct radeon_relocs_info { + uint32_t *buf; ++ dri_bo **bo_list; + int size; ++ int max_bo; + int num_reloc; +}; + diff --git a/xorg-x11-drv-ati.spec b/xorg-x11-drv-ati.spec index a0f0dcd..588b8fc 100644 --- a/xorg-x11-drv-ati.spec +++ b/xorg-x11-drv-ati.spec @@ -5,7 +5,7 @@ Summary: Xorg X11 ati video driver Name: xorg-x11-drv-ati Version: 6.9.0 -Release: 48%{?dist} +Release: 49%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man4/radeon.4* %changelog +* Tue Nov 18 2008 Dave Airlie 6.9.0-49 +- modeset - fix O(wtf) operation in post_bufmgr_submit + * Mon Nov 17 2008 Dave Airlie 6.9.0-48 - limit to 90% of VRAM for modeset command submission