From 1a73392aa4381be33f87469e6d613b04e504b72b Mon Sep 17 00:00:00 2001 From: Moeta Yuko Date: Fri, 13 Dec 2024 11:39:10 +0800 Subject: [PATCH] drm/i915: fix build for 6.8.12-5-pve and newer Fixes #34 --- backport-include/backport/backport_macro.h | 12 +++++++++++- drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/backport-include/backport/backport_macro.h b/backport-include/backport/backport_macro.h index a8688226..a938686b 100644 --- a/backport-include/backport/backport_macro.h +++ b/backport-include/backport/backport_macro.h @@ -1284,7 +1284,8 @@ */ #define BPM_DGLUT_24BIT_MTL_NOT_SUPPORTED -#if LINUX_VERSION_IN_RANGE(6,8,12, 6,8,99) && PVE_RELEASE_VERSION_IS_GEQ(1) +#if LINUX_VERSION_IN_RANGE(6,8,12, 6,8,99) +#if PVE_RELEASE_VERSION_IS_GEQ(1) /* * 5a507b7d2be15f * drm/mst: Fix NULL pointer dereference at drm_dp_add_payload_part2 @@ -1292,6 +1293,15 @@ #define BPM_DRM_DP_ADD_PAYLOAD_PART2_STATE_ARG_NOT_PRESENT #endif +#if PVE_RELEASE_VERSION_IS_GEQ(5) +/* + * c0ef3df8dbaef5 + * PM: runtime: Simplify pm_runtime_get_if_active() usage + */ +#define BPM_PM_RUNTIME_GET_IF_ACTIVE_IGN_USAGE_COUNT_ARG_NOT_PRESENT +#endif +#endif + #if LINUX_VERSION_IS_LESS(6,8,0) && \ !(LINUX_VERSION_IN_RANGE(6,5,13, 6,5,99) && PVE_RELEASE_VERSION_IS_GEQ(4)) /* diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index bc779ef5..9d06fd6d 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -434,8 +434,16 @@ static intel_wakeref_t __intel_runtime_pm_get_if_active(struct intel_runtime_pm * function, since the power state is undefined. This applies * atm to the late/early system suspend/resume handlers. */ +#ifdef BPM_PM_RUNTIME_GET_IF_ACTIVE_IGN_USAGE_COUNT_ARG_NOT_PRESENT + if ((ignore_usecount && + pm_runtime_get_if_active(rpm->kdev) <= 0) || + (!ignore_usecount && + pm_runtime_get_if_in_use(rpm->kdev) <= 0)) + return 0; +#else if (pm_runtime_get_if_active(rpm->kdev, ignore_usecount) <= 0) return 0; +#endif } intel_runtime_pm_acquire(rpm, true);