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

drm/i915/hdcp: simplify HDCP GSC firmware usage selection

Just localize the GSC decision inside intel_hdcp.c, and deduplicate the
conditions.

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

Jani Nikula f4507f98 a50f0c49

+6 -15
+6 -4
drivers/gpu/drm/i915/display/intel_hdcp.c
··· 32 32 #include "intel_hdcp_shim.h" 33 33 #include "intel_pcode.h" 34 34 35 + #define USE_HDCP_GSC(__display) (DISPLAY_VER(__display) >= 14) 36 + 35 37 #define KEY_LOAD_TRIES 5 36 38 #define HDCP2_LC_RETRY_CNT 3 37 39 ··· 253 251 return false; 254 252 255 253 /* If MTL+ make sure gsc is loaded and proxy is setup */ 256 - if (intel_hdcp_gsc_cs_required(display)) { 254 + if (USE_HDCP_GSC(display)) { 257 255 if (!intel_hdcp_gsc_check_status(display)) 258 256 return false; 259 257 } ··· 2342 2340 2343 2341 static bool is_hdcp2_supported(struct intel_display *display) 2344 2342 { 2345 - if (intel_hdcp_gsc_cs_required(display)) 2343 + if (USE_HDCP_GSC(display)) 2346 2344 return true; 2347 2345 2348 2346 if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) ··· 2366 2364 2367 2365 display->hdcp.comp_added = true; 2368 2366 mutex_unlock(&display->hdcp.hdcp_mutex); 2369 - if (intel_hdcp_gsc_cs_required(display)) 2367 + if (USE_HDCP_GSC(display)) 2370 2368 ret = intel_hdcp_gsc_init(display); 2371 2369 else 2372 2370 ret = component_add_typed(display->drm->dev, &i915_hdcp_ops, ··· 2641 2639 display->hdcp.comp_added = false; 2642 2640 mutex_unlock(&display->hdcp.hdcp_mutex); 2643 2641 2644 - if (intel_hdcp_gsc_cs_required(display)) 2642 + if (USE_HDCP_GSC(display)) 2645 2643 intel_hdcp_gsc_fini(display); 2646 2644 else 2647 2645 component_del(display->drm->dev, &i915_hdcp_ops);
-5
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c
··· 19 19 void *hdcp_cmd_out; 20 20 }; 21 21 22 - bool intel_hdcp_gsc_cs_required(struct intel_display *display) 23 - { 24 - return DISPLAY_VER(display) >= 14; 25 - } 26 - 27 22 bool intel_hdcp_gsc_check_status(struct intel_display *display) 28 23 { 29 24 struct drm_i915_private *i915 = to_i915(display->drm);
-1
drivers/gpu/drm/i915/display/intel_hdcp_gsc.h
··· 12 12 struct intel_display; 13 13 struct intel_hdcp_gsc_context; 14 14 15 - bool intel_hdcp_gsc_cs_required(struct intel_display *display); 16 15 ssize_t intel_hdcp_gsc_msg_send(struct intel_hdcp_gsc_context *gsc_context, 17 16 void *msg_in, size_t msg_in_len, 18 17 void *msg_out, size_t msg_out_len);
-5
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_cs_required(struct intel_display *display) 34 - { 35 - return DISPLAY_VER(display) >= 14; 36 - } 37 - 38 33 bool intel_hdcp_gsc_check_status(struct intel_display *display) 39 34 { 40 35 struct xe_device *xe = to_xe_device(display->drm);