[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161109114217.GO25290@imgtec.com>
Date: Wed, 9 Nov 2016 11:42:17 +0000
From: Eric Engestrom <eric.engestrom@...tec.com>
To: Eric Engestrom <eric@...estrom.ch>, <linux-kernel@...r.kernel.org>,
David Airlie <airlied@...ux.ie>,
<dri-devel@...ts.freedesktop.org>,
Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
Daniel Vetter <daniel.vetter@...el.com>,
Flora Cui <Flora.Cui@....com>,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
Tom St Denis <tom.stdenis@....com>,
Chunming Zhou <David1.Zhou@....com>,
Thomas Hellstrom <thellstrom@...are.com>,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
Sinclair Yeh <syeh@...are.com>,
Xinliang Liu <z.liuxinliang@...ilicon.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
VMware Graphics <linux-graphics-maintainer@...are.com>,
Vitaly Prosyak <vitaly.prosyak@....com>,
Alexandre Demers <alexandre.f.demers@...il.com>,
Jani Nikula <jani.nikula@...el.com>,
<intel-gfx@...ts.freedesktop.org>, Emily Deng <Emily.Deng@....com>,
Colin Ian King <colin.king@...onical.com>,
Junwei Zhang <Jerry.Zhang@....com>,
Michel Dänzer <michel.daenzer@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>
Subject: Re: [Intel-gfx] [PATCH v3] drm: move allocation out of
drm_get_format_name()
On Wednesday, 2016-11-09 02:13:25 +0100, Daniel Vetter wrote:
> On Wed, Nov 09, 2016 at 02:09:16AM +0100, Daniel Vetter wrote:
> > On Wed, Nov 09, 2016 at 12:17:52AM +0000, Eric Engestrom wrote:
> > > The function's behaviour was changed in 90844f00049e, without changing
> > > its signature, causing people to keep using it the old way without
> > > realising they were now leaking memory.
> > > Rob Clark also noticed it was also allocating GFP_KERNEL memory in
> > > atomic contexts, breaking them.
> > >
> > > Instead of having to allocate GFP_ATOMIC memory and fixing the callers
> > > to make them cleanup the memory afterwards, let's change the function's
> > > signature by having the caller take care of the memory and passing it to
> > > the function.
> > > The new parameter is a single-field struct in order to enforce the size
> > > of its buffer and help callers to correctly manage their memory.
> > >
> > > Fixes: 90844f00049e ("drm: make drm_get_format_name thread-safe")
> > > Cc: Rob Clark <robdclark@...il.com>
> > > Cc: Christian König <christian.koenig@....com>
> > > Acked-by: Christian König <christian.koenig@....com>
> > > Acked-by: Rob Clark <robdclark@...il.com>
> > > Acked-by: Sinclair Yeh <syeh@...are.com> (vmwgfx)
> > > Reviewed-by: Jani Nikula <jani.nikula@...el.com>
> > > Suggested-by: Ville Syrjälä <ville.syrjala@...ux.intel.com>
> > > Signed-off-by: Eric Engestrom <eric@...estrom.ch>
> > > ---
> > > v3 - fix "Fixes" tag, replace it with an actual commit message
> > > - collect ack & r-b
> > >
> > > v2 - use single-field struct instead of typedef to let the compiler
> > > enforce the type (Christian König)
> >
> > Applied to drm-misc, thanks.
>
> Well, had to drop it again since it didn't compile:
>
>
> CC [M] drivers/gpu/drm/drm_blend.o
> drivers/gpu/drm/drm_atomic.c: In function ‘drm_atomic_plane_print_state’:
> drivers/gpu/drm/drm_atomic.c:920:5: error: too few arguments to function ‘drm_get_format_name’
> drm_get_format_name(fb->pixel_format));
> ^~~~~~~~~~~~~~~~~~~
> In file included from ./include/drm/drmP.h:71:0,
> from drivers/gpu/drm/drm_atomic.c:29:
> ./include/drm/drm_fourcc.h:65:7: note: declared here
> char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf);
> ^~~~~~~~~~~~~~~~~~~
>
> Can you pls rebase onto drm-misc or linux-next or something?
That was based on airlied/drm-next (last fetched on Sunday I think),
I can rebase it on drm-misc if it helps, but it seems older than
drm-next.
Should I just rebase on top of current head of drm-next?
Powered by blists - more mailing lists