lkml.org 
[lkml]   [2016]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Intel-gfx] [PATCH v3] drm: move allocation out of drm_get_format_name()
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@gmail.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Acked-by: Christian König <christian.koenig@amd.com>
> > Acked-by: Rob Clark <robdclark@gmail.com>
> > Acked-by: Sinclair Yeh <syeh@vmware.com> (vmwgfx)
> > Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> > Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Eric Engestrom <eric@engestrom.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?

Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

\
 
 \ /
  Last update: 2016-11-09 02:19    [W:0.248 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site