/* * Copyright © 2014 Broadcom * * 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, sublicense, * 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 NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS 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. */ /** * DOC: Interrupt management for the V3D engine * * We have an interrupt status register (V3D_INTCTL) which reports * interrupts, and where writing 1 bits clears those interrupts. * There are also a pair of interrupt registers * (V3D_INTENA/V3D_INTDIS) where writing a 1 to their bits enables or * disables that specific interrupt, and 0s written are ignored * (reading either one returns the set of enabled interrupts). * * When we take a binning flush done interrupt, we need to submit the * next frame for binning and move the finished frame to the render * thread. * * When we take a render frame interrupt, we need to wake the * processes waiting for some frame to be done, and get the next frame * submitted ASAP (so the hardware doesn't sit idle when there's work * to do). * * When we take the binner out of memory interrupt, we need to * allocate some new memory and pass it to the binner so that the * current job can make progress. */ #include <linux/platform_device.h> #include <drm/drm_drv.h> #include "vc4_drv.h" #include "vc4_regs.h" #include "vc4_trace.h" #define V3D_DRIVER_IRQS … static void vc4_overflow_mem_work(struct work_struct *work) { … } static void vc4_irq_finish_bin_job(struct drm_device *dev) { … } static void vc4_cancel_bin_job(struct drm_device *dev) { … } static void vc4_irq_finish_render_job(struct drm_device *dev) { … } static irqreturn_t vc4_irq(int irq, void *arg) { … } static void vc4_irq_prepare(struct drm_device *dev) { … } void vc4_irq_enable(struct drm_device *dev) { … } void vc4_irq_disable(struct drm_device *dev) { … } int vc4_irq_install(struct drm_device *dev, int irq) { … } void vc4_irq_uninstall(struct drm_device *dev) { … } /** Reinitializes interrupt registers when a GPU reset is performed. */ void vc4_irq_reset(struct drm_device *dev) { … }