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

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init

Currently we are ignoriong drm_dp_dpcd_read return values when reading PSR
and Panel Replay capability DPCD register. Rework intel_psr_dpcd a bit to
take care of checking the return value.

v2: use drm_dp_dpcd_read_data

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250821045918.17757-1-jouni.hogander@intel.com

+21 -11
+21 -11
drivers/gpu/drm/i915/display/intel_psr.c
··· 580 580 static void _panel_replay_init_dpcd(struct intel_dp *intel_dp) 581 581 { 582 582 struct intel_display *display = to_intel_display(intel_dp); 583 + int ret; 584 + 585 + ret = drm_dp_dpcd_read_data(&intel_dp->aux, DP_PANEL_REPLAY_CAP_SUPPORT, 586 + &intel_dp->pr_dpcd, sizeof(intel_dp->pr_dpcd)); 587 + if (ret < 0) 588 + return; 589 + 590 + if (!(intel_dp->pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)] & 591 + DP_PANEL_REPLAY_SUPPORT)) 592 + return; 583 593 584 594 if (intel_dp_is_edp(intel_dp)) { 585 595 if (!intel_alpm_aux_less_wake_supported(intel_dp)) { ··· 621 611 static void _psr_init_dpcd(struct intel_dp *intel_dp) 622 612 { 623 613 struct intel_display *display = to_intel_display(intel_dp); 614 + int ret; 615 + 616 + ret = drm_dp_dpcd_read_data(&intel_dp->aux, DP_PSR_SUPPORT, intel_dp->psr_dpcd, 617 + sizeof(intel_dp->psr_dpcd)); 618 + if (ret < 0) 619 + return; 620 + 621 + if (!intel_dp->psr_dpcd[0]) 622 + return; 624 623 625 624 drm_dbg_kms(display->drm, "eDP panel supports PSR version %x\n", 626 625 intel_dp->psr_dpcd[0]); ··· 675 656 676 657 void intel_psr_init_dpcd(struct intel_dp *intel_dp) 677 658 { 678 - drm_dp_dpcd_read(&intel_dp->aux, DP_PSR_SUPPORT, intel_dp->psr_dpcd, 679 - sizeof(intel_dp->psr_dpcd)); 659 + _psr_init_dpcd(intel_dp); 680 660 681 - drm_dp_dpcd_read(&intel_dp->aux, DP_PANEL_REPLAY_CAP_SUPPORT, 682 - &intel_dp->pr_dpcd, sizeof(intel_dp->pr_dpcd)); 683 - 684 - if (intel_dp->pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)] & 685 - DP_PANEL_REPLAY_SUPPORT) 686 - _panel_replay_init_dpcd(intel_dp); 687 - 688 - if (intel_dp->psr_dpcd[0]) 689 - _psr_init_dpcd(intel_dp); 661 + _panel_replay_init_dpcd(intel_dp); 690 662 691 663 if (intel_dp->psr.sink_psr2_support || 692 664 intel_dp->psr.sink_panel_replay_su_support)