public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/3] lib/ioctl_wrapper: Add i915_get_param helper
@ 2018-11-23 14:27 Lukasz Kalamarz
  2018-11-23 14:27 ` [igt-dev] [PATCH i-g-t 2/3] tests: Use drm_get_param where applicable Lukasz Kalamarz
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Lukasz Kalamarz @ 2018-11-23 14:27 UTC (permalink / raw)
  To: igt-dev

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;
+}
 
 bool gem_create__has_stolen_support(int fd)
 {
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index b22b36b0..90174d13 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -74,6 +74,7 @@ int __gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write);
 void gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write);
 int gem_wait(int fd, uint32_t handle, int64_t *timeout_ns);
 void gem_sync(int fd, uint32_t handle);
+int drm_get_param(int fd, uint32_t param);
 bool gem_create__has_stolen_support(int fd);
 uint32_t __gem_create_stolen(int fd, uint64_t size);
 uint32_t gem_create_stolen(int fd, uint64_t size);
-- 
2.17.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-11-26 12:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox