All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: igt-dev@lists.freedesktop.org
Cc: boris.brezillon@collabora.com, adrian.larumbe@collabora.com,
	 liviu.dudau@arm.com, steven.price@arm.com,
	daniel.almeida@collabora.com,  kamil.konieczny@linux.intel.com,
	 Deborah Brouwer <deborah.brouwer@collabora.com>
Subject: [PATCH i-g-t 1/2] panthor: Return size from PANTHOR_DEV_QUERY
Date: Thu, 15 Oct 2026 16:44:57 -0700	[thread overview]
Message-ID: <20261015-b4-dev_query-v1-1-70ffafa4131e@collabora.com> (raw)
In-Reply-To: <20261015-b4-dev_query-v1-0-70ffafa4131e@collabora.com>

The size of the type being queried will be updated by the kernel driver
when the user pointer is null. Return the query size so that we can check
that it was correctly calculated.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
 lib/igt_panthor.c | 6 +++++-
 lib/igt_panthor.h | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/igt_panthor.c b/lib/igt_panthor.c
index 11d8ec342..5aca0a020 100644
--- a/lib/igt_panthor.c
+++ b/lib/igt_panthor.c
@@ -178,8 +178,10 @@ void igt_panthor_group_submit_simple(int fd, uint32_t group_handle,
  * @err: expected error code, or 0 for success
  *
  * Query GPU information.
+ *
+ * Returns: the size of the type being queried.
  */
-void igt_panthor_query(int fd, int32_t type, void *data, size_t size, int err)
+uint32_t igt_panthor_query(int fd, int32_t type, void *data, size_t size, int err)
 {
 	struct drm_panthor_dev_query query = {
 		.type = type,
@@ -191,6 +193,8 @@ void igt_panthor_query(int fd, int32_t type, void *data, size_t size, int err)
 		do_ioctl_err(fd, DRM_IOCTL_PANTHOR_DEV_QUERY, &query, err);
 	else
 		do_ioctl(fd, DRM_IOCTL_PANTHOR_DEV_QUERY, &query);
+
+	return query.size;
 }
 
 /**
diff --git a/lib/igt_panthor.h b/lib/igt_panthor.h
index ba4a9bf1e..2ecce57de 100644
--- a/lib/igt_panthor.h
+++ b/lib/igt_panthor.h
@@ -16,7 +16,7 @@ struct panthor_bo {
 	void *map;
 };
 
-void igt_panthor_query(int fd, int32_t type, void *data, size_t size, int err);
+uint32_t igt_panthor_query(int fd, int32_t type, void *data, size_t size, int err);
 void igt_panthor_vm_create_userva_range(int fd, uint32_t *vm_id, int err, uint64_t *uva_range);
 void igt_panthor_vm_destroy(int fd, uint32_t vm_id, int err);
 void igt_panthor_vm_bind_offset(int fd, uint32_t vm_id, uint32_t bo_handle, uint64_t va,

-- 
2.56.0


  reply	other threads:[~2026-10-15 23:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 23:44 [PATCH i-g-t 0/2] panthor: add dev_query tests for userspace buffer Deborah Brouwer
2026-10-15 23:44 ` Deborah Brouwer [this message]
2026-10-16  9:00   ` [PATCH i-g-t 1/2] panthor: Return size from PANTHOR_DEV_QUERY Liviu Dudau
2026-10-15 23:44 ` [PATCH i-g-t 2/2] panthor: test dev_query buffer size variations Deborah Brouwer
2026-10-16  9:06   ` Liviu Dudau
2026-10-16  0:25 ` ✗ Xe.CI.BAT: failure for panthor: add dev_query tests for userspace buffer Patchwork
2026-10-16  0:37 ` ✓ i915.CI.BAT: success " Patchwork
2026-10-16 10:56 ` ✗ Xe.CI.FULL: failure " Patchwork

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=20261015-b4-dev_query-v1-1-70ffafa4131e@collabora.com \
    --to=deborah.brouwer@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel.almeida@collabora.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=liviu.dudau@arm.com \
    --cc=steven.price@arm.com \
    /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.