From: jsg Date: Thu, 23 Feb 2023 02:24:10 +0000 (+0000) Subject: drm/amd/display: Properly handle additional cases where DCN is not supported X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=91354d167aa9c40abb01ec37b3075692d767e95d;p=openbsd drm/amd/display: Properly handle additional cases where DCN is not supported From Alex Deucher b4e79d0c7f9bb938525716b3e05cfca6418e2bae in linux-6.1.y/6.1.13 6fc547a5a2ef5ce05b16924106663ab92f8f87a7 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e1c98e9a53c..4f4ff3180c6 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4528,6 +4528,17 @@ DEVICE_ATTR_WO(s3_debug); static int dm_early_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + struct amdgpu_mode_info *mode_info = &adev->mode_info; + struct atom_context *ctx = mode_info->atom_context; + int index = GetIndexIntoMasterTable(DATA, Object_Header); + u16 data_offset; + + /* if there is no object header, skip DM */ + if (!amdgpu_atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset)) { + adev->harvest_ip_mask |= AMD_HARVEST_IP_DMU_MASK; + dev_info(adev->dev, "No object header, skipping DM\n"); + return -ENOENT; + } switch (adev->asic_type) { #if defined(CONFIG_DRM_AMD_DC_SI)