linux/drivers/gpu/drm/i915/i915_irq.c

/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
 */
/*
 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#define pr_fmt(fmt)

#include <linux/slab.h>
#include <linux/sysrq.h>

#include <drm/drm_drv.h>

#include "display/intel_display_irq.h"
#include "display/intel_hotplug.h"
#include "display/intel_hotplug_irq.h"
#include "display/intel_lpe_audio.h"
#include "display/intel_psr_regs.h"

#include "gt/intel_breadcrumbs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_irq.h"
#include "gt/intel_gt_pm_irq.h"
#include "gt/intel_gt_regs.h"
#include "gt/intel_rps.h"

#include "i915_driver.h"
#include "i915_drv.h"
#include "i915_irq.h"
#include "i915_reg.h"

/**
 * DOC: interrupt handling
 *
 * These functions provide the basic support for enabling and disabling the
 * interrupt handling support. There's a lot more functionality in i915_irq.c
 * and related files, but that will be described in separate chapters.
 */

/*
 * Interrupt statistic for PMU. Increments the counter only if the
 * interrupt originated from the GPU so interrupts from a device which
 * shares the interrupt line are not accounted.
 */
static inline void pmu_irq_stats(struct drm_i915_private *i915,
				 irqreturn_t res)
{}

void gen3_irq_reset(struct intel_uncore *uncore, i915_reg_t imr,
		    i915_reg_t iir, i915_reg_t ier)
{}

static void gen2_irq_reset(struct intel_uncore *uncore)
{}

/*
 * We should clear IMR at preinstall/uninstall, and just check at postinstall.
 */
void gen3_assert_iir_is_zero(struct intel_uncore *uncore, i915_reg_t reg)
{}

static void gen2_assert_iir_is_zero(struct intel_uncore *uncore)
{}

void gen3_irq_init(struct intel_uncore *uncore,
		   i915_reg_t imr, u32 imr_val,
		   i915_reg_t ier, u32 ier_val,
		   i915_reg_t iir)
{}

static void gen2_irq_init(struct intel_uncore *uncore,
			  u32 imr_val, u32 ier_val)
{}

/**
 * ivb_parity_work - Workqueue called when a parity error interrupt
 * occurred.
 * @work: workqueue struct
 *
 * Doesn't actually do anything except notify userspace. As a consequence of
 * this event, userspace should try to remap the bad rows since statistically
 * it is likely the same row is more likely to go bad again.
 */
static void ivb_parity_work(struct work_struct *work)
{}

static irqreturn_t valleyview_irq_handler(int irq, void *arg)
{}

static irqreturn_t cherryview_irq_handler(int irq, void *arg)
{}

/*
 * To handle irqs with the minimum potential races with fresh interrupts, we:
 * 1 - Disable Master Interrupt Control.
 * 2 - Find the source(s) of the interrupt.
 * 3 - Clear the Interrupt Identity bits (IIR).
 * 4 - Process the interrupt(s) that had bits set in the IIRs.
 * 5 - Re-enable Master Interrupt Control.
 */
static irqreturn_t ilk_irq_handler(int irq, void *arg)
{}

static inline u32 gen8_master_intr_disable(void __iomem * const regs)
{}

static inline void gen8_master_intr_enable(void __iomem * const regs)
{}

static irqreturn_t gen8_irq_handler(int irq, void *arg)
{}

static inline u32 gen11_master_intr_disable(void __iomem * const regs)
{}

static inline void gen11_master_intr_enable(void __iomem * const regs)
{}

static irqreturn_t gen11_irq_handler(int irq, void *arg)
{}

static inline u32 dg1_master_intr_disable(void __iomem * const regs)
{}

static inline void dg1_master_intr_enable(void __iomem * const regs)
{}

static irqreturn_t dg1_irq_handler(int irq, void *arg)
{}

static void ibx_irq_reset(struct drm_i915_private *dev_priv)
{}

/* drm_dma.h hooks
*/
static void ilk_irq_reset(struct drm_i915_private *dev_priv)
{}

static void valleyview_irq_reset(struct drm_i915_private *dev_priv)
{}

static void gen8_irq_reset(struct drm_i915_private *dev_priv)
{}

static void gen11_irq_reset(struct drm_i915_private *dev_priv)
{}

static void dg1_irq_reset(struct drm_i915_private *dev_priv)
{}

static void cherryview_irq_reset(struct drm_i915_private *dev_priv)
{}

static void ilk_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void valleyview_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void gen8_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void gen11_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void dg1_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void cherryview_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void i8xx_irq_reset(struct drm_i915_private *dev_priv)
{}

static u32 i9xx_error_mask(struct drm_i915_private *i915)
{}

static void i8xx_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static void i8xx_error_irq_ack(struct drm_i915_private *i915,
			       u16 *eir, u16 *eir_stuck)
{}

static void i8xx_error_irq_handler(struct drm_i915_private *dev_priv,
				   u16 eir, u16 eir_stuck)
{}

static void i9xx_error_irq_ack(struct drm_i915_private *dev_priv,
			       u32 *eir, u32 *eir_stuck)
{}

static void i9xx_error_irq_handler(struct drm_i915_private *dev_priv,
				   u32 eir, u32 eir_stuck)
{}

static irqreturn_t i8xx_irq_handler(int irq, void *arg)
{}

static void i915_irq_reset(struct drm_i915_private *dev_priv)
{}

static void i915_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static irqreturn_t i915_irq_handler(int irq, void *arg)
{}

static void i965_irq_reset(struct drm_i915_private *dev_priv)
{}

static u32 i965_error_mask(struct drm_i915_private *i915)
{}

static void i965_irq_postinstall(struct drm_i915_private *dev_priv)
{}

static irqreturn_t i965_irq_handler(int irq, void *arg)
{}

/**
 * intel_irq_init - initializes irq support
 * @dev_priv: i915 device instance
 *
 * This function initializes all the irq support including work items, timers
 * and all the vtables. It does not setup the interrupt itself though.
 */
void intel_irq_init(struct drm_i915_private *dev_priv)
{}

/**
 * intel_irq_fini - deinitializes IRQ support
 * @i915: i915 device instance
 *
 * This function deinitializes all the IRQ support.
 */
void intel_irq_fini(struct drm_i915_private *i915)
{}

static irq_handler_t intel_irq_handler(struct drm_i915_private *dev_priv)
{}

static void intel_irq_reset(struct drm_i915_private *dev_priv)
{}

static void intel_irq_postinstall(struct drm_i915_private *dev_priv)
{}

/**
 * intel_irq_install - enables the hardware interrupt
 * @dev_priv: i915 device instance
 *
 * This function enables the hardware interrupt handling, but leaves the hotplug
 * handling still disabled. It is called after intel_irq_init().
 *
 * In the driver load and resume code we need working interrupts in a few places
 * but don't want to deal with the hassle of concurrent probe and hotplug
 * workers. Hence the split into this two-stage approach.
 */
int intel_irq_install(struct drm_i915_private *dev_priv)
{}

/**
 * intel_irq_uninstall - finilizes all irq handling
 * @dev_priv: i915 device instance
 *
 * This stops interrupt and hotplug handling and unregisters and frees all
 * resources acquired in the init functions.
 */
void intel_irq_uninstall(struct drm_i915_private *dev_priv)
{}

/**
 * intel_runtime_pm_disable_interrupts - runtime interrupt disabling
 * @dev_priv: i915 device instance
 *
 * This function is used to disable interrupts at runtime, both in the runtime
 * pm and the system suspend/resume code.
 */
void intel_runtime_pm_disable_interrupts(struct drm_i915_private *dev_priv)
{}

/**
 * intel_runtime_pm_enable_interrupts - runtime interrupt enabling
 * @dev_priv: i915 device instance
 *
 * This function is used to enable interrupts at runtime, both in the runtime
 * pm and the system suspend/resume code.
 */
void intel_runtime_pm_enable_interrupts(struct drm_i915_private *dev_priv)
{}

bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
{}

void intel_synchronize_irq(struct drm_i915_private *i915)
{}

void intel_synchronize_hardirq(struct drm_i915_private *i915)
{}