From owner-svn-src-all@FreeBSD.ORG Wed Jun 4 09:44:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 277F9C4A; Wed, 4 Jun 2014 09:44:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13F872BC7; Wed, 4 Jun 2014 09:44:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s549i5Xn098706; Wed, 4 Jun 2014 09:44:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s549i5NA098705; Wed, 4 Jun 2014 09:44:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406040944.s549i5NA098705@svn.freebsd.org> From: Marius Strobl Date: Wed, 4 Jun 2014 09:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267042 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 09:44:06 -0000 Author: marius Date: Wed Jun 4 09:44:05 2014 New Revision: 267042 URL: http://svnweb.freebsd.org/changeset/base/267042 Log: MFC: r266792 Fix DMA handling in radeon_dummy_page_init(): - Based on actual usage and on what Linux does, dummy_page.addr should contain the physical bus address of the dummy page rather than its virtual one. As a side-effect, correcting this bug fixes compilation with PAE support enabled by getting rid of an inappropriate cast. - Also based on actual usage of dummy_page.addr, theoretically Radeon devices could do a maximum of 44-bit DMA. In reality, though, it is more likely that they only support 32-bit DMA, at least that is what radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0 to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead, which the existing 32-bit DMA limits within the drm2 code spelled as 0xFFFFFFFF should also be changed to. Reviewed by: dumbbell Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 09:18:13 2014 (r267041) +++ stable/10/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 09:44:05 2014 (r267042) @@ -548,10 +548,10 @@ int radeon_dummy_page_init(struct radeon if (rdev->dummy_page.dmah) return 0; rdev->dummy_page.dmah = drm_pci_alloc(rdev->ddev, - PAGE_SIZE, PAGE_SIZE, ~0); + PAGE_SIZE, PAGE_SIZE, BUS_SPACE_MAXSIZE_32BIT); if (rdev->dummy_page.dmah == NULL) return -ENOMEM; - rdev->dummy_page.addr = (dma_addr_t)rdev->dummy_page.dmah->vaddr; + rdev->dummy_page.addr = rdev->dummy_page.dmah->busaddr; return 0; }