Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: MIT
0002 /*
0003  * Copyright(c) 2020 Intel Corporation.
0004  */
0005 
0006 #include "intel_pxp.h"
0007 #include "intel_pxp_irq.h"
0008 #include "intel_pxp_pm.h"
0009 #include "intel_pxp_session.h"
0010 #include "i915_drv.h"
0011 
0012 void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
0013 {
0014     if (!intel_pxp_is_enabled(pxp))
0015         return;
0016 
0017     pxp->arb_is_valid = false;
0018 
0019     intel_pxp_invalidate(pxp);
0020 }
0021 
0022 void intel_pxp_suspend(struct intel_pxp *pxp)
0023 {
0024     intel_wakeref_t wakeref;
0025 
0026     if (!intel_pxp_is_enabled(pxp))
0027         return;
0028 
0029     with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
0030         intel_pxp_fini_hw(pxp);
0031         pxp->hw_state_invalidated = false;
0032     }
0033 }
0034 
0035 void intel_pxp_resume(struct intel_pxp *pxp)
0036 {
0037     if (!intel_pxp_is_enabled(pxp))
0038         return;
0039 
0040     /*
0041      * The PXP component gets automatically unbound when we go into S3 and
0042      * re-bound after we come out, so in that scenario we can defer the
0043      * hw init to the bind call.
0044      */
0045     if (!pxp->pxp_component)
0046         return;
0047 
0048     intel_pxp_init_hw(pxp);
0049 }
0050 
0051 void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
0052 {
0053     if (!intel_pxp_is_enabled(pxp))
0054         return;
0055 
0056     pxp->arb_is_valid = false;
0057 
0058     intel_pxp_fini_hw(pxp);
0059 
0060     pxp->hw_state_invalidated = false;
0061 }