cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

intel_rps.h (3756B)


      1/* SPDX-License-Identifier: MIT */
      2/*
      3 * Copyright © 2019 Intel Corporation
      4 */
      5
      6#ifndef INTEL_RPS_H
      7#define INTEL_RPS_H
      8
      9#include "intel_rps_types.h"
     10#include "i915_reg_defs.h"
     11
     12struct i915_request;
     13
     14void intel_rps_init_early(struct intel_rps *rps);
     15void intel_rps_init(struct intel_rps *rps);
     16void intel_rps_sanitize(struct intel_rps *rps);
     17
     18void intel_rps_driver_register(struct intel_rps *rps);
     19void intel_rps_driver_unregister(struct intel_rps *rps);
     20
     21void intel_rps_enable(struct intel_rps *rps);
     22void intel_rps_disable(struct intel_rps *rps);
     23
     24void intel_rps_park(struct intel_rps *rps);
     25void intel_rps_unpark(struct intel_rps *rps);
     26void intel_rps_boost(struct i915_request *rq);
     27void intel_rps_dec_waiters(struct intel_rps *rps);
     28u32 intel_rps_get_boost_frequency(struct intel_rps *rps);
     29int intel_rps_set_boost_frequency(struct intel_rps *rps, u32 freq);
     30
     31int intel_rps_set(struct intel_rps *rps, u8 val);
     32void intel_rps_mark_interactive(struct intel_rps *rps, bool interactive);
     33
     34int intel_gpu_freq(struct intel_rps *rps, int val);
     35int intel_freq_opcode(struct intel_rps *rps, int val);
     36u32 intel_rps_get_cagf(struct intel_rps *rps, u32 rpstat1);
     37u32 intel_rps_read_actual_frequency(struct intel_rps *rps);
     38u32 intel_rps_get_requested_frequency(struct intel_rps *rps);
     39u32 intel_rps_get_min_frequency(struct intel_rps *rps);
     40int intel_rps_set_min_frequency(struct intel_rps *rps, u32 val);
     41u32 intel_rps_get_max_frequency(struct intel_rps *rps);
     42int intel_rps_set_max_frequency(struct intel_rps *rps, u32 val);
     43u32 intel_rps_get_rp0_frequency(struct intel_rps *rps);
     44u32 intel_rps_get_rp1_frequency(struct intel_rps *rps);
     45u32 intel_rps_get_rpn_frequency(struct intel_rps *rps);
     46u32 intel_rps_read_punit_req(struct intel_rps *rps);
     47u32 intel_rps_read_punit_req_frequency(struct intel_rps *rps);
     48void gen6_rps_get_freq_caps(struct intel_rps *rps, struct intel_rps_freq_caps *caps);
     49void intel_rps_raise_unslice(struct intel_rps *rps);
     50void intel_rps_lower_unslice(struct intel_rps *rps);
     51
     52u32 intel_rps_read_throttle_reason(struct intel_rps *rps);
     53bool rps_read_mask_mmio(struct intel_rps *rps, i915_reg_t reg32, u32 mask);
     54
     55void gen5_rps_irq_handler(struct intel_rps *rps);
     56void gen6_rps_irq_handler(struct intel_rps *rps, u32 pm_iir);
     57void gen11_rps_irq_handler(struct intel_rps *rps, u32 pm_iir);
     58
     59static inline bool intel_rps_is_enabled(const struct intel_rps *rps)
     60{
     61	return test_bit(INTEL_RPS_ENABLED, &rps->flags);
     62}
     63
     64static inline void intel_rps_set_enabled(struct intel_rps *rps)
     65{
     66	set_bit(INTEL_RPS_ENABLED, &rps->flags);
     67}
     68
     69static inline void intel_rps_clear_enabled(struct intel_rps *rps)
     70{
     71	clear_bit(INTEL_RPS_ENABLED, &rps->flags);
     72}
     73
     74static inline bool intel_rps_is_active(const struct intel_rps *rps)
     75{
     76	return test_bit(INTEL_RPS_ACTIVE, &rps->flags);
     77}
     78
     79static inline void intel_rps_set_active(struct intel_rps *rps)
     80{
     81	set_bit(INTEL_RPS_ACTIVE, &rps->flags);
     82}
     83
     84static inline bool intel_rps_clear_active(struct intel_rps *rps)
     85{
     86	return test_and_clear_bit(INTEL_RPS_ACTIVE, &rps->flags);
     87}
     88
     89static inline bool intel_rps_has_interrupts(const struct intel_rps *rps)
     90{
     91	return test_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
     92}
     93
     94static inline void intel_rps_set_interrupts(struct intel_rps *rps)
     95{
     96	set_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
     97}
     98
     99static inline void intel_rps_clear_interrupts(struct intel_rps *rps)
    100{
    101	clear_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
    102}
    103
    104static inline bool intel_rps_uses_timer(const struct intel_rps *rps)
    105{
    106	return test_bit(INTEL_RPS_TIMER, &rps->flags);
    107}
    108
    109static inline void intel_rps_set_timer(struct intel_rps *rps)
    110{
    111	set_bit(INTEL_RPS_TIMER, &rps->flags);
    112}
    113
    114static inline void intel_rps_clear_timer(struct intel_rps *rps)
    115{
    116	clear_bit(INTEL_RPS_TIMER, &rps->flags);
    117}
    118
    119#endif /* INTEL_RPS_H */