Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756228AbcCAX5I (ORCPT ); Tue, 1 Mar 2016 18:57:08 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:58676 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756199AbcCAX5E convert rfc822-to-8bit (ORCPT ); Tue, 1 Mar 2016 18:57:04 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=EZjAcnuZ8BMXLk7Og8JwV3xIqYg2P3ZsyWyz5AQzY9/kO9j+jC8FyjFOnkENb6E8m42zKPsan2CT 0cK3vwfIapmy/FhoTR7uHLYZp8zXAiwJepKOaVzHmMkzgA4ShbS4uNTiJsxs2ASfv1LHUenIcxBv 2C132+JJepFYPtsIaUY=; From: Greg Kroah-Hartman Subject: [PATCH 4.4 176/342] drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , =?utf-8?Q?Christian=20K=C3=B6nig?= , =?utf-8?Q?Michel=20D=C3=A4nzer?= Message-Id: <20160301234533.642218600@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.0dbe7b34f23a4f3b9b8830ea19459836 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:54:48 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1152 Lines: 34 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian König commit 78d0e182b6c1f5336f6e8cbb197f403276dabc7f upstream. We could pin BOs into invisible VRAM otherwise. v2: make logic more readable as suggested by Michel Signed-off-by: Christian König Reviewed-by: Alex Deucher (v1) Reviewed-by: Rex Zhu (v1) Reviewed-by: Michel Dänzer Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -399,7 +399,8 @@ int amdgpu_bo_pin_restricted(struct amdg } if (fpfn > bo->placements[i].fpfn) bo->placements[i].fpfn = fpfn; - if (lpfn && lpfn < bo->placements[i].lpfn) + if (!bo->placements[i].lpfn || + (lpfn && lpfn < bo->placements[i].lpfn)) bo->placements[i].lpfn = lpfn; bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; }