* [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment
@ 2019-02-28 14:18 Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
` (4 more replies)
0 siblings, 5 replies; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
mmap(2) mandates size is page aligned so check this in our wrappers.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
lib/i915/gem_mman.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index 3cf9a6bbdb31..084dbb3b3678 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -57,6 +57,8 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
struct drm_i915_gem_mmap_gtt mmap_arg;
void *ptr;
+ igt_assert(!(size & 4095));
+
memset(&mmap_arg, 0, sizeof(mmap_arg));
mmap_arg.handle = handle;
if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg))
@@ -162,6 +164,8 @@ static void
{
struct drm_i915_gem_mmap arg;
+ igt_assert(!(size & 4095));
+
memset(&arg, 0, sizeof(arg));
arg.handle = handle;
arg.offset = offset;
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
@ 2019-02-28 14:18 ` Tvrtko Ursulin
2019-02-28 14:25 ` Chris Wilson
2019-02-28 14:18 ` [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members Tvrtko Ursulin
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
mmap(2) mandates size is page aligned.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
benchmarks/gem_wsim.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 0a5abc08d8c2..57ceb983cf82 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -737,6 +737,7 @@ init_bb(struct w_step *w, unsigned int flags)
{
const unsigned int arb_period =
get_bb_sz(w->preempt_us) / sizeof(uint32_t);
+ const unsigned int mmap_len = ALIGN(w->bb_sz, 4096);
unsigned int i;
uint32_t *ptr;
@@ -746,12 +747,12 @@ init_bb(struct w_step *w, unsigned int flags)
gem_set_domain(fd, w->bb_handle,
I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
- ptr = gem_mmap__wc(fd, w->bb_handle, 0, w->bb_sz, PROT_WRITE);
+ ptr = gem_mmap__wc(fd, w->bb_handle, 0, mmap_len, PROT_WRITE);
for (i = arb_period; i < w->bb_sz / sizeof(uint32_t); i += arb_period)
ptr[i] = 0x5 << 23; /* MI_ARB_CHK */
- munmap(ptr, w->bb_sz);
+ munmap(ptr, mmap_len);
}
static void
@@ -771,7 +772,7 @@ terminate_bb(struct w_step *w, unsigned int flags)
batch_start -= 12 * sizeof(uint32_t);
mmap_start = rounddown(batch_start, PAGE_SIZE);
- mmap_len = w->bb_sz - mmap_start;
+ mmap_len = ALIGN(w->bb_sz - mmap_start, PAGE_SIZE);
gem_set_domain(fd, w->bb_handle,
I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
@ 2019-02-28 14:18 ` Tvrtko Ursulin
2019-02-28 14:30 ` [igt-dev] " Chris Wilson
2019-02-28 14:18 ` [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings Tvrtko Ursulin
` (2 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
We do not bother explicitly unmapping memory on exit so no need to store
address and size in the workload step struct.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
benchmarks/gem_wsim.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 57ceb983cf82..afb9644dd7f0 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -131,7 +131,6 @@ struct w_step
struct drm_i915_gem_relocation_entry reloc[4];
unsigned long bb_sz;
uint32_t bb_handle;
- uint32_t *mapped_batch;
uint32_t *seqno_value;
uint32_t *seqno_address;
uint32_t *rt0_value;
@@ -139,7 +138,6 @@ struct w_step
uint32_t *rt1_address;
uint32_t *latch_value;
uint32_t *latch_address;
- unsigned int mapped_len;
};
DECLARE_EWMA(uint64_t, rt, 4, 2)
@@ -824,9 +822,6 @@ terminate_bb(struct w_step *w, unsigned int flags)
}
*cs = bbe;
-
- w->mapped_batch = ptr;
- w->mapped_len = mmap_len;
}
static const unsigned int eb_engine_map[NUM_ENGINES] = {
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members Tvrtko Ursulin
@ 2019-02-28 14:18 ` Tvrtko Ursulin
2019-02-28 14:31 ` [igt-dev] " Chris Wilson
2019-02-28 14:18 ` [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking Tvrtko Ursulin
2019-02-28 14:24 ` [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Chris Wilson
4 siblings, 1 reply; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Meson build does it so make the two symmetrical in this respect.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 4f55ea5d0f89..210e2c57df55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,6 +256,8 @@ AC_ARG_ENABLE(werror,
[Fail on warnings]),
[], [enable_werror=no])
+CWARNFLAGS="$CWARNFLAGS -Wno-pointer-arith"
+
if test "x$enable_debug" = xyes; then
AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
` (2 preceding siblings ...)
2019-02-28 14:18 ` [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings Tvrtko Ursulin
@ 2019-02-28 14:18 ` Tvrtko Ursulin
2019-02-28 14:33 ` [igt-dev] " Chris Wilson
2019-02-28 14:24 ` [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Chris Wilson
4 siblings, 1 reply; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Probably a leftover from test renames:
tests/Makefile.am:134: warning: variable 'pm_rc6_residency_LDADD' is defined but no program or
tests/Makefile.am:134: library has 'pm_rc6_residency' as canonical name (possible typo)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tests/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c5dd210c7163..80bc5f92a13b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -131,7 +131,7 @@ perf_pmu_LDADD = $(LDADD) $(top_builddir)/lib/libigt_perf.la
gem_eio_LDADD = $(LDADD) -lrt
gem_wait_LDADD = $(LDADD) -lrt
kms_flip_LDADD = $(LDADD) -lrt -lpthread
-pm_rc6_residency_LDADD = $(LDADD) -lrt
+i915_pm_rc6_residency_LDADD = $(LDADD) -lrt
prime_nv_test_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS)
prime_nv_test_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS)
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
` (3 preceding siblings ...)
2019-02-28 14:18 ` [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking Tvrtko Ursulin
@ 2019-02-28 14:24 ` Chris Wilson
2019-02-28 14:38 ` Tvrtko Ursulin
4 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:24 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:18:24)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> mmap(2) mandates size is page aligned so check this in our wrappers.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> lib/i915/gem_mman.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index 3cf9a6bbdb31..084dbb3b3678 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -57,6 +57,8 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
> struct drm_i915_gem_mmap_gtt mmap_arg;
> void *ptr;
>
> + igt_assert(!(size & 4095));
No, we don't filter what the kernel gets, not in the ioctl wrapper
itself.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size
2019-02-28 14:18 ` [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
@ 2019-02-28 14:25 ` Chris Wilson
2019-02-28 14:41 ` Tvrtko Ursulin
0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:25 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:18:25)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> mmap(2) mandates size is page aligned.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> benchmarks/gem_wsim.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index 0a5abc08d8c2..57ceb983cf82 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -737,6 +737,7 @@ init_bb(struct w_step *w, unsigned int flags)
> {
> const unsigned int arb_period =
> get_bb_sz(w->preempt_us) / sizeof(uint32_t);
> + const unsigned int mmap_len = ALIGN(w->bb_sz, 4096);
> unsigned int i;
> uint32_t *ptr;
You only need to do it for
ww->bb_sz = ALIGN(get_bb_sz(), 4096);
All batch lengths are start = ww->bb_sz - get_bb_sz() and so remain
correct. Right?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members
2019-02-28 14:18 ` [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members Tvrtko Ursulin
@ 2019-02-28 14:30 ` Chris Wilson
0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:30 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:18:26)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> We do not bother explicitly unmapping memory on exit so no need to store
> address and size in the workload step struct.
If compiler happy, and I'm happy about leaving the mmap dangling for the
kernel to clean up,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings
2019-02-28 14:18 ` [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings Tvrtko Ursulin
@ 2019-02-28 14:31 ` Chris Wilson
2019-02-28 14:42 ` Tvrtko Ursulin
0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:31 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:18:27)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Meson build does it so make the two symmetrical in this respect.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> configure.ac | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 4f55ea5d0f89..210e2c57df55 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -256,6 +256,8 @@ AC_ARG_ENABLE(werror,
> [Fail on warnings]),
> [], [enable_werror=no])
>
> +CWARNFLAGS="$CWARNFLAGS -Wno-pointer-arith"
\o/
> +
> if test "x$enable_debug" = xyes; then
> AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
> AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
> --
But shouldn't we be using something like the above to verify the flag
exists?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking
2019-02-28 14:18 ` [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking Tvrtko Ursulin
@ 2019-02-28 14:33 ` Chris Wilson
2019-02-28 14:48 ` Tvrtko Ursulin
0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:33 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:18:28)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Probably a leftover from test renames:
>
> tests/Makefile.am:134: warning: variable 'pm_rc6_residency_LDADD' is defined but no program or
> tests/Makefile.am:134: library has 'pm_rc6_residency' as canonical name (possible typo)
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> tests/Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index c5dd210c7163..80bc5f92a13b 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -131,7 +131,7 @@ perf_pmu_LDADD = $(LDADD) $(top_builddir)/lib/libigt_perf.la
> gem_eio_LDADD = $(LDADD) -lrt
> gem_wait_LDADD = $(LDADD) -lrt
> kms_flip_LDADD = $(LDADD) -lrt -lpthread
> -pm_rc6_residency_LDADD = $(LDADD) -lrt
> +i915_pm_rc6_residency_LDADD = $(LDADD) -lrt
Have we not snuck -lrt into the core library yet, pretty sure libigt.la
now includes clock_gettime() and so must be pulling it in already?
i.e. can we just drop the above line?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment
2019-02-28 14:24 ` [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Chris Wilson
@ 2019-02-28 14:38 ` Tvrtko Ursulin
0 siblings, 0 replies; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:38 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: Intel-gfx
On 28/02/2019 14:24, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-02-28 14:18:24)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> mmap(2) mandates size is page aligned so check this in our wrappers.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> lib/i915/gem_mman.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
>> index 3cf9a6bbdb31..084dbb3b3678 100644
>> --- a/lib/i915/gem_mman.c
>> +++ b/lib/i915/gem_mman.c
>> @@ -57,6 +57,8 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
>> struct drm_i915_gem_mmap_gtt mmap_arg;
>> void *ptr;
>>
>> + igt_assert(!(size & 4095));
>
> No, we don't filter what the kernel gets, not in the ioctl wrapper
> itself.
I know, but I could flip a coin on these kind of decisions. (Sometimes
we open code for such ABI tests.) Move it to non-double underscore flavours?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size
2019-02-28 14:25 ` Chris Wilson
@ 2019-02-28 14:41 ` Tvrtko Ursulin
2019-02-28 14:44 ` Chris Wilson
0 siblings, 1 reply; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:41 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: Intel-gfx
On 28/02/2019 14:25, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-02-28 14:18:25)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> mmap(2) mandates size is page aligned.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> benchmarks/gem_wsim.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
>> index 0a5abc08d8c2..57ceb983cf82 100644
>> --- a/benchmarks/gem_wsim.c
>> +++ b/benchmarks/gem_wsim.c
>> @@ -737,6 +737,7 @@ init_bb(struct w_step *w, unsigned int flags)
>> {
>> const unsigned int arb_period =
>> get_bb_sz(w->preempt_us) / sizeof(uint32_t);
>> + const unsigned int mmap_len = ALIGN(w->bb_sz, 4096);
>> unsigned int i;
>> uint32_t *ptr;
>
> You only need to do it for
>
> ww->bb_sz = ALIGN(get_bb_sz(), 4096);
>
> All batch lengths are start = ww->bb_sz - get_bb_sz() and so remain
> correct. Right?
I think so. I have one more assignment site of w->bb_sz in the upcoming
code so it was 2 : 2 and I flipped a coin. Actually I wanted to make it
explicit what I am fixing - the mmap size. But now you'll say batch size
is also implicitly rounded.. oh well.. I prefer the explicit round up at
mmap time.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings
2019-02-28 14:31 ` [igt-dev] " Chris Wilson
@ 2019-02-28 14:42 ` Tvrtko Ursulin
0 siblings, 0 replies; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:42 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: Intel-gfx
On 28/02/2019 14:31, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-02-28 14:18:27)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Meson build does it so make the two symmetrical in this respect.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> configure.ac | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 4f55ea5d0f89..210e2c57df55 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -256,6 +256,8 @@ AC_ARG_ENABLE(werror,
>> [Fail on warnings]),
>> [], [enable_werror=no])
>>
>> +CWARNFLAGS="$CWARNFLAGS -Wno-pointer-arith"
>
> \o/
Maybe I am only testing to see who still uses automake. :))
>> +
>> if test "x$enable_debug" = xyes; then
>> AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
>> AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
>> --
>
> But shouldn't we be using something like the above to verify the flag
> exists?
Definitely true.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size
2019-02-28 14:41 ` Tvrtko Ursulin
@ 2019-02-28 14:44 ` Chris Wilson
0 siblings, 0 replies; 15+ messages in thread
From: Chris Wilson @ 2019-02-28 14:44 UTC (permalink / raw)
To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx
Quoting Tvrtko Ursulin (2019-02-28 14:41:23)
>
> On 28/02/2019 14:25, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2019-02-28 14:18:25)
> >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>
> >> mmap(2) mandates size is page aligned.
> >>
> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >> ---
> >> benchmarks/gem_wsim.c | 7 ++++---
> >> 1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> >> index 0a5abc08d8c2..57ceb983cf82 100644
> >> --- a/benchmarks/gem_wsim.c
> >> +++ b/benchmarks/gem_wsim.c
> >> @@ -737,6 +737,7 @@ init_bb(struct w_step *w, unsigned int flags)
> >> {
> >> const unsigned int arb_period =
> >> get_bb_sz(w->preempt_us) / sizeof(uint32_t);
> >> + const unsigned int mmap_len = ALIGN(w->bb_sz, 4096);
> >> unsigned int i;
> >> uint32_t *ptr;
> >
> > You only need to do it for
> >
> > ww->bb_sz = ALIGN(get_bb_sz(), 4096);
> >
> > All batch lengths are start = ww->bb_sz - get_bb_sz() and so remain
> > correct. Right?
>
> I think so. I have one more assignment site of w->bb_sz in the upcoming
> code so it was 2 : 2 and I flipped a coin. Actually I wanted to make it
> explicit what I am fixing - the mmap size. But now you'll say batch size
> is also implicitly rounded.. oh well.. I prefer the explicit round up at
> mmap time.
Ok,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking
2019-02-28 14:33 ` [igt-dev] " Chris Wilson
@ 2019-02-28 14:48 ` Tvrtko Ursulin
0 siblings, 0 replies; 15+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:48 UTC (permalink / raw)
To: Chris Wilson, igt-dev; +Cc: Intel-gfx
On 28/02/2019 14:33, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-02-28 14:18:28)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Probably a leftover from test renames:
>>
>> tests/Makefile.am:134: warning: variable 'pm_rc6_residency_LDADD' is defined but no program or
>> tests/Makefile.am:134: library has 'pm_rc6_residency' as canonical name (possible typo)
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> tests/Makefile.am | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/Makefile.am b/tests/Makefile.am
>> index c5dd210c7163..80bc5f92a13b 100644
>> --- a/tests/Makefile.am
>> +++ b/tests/Makefile.am
>> @@ -131,7 +131,7 @@ perf_pmu_LDADD = $(LDADD) $(top_builddir)/lib/libigt_perf.la
>> gem_eio_LDADD = $(LDADD) -lrt
>> gem_wait_LDADD = $(LDADD) -lrt
>> kms_flip_LDADD = $(LDADD) -lrt -lpthread
>> -pm_rc6_residency_LDADD = $(LDADD) -lrt
>> +i915_pm_rc6_residency_LDADD = $(LDADD) -lrt
>
> Have we not snuck -lrt into the core library yet, pretty sure libigt.la
> now includes clock_gettime() and so must be pulling it in already?
>
> i.e. can we just drop the above line?
Looks like it. And many more in this case.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2019-02-28 14:48 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28 14:18 [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
2019-02-28 14:25 ` Chris Wilson
2019-02-28 14:41 ` Tvrtko Ursulin
2019-02-28 14:44 ` Chris Wilson
2019-02-28 14:18 ` [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members Tvrtko Ursulin
2019-02-28 14:30 ` [igt-dev] " Chris Wilson
2019-02-28 14:18 ` [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings Tvrtko Ursulin
2019-02-28 14:31 ` [igt-dev] " Chris Wilson
2019-02-28 14:42 ` Tvrtko Ursulin
2019-02-28 14:18 ` [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking Tvrtko Ursulin
2019-02-28 14:33 ` [igt-dev] " Chris Wilson
2019-02-28 14:48 ` Tvrtko Ursulin
2019-02-28 14:24 ` [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Chris Wilson
2019-02-28 14:38 ` Tvrtko Ursulin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox