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

drm/i915/hdcp: pass struct drm_device to driver specific HDCP GSC code

The driver specific HDCP GSC code will eventually be part of the driver
cores rather than display. Remove the struct intel_display references
from them, and pass struct drm_device instead.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/bf9aa8e44e18eef41e3077a2966935b4e2649b62.1745524803.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Jani Nikula c526ac45 f4507f98

+19 -19
+1 -1
drivers/gpu/drm/i915/display/intel_hdcp.c
··· 254 254 255 255 /* If MTL+ make sure gsc is loaded and proxy is setup */ 256 256 if (USE_HDCP_GSC(display)) { 257 - if (!intel_hdcp_gsc_check_status(display)) 257 + if (!intel_hdcp_gsc_check_status(display->drm)) 258 258 return false; 259 259 } 260 260
+6 -6
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c
··· 19 19 void *hdcp_cmd_out; 20 20 }; 21 21 22 - bool intel_hdcp_gsc_check_status(struct intel_display *display) 22 + bool intel_hdcp_gsc_check_status(struct drm_device *drm) 23 23 { 24 - struct drm_i915_private *i915 = to_i915(display->drm); 24 + struct drm_i915_private *i915 = to_i915(drm); 25 25 struct intel_gt *gt = i915->media_gt; 26 26 struct intel_gsc_uc *gsc = gt ? &gt->uc.gsc : NULL; 27 27 28 28 if (!gsc || !intel_uc_fw_is_running(&gsc->fw)) { 29 - drm_dbg_kms(display->drm, 29 + drm_dbg_kms(&i915->drm, 30 30 "GSC components required for HDCP2.2 are not ready\n"); 31 31 return false; 32 32 } ··· 87 87 return err; 88 88 } 89 89 90 - struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct intel_display *display) 90 + struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_device *drm) 91 91 { 92 - struct drm_i915_private *i915 = to_i915(display->drm); 92 + struct drm_i915_private *i915 = to_i915(drm); 93 93 struct intel_hdcp_gsc_context *gsc_context; 94 94 int ret; 95 95 ··· 103 103 */ 104 104 ret = intel_hdcp_gsc_initialize_message(i915, gsc_context); 105 105 if (ret) { 106 - drm_err(display->drm, "Could not initialize gsc_context\n"); 106 + drm_err(&i915->drm, "Could not initialize gsc_context\n"); 107 107 kfree(gsc_context); 108 108 gsc_context = ERR_PTR(ret); 109 109 }
+3 -3
drivers/gpu/drm/i915/display/intel_hdcp_gsc.h
··· 9 9 #include <linux/err.h> 10 10 #include <linux/types.h> 11 11 12 - struct intel_display; 12 + struct drm_device; 13 13 struct intel_hdcp_gsc_context; 14 14 15 15 ssize_t intel_hdcp_gsc_msg_send(struct intel_hdcp_gsc_context *gsc_context, 16 16 void *msg_in, size_t msg_in_len, 17 17 void *msg_out, size_t msg_out_len); 18 - bool intel_hdcp_gsc_check_status(struct intel_display *display); 18 + bool intel_hdcp_gsc_check_status(struct drm_device *drm); 19 19 20 - struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct intel_display *display); 20 + struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_device *drm); 21 21 void intel_hdcp_gsc_context_free(struct intel_hdcp_gsc_context *gsc_context); 22 22 23 23 #endif /* __INTEL_HDCP_GCS_H__ */
+1 -1
drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
··· 645 645 646 646 mutex_lock(&display->hdcp.hdcp_mutex); 647 647 648 - gsc_context = intel_hdcp_gsc_context_alloc(display); 648 + gsc_context = intel_hdcp_gsc_context_alloc(display->drm); 649 649 if (IS_ERR(gsc_context)) { 650 650 ret = PTR_ERR(gsc_context); 651 651 kfree(arbiter);
+8 -8
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
··· 30 30 31 31 #define HDCP_GSC_HEADER_SIZE sizeof(struct intel_gsc_mtl_header) 32 32 33 - bool intel_hdcp_gsc_check_status(struct intel_display *display) 33 + bool intel_hdcp_gsc_check_status(struct drm_device *drm) 34 34 { 35 - struct xe_device *xe = to_xe_device(display->drm); 35 + struct xe_device *xe = to_xe_device(drm); 36 36 struct xe_tile *tile = xe_device_get_root_tile(xe); 37 37 struct xe_gt *gt = tile->media_gt; 38 38 struct xe_gsc *gsc = &gt->uc.gsc; ··· 64 64 } 65 65 66 66 /*This function helps allocate memory for the command that we will send to gsc cs */ 67 - static int intel_hdcp_gsc_initialize_message(struct intel_display *display, 67 + static int intel_hdcp_gsc_initialize_message(struct xe_device *xe, 68 68 struct intel_hdcp_gsc_context *gsc_context) 69 69 { 70 - struct xe_device *xe = to_xe_device(display->drm); 71 70 struct xe_bo *bo = NULL; 72 71 u64 cmd_in, cmd_out; 73 72 int ret = 0; ··· 78 79 XE_BO_FLAG_GGTT); 79 80 80 81 if (IS_ERR(bo)) { 81 - drm_err(display->drm, "Failed to allocate bo for HDCP streaming command!\n"); 82 + drm_err(&xe->drm, "Failed to allocate bo for HDCP streaming command!\n"); 82 83 ret = PTR_ERR(bo); 83 84 goto out; 84 85 } ··· 96 97 return ret; 97 98 } 98 99 99 - struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct intel_display *display) 100 + struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_device *drm) 100 101 { 102 + struct xe_device *xe = to_xe_device(drm); 101 103 struct intel_hdcp_gsc_context *gsc_context; 102 104 int ret; 103 105 ··· 110 110 * NOTE: No need to lock the comp mutex here as it is already 111 111 * going to be taken before this function called 112 112 */ 113 - ret = intel_hdcp_gsc_initialize_message(display, gsc_context); 113 + ret = intel_hdcp_gsc_initialize_message(xe, gsc_context); 114 114 if (ret) { 115 - drm_err(display->drm, "Could not initialize gsc_context\n"); 115 + drm_err(&xe->drm, "Could not initialize gsc_context\n"); 116 116 kfree(gsc_context); 117 117 gsc_context = ERR_PTR(ret); 118 118 }