From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 17:58:20 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D8C1065675; Thu, 2 Apr 2009 17:58:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D01358FC1F; Thu, 2 Apr 2009 17:58:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32HwKDX071988; Thu, 2 Apr 2009 17:58:20 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32HwKJw071985; Thu, 2 Apr 2009 17:58:20 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021758.n32HwKJw071985@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 17:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190649 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:58:22 -0000 Author: rnoland Date: Thu Apr 2 17:58:20 2009 New Revision: 190649 URL: http://svn.freebsd.org/changeset/base/190649 Log: Merge 190399 The GART allocations are a propery of the gart, not of scatter-gather memory. Track them in the appropriate structure. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/ati_pcigart.c stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_scatter.c Modified: stable/7/sys/dev/drm/ati_pcigart.c ============================================================================== --- stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:58:20 2009 (r190649) @@ -104,7 +104,7 @@ drm_ati_alloc_pcigart_table(struct drm_d return ENOMEM; } - dev->sg->dmah = dmah; + gart_info->dmah = dmah; return 0; } @@ -113,12 +113,12 @@ static void drm_ati_free_pcigart_table(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info) { - struct drm_dma_handle *dmah = dev->sg->dmah; + struct drm_dma_handle *dmah = gart_info->dmah; bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); - dev->sg->dmah = NULL; + gart_info->dmah = NULL; } int @@ -134,7 +134,7 @@ drm_ati_pcigart_cleanup(struct drm_devic if (gart_info->bus_addr) { if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { gart_info->bus_addr = 0; - if (dev->sg->dmah) + if (gart_info->dmah) drm_ati_free_pcigart_table(dev, gart_info); } } @@ -169,8 +169,8 @@ drm_ati_pcigart_init(struct drm_device * goto done; } - address = (void *)dev->sg->dmah->vaddr; - bus_address = dev->sg->dmah->busaddr; + address = (void *)gart_info->dmah->vaddr; + bus_address = gart_info->dmah->busaddr; } else { address = gart_info->addr; bus_address = gart_info->bus_addr; Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/drmP.h Thu Apr 2 17:58:20 2009 (r190649) @@ -480,9 +480,7 @@ typedef struct drm_sg_mem { void *virtual; int pages; dma_addr_t *busaddr; - struct drm_dma_handle *sg_dmah; /* Handle for sg_pages */ struct drm_dma_handle *dmah; /* Handle to PCI memory */ - /* for ATI PCIGART table */ } drm_sg_mem_t; typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t; @@ -543,6 +541,7 @@ struct drm_ati_pcigart_info { struct drm_dma_handle *table_handle; drm_local_map_t mapping; int table_size; + struct drm_dma_handle *dmah; /* handle for ATI PCIGART table */ }; #ifndef DMA_BIT_MASK Modified: stable/7/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:58:20 2009 (r190649) @@ -112,7 +112,7 @@ drm_sg_alloc(struct drm_device *dev, str return ENOMEM; } - entry->sg_dmah = dmah; + entry->dmah = dmah; entry->handle = (unsigned long)dmah->vaddr; DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); @@ -160,7 +160,7 @@ drm_sg_alloc_ioctl(struct drm_device *de void drm_sg_cleanup(struct drm_sg_mem *entry) { - struct drm_dma_handle *dmah = entry->sg_dmah; + struct drm_dma_handle *dmah = entry->dmah; bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);