From patchwork Mon Oct 28 12:37:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11215305 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6558513B1 for ; Mon, 28 Oct 2019 12:37:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D748208C0 for ; Mon, 28 Oct 2019 12:37:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D748208C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B1626E843; Mon, 28 Oct 2019 12:37:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D5C16E82B for ; Mon, 28 Oct 2019 12:37:33 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id n1so2245285wra.10 for ; Mon, 28 Oct 2019 05:37:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eD/3jzkhTttili1L+hDnKUUTcpzreCksFu7kaZ3nllc=; b=IrZgwdcvmV+EeHozkaBMOzDmdAc7Q4tgmjCiCR2l9tHDqbMQlU3IIldwl19jSZPMYk 294Y0TVct8VvI8ZgI595YlMPDKvnB7feGIFrQS5LP7yn3Ruz+rird8HFtVixW0NpA9/b MB0m05c6G+Js0dRUSsUxZslo2XpsCc1YOy4ajD0Bi3u6rUDpDkswcNt43IIawL88jj/Y iaxmnlD/AH9Gud26QcC7gRMf6e3jDbfz29Ajdr8EyZd9TAgqkSTIjCOrJ/xyctsW53dG SS26KjpAF8x2lggQ7MCmVxZrktU+fKf9mopW3oibfGkX5YXgx7RcixpIfjbmazlYj/s+ EbtQ== X-Gm-Message-State: APjAAAVjeqUzw8Evumk4rtGW3XzYhyj4HNWIXBQPGff51agNfKzH6V+Z 4v1Fbxm5kPd1nVY1ohwY6HU= X-Google-Smtp-Source: APXvYqxJ5QBDdZwav0OKxoV+O0v7Le3RgZKyUoXTyLkXOi/tNWCgpHygWnpuqOrodFLzq79/6dt0cQ== X-Received: by 2002:a5d:6b0e:: with SMTP id v14mr14576420wrw.280.1572266251823; Mon, 28 Oct 2019 05:37:31 -0700 (PDT) Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) by smtp.gmail.com with ESMTPSA id 12sm12290850wmk.13.2019.10.28.05.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 05:37:30 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 05/12] gpu: host1x: Add direction flags to relocations Date: Mon, 28 Oct 2019 13:37:11 +0100 Message-Id: <20191028123718.3890217-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191028123718.3890217-1-thierry.reding@gmail.com> References: <20191028123718.3890217-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eD/3jzkhTttili1L+hDnKUUTcpzreCksFu7kaZ3nllc=; b=isl9SFetQ6uOtfd80K61+4EPWD8j7L9JcGCZc82nzVQm6CPSIHQRI2yGIbG5E/6SBk yERgD2OTnpMMGK4/d827BFzOocROI6zzASDv4tieJxYqDbJW5LRs+M/T11kuTnYnXuav EKLJZwoCkDQHy7nXEMyPBxcg+OboLtPg8YG9DK0tWaFtkhD7lrPHYPHE5xHzXgXjjqHh xxzbmxwZD9OATZa41ioak2XZGX6lm8cYPRgw/TBS4ha8obH78XN/Saqbm06+0ZK8df8E VwFYnooU5ONhF0lBEy2KQKfcZyhrZoginl47EfbxrR/LSUyeV5Aus94gNHYGdj/xz/ER tfuQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, Sachin Nikam , dri-devel@lists.freedesktop.org, Puneet Saxena Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Add direction flags to host1x relocations performed during job pinning. These flags indicate the kinds of accesses that hardware is allowed to perform on the relocated buffers. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/drm.c | 2 ++ include/linux/host1x.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 9a1c1694604a..efc8a27b9e6a 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -149,6 +149,8 @@ static int host1x_reloc_copy_from_user(struct host1x_reloc *dest, if (err < 0) return err; + dest->flags = HOST1X_RELOC_READ | HOST1X_RELOC_WRITE; + dest->cmdbuf.bo = host1x_bo_lookup(file, cmdbuf); if (!dest->cmdbuf.bo) return -ENOENT; diff --git a/include/linux/host1x.h b/include/linux/host1x.h index 1ba23a6a2021..6f8d772591ba 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h @@ -173,6 +173,9 @@ int host1x_job_submit(struct host1x_job *job); * host1x job */ +#define HOST1X_RELOC_READ (1 << 0) +#define HOST1X_RELOC_WRITE (1 << 1) + struct host1x_reloc { struct { struct host1x_bo *bo; @@ -183,6 +186,7 @@ struct host1x_reloc { unsigned long offset; } target; unsigned long shift; + unsigned long flags; }; struct host1x_job {