* [PATCH libdrm] tests: Test mapping different caching types on etnaviv
@ 2018-09-14 12:05 Guido Günther
2018-10-04 13:20 ` Emil Velikov
0 siblings, 1 reply; 4+ messages in thread
From: Guido Günther @ 2018-09-14 12:05 UTC (permalink / raw)
To: Lucas Stach, Christian Gmeiner; +Cc: dri-devel
This makes it simple to test if all cache types are mappable.
Signed-off-by: Guido Günther <guido.gunther@puri.sm>
---
Prompted by
https://lists.freedesktop.org/archives/etnaviv/2018-September/001946.html
tests/etnaviv/etnaviv_bo_cache_test.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/etnaviv/etnaviv_bo_cache_test.c b/tests/etnaviv/etnaviv_bo_cache_test.c
index 7fb06293..0ad37e19 100644
--- a/tests/etnaviv/etnaviv_bo_cache_test.c
+++ b/tests/etnaviv/etnaviv_bo_cache_test.c
@@ -28,6 +28,7 @@
#include <assert.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -78,6 +79,28 @@ static void test_size_rounding(struct etna_device *dev)
printf("ok\n");
}
+
+static void test_write(struct etna_device *dev, uint32_t flags)
+{
+ struct etna_bo *bo;
+ uint32_t *buf;
+
+ /* allocate, map, write to, and free of a bo */
+ printf("testing bo map with flags 0x%"PRIx32"... ", flags);
+ fflush(stdout);
+
+ bo = etna_bo_new(dev, 0x100, flags);
+ assert(bo);
+ buf = etna_bo_map(bo);
+ assert(buf);
+ assert(!etna_bo_cpu_prep(bo, DRM_ETNA_PREP_WRITE));
+ memset(buf, 0, 0x100);
+ etna_bo_cpu_fini(bo);
+ etna_bo_del(bo);
+
+ printf("ok\n");
+}
+
int main(int argc, char *argv[])
{
struct etna_device *dev;
@@ -107,6 +130,9 @@ int main(int argc, char *argv[])
test_cache(dev);
test_size_rounding(dev);
+ test_write(dev, ETNA_BO_CACHED);
+ test_write(dev, ETNA_BO_WC);
+ test_write(dev, ETNA_BO_UNCACHED);
etna_device_del(dev);
--
2.18.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] tests: Test mapping different caching types on etnaviv
2018-09-14 12:05 [PATCH libdrm] tests: Test mapping different caching types on etnaviv Guido Günther
@ 2018-10-04 13:20 ` Emil Velikov
2018-10-04 13:43 ` Lucas Stach
0 siblings, 1 reply; 4+ messages in thread
From: Emil Velikov @ 2018-10-04 13:20 UTC (permalink / raw)
To: Guido Günther, The etnaviv authors; +Cc: ML dri-devel
[adding etnaviv@ for bigger exposure]
Hi Guido,
On Fri, 14 Sep 2018 at 13:06, Guido Günther <agx@sigxcpu.org> wrote:
>
> This makes it simple to test if all cache types are mappable.
>
> Signed-off-by: Guido Günther <guido.gunther@puri.sm>
> ---
> Prompted by
>
> https://lists.freedesktop.org/archives/etnaviv/2018-September/001946.html
>
> tests/etnaviv/etnaviv_bo_cache_test.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Patch looks spot on, sadly my etnaviv knowledge is a bit limited.
Ideally one of the etna devs will double-check it, but from my POV
Acked-by: Emil Velikov <emil.velikov@collabora.com>
-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] tests: Test mapping different caching types on etnaviv
2018-10-04 13:20 ` Emil Velikov
@ 2018-10-04 13:43 ` Lucas Stach
2018-10-04 14:53 ` Guido Günther
0 siblings, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2018-10-04 13:43 UTC (permalink / raw)
To: Emil Velikov, Guido Günther, The etnaviv authors; +Cc: ML dri-devel
Am Donnerstag, den 04.10.2018, 14:20 +0100 schrieb Emil Velikov:
> [adding etnaviv@ for bigger exposure]
>
> Hi Guido,
>
> > On Fri, 14 Sep 2018 at 13:06, Guido Günther <agx@sigxcpu.org> wrote:
> >
> > This makes it simple to test if all cache types are mappable.
> >
> > > > Signed-off-by: Guido Günther <guido.gunther@puri.sm>
> > ---
> > Prompted by
> >
> > https://lists.freedesktop.org/archives/etnaviv/2018-September/001946.html
> >
> > tests/etnaviv/etnaviv_bo_cache_test.c | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> >
>
> Patch looks spot on, sadly my etnaviv knowledge is a bit limited.
>
> Ideally one of the etna devs will double-check it, but from my POV
> > Acked-by: Emil Velikov <emil.velikov@collabora.com>
Nope, this test has nothing to do with the BO cache, which is a
userspace buffer cache layer, while the caching modes map to how CPU
accesses to the buffer mmap space are treated by the hardware.
So if we want to keep this test, it needs to be split into a separate
test.
Regards,
Lucas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] tests: Test mapping different caching types on etnaviv
2018-10-04 13:43 ` Lucas Stach
@ 2018-10-04 14:53 ` Guido Günther
0 siblings, 0 replies; 4+ messages in thread
From: Guido Günther @ 2018-10-04 14:53 UTC (permalink / raw)
To: Lucas Stach; +Cc: Emil Velikov, The etnaviv authors, ML dri-devel
Hi,
On Thu, Oct 04, 2018 at 03:43:11PM +0200, Lucas Stach wrote:
> Am Donnerstag, den 04.10.2018, 14:20 +0100 schrieb Emil Velikov:
> > [adding etnaviv@ for bigger exposure]
> >
> > Hi Guido,
> >
> > > On Fri, 14 Sep 2018 at 13:06, Guido Günther <agx@sigxcpu.org> wrote:
> > >
> > > This makes it simple to test if all cache types are mappable.
> > >
> > > > > Signed-off-by: Guido Günther <guido.gunther@puri.sm>
> > > ---
> > > Prompted by
> > >
> > > https://lists.freedesktop.org/archives/etnaviv/2018-September/001946.html
> > >
> > > tests/etnaviv/etnaviv_bo_cache_test.c | 26 ++++++++++++++++++++++++++
> > > 1 file changed, 26 insertions(+)
> > >
> >
> > Patch looks spot on, sadly my etnaviv knowledge is a bit limited.
> >
> > Ideally one of the etna devs will double-check it, but from my POV
> > > Acked-by: Emil Velikov <emil.velikov@collabora.com>
>
> Nope, this test has nothing to do with the BO cache, which is a
> userspace buffer cache layer, while the caching modes map to how CPU
> accesses to the buffer mmap space are treated by the hardware.
>
> So if we want to keep this test, it needs to be split into a separate
> test.
After sending this I also realized that it would might be better suited
for igt-gpu-tools. Would it fit in there? If so'd rework it and add it
there.
Cheers,
-- Guido
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-04 14:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-14 12:05 [PATCH libdrm] tests: Test mapping different caching types on etnaviv Guido Günther
2018-10-04 13:20 ` Emil Velikov
2018-10-04 13:43 ` Lucas Stach
2018-10-04 14:53 ` Guido Günther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox