From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Karthik B S <karthik.b.s@intel.com>
Cc: michel@daenzer.net, igt-dev@lists.freedesktop.org,
daniel.vetter@intel.com, petri.latvala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v11 1/2] lib/igt_ioctl_wrappers: Add igt_has_drm_cap ioctl wrapper
Date: Fri, 25 Sep 2020 18:08:06 +0300 [thread overview]
Message-ID: <20200925150806.GQ6112@intel.com> (raw)
In-Reply-To: <20200925042613.18301-2-karthik.b.s@intel.com>
On Fri, Sep 25, 2020 at 09:56:12AM +0530, Karthik B S wrote:
> Add a generic helper for DRM_IOCTL_GET_CAP ioctl.
>
> v10: -No changes.
>
> v11: -Pass cap ID instead of the whole structure. (Ville)
> -Fix the patch ordering. (Ville)
>
> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> ---
> lib/ioctl_wrappers.c | 17 +++++++++++++++++
> lib/ioctl_wrappers.h | 1 +
> 2 files changed, 18 insertions(+)
>
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 3781286d..3f35609a 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -1318,3 +1318,20 @@ int __kms_addfb(int fd, uint32_t handle,
>
> return ret < 0 ? -errno : ret;
> }
> +
> +/**
> + * igt_has_drm_cap:
> + * @fd: Open DRM file descriptor.
> + * @cap: drm_get_cap structure.
> + *
> + * This helper verifies if the passed cap is supported by the kernel
> + *
> + * Returns: Whether the cap is supported or not.
> + */
> +bool igt_has_drm_cap(int fd, uint64_t flag)
The docs and code here don't match. I fixed that up and
s/flag/capability/ for clarity.
There was also an int vs. pointer compiler warning in the
othr patch which I fixed.
Series pushed to master. Thanks.
> +{
> + struct drm_get_cap cap = { .capability = flag };
> +
> + igt_assert(drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap) == 0);
> + return cap.value;
> +}
> diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
> index 870ac8b7..e0ec203d 100644
> --- a/lib/ioctl_wrappers.h
> +++ b/lib/ioctl_wrappers.h
> @@ -196,6 +196,7 @@ struct local_drm_mode_fb_cmd2 {
>
> bool igt_has_fb_modifiers(int fd);
> void igt_require_fb_modifiers(int fd);
> +bool igt_has_drm_cap(int fd, uint64_t flag);
>
> /**
> * __kms_addfb:
> --
> 2.22.0
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-09-25 15:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 4:26 [igt-dev] [PATCH i-g-t v11 0/2] Add test for asynchronous flips Karthik B S
2020-09-25 4:26 ` [igt-dev] [PATCH i-g-t v11 1/2] lib/igt_ioctl_wrappers: Add igt_has_drm_cap ioctl wrapper Karthik B S
2020-09-25 15:08 ` Ville Syrjälä [this message]
2020-09-29 9:46 ` Karthik B S
2020-09-29 16:37 ` Ville Syrjälä
2020-09-30 6:18 ` Karthik B S
2020-10-13 7:19 ` Karthik B S
2020-09-25 4:26 ` [igt-dev] [PATCH i-g-t v11 2/2] tests/kms_async_flips: Add test to validate asynchronous flips Karthik B S
2020-09-25 5:36 ` [igt-dev] ✓ Fi.CI.BAT: success for Add test for " Patchwork
2020-09-25 6:51 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20200925150806.GQ6112@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karthik.b.s@intel.com \
--cc=michel@daenzer.net \
--cc=petri.latvala@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.