Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'amd-drm-fixes-6.19-2026-02-05' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.19-2026-02-05:

amdgpu:
- MES 11 old firmware compatibility fix
- ASPM fix
- DC LUT fixes

amdkfd:
- Fix possible double deletion of validate list

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20260205182017.2409773-1-alexander.deucher@amd.com

+64 -41
+9 -9
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
··· 1920 1920 1921 1921 /* Make sure restore workers don't access the BO any more */ 1922 1922 mutex_lock(&process_info->lock); 1923 - list_del(&mem->validate_list); 1923 + if (!list_empty(&mem->validate_list)) 1924 + list_del_init(&mem->validate_list); 1924 1925 mutex_unlock(&process_info->lock); 1925 - 1926 - /* Cleanup user pages and MMU notifiers */ 1927 - if (amdgpu_ttm_tt_get_usermm(mem->bo->tbo.ttm)) { 1928 - amdgpu_hmm_unregister(mem->bo); 1929 - mutex_lock(&process_info->notifier_lock); 1930 - amdgpu_hmm_range_free(mem->range); 1931 - mutex_unlock(&process_info->notifier_lock); 1932 - } 1933 1926 1934 1927 ret = reserve_bo_and_cond_vms(mem, NULL, BO_VM_ALL, &ctx); 1935 1928 if (unlikely(ret)) 1936 1929 return ret; 1930 + 1931 + /* Cleanup user pages and MMU notifiers */ 1932 + if (amdgpu_ttm_tt_get_usermm(mem->bo->tbo.ttm)) { 1933 + amdgpu_hmm_unregister(mem->bo); 1934 + amdgpu_hmm_range_free(mem->range); 1935 + mem->range = NULL; 1936 + } 1937 1937 1938 1938 amdgpu_amdkfd_remove_eviction_fence(mem->bo, 1939 1939 process_info->eviction_fence);
-3
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 2405 2405 return -ENODEV; 2406 2406 } 2407 2407 2408 - if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev)) 2409 - amdgpu_aspm = 0; 2410 - 2411 2408 if (amdgpu_virtual_display || 2412 2409 amdgpu_device_asic_has_dc_support(pdev, flags & AMD_ASIC_MASK)) 2413 2410 supports_atomic = true;
+1 -1
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
··· 1671 1671 if (r) 1672 1672 goto failure; 1673 1673 1674 - if ((adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x50) { 1674 + if ((adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x52) { 1675 1675 r = mes_v11_0_set_hw_resources_1(&adev->mes); 1676 1676 if (r) { 1677 1677 DRM_ERROR("failed mes_v11_0_set_hw_resources_1, r=%d\n", r);
+29 -8
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c
··· 105 105 #define NUMBER_REGIONS 32 106 106 #define NUMBER_SW_SEGMENTS 16 107 107 108 - bool cm3_helper_translate_curve_to_hw_format( 109 - const struct dc_transfer_func *output_tf, 110 - struct pwl_params *lut_params, bool fixpoint) 108 + #define DC_LOGGER \ 109 + ctx->logger 110 + 111 + bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx, 112 + const struct dc_transfer_func *output_tf, 113 + struct pwl_params *lut_params, bool fixpoint) 111 114 { 112 115 struct curve_points3 *corner_points; 113 116 struct pwl_result_data *rgb_resulted; ··· 165 162 if (seg_distr[k] != -1) 166 163 hw_points += (1 << seg_distr[k]); 167 164 } 165 + 166 + // DCN3+ have 257 pts in lieu of no separate slope registers 167 + // Prior HW had 256 base+slope pairs 168 + // Shaper LUT (i.e. fixpoint == true) is still 256 bases and 256 deltas 169 + hw_points = fixpoint ? (hw_points - 1) : hw_points; 168 170 169 171 j = 0; 170 172 for (k = 0; k < (region_end - region_start); k++) { ··· 231 223 corner_points[1].green.slope = dc_fixpt_zero; 232 224 corner_points[1].blue.slope = dc_fixpt_zero; 233 225 234 - // DCN3+ have 257 pts in lieu of no separate slope registers 235 - // Prior HW had 256 base+slope pairs 236 226 lut_params->hw_points_num = hw_points + 1; 237 227 238 228 k = 0; ··· 254 248 if (fixpoint == true) { 255 249 i = 1; 256 250 while (i != hw_points + 2) { 251 + uint32_t red_clamp; 252 + uint32_t green_clamp; 253 + uint32_t blue_clamp; 254 + 257 255 if (i >= hw_points) { 258 256 if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) 259 257 rgb_plus_1->red = dc_fixpt_add(rgb->red, ··· 270 260 rgb_minus_1->delta_blue); 271 261 } 272 262 273 - rgb->delta_red_reg = dc_fixpt_clamp_u0d10(rgb->delta_red); 274 - rgb->delta_green_reg = dc_fixpt_clamp_u0d10(rgb->delta_green); 275 - rgb->delta_blue_reg = dc_fixpt_clamp_u0d10(rgb->delta_blue); 263 + rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red); 264 + rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green); 265 + rgb->delta_blue = dc_fixpt_sub(rgb_plus_1->blue, rgb->blue); 266 + 267 + red_clamp = dc_fixpt_clamp_u0d14(rgb->delta_red); 268 + green_clamp = dc_fixpt_clamp_u0d14(rgb->delta_green); 269 + blue_clamp = dc_fixpt_clamp_u0d14(rgb->delta_blue); 270 + 271 + if (red_clamp >> 10 || green_clamp >> 10 || blue_clamp >> 10) 272 + DC_LOG_ERROR("Losing delta precision while programming shaper LUT."); 273 + 274 + rgb->delta_red_reg = red_clamp & 0x3ff; 275 + rgb->delta_green_reg = green_clamp & 0x3ff; 276 + rgb->delta_blue_reg = blue_clamp & 0x3ff; 276 277 rgb->red_reg = dc_fixpt_clamp_u0d14(rgb->red); 277 278 rgb->green_reg = dc_fixpt_clamp_u0d14(rgb->green); 278 279 rgb->blue_reg = dc_fixpt_clamp_u0d14(rgb->blue);
+1 -1
drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h
··· 59 59 const struct pwl_params *params, 60 60 const struct dcn3_xfer_func_reg *reg); 61 61 62 - bool cm3_helper_translate_curve_to_hw_format( 62 + bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx, 63 63 const struct dc_transfer_func *output_tf, 64 64 struct pwl_params *lut_params, bool fixpoint); 65 65
+5 -4
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
··· 239 239 if (plane_state->blend_tf.type == TF_TYPE_HWPWL) 240 240 blend_lut = &plane_state->blend_tf.pwl; 241 241 else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) { 242 - result = cm3_helper_translate_curve_to_hw_format( 242 + result = cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 243 243 &plane_state->blend_tf, &dpp_base->regamma_params, false); 244 244 if (!result) 245 245 return result; ··· 334 334 if (plane_state->in_transfer_func.type == TF_TYPE_HWPWL) 335 335 params = &plane_state->in_transfer_func.pwl; 336 336 else if (plane_state->in_transfer_func.type == TF_TYPE_DISTRIBUTED_POINTS && 337 - cm3_helper_translate_curve_to_hw_format(&plane_state->in_transfer_func, 338 - &dpp_base->degamma_params, false)) 337 + cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 338 + &plane_state->in_transfer_func, 339 + &dpp_base->degamma_params, false)) 339 340 params = &dpp_base->degamma_params; 340 341 341 342 result = dpp_base->funcs->dpp_program_gamcor_lut(dpp_base, params); ··· 407 406 params = &stream->out_transfer_func.pwl; 408 407 else if (pipe_ctx->stream->out_transfer_func.type == 409 408 TF_TYPE_DISTRIBUTED_POINTS && 410 - cm3_helper_translate_curve_to_hw_format( 409 + cm3_helper_translate_curve_to_hw_format(stream->ctx, 411 410 &stream->out_transfer_func, 412 411 &mpc->blender_params, false)) 413 412 params = &mpc->blender_params;
+10 -8
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
··· 486 486 if (plane_state->blend_tf.type == TF_TYPE_HWPWL) 487 487 lut_params = &plane_state->blend_tf.pwl; 488 488 else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) { 489 - result = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf, 490 - &dpp_base->regamma_params, false); 489 + result = cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 490 + &plane_state->blend_tf, 491 + &dpp_base->regamma_params, false); 491 492 if (!result) 492 493 return result; 493 494 ··· 502 501 lut_params = &plane_state->in_shaper_func.pwl; 503 502 else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) { 504 503 // TODO: dpp_base replace 505 - ASSERT(false); 506 - cm3_helper_translate_curve_to_hw_format(&plane_state->in_shaper_func, 507 - &dpp_base->shaper_params, true); 504 + cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 505 + &plane_state->in_shaper_func, 506 + &dpp_base->shaper_params, true); 508 507 lut_params = &dpp_base->shaper_params; 509 508 } 510 509 ··· 544 543 if (plane_state->in_transfer_func.type == TF_TYPE_HWPWL) 545 544 params = &plane_state->in_transfer_func.pwl; 546 545 else if (plane_state->in_transfer_func.type == TF_TYPE_DISTRIBUTED_POINTS && 547 - cm3_helper_translate_curve_to_hw_format(&plane_state->in_transfer_func, 548 - &dpp_base->degamma_params, false)) 546 + cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 547 + &plane_state->in_transfer_func, 548 + &dpp_base->degamma_params, false)) 549 549 params = &dpp_base->degamma_params; 550 550 551 551 dpp_base->funcs->dpp_program_gamcor_lut(dpp_base, params); ··· 577 575 params = &stream->out_transfer_func.pwl; 578 576 else if (pipe_ctx->stream->out_transfer_func.type == 579 577 TF_TYPE_DISTRIBUTED_POINTS && 580 - cm3_helper_translate_curve_to_hw_format( 578 + cm3_helper_translate_curve_to_hw_format(stream->ctx, 581 579 &stream->out_transfer_func, 582 580 &mpc->blender_params, false)) 583 581 params = &mpc->blender_params;
+9 -7
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
··· 430 430 if (mcm_luts.lut1d_func->type == TF_TYPE_HWPWL) 431 431 m_lut_params.pwl = &mcm_luts.lut1d_func->pwl; 432 432 else if (mcm_luts.lut1d_func->type == TF_TYPE_DISTRIBUTED_POINTS) { 433 - rval = cm3_helper_translate_curve_to_hw_format( 433 + rval = cm3_helper_translate_curve_to_hw_format(mpc->ctx, 434 434 mcm_luts.lut1d_func, 435 435 &dpp_base->regamma_params, false); 436 436 m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL; ··· 450 450 m_lut_params.pwl = &mcm_luts.shaper->pwl; 451 451 else if (mcm_luts.shaper->type == TF_TYPE_DISTRIBUTED_POINTS) { 452 452 ASSERT(false); 453 - rval = cm3_helper_translate_curve_to_hw_format( 453 + rval = cm3_helper_translate_curve_to_hw_format(mpc->ctx, 454 454 mcm_luts.shaper, 455 455 &dpp_base->regamma_params, true); 456 456 m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL; ··· 627 627 if (plane_state->blend_tf.type == TF_TYPE_HWPWL) 628 628 lut_params = &plane_state->blend_tf.pwl; 629 629 else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) { 630 - rval = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf, 631 - &dpp_base->regamma_params, false); 630 + rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 631 + &plane_state->blend_tf, 632 + &dpp_base->regamma_params, false); 632 633 lut_params = rval ? &dpp_base->regamma_params : NULL; 633 634 } 634 635 result = mpc->funcs->program_1dlut(mpc, lut_params, mpcc_id); ··· 640 639 lut_params = &plane_state->in_shaper_func.pwl; 641 640 else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) { 642 641 // TODO: dpp_base replace 643 - rval = cm3_helper_translate_curve_to_hw_format(&plane_state->in_shaper_func, 644 - &dpp_base->shaper_params, true); 642 + rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx, 643 + &plane_state->in_shaper_func, 644 + &dpp_base->shaper_params, true); 645 645 lut_params = rval ? &dpp_base->shaper_params : NULL; 646 646 } 647 647 result &= mpc->funcs->program_shaper(mpc, lut_params, mpcc_id); ··· 676 674 params = &stream->out_transfer_func.pwl; 677 675 else if (pipe_ctx->stream->out_transfer_func.type == 678 676 TF_TYPE_DISTRIBUTED_POINTS && 679 - cm3_helper_translate_curve_to_hw_format( 677 + cm3_helper_translate_curve_to_hw_format(stream->ctx, 680 678 &stream->out_transfer_func, 681 679 &mpc->blender_params, false)) 682 680 params = &mpc->blender_params;