mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
drm/i915/hdcp: Move HDCP debugfs to intel_hdcp.c
Continue with placing debugfs next to the implementation. intel_connector_info() still needs intel_hdcp_info(), so we'll need to expose that too. Cc: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/c118e992673f6b054aacaff0e1850fcea329e000.1738924826.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
9e35a4edb8
commit
2c569b955e
3 changed files with 88 additions and 72 deletions
|
|
@ -213,38 +213,6 @@ static void intel_panel_info(struct seq_file *m,
|
|||
intel_seq_print_mode(m, 2, fixed_mode);
|
||||
}
|
||||
|
||||
static void intel_hdcp_info(struct seq_file *m,
|
||||
struct intel_connector *intel_connector,
|
||||
bool remote_req)
|
||||
{
|
||||
bool hdcp_cap = false, hdcp2_cap = false;
|
||||
|
||||
if (!intel_connector->hdcp.shim) {
|
||||
seq_puts(m, "No Connector Support");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (remote_req) {
|
||||
intel_hdcp_get_remote_capability(intel_connector,
|
||||
&hdcp_cap,
|
||||
&hdcp2_cap);
|
||||
} else {
|
||||
hdcp_cap = intel_hdcp_get_capability(intel_connector);
|
||||
hdcp2_cap = intel_hdcp2_get_capability(intel_connector);
|
||||
}
|
||||
|
||||
if (hdcp_cap)
|
||||
seq_puts(m, "HDCP1.4 ");
|
||||
if (hdcp2_cap)
|
||||
seq_puts(m, "HDCP2.2 ");
|
||||
|
||||
if (!hdcp_cap && !hdcp2_cap)
|
||||
seq_puts(m, "None");
|
||||
|
||||
out:
|
||||
seq_puts(m, "\n");
|
||||
}
|
||||
|
||||
static void intel_dp_info(struct seq_file *m, struct intel_connector *connector)
|
||||
{
|
||||
struct intel_encoder *intel_encoder = intel_attached_encoder(connector);
|
||||
|
|
@ -309,12 +277,7 @@ static void intel_connector_info(struct seq_file *m,
|
|||
break;
|
||||
}
|
||||
|
||||
seq_puts(m, "\tHDCP version: ");
|
||||
if (intel_connector->mst_port) {
|
||||
intel_hdcp_info(m, intel_connector, true);
|
||||
seq_puts(m, "\tMST Hub HDCP version: ");
|
||||
}
|
||||
intel_hdcp_info(m, intel_connector, false);
|
||||
intel_hdcp_info(m, intel_connector);
|
||||
|
||||
seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc);
|
||||
|
||||
|
|
@ -893,33 +856,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
|
|||
intel_display_debugfs_params(display);
|
||||
}
|
||||
|
||||
static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct intel_connector *connector = m->private;
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
int ret;
|
||||
|
||||
ret = drm_modeset_lock_single_interruptible(&i915->drm.mode_config.connection_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!connector->base.encoder ||
|
||||
connector->base.status != connector_status_connected) {
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
seq_printf(m, "%s:%d HDCP version: ", connector->base.name,
|
||||
connector->base.base.id);
|
||||
intel_hdcp_info(m, connector, false);
|
||||
|
||||
out:
|
||||
drm_modeset_unlock(&i915->drm.mode_config.connection_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
DEFINE_SHOW_ATTRIBUTE(i915_hdcp_sink_capability);
|
||||
|
||||
static int i915_lpsp_capability_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct intel_connector *connector = m->private;
|
||||
|
|
@ -1401,18 +1337,12 @@ void intel_connector_debugfs_add(struct intel_connector *connector)
|
|||
return;
|
||||
|
||||
intel_drrs_connector_debugfs_add(connector);
|
||||
intel_hdcp_connector_debugfs_add(connector);
|
||||
intel_pps_connector_debugfs_add(connector);
|
||||
intel_psr_connector_debugfs_add(connector);
|
||||
intel_alpm_lobf_debugfs_add(connector);
|
||||
intel_dp_link_training_debugfs_add(connector);
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
|
||||
connector_type == DRM_MODE_CONNECTOR_HDMIA ||
|
||||
connector_type == DRM_MODE_CONNECTOR_HDMIB) {
|
||||
debugfs_create_file("i915_hdcp_sink_capability", 0444, root,
|
||||
connector, &i915_hdcp_sink_capability_fops);
|
||||
}
|
||||
|
||||
if (DISPLAY_VER(i915) >= 11 &&
|
||||
((connector_type == DRM_MODE_CONNECTOR_DisplayPort && !connector->mst_port) ||
|
||||
connector_type == DRM_MODE_CONNECTOR_eDP)) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/component.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/random.h>
|
||||
|
||||
|
|
@ -2731,3 +2732,84 @@ void intel_hdcp_handle_cp_irq(struct intel_connector *connector)
|
|||
|
||||
queue_delayed_work(i915->unordered_wq, &hdcp->check_work, 0);
|
||||
}
|
||||
|
||||
static void __intel_hdcp_info(struct seq_file *m, struct intel_connector *intel_connector,
|
||||
bool remote_req)
|
||||
{
|
||||
bool hdcp_cap = false, hdcp2_cap = false;
|
||||
|
||||
if (!intel_connector->hdcp.shim) {
|
||||
seq_puts(m, "No Connector Support");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (remote_req) {
|
||||
intel_hdcp_get_remote_capability(intel_connector,
|
||||
&hdcp_cap,
|
||||
&hdcp2_cap);
|
||||
} else {
|
||||
hdcp_cap = intel_hdcp_get_capability(intel_connector);
|
||||
hdcp2_cap = intel_hdcp2_get_capability(intel_connector);
|
||||
}
|
||||
|
||||
if (hdcp_cap)
|
||||
seq_puts(m, "HDCP1.4 ");
|
||||
if (hdcp2_cap)
|
||||
seq_puts(m, "HDCP2.2 ");
|
||||
|
||||
if (!hdcp_cap && !hdcp2_cap)
|
||||
seq_puts(m, "None");
|
||||
|
||||
out:
|
||||
seq_puts(m, "\n");
|
||||
}
|
||||
|
||||
void intel_hdcp_info(struct seq_file *m, struct intel_connector *connector)
|
||||
{
|
||||
seq_puts(m, "\tHDCP version: ");
|
||||
if (connector->mst_port) {
|
||||
__intel_hdcp_info(m, connector, true);
|
||||
seq_puts(m, "\tMST Hub HDCP version: ");
|
||||
}
|
||||
__intel_hdcp_info(m, connector, false);
|
||||
}
|
||||
|
||||
static int intel_hdcp_sink_capability_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct intel_connector *connector = m->private;
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
int ret;
|
||||
|
||||
ret = drm_modeset_lock_single_interruptible(&i915->drm.mode_config.connection_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!connector->base.encoder ||
|
||||
connector->base.status != connector_status_connected) {
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
seq_printf(m, "%s:%d HDCP version: ", connector->base.name,
|
||||
connector->base.base.id);
|
||||
__intel_hdcp_info(m, connector, false);
|
||||
|
||||
out:
|
||||
drm_modeset_unlock(&i915->drm.mode_config.connection_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
DEFINE_SHOW_ATTRIBUTE(intel_hdcp_sink_capability);
|
||||
|
||||
void intel_hdcp_connector_debugfs_add(struct intel_connector *connector)
|
||||
{
|
||||
struct dentry *root = connector->base.debugfs_entry;
|
||||
int connector_type = connector->base.connector_type;
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
|
||||
connector_type == DRM_MODE_CONNECTOR_HDMIA ||
|
||||
connector_type == DRM_MODE_CONNECTOR_HDMIB) {
|
||||
debugfs_create_file("i915_hdcp_sink_capability", 0444, root,
|
||||
connector, &intel_hdcp_sink_capability_fops);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ struct intel_digital_port;
|
|||
struct intel_display;
|
||||
struct intel_encoder;
|
||||
struct intel_hdcp_shim;
|
||||
struct seq_file;
|
||||
enum port;
|
||||
enum transcoder;
|
||||
|
||||
|
|
@ -48,4 +49,7 @@ void intel_hdcp_component_fini(struct intel_display *display);
|
|||
void intel_hdcp_cleanup(struct intel_connector *connector);
|
||||
void intel_hdcp_handle_cp_irq(struct intel_connector *connector);
|
||||
|
||||
void intel_hdcp_info(struct seq_file *m, struct intel_connector *connector);
|
||||
void intel_hdcp_connector_debugfs_add(struct intel_connector *connector);
|
||||
|
||||
#endif /* __INTEL_HDCP_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue