Merge tag 'drm-next-2025-08-01' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
"Just a bunch of amdgpu and xe fixes.

amdgpu:
- DSC divide by 0 fix
- clang fix
- DC debugfs fix
- Userq fixes
- Avoid extra evict-restore with KFD
- Backlight fix
- Documentation fix
- RAS fix
- Add new kicker handling
- DSC fix for DCN 3.1.4
- PSR fix
- Atomic fix
- DC reset fixes
- DCN 3.0.1 fix
- MMHUB client mapping fix

xe:
- Fix BMG probe on unsupported mailbox command
- Fix OA static checker warning about null gt
- Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter
- Fix missing unwind goto in GuC/HuC
- Don't register I2C devices if VF
- Clear whole GuC g2h_fence during initialization
- Avoid call kfree for drmm_kzalloc
- Fix pci_dev reference leak on configfs
- SRIOV: Disable CSC support on VF

* tag 'drm-next-2025-08-01' of https://gitlab.freedesktop.org/drm/kernel: (24 commits)
drm/xe/vf: Disable CSC support on VF
drm/amdgpu: update mmhub 4.1.0 client id mappings
drm/amd/display: Allow DCN301 to clear update flags
drm/amd/display: Pass up errors for reset GPU that fails to init HW
drm/amd/display: Only finalize atomic_obj if it was initialized
drm/amd/display: Avoid configuring PSR granularity if PSR-SU not supported
drm/amd/display: Disable dsc_power_gate for dcn314 by default
drm/amdgpu: add kicker fws loading for gfx12/smu14/psp14
drm/amd/amdgpu: fix missing lock for cper.ring->rptr/wptr access
drm/amd/display: Fix misuse of /** to /* in 'dce_i2c_hw.c'
drm/amd/display: fix initial backlight brightness calculation
drm/amdgpu: Avoid extra evict-restore process.
drm/amdgpu: track whether a queue is a kernel queue in amdgpu_mqd_prop
drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities
drm/amdgpu: Initialize data to NULL in imu_v12_0_program_rlc_ram()
drm/amd/display: Fix divide by zero when calculating min ODM factor
drm/xe/configfs: Fix pci_dev reference leak
drm/xe/hw_engine_group: Avoid call kfree() for drmm_kzalloc()
drm/xe/guc: Clear whole g2h_fence during initialization
drm/xe/vf: Don't register I2C devices if VF
...

+112 -95
+1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 883 uint64_t csa_addr; 884 uint64_t fence_address; 885 bool tmz_queue; 886 }; 887 888 struct amdgpu_mqd {
··· 883 uint64_t csa_addr; 884 uint64_t fence_address; 885 bool tmz_queue; 886 + bool kernel_queue; 887 }; 888 889 struct amdgpu_mqd {
+5 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
··· 459 460 void amdgpu_cper_ring_write(struct amdgpu_ring *ring, void *src, int count) 461 { 462 - u64 pos, wptr_old, rptr = *ring->rptr_cpu_addr & ring->ptr_mask; 463 int rec_cnt_dw = count >> 2; 464 u32 chunk, ent_sz; 465 u8 *s = (u8 *)src; ··· 472 return; 473 } 474 475 - wptr_old = ring->wptr; 476 - 477 mutex_lock(&ring->adev->cper.ring_lock); 478 while (count) { 479 ent_sz = amdgpu_cper_ring_get_ent_sz(ring, ring->wptr); 480 chunk = umin(ent_sz, count);
··· 459 460 void amdgpu_cper_ring_write(struct amdgpu_ring *ring, void *src, int count) 461 { 462 + u64 pos, wptr_old, rptr; 463 int rec_cnt_dw = count >> 2; 464 u32 chunk, ent_sz; 465 u8 *s = (u8 *)src; ··· 472 return; 473 } 474 475 mutex_lock(&ring->adev->cper.ring_lock); 476 + 477 + wptr_old = ring->wptr; 478 + rptr = *ring->rptr_cpu_addr & ring->ptr_mask; 479 + 480 while (count) { 481 ent_sz = amdgpu_cper_ring_get_ent_sz(ring, ring->wptr); 482 chunk = umin(ent_sz, count);
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
··· 719 prop->eop_gpu_addr = ring->eop_gpu_addr; 720 prop->use_doorbell = ring->use_doorbell; 721 prop->doorbell_index = ring->doorbell_index; 722 723 /* map_queues packet doesn't need activate the queue, 724 * so only kiq need set this field.
··· 719 prop->eop_gpu_addr = ring->eop_gpu_addr; 720 prop->use_doorbell = ring->use_doorbell; 721 prop->doorbell_index = ring->doorbell_index; 722 + prop->kernel_queue = true; 723 724 /* map_queues packet doesn't need activate the queue, 725 * so only kiq need set this field.
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
··· 32 33 static const struct kicker_device kicker_device_list[] = { 34 {0x744B, 0x00}, 35 }; 36 37 static void amdgpu_ucode_print_common_hdr(const struct common_firmware_header *hdr)
··· 32 33 static const struct kicker_device kicker_device_list[] = { 34 {0x744B, 0x00}, 35 + {0x7551, 0xC8} 36 }; 37 38 static void amdgpu_ucode_print_common_hdr(const struct common_firmware_header *hdr)
+2 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 2414 */ 2415 long amdgpu_vm_wait_idle(struct amdgpu_vm *vm, long timeout) 2416 { 2417 - timeout = dma_resv_wait_timeout(vm->root.bo->tbo.base.resv, 2418 - DMA_RESV_USAGE_BOOKKEEP, 2419 - true, timeout); 2420 if (timeout <= 0) 2421 return timeout; 2422 2423 - return dma_fence_wait_timeout(vm->last_unlocked, true, timeout); 2424 } 2425 2426 static void amdgpu_vm_destroy_task_info(struct kref *kref)
··· 2414 */ 2415 long amdgpu_vm_wait_idle(struct amdgpu_vm *vm, long timeout) 2416 { 2417 + timeout = drm_sched_entity_flush(&vm->immediate, timeout); 2418 if (timeout <= 0) 2419 return timeout; 2420 2421 + return drm_sched_entity_flush(&vm->delayed, timeout); 2422 } 2423 2424 static void amdgpu_vm_destroy_task_info(struct kref *kref)
+10 -4
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
··· 79 MODULE_FIRMWARE("amdgpu/gc_12_0_1_me.bin"); 80 MODULE_FIRMWARE("amdgpu/gc_12_0_1_mec.bin"); 81 MODULE_FIRMWARE("amdgpu/gc_12_0_1_rlc.bin"); 82 MODULE_FIRMWARE("amdgpu/gc_12_0_1_toc.bin"); 83 84 static const struct amdgpu_hwip_reg_entry gc_reg_list_12_0[] = { ··· 587 588 static int gfx_v12_0_init_microcode(struct amdgpu_device *adev) 589 { 590 - char ucode_prefix[15]; 591 int err; 592 const struct rlc_firmware_header_v2_0 *rlc_hdr; 593 uint16_t version_major; ··· 614 amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK); 615 616 if (!amdgpu_sriov_vf(adev)) { 617 - err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, 618 - AMDGPU_UCODE_REQUIRED, 619 - "amdgpu/%s_rlc.bin", ucode_prefix); 620 if (err) 621 goto out; 622 rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
··· 79 MODULE_FIRMWARE("amdgpu/gc_12_0_1_me.bin"); 80 MODULE_FIRMWARE("amdgpu/gc_12_0_1_mec.bin"); 81 MODULE_FIRMWARE("amdgpu/gc_12_0_1_rlc.bin"); 82 + MODULE_FIRMWARE("amdgpu/gc_12_0_1_rlc_kicker.bin"); 83 MODULE_FIRMWARE("amdgpu/gc_12_0_1_toc.bin"); 84 85 static const struct amdgpu_hwip_reg_entry gc_reg_list_12_0[] = { ··· 586 587 static int gfx_v12_0_init_microcode(struct amdgpu_device *adev) 588 { 589 + char ucode_prefix[30]; 590 int err; 591 const struct rlc_firmware_header_v2_0 *rlc_hdr; 592 uint16_t version_major; ··· 613 amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_ME_P0_STACK); 614 615 if (!amdgpu_sriov_vf(adev)) { 616 + if (amdgpu_is_kicker_fw(adev)) 617 + err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, 618 + AMDGPU_UCODE_REQUIRED, 619 + "amdgpu/%s_rlc_kicker.bin", ucode_prefix); 620 + else 621 + err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, 622 + AMDGPU_UCODE_REQUIRED, 623 + "amdgpu/%s_rlc.bin", ucode_prefix); 624 if (err) 625 goto out; 626 rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
+9 -4
drivers/gpu/drm/amd/amdgpu/imu_v12_0.c
··· 34 35 MODULE_FIRMWARE("amdgpu/gc_12_0_0_imu.bin"); 36 MODULE_FIRMWARE("amdgpu/gc_12_0_1_imu.bin"); 37 38 #define TRANSFER_RAM_MASK 0x001c0000 39 40 static int imu_v12_0_init_microcode(struct amdgpu_device *adev) 41 { 42 - char ucode_prefix[15]; 43 int err; 44 const struct imu_firmware_header_v1_0 *imu_hdr; 45 struct amdgpu_firmware_info *info = NULL; ··· 48 DRM_DEBUG("\n"); 49 50 amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix)); 51 - err = amdgpu_ucode_request(adev, &adev->gfx.imu_fw, AMDGPU_UCODE_REQUIRED, 52 - "amdgpu/%s_imu.bin", ucode_prefix); 53 if (err) 54 goto out; 55 ··· 367 static void imu_v12_0_program_rlc_ram(struct amdgpu_device *adev) 368 { 369 u32 reg_data, size = 0; 370 - const u32 *data; 371 int r = -EINVAL; 372 373 WREG32_SOC15(GC, 0, regGFX_IMU_RLC_RAM_INDEX, 0x2);
··· 34 35 MODULE_FIRMWARE("amdgpu/gc_12_0_0_imu.bin"); 36 MODULE_FIRMWARE("amdgpu/gc_12_0_1_imu.bin"); 37 + MODULE_FIRMWARE("amdgpu/gc_12_0_1_imu_kicker.bin"); 38 39 #define TRANSFER_RAM_MASK 0x001c0000 40 41 static int imu_v12_0_init_microcode(struct amdgpu_device *adev) 42 { 43 + char ucode_prefix[30]; 44 int err; 45 const struct imu_firmware_header_v1_0 *imu_hdr; 46 struct amdgpu_firmware_info *info = NULL; ··· 47 DRM_DEBUG("\n"); 48 49 amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix)); 50 + if (amdgpu_is_kicker_fw(adev)) 51 + err = amdgpu_ucode_request(adev, &adev->gfx.imu_fw, AMDGPU_UCODE_REQUIRED, 52 + "amdgpu/%s_imu_kicker.bin", ucode_prefix); 53 + else 54 + err = amdgpu_ucode_request(adev, &adev->gfx.imu_fw, AMDGPU_UCODE_REQUIRED, 55 + "amdgpu/%s_imu.bin", ucode_prefix); 56 if (err) 57 goto out; 58 ··· 362 static void imu_v12_0_program_rlc_ram(struct amdgpu_device *adev) 363 { 364 u32 reg_data, size = 0; 365 + const u32 *data = NULL; 366 int r = -EINVAL; 367 368 WREG32_SOC15(GC, 0, regGFX_IMU_RLC_RAM_INDEX, 0x2);
+13 -21
drivers/gpu/drm/amd/amdgpu/mmhub_v4_1_0.c
··· 37 static const char *mmhub_client_ids_v4_1_0[][2] = { 38 [0][0] = "VMC", 39 [4][0] = "DCEDMC", 40 - [5][0] = "DCEVGA", 41 [6][0] = "MP0", 42 [7][0] = "MP1", 43 [8][0] = "MPIO", 44 - [16][0] = "HDP", 45 - [17][0] = "LSDMA", 46 - [18][0] = "JPEG", 47 - [19][0] = "VCNU0", 48 - [21][0] = "VSCH", 49 - [22][0] = "VCNU1", 50 - [23][0] = "VCN1", 51 - [32+20][0] = "VCN0", 52 - [2][1] = "DBGUNBIO", 53 [3][1] = "DCEDWB", 54 [4][1] = "DCEDMC", 55 - [5][1] = "DCEVGA", 56 [6][1] = "MP0", 57 [7][1] = "MP1", 58 [8][1] = "MPIO", 59 [10][1] = "DBGU0", 60 [11][1] = "DBGU1", 61 - [12][1] = "DBGU2", 62 - [13][1] = "DBGU3", 63 [14][1] = "XDP", 64 [15][1] = "OSSSYS", 65 - [16][1] = "HDP", 66 - [17][1] = "LSDMA", 67 - [18][1] = "JPEG", 68 - [19][1] = "VCNU0", 69 - [20][1] = "VCN0", 70 - [21][1] = "VSCH", 71 - [22][1] = "VCNU1", 72 - [23][1] = "VCN1", 73 }; 74 75 static uint32_t mmhub_v4_1_0_get_invalidate_req(unsigned int vmid,
··· 37 static const char *mmhub_client_ids_v4_1_0[][2] = { 38 [0][0] = "VMC", 39 [4][0] = "DCEDMC", 40 [6][0] = "MP0", 41 [7][0] = "MP1", 42 [8][0] = "MPIO", 43 + [16][0] = "LSDMA", 44 + [17][0] = "JPEG", 45 + [19][0] = "VCNU", 46 + [22][0] = "VSCH", 47 + [23][0] = "HDP", 48 + [32+23][0] = "VCNRD", 49 [3][1] = "DCEDWB", 50 [4][1] = "DCEDMC", 51 [6][1] = "MP0", 52 [7][1] = "MP1", 53 [8][1] = "MPIO", 54 [10][1] = "DBGU0", 55 [11][1] = "DBGU1", 56 + [12][1] = "DBGUNBIO", 57 [14][1] = "XDP", 58 [15][1] = "OSSSYS", 59 + [16][1] = "LSDMA", 60 + [17][1] = "JPEG", 61 + [18][1] = "VCNWR", 62 + [19][1] = "VCNU", 63 + [22][1] = "VSCH", 64 + [23][1] = "HDP", 65 }; 66 67 static uint32_t mmhub_v4_1_0_get_invalidate_req(unsigned int vmid,
+2
drivers/gpu/drm/amd/amdgpu/psp_v14_0.c
··· 34 MODULE_FIRMWARE("amdgpu/psp_14_0_2_sos.bin"); 35 MODULE_FIRMWARE("amdgpu/psp_14_0_2_ta.bin"); 36 MODULE_FIRMWARE("amdgpu/psp_14_0_3_sos.bin"); 37 MODULE_FIRMWARE("amdgpu/psp_14_0_3_ta.bin"); 38 MODULE_FIRMWARE("amdgpu/psp_14_0_5_toc.bin"); 39 MODULE_FIRMWARE("amdgpu/psp_14_0_5_ta.bin"); 40
··· 34 MODULE_FIRMWARE("amdgpu/psp_14_0_2_sos.bin"); 35 MODULE_FIRMWARE("amdgpu/psp_14_0_2_ta.bin"); 36 MODULE_FIRMWARE("amdgpu/psp_14_0_3_sos.bin"); 37 + MODULE_FIRMWARE("amdgpu/psp_14_0_3_sos_kicker.bin"); 38 MODULE_FIRMWARE("amdgpu/psp_14_0_3_ta.bin"); 39 + MODULE_FIRMWARE("amdgpu/psp_14_0_3_ta_kicker.bin"); 40 MODULE_FIRMWARE("amdgpu/psp_14_0_5_toc.bin"); 41 MODULE_FIRMWARE("amdgpu/psp_14_0_5_ta.bin"); 42
+7 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 3398 link_enc_cfg_copy(adev->dm.dc->current_state, dc_state); 3399 3400 r = dm_dmub_hw_init(adev); 3401 - if (r) 3402 drm_err(adev_to_drm(adev), "DMUB interface failed to initialize: status=%d\n", r); 3403 3404 dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D0); 3405 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); ··· 4985 caps = &dm->backlight_caps[aconnector->bl_idx]; 4986 if (get_brightness_range(caps, &min, &max)) { 4987 if (power_supply_is_system_supplied() > 0) 4988 - props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps->ac_level, 100); 4989 else 4990 - props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps->dc_level, 100); 4991 /* min is zero, so max needs to be adjusted */ 4992 props.max_brightness = max - min; 4993 drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max, ··· 5412 5413 static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm) 5414 { 5415 - drm_atomic_private_obj_fini(&dm->atomic_obj); 5416 } 5417 5418 /******************************************************************************
··· 3398 link_enc_cfg_copy(adev->dm.dc->current_state, dc_state); 3399 3400 r = dm_dmub_hw_init(adev); 3401 + if (r) { 3402 drm_err(adev_to_drm(adev), "DMUB interface failed to initialize: status=%d\n", r); 3403 + return r; 3404 + } 3405 3406 dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D0); 3407 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); ··· 4983 caps = &dm->backlight_caps[aconnector->bl_idx]; 4984 if (get_brightness_range(caps, &min, &max)) { 4985 if (power_supply_is_system_supplied() > 0) 4986 + props.brightness = DIV_ROUND_CLOSEST((max - min) * caps->ac_level, 100); 4987 else 4988 + props.brightness = DIV_ROUND_CLOSEST((max - min) * caps->dc_level, 100); 4989 /* min is zero, so max needs to be adjusted */ 4990 props.max_brightness = max - min; 4991 drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max, ··· 5410 5411 static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm) 5412 { 5413 + if (dm->atomic_obj.state) 5414 + drm_atomic_private_obj_fini(&dm->atomic_obj); 5415 } 5416 5417 /******************************************************************************
+1 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
··· 3988 3989 struct hubbub *hubbub = dc->res_pool->hubbub; 3990 3991 - if (hubbub->funcs->get_mall_en) 3992 hubbub->funcs->get_mall_en(hubbub, &mall_in_use); 3993 3994 if (dc->cap_funcs.get_subvp_en)
··· 3988 3989 struct hubbub *hubbub = dc->res_pool->hubbub; 3990 3991 + if (hubbub && hubbub->funcs->get_mall_en) 3992 hubbub->funcs->get_mall_en(hubbub, &mall_in_use); 3993 3994 if (dc->cap_funcs.get_subvp_en)
+4 -2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
··· 119 psr_config.allow_multi_disp_optimizations = 120 (amdgpu_dc_feature_mask & DC_PSR_ALLOW_MULTI_DISP_OPT); 121 122 - if (!psr_su_set_dsc_slice_height(dc, link, stream, &psr_config)) 123 - return false; 124 125 ret = dc_link_setup_psr(link, stream, &psr_config, &psr_context); 126
··· 119 psr_config.allow_multi_disp_optimizations = 120 (amdgpu_dc_feature_mask & DC_PSR_ALLOW_MULTI_DISP_OPT); 121 122 + if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1) { 123 + if (!psr_su_set_dsc_slice_height(dc, link, stream, &psr_config)) 124 + return false; 125 + } 126 127 ret = dc_link_setup_psr(link, stream, &psr_config, &psr_context); 128
+2 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 5443 else 5444 ret = update_planes_and_stream_v2(dc, srf_updates, 5445 surface_count, stream, stream_update); 5446 - if (ret && dc->ctx->dce_version >= DCN_VERSION_3_2) 5447 clear_update_flags(srf_updates, surface_count, stream); 5448 5449 return ret;
··· 5443 else 5444 ret = update_planes_and_stream_v2(dc, srf_updates, 5445 surface_count, stream, stream_update); 5446 + if (ret && (dc->ctx->dce_version >= DCN_VERSION_3_2 || 5447 + dc->ctx->dce_version == DCN_VERSION_3_01)) 5448 clear_update_flags(srf_updates, surface_count, stream); 5449 5450 return ret;
+7 -1
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
··· 377 } 378 379 /** 380 * If we boot without an HDMI display, the I2C engine does not get initialized 381 * correctly. One of its symptoms is that SW_USE_I2C does not get cleared after 382 - * acquire, so that after setting SW_DONE_USING_I2C on release, the engine gets 383 * immediately reacquired by SW, preventing DMUB from using it. 384 */ 385 static void cntl_stuck_hw_workaround(struct dce_i2c_hw *dce_i2c_hw) 386 {
··· 377 } 378 379 /** 380 + * cntl_stuck_hw_workaround - Workaround for I2C engine stuck state 381 + * @dce_i2c_hw: Pointer to dce_i2c_hw structure 382 + * 383 * If we boot without an HDMI display, the I2C engine does not get initialized 384 * correctly. One of its symptoms is that SW_USE_I2C does not get cleared after 385 + * acquire. After setting SW_DONE_USING_I2C on release, the engine gets 386 * immediately reacquired by SW, preventing DMUB from using it. 387 + * 388 + * This function checks the I2C arbitration status and applies a release 389 + * workaround if necessary. 390 */ 391 static void cntl_stuck_hw_workaround(struct dce_i2c_hw *dce_i2c_hw) 392 {
+15 -14
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 152 } 153 154 /* Forward Declerations */ 155 - static unsigned int get_min_slice_count_for_odm( 156 const struct display_stream_compressor *dsc, 157 const struct dsc_enc_caps *dsc_enc_caps, 158 const struct dc_crtc_timing *timing); ··· 466 struct dc_dsc_bw_range *range) 467 { 468 bool is_dsc_possible = false; 469 - unsigned int min_slice_count; 470 struct dsc_enc_caps dsc_enc_caps; 471 struct dsc_enc_caps dsc_common_caps; 472 struct dc_dsc_config config = {0}; ··· 478 479 get_dsc_enc_caps(dsc, &dsc_enc_caps, timing->pix_clk_100hz); 480 481 - min_slice_count = get_min_slice_count_for_odm(dsc, &dsc_enc_caps, timing); 482 483 is_dsc_possible = intersect_dsc_caps(dsc_sink_caps, &dsc_enc_caps, 484 timing->pixel_encoding, &dsc_common_caps); 485 486 if (is_dsc_possible) 487 is_dsc_possible = setup_dsc_config(dsc_sink_caps, &dsc_enc_caps, 0, timing, 488 - &options, link_encoding, min_slice_count, &config); 489 490 if (is_dsc_possible) 491 is_dsc_possible = decide_dsc_bandwidth_range(min_bpp_x16, max_bpp_x16, ··· 593 594 struct dc *dc; 595 596 - memset(&single_dsc_enc_caps, 0, sizeof(struct dsc_enc_caps)); 597 - 598 if (!dsc || !dsc->ctx || !dsc->ctx->dc || !dsc->funcs->dsc_get_single_enc_caps) 599 return; 600 601 dc = dsc->ctx->dc; 602 603 - if (!dc->clk_mgr || !dc->clk_mgr->funcs->get_max_clock_khz || !dc->res_pool) 604 return; 605 606 /* get max DSCCLK from clk_mgr */ ··· 632 return (value + 9) / 10; 633 } 634 635 - static unsigned int get_min_slice_count_for_odm( 636 const struct display_stream_compressor *dsc, 637 const struct dsc_enc_caps *dsc_enc_caps, 638 const struct dc_crtc_timing *timing) ··· 648 max_dispclk_khz = dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz(dsc->ctx->dc->clk_mgr, CLK_TYPE_DISPCLK); 649 } 650 } 651 652 /* consider minimum odm slices required due to 653 * 1) display pipe throughput (dispclk) ··· 671 { 672 memset(dsc_enc_caps, 0, sizeof(struct dsc_enc_caps)); 673 674 - if (!dsc) 675 return; 676 677 /* check if reported cap global or only for a single DCN DSC enc */ 678 if (dsc->funcs->dsc_get_enc_caps) { 679 - if (!dsc->ctx->dc->debug.disable_dsc) 680 - dsc->funcs->dsc_get_enc_caps(dsc_enc_caps, pixel_clock_100Hz); 681 } else { 682 build_dsc_enc_caps(dsc, dsc_enc_caps); 683 } ··· 1296 { 1297 bool is_dsc_possible = false; 1298 struct dsc_enc_caps dsc_enc_caps; 1299 - unsigned int min_slice_count; 1300 get_dsc_enc_caps(dsc, &dsc_enc_caps, timing->pix_clk_100hz); 1301 1302 - min_slice_count = get_min_slice_count_for_odm(dsc, &dsc_enc_caps, timing); 1303 1304 is_dsc_possible = setup_dsc_config(dsc_sink_caps, 1305 &dsc_enc_caps, ··· 1307 timing, 1308 options, 1309 link_encoding, 1310 - min_slice_count, 1311 dsc_cfg); 1312 return is_dsc_possible; 1313 }
··· 152 } 153 154 /* Forward Declerations */ 155 + static unsigned int get_min_dsc_slice_count_for_odm( 156 const struct display_stream_compressor *dsc, 157 const struct dsc_enc_caps *dsc_enc_caps, 158 const struct dc_crtc_timing *timing); ··· 466 struct dc_dsc_bw_range *range) 467 { 468 bool is_dsc_possible = false; 469 + unsigned int min_dsc_slice_count; 470 struct dsc_enc_caps dsc_enc_caps; 471 struct dsc_enc_caps dsc_common_caps; 472 struct dc_dsc_config config = {0}; ··· 478 479 get_dsc_enc_caps(dsc, &dsc_enc_caps, timing->pix_clk_100hz); 480 481 + min_dsc_slice_count = get_min_dsc_slice_count_for_odm(dsc, &dsc_enc_caps, timing); 482 483 is_dsc_possible = intersect_dsc_caps(dsc_sink_caps, &dsc_enc_caps, 484 timing->pixel_encoding, &dsc_common_caps); 485 486 if (is_dsc_possible) 487 is_dsc_possible = setup_dsc_config(dsc_sink_caps, &dsc_enc_caps, 0, timing, 488 + &options, link_encoding, min_dsc_slice_count, &config); 489 490 if (is_dsc_possible) 491 is_dsc_possible = decide_dsc_bandwidth_range(min_bpp_x16, max_bpp_x16, ··· 593 594 struct dc *dc; 595 596 if (!dsc || !dsc->ctx || !dsc->ctx->dc || !dsc->funcs->dsc_get_single_enc_caps) 597 return; 598 599 dc = dsc->ctx->dc; 600 601 + if (!dc->clk_mgr || !dc->clk_mgr->funcs->get_max_clock_khz || !dc->res_pool || dc->debug.disable_dsc) 602 return; 603 604 /* get max DSCCLK from clk_mgr */ ··· 634 return (value + 9) / 10; 635 } 636 637 + static unsigned int get_min_dsc_slice_count_for_odm( 638 const struct display_stream_compressor *dsc, 639 const struct dsc_enc_caps *dsc_enc_caps, 640 const struct dc_crtc_timing *timing) ··· 650 max_dispclk_khz = dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz(dsc->ctx->dc->clk_mgr, CLK_TYPE_DISPCLK); 651 } 652 } 653 + 654 + /* validate parameters */ 655 + if (max_dispclk_khz == 0 || dsc_enc_caps->max_slice_width == 0) 656 + return 1; 657 658 /* consider minimum odm slices required due to 659 * 1) display pipe throughput (dispclk) ··· 669 { 670 memset(dsc_enc_caps, 0, sizeof(struct dsc_enc_caps)); 671 672 + if (!dsc || !dsc->ctx || !dsc->ctx->dc || dsc->ctx->dc->debug.disable_dsc) 673 return; 674 675 /* check if reported cap global or only for a single DCN DSC enc */ 676 if (dsc->funcs->dsc_get_enc_caps) { 677 + dsc->funcs->dsc_get_enc_caps(dsc_enc_caps, pixel_clock_100Hz); 678 } else { 679 build_dsc_enc_caps(dsc, dsc_enc_caps); 680 } ··· 1295 { 1296 bool is_dsc_possible = false; 1297 struct dsc_enc_caps dsc_enc_caps; 1298 + unsigned int min_dsc_slice_count; 1299 get_dsc_enc_caps(dsc, &dsc_enc_caps, timing->pix_clk_100hz); 1300 1301 + min_dsc_slice_count = get_min_dsc_slice_count_for_odm(dsc, &dsc_enc_caps, timing); 1302 1303 is_dsc_possible = setup_dsc_config(dsc_sink_caps, 1304 &dsc_enc_caps, ··· 1306 timing, 1307 options, 1308 link_encoding, 1309 + min_dsc_slice_count, 1310 dsc_cfg); 1311 return is_dsc_possible; 1312 }
+1
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c
··· 926 .seamless_boot_odm_combine = true, 927 .enable_legacy_fast_update = true, 928 .using_dml2 = false, 929 }; 930 931 static const struct dc_panel_config panel_config_defaults = {
··· 926 .seamless_boot_odm_combine = true, 927 .enable_legacy_fast_update = true, 928 .using_dml2 = false, 929 + .disable_dsc_power_gate = true, 930 }; 931 932 static const struct dc_panel_config panel_config_defaults = {
+8 -3
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c
··· 62 63 MODULE_FIRMWARE("amdgpu/smu_14_0_2.bin"); 64 MODULE_FIRMWARE("amdgpu/smu_14_0_3.bin"); 65 66 #define ENABLE_IMU_ARG_GFXOFF_ENABLE 1 67 68 int smu_v14_0_init_microcode(struct smu_context *smu) 69 { 70 struct amdgpu_device *adev = smu->adev; 71 - char ucode_prefix[15]; 72 int err = 0; 73 const struct smc_firmware_header_v1_0 *hdr; 74 const struct common_firmware_header *header; ··· 80 return 0; 81 82 amdgpu_ucode_ip_version_decode(adev, MP1_HWIP, ucode_prefix, sizeof(ucode_prefix)); 83 - err = amdgpu_ucode_request(adev, &adev->pm.fw, AMDGPU_UCODE_REQUIRED, 84 - "amdgpu/%s.bin", ucode_prefix); 85 if (err) 86 goto out; 87
··· 62 63 MODULE_FIRMWARE("amdgpu/smu_14_0_2.bin"); 64 MODULE_FIRMWARE("amdgpu/smu_14_0_3.bin"); 65 + MODULE_FIRMWARE("amdgpu/smu_14_0_3_kicker.bin"); 66 67 #define ENABLE_IMU_ARG_GFXOFF_ENABLE 1 68 69 int smu_v14_0_init_microcode(struct smu_context *smu) 70 { 71 struct amdgpu_device *adev = smu->adev; 72 + char ucode_prefix[30]; 73 int err = 0; 74 const struct smc_firmware_header_v1_0 *hdr; 75 const struct common_firmware_header *header; ··· 79 return 0; 80 81 amdgpu_ucode_ip_version_decode(adev, MP1_HWIP, ucode_prefix, sizeof(ucode_prefix)); 82 + if (amdgpu_is_kicker_fw(adev)) 83 + err = amdgpu_ucode_request(adev, &adev->pm.fw, AMDGPU_UCODE_REQUIRED, 84 + "amdgpu/%s_kicker.bin", ucode_prefix); 85 + else 86 + err = amdgpu_ucode_request(adev, &adev->pm.fw, AMDGPU_UCODE_REQUIRED, 87 + "amdgpu/%s.bin", ucode_prefix); 88 if (err) 89 goto out; 90
+2 -1
drivers/gpu/drm/xe/xe_configfs.c
··· 267 268 pdev = pci_get_domain_bus_and_slot(domain, bus, PCI_DEVFN(slot, function)); 269 if (!pdev) 270 - return ERR_PTR(-EINVAL); 271 272 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 273 if (!dev)
··· 267 268 pdev = pci_get_domain_bus_and_slot(domain, bus, PCI_DEVFN(slot, function)); 269 if (!pdev) 270 + return ERR_PTR(-ENODEV); 271 + pci_dev_put(pdev); 272 273 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 274 if (!dev)
+1
drivers/gpu/drm/xe/xe_device.c
··· 681 /* disable features that are not available/applicable to VFs */ 682 if (IS_SRIOV_VF(xe)) { 683 xe->info.probe_display = 0; 684 xe->info.has_heci_gscfi = 0; 685 xe->info.skip_guc_pc = 1; 686 xe->info.skip_pcode = 1;
··· 681 /* disable features that are not available/applicable to VFs */ 682 if (IS_SRIOV_VF(xe)) { 683 xe->info.probe_display = 0; 684 + xe->info.has_heci_cscfi = 0; 685 xe->info.has_heci_gscfi = 0; 686 xe->info.skip_guc_pc = 1; 687 xe->info.skip_pcode = 1;
+6 -1
drivers/gpu/drm/xe/xe_device_sysfs.c
··· 160 161 ret = xe_pcode_read(root, PCODE_MBOX(PCODE_LATE_BINDING, GET_CAPABILITY_STATUS, 0), 162 &cap, NULL); 163 - if (ret) 164 goto out; 165 166 if (REG_FIELD_GET(V1_FAN_SUPPORTED, cap)) { 167 ret = sysfs_create_file(&dev->kobj, &dev_attr_lb_fan_control_version.attr);
··· 160 161 ret = xe_pcode_read(root, PCODE_MBOX(PCODE_LATE_BINDING, GET_CAPABILITY_STATUS, 0), 162 &cap, NULL); 163 + if (ret) { 164 + if (ret == -ENXIO) { 165 + drm_dbg(&xe->drm, "Late binding not supported by firmware\n"); 166 + ret = 0; 167 + } 168 goto out; 169 + } 170 171 if (REG_FIELD_GET(V1_FAN_SUPPORTED, cap)) { 172 ret = sysfs_create_file(&dev->kobj, &dev_attr_lb_fan_control_version.attr);
+1 -5
drivers/gpu/drm/xe/xe_guc_ct.c
··· 95 96 static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer) 97 { 98 g2h_fence->response_buffer = response_buffer; 99 - g2h_fence->response_data = 0; 100 - g2h_fence->response_len = 0; 101 - g2h_fence->fail = false; 102 - g2h_fence->retry = false; 103 - g2h_fence->done = false; 104 g2h_fence->seqno = ~0x0; 105 } 106
··· 95 96 static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer) 97 { 98 + memset(g2h_fence, 0, sizeof(*g2h_fence)); 99 g2h_fence->response_buffer = response_buffer; 100 g2h_fence->seqno = ~0x0; 101 } 102
+6 -22
drivers/gpu/drm/xe/xe_hw_engine_group.c
··· 75 enum xe_hw_engine_id id; 76 struct xe_hw_engine_group *group_rcs_ccs, *group_bcs, *group_vcs_vecs; 77 struct xe_device *xe = gt_to_xe(gt); 78 - int err; 79 80 group_rcs_ccs = hw_engine_group_alloc(xe); 81 - if (IS_ERR(group_rcs_ccs)) { 82 - err = PTR_ERR(group_rcs_ccs); 83 - goto err_group_rcs_ccs; 84 - } 85 86 group_bcs = hw_engine_group_alloc(xe); 87 - if (IS_ERR(group_bcs)) { 88 - err = PTR_ERR(group_bcs); 89 - goto err_group_bcs; 90 - } 91 92 group_vcs_vecs = hw_engine_group_alloc(xe); 93 - if (IS_ERR(group_vcs_vecs)) { 94 - err = PTR_ERR(group_vcs_vecs); 95 - goto err_group_vcs_vecs; 96 - } 97 98 for_each_hw_engine(hwe, gt, id) { 99 switch (hwe->class) { ··· 109 } 110 111 return 0; 112 - 113 - err_group_vcs_vecs: 114 - kfree(group_vcs_vecs); 115 - err_group_bcs: 116 - kfree(group_bcs); 117 - err_group_rcs_ccs: 118 - kfree(group_rcs_ccs); 119 - 120 - return err; 121 } 122 123 /**
··· 75 enum xe_hw_engine_id id; 76 struct xe_hw_engine_group *group_rcs_ccs, *group_bcs, *group_vcs_vecs; 77 struct xe_device *xe = gt_to_xe(gt); 78 79 group_rcs_ccs = hw_engine_group_alloc(xe); 80 + if (IS_ERR(group_rcs_ccs)) 81 + return PTR_ERR(group_rcs_ccs); 82 83 group_bcs = hw_engine_group_alloc(xe); 84 + if (IS_ERR(group_bcs)) 85 + return PTR_ERR(group_bcs); 86 87 group_vcs_vecs = hw_engine_group_alloc(xe); 88 + if (IS_ERR(group_vcs_vecs)) 89 + return PTR_ERR(group_vcs_vecs); 90 91 for_each_hw_engine(hwe, gt, id) { 92 switch (hwe->class) { ··· 116 } 117 118 return 0; 119 } 120 121 /**
+5 -2
drivers/gpu/drm/xe/xe_i2c.c
··· 96 int ret; 97 98 fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL); 99 - if (!fwnode) 100 - return -ENOMEM; 101 102 /* 103 * Not using platform_device_register_full() here because we don't have ··· 281 int ret; 282 283 if (xe->info.platform != XE_BATTLEMAGE) 284 return 0; 285 286 xe_i2c_read_endpoint(xe_root_tile_mmio(xe), &ep);
··· 96 int ret; 97 98 fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL); 99 + if (IS_ERR(fwnode)) 100 + return PTR_ERR(fwnode); 101 102 /* 103 * Not using platform_device_register_full() here because we don't have ··· 281 int ret; 282 283 if (xe->info.platform != XE_BATTLEMAGE) 284 + return 0; 285 + 286 + if (IS_SRIOV_VF(xe)) 287 return 0; 288 289 xe_i2c_read_endpoint(xe_root_tile_mmio(xe), &ep);
+1 -1
drivers/gpu/drm/xe/xe_oa.c
··· 1941 1942 /* If not provided, OA unit defaults to OA unit 0 as per uapi */ 1943 if (!param->oa_unit) 1944 - param->oa_unit = &xe_device_get_gt(oa->xe, 0)->oa.oa_unit[0]; 1945 1946 /* When we have an exec_q, get hwe from the exec_q */ 1947 if (param->exec_q) {
··· 1941 1942 /* If not provided, OA unit defaults to OA unit 0 as per uapi */ 1943 if (!param->oa_unit) 1944 + param->oa_unit = &xe_root_mmio_gt(oa->xe)->oa.oa_unit[0]; 1945 1946 /* When we have an exec_q, get hwe from the exec_q */ 1947 if (param->exec_q) {
+1 -1
drivers/gpu/drm/xe/xe_uc.c
··· 164 165 err = xe_guc_opt_in_features_enable(&uc->guc); 166 if (err) 167 - return err; 168 169 err = xe_gt_record_default_lrcs(uc_to_gt(uc)); 170 if (err)
··· 164 165 err = xe_guc_opt_in_features_enable(&uc->guc); 166 if (err) 167 + goto err_out; 168 169 err = xe_gt_record_default_lrcs(uc_to_gt(uc)); 170 if (err)