From patchwork Mon Apr 28 09:09:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 4090171 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2FEFBFF02 for ; Wed, 30 Apr 2014 01:28:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2CC420218 for ; Wed, 30 Apr 2014 01:28:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 062652021B for ; Wed, 30 Apr 2014 01:28:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B702D6EB2F; Tue, 29 Apr 2014 18:28:50 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B44B6E7D6 for ; Mon, 28 Apr 2014 02:09:14 -0700 (PDT) Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WehYg-0004HH-Lv from Thomas_Schwinge@mentor.com ; Mon, 28 Apr 2014 02:09:06 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 28 Apr 2014 02:09:06 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Mon, 28 Apr 2014 10:09:04 +0100 From: Thomas Schwinge To: Jerome Glisse Subject: Re: radeon: screen garbled after page allocator change, was: Re: [patch v2 3/3] mm: page_alloc: fair zone allocator policy In-Reply-To: <87sioxq3rx.fsf@schwinge.name> References: <1375457846-21521-1-git-send-email-hannes@cmpxchg.org> <1375457846-21521-4-git-send-email-hannes@cmpxchg.org> <87r45fajun.fsf@schwinge.name> <20140424133722.GD4107@cmpxchg.org> <20140425214746.GC5915@gmail.com> <20140425215055.GD5915@gmail.com> <20140425230321.GG5915@gmail.com> <87sioxq3rx.fsf@schwinge.name> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Mon, 28 Apr 2014 11:09:00 +0200 Message-ID: <87k3a9q0r7.fsf@schwinge.name> MIME-Version: 1.0 X-OriginalArrivalTime: 28 Apr 2014 09:09:06.0046 (UTC) FILETIME=[81A729E0:01CF62C1] X-Mailman-Approved-At: Tue, 29 Apr 2014 18:28:30 -0700 Cc: Andrea Arcangeli , linux-mm@kvack.org, Zlatko Calusic , Rik van Riel , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Minchan Kim , Mel Gorman , Johannes Weiner , Alex Deucher , Andrew Morton , Christian =?utf-8?Q?K=C3=B6nig?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! On Mon, 28 Apr 2014 10:03:46 +0200, I wrote: > On Fri, 25 Apr 2014 19:03:22 -0400, Jerome Glisse wrote: > > On Fri, Apr 25, 2014 at 05:50:57PM -0400, Jerome Glisse wrote: > > > On Fri, Apr 25, 2014 at 05:47:48PM -0400, Jerome Glisse wrote: > > > > On Thu, Apr 24, 2014 at 09:37:22AM -0400, Johannes Weiner wrote: > > > > > On Wed, Apr 02, 2014 at 04:26:08PM +0200, Thomas Schwinge wrote: > > > > > > On Fri, 2 Aug 2013 11:37:26 -0400, Johannes Weiner wrote: > > > > > > > Each zone that holds userspace pages of one workload must be aged at a > > > > > > > speed proportional to the zone size. [...] > > > > > > > > > > > > > Fix this with a very simple round robin allocator. [...] > > > > > > > > > > > > This patch, adding NR_ALLOC_BATCH, eventually landed in mainline as > > > > > > commit 81c0a2bb515fd4daae8cab64352877480792b515 (2013-09-11). > > > > > > > > > > > > I recently upgraded a Debian testing system from a 3.11 kernel to 3.12, > > > > > > and it started to exhibit "strange" issues, which I then bisected to this > > > > > > patch. I'm not saying that the patch is faulty, as it seems to be > > > > > > working fine for everyone else, so I rather assume that something in a > > > > > > (vastly?) different corner of the kernel (or my hardware?) is broken. > > > > > > ;-) > > > > > > > > > > > > The issue is that when X.org/lightdm starts up, there are "garbled" > > > > > > section on the screen, for example, rectangular boxes that are just black > > > > > > or otherwise "distorted", and/or sets of glyphs (corresponding to a set > > > > > > of characters; but not all characters) are displayed as rectangular gray > > > > > > or black boxes, and/or icons in a GNOME session are not displayed > > > > > > properly, and so on. (Can take a snapshot if that helps?) Switching to > > > > > > a Linux console, I can use that one fine. Switching back to X, in the > > > > > > majority of all cases, the screen will be completely black, but with the > > > > > > mouse cursor still rendered properly (done in hardware, I assume). > > > > > > > > > > > > Reverting commit 81c0a2bb515fd4daae8cab64352877480792b515, for example on > > > > > > top of v3.12, and everything is back to normal. The problem also > > > > > > persists with a v3.14 kernel that I just built. > > > > My guess is that the pcie bridge can only remap dma page with 32bit dma > > > > mask while the gpu is fine with 40bit dma mask. I always thought that the > > > > pcie/pci code did take care of such thing for us. > > > > > > Forgot to attach patch to test my theory. Does the attached patch fix > > > the issue ? > > Unfortunately it does not. :-/ Ha, the following seems to do it: additionally to dma_bits (your patch), I'm also overriding need_dma32 for later use in drivers/gpu/drm/ttm/ttm_bo.c:ttm_bo_add_ttm, I assume. With that hack applied, I have now rebooted a v3.14 build a few times, and so far things "look" fine. Grüße, Thomas diff --git drivers/gpu/drm/radeon/radeon_device.c drivers/gpu/drm/radeon/radeon_device.c index 044bc98..90baf2f 100644 --- drivers/gpu/drm/radeon/radeon_device.c +++ drivers/gpu/drm/radeon/radeon_device.c @@ -1243,6 +1243,8 @@ int radeon_device_init(struct radeon_device *rdev, rdev->need_dma32 = true; dma_bits = rdev->need_dma32 ? 32 : 40; + dma_bits = 32; + rdev->need_dma32 = true; r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits)); if (r) { rdev->need_dma32 = true;