gpu: host1x: Add direction flags to relocations
authorThierry Reding <treding@nvidia.com>
Mon, 28 Oct 2019 12:37:11 +0000 (13:37 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 29 Oct 2019 14:04:34 +0000 (15:04 +0100)
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 <treding@nvidia.com>
drivers/gpu/drm/tegra/drm.c
include/linux/host1x.h

index 9a1c1694604a5f78b3a83ab915ae5a8a2eb173b9..efc8a27b9e6acf8be0f38b23911673ecef263fb7 100644 (file)
@@ -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;
index 1ba23a6a2021ff142105e81022c04ae0a58352f9..6f8d772591ba798c7e53117fa48f2a724325f134 100644 (file)
@@ -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 {