Maarten Lankhorst
2013-Sep-02 14:31 UTC
[Nouveau] [PATCH] drm/nouveau: force alignment to 0x1000 for gpu objects
There are a lot of places that allocate multiples of 1000, but do not set alignment correctly and still require this alignment implicitly or explicitly. --- drivers/gpu/drm/nouveau/core/core/gpuobj.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c index 7595506..7bcae1d 100644 --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c @@ -65,6 +65,14 @@ nouveau_gpuobj_create_(struct nouveau_object *parent, int ret, i; u64 addr; + /* + * There are a lot of places that allocate multiples of 1000, + * but do not set alignment correctly and still require this + * alignment implicitly or explicitly. + */ + if (size >= 0x1000 && align < 0x1000) + align = 0x1000; + *pobject = NULL; if (pargpu) { -- 1.8.3.4
Ben Skeggs
2013-Sep-04 03:34 UTC
[Nouveau] [PATCH] drm/nouveau: force alignment to 0x1000 for gpu objects
On Tue, Sep 3, 2013 at 12:31 AM, Maarten Lankhorst <maarten.lankhorst at canonical.com> wrote:> There are a lot of places that allocate multiples of 1000, > but do not set alignment correctly and still require this > alignment implicitly or explicitly.This is wrong. Where are the places you think you need this? Ben.> --- > drivers/gpu/drm/nouveau/core/core/gpuobj.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c > index 7595506..7bcae1d 100644 > --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c > +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c > @@ -65,6 +65,14 @@ nouveau_gpuobj_create_(struct nouveau_object *parent, > int ret, i; > u64 addr; > > + /* > + * There are a lot of places that allocate multiples of 1000, > + * but do not set alignment correctly and still require this > + * alignment implicitly or explicitly. > + */ > + if (size >= 0x1000 && align < 0x1000) > + align = 0x1000; > + > *pobject = NULL; > > if (pargpu) { > -- > 1.8.3.4 > > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
2013-Sep-04 11:59 UTC
[Nouveau] [PATCH] drm/nouveau: force alignment to 0x1000 for gpu objects
Op 04-09-13 05:34, Ben Skeggs schreef:> On Tue, Sep 3, 2013 at 12:31 AM, Maarten Lankhorst > <maarten.lankhorst at canonical.com> wrote: >> There are a lot of places that allocate multiples of 1000, >> but do not set alignment correctly and still require this >> alignment implicitly or explicitly. > This is wrong. Where are the places you think you need this? >All the calls to nouveau_gpuobj_map_vm for example in core/engine/graph/nvc0.c. engctx_create is usually called with alignment = 0x100 too, which seems like it would break in the fifo_context_attach calls too. ~Maarten
Seemingly Similar Threads
- [PATCH] drm/nouveau: force alignment to 0x1000 for gpu objects
- [PATCH] drm/nouveau: force alignment to 0x1000 for gpu objects
- [PATCH] drm/nouveau: fix error handling in core/core object creation functions
- [PATCH] drm/nouveau: fix nouveau_mm/nouveau_mm_node leak
- [PATCH] drm/nouveau: always do buffer object moves on bo->channel