drm/amdgpu: deduplicate JPEG v5.0 interrupt routine
Subsystems (2)
PATCH 1/1 drm/amdgpu: deduplicate JPEG v5.0 interrupt routine
Both jpeg_v5_0_1.c and jpeg_v5_0_2.c implement identical interrupt processing routines. To avoid code duplication, extract this implementation into a shared common function in new jpeg_v5_0_interrupt.c and .h files.
Signed-off-by Andre Luiz Batista Bueno <[email protected]>
Co-developed-by Enzo Furegatti Spinella <[email protected]>
Signed-off-by Enzo Furegatti Spinella <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/Makefile | 1 + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c | 57 +---------------- drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c | 57 +---------------- .../gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.c | 64 +++++++++++++++++++ .../gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.h | 12 ++++ 5 files changed, 83 insertions(+), 108 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.c create mode 100644 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -0
@@ -229,6 +229,7 @@ amdgpu-y += \ jpeg_v5_0_0.o \ jpeg_v5_0_1.o \ jpeg_v5_0_2.o \ + jpeg_v5_0_interrupt.o \ jpeg_v5_3_0.o # add VPE block
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +3 -54
69 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c +3 -54
69 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.c new file +64 -0
64 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_interrupt.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ + +#ifndef __JPEG_V5_0_INTERRUPT_H__ +#define __JPEG_V5_0_INTERRUPT_H__ + +struct amdgpu_device ; +struct amdgpu_iv_entry ; + +int jpeg_v5_0_process_interrupt_common (struct amdgpu_device *adev, +struct amdgpu_iv_entry *entry); + +#endif /* __JPEG_V5_0_INTERRUPT_H__ */
Signature · 1 line
2.43.0