linux/drivers/gpu/drm/amd/amdgpu
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
..
amdgpu.h drm/amdgpu: add the interface of waiting multiple fences (v4) 2016-11-09 00:28:42 +05:30
amdgpu_acp.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_acp.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_acpi.c drm/amdgpu/atif: Send a hotplug event when we get dgpu display request 2016-09-22 10:30:36 -04:00
amdgpu_afmt.c
amdgpu_amdkfd.c drm/amdgpu: remove unused functions 2016-09-22 10:24:16 -04:00
amdgpu_amdkfd.h
amdgpu_amdkfd_gfx_v7.c drm/amdkfd: Fix possible infinite loop 2016-09-19 20:58:35 +03:00
amdgpu_amdkfd_gfx_v8.c drm/amdkfd: Fix possible infinite loop 2016-09-19 20:58:35 +03:00
amdgpu_atombios.c drm/amdgpu/atom: remove a bunch of unused functions 2016-10-25 14:38:56 -04:00
amdgpu_atombios.h drm/amdgpu/atom: remove a bunch of unused functions 2016-10-25 14:38:56 -04:00
amdgpu_atpx_handler.c Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
amdgpu_benchmark.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_bios.c
amdgpu_bo_list.c
amdgpu_cgs.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_connectors.c drm/amdgpu: simplify encoder and connector setup (v2) 2016-10-25 14:38:06 -04:00
amdgpu_connectors.h
amdgpu_cs.c 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
amdgpu_ctx.c 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
amdgpu_device.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
amdgpu_display.c 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
amdgpu_dpm.c drm/amdgpu/dpm: add an implementation for get_vce_clock_state (v2) 2016-10-25 14:38:41 -04:00
amdgpu_dpm.h drm/amdgpu: when suspend, set boot state instand of disable dpm. 2016-10-27 15:18:19 -04:00
amdgpu_drv.c drm/amdgpu:add one more fiji device id 2016-10-25 14:38:20 -04:00
amdgpu_drv.h
amdgpu_encoders.c
amdgpu_fb.c drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3 2016-10-25 14:38:13 -04:00
amdgpu_fence.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
amdgpu_gart.c drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3 2016-10-25 14:38:13 -04:00
amdgpu_gds.h
amdgpu_gem.c drm/amdgpu: use amdgpu_vm_get_pd_bo in the GEM code 2016-10-25 14:38:30 -04:00
amdgpu_gfx.c drm/amdgpu: change function declarations and add missing header dependencies 2016-10-25 14:38:58 -04:00
amdgpu_gfx.h drm/amdgpu: change function declarations and add missing header dependencies 2016-10-25 14:38:58 -04:00
amdgpu_gtt_mgr.c drm/amdgpu: set at least the node size in the gtt manager 2016-10-25 14:38:15 -04:00
amdgpu_i2c.c drm/amdgpu: warn if dp aux is still attached on free 2016-10-06 12:39:03 -04:00
amdgpu_i2c.h drm/amdgpu/i2c: add const where appropriate 2016-09-27 13:00:52 -04:00
amdgpu_ib.c 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
amdgpu_ih.c drm/amdgpu: free the BO in kernel by helper amdgpu_bo_free_kernel() 2016-09-14 15:10:27 -04:00
amdgpu_ih.h
amdgpu_ioc32.c
amdgpu_irq.c drm/amdgpu: cancel reset work on fini 2016-10-24 16:59:55 -04:00
amdgpu_irq.h
amdgpu_job.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_kms.c 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
amdgpu_mn.c drm/amdgpu: remove adev pointer from struct amdgpu_bo v2 2016-10-25 14:38:26 -04:00
amdgpu_mode.h drm/amd/amdgpu: For virtual display, enable multi crtcs. (v3) 2016-10-25 14:38:07 -04:00
amdgpu_object.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
amdgpu_object.h 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
amdgpu_pll.c drm/amdgpu: add missing header dependencies 2016-09-14 15:10:37 -04:00
amdgpu_pll.h
amdgpu_pm.c drm/amdgpu: refine set power state logic for dpm. 2016-10-25 14:38:53 -04:00
amdgpu_pm.h
amdgpu_powerplay.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_powerplay.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_prime.c
amdgpu_ring.c drm/amdgpu: move align_mask and nop into ring funcs as well (v2) 2016-10-25 14:38:38 -04:00
amdgpu_ring.h 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
amdgpu_sa.c drm/amdgpu: add the interface of waiting multiple fences (v4) 2016-11-09 00:28:42 +05:30
amdgpu_sync.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_sync.h 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
amdgpu_test.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_trace.h dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_trace_points.c
amdgpu_ttm.c 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
amdgpu_ttm.h 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
amdgpu_ucode.c drm/amdgpu:properly fix some JumpTable issues 2016-10-25 14:38:23 -04:00
amdgpu_ucode.h drm/amdgpu:add MEC_STORAGE ucode id for sriov 2016-10-25 14:38:23 -04:00
amdgpu_uvd.c 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
amdgpu_uvd.h dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_vce.c 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
amdgpu_vce.h 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
amdgpu_virt.h drm/amdgpu:cleanup virt related define 2016-09-22 10:24:20 -04:00
amdgpu_vm.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
amdgpu_vm.h 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
amdgpu_vram_mgr.c drm/amdgpu: add VRAM manager v2 2016-10-25 14:38:16 -04:00
atom.c
atom.h
atombios_crtc.c drm/amdgpu: change function declarations and add missing header dependencies 2016-10-25 14:38:58 -04:00
atombios_crtc.h
atombios_dp.c
atombios_dp.h
atombios_encoders.c
atombios_encoders.h
atombios_i2c.c drm/amdgpu: add missing header dependencies 2016-09-14 15:10:37 -04:00
atombios_i2c.h
ci_dpm.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
ci_dpm.h
ci_smc.c
cik.c drm/amdgpu: consolidate atom scratch reg handling for hangs 2016-10-25 14:38:56 -04:00
cik.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik_dpm.h
cik_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik_sdma.c 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
cik_sdma.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cikd.h drm/amdgpu/dce8: simplify hpd code 2016-10-25 14:38:08 -04:00
clearstate_ci.h
clearstate_defs.h
clearstate_vi.h
cz_dpm.c drm/amdgpu: update current ps/requeset ps in adev with real ps. 2016-10-25 14:38:53 -04:00
cz_dpm.h
cz_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cz_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cz_smc.c drm/amdgpu: remove unused functions 2016-09-22 10:24:16 -04:00
cz_smumgr.h
dce_v6_0.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
dce_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v8_0.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
dce_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v10_0.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
dce_v10_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v11_0.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
dce_v11_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_virtual.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_virtual.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v6_0.c 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
gfx_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v7_0.c 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
gfx_v7_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v8_0.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
gfx_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v6_0.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v7_0.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v7_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v8_0.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
gmc_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
iceland_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
iceland_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
iceland_sdma_pkt_open.h
Kconfig drm/amdgpu: remove DRM_AMD_POWERPLAY 2016-10-04 11:15:59 -04:00
kv_dpm.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
kv_dpm.h
kv_smc.c
Makefile drm/amdgpu: add VRAM manager v2 2016-10-25 14:38:16 -04:00
ObjectID.h Revert "drm/amdgpu: Add virtual connector and encoder macros." 2016-10-25 14:38:06 -04:00
ppsmc.h
r600_dpm.h drm/amdgpu: add SI DPM support (v4) 2016-08-31 15:21:09 -04:00
sdma_v2_4.c 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
sdma_v2_4.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
sdma_v3_0.c 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
sdma_v3_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si.c drm/amdgpu: mark symbols static where possible 2016-10-25 14:38:58 -04:00
si.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_dma.c 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
si_dma.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_dpm.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
si_dpm.h drm/amdgpu: add SI DPM support (v4) 2016-08-31 15:21:09 -04:00
si_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_smc.c drm/amdgpu/si/dpm: fix symbol conflicts with radeon 2016-09-14 15:10:40 -04:00
sislands_smc.h drm/amdgpu/si/dpm: fix phase shedding setup 2016-09-28 16:13:17 -04:00
smu_ucode_xfer_vi.h
tonga_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
tonga_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
tonga_sdma_pkt_open.h
uvd_v4_2.c drm/amdgpu: enable uvd bypass mode for CI/VI. 2016-10-27 15:18:38 -04:00
uvd_v4_2.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
uvd_v5_0.c drm/amdgpu: enable uvd bypass mode for CI/VI. 2016-10-27 15:18:38 -04:00
uvd_v5_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
uvd_v6_0.c drm/amdgpu: enable uvd bypass mode for CI/VI. 2016-10-27 15:18:38 -04:00
uvd_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v2_0.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v2_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v3_0.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
vce_v3_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vi.c Linux 4.9-rc4 2016-11-07 09:37:09 +10:00
vi.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vi_dpm.h
vid.h drm/amdgpu: implement raster configuration for gfx v8 2016-09-19 14:38:25 -04:00