Skip to content

Commit

Permalink
drm/amdkcl: test whether drm_dp_mst_topology_cbs->poll_hpd_irq is ava…
Browse files Browse the repository at this point in the history
…ilable

It's caused by ed8496801ab71fdfb9c9fdcbef058aa20a549ebd
"drm/amd/display: Add polling method to handle MST reply packet"

Signed-off-by: Bob Zhou <bob.zhou@amd.com>
Reviewed-by: Leslie Shi <Yuliang.Shi@amd.com>
  • Loading branch information
Bob Zhou committed Aug 25, 2023
1 parent 6a466ff commit b728ef0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,14 +860,18 @@ void dm_handle_mst_sideband_msg_ready_event(
DRM_DEBUG_DRIVER("Loop exceeded max iterations\n");
}

#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
static void dm_handle_mst_down_rep_msg_ready(struct drm_dp_mst_topology_mgr *mgr)
{
dm_handle_mst_sideband_msg_ready_event(mgr, DOWN_REP_MSG_RDY_EVENT);
}
#endif

static const struct drm_dp_mst_topology_cbs dm_mst_cbs = {
.add_connector = dm_dp_add_mst_connector,
#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
.poll_hpd_irq = dm_handle_mst_down_rep_msg_ready,
#endif
#ifdef HAVE_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR
.destroy_connector = dm_dp_destroy_mst_connector,
#endif
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/dkms/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@
/* struct drm_dp_mst_topology_cbs has hotplug member */
/* #undef HAVE_DRM_DP_MST_TOPOLOGY_CBS_HOTPLUG */

/* struct drm_dp_mst_topology_cbs->poll_hpd_irq is available */
#define HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ 1

/* struct drm_dp_mst_topology_cbs->register_connector is available */
/* #undef HAVE_DRM_DP_MST_TOPOLOGY_CBS_REGISTER_CONNECTOR */

Expand Down
23 changes: 23 additions & 0 deletions drivers/gpu/drm/amd/dkms/m4/drm-dp-mst-topology-cbs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,33 @@ AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR], [
])
])

dnl #
dnl # commit v5.7-rc1-646-g471bdd0df0d5
dnl # drm/i915/dp_mst: Work around out-of-spec adapters filtering short pulses
dnl #
AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ], [
AC_KERNEL_TRY_COMPILE([
#if defined(HAVE_DRM_DISPLAY_DRM_DP_MST_HELPER_H)
#include <drm/display/drm_dp_mst_helper.h>
#elif defined(HAVE_DRM_DP_DRM_DP_MST_HELPER_H)
#include <drm/dp/drm_dp_mst_helper.h>
#else
#include <drm/drm_dp_mst_helper.h>
#endif
], [
struct drm_dp_mst_topology_cbs *dp_mst_cbs = NULL;
dp_mst_cbs->poll_hpd_irq(NULL);
], [
AC_DEFINE(HAVE_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ, 1,
[struct drm_dp_mst_topology_cbs->poll_hpd_irq is available])
])
])

AC_DEFUN([AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS], [
AC_KERNEL_DO_BACKGROUND([
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_HOTPLUG
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_REGISTER_CONNECTOR
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_DESTROY_CONNECTOR
AC_AMDGPU_DRM_DP_MST_TOPOLOGY_CBS_POLL_HPD_IRQ
])
])

0 comments on commit b728ef0

Please sign in to comment.