All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Dave Airlie <airlied@redhat.com>
Cc: linux-kernel@vger.kernel.org, Eric Anholt <eric@anholt.net>
Subject: [PATCH] v3d: fixup for submit alignment and check for zero flags in other ioctls.
Date: Tue,  1 May 2018 10:58:45 -0700	[thread overview]
Message-ID: <20180501175845.14837-1-eric@anholt.net> (raw)
In-Reply-To: <20180430181058.30181-3-eric@anholt.net>

Signed-off-by: Eric Anholt <eric@anholt.net>
---

airlied + danvet: this is the last change I think we need before I can
merge v3d with your acks.  Sending as a diff so you don't have to look
at the whole thing again.  Look good?

 drivers/gpu/drm/v3d/v3d_bo.c  | 10 ++++++++++
 drivers/gpu/drm/v3d/v3d_gem.c |  5 +++++
 include/uapi/drm/v3d_drm.h    |  3 +++
 3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c
index 2be4e8b71604..7b1e2a549a71 100644
--- a/drivers/gpu/drm/v3d/v3d_bo.c
+++ b/drivers/gpu/drm/v3d/v3d_bo.c
@@ -325,6 +325,11 @@ int v3d_create_bo_ioctl(struct drm_device *dev, void *data,
 	struct v3d_bo *bo = NULL;
 	int ret;
 
+	if (args->flags != 0) {
+		DRM_INFO("unknown create_bo flags: %d\n", args->flags);
+		return -EINVAL;
+	}
+
 	bo = v3d_bo_create(dev, file_priv, PAGE_ALIGN(args->size));
 	if (IS_ERR(bo))
 		return PTR_ERR(bo);
@@ -344,6 +349,11 @@ int v3d_mmap_bo_ioctl(struct drm_device *dev, void *data,
 	struct drm_gem_object *gem_obj;
 	int ret;
 
+	if (args->flags != 0) {
+		DRM_INFO("unknown mmap_bo flags: %d\n", args->flags);
+		return -EINVAL;
+	}
+
 	gem_obj = drm_gem_object_lookup(file_priv, args->handle);
 	if (!gem_obj) {
 		DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index fa39a1e35263..b513f9189caf 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -503,6 +503,11 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
 	struct drm_syncobj *sync_out;
 	int ret = 0;
 
+	if (args->pad != 0) {
+		DRM_INFO("pad must be zero: %d\n", args->pad);
+		return -EINVAL;
+	}
+
 	exec = kcalloc(1, sizeof(*exec), GFP_KERNEL);
 	if (!exec)
 		return -ENOMEM;
diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
index 201a07645bdd..7b6627783608 100644
--- a/include/uapi/drm/v3d_drm.h
+++ b/include/uapi/drm/v3d_drm.h
@@ -101,6 +101,9 @@ struct drm_v3d_submit_cl {
 
 	/* Number of BO handles passed in (size is that times 4). */
 	__u32 bo_handle_count;
+
+	/* Pad, must be zero-filled. */
+	__u32 pad;
 };
 
 /**
-- 
2.17.0

WARNING: multiple messages have this Message-ID (diff)
From: Eric Anholt <eric@anholt.net>
To: dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Dave Airlie <airlied@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] v3d: fixup for submit alignment and check for zero flags in other ioctls.
Date: Tue,  1 May 2018 10:58:45 -0700	[thread overview]
Message-ID: <20180501175845.14837-1-eric@anholt.net> (raw)
In-Reply-To: <20180430181058.30181-3-eric@anholt.net>

Signed-off-by: Eric Anholt <eric@anholt.net>
---

airlied + danvet: this is the last change I think we need before I can
merge v3d with your acks.  Sending as a diff so you don't have to look
at the whole thing again.  Look good?

 drivers/gpu/drm/v3d/v3d_bo.c  | 10 ++++++++++
 drivers/gpu/drm/v3d/v3d_gem.c |  5 +++++
 include/uapi/drm/v3d_drm.h    |  3 +++
 3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c
index 2be4e8b71604..7b1e2a549a71 100644
--- a/drivers/gpu/drm/v3d/v3d_bo.c
+++ b/drivers/gpu/drm/v3d/v3d_bo.c
@@ -325,6 +325,11 @@ int v3d_create_bo_ioctl(struct drm_device *dev, void *data,
 	struct v3d_bo *bo = NULL;
 	int ret;
 
+	if (args->flags != 0) {
+		DRM_INFO("unknown create_bo flags: %d\n", args->flags);
+		return -EINVAL;
+	}
+
 	bo = v3d_bo_create(dev, file_priv, PAGE_ALIGN(args->size));
 	if (IS_ERR(bo))
 		return PTR_ERR(bo);
@@ -344,6 +349,11 @@ int v3d_mmap_bo_ioctl(struct drm_device *dev, void *data,
 	struct drm_gem_object *gem_obj;
 	int ret;
 
+	if (args->flags != 0) {
+		DRM_INFO("unknown mmap_bo flags: %d\n", args->flags);
+		return -EINVAL;
+	}
+
 	gem_obj = drm_gem_object_lookup(file_priv, args->handle);
 	if (!gem_obj) {
 		DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index fa39a1e35263..b513f9189caf 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -503,6 +503,11 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
 	struct drm_syncobj *sync_out;
 	int ret = 0;
 
+	if (args->pad != 0) {
+		DRM_INFO("pad must be zero: %d\n", args->pad);
+		return -EINVAL;
+	}
+
 	exec = kcalloc(1, sizeof(*exec), GFP_KERNEL);
 	if (!exec)
 		return -ENOMEM;
diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
index 201a07645bdd..7b6627783608 100644
--- a/include/uapi/drm/v3d_drm.h
+++ b/include/uapi/drm/v3d_drm.h
@@ -101,6 +101,9 @@ struct drm_v3d_submit_cl {
 
 	/* Number of BO handles passed in (size is that times 4). */
 	__u32 bo_handle_count;
+
+	/* Pad, must be zero-filled. */
+	__u32 pad;
 };
 
 /**
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-01 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 18:10 [PATCH v3 0/2] V3D DRM driver Eric Anholt
2018-04-30 18:10 ` Eric Anholt
2018-04-30 18:10 ` [PATCH v3 1/2] dt-bindings: Add a new binding for Broadcom V3D 3.x and newer GPUs Eric Anholt
2018-04-30 18:10   ` Eric Anholt
2018-04-30 19:44   ` Rob Herring
2018-04-30 19:44     ` Rob Herring
2018-04-30 18:10 ` [PATCH v3 2/2] drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+ Eric Anholt
2018-04-30 18:10   ` Eric Anholt
2018-05-01 17:58   ` Eric Anholt [this message]
2018-05-01 17:58     ` [PATCH] v3d: fixup for submit alignment and check for zero flags in other ioctls Eric Anholt
2018-05-02  7:44     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180501175845.14837-1-eric@anholt.net \
    --to=eric@anholt.net \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.