ChangeSet 1.2199.17.3, 2005/03/24 21:15:09+11:00, [EMAIL PROTECTED](none) drm: fix issue where agp is acquired before agp_init With integrated chipsets ala i865 the X server acquires the bridge for 2D operations then the DRM acquires it for 3D kaboom.. Based on patch from Brice Goglin <[EMAIL PROTECTED]> but I think this patch is safer if it can't find a bridge it acquires it. Tested on i865 (i830/i915) and Radeon on Xorg CVS and XFree86 4.3.0 Signed-off-by: Dave Airlie <[EMAIL PROTECTED]>
drm_agpsupport.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff -Nru a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c --- a/drivers/char/drm/drm_agpsupport.c 2005-03-27 12:04:32 -08:00 +++ b/drivers/char/drm/drm_agpsupport.c 2005-03-27 12:04:32 -08:00 @@ -387,12 +387,17 @@ if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS))) return NULL; memset((void *)head, 0, sizeof(*head)); - if (!(head->bridge = agp_backend_acquire(dev->pdev))) { - drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS); - return NULL; + head->bridge = agp_find_bridge(dev->pdev); + if (!head->bridge) { + if (!(head->bridge = agp_backend_acquire(dev->pdev))) { + drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS); + return NULL; + } + agp_copy_info(head->bridge, &head->agp_info); + agp_backend_release(head->bridge); + } else { + agp_copy_info(head->bridge, &head->agp_info); } - agp_copy_info(head->bridge, &head->agp_info); - agp_backend_release(head->bridge); if (head->agp_info.chipset == NOT_SUPPORTED) { drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS); return NULL; - To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html