From: Petri Latvala <petri.latvala@intel.com>
To: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/3] lib/ioctl_wrapper: Add i915_get_param helper
Date: Mon, 26 Nov 2018 14:58:04 +0200 [thread overview]
Message-ID: <20181126125804.GF17124@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20181123152509.20360-1-lukasz.kalamarz@intel.com>
On Fri, Nov 23, 2018 at 04:25:07PM +0100, Lukasz Kalamarz wrote:
> getparam is used in few places across IGT, but no helper function
> is used to reduce code duplication.
>
> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
>
> Cc: Michal Winiarski <michal.winiarski@intel.com>
> Cc: Katarzyna Dec <katarzyna.dec@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> ---
> lib/ioctl_wrappers.c | 13 +++++++++++++
> lib/ioctl_wrappers.h | 1 +
> 2 files changed, 14 insertions(+)
>
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 9f255508..8fea9fa9 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -468,6 +468,19 @@ void gem_sync(int fd, uint32_t handle)
> errno = 0;
> }
>
> +int drm_get_param(int fd, uint32_t param)
> +{
> + int value;
> + drm_i915_getparam_t gp = {
> + .param = param,
> + .value = &value
> + };
> +
> + if (igt_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) == -1)
> + return NULL;
> +
> + return value;
> +}
Docs would be lovely.
--
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-11-26 12:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 14:27 [igt-dev] [PATCH i-g-t 1/3] lib/ioctl_wrapper: Add i915_get_param helper Lukasz Kalamarz
2018-11-23 14:27 ` [igt-dev] [PATCH i-g-t 2/3] tests: Use drm_get_param where applicable Lukasz Kalamarz
2018-11-23 14:27 ` [igt-dev] [PATCH i-g-t 3/3] lib: Use drm_get_param where it is applicable Lukasz Kalamarz
2018-11-23 14:56 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] lib/ioctl_wrapper: Add i915_get_param helper Patchwork
2018-11-23 15:25 ` [igt-dev] [PATCH i-g-t v2 1/3] " Lukasz Kalamarz
2018-11-23 15:25 ` [igt-dev] [PATCH i-g-t v2 2/3] tests: Use drm_get_param where applicable Lukasz Kalamarz
2018-11-23 15:25 ` [igt-dev] [PATCH i-g-t v2 3/3] lib: Use drm_get_param where it is applicable Lukasz Kalamarz
2018-11-26 9:11 ` Katarzyna Dec
2018-11-26 6:18 ` [igt-dev] [PATCH i-g-t v2 1/3] lib/ioctl_wrapper: Add i915_get_param helper Katarzyna Dec
2018-11-26 12:58 ` Petri Latvala [this message]
2018-11-23 15:37 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v2,3/3] lib: Use drm_get_param where it is applicable (rev4) 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=20181126125804.GF17124@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lukasz.kalamarz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox