* [igt-dev] [PATCH i-g-t v4 2/3] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable
2019-01-15 13:44 [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
@ 2019-01-15 13:44 ` Lukasz Kalamarz
2019-01-15 13:44 ` [igt-dev] [PATCH i-g-t v4 3/3] lib/ioctl_wrapper: Implement __gem_mmap Lukasz Kalamarz
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Lukasz Kalamarz @ 2019-01-15 13:44 UTC (permalink / raw)
To: igt-dev
We had some duplicates in code that are using direct call to
__gem_mmap__cpu or __gem_mmap__wc and then assert it result, which is what
gem_mmap__cpu and gem_mmap__wc is taking care for us.
v2: Rebased and reordered this patch in series
v4: Rebase
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
lib/igt_dummyload.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 2027a4b7..982906f2 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -148,14 +148,13 @@ emit_recursive_batch(igt_spin_t *spin,
if (__gem_set_caching(fd, spin->poll_handle,
I915_CACHING_CACHED) == 0)
- spin->running = __gem_mmap__cpu(fd, spin->poll_handle,
- 0, 4096,
- PROT_READ | PROT_WRITE);
+ spin->running = gem_mmap__cpu(fd, spin->poll_handle,
+ 0, 4096,
+ PROT_READ | PROT_WRITE);
else
- spin->running = __gem_mmap__wc(fd, spin->poll_handle,
- 0, 4096,
- PROT_READ | PROT_WRITE);
- igt_assert(spin->running);
+ spin->running = gem_mmap__wc(fd, spin->poll_handle,
+ 0, 4096,
+ PROT_READ | PROT_WRITE);
igt_assert_eq(*spin->running, 0);
*batch++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
--
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] 7+ messages in thread
* [igt-dev] [PATCH i-g-t v4 3/3] lib/ioctl_wrapper: Implement __gem_mmap
2019-01-15 13:44 [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
2019-01-15 13:44 ` [igt-dev] [PATCH i-g-t v4 2/3] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable Lukasz Kalamarz
@ 2019-01-15 13:44 ` Lukasz Kalamarz
2019-01-15 14:02 ` Chris Wilson
2019-01-15 14:12 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Patchwork
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Lukasz Kalamarz @ 2019-01-15 13:44 UTC (permalink / raw)
To: igt-dev
Previous implementation of __gem_mmap__cpu and __gem_mmap_wc only
differ with setting proper flag for caching. This patch implement
__gem_mmap, which merge those two functions into one
v2: Reordered and splited this patch into two separete patches
v3: Dropped unnecessary check
v4: Remerge patches again and fixed __gem_mmap description
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>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
lib/ioctl_wrappers.c | 70 ++++++++++++++++++++++++--------------------
1 file changed, 38 insertions(+), 32 deletions(-)
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index f71f0e32..19e59794 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -736,6 +736,42 @@ bool gem_mmap__has_wc(int fd)
return has_wc > 0;
}
+/**
+ * __gem_mmap:
+ * @fd: open i915 drm file descriptor
+ * @handle: gem buffer object handle
+ * @offset: offset in the gem buffer of the mmap arena
+ * @size: size of the mmap arena
+ * @prot: memory protection bits as used by mmap()
+ * @flags: flags used to determine caching
+ *
+ * This functions wraps up procedure to establish a memory mapping through
+ * direct cpu access, bypassing the gpu (valid for wc == false). For wc == true
+ * it also bypass cpu caches completely and GTT system agent (i.e. there is no
+ * automatic tiling of the mmapping through the fence registers).
+ *
+ * Returns: A pointer to the created memory mapping, NULL on failure.
+ */
+static void
+*__gem_mmap(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned int prot, uint64_t flags)
+{
+ struct drm_i915_gem_mmap arg;
+
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = handle;
+ arg.offset = offset;
+ arg.size = size;
+ arg.flags = flags;
+
+ if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg))
+ return NULL;
+
+ VG(VALGRIND_MAKE_MEM_DEFINED(from_user_pointer(arg.addr_ptr), arg.size));
+
+ errno = 0;
+ return from_user_pointer(arg.addr_ptr);
+}
+
/**
* __gem_mmap__wc:
* @fd: open i915 drm file descriptor
@@ -753,25 +789,7 @@ bool gem_mmap__has_wc(int fd)
*/
void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
{
- struct drm_i915_gem_mmap arg;
-
- if (!gem_mmap__has_wc(fd)) {
- errno = ENOSYS;
- return NULL;
- }
-
- memset(&arg, 0, sizeof(arg));
- arg.handle = handle;
- arg.offset = offset;
- arg.size = size;
- arg.flags = I915_MMAP_WC;
- if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg))
- return NULL;
-
- VG(VALGRIND_MAKE_MEM_DEFINED(from_user_pointer(arg.addr_ptr), arg.size));
-
- errno = 0;
- return from_user_pointer(arg.addr_ptr);
+ return __gem_mmap(fd, handle, offset, size, prot, I915_MMAP_WC);
}
/**
@@ -808,19 +826,7 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
*/
void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
{
- struct drm_i915_gem_mmap mmap_arg;
-
- memset(&mmap_arg, 0, sizeof(mmap_arg));
- mmap_arg.handle = handle;
- mmap_arg.offset = offset;
- mmap_arg.size = size;
- if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))
- return NULL;
-
- VG(VALGRIND_MAKE_MEM_DEFINED(from_user_pointer(mmap_arg.addr_ptr), mmap_arg.size));
-
- errno = 0;
- return from_user_pointer(mmap_arg.addr_ptr);
+ return __gem_mmap(fd, handle, offset, size, prot, 0);
}
/**
--
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] 7+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v4 3/3] lib/ioctl_wrapper: Implement __gem_mmap
2019-01-15 13:44 ` [igt-dev] [PATCH i-g-t v4 3/3] lib/ioctl_wrapper: Implement __gem_mmap Lukasz Kalamarz
@ 2019-01-15 14:02 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-01-15 14:02 UTC (permalink / raw)
To: Lukasz Kalamarz, igt-dev
Quoting Lukasz Kalamarz (2019-01-15 13:44:49)
> Previous implementation of __gem_mmap__cpu and __gem_mmap_wc only
> differ with setting proper flag for caching. This patch implement
> __gem_mmap, which merge those two functions into one
> v2: Reordered and splited this patch into two separete patches
> v3: Dropped unnecessary check
> v4: Remerge patches again and fixed __gem_mmap description
>
> 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>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> +static void
> +*__gem_mmap(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned int prot, uint64_t flags)
> +{
> + struct drm_i915_gem_mmap arg;
I would have taken the opportunity to use arg = {
.handle = handle,
.etal
}.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number
2019-01-15 13:44 [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
2019-01-15 13:44 ` [igt-dev] [PATCH i-g-t v4 2/3] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable Lukasz Kalamarz
2019-01-15 13:44 ` [igt-dev] [PATCH i-g-t v4 3/3] lib/ioctl_wrapper: Implement __gem_mmap Lukasz Kalamarz
@ 2019-01-15 14:12 ` Patchwork
2019-01-15 18:34 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-15 23:20 ` [igt-dev] [PATCH i-g-t v4 1/3] " Daniele Ceraolo Spurio
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-01-15 14:12 UTC (permalink / raw)
To: Lukasz Kalamarz; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number
URL : https://patchwork.freedesktop.org/series/55246/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5424 -> IGTPW_2240
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/55246/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2240 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_hangcheck:
- fi-bwr-2160: PASS -> DMESG-FAIL [fdo#108735]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7500u: NOTRUN -> DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105079] / [fdo#105602]
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362]
#### Possible fixes ####
* igt@gem_mmap_gtt@basic-small-copy-xy:
- fi-glk-dsi: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS
* igt@i915_module_load@reload:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS
* igt@kms_busy@basic-flip-a:
- fi-kbl-7567u: {SKIP} [fdo#109271] / [fdo#109278] -> PASS +2
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7567u: DMESG-WARN [fdo#108473] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108473]: https://bugs.freedesktop.org/show_bug.cgi?id=108473
[fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (45 -> 44)
------------------------------
Additional (2): fi-ivb-3770 fi-kbl-7500u
Missing (3): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
Build changes
-------------
* IGT: IGT_4773 -> IGTPW_2240
CI_DRM_5424: 47fde994f99d9d4c04538b38279e2e9ae4b2c978 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2240: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2240/
IGT_4773: 951e2b1a016b750544d0f42459b13b9c70631c68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2240/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number
2019-01-15 13:44 [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
` (2 preceding siblings ...)
2019-01-15 14:12 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Patchwork
@ 2019-01-15 18:34 ` Patchwork
2019-01-15 23:20 ` [igt-dev] [PATCH i-g-t v4 1/3] " Daniele Ceraolo Spurio
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-01-15 18:34 UTC (permalink / raw)
To: Lukasz Kalamarz; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,v4,1/3] lib/ioctl_wrapper: use defines for get_param instead of param number
URL : https://patchwork.freedesktop.org/series/55246/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5424_full -> IGTPW_2240_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/55246/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2240_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_busy@extended-modeset-hang-newfb-render-b:
- shard-kbl: NOTRUN -> DMESG-WARN [fdo#107956] +1
* igt@kms_color@pipe-a-degamma:
- shard-apl: PASS -> FAIL [fdo#104782] / [fdo#108145]
- shard-kbl: PASS -> FAIL [fdo#104782] / [fdo#108145]
* igt@kms_cursor_crc@cursor-128x42-sliding:
- shard-apl: PASS -> FAIL [fdo#103232] +5
* igt@kms_cursor_crc@cursor-256x256-sliding:
- shard-kbl: PASS -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]
* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
* igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
- shard-glk: PASS -> FAIL [fdo#103184]
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-hsw: PASS -> FAIL [fdo#102887]
* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc:
- shard-snb: PASS -> INCOMPLETE [fdo#105411]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167] +4
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-kbl: PASS -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-1p-rte:
- shard-apl: PASS -> FAIL [fdo#103167] / [fdo#105682]
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-glk: PASS -> FAIL [fdo#103167] +3
* igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
- shard-glk: PASS -> FAIL [fdo#108145] +1
* igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
- shard-glk: PASS -> FAIL [fdo#103166] +6
* igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
- shard-apl: PASS -> FAIL [fdo#103166] +4
- shard-kbl: PASS -> FAIL [fdo#103166] +2
* igt@kms_setmode@basic:
- shard-apl: PASS -> FAIL [fdo#99912]
#### Possible fixes ####
* igt@gem_softpin@noreloc-s3:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
* igt@kms_color@pipe-b-legacy-gamma:
- shard-apl: FAIL [fdo#104782] -> PASS
* igt@kms_cursor_crc@cursor-128x42-random:
- shard-glk: FAIL [fdo#103232] -> PASS +1
- shard-kbl: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: FAIL [fdo#103232] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:
- shard-kbl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
- shard-apl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: FAIL [fdo#103167] -> PASS +7
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-apl: FAIL [fdo#103375] -> PASS
* igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
- shard-glk: FAIL [fdo#103166] -> PASS
- shard-apl: FAIL [fdo#103166] -> PASS +4
- shard-kbl: FAIL [fdo#103166] -> PASS +1
* igt@kms_setmode@basic:
- shard-kbl: FAIL [fdo#99912] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4773 -> IGTPW_2240
* Piglit: piglit_4509 -> None
CI_DRM_5424: 47fde994f99d9d4c04538b38279e2e9ae4b2c978 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2240: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2240/
IGT_4773: 951e2b1a016b750544d0f42459b13b9c70631c68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2240/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number
2019-01-15 13:44 [igt-dev] [PATCH i-g-t v4 1/3] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
` (3 preceding siblings ...)
2019-01-15 18:34 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-01-15 23:20 ` Daniele Ceraolo Spurio
4 siblings, 0 replies; 7+ messages in thread
From: Daniele Ceraolo Spurio @ 2019-01-15 23:20 UTC (permalink / raw)
To: Lukasz Kalamarz, igt-dev
On 01/15/2019 05:44 AM, Lukasz Kalamarz wrote:
> In lib code there were few functions using param number instead of
> defines. We would like to use defines, since they are providing more
> information to user comparing to param number.
> v2: Rebased patch
> v4: Fixed commit message
>
> 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>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Daniele
> ---
> lib/ioctl_wrappers.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 9f255508..f71f0e32 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -708,12 +708,12 @@ bool gem_mmap__has_wc(int fd)
> has_wc = 0;
>
> memset(&gp, 0, sizeof(gp));
> - gp.param = 40; /* MMAP_GTT_VERSION */
> + gp.param = I915_PARAM_MMAP_GTT_VERSION;
> gp.value = >t_version;
> ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>
> memset(&gp, 0, sizeof(gp));
> - gp.param = 30; /* MMAP_VERSION */
> + gp.param = I915_PARAM_MMAP_VERSION;
> gp.value = &mmap_version;
> ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>
> @@ -964,7 +964,7 @@ static int gem_gtt_type(int fd)
> int val = 0;
>
> memset(&gp, 0, sizeof(gp));
> - gp.param = 18; /* HAS_ALIASING_PPGTT */
> + gp.param = I915_PARAM_HAS_ALIASING_PPGTT;
> gp.value = &val;
>
> if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)))
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 7+ messages in thread