Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3629048imu; Mon, 28 Jan 2019 08:06:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN7N2tIwwo5Yt/0q8dNFtLG0cLQuIii+KXVCK1PUfx0t+YDzElnzkygSfG0Y78qWrqbMvhFw X-Received: by 2002:a63:a002:: with SMTP id r2mr20083749pge.212.1548691587526; Mon, 28 Jan 2019 08:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691587; cv=none; d=google.com; s=arc-20160816; b=Nqp64CgsZNmpvJ49YCt0aslA8ZwJoLC9X2M/Rk1emE6ksSjwCEAisywYlt11BsMf+8 fbfAZB20q4/rYUl3AjPC8Ww+6QcujqdvNu5/sLhl1avIRapbQl1hEUnyjHqvRX0WhyPs cd0q2Vt1kF9SEA3BLFVYekdF5gHiZQ5qsmksCnN8rVxEC8XGl7CeA7YMpyKBL1hjJyRT rL8gvC8Xo9FOuZhm4XySFJdkU4Sb0z8ca8XQMF4oXKxn8D99/qNdRU8gz+HKsYIk+UwK Qdfzb/N0eXT4SSbykSIeghYANmzHkfY9SoQhvWNW8T1IXmWn7ZRI3C21oPIGWsK7ySlQ WOSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jajhnWP079CukTssVLesL+ZBv6lGJ5zFoq6SNBxwOsA=; b=jqlDoI2KMNc3x0NCKI/9R0o8lSU/CjI3LGZojJPbeGyOPFcmTGCotBzNrIm8d6isTA w/RLBqmRd03sOZu8RJZ4SNVbYlPL0uAN80nXNVFwWFpH6K9zWcWzx42icIjyeT4IV6j/ aCyl0f0/w9yWjrN9nG3KoB9DyD3gnaf0GxqL1m126A8eCdRvU6nDYsAqiJT/T2lMpBXd Bd+GfTb13Hr64/E8kOcCaIxMwMIl3M9f5J6DTJ6Yhx9Gn+PBHRlS+7FQSjP/ambw3EH+ JUHvLj1n0NUWWGa6IGgQSocGTRzGzM5Z82GjvN4UG1O23eJnYu+D4lZgw6iXkQaGDpdC QhyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MCSlqaYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d33si28792806pla.359.2019.01.28.08.06.12; Mon, 28 Jan 2019 08:06:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MCSlqaYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731496AbfA1QEB (ORCPT + 99 others); Mon, 28 Jan 2019 11:04:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:49178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731467AbfA1QDu (ORCPT ); Mon, 28 Jan 2019 11:03:50 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6159421852; Mon, 28 Jan 2019 16:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691429; bh=beHVS2Iu1Tzax3T2S2GlQfVdgWYSSvUUhhfJczYpivQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MCSlqaYBqbov/M+ozi7idtf+K/o5zisO6lZt/aeyDMYmiTwPD3KdPQ3lS6sTC5vOf wlnCrEmoDVlIs+/s+994BJj7mGGCDp4pBtalGjuqYrSetJvzk2K5XsXlWCjesO8Cju djhgPVJXaKz4cURnoEDrZCPpdUh2s70rEq536X1A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eric Anholt , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.19 092/258] drm/v3d: Fix prime imports of buffers from other drivers. Date: Mon, 28 Jan 2019 10:56:38 -0500 Message-Id: <20190128155924.51521-92-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Anholt [ Upstream commit 62d1a752874962f072de8a779e960fcd2ab4847b ] v3d_bo_get_pages() checks this to decide to map the imported buffer instead of the backing shmem file. The caller was about to set this value anyway, and there's no error path in between. Ideally we wouldn't even allocate the shmem file for our imports, but that's a more invasive fix. Signed-off-by: Eric Anholt Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Link: https://patchwork.freedesktop.org/patch/msgid/20181128230927.10951-3-eric@anholt.net Acked-by: Daniel Vetter Reviewed-by: Dave Emett Signed-off-by: Sasha Levin --- drivers/gpu/drm/v3d/v3d_bo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index 54d96518a131..a08766d39eab 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -293,6 +293,7 @@ v3d_prime_import_sg_table(struct drm_device *dev, bo->resv = attach->dmabuf->resv; bo->sgt = sgt; + obj->import_attach = attach; v3d_bo_get_pages(bo); v3d_mmu_insert_ptes(bo); -- 2.19.1