From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: "Ruhl, Michael J" Date: Wed, 6 Oct 2021 17:11:02 +0000 Message-ID: <8dfaad70a9504fcebaec0949dc45ad90@intel.com> References: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com> In-Reply-To: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: "Teres Alexis, Alan Previn" , "igt-dev@lists.freedesktop.org" Cc: "dri-devel@lists.freedesktop.org" , "Vivi, Rodrigo" List-ID: >-----Original Message----- >From: Teres Alexis, Alan Previn >Sent: Wednesday, October 6, 2021 12:52 PM >To: igt-dev@lists.freedesktop.org >Cc: Teres Alexis, Alan Previn ; dri- >devel@lists.freedesktop.org; Ruhl; Ruhl, Michael J >; Vivi, Rodrigo >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 M >Signed-off-by: Alan Previn >--- > 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 =3D handle; >- args.flags =3D DRM_CLOEXEC; >- args.fd =3D -1; >- >- ret =3D drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); >- if (ret) >- ret =3D errno; >- *outfd =3D 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] =3D alloc_and_fill_dest_buff(fd[0], true, >TSTSURF_SIZE, > >TSTSURF_INITCOLOR1); > } else { >- ret =3D export_handle(fd[0], dbo[0], &dmabuf_fd); >- igt_assert(ret =3D=3D 0); >+ dmabuf_fd =3D prime_handle_to_fd(fd[0], dbo[0]); > dbo[1] =3D prime_fd_to_handle(fd[1], dmabuf_fd); > igt_assert(dbo[1]); > } >-- >2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 866DCC433EF for ; Wed, 6 Oct 2021 17:11:07 +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 4EFDD60F9E for ; Wed, 6 Oct 2021 17:11:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4EFDD60F9E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E5A86EDCA; Wed, 6 Oct 2021 17:11:06 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id D82996EDC7; Wed, 6 Oct 2021 17:11:04 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="289553885" X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="289553885" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 10:11:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="439194484" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 06 Oct 2021 10:11:04 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 6 Oct 2021 10:11:03 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 6 Oct 2021 10:11:03 -0700 Received: from orsmsx611.amr.corp.intel.com ([10.22.229.24]) by ORSMSX611.amr.corp.intel.com ([10.22.229.24]) with mapi id 15.01.2242.012; Wed, 6 Oct 2021 10:11:03 -0700 From: "Ruhl, Michael J" To: "Teres Alexis, Alan Previn" , "igt-dev@lists.freedesktop.org" CC: "dri-devel@lists.freedesktop.org" , "Vivi, Rodrigo" Subject: RE: [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD Thread-Topic: [PATCH i-g-t 1/1] tests/i915_pxp: Use ioctl_wrapper for DRM_IOCTL_PRIME_HANDLE_TO_FD Thread-Index: AQHXutJh5oMNYtY4mk6kTCD0hoWY7qvGNAJQ Date: Wed, 6 Oct 2021 17:11:02 +0000 Message-ID: <8dfaad70a9504fcebaec0949dc45ad90@intel.com> References: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com> In-Reply-To: <20211006165151.247868-1-alan.previn.teres.alexis@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" >-----Original Message----- >From: Teres Alexis, Alan Previn >Sent: Wednesday, October 6, 2021 12:52 PM >To: igt-dev@lists.freedesktop.org >Cc: Teres Alexis, Alan Previn ; dri- >devel@lists.freedesktop.org; Ruhl; Ruhl, Michael J >; Vivi, Rodrigo >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 M >Signed-off-by: Alan Previn >--- > 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 =3D handle; >- args.flags =3D DRM_CLOEXEC; >- args.fd =3D -1; >- >- ret =3D drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); >- if (ret) >- ret =3D errno; >- *outfd =3D 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] =3D alloc_and_fill_dest_buff(fd[0], true, >TSTSURF_SIZE, > >TSTSURF_INITCOLOR1); > } else { >- ret =3D export_handle(fd[0], dbo[0], &dmabuf_fd); >- igt_assert(ret =3D=3D 0); >+ dmabuf_fd =3D prime_handle_to_fd(fd[0], dbo[0]); > dbo[1] =3D prime_fd_to_handle(fd[1], dmabuf_fd); > igt_assert(dbo[1]); > } >-- >2.25.1