linux/drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef __NVKM_PM_PRIV_H__
   3#define __NVKM_PM_PRIV_H__
   4#define nvkm_pm(p) container_of((p), struct nvkm_pm, engine)
   5#include <engine/pm.h>
   6
   7int nvkm_pm_ctor(const struct nvkm_pm_func *, struct nvkm_device *,
   8                 int index, struct nvkm_pm *);
   9
  10struct nvkm_pm_func {
  11        void (*fini)(struct nvkm_pm *);
  12};
  13
  14struct nvkm_perfctr {
  15        struct list_head head;
  16        u8 domain;
  17        u8  signal[4];
  18        u64 source[4][8];
  19        int slot;
  20        u32 logic_op;
  21        u32 ctr;
  22};
  23
  24struct nvkm_specmux {
  25        u32 mask;
  26        u8 shift;
  27        const char *name;
  28        bool enable;
  29};
  30
  31struct nvkm_specsrc {
  32        u32 addr;
  33        const struct nvkm_specmux *mux;
  34        const char *name;
  35};
  36
  37struct nvkm_perfsrc {
  38        struct list_head head;
  39        char *name;
  40        u32 addr;
  41        u32 mask;
  42        u8 shift;
  43        bool enable;
  44};
  45
  46extern const struct nvkm_specsrc nv50_zcull_sources[];
  47extern const struct nvkm_specsrc nv50_zrop_sources[];
  48extern const struct nvkm_specsrc g84_vfetch_sources[];
  49extern const struct nvkm_specsrc gt200_crop_sources[];
  50extern const struct nvkm_specsrc gt200_prop_sources[];
  51extern const struct nvkm_specsrc gt200_tex_sources[];
  52
  53struct nvkm_specsig {
  54        u8 signal;
  55        const char *name;
  56        const struct nvkm_specsrc *source;
  57};
  58
  59struct nvkm_perfsig {
  60        const char *name;
  61        u8 source[8];
  62};
  63
  64struct nvkm_specdom {
  65        u16 signal_nr;
  66        const struct nvkm_specsig *signal;
  67        const struct nvkm_funcdom *func;
  68};
  69
  70#define nvkm_perfdom(p) container_of((p), struct nvkm_perfdom, object)
  71#include <core/object.h>
  72
  73struct nvkm_perfdom {
  74        struct nvkm_object object;
  75        struct nvkm_perfmon *perfmon;
  76        struct list_head head;
  77        struct list_head list;
  78        const struct nvkm_funcdom *func;
  79        struct nvkm_perfctr *ctr[4];
  80        char name[32];
  81        u32 addr;
  82        u8  mode;
  83        u32 clk;
  84        u16 signal_nr;
  85        struct nvkm_perfsig signal[];
  86};
  87
  88struct nvkm_funcdom {
  89        void (*init)(struct nvkm_pm *, struct nvkm_perfdom *,
  90                     struct nvkm_perfctr *);
  91        void (*read)(struct nvkm_pm *, struct nvkm_perfdom *,
  92                     struct nvkm_perfctr *);
  93        void (*next)(struct nvkm_pm *, struct nvkm_perfdom *);
  94};
  95
  96int nvkm_perfdom_new(struct nvkm_pm *, const char *, u32, u32, u32, u32,
  97                     const struct nvkm_specdom *);
  98
  99#define nvkm_perfmon(p) container_of((p), struct nvkm_perfmon, object)
 100
 101struct nvkm_perfmon {
 102        struct nvkm_object object;
 103        struct nvkm_pm *pm;
 104};
 105#endif
 106