#include <linux/component.h>
#include <linux/i2c.h>
#include <linux/random.h>
#include <drm/display/drm_hdcp_helper.h>
#include <drm/intel/i915_component.h>
#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_connector.h"
#include "intel_de.h"
#include "intel_display_power.h"
#include "intel_display_power_well.h"
#include "intel_display_types.h"
#include "intel_hdcp.h"
#include "intel_hdcp_gsc.h"
#include "intel_hdcp_regs.h"
#include "intel_pcode.h"
#define KEY_LOAD_TRIES …
#define HDCP2_LC_RETRY_CNT …
static void
intel_hdcp_disable_hdcp_line_rekeying(struct intel_encoder *encoder,
struct intel_hdcp *hdcp)
{ … }
static int intel_conn_to_vcpi(struct intel_atomic_state *state,
struct intel_connector *connector)
{ … }
static int
intel_hdcp_required_content_stream(struct intel_atomic_state *state,
struct intel_digital_port *dig_port)
{ … }
static int intel_hdcp_prepare_streams(struct intel_atomic_state *state,
struct intel_connector *connector)
{ … }
static
bool intel_hdcp_is_ksv_valid(u8 *ksv)
{ … }
static
int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port,
const struct intel_hdcp_shim *shim, u8 *bksv)
{ … }
bool intel_hdcp_get_capability(struct intel_connector *connector)
{ … }
static bool intel_hdcp2_prerequisite(struct intel_connector *connector)
{ … }
bool intel_hdcp2_get_capability(struct intel_connector *connector)
{ … }
void intel_hdcp_get_remote_capability(struct intel_connector *connector,
bool *hdcp_capable,
bool *hdcp2_capable)
{ … }
static bool intel_hdcp_in_use(struct drm_i915_private *i915,
enum transcoder cpu_transcoder, enum port port)
{ … }
static bool intel_hdcp2_in_use(struct drm_i915_private *i915,
enum transcoder cpu_transcoder, enum port port)
{ … }
static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
const struct intel_hdcp_shim *shim)
{ … }
static bool hdcp_key_loadable(struct drm_i915_private *i915)
{ … }
static void intel_hdcp_clear_keys(struct drm_i915_private *i915)
{ … }
static int intel_hdcp_load_keys(struct drm_i915_private *i915)
{ … }
static int intel_write_sha_text(struct drm_i915_private *i915, u32 sha_text)
{ … }
static
u32 intel_hdcp_get_repeater_ctl(struct drm_i915_private *i915,
enum transcoder cpu_transcoder, enum port port)
{ … }
static
int intel_hdcp_validate_v_prime(struct intel_connector *connector,
const struct intel_hdcp_shim *shim,
u8 *ksv_fifo, u8 num_downstream, u8 *bstatus)
{ … }
static
int intel_hdcp_auth_downstream(struct intel_connector *connector)
{ … }
static int intel_hdcp_auth(struct intel_connector *connector)
{ … }
static int _intel_hdcp_disable(struct intel_connector *connector)
{ … }
static int intel_hdcp1_enable(struct intel_connector *connector)
{ … }
static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp)
{ … }
static void intel_hdcp_update_value(struct intel_connector *connector,
u64 value, bool update_property)
{ … }
static int intel_hdcp_check_link(struct intel_connector *connector)
{ … }
static void intel_hdcp_prop_work(struct work_struct *work)
{ … }
bool is_hdcp_supported(struct drm_i915_private *i915, enum port port)
{ … }
static int
hdcp2_prepare_ake_init(struct intel_connector *connector,
struct hdcp2_ake_init *ake_data)
{ … }
static int
hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector,
struct hdcp2_ake_send_cert *rx_cert,
bool *paired,
struct hdcp2_ake_no_stored_km *ek_pub_km,
size_t *msg_sz)
{ … }
static int hdcp2_verify_hprime(struct intel_connector *connector,
struct hdcp2_ake_send_hprime *rx_hprime)
{ … }
static int
hdcp2_store_pairing_info(struct intel_connector *connector,
struct hdcp2_ake_send_pairing_info *pairing_info)
{ … }
static int
hdcp2_prepare_lc_init(struct intel_connector *connector,
struct hdcp2_lc_init *lc_init)
{ … }
static int
hdcp2_verify_lprime(struct intel_connector *connector,
struct hdcp2_lc_send_lprime *rx_lprime)
{ … }
static int hdcp2_prepare_skey(struct intel_connector *connector,
struct hdcp2_ske_send_eks *ske_data)
{ … }
static int
hdcp2_verify_rep_topology_prepare_ack(struct intel_connector *connector,
struct hdcp2_rep_send_receiverid_list
*rep_topology,
struct hdcp2_rep_send_ack *rep_send_ack)
{ … }
static int
hdcp2_verify_mprime(struct intel_connector *connector,
struct hdcp2_rep_stream_ready *stream_ready)
{ … }
static int hdcp2_authenticate_port(struct intel_connector *connector)
{ … }
static int hdcp2_close_session(struct intel_connector *connector)
{ … }
static int hdcp2_deauthenticate_port(struct intel_connector *connector)
{ … }
static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
{ … }
static int hdcp2_locality_check(struct intel_connector *connector)
{ … }
static int hdcp2_session_key_exchange(struct intel_connector *connector)
{ … }
static
int _hdcp2_propagate_stream_management_info(struct intel_connector *connector)
{ … }
static
int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
{ … }
static int hdcp2_authenticate_sink(struct intel_connector *connector)
{ … }
static int hdcp2_enable_stream_encryption(struct intel_connector *connector)
{ … }
static int hdcp2_enable_encryption(struct intel_connector *connector)
{ … }
static int hdcp2_disable_encryption(struct intel_connector *connector)
{ … }
static int
hdcp2_propagate_stream_management_info(struct intel_connector *connector)
{ … }
static int hdcp2_authenticate_and_encrypt(struct intel_atomic_state *state,
struct intel_connector *connector)
{ … }
static int _intel_hdcp2_enable(struct intel_atomic_state *state,
struct intel_connector *connector)
{ … }
static int
_intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery)
{ … }
static int intel_hdcp2_check_link(struct intel_connector *connector)
{ … }
static void intel_hdcp_check_work(struct work_struct *work)
{ … }
static int i915_hdcp_component_bind(struct device *drv_kdev,
struct device *mei_kdev, void *data)
{ … }
static void i915_hdcp_component_unbind(struct device *drv_kdev,
struct device *mei_kdev, void *data)
{ … }
static const struct component_ops i915_hdcp_ops = …;
static enum hdcp_ddi intel_get_hdcp_ddi_index(enum port port)
{ … }
static enum hdcp_transcoder intel_get_hdcp_transcoder(enum transcoder cpu_transcoder)
{ … }
static int initialize_hdcp_port_data(struct intel_connector *connector,
struct intel_digital_port *dig_port,
const struct intel_hdcp_shim *shim)
{ … }
static bool is_hdcp2_supported(struct drm_i915_private *i915)
{ … }
void intel_hdcp_component_init(struct drm_i915_private *i915)
{ … }
static void intel_hdcp2_init(struct intel_connector *connector,
struct intel_digital_port *dig_port,
const struct intel_hdcp_shim *shim)
{ … }
int intel_hdcp_init(struct intel_connector *connector,
struct intel_digital_port *dig_port,
const struct intel_hdcp_shim *shim)
{ … }
static int _intel_hdcp_enable(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config,
const struct drm_connector_state *conn_state)
{ … }
void intel_hdcp_enable(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{ … }
int intel_hdcp_disable(struct intel_connector *connector)
{ … }
void intel_hdcp_update_pipe(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{ … }
void intel_hdcp_component_fini(struct drm_i915_private *i915)
{ … }
void intel_hdcp_cleanup(struct intel_connector *connector)
{ … }
void intel_hdcp_atomic_check(struct drm_connector *connector,
struct drm_connector_state *old_state,
struct drm_connector_state *new_state)
{ … }
void intel_hdcp_handle_cp_irq(struct intel_connector *connector)
{ … }