-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915/pxp: Enable PXP power management
During the power event S3+ sleep/resume, hardware will lose all the encryption keys for every hardware session, even though the session state might still be marked as alive after resume. Therefore, we should consider the session as dead on suspend and invalidate all the objects. The session will be automatically restarted on the first protected submission on resume. v2: runtime suspend also invalidates the keys v3: fix return codes, simplify rpm ops (Chris), use the new worker func v4: invalidate the objects on suspend, don't re-create the arb sesson on resume (delayed to first submission). v5: move irq changes back to irq patch (Rodrigo) v6: drop invalidation in runtime suspend (Rodrigo) Signed-off-by: Huang, Sean Z <sean.z.huang@intel.com> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210924191452.1539378-13-alan.previn.teres.alexis@intel.com
- Loading branch information
Huang, Sean Z
authored and
Rodrigo Vivi
committed
Oct 4, 2021
1 parent
32271ec
commit 0cfab4c
Showing
8 changed files
with
126 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
/* | ||
* Copyright(c) 2020 Intel Corporation. | ||
*/ | ||
|
||
#include "intel_pxp.h" | ||
#include "intel_pxp_irq.h" | ||
#include "intel_pxp_pm.h" | ||
#include "intel_pxp_session.h" | ||
|
||
void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime) | ||
{ | ||
if (!intel_pxp_is_enabled(pxp)) | ||
return; | ||
|
||
pxp->arb_is_valid = false; | ||
|
||
/* | ||
* Contexts using protected objects keep a runtime PM reference, so we | ||
* can only runtime suspend when all of them have been either closed | ||
* or banned. Therefore, there is no need to invalidate in that | ||
* scenario. | ||
*/ | ||
if (!runtime) | ||
intel_pxp_invalidate(pxp); | ||
|
||
intel_pxp_fini_hw(pxp); | ||
|
||
pxp->hw_state_invalidated = false; | ||
} | ||
|
||
void intel_pxp_resume(struct intel_pxp *pxp) | ||
{ | ||
if (!intel_pxp_is_enabled(pxp)) | ||
return; | ||
|
||
/* | ||
* The PXP component gets automatically unbound when we go into S3 and | ||
* re-bound after we come out, so in that scenario we can defer the | ||
* hw init to the bind call. | ||
*/ | ||
if (!pxp->pxp_component) | ||
return; | ||
|
||
intel_pxp_init_hw(pxp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright(c) 2020, Intel Corporation. All rights reserved. | ||
*/ | ||
|
||
#ifndef __INTEL_PXP_PM_H__ | ||
#define __INTEL_PXP_PM_H__ | ||
|
||
#include "intel_pxp_types.h" | ||
|
||
#ifdef CONFIG_DRM_I915_PXP | ||
void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime); | ||
void intel_pxp_resume(struct intel_pxp *pxp); | ||
#else | ||
static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime) | ||
{ | ||
} | ||
|
||
static inline void intel_pxp_resume(struct intel_pxp *pxp) | ||
{ | ||
} | ||
#endif | ||
|
||
#endif /* __INTEL_PXP_PM_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters