linux/drivers/gpu/drm/xe/xe_gt_throttle.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2023 Intel Corporation
 */

#include <drm/drm_managed.h>

#include <regs/xe_gt_regs.h>
#include "xe_device.h"
#include "xe_gt.h"
#include "xe_gt_sysfs.h"
#include "xe_gt_throttle.h"
#include "xe_mmio.h"
#include "xe_pm.h"

/**
 * DOC: Xe GT Throttle
 *
 * Provides sysfs entries and other helpers for frequency throttle reasons in GT
 *
 * device/gt#/freq0/throttle/status - Overall status
 * device/gt#/freq0/throttle/reason_pl1 - Frequency throttle due to PL1
 * device/gt#/freq0/throttle/reason_pl2 - Frequency throttle due to PL2
 * device/gt#/freq0/throttle/reason_pl4 - Frequency throttle due to PL4, Iccmax etc.
 * device/gt#/freq0/throttle/reason_thermal - Frequency throttle due to thermal
 * device/gt#/freq0/throttle/reason_prochot - Frequency throttle due to prochot
 * device/gt#/freq0/throttle/reason_ratl - Frequency throttle due to RATL
 * device/gt#/freq0/throttle/reason_vr_thermalert - Frequency throttle due to VR THERMALERT
 * device/gt#/freq0/throttle/reason_vr_tdc -  Frequency throttle due to VR TDC
 */

static struct xe_gt *
dev_to_gt(struct device *dev)
{}

u32 xe_gt_throttle_get_limit_reasons(struct xe_gt *gt)
{}

static u32 read_status(struct xe_gt *gt)
{}

static u32 read_reason_pl1(struct xe_gt *gt)
{}

static u32 read_reason_pl2(struct xe_gt *gt)
{}

static u32 read_reason_pl4(struct xe_gt *gt)
{}

static u32 read_reason_thermal(struct xe_gt *gt)
{}

static u32 read_reason_prochot(struct xe_gt *gt)
{}

static u32 read_reason_ratl(struct xe_gt *gt)
{}

static u32 read_reason_vr_thermalert(struct xe_gt *gt)
{}

static u32 read_reason_vr_tdc(struct xe_gt *gt)
{}

static ssize_t status_show(struct device *dev,
			   struct device_attribute *attr,
			   char *buff)
{}
static DEVICE_ATTR_RO(status);

static ssize_t reason_pl1_show(struct device *dev,
			       struct device_attribute *attr,
			       char *buff)
{}
static DEVICE_ATTR_RO(reason_pl1);

static ssize_t reason_pl2_show(struct device *dev,
			       struct device_attribute *attr,
			       char *buff)
{}
static DEVICE_ATTR_RO(reason_pl2);

static ssize_t reason_pl4_show(struct device *dev,
			       struct device_attribute *attr,
			       char *buff)
{}
static DEVICE_ATTR_RO(reason_pl4);

static ssize_t reason_thermal_show(struct device *dev,
				   struct device_attribute *attr,
				   char *buff)
{}
static DEVICE_ATTR_RO(reason_thermal);

static ssize_t reason_prochot_show(struct device *dev,
				   struct device_attribute *attr,
				   char *buff)
{}
static DEVICE_ATTR_RO(reason_prochot);

static ssize_t reason_ratl_show(struct device *dev,
				struct device_attribute *attr,
				char *buff)
{}
static DEVICE_ATTR_RO(reason_ratl);

static ssize_t reason_vr_thermalert_show(struct device *dev,
					 struct device_attribute *attr,
					 char *buff)
{}
static DEVICE_ATTR_RO(reason_vr_thermalert);

static ssize_t reason_vr_tdc_show(struct device *dev,
				  struct device_attribute *attr,
				  char *buff)
{}
static DEVICE_ATTR_RO(reason_vr_tdc);

static struct attribute *throttle_attrs[] =;

static const struct attribute_group throttle_group_attrs =;

static void gt_throttle_sysfs_fini(void *arg)
{}

int xe_gt_throttle_init(struct xe_gt *gt)
{}