]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/xe/hdcp: Check GSC structure validity
authorSuraj Kandpal <suraj.kandpal@intel.com>
Mon, 22 Jul 2024 06:44:51 +0000 (12:14 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:29 +0000 (12:00 +0200)
[ Upstream commit b4224f6bae3801d589f815672ec62800a1501b0d ]

Sometimes xe_gsc is not initialized when checked at HDCP capability
check. Add gsc structure check to avoid null pointer error.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240722064451.3610512-4-suraj.kandpal@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c

index b3d3c065dd9d8a80296ec7a53aa092ba5bff3fa9..2f935771658e6bc0ad02423f140085ceb7892822 100644 (file)
@@ -39,10 +39,14 @@ bool intel_hdcp_gsc_check_status(struct xe_device *xe)
 {
        struct xe_tile *tile = xe_device_get_root_tile(xe);
        struct xe_gt *gt = tile->media_gt;
+       struct xe_gsc *gsc = &gt->uc.gsc;
        bool ret = true;
 
-       if (!xe_uc_fw_is_enabled(&gt->uc.gsc.fw))
+       if (!gsc && !xe_uc_fw_is_enabled(&gsc->fw)) {
+               drm_dbg_kms(&xe->drm,
+                           "GSC Components not ready for HDCP2.x\n");
                return false;
+       }
 
        xe_pm_runtime_get(xe);
        if (xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC)) {
@@ -52,7 +56,7 @@ bool intel_hdcp_gsc_check_status(struct xe_device *xe)
                goto out;
        }
 
-       if (!xe_gsc_proxy_init_done(&gt->uc.gsc))
+       if (!xe_gsc_proxy_init_done(gsc))
                ret = false;
 
        xe_force_wake_put(gt_to_fw(gt), XE_FW_GSC);