linux/drivers/gpu/drm
Eric Engestrom b3c11ac267 drm: move allocation out of drm_get_format_name()
The function's behaviour was changed in 90844f0004, 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: 90844f0004 ("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>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161112011309.9799-1-eric@engestrom.ch
2016-11-12 14:19:38 +01:00
..
amd drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
arc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
arm Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next 2016-11-11 10:00:58 +10:00
armada drm: convert DT component matching to component_match_add_release() 2016-10-25 11:52:38 -04:00
ast Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
atmel-hlcdc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
bochs drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
bridge dw-hdmi i2c master controller 2016-11-11 09:57:54 +10:00
cirrus Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
etnaviv drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
exynos Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
fsl-dcu drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
gma500 drm/gma500: remove unused ioctl declarations 2016-11-08 10:45:10 +01:00
hisilicon drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
i2c drm/i2c/tda998x: mark symbol static where possible 2016-10-24 16:27:16 +02:00
i810 drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
i915 drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
imx imx-drm plane update cleanup, YUV formats 2016-11-11 09:31:27 +10:00
mediatek drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
mga
mgag200 Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
msm drm/msm: module param to dump state on error irq 2016-11-08 16:38:03 -05:00
nouveau drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutex 2016-11-07 14:05:13 +10:00
omapdrm drm/omap: panel-lgphilips-lb035q02: Add note for incorrect data drive edge and DE level 2016-11-02 10:48:18 +02:00
panel
qxl Merge tag 'topic/drm-misc-2016-10-27' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2016-10-28 11:33:52 +10:00
r128
radeon drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
rcar-du Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
rockchip drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
savage drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
shmobile drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
sis drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
sti Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
sun4i drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
tdfx drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
tegra drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
tilcdc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
ttm drm/ttm: fix ttm_bo_wait 2016-11-09 00:46:04 +05:30
udl drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
vc4 drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
vgem dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
via drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
virtio Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
vmwgfx drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
zte ZTE zxdrm driver support for 4.10: 2016-11-11 10:09:13 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_atomic_helper.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
drm_auth.c
drm_blend.c drm: RIP mode_config->rotation_property 2016-10-22 10:42:11 +02:00
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_color_mgmt.c
drm_connector.c
drm_context.c
drm_crtc.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_debugfs.c drm/atomic: add debugfs file to dump out atomic state 2016-11-08 16:38:03 -05:00
drm_debugfs_crc.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_dual_mode_helper.c drm: Print some debug/error info during DP dual mode detect 2016-10-26 15:57:11 -04:00
drm_dp_helper.c
drm_dp_mst_topology.c drm/dp/mst: Check peer device type before attempting EDID read 2016-10-26 18:53:44 +02:00
drm_drv.c drm: Add missing mutex_destroy in drm_dev_init/release 2016-11-11 14:10:03 +01:00
drm_edid.c drm/edid: Add the missing "Hz" to VIC 58,59 comment 2016-11-08 11:09:06 +01:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
drm_flip_work.c
drm_fops.c drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
drm_fourcc.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_framebuffer.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_gem.c
drm_gem_cma_helper.c
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm: Add stackdepot include for DRM_DEBUG_MM 2016-11-08 13:46:49 +01:00
drm_mode_object.c
drm_modes.c drm: helper macros to print composite types 2016-11-08 16:38:03 -05:00
drm_modeset_helper.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_modeset_lock.c
drm_of.c drm: convert DT component matching to component_match_add_release() 2016-10-25 11:52:38 -04:00
drm_panel.c
drm_pci.c
drm_plane.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_plane_helper.c drm: add helpers to go from plane state to drm_rect 2016-11-08 16:38:03 -05:00
drm_platform.c
drm_prime.c
drm_print.c drm: add helper for printing to log or seq_file 2016-11-08 16:38:03 -05:00
drm_probe_helper.c
drm_property.c
drm_rect.c drm: helper macros to print composite types 2016-11-08 16:38:03 -05:00
drm_scatter.c
drm_simple_kms_helper.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vm.c
drm_vma_manager.c
Kconfig ZTE zxdrm driver support for 4.10: 2016-11-11 10:09:13 +10:00
Makefile ZTE zxdrm driver support for 4.10: 2016-11-11 10:09:13 +10:00