mirror of
https://github.com/torvalds/linux.git
synced 2026-09-28 20:12:01 +02:00
drm/i915/dp_link_caps: Introduce DP link capability module
Start isolating the DP link capability logic from the generic DP code by adding a separate intel_dp_link_caps module and a corresponding state object. Allocate the state so it can remain opaque within its module. Follow-up changes will move link capability helpers and state from intel_dp.c and intel_dp_link_training.c to the new module and state. v2: Remove unnecessary function documentation. (Jani) Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260616200849.3534628-4-imre.deak@intel.com
This commit is contained in:
parent
f5fed6af1c
commit
ebf5ad5cbc
|
|
@ -356,6 +356,7 @@ i915-y += \
|
|||
display/intel_dp_aux.o \
|
||||
display/intel_dp_aux_backlight.o \
|
||||
display/intel_dp_hdcp.o \
|
||||
display/intel_dp_link_caps.o \
|
||||
display/intel_dp_link_training.o \
|
||||
display/intel_dp_mst.o \
|
||||
display/intel_dp_test.o \
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ struct cec_notifier;
|
|||
struct drm_printer;
|
||||
struct intel_connector;
|
||||
struct intel_ddi_buf_trans;
|
||||
struct intel_dp_link_caps;
|
||||
struct intel_dp_link_training;
|
||||
struct intel_fbc;
|
||||
struct intel_global_objs_state;
|
||||
|
|
@ -1869,6 +1870,7 @@ struct intel_dp {
|
|||
int force_lane_count;
|
||||
int force_rate;
|
||||
struct intel_dp_link_training *training;
|
||||
struct intel_dp_link_caps *caps;
|
||||
} link;
|
||||
bool reset_link_params;
|
||||
int mso_link_count;
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
#include "intel_dp.h"
|
||||
#include "intel_dp_aux.h"
|
||||
#include "intel_dp_hdcp.h"
|
||||
#include "intel_dp_link_caps.h"
|
||||
#include "intel_dp_link_training.h"
|
||||
#include "intel_dp_mst.h"
|
||||
#include "intel_dp_test.h"
|
||||
|
|
@ -7458,10 +7459,18 @@ int intel_dp_link_init(struct intel_dp *intel_dp)
|
|||
if (!intel_dp->link.training)
|
||||
return -ENOMEM;
|
||||
|
||||
intel_dp->link.caps = intel_dp_link_caps_init(intel_dp);
|
||||
if (!intel_dp->link.caps) {
|
||||
intel_dp_link_training_cleanup(intel_dp->link.training);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void intel_dp_link_cleanup(struct intel_dp *intel_dp)
|
||||
{
|
||||
intel_dp_link_caps_cleanup(intel_dp->link.caps);
|
||||
intel_dp_link_training_cleanup(intel_dp->link.training);
|
||||
}
|
||||
|
|
|
|||
30
drivers/gpu/drm/i915/display/intel_dp_link_caps.c
Normal file
30
drivers/gpu/drm/i915/display/intel_dp_link_caps.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
/*
|
||||
* Copyright © 2026 Intel Corporation
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "intel_dp_link_caps.h"
|
||||
|
||||
struct intel_dp_link_caps {
|
||||
struct intel_dp *dp;
|
||||
};
|
||||
|
||||
struct intel_dp_link_caps *intel_dp_link_caps_init(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_dp_link_caps *link_caps;
|
||||
|
||||
link_caps = kzalloc_obj(*link_caps);
|
||||
if (!link_caps)
|
||||
return NULL;
|
||||
|
||||
link_caps->dp = intel_dp;
|
||||
|
||||
return link_caps;
|
||||
}
|
||||
|
||||
void intel_dp_link_caps_cleanup(struct intel_dp_link_caps *link_caps)
|
||||
{
|
||||
kfree(link_caps);
|
||||
}
|
||||
12
drivers/gpu/drm/i915/display/intel_dp_link_caps.h
Normal file
12
drivers/gpu/drm/i915/display/intel_dp_link_caps.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright © 2026 Intel Corporation */
|
||||
|
||||
#ifndef __INTEL_DP_LINK_CAPS_H__
|
||||
#define __INTEL_DP_LINK_CAPS_H__
|
||||
|
||||
struct intel_dp;
|
||||
|
||||
struct intel_dp_link_caps *intel_dp_link_caps_init(struct intel_dp *intel_dp);
|
||||
void intel_dp_link_caps_cleanup(struct intel_dp_link_caps *link_caps);
|
||||
|
||||
#endif /* __INTEL_DP_LINK_CAPS_H__ */
|
||||
|
|
@ -278,6 +278,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
|||
i915-display/intel_dp_aux.o \
|
||||
i915-display/intel_dp_aux_backlight.o \
|
||||
i915-display/intel_dp_hdcp.o \
|
||||
i915-display/intel_dp_link_caps.o \
|
||||
i915-display/intel_dp_link_training.o \
|
||||
i915-display/intel_dp_mst.o \
|
||||
i915-display/intel_dp_test.o \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user