* [PATCH v2] nouveau: add coherent BO attribute
@ 2015-05-21 6:08 Alexandre Courbot
[not found] ` <1432188508-650-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Courbot @ 2015-05-21 6:08 UTC (permalink / raw)
To: Martin Peres, Maarten Lankhorst, Ben Skeggs
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alexandre Courbot
Add a flag allowing Nouveau to specify that an object should be coherent
at allocation time. This is required for some class of objects like
fences which are randomly-accessed by both the CPU and GPU. This flag
instructs the kernel driver to make sure the object remains coherent
even on architectures for which coherency is not guaranteed by the bus.
Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Changes since v1:
None, just added Martin so he can merge the patch. R-b and A-b wanted. :)
include/drm/nouveau_drm.h | 1 +
nouveau/abi16.c | 3 +++
nouveau/nouveau.h | 1 +
3 files changed, 5 insertions(+)
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index b18cad02419b..87aefc5e9d2f 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -96,6 +96,7 @@ struct drm_nouveau_setparam {
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
+#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
#define NOUVEAU_GEM_TILE_16BPP 0x00000001
diff --git a/nouveau/abi16.c b/nouveau/abi16.c
index 538f3a730dbe..4ca0bfbaf592 100644
--- a/nouveau/abi16.c
+++ b/nouveau/abi16.c
@@ -195,6 +195,9 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment,
if (bo->flags & NOUVEAU_BO_MAP)
info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE;
+ if (bo->flags & NOUVEAU_BO_COHERENT)
+ info->domain |= NOUVEAU_GEM_DOMAIN_COHERENT;
+
if (!(bo->flags & NOUVEAU_BO_CONTIG))
info->tile_flags = NOUVEAU_GEM_TILE_NONCONTIG;
diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h
index a55e2b020778..4adda0e3594c 100644
--- a/nouveau/nouveau.h
+++ b/nouveau/nouveau.h
@@ -127,6 +127,7 @@ union nouveau_bo_config {
#define NOUVEAU_BO_MAP 0x80000000
#define NOUVEAU_BO_CONTIG 0x40000000
#define NOUVEAU_BO_NOSNOOP 0x20000000
+#define NOUVEAU_BO_COHERENT 0x10000000
struct nouveau_bo {
struct nouveau_device *device;
--
2.4.0
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <1432188508-650-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH v2] nouveau: add coherent BO attribute [not found] ` <1432188508-650-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> @ 2015-05-21 8:47 ` Ben Skeggs 2015-05-21 18:23 ` [Nouveau] " Martin Peres 0 siblings, 1 reply; 8+ messages in thread From: Ben Skeggs @ 2015-05-21 8:47 UTC (permalink / raw) To: Alexandre Courbot Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Maarten Lankhorst, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ben Skeggs On 21 May 2015 at 16:08, Alexandre Courbot <acourbot@nvidia.com> wrote: > Add a flag allowing Nouveau to specify that an object should be coherent > at allocation time. This is required for some class of objects like > fences which are randomly-accessed by both the CPU and GPU. This flag > instructs the kernel driver to make sure the object remains coherent > even on architectures for which coherency is not guaranteed by the bus. > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> > --- > Changes since v1: > None, just added Martin so he can merge the patch. R-b and A-b wanted. :) > > include/drm/nouveau_drm.h | 1 + > nouveau/abi16.c | 3 +++ > nouveau/nouveau.h | 1 + > 3 files changed, 5 insertions(+) > > diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h > index b18cad02419b..87aefc5e9d2f 100644 > --- a/include/drm/nouveau_drm.h > +++ b/include/drm/nouveau_drm.h > @@ -96,6 +96,7 @@ struct drm_nouveau_setparam { > #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) > #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) > #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) > +#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4) > > #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 > #define NOUVEAU_GEM_TILE_16BPP 0x00000001 > diff --git a/nouveau/abi16.c b/nouveau/abi16.c > index 538f3a730dbe..4ca0bfbaf592 100644 > --- a/nouveau/abi16.c > +++ b/nouveau/abi16.c > @@ -195,6 +195,9 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment, > if (bo->flags & NOUVEAU_BO_MAP) > info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE; > > + if (bo->flags & NOUVEAU_BO_COHERENT) > + info->domain |= NOUVEAU_GEM_DOMAIN_COHERENT; > + > if (!(bo->flags & NOUVEAU_BO_CONTIG)) > info->tile_flags = NOUVEAU_GEM_TILE_NONCONTIG; > > diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h > index a55e2b020778..4adda0e3594c 100644 > --- a/nouveau/nouveau.h > +++ b/nouveau/nouveau.h > @@ -127,6 +127,7 @@ union nouveau_bo_config { > #define NOUVEAU_BO_MAP 0x80000000 > #define NOUVEAU_BO_CONTIG 0x40000000 > #define NOUVEAU_BO_NOSNOOP 0x20000000 > +#define NOUVEAU_BO_COHERENT 0x10000000 > > struct nouveau_bo { > struct nouveau_device *device; > -- > 2.4.0 > > _______________________________________________ > Nouveau mailing list > Nouveau@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH v2] nouveau: add coherent BO attribute 2015-05-21 8:47 ` Ben Skeggs @ 2015-05-21 18:23 ` Martin Peres [not found] ` <555E228B.9090400-GANU6spQydw@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Martin Peres @ 2015-05-21 18:23 UTC (permalink / raw) To: Ben Skeggs, Alexandre Courbot Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, Maarten Lankhorst, dri-devel@lists.freedesktop.org, Ben Skeggs On 21/05/2015 11:47, Ben Skeggs wrote: > On 21 May 2015 at 16:08, Alexandre Courbot <acourbot@nvidia.com> wrote: >> Add a flag allowing Nouveau to specify that an object should be coherent >> at allocation time. This is required for some class of objects like >> fences which are randomly-accessed by both the CPU and GPU. This flag >> instructs the kernel driver to make sure the object remains coherent >> even on architectures for which coherency is not guaranteed by the bus. >> >> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> > Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Pushed! _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <555E228B.9090400-GANU6spQydw@public.gmane.org>]
* Re: [Nouveau] [PATCH v2] nouveau: add coherent BO attribute [not found] ` <555E228B.9090400-GANU6spQydw@public.gmane.org> @ 2015-05-23 6:45 ` Alexandre Courbot [not found] ` <CAAVeFuJHL664jbsEBUYFp0atnuF3gisbwhJhR-R=cy+iB8gUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Alexandre Courbot @ 2015-05-23 6:45 UTC (permalink / raw) To: Martin Peres Cc: Ben Skeggs, Alexandre Courbot, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Maarten Lankhorst, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Ben Skeggs On Fri, May 22, 2015 at 3:23 AM, Martin Peres <martin.peres-GANU6spQydw@public.gmane.org> wrote: > On 21/05/2015 11:47, Ben Skeggs wrote: >> >> On 21 May 2015 at 16:08, Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote: >>> >>> Add a flag allowing Nouveau to specify that an object should be coherent >>> at allocation time. This is required for some class of objects like >>> fences which are randomly-accessed by both the CPU and GPU. This flag >>> instructs the kernel driver to make sure the object remains coherent >>> even on architectures for which coherency is not guaranteed by the bus. >>> >>> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >> >> Reviewed-by: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > > Pushed! Thanks! Should we also bump the ABI version or something? ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CAAVeFuJHL664jbsEBUYFp0atnuF3gisbwhJhR-R=cy+iB8gUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2] nouveau: add coherent BO attribute [not found] ` <CAAVeFuJHL664jbsEBUYFp0atnuF3gisbwhJhR-R=cy+iB8gUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-05-24 6:26 ` Maarten Lankhorst 2015-05-26 13:23 ` [Nouveau] " Alexandre Courbot 0 siblings, 1 reply; 8+ messages in thread From: Maarten Lankhorst @ 2015-05-24 6:26 UTC (permalink / raw) To: Alexandre Courbot, Martin Peres Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Ben Skeggs, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Op 23-05-15 om 08:45 schreef Alexandre Courbot: > On Fri, May 22, 2015 at 3:23 AM, Martin Peres <martin.peres@free.fr> wrote: >> On 21/05/2015 11:47, Ben Skeggs wrote: >>> On 21 May 2015 at 16:08, Alexandre Courbot <acourbot@nvidia.com> wrote: >>>> Add a flag allowing Nouveau to specify that an object should be coherent >>>> at allocation time. This is required for some class of objects like >>>> fences which are randomly-accessed by both the CPU and GPU. This flag >>>> instructs the kernel driver to make sure the object remains coherent >>>> even on architectures for which coherency is not guaranteed by the bus. >>>> >>>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> >>> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> >> >> Pushed! > Thanks! Should we also bump the ABI version or something? If you mean changing libdrm_nouveau.so.2 to .so.3 no! If you mean having something that pkg-config can pick up that's done automatically on every drm release. ~Maarten _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH v2] nouveau: add coherent BO attribute 2015-05-24 6:26 ` Maarten Lankhorst @ 2015-05-26 13:23 ` Alexandre Courbot [not found] ` <CAAVeFuJ4oNi-_ALd3NRNeje7wNntcJ5QME2TWHKTBVWzE0yG1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Alexandre Courbot @ 2015-05-26 13:23 UTC (permalink / raw) To: Maarten Lankhorst Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Ben Skeggs, linux-tegra@vger.kernel.org On Sun, May 24, 2015 at 3:26 PM, Maarten Lankhorst <maarten@mblankhorst.nl> wrote: > Op 23-05-15 om 08:45 schreef Alexandre Courbot: >> On Fri, May 22, 2015 at 3:23 AM, Martin Peres <martin.peres@free.fr> wrote: >>> On 21/05/2015 11:47, Ben Skeggs wrote: >>>> On 21 May 2015 at 16:08, Alexandre Courbot <acourbot@nvidia.com> wrote: >>>>> Add a flag allowing Nouveau to specify that an object should be coherent >>>>> at allocation time. This is required for some class of objects like >>>>> fences which are randomly-accessed by both the CPU and GPU. This flag >>>>> instructs the kernel driver to make sure the object remains coherent >>>>> even on architectures for which coherency is not guaranteed by the bus. >>>>> >>>>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> >>>> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> >>> >>> Pushed! >> Thanks! Should we also bump the ABI version or something? > If you mean changing libdrm_nouveau.so.2 to .so.3 no! If you mean having something that pkg-config can pick up that's done automatically on every drm release. Sorry for not having been clear. I was talking about checking against the driver version to ensure it supports all the features that libdrm can throw at it. We increased the modules's version to 1.2.2 when adding the coherent flag: drm/nouveau/nouveau_drm.h: * 1.2.2: * - add NOUVEAU_GEM_DOMAIN_COHERENT flag _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CAAVeFuJ4oNi-_ALd3NRNeje7wNntcJ5QME2TWHKTBVWzE0yG1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [Nouveau] [PATCH v2] nouveau: add coherent BO attribute [not found] ` <CAAVeFuJ4oNi-_ALd3NRNeje7wNntcJ5QME2TWHKTBVWzE0yG1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-05-26 19:06 ` Martin Peres 2015-05-26 20:46 ` Emil Velikov 0 siblings, 1 reply; 8+ messages in thread From: Martin Peres @ 2015-05-26 19:06 UTC (permalink / raw) To: Alexandre Courbot, Maarten Lankhorst Cc: Ben Skeggs, Alexandre Courbot, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Ben Skeggs On 26/05/2015 16:23, Alexandre Courbot wrote: > On Sun, May 24, 2015 at 3:26 PM, Maarten Lankhorst > <maarten-FcfepWsj2zOByvU0x3ry2g@public.gmane.org> wrote: >> Op 23-05-15 om 08:45 schreef Alexandre Courbot: >>> On Fri, May 22, 2015 at 3:23 AM, Martin Peres <martin.peres-GANU6spQydw@public.gmane.org> wrote: >>>> On 21/05/2015 11:47, Ben Skeggs wrote: >>>>> On 21 May 2015 at 16:08, Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote: >>>>>> Add a flag allowing Nouveau to specify that an object should be coherent >>>>>> at allocation time. This is required for some class of objects like >>>>>> fences which are randomly-accessed by both the CPU and GPU. This flag >>>>>> instructs the kernel driver to make sure the object remains coherent >>>>>> even on architectures for which coherency is not guaranteed by the bus. >>>>>> >>>>>> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >>>>> Reviewed-by: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >>>> Pushed! >>> Thanks! Should we also bump the ABI version or something? >> If you mean changing libdrm_nouveau.so.2 to .so.3 no! If you mean having something that pkg-config can pick up that's done automatically on every drm release. > Sorry for not having been clear. I was talking about checking against > the driver version to ensure it supports all the features that libdrm > can throw at it. We increased the modules's version to 1.2.2 when > adding the coherent flag: > > drm/nouveau/nouveau_drm.h: > * 1.2.2: > * - add NOUVEAU_GEM_DOMAIN_COHERENT flag That will be the job of mesa to check the DRM version, I would guess. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH v2] nouveau: add coherent BO attribute 2015-05-26 19:06 ` Martin Peres @ 2015-05-26 20:46 ` Emil Velikov 0 siblings, 0 replies; 8+ messages in thread From: Emil Velikov @ 2015-05-26 20:46 UTC (permalink / raw) To: Martin Peres, Alexandre Courbot, Maarten Lankhorst Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, emil.l.velikov, Ben Skeggs, dri-devel@lists.freedesktop.org On 26/05/15 19:06, Martin Peres wrote: > On 26/05/2015 16:23, Alexandre Courbot wrote: >> On Sun, May 24, 2015 at 3:26 PM, Maarten Lankhorst >> <maarten@mblankhorst.nl> wrote: >>> Op 23-05-15 om 08:45 schreef Alexandre Courbot: >>>> On Fri, May 22, 2015 at 3:23 AM, Martin Peres <martin.peres@free.fr> >>>> wrote: >>>>> On 21/05/2015 11:47, Ben Skeggs wrote: >>>>>> On 21 May 2015 at 16:08, Alexandre Courbot <acourbot@nvidia.com> >>>>>> wrote: >>>>>>> Add a flag allowing Nouveau to specify that an object should be >>>>>>> coherent >>>>>>> at allocation time. This is required for some class of objects like >>>>>>> fences which are randomly-accessed by both the CPU and GPU. This >>>>>>> flag >>>>>>> instructs the kernel driver to make sure the object remains coherent >>>>>>> even on architectures for which coherency is not guaranteed by >>>>>>> the bus. >>>>>>> >>>>>>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> >>>>>> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> >>>>> Pushed! >>>> Thanks! Should we also bump the ABI version or something? >>> If you mean changing libdrm_nouveau.so.2 to .so.3 no! If you mean >>> having something that pkg-config can pick up that's done >>> automatically on every drm release. >> Sorry for not having been clear. I was talking about checking against >> the driver version to ensure it supports all the features that libdrm >> can throw at it. We increased the modules's version to 1.2.2 when >> adding the coherent flag: >> >> drm/nouveau/nouveau_drm.h: >> * 1.2.2: >> * - add NOUVEAU_GEM_DOMAIN_COHERENT flag > > That will be the job of mesa to check the DRM version, I would guess. Precisely. It's up-to the user of nouveau_bo_new() to check for it. Search for drm_version in src/gallium/drivers/nouveau to see how we already do it for similar changes. -Emil _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-26 20:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 6:08 [PATCH v2] nouveau: add coherent BO attribute Alexandre Courbot
[not found] ` <1432188508-650-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-21 8:47 ` Ben Skeggs
2015-05-21 18:23 ` [Nouveau] " Martin Peres
[not found] ` <555E228B.9090400-GANU6spQydw@public.gmane.org>
2015-05-23 6:45 ` Alexandre Courbot
[not found] ` <CAAVeFuJHL664jbsEBUYFp0atnuF3gisbwhJhR-R=cy+iB8gUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-24 6:26 ` Maarten Lankhorst
2015-05-26 13:23 ` [Nouveau] " Alexandre Courbot
[not found] ` <CAAVeFuJ4oNi-_ALd3NRNeje7wNntcJ5QME2TWHKTBVWzE0yG1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-26 19:06 ` Martin Peres
2015-05-26 20:46 ` Emil Velikov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).