LCOV - code coverage report
Current view: top level - drivers/gpu/drm/i915/gt - intel_engine_pm.h (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 18 0.0 %
Date: 2022-03-28 15:32:58 Functions: 0 1 0.0 %
Branches: 0 2 0.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * SPDX-License-Identifier: MIT
       3                 :            :  *
       4                 :            :  * Copyright © 2019 Intel Corporation
       5                 :            :  */
       6                 :            : 
       7                 :            : #ifndef INTEL_ENGINE_PM_H
       8                 :            : #define INTEL_ENGINE_PM_H
       9                 :            : 
      10                 :            : #include "i915_request.h"
      11                 :            : #include "intel_engine_types.h"
      12                 :            : #include "intel_wakeref.h"
      13                 :            : 
      14                 :            : static inline bool
      15                 :          0 : intel_engine_pm_is_awake(const struct intel_engine_cs *engine)
      16                 :            : {
      17         [ #  # ]:          0 :         return intel_wakeref_is_active(&engine->wakeref);
      18                 :            : }
      19                 :            : 
      20                 :          0 : static inline void intel_engine_pm_get(struct intel_engine_cs *engine)
      21                 :            : {
      22                 :          0 :         intel_wakeref_get(&engine->wakeref);
      23                 :          0 : }
      24                 :            : 
      25                 :          0 : static inline bool intel_engine_pm_get_if_awake(struct intel_engine_cs *engine)
      26                 :            : {
      27                 :          0 :         return intel_wakeref_get_if_active(&engine->wakeref);
      28                 :            : }
      29                 :            : 
      30                 :          0 : static inline void intel_engine_pm_put(struct intel_engine_cs *engine)
      31                 :            : {
      32                 :          0 :         intel_wakeref_put(&engine->wakeref);
      33                 :          0 : }
      34                 :            : 
      35                 :          0 : static inline void intel_engine_pm_put_async(struct intel_engine_cs *engine)
      36                 :            : {
      37                 :          0 :         intel_wakeref_put_async(&engine->wakeref);
      38                 :            : }
      39                 :            : 
      40                 :            : static inline void intel_engine_pm_flush(struct intel_engine_cs *engine)
      41                 :            : {
      42                 :            :         intel_wakeref_unlock_wait(&engine->wakeref);
      43                 :            : }
      44                 :            : 
      45                 :            : static inline struct i915_request *
      46                 :          0 : intel_engine_create_kernel_request(struct intel_engine_cs *engine)
      47                 :            : {
      48                 :          0 :         struct i915_request *rq;
      49                 :            : 
      50                 :            :         /*
      51                 :            :          * The engine->kernel_context is special as it is used inside
      52                 :            :          * the engine-pm barrier (see __engine_park()), circumventing
      53                 :            :          * the usual mutexes and relying on the engine-pm barrier
      54                 :            :          * instead. So whenever we use the engine->kernel_context
      55                 :            :          * outside of the barrier, we must manually handle the
      56                 :            :          * engine wakeref to serialise with the use inside.
      57                 :            :          */
      58                 :          0 :         intel_engine_pm_get(engine);
      59                 :          0 :         rq = i915_request_create(engine->kernel_context);
      60                 :          0 :         intel_engine_pm_put(engine);
      61                 :            : 
      62                 :          0 :         return rq;
      63                 :            : }
      64                 :            : 
      65                 :            : void intel_engine_init__pm(struct intel_engine_cs *engine);
      66                 :            : 
      67                 :            : #endif /* INTEL_ENGINE_PM_H */

Generated by: LCOV version 1.14