drm/amd/amdgpu: Declare isp firmware binary file
Subsystems (2)
PATCH 1/1 drm/amd/amdgpu: Declare isp firmware binary file
Declare isp firmware file isp_4_1_1.bin required by isp4.1.1 device.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 22 +++++++++------------- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h | 2 ++ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 12 +++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h | 2 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 14 +++++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h | 2 +- 6 files changed, 37 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +9 -13
@@ -68,7 +68,7 @@ static int isp_hw_fini(struct amdgpu_ip_block *ip_block)return -ENODEV ; } -static int isp_load_fw_by_psp (struct amdgpu_device *adev) +int isp_load_fw_by_psp (struct amdgpu_device *adev) {const struct common_firmware_header *hdr;char ucode_prefix[10 ];
@@ -80,7 +80,7 @@ static int isp_load_fw_by_psp(struct amdgpu_device *adev)/* read isp fw */ r =amdgpu_ucode_request (adev, &adev->isp.fw,AMDGPU_UCODE_OPTIONAL , -"amdgpu/%s.bin" , ucode_prefix); +"amdgpu/%s.bin" , ucode_prefix);if (r) {amdgpu_ucode_release (&adev->isp.fw);return r;
@@ -103,27 +103,23 @@ static int isp_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;struct amdgpu_isp *isp = &adev->isp; +int r; + + isp->adev = adev; + isp->parent = adev->dev;switch (amdgpu_ip_version (adev,ISP_HWIP ,0 )) {case IP_VERSION (4 ,1 ,0 ): -isp_v4_1_0_set_isp_funcs (isp); + r =isp_v4_1_0_set_isp_funcs (isp);break ;case IP_VERSION (4 ,1 ,1 ): -isp_v4_1_1_set_isp_funcs (isp); + r =isp_v4_1_1_set_isp_funcs (isp);break ;default :return -EINVAL ; } - isp->adev = adev; - isp->parent = adev->dev; - -if (isp_load_fw_by_psp (adev)) { -DRM_DEBUG_DRIVER ("%s: isp fw load failed\n" , __func__); -return -ENOENT ; - } - -return 0 ; +return r; }static bool isp_is_idle (struct amdgpu_ip_block *ip_block)
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h +2 -0
@@ -57,4 +57,6 @@ struct amdgpu_isp {extern const struct amdgpu_ip_block_version isp_v4_1_0_ip_block;extern const struct amdgpu_ip_block_version isp_v4_1_1_ip_block; +int isp_load_fw_by_psp (struct amdgpu_device *adev); +#endif /* __AMDGPU_ISP_H__ */
drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +11 -1
@@ -185,7 +185,17 @@ static const struct isp_funcs isp_v4_1_0_funcs = { .hw_fini = isp_v4_1_0_hw_fini, }; -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_0_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }
drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h +1 -1
@@ -45,6 +45,6 @@#define ISP410_GPIO_SENSOR_OFFSET 0x6613C#define ISP410_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp);#endif
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +13 -1
@@ -29,6 +29,8 @@#include "amdgpu.h" #include "isp_v4_1_1.h" +MODULE_FIRMWARE ("amdgpu/isp_4_1_1.bin" ); +#define ISP_PERFORMANCE_STATE_LOW 0#define ISP_PERFORMANCE_STATE_HIGH 1
@@ -369,7 +371,17 @@ static const struct isp_funcs isp_v4_1_1_funcs = { .hw_fini = isp_v4_1_1_hw_fini, }; -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_1_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h +1 -1
@@ -44,6 +44,6 @@#define ISP411_GPIO_SENSOR_OFFSET 0x6613C#define ISP411_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp);#endif
Signature · 1 line
2.43.0
Quoted 4 lines · Pratap
Declare isp firmware file isp_4_1_1.bin required by isp4.1.1 device.
Suggested-by Alexey Zagorodnikov <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>
I think you should split this into multiple patches. Just one patch to add the declaration, and another patch to change the error handling.
Quoted 156 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 22 +++++++++------------- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h | 2 ++ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 12 +++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h | 2 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 14 +++++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h | 2 +- 6 files changed, 37 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +9
-13@@ -68,7 +68,7 @@ static int isp_hw_fini(struct amdgpu_ip_block *ip_block)return -ENODEV ; } -static int isp_load_fw_by_psp (struct amdgpu_device *adev) +int isp_load_fw_by_psp (struct amdgpu_device *adev) {const struct common_firmware_header *hdr;char ucode_prefix[10 ];@@ -80,7 +80,7 @@ static int isp_load_fw_by_psp(struct amdgpu_device *adev)/* read isp fw */ r =amdgpu_ucode_request (adev, &adev->isp.fw,AMDGPU_UCODE_OPTIONAL , -"amdgpu/%s.bin" , ucode_prefix); +"amdgpu/%s.bin" , ucode_prefix);if (r) {amdgpu_ucode_release (&adev->isp.fw);return r;@@ -103,27 +103,23 @@ static int isp_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;struct amdgpu_isp *isp = &adev->isp; +int r; + + isp->adev = adev; + isp->parent = adev->dev;switch (amdgpu_ip_version (adev,ISP_HWIP ,0 )) {case IP_VERSION (4 ,1 ,0 ): -isp_v4_1_0_set_isp_funcs (isp); + r =isp_v4_1_0_set_isp_funcs (isp);break ;case IP_VERSION (4 ,1 ,1 ): -isp_v4_1_1_set_isp_funcs (isp); + r =isp_v4_1_1_set_isp_funcs (isp);break ;default :return -EINVAL ; } - isp->adev = adev; - isp->parent = adev->dev; - -if (isp_load_fw_by_psp (adev)) { -DRM_DEBUG_DRIVER ("%s: isp fw load failed\n" , __func__); -return -ENOENT ; - } - -return 0 ; +return r; }static bool isp_is_idle (struct amdgpu_ip_block *ip_block)drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h +2
-0@@ -57,4 +57,6 @@ struct amdgpu_isp {extern const struct amdgpu_ip_block_version isp_v4_1_0_ip_block;extern const struct amdgpu_ip_block_version isp_v4_1_1_ip_block; +int isp_load_fw_by_psp (struct amdgpu_device *adev); +#endif /* __AMDGPU_ISP_H__ */ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +11
-1@@ -185,7 +185,17 @@ static const struct isp_funcs isp_v4_1_0_funcs = { .hw_fini = isp_v4_1_0_hw_fini, }; -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_0_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h +1
-1@@ -45,6 +45,6 @@#define ISP410_GPIO_SENSOR_OFFSET 0x6613C#define ISP410_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp);#endif drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +13
-1@@ -29,6 +29,8 @@#include "amdgpu.h" #include "isp_v4_1_1.h" +MODULE_FIRMWARE ("amdgpu/isp_4_1_1.bin" ); +#define ISP_PERFORMANCE_STATE_LOW 0#define ISP_PERFORMANCE_STATE_HIGH 1@@ -369,7 +371,17 @@ static const struct isp_funcs isp_v4_1_1_funcs = { .hw_fini = isp_v4_1_1_hw_fini, }; -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_1_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h +1
-1@@ -44,6 +44,6 @@#define ISP411_GPIO_SENSOR_OFFSET 0x6613C#define ISP411_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp);#endif
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Wednesday, September 3, 2025 2:43 PM
To: Nirujogi, Pratap <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Limonciello, Mario <[email protected]>
Cc: Chan, Benjamin (Koon Pan) <[email protected]>; Du, Bin <[email protected]>; Rosikopulos, Gjorgji <[email protected]>; Li, King <[email protected]>; Antony, Dominic <[email protected]>; Jawich, Phil <[email protected]>; Alexey Zagorodnikov <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: Declare isp firmware binary file
Quoted 4 lines · Pratap
Declare isp firmware file isp_4_1_1.bin required by isp4.1.1 device.
Suggested-by Alexey Zagorodnikov <[email protected]>Signed-off-by Pratap Nirujogi <[email protected]>
I think you should split this into multiple patches. Just one patch to add the declaration, and another patch to change the error handling.
Hi Mario, yes, this can be split into two patches (a) update fw load sequence (b) declare isp firmware file. Will address it in v2.
Thanks,
Pratap
Quoted 164 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 22 +++++++++------------- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h | 2 ++ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 12 +++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h | 2 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 14 +++++++++++++- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h | 2 +- 6 files changed, 37 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +2
-2@@ -68,7 +68,7 @@ static int isp_hw_fini(struct amdgpu_ip_block *ip_block)return -ENODEV ; } -static int isp_load_fw_by_psp (struct amdgpu_device *adev) +int isp_load_fw_by_psp (struct amdgpu_device *adev) {const struct common_firmware_header *hdr;char ucode_prefix[10 ];@@ -80,7 +80,7 @@ static int isp_load_fw_by_psp(struct amdgpu_device *adev)/* read isp fw */ r =amdgpu_ucode_request (adev, &adev->isp.fw,AMDGPU_UCODE_OPTIONAL , -"amdgpu/%s.bin" , ucode_prefix); +"amdgpu/%s.bin" , ucode_prefix);if (r) {amdgpu_ucode_release (&adev->isp.fw);return r;drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c +7
-11@@ -103,27 +103,23 @@ static int isp_early_init(struct amdgpu_ip_block *ip_block)struct amdgpu_device *adev = ip_block->adev;struct amdgpu_isp *isp = &adev->isp; +int r; + + isp->adev = adev; + isp->parent = adev->dev;switch (amdgpu_ip_version (adev,ISP_HWIP ,0 )) {case IP_VERSION (4 ,1 ,0 ): -isp_v4_1_0_set_isp_funcs (isp); + r =isp_v4_1_0_set_isp_funcs (isp);break ;case IP_VERSION (4 ,1 ,1 ): -isp_v4_1_1_set_isp_funcs (isp); + r =isp_v4_1_1_set_isp_funcs (isp);break ;default :return -EINVAL ; } - isp->adev = adev; - isp->parent = adev->dev; - -if (isp_load_fw_by_psp (adev)) { -DRM_DEBUG_DRIVER ("%s: isp fw load failed\n" , __func__); -return -ENOENT ; - } - -return 0 ; +return r; }static bool
isp_is_idle(struct amdgpu_ip_block *ip_block)diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.hb/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h
indexd6f4ffa4c97c..36750123ed46100644drivers/gpu/drm/amd/amdgpu/amdgpu_isp.h +2
-0@@ -57,4 +57,6 @@ struct amdgpu_isp {extern const struct amdgpu_ip_block_version isp_v4_1_0_ip_block;extern const struct amdgpu_ip_block_version isp_v4_1_1_ip_block; +int isp_load_fw_by_psp (struct amdgpu_device *adev); +#endif /* __AMDGPU_ISP_H__ */ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +11
-1@@ -185,7 +185,17 @@ static const struct isp_funcs isp_v4_1_0_funcs = { .hw_fini = isp_v4_1_0_hw_fini, }; -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_0_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h +1
-1@@ -45,6 +45,6 @@#define ISP410_GPIO_SENSOR_OFFSET 0x6613C#define ISP410_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp);#endif drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +13
-1@@ -29,6 +29,8 @@#include "amdgpu.h" #include "isp_v4_1_1.h" +MODULE_FIRMWARE ("amdgpu/isp_4_1_1.bin" ); +#define ISP_PERFORMANCE_STATE_LOW 0#define ISP_PERFORMANCE_STATE_HIGH 1@@ -369,7 +371,17 @@ static const struct isp_funcs isp_v4_1_1_funcs = { .hw_fini = isp_v4_1_1_hw_fini, }; -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp) { +struct amdgpu_device *adev = isp->adev; + isp->funcs = &isp_v4_1_1_funcs; + +/* load isp firmware */ +if (isp_load_fw_by_psp (adev)) { +drm_err (&adev->ddev,"isp fw load failed\n" ); +return -ENOENT ; + } + +return 0 ; }drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h +1
-1@@ -44,6 +44,6 @@#define ISP411_GPIO_SENSOR_OFFSET 0x6613C#define ISP411_GPIO_SENSOR_SIZE 0x54 -void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp); +int isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp);#endif