mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
a50f0c49f9
commit
f4507f987c
|
|
@ -32,6 +32,8 @@
|
|||
#include "intel_hdcp_shim.h"
|
||||
#include "intel_pcode.h"
|
||||
|
||||
#define USE_HDCP_GSC(__display) (DISPLAY_VER(__display) >= 14)
|
||||
|
||||
#define KEY_LOAD_TRIES 5
|
||||
#define HDCP2_LC_RETRY_CNT 3
|
||||
|
||||
|
|
@ -251,7 +253,7 @@ static bool intel_hdcp2_prerequisite(struct intel_connector *connector)
|
|||
return false;
|
||||
|
||||
/* If MTL+ make sure gsc is loaded and proxy is setup */
|
||||
if (intel_hdcp_gsc_cs_required(display)) {
|
||||
if (USE_HDCP_GSC(display)) {
|
||||
if (!intel_hdcp_gsc_check_status(display))
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2340,7 +2342,7 @@ static int initialize_hdcp_port_data(struct intel_connector *connector,
|
|||
|
||||
static bool is_hdcp2_supported(struct intel_display *display)
|
||||
{
|
||||
if (intel_hdcp_gsc_cs_required(display))
|
||||
if (USE_HDCP_GSC(display))
|
||||
return true;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP))
|
||||
|
|
@ -2364,7 +2366,7 @@ void intel_hdcp_component_init(struct intel_display *display)
|
|||
|
||||
display->hdcp.comp_added = true;
|
||||
mutex_unlock(&display->hdcp.hdcp_mutex);
|
||||
if (intel_hdcp_gsc_cs_required(display))
|
||||
if (USE_HDCP_GSC(display))
|
||||
ret = intel_hdcp_gsc_init(display);
|
||||
else
|
||||
ret = component_add_typed(display->drm->dev, &i915_hdcp_ops,
|
||||
|
|
@ -2639,7 +2641,7 @@ void intel_hdcp_component_fini(struct intel_display *display)
|
|||
display->hdcp.comp_added = false;
|
||||
mutex_unlock(&display->hdcp.hdcp_mutex);
|
||||
|
||||
if (intel_hdcp_gsc_cs_required(display))
|
||||
if (USE_HDCP_GSC(display))
|
||||
intel_hdcp_gsc_fini(display);
|
||||
else
|
||||
component_del(display->drm->dev, &i915_hdcp_ops);
|
||||
|
|
|
|||
|
|
@ -19,11 +19,6 @@ struct intel_hdcp_gsc_context {
|
|||
void *hdcp_cmd_out;
|
||||
};
|
||||
|
||||
bool intel_hdcp_gsc_cs_required(struct intel_display *display)
|
||||
{
|
||||
return DISPLAY_VER(display) >= 14;
|
||||
}
|
||||
|
||||
bool intel_hdcp_gsc_check_status(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
struct intel_display;
|
||||
struct intel_hdcp_gsc_context;
|
||||
|
||||
bool intel_hdcp_gsc_cs_required(struct intel_display *display);
|
||||
ssize_t intel_hdcp_gsc_msg_send(struct intel_hdcp_gsc_context *gsc_context,
|
||||
void *msg_in, size_t msg_in_len,
|
||||
void *msg_out, size_t msg_out_len);
|
||||
|
|
|
|||
|
|
@ -30,11 +30,6 @@ struct intel_hdcp_gsc_context {
|
|||
|
||||
#define HDCP_GSC_HEADER_SIZE sizeof(struct intel_gsc_mtl_header)
|
||||
|
||||
bool intel_hdcp_gsc_cs_required(struct intel_display *display)
|
||||
{
|
||||
return DISPLAY_VER(display) >= 14;
|
||||
}
|
||||
|
||||
bool intel_hdcp_gsc_check_status(struct intel_display *display)
|
||||
{
|
||||
struct xe_device *xe = to_xe_device(display->drm);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user