Skip to contentSkip to conversation

drm/amdgpu: deduplicate JPEG v5.0 interrupt routine

PATCH Superseded Andre Luiz Batista Bueno 1 participant 1 message Apr 22

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

---
 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
index db66c6372199..69e5e55e1a2b 100644
@@ -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
new file mode 100644
index 000000000000..046bcb4a3906
@@ -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