From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B4F38826D for ; Mon, 28 Jun 2021 07:58:30 +0000 (UTC) Date: Mon, 28 Jun 2021 11:00:33 +0300 From: Petri Latvala Message-ID: References: <20210622090221.1741111-1-boris.brezillon@collabora.com> <20210622090221.1741111-2-boris.brezillon@collabora.com> <20210624162943.5fa8d8d2@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210624162943.5fa8d8d2@collabora.com> Subject: Re: [igt-dev] [PATCH v2 1/8] tests/panfrost: Make sure we open a DUMB capable node for prime tests List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Boris Brezillon Cc: Tomeu Vizoso , Steven Price , igt-dev@lists.freedesktop.org, Rob Herring , Alyssa Rosenzweig , Robin Murphy List-ID: On Thu, Jun 24, 2021 at 04:29:43PM +0200, Boris Brezillon wrote: > Hi Petri, > > On Tue, 22 Jun 2021 12:42:01 +0300 > Petri Latvala wrote: > > > On Tue, Jun 22, 2021 at 11:02:14AM +0200, Boris Brezillon wrote: > > > v2: > > > * Use __drm_open_driver_another() > > > > > > Signed-off-by: Boris Brezillon > > > --- > > > tests/panfrost_prime.c | 25 ++++++++++++++++++++++++- > > > 1 file changed, 24 insertions(+), 1 deletion(-) > > > > > > diff --git a/tests/panfrost_prime.c b/tests/panfrost_prime.c > > > index 351d46f2f7e6..dbc741a9eacb 100644 > > > --- a/tests/panfrost_prime.c > > > +++ b/tests/panfrost_prime.c > > > @@ -35,13 +35,33 @@ > > > #include > > > #include "panfrost_drm.h" > > > > > > +static bool igt_has_dumb(int fd) > > > +{ > > > + uint64_t value = 0; > > > + int ret; > > > + > > > + ret = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &value); > > > + igt_assert(ret == 0 || errno == EINVAL || errno == EOPNOTSUPP); > > > + return value == 1; > > > +} > > > + > > > +static bool igt_has_prime(int fd, uint64_t flags) > > > +{ > > > + uint64_t value = 0; > > > + int ret; > > > + > > > + ret = drmGetCap(fd, DRM_CAP_PRIME, &value); > > > + igt_assert(ret == 0 || errno == EINVAL || errno == EOPNOTSUPP); > > > + return (value & flags) == flags; > > > +} > > > + > > > igt_main > > > { > > > int fd, kms_fd; > > > > > > igt_fixture { > > > - kms_fd = drm_open_driver_master(DRIVER_ANY); > > > fd = drm_open_driver(DRIVER_PANFROST); > > > + kms_fd = __drm_open_driver_another(1, DRIVER_ANY); > > > } > > > > > > igt_subtest("gem-prime-import") { > > > @@ -50,6 +70,9 @@ igt_main > > > struct drm_panfrost_get_bo_offset get_bo_offset = {0,}; > > > int dmabuf_fd; > > > > > > + igt_skip_on(!igt_has_dumb(kms_fd) || > > > + !igt_has_prime(kms_fd, DRM_PRIME_CAP_EXPORT)); > > > > For better logs in case any of these trigger, use separate clauses: > > > > igt_require(igt_has_dumb(kms_fd)); > > igt_require(igt_has_prime(kms_fd, DRM_PRIME_CAP_EXPORT)); > > > > > > Either way, LGTM > > Acked-by: Petri Latvala > > Thanks for this ack. I haven't contributed to igt in a while, and I > don't remember the process to push patches once they've received > acks/reviews. Should I push directly to the igt/master on gitlab (in > which case I'd need to be added to the project), or should I let > someone else push things for me. After acks/reviews if the CI doesn't give a fuzz you just push. You have enough activity now to qualify for direct access so... well you already have the access. Granted 2 days ago by Daniel Stone. -- Petri Latvala _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev