Skip to content

Commit 5896f2d

Browse files
surajk8jlahtine-intel
authored andcommitted
drm/i915/hdcp: Check if media_gt exists
Check if media_gt exists if we are using gsc cs --v2 -correct typo [Ankit] -assign gsc variable if gt exists [Ankit] --v3 -declare gsc and gt variables in if block [Ankit] --v4 -add fixes tag [Ankit] Fixes: 8836317 ("drm/i915/mtl: Add HDCP GSC interface") Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Uma Shankar <uma.shankar@intel.com> Cc: Anshuman Gupta <anshuman.gupta@intel.com> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Signed-off-by: Animesh Manna <animesh.manna@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230505041512.585486-1-suraj.kandpal@intel.com (cherry picked from commit 6986f05) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent f1fcbaa commit 5896f2d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpu/drm/i915/display/intel_hdcp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,20 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
204204
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
205205
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
206206
struct intel_hdcp *hdcp = &connector->hdcp;
207-
struct intel_gt *gt = dev_priv->media_gt;
208-
struct intel_gsc_uc *gsc = &gt->uc.gsc;
209207
bool capable = false;
210208

211209
/* I915 support for HDCP2.2 */
212210
if (!hdcp->hdcp2_supported)
213211
return false;
214212

215213
/* If MTL+ make sure gsc is loaded and proxy is setup */
216-
if (intel_hdcp_gsc_cs_required(dev_priv))
217-
if (!intel_uc_fw_is_running(&gsc->fw))
214+
if (intel_hdcp_gsc_cs_required(dev_priv)) {
215+
struct intel_gt *gt = dev_priv->media_gt;
216+
struct intel_gsc_uc *gsc = gt ? &gt->uc.gsc : NULL;
217+
218+
if (!gsc || !intel_uc_fw_is_running(&gsc->fw))
218219
return false;
220+
}
219221

220222
/* MEI/GSC interface is solid depending on which is used */
221223
mutex_lock(&dev_priv->display.hdcp.comp_mutex);

0 commit comments

Comments
 (0)