]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: fix Kconfig for ISP v2
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 14 May 2024 20:45:45 +0000 (16:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:34:40 +0000 (17:34 -0400)
Add new config option and set proper dependencies for ISP.

v2: add missed guards, drop separate Kconfig

Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Pratap Nirujogi <pratap.nirujogi@amd.com>
drivers/gpu/drm/amd/amdgpu/Kconfig
drivers/gpu/drm/amd/amdgpu/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index 4232ab27f990282cba8174846c12db3b29d964bc..0051fb1b437fb853f21af4afa351522f51180d6e 100644 (file)
@@ -71,6 +71,17 @@ config DRM_AMDGPU_USERPTR
          This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
          isn't already selected to enabled full userptr support.
 
+config DRM_AMD_ISP
+       bool "Enable AMD Image Signal Processor IP support"
+       depends on DRM_AMDGPU
+       select MFD_CORE
+       select PM_GENERIC_DOMAINS if PM
+       help
+       Choose this option to enable ISP IP support for AMD SOCs.
+       This adds the ISP (Image Signal Processor) IP driver and wires
+       it up into the amdgpu driver.  It is required for cameras
+       on APUs which utilize mipi cameras.
+
 config DRM_AMDGPU_WERROR
        bool "Force the compiler to throw an error instead of a warning when compiling"
        depends on DRM_AMDGPU
index a95f93056a5f72975a28c79f023ef8eb3f6c4b0b..2ed06d516e040a34efa3d1807c225acb635726e2 100644 (file)
@@ -324,6 +324,8 @@ amdgpu-y += $(AMD_DISPLAY_FILES)
 endif
 
 # add isp block
+ifneq ($(CONFIG_DRM_AMD_ISP),)
 amdgpu-y += amdgpu_isp.o
+endif
 
 obj-$(CONFIG_DRM_AMDGPU)+= amdgpu.o
index 18738ad06980d25a77d8d1f34856be9e8d5ed365..137a88b8de45366d52a173be93a0a8bdbd0be355 100644 (file)
 #include "amdgpu_xcp.h"
 #include "amdgpu_seq64.h"
 #include "amdgpu_reg_state.h"
+#if defined(CONFIG_DRM_AMD_ISP)
 #include "amdgpu_isp.h"
+#endif
 
 #define MAX_GPU_INSTANCE               64
 
@@ -1048,8 +1050,10 @@ struct amdgpu_device {
        /* display related functionality */
        struct amdgpu_display_manager dm;
 
+#if defined(CONFIG_DRM_AMD_ISP)
        /* isp */
        struct amdgpu_isp               isp;
+#endif
 
        /* mes */
        bool                            enable_mes;
index b2b9498851a1da6dfffc3893682ee4de81abdaea..05031bfd0acfc49b9898063c1dbe5c4a33c0af06 100644 (file)
 #include "jpeg_v5_0_0.h"
 
 #include "amdgpu_vpe.h"
+#if defined(CONFIG_DRM_AMD_ISP)
 #include "amdgpu_isp.h"
+#endif
 
 #define FIRMWARE_IP_DISCOVERY "amdgpu/ip_discovery.bin"
 MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY);
@@ -713,10 +715,12 @@ static void amdgpu_discovery_read_from_harvest_table(struct amdgpu_device *adev,
                        adev->sdma.sdma_mask &=
                                ~(1U << harvest_info->list[i].number_instance);
                        break;
+#if defined(CONFIG_DRM_AMD_ISP)
                case ISP_HWID:
                        adev->isp.harvest_config |=
                                ~(1U << harvest_info->list[i].number_instance);
                        break;
+#endif
                default:
                        break;
                }
@@ -2384,6 +2388,7 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
 
 static int amdgpu_discovery_set_isp_ip_blocks(struct amdgpu_device *adev)
 {
+#if defined(CONFIG_DRM_AMD_ISP)
        switch (amdgpu_ip_version(adev, ISP_HWIP, 0)) {
        case IP_VERSION(4, 1, 0):
        case IP_VERSION(4, 1, 1):
@@ -2392,6 +2397,7 @@ static int amdgpu_discovery_set_isp_ip_blocks(struct amdgpu_device *adev)
        default:
                break;
        }
+#endif
 
        return 0;
 }