aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorLinus Torvalds2023-04-25 16:12:15 -0700
committerLinus Torvalds2023-04-25 16:12:15 -0700
commitc8cc58e289ed3b5bc50258f52776cf3dfa3bad66 (patch)
treefab95a9e92dd1b7ddec386294365ebd2ba130ec3 /drivers/misc
parent736b378b29d89c8c3567fa4b2e948be5568aebb8 (diff)
parent289af45508ca890585f329376d16e08f41f75bd5 (diff)
Merge tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm
Pull drm updates from Dave Airlie: "There is a new Qualcomm accel driver for their QAIC, dma-fence got a deadline feature added, lots of refactoring around fbdev emulation, and the usual pre-release hw enablements from AMD and Intel and fixes everywhere. New drivers: - add QAIC acceleration driver dma-buf: - constify kobj_type structs - Reject prime DMA-Buf attachment if get_sg_table is missing. fbdev: - cmdline parser fixes - implement fbdev emulation for GEM DMA drivers - always use shadow buffer in fbdev emulation helpers dma-fence: - add deadline hint to fences - signal private stub fence core: - improve DisplayID 2.0 and EDID parsing - add gem eviction function + callback - prep to convert shmem helper to GEM resv lock - move suballocator from radeon/amdgpu to core for Xe - HPD polling fixes - Documentation improvements - Add atomic enable_plane callback - use tgid instead of pid for client tracking - DP: Add SDP Error Detection Configuration Register - Add prime import/export to vram-helper - use pci aperture helpers in more drivers panel: - Radxa 8/10HD support - Samsung AMD495QA01 support - Elida KD50T048A - Sony TD4353 - Novatek NT36523 - STARRY 2081101QFH032011-53G - B133UAN01.0 - AUO NE135FBM-N41 i915: - More MTL enabling - fix s/r problems with MEI/PXP - Implement fb_dirty for PSR,FBC,DRRS fixes - Fix eDP+DSI dual panel systems - Fix issue #6333: "list_add corruption" and full system lockup from performance monitoring - Don't use stolen memory or BAR for ring buffers on LLC platforms - Make sure DSM size has correct 1MiB granularity on Gen12+ - Whitelist COMMON_SLICE_CHICKEN3 for UMD access on Gen12+ - Add engine TLB invalidation for Meteorlake - Fix GSC races on driver load/unload on Meteorlake+ - Make kobj_type structures constant - Move fd_install after last use of fence - wm/vblank refactoring - display code refactoring - Create GSC submission targeting HDCP and PXP usages on MTL+ - Enable HDCP2.x via GSC CS - Fix context runtime accounting on sysfs fdinfo for heavy workloads - Use i915 instead of dev_priv insied the file_priv structure - Replace fake flex-array with flexible-array member amdgpu: - Make kobj structures const - Generalize dmabuf import to work with KFD - Add capped/uncapped workload handling for supported APUs - Expose additional memory stats via fdinfo - Register vga_switcheroo for apple-gmux - Initial NBIO7.9, GC 9.4.3, GFXHUB 1.2, MMHUB 1.8 support - Initial DC FAM infrastructure - Link DC backlight to connector device rather than PCI device - Add sysfs nodes for secondary VCN clocks amdkfd: - Make kobj structures const - Support for exporting buffers via dmabuf - Multi-VMA page migration fixes - initial GC 9.4.3 support radeon: - iMac fix - convert to client based fbdev emulation habanalabs: - Add opcodes to the CS ioctl to allow user to stall/resume specific engines inside Gaudi2. - INFO ioctl the amount of device memory that the driver and f/w reserve for themselves. - INFO ioctl a bit-mask of the available rotator engines - INFO ioctl the register's address of the f/w that should be used to trigger interrupts - INFO ioctl two new opcodes to fetch information on h/w and f/w events - Enable graceful reset mechanism for compute-reset. - Align to the latest firmware specs. - Enforce the release order of the compute device and dma-buf. msm: - UBWC decoder programming rework - SM8550, SM8450 bindings update - uapi C++ fix - a3xx and a4xx devfreq support - GPU and GEM updates to avoid allocations which could trigger reclaim (shrinker) in fence signaling path - dma-fence deadline hint support and wait-boost - a640/650 speed bin support cirrus: - convert to regular atomic helpers - add damage clipping mediatek: - 10-bit overlay support - mt8195 support - Only trigger DRM HPD events if bridge is attached - Change the aux retries times when receiving AUX_DEFER rockchip: - add 4K support vc4: - use drm_gem_objects virtio: - allow KMS support to be disabled - add damage clipping vmwgfx: - buffer object lifetime fixes exynos: - move MIPI DSI driver to drm bridge for iMX sharing - use kernel fbdev emulation panfrost: - add support for mali MT81xx devices - add speed binning support lima: - add usage stats tegra: - fbdev client conversion vkms: - Add primary plane positioning support" * tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm: (1495 commits) drm/i915/dp_mst: Fix active port PLL selection for secondary MST streams drm/exynos: Implement fbdev emulation as in-kernel client drm/exynos: Initialize fbdev DRM client drm/exynos: Remove fb_helper from struct exynos_drm_private drm/exynos: Remove struct exynos_drm_fbdev drm/exynos: Remove exynos_gem from struct exynos_drm_fbdev drm/i915: Fix memory leaks in i915 selftests drm/i915: Make intel_get_crtc_new_encoder() less oopsy drm/i915/gt: Avoid out-of-bounds access when loading HuC drm/amdgpu: add some basic elements for multiple XCD case drm/amdgpu: move vmhub out of amdgpu_ring_funcs (v4) Revert "drm/amdgpu: enable ras for mp0 v13_0_10 on SRIOV" drm/amdgpu: add common ip block for GC 9.4.3 drm/amd/display: Add logging when DP link training Clock recovery is Successful drm/amdgpu: add common early init support for GC 9.4.3 drm/amdgpu: switch to v9_4_3 gfx_funcs callbacks for GC 9.4.3 drm/amd/display: Add logging when setting DP sink power state fails drm/amdkfd: Add gfx_target_version for GC 9.4.3 drm/amdkfd: Enable HW_UPDATE_RPTR on GC 9.4.3 drm/amdgpu: reserve the old gc_11_0_*_mes.bin ...
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/client.c4
-rw-r--r--drivers/misc/mei/hdcp/mei_hdcp.c105
-rw-r--r--drivers/misc/mei/hdcp/mei_hdcp.h354
-rw-r--r--drivers/misc/mei/pci-me.c20
4 files changed, 73 insertions, 410 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 9ddb854b8155..5c19097266fe 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -1343,7 +1343,9 @@ static void mei_cl_reset_read_by_vtag(const struct mei_cl *cl, u8 vtag)
struct mei_cl_vtag *vtag_l;
list_for_each_entry(vtag_l, &cl->vtag_map, list) {
- if (vtag_l->vtag == vtag) {
+ /* The client on bus has one fixed vtag map */
+ if ((cl->cldev && mei_cldev_enabled(cl->cldev)) ||
+ vtag_l->vtag == vtag) {
vtag_l->pending_read = false;
break;
}
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index e0dcd5c114db..7728fe685476 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -23,7 +23,7 @@
#include <linux/component.h>
#include <drm/drm_connector.h>
#include <drm/i915_component.h>
-#include <drm/i915_mei_hdcp_interface.h>
+#include <drm/i915_hdcp_interface.h>
#include "mei_hdcp.h"
@@ -52,13 +52,13 @@ mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data,
session_init_in.header.api_version = HDCP_API_VERSION;
session_init_in.header.command_id = WIRED_INITIATE_HDCP2_SESSION;
- session_init_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ session_init_in.header.status = FW_HDCP_STATUS_SUCCESS;
session_init_in.header.buffer_len =
WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN;
session_init_in.port.integrated_port_type = data->port_type;
- session_init_in.port.physical_port = (u8)data->fw_ddi;
- session_init_in.port.attached_transcoder = (u8)data->fw_tc;
+ session_init_in.port.physical_port = (u8)data->hdcp_ddi;
+ session_init_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
session_init_in.protocol = data->protocol;
byte = mei_cldev_send(cldev, (u8 *)&session_init_in,
@@ -75,7 +75,7 @@ mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data,
return byte;
}
- if (session_init_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (session_init_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n",
WIRED_INITIATE_HDCP2_SESSION,
session_init_out.header.status);
@@ -122,13 +122,13 @@ mei_hdcp_verify_receiver_cert_prepare_km(struct device *dev,
verify_rxcert_in.header.api_version = HDCP_API_VERSION;
verify_rxcert_in.header.command_id = WIRED_VERIFY_RECEIVER_CERT;
- verify_rxcert_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ verify_rxcert_in.header.status = FW_HDCP_STATUS_SUCCESS;
verify_rxcert_in.header.buffer_len =
WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN;
verify_rxcert_in.port.integrated_port_type = data->port_type;
- verify_rxcert_in.port.physical_port = (u8)data->fw_ddi;
- verify_rxcert_in.port.attached_transcoder = (u8)data->fw_tc;
+ verify_rxcert_in.port.physical_port = (u8)data->hdcp_ddi;
+ verify_rxcert_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
verify_rxcert_in.cert_rx = rx_cert->cert_rx;
memcpy(verify_rxcert_in.r_rx, &rx_cert->r_rx, HDCP_2_2_RRX_LEN);
@@ -148,7 +148,7 @@ mei_hdcp_verify_receiver_cert_prepare_km(struct device *dev,
return byte;
}
- if (verify_rxcert_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (verify_rxcert_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n",
WIRED_VERIFY_RECEIVER_CERT,
verify_rxcert_out.header.status);
@@ -194,12 +194,12 @@ mei_hdcp_verify_hprime(struct device *dev, struct hdcp_port_data *data,
send_hprime_in.header.api_version = HDCP_API_VERSION;
send_hprime_in.header.command_id = WIRED_AKE_SEND_HPRIME;
- send_hprime_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ send_hprime_in.header.status = FW_HDCP_STATUS_SUCCESS;
send_hprime_in.header.buffer_len = WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN;
send_hprime_in.port.integrated_port_type = data->port_type;
- send_hprime_in.port.physical_port = (u8)data->fw_ddi;
- send_hprime_in.port.attached_transcoder = (u8)data->fw_tc;
+ send_hprime_in.port.physical_port = (u8)data->hdcp_ddi;
+ send_hprime_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
memcpy(send_hprime_in.h_prime, rx_hprime->h_prime,
HDCP_2_2_H_PRIME_LEN);
@@ -218,7 +218,7 @@ mei_hdcp_verify_hprime(struct device *dev, struct hdcp_port_data *data,
return byte;
}
- if (send_hprime_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (send_hprime_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n",
WIRED_AKE_SEND_HPRIME, send_hprime_out.header.status);
return -EIO;
@@ -251,13 +251,13 @@ mei_hdcp_store_pairing_info(struct device *dev, struct hdcp_port_data *data,
pairing_info_in.header.api_version = HDCP_API_VERSION;
pairing_info_in.header.command_id = WIRED_AKE_SEND_PAIRING_INFO;
- pairing_info_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ pairing_info_in.header.status = FW_HDCP_STATUS_SUCCESS;
pairing_info_in.header.buffer_len =
WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN;
pairing_info_in.port.integrated_port_type = data->port_type;
- pairing_info_in.port.physical_port = (u8)data->fw_ddi;
- pairing_info_in.port.attached_transcoder = (u8)data->fw_tc;
+ pairing_info_in.port.physical_port = (u8)data->hdcp_ddi;
+ pairing_info_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
memcpy(pairing_info_in.e_kh_km, pairing_info->e_kh_km,
HDCP_2_2_E_KH_KM_LEN);
@@ -276,7 +276,7 @@ mei_hdcp_store_pairing_info(struct device *dev, struct hdcp_port_data *data,
return byte;
}
- if (pairing_info_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (pairing_info_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. Status: 0x%X\n",
WIRED_AKE_SEND_PAIRING_INFO,
pairing_info_out.header.status);
@@ -311,12 +311,12 @@ mei_hdcp_initiate_locality_check(struct device *dev,
lc_init_in.header.api_version = HDCP_API_VERSION;
lc_init_in.header.command_id = WIRED_INIT_LOCALITY_CHECK;
- lc_init_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ lc_init_in.header.status = FW_HDCP_STATUS_SUCCESS;
lc_init_in.header.buffer_len = WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN;
lc_init_in.port.integrated_port_type = data->port_type;
- lc_init_in.port.physical_port = (u8)data->fw_ddi;
- lc_init_in.port.attached_transcoder = (u8)data->fw_tc;
+ lc_init_in.port.physical_port = (u8)data->hdcp_ddi;
+ lc_init_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
byte = mei_cldev_send(cldev, (u8 *)&lc_init_in, sizeof(lc_init_in));
if (byte < 0) {
@@ -330,7 +330,7 @@ mei_hdcp_initiate_locality_check(struct device *dev,
return byte;
}
- if (lc_init_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (lc_init_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X Failed. status: 0x%X\n",
WIRED_INIT_LOCALITY_CHECK, lc_init_out.header.status);
return -EIO;
@@ -366,13 +366,13 @@ mei_hdcp_verify_lprime(struct device *dev, struct hdcp_port_data *data,
verify_lprime_in.header.api_version = HDCP_API_VERSION;
verify_lprime_in.header.command_id = WIRED_VALIDATE_LOCALITY;
- verify_lprime_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ verify_lprime_in.header.status = FW_HDCP_STATUS_SUCCESS;
verify_lprime_in.header.buffer_len =
WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_IN;
verify_lprime_in.port.integrated_port_type = data->port_type;
- verify_lprime_in.port.physical_port = (u8)data->fw_ddi;
- verify_lprime_in.port.attached_transcoder = (u8)data->fw_tc;
+ verify_lprime_in.port.physical_port = (u8)data->hdcp_ddi;
+ verify_lprime_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
memcpy(verify_lprime_in.l_prime, rx_lprime->l_prime,
HDCP_2_2_L_PRIME_LEN);
@@ -391,7 +391,7 @@ mei_hdcp_verify_lprime(struct device *dev, struct hdcp_port_data *data,
return byte;
}
- if (verify_lprime_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (verify_lprime_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
WIRED_VALIDATE_LOCALITY,
verify_lprime_out.header.status);
@@ -425,12 +425,12 @@ static int mei_hdcp_get_session_key(struct device *dev,
get_skey_in.header.api_version = HDCP_API_VERSION;
get_skey_in.header.command_id = WIRED_GET_SESSION_KEY;
- get_skey_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ get_skey_in.header.status = FW_HDCP_STATUS_SUCCESS;
get_skey_in.header.buffer_len = WIRED_CMD_BUF_LEN_GET_SESSION_KEY_IN;
get_skey_in.port.integrated_port_type = data->port_type;
- get_skey_in.port.physical_port = (u8)data->fw_ddi;
- get_skey_in.port.attached_transcoder = (u8)data->fw_tc;
+ get_skey_in.port.physical_port = (u8)data->hdcp_ddi;
+ get_skey_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
byte = mei_cldev_send(cldev, (u8 *)&get_skey_in, sizeof(get_skey_in));
if (byte < 0) {
@@ -445,7 +445,7 @@ static int mei_hdcp_get_session_key(struct device *dev,
return byte;
}
- if (get_skey_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (get_skey_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
WIRED_GET_SESSION_KEY, get_skey_out.header.status);
return -EIO;
@@ -489,13 +489,13 @@ mei_hdcp_repeater_check_flow_prepare_ack(struct device *dev,
verify_repeater_in.header.api_version = HDCP_API_VERSION;
verify_repeater_in.header.command_id = WIRED_VERIFY_REPEATER;
- verify_repeater_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ verify_repeater_in.header.status = FW_HDCP_STATUS_SUCCESS;
verify_repeater_in.header.buffer_len =
WIRED_CMD_BUF_LEN_VERIFY_REPEATER_IN;
verify_repeater_in.port.integrated_port_type = data->port_type;
- verify_repeater_in.port.physical_port = (u8)data->fw_ddi;
- verify_repeater_in.port.attached_transcoder = (u8)data->fw_tc;
+ verify_repeater_in.port.physical_port = (u8)data->hdcp_ddi;
+ verify_repeater_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
memcpy(verify_repeater_in.rx_info, rep_topology->rx_info,
HDCP_2_2_RXINFO_LEN);
@@ -520,7 +520,7 @@ mei_hdcp_repeater_check_flow_prepare_ack(struct device *dev,
return byte;
}
- if (verify_repeater_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (verify_repeater_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
WIRED_VERIFY_REPEATER,
verify_repeater_out.header.status);
@@ -568,12 +568,12 @@ static int mei_hdcp_verify_mprime(struct device *dev,
verify_mprime_in->header.api_version = HDCP_API_VERSION;
verify_mprime_in->header.command_id = WIRED_REPEATER_AUTH_STREAM_REQ;
- verify_mprime_in->header.status = ME_HDCP_STATUS_SUCCESS;
+ verify_mprime_in->header.status = FW_HDCP_STATUS_SUCCESS;
verify_mprime_in->header.buffer_len = cmd_size - sizeof(verify_mprime_in->header);
verify_mprime_in->port.integrated_port_type = data->port_type;
- verify_mprime_in->port.physical_port = (u8)data->fw_ddi;
- verify_mprime_in->port.attached_transcoder = (u8)data->fw_tc;
+ verify_mprime_in->port.physical_port = (u8)data->hdcp_ddi;
+ verify_mprime_in->port.attached_transcoder = (u8)data->hdcp_transcoder;
memcpy(verify_mprime_in->m_prime, stream_ready->m_prime, HDCP_2_2_MPRIME_LEN);
drm_hdcp_cpu_to_be24(verify_mprime_in->seq_num_m, data->seq_num_m);
@@ -597,7 +597,7 @@ static int mei_hdcp_verify_mprime(struct device *dev,
return byte;
}
- if (verify_mprime_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (verify_mprime_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
WIRED_REPEATER_AUTH_STREAM_REQ,
verify_mprime_out.header.status);
@@ -630,12 +630,12 @@ static int mei_hdcp_enable_authentication(struct device *dev,
enable_auth_in.header.api_version = HDCP_API_VERSION;
enable_auth_in.header.command_id = WIRED_ENABLE_AUTH;
- enable_auth_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ enable_auth_in.header.status = FW_HDCP_STATUS_SUCCESS;
enable_auth_in.header.buffer_len = WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN;
enable_auth_in.port.integrated_port_type = data->port_type;
- enable_auth_in.port.physical_port = (u8)data->fw_ddi;
- enable_auth_in.port.attached_transcoder = (u8)data->fw_tc;
+ enable_auth_in.port.physical_port = (u8)data->hdcp_ddi;
+ enable_auth_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
enable_auth_in.stream_type = data->streams[0].stream_type;
byte = mei_cldev_send(cldev, (u8 *)&enable_auth_in,
@@ -652,7 +652,7 @@ static int mei_hdcp_enable_authentication(struct device *dev,
return byte;
}
- if (enable_auth_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (enable_auth_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
WIRED_ENABLE_AUTH, enable_auth_out.header.status);
return -EIO;
@@ -684,13 +684,13 @@ mei_hdcp_close_session(struct device *dev, struct hdcp_port_data *data)
session_close_in.header.api_version = HDCP_API_VERSION;
session_close_in.header.command_id = WIRED_CLOSE_SESSION;
- session_close_in.header.status = ME_HDCP_STATUS_SUCCESS;
+ session_close_in.header.status = FW_HDCP_STATUS_SUCCESS;
session_close_in.header.buffer_len =
WIRED_CMD_BUF_LEN_CLOSE_SESSION_IN;
session_close_in.port.integrated_port_type = data->port_type;
- session_close_in.port.physical_port = (u8)data->fw_ddi;
- session_close_in.port.attached_transcoder = (u8)data->fw_tc;
+ session_close_in.port.physical_port = (u8)data->hdcp_ddi;
+ session_close_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
byte = mei_cldev_send(cldev, (u8 *)&session_close_in,
sizeof(session_close_in));
@@ -706,7 +706,7 @@ mei_hdcp_close_session(struct device *dev, struct hdcp_port_data *data)
return byte;
}
- if (session_close_out.header.status != ME_HDCP_STATUS_SUCCESS) {
+ if (session_close_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "Session Close Failed. status: 0x%X\n",
session_close_out.header.status);
return -EIO;
@@ -715,7 +715,7 @@ mei_hdcp_close_session(struct device *dev, struct hdcp_port_data *data)
return 0;
}
-static const struct i915_hdcp_component_ops mei_hdcp_ops = {
+static const struct i915_hdcp_ops mei_hdcp_ops = {
.owner = THIS_MODULE,
.initiate_hdcp2_session = mei_hdcp_initiate_session,
.verify_receiver_cert_prepare_km =
@@ -735,13 +735,12 @@ static const struct i915_hdcp_component_ops mei_hdcp_ops = {
static int mei_component_master_bind(struct device *dev)
{
struct mei_cl_device *cldev = to_mei_cl_device(dev);
- struct i915_hdcp_comp_master *comp_master =
- mei_cldev_get_drvdata(cldev);
+ struct i915_hdcp_master *comp_master = mei_cldev_get_drvdata(cldev);
int ret;
dev_dbg(dev, "%s\n", __func__);
comp_master->ops = &mei_hdcp_ops;
- comp_master->mei_dev = dev;
+ comp_master->hdcp_dev = dev;
ret = component_bind_all(dev, comp_master);
if (ret < 0)
return ret;
@@ -752,8 +751,7 @@ static int mei_component_master_bind(struct device *dev)
static void mei_component_master_unbind(struct device *dev)
{
struct mei_cl_device *cldev = to_mei_cl_device(dev);
- struct i915_hdcp_comp_master *comp_master =
- mei_cldev_get_drvdata(cldev);
+ struct i915_hdcp_master *comp_master = mei_cldev_get_drvdata(cldev);
dev_dbg(dev, "%s\n", __func__);
component_unbind_all(dev, comp_master);
@@ -801,7 +799,7 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
static int mei_hdcp_probe(struct mei_cl_device *cldev,
const struct mei_cl_device_id *id)
{
- struct i915_hdcp_comp_master *comp_master;
+ struct i915_hdcp_master *comp_master;
struct component_match *master_match;
int ret;
@@ -846,8 +844,7 @@ enable_err_exit:
static void mei_hdcp_remove(struct mei_cl_device *cldev)
{
- struct i915_hdcp_comp_master *comp_master =
- mei_cldev_get_drvdata(cldev);
+ struct i915_hdcp_master *comp_master = mei_cldev_get_drvdata(cldev);
int ret;
component_master_del(&cldev->dev, &mei_component_master_ops);
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.h b/drivers/misc/mei/hdcp/mei_hdcp.h
index ca09c8f83d6b..0683d83ec17a 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.h
+++ b/drivers/misc/mei/hdcp/mei_hdcp.h
@@ -11,358 +11,4 @@
#include <drm/display/drm_hdcp.h>
-/* me_hdcp_status: Enumeration of all HDCP Status Codes */
-enum me_hdcp_status {
- ME_HDCP_STATUS_SUCCESS = 0x0000,
-
- /* WiDi Generic Status Codes */
- ME_HDCP_STATUS_INTERNAL_ERROR = 0x1000,
- ME_HDCP_STATUS_UNKNOWN_ERROR = 0x1001,
- ME_HDCP_STATUS_INCORRECT_API_VERSION = 0x1002,
- ME_HDCP_STATUS_INVALID_FUNCTION = 0x1003,
- ME_HDCP_STATUS_INVALID_BUFFER_LENGTH = 0x1004,
- ME_HDCP_STATUS_INVALID_PARAMS = 0x1005,
- ME_HDCP_STATUS_AUTHENTICATION_FAILED = 0x1006,
-
- /* WiDi Status Codes */
- ME_HDCP_INVALID_SESSION_STATE = 0x6000,
- ME_HDCP_SRM_FRAGMENT_UNEXPECTED = 0x6001,
- ME_HDCP_SRM_INVALID_LENGTH = 0x6002,
- ME_HDCP_SRM_FRAGMENT_OFFSET_INVALID = 0x6003,
- ME_HDCP_SRM_VERIFICATION_FAILED = 0x6004,
- ME_HDCP_SRM_VERSION_TOO_OLD = 0x6005,
- ME_HDCP_RX_CERT_VERIFICATION_FAILED = 0x6006,
- ME_HDCP_RX_REVOKED = 0x6007,
- ME_HDCP_H_VERIFICATION_FAILED = 0x6008,
- ME_HDCP_REPEATER_CHECK_UNEXPECTED = 0x6009,
- ME_HDCP_TOPOLOGY_MAX_EXCEEDED = 0x600A,
- ME_HDCP_V_VERIFICATION_FAILED = 0x600B,
- ME_HDCP_L_VERIFICATION_FAILED = 0x600C,
- ME_HDCP_STREAM_KEY_ALLOC_FAILED = 0x600D,
- ME_HDCP_BASE_KEY_RESET_FAILED = 0x600E,
- ME_HDCP_NONCE_GENERATION_FAILED = 0x600F,
- ME_HDCP_STATUS_INVALID_E_KEY_STATE = 0x6010,
- ME_HDCP_STATUS_INVALID_CS_ICV = 0x6011,
- ME_HDCP_STATUS_INVALID_KB_KEY_STATE = 0x6012,
- ME_HDCP_STATUS_INVALID_PAVP_MODE_ICV = 0x6013,
- ME_HDCP_STATUS_INVALID_PAVP_MODE = 0x6014,
- ME_HDCP_STATUS_LC_MAX_ATTEMPTS = 0x6015,
-
- /* New status for HDCP 2.1 */
- ME_HDCP_STATUS_MISMATCH_IN_M = 0x6016,
-
- /* New status code for HDCP 2.2 Rx */
- ME_HDCP_STATUS_RX_PROV_NOT_ALLOWED = 0x6017,
- ME_HDCP_STATUS_RX_PROV_WRONG_SUBJECT = 0x6018,
- ME_HDCP_RX_NEEDS_PROVISIONING = 0x6019,
- ME_HDCP_BKSV_ICV_AUTH_FAILED = 0x6020,
- ME_HDCP_STATUS_INVALID_STREAM_ID = 0x6021,
- ME_HDCP_STATUS_CHAIN_NOT_INITIALIZED = 0x6022,
- ME_HDCP_FAIL_NOT_EXPECTED = 0x6023,
- ME_HDCP_FAIL_HDCP_OFF = 0x6024,
- ME_HDCP_FAIL_INVALID_PAVP_MEMORY_MODE = 0x6025,
- ME_HDCP_FAIL_AES_ECB_FAILURE = 0x6026,
- ME_HDCP_FEATURE_NOT_SUPPORTED = 0x6027,
- ME_HDCP_DMA_READ_ERROR = 0x6028,
- ME_HDCP_DMA_WRITE_ERROR = 0x6029,
- ME_HDCP_FAIL_INVALID_PACKET_SIZE = 0x6030,
- ME_HDCP_H264_PARSING_ERROR = 0x6031,
- ME_HDCP_HDCP2_ERRATA_VIDEO_VIOLATION = 0x6032,
- ME_HDCP_HDCP2_ERRATA_AUDIO_VIOLATION = 0x6033,
- ME_HDCP_TX_ACTIVE_ERROR = 0x6034,
- ME_HDCP_MODE_CHANGE_ERROR = 0x6035,
- ME_HDCP_STREAM_TYPE_ERROR = 0x6036,
- ME_HDCP_STREAM_MANAGE_NOT_POSSIBLE = 0x6037,
-
- ME_HDCP_STATUS_PORT_INVALID_COMMAND = 0x6038,
- ME_HDCP_STATUS_UNSUPPORTED_PROTOCOL = 0x6039,
- ME_HDCP_STATUS_INVALID_PORT_INDEX = 0x603a,
- ME_HDCP_STATUS_TX_AUTH_NEEDED = 0x603b,
- ME_HDCP_STATUS_NOT_INTEGRATED_PORT = 0x603c,
- ME_HDCP_STATUS_SESSION_MAX_REACHED = 0x603d,
-
- /* hdcp capable bit is not set in rx_caps(error is unique to DP) */
- ME_HDCP_STATUS_NOT_HDCP_CAPABLE = 0x6041,
-
- ME_HDCP_STATUS_INVALID_STREAM_COUNT = 0x6042,
-};
-
-#define HDCP_API_VERSION 0x00010000
-
-#define HDCP_M_LEN 16
-#define HDCP_KH_LEN 16
-
-/* Payload Buffer size(Excluding Header) for CMDs and corresponding response */
-/* Wired_Tx_AKE */
-#define WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN (4 + 1)
-#define WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_OUT (4 + 8 + 3)
-
-#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN (4 + 522 + 8 + 3)
-#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MIN_OUT (4 + 1 + 3 + 16 + 16)
-#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MAX_OUT (4 + 1 + 3 + 128)
-
-#define WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN (4 + 32)
-#define WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_OUT (4)
-
-#define WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN (4 + 16)
-#define WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_OUT (4)
-
-#define WIRED_CMD_BUF_LEN_CLOSE_SESSION_IN (4)
-#define WIRED_CMD_BUF_LEN_CLOSE_SESSION_OUT (4)
-
-/* Wired_Tx_LC */
-#define WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN (4)
-#define WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_OUT (4 + 8)
-
-#define WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_IN (4 + 32)
-#define WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_OUT (4)
-
-/* Wired_Tx_SKE */
-#define WIRED_CMD_BUF_LEN_GET_SESSION_KEY_IN (4)
-#define WIRED_CMD_BUF_LEN_GET_SESSION_KEY_OUT (4 + 16 + 8)
-
-/* Wired_Tx_SKE */
-#define WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN (4 + 1)
-#define WIRED_CMD_BUF_LEN_ENABLE_AUTH_OUT (4)
-
-/* Wired_Tx_Repeater */
-#define WIRED_CMD_BUF_LEN_VERIFY_REPEATER_IN (4 + 2 + 3 + 16 + 155)
-#define WIRED_CMD_BUF_LEN_VERIFY_REPEATER_OUT (4 + 1 + 16)
-
-#define WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_MIN_IN (4 + 3 + \
- 32 + 2 + 2)
-
-#define WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_OUT (4)
-
-/* hdcp_command_id: Enumeration of all WIRED HDCP Command IDs */
-enum hdcp_command_id {
- _WIDI_COMMAND_BASE = 0x00030000,
- WIDI_INITIATE_HDCP2_SESSION = _WIDI_COMMAND_BASE,
- HDCP_GET_SRM_STATUS,
- HDCP_SEND_SRM_FRAGMENT,
-
- /* The wired HDCP Tx commands */
- _WIRED_COMMAND_BASE = 0x00031000,
- WIRED_INITIATE_HDCP2_SESSION = _WIRED_COMMAND_BASE,
- WIRED_VERIFY_RECEIVER_CERT,
- WIRED_AKE_SEND_HPRIME,
- WIRED_AKE_SEND_PAIRING_INFO,
- WIRED_INIT_LOCALITY_CHECK,
- WIRED_VALIDATE_LOCALITY,
- WIRED_GET_SESSION_KEY,
- WIRED_ENABLE_AUTH,
- WIRED_VERIFY_REPEATER,
- WIRED_REPEATER_AUTH_STREAM_REQ,
- WIRED_CLOSE_SESSION,
-
- _WIRED_COMMANDS_COUNT,
-};
-
-union encrypted_buff {
- u8 e_kpub_km[HDCP_2_2_E_KPUB_KM_LEN];
- u8 e_kh_km_m[HDCP_2_2_E_KH_KM_M_LEN];
- struct {
- u8 e_kh_km[HDCP_KH_LEN];
- u8 m[HDCP_M_LEN];
- } __packed;
-};
-
-/* HDCP HECI message header. All header values are little endian. */
-struct hdcp_cmd_header {
- u32 api_version;
- u32 command_id;
- enum me_hdcp_status status;
- /* Length of the HECI message (excluding the header) */
- u32 buffer_len;
-} __packed;
-
-/* Empty command request or response. No data follows the header. */
-struct hdcp_cmd_no_data {
- struct hdcp_cmd_header header;
-} __packed;
-
-/* Uniquely identifies the hdcp port being addressed for a given command. */
-struct hdcp_port_id {
- u8 integrated_port_type;
- /* physical_port is used until Gen11.5. Must be zero for Gen11.5+ */
- u8 physical_port;
- /* attached_transcoder is for Gen11.5+. Set to zero for <Gen11.5 */
- u8 attached_transcoder;
- u8 reserved;
-} __packed;
-
-/*
- * Data structures for integrated wired HDCP2 Tx in
- * support of the AKE protocol
- */
-/* HECI struct for integrated wired HDCP Tx session initiation. */
-struct wired_cmd_initiate_hdcp2_session_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 protocol; /* for HDMI vs DP */
-} __packed;
-
-struct wired_cmd_initiate_hdcp2_session_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 r_tx[HDCP_2_2_RTX_LEN];
- struct hdcp2_tx_caps tx_caps;
-} __packed;
-
-/* HECI struct for ending an integrated wired HDCP Tx session. */
-struct wired_cmd_close_session_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-struct wired_cmd_close_session_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-/* HECI struct for integrated wired HDCP Tx Rx Cert verification. */
-struct wired_cmd_verify_receiver_cert_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- struct hdcp2_cert_rx cert_rx;
- u8 r_rx[HDCP_2_2_RRX_LEN];
- u8 rx_caps[HDCP_2_2_RXCAPS_LEN];
-} __packed;
-
-struct wired_cmd_verify_receiver_cert_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 km_stored;
- u8 reserved[3];
- union encrypted_buff ekm_buff;
-} __packed;
-
-/* HECI struct for verification of Rx's Hprime in a HDCP Tx session */
-struct wired_cmd_ake_send_hprime_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 h_prime[HDCP_2_2_H_PRIME_LEN];
-} __packed;
-
-struct wired_cmd_ake_send_hprime_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-/*
- * HECI struct for sending in AKE pairing data generated by the Rx in an
- * integrated wired HDCP Tx session.
- */
-struct wired_cmd_ake_send_pairing_info_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 e_kh_km[HDCP_2_2_E_KH_KM_LEN];
-} __packed;
-
-struct wired_cmd_ake_send_pairing_info_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-/* Data structures for integrated wired HDCP2 Tx in support of the LC protocol*/
-/*
- * HECI struct for initiating locality check with an
- * integrated wired HDCP Tx session.
- */
-struct wired_cmd_init_locality_check_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-struct wired_cmd_init_locality_check_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 r_n[HDCP_2_2_RN_LEN];
-} __packed;
-
-/*
- * HECI struct for validating an Rx's LPrime value in an
- * integrated wired HDCP Tx session.
- */
-struct wired_cmd_validate_locality_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 l_prime[HDCP_2_2_L_PRIME_LEN];
-} __packed;
-
-struct wired_cmd_validate_locality_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-/*
- * Data structures for integrated wired HDCP2 Tx in support of the
- * SKE protocol
- */
-/* HECI struct for creating session key */
-struct wired_cmd_get_session_key_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-struct wired_cmd_get_session_key_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 e_dkey_ks[HDCP_2_2_E_DKEY_KS_LEN];
- u8 r_iv[HDCP_2_2_RIV_LEN];
-} __packed;
-
-/* HECI struct for the Tx enable authentication command */
-struct wired_cmd_enable_auth_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 stream_type;
-} __packed;
-
-struct wired_cmd_enable_auth_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
-
-/*
- * Data structures for integrated wired HDCP2 Tx in support of
- * the repeater protocols
- */
-/*
- * HECI struct for verifying the downstream repeater's HDCP topology in an
- * integrated wired HDCP Tx session.
- */
-struct wired_cmd_verify_repeater_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 rx_info[HDCP_2_2_RXINFO_LEN];
- u8 seq_num_v[HDCP_2_2_SEQ_NUM_LEN];
- u8 v_prime[HDCP_2_2_V_PRIME_HALF_LEN];
- u8 receiver_ids[HDCP_2_2_RECEIVER_IDS_MAX_LEN];
-} __packed;
-
-struct wired_cmd_verify_repeater_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 content_type_supported;
- u8 v[HDCP_2_2_V_PRIME_HALF_LEN];
-} __packed;
-
-/*
- * HECI struct in support of stream management in an
- * integrated wired HDCP Tx session.
- */
-struct wired_cmd_repeater_auth_stream_req_in {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
- u8 seq_num_m[HDCP_2_2_SEQ_NUM_LEN];
- u8 m_prime[HDCP_2_2_MPRIME_LEN];
- __be16 k;
- struct hdcp2_streamid_type streams[];
-} __packed;
-
-struct wired_cmd_repeater_auth_stream_req_out {
- struct hdcp_cmd_header header;
- struct hdcp_port_id port;
-} __packed;
#endif /* __MEI_HDCP_H__ */
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 5bf0d50d55a0..676d566f38dd 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -342,6 +342,12 @@ static void mei_me_remove(struct pci_dev *pdev)
}
#ifdef CONFIG_PM_SLEEP
+static int mei_me_pci_prepare(struct device *device)
+{
+ pm_runtime_resume(device);
+ return 0;
+}
+
static int mei_me_pci_suspend(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
@@ -398,7 +404,17 @@ static int mei_me_pci_resume(struct device *device)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
+
+static void mei_me_pci_complete(struct device *device)
+{
+ pm_runtime_suspend(device);
+}
+#else /* CONFIG_PM_SLEEP */
+
+#define mei_me_pci_prepare NULL
+#define mei_me_pci_complete NULL
+
+#endif /* !CONFIG_PM_SLEEP */
#ifdef CONFIG_PM
static int mei_me_pm_runtime_idle(struct device *device)
@@ -501,6 +517,8 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev)
}
static const struct dev_pm_ops mei_me_pm_ops = {
+ .prepare = mei_me_pci_prepare,
+ .complete = mei_me_pci_complete,
SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend,
mei_me_pci_resume)
SET_RUNTIME_PM_OPS(