All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ruhl, Michael J" <michael.j.ruhl@intel.com>
To: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD
Date: Wed, 6 Oct 2021 17:11:02 +0000	[thread overview]
Message-ID: <8dfaad70a9504fcebaec0949dc45ad90@intel.com> (raw)
In-Reply-To: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com>

>-----Original Message-----
>From: Teres Alexis, Alan Previn <alan.previn.teres.alexis@intel.com>
>Sent: Wednesday, October 6, 2021 12:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: Teres Alexis, Alan Previn <alan.previn.teres.alexis@intel.com>; dri-
>devel@lists.freedesktop.org; Ruhl; Ruhl, Michael J
><michael.j.ruhl@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
>Subject: [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for
>DRM_IOCTL_PRIME_HANDLE_TO_FD
>
>Replace private helper with call to ioctl_wrapper for
>DRM_IOCTL_PRIME_HANDLE_TO_FD.

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>

M

>Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
>---
> tests/i915/gem_pxp.c | 20 +-------------------
> 1 file changed, 1 insertion(+), 19 deletions(-)
>
>diff --git a/tests/i915/gem_pxp.c b/tests/i915/gem_pxp.c
>index 79040165..0430f4b8 100644
>--- a/tests/i915/gem_pxp.c
>+++ b/tests/i915/gem_pxp.c
>@@ -622,23 +622,6 @@ static void test_render_pxp_protsrc_to_protdest(int
>i915)
> 	buf_ops_destroy(bops);
> }
>
>-static int export_handle(int fd, uint32_t handle, int *outfd)
>-{
>-	struct drm_prime_handle args;
>-	int ret;
>-
>-	args.handle = handle;
>-	args.flags = DRM_CLOEXEC;
>-	args.fd = -1;
>-
>-	ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);
>-	if (ret)
>-		ret = errno;
>-	*outfd = args.fd;
>-
>-	return ret;
>-}
>-
> static void test_pxp_dmabuffshare_refcnt(void)
> {
> 	uint32_t ctx[2], sbo[2], dbo[2];
>@@ -659,8 +642,7 @@ static void test_pxp_dmabuffshare_refcnt(void)
> 			dbo[0] = alloc_and_fill_dest_buff(fd[0], true,
>TSTSURF_SIZE,
>
>TSTSURF_INITCOLOR1);
> 		} else {
>-			ret = export_handle(fd[0], dbo[0], &dmabuf_fd);
>-			igt_assert(ret == 0);
>+			dmabuf_fd = prime_handle_to_fd(fd[0], dbo[0]);
> 			dbo[1] = prime_fd_to_handle(fd[1], dmabuf_fd);
> 			igt_assert(dbo[1]);
> 		}
>--
>2.25.1

WARNING: multiple messages have this Message-ID (diff)
From: "Ruhl, Michael J" <michael.j.ruhl@intel.com>
To: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: RE: [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD
Date: Wed, 6 Oct 2021 17:11:02 +0000	[thread overview]
Message-ID: <8dfaad70a9504fcebaec0949dc45ad90@intel.com> (raw)
In-Reply-To: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com>

>-----Original Message-----
>From: Teres Alexis, Alan Previn <alan.previn.teres.alexis@intel.com>
>Sent: Wednesday, October 6, 2021 12:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: Teres Alexis, Alan Previn <alan.previn.teres.alexis@intel.com>; dri-
>devel@lists.freedesktop.org; Ruhl; Ruhl, Michael J
><michael.j.ruhl@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
>Subject: [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for
>DRM_IOCTL_PRIME_HANDLE_TO_FD
>
>Replace private helper with call to ioctl_wrapper for
>DRM_IOCTL_PRIME_HANDLE_TO_FD.

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>

M

>Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
>---
> tests/i915/gem_pxp.c | 20 +-------------------
> 1 file changed, 1 insertion(+), 19 deletions(-)
>
>diff --git a/tests/i915/gem_pxp.c b/tests/i915/gem_pxp.c
>index 79040165..0430f4b8 100644
>--- a/tests/i915/gem_pxp.c
>+++ b/tests/i915/gem_pxp.c
>@@ -622,23 +622,6 @@ static void test_render_pxp_protsrc_to_protdest(int
>i915)
> 	buf_ops_destroy(bops);
> }
>
>-static int export_handle(int fd, uint32_t handle, int *outfd)
>-{
>-	struct drm_prime_handle args;
>-	int ret;
>-
>-	args.handle = handle;
>-	args.flags = DRM_CLOEXEC;
>-	args.fd = -1;
>-
>-	ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);
>-	if (ret)
>-		ret = errno;
>-	*outfd = args.fd;
>-
>-	return ret;
>-}
>-
> static void test_pxp_dmabuffshare_refcnt(void)
> {
> 	uint32_t ctx[2], sbo[2], dbo[2];
>@@ -659,8 +642,7 @@ static void test_pxp_dmabuffshare_refcnt(void)
> 			dbo[0] = alloc_and_fill_dest_buff(fd[0], true,
>TSTSURF_SIZE,
>
>TSTSURF_INITCOLOR1);
> 		} else {
>-			ret = export_handle(fd[0], dbo[0], &dmabuf_fd);
>-			igt_assert(ret == 0);
>+			dmabuf_fd = prime_handle_to_fd(fd[0], dbo[0]);
> 			dbo[1] = prime_fd_to_handle(fd[1], dmabuf_fd);
> 			igt_assert(dbo[1]);
> 		}
>--
>2.25.1


  reply	other threads:[~2021-10-06 17:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 16:51 [igt-dev] [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD Alan Previn
2021-10-06 16:51 ` Alan Previn
2021-10-06 17:11 ` Ruhl, Michael J [this message]
2021-10-06 17:11   ` Ruhl, Michael J
2021-10-06 21:56   ` [igt-dev] " Rodrigo Vivi
2021-10-06 17:47 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/1] " Patchwork
2021-10-06 21:03 ` [igt-dev] ✗ Fi.CI.IGT: 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=8dfaad70a9504fcebaec0949dc45ad90@intel.com \
    --to=michael.j.ruhl@intel.com \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.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.