Skip to content

Commit b728ef0

Browse files
author
Bob Zhou
committed
drm/amdkcl: test whether drm_dp_mst_topology_cbs->poll_hpd_irq is available
It's caused by ed8496801ab71fdfb9c9fdcbef058aa20a549ebd "drm/amd/display: Add polling method to handle MST reply packet" Signed-off-by: Bob Zhou <[email protected]> Reviewed-by: Leslie Shi <[email protected]>
1 parent 6a466ff commit b728ef0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,14 +860,18 @@ void dm_handle_mst_sideband_msg_ready_event(
860860
DRM_DEBUG_DRIVER("Loop exceeded max iterations\n");
861861
}
862862

863+
#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
863864
static void dm_handle_mst_down_rep_msg_ready(struct drm_dp_mst_topology_mgr *mgr)
864865
{
865866
dm_handle_mst_sideband_msg_ready_event(mgr, DOWN_REP_MSG_RDY_EVENT);
866867
}
868+
#endif
867869

868870
static const struct drm_dp_mst_topology_cbs dm_mst_cbs = {
869871
.add_connector = dm_dp_add_mst_connector,
872+
#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
870873
.poll_hpd_irq = dm_handle_mst_down_rep_msg_ready,
874+
#endif
871875
#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR
872876
.destroy_connector = dm_dp_destroy_mst_connector,
873877
#endif

drivers/gpu/drm/amd/dkms/config/config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@
326326
/* struct drm_dp_mst_topology_cbs has hotplug member */
327327
/* #undef HAVE_DRM_DP_MST_TOPOLOGY_CBS_HOTPLUG */
328328

329+
/* struct drm_dp_mst_topology_cbs->poll_hpd_irq is available */
330+
#define HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ 1
331+
329332
/* struct drm_dp_mst_topology_cbs->register_connector is available */
330333
/* #undef HAVE_DRM_DP_MST_TOPOLOGY_CBS_REGISTER_CONNECTOR */
331334

drivers/gpu/drm/amd/dkms/m4/drm-dp-mst-topology-cbs.m4

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,33 @@ AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR], [
6868
])
6969
])
7070

71+
dnl #
72+
dnl # commit v5.7-rc1-646-g471bdd0df0d5
73+
dnl # drm/i915/dp_mst: Work around out-of-spec adapters filtering short pulses
74+
dnl #
75+
AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ], [
76+
AC_KERNEL_TRY_COMPILE([
77+
#if defined(HAVE_DRM_DISPLAY_DRM_DP_MST_HELPER_H)
78+
#include <drm/display/drm_dp_mst_helper.h>
79+
#elif defined(HAVE_DRM_DP_DRM_DP_MST_HELPER_H)
80+
#include <drm/dp/drm_dp_mst_helper.h>
81+
#else
82+
#include <drm/drm_dp_mst_helper.h>
83+
#endif
84+
], [
85+
struct drm_dp_mst_topology_cbs *dp_mst_cbs = NULL;
86+
dp_mst_cbs->poll_hpd_irq(NULL);
87+
], [
88+
AC_DEFINE(HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ, 1,
89+
[struct drm_dp_mst_topology_cbs->poll_hpd_irq is available])
90+
])
91+
])
92+
7193
AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS], [
7294
AC_KERNEL_DO_BACKGROUND([
7395
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_HOTPLUG
7496
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_REGISTER_CONNECTOR
7597
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR
98+
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
7699
])
77100
])

0 commit comments

Comments
 (0)