linux/drivers/gpu/drm/vc4/vc4_hvs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2015 Broadcom
 */

/**
 * DOC: VC4 HVS module.
 *
 * The Hardware Video Scaler (HVS) is the piece of hardware that does
 * translation, scaling, colorspace conversion, and compositing of
 * pixels stored in framebuffers into a FIFO of pixels going out to
 * the Pixel Valve (CRTC).  It operates at the system clock rate (the
 * system audio clock gate, specifically), which is much higher than
 * the pixel clock rate.
 *
 * There is a single global HVS, with multiple output FIFOs that can
 * be consumed by the PVs.  This file just manages the resources for
 * the HVS, while the vc4_crtc.c code actually drives HVS setup for
 * each CRTC.
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/platform_device.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_vblank.h>

#include <soc/bcm2835/raspberrypi-firmware.h>

#include "vc4_drv.h"
#include "vc4_regs.h"

static const struct debugfs_reg32 hvs_regs[] =;

void vc4_hvs_dump_state(struct vc4_hvs *hvs)
{}

static int vc4_hvs_debugfs_underrun(struct seq_file *m, void *data)
{}

static int vc4_hvs_debugfs_dlist(struct seq_file *m, void *data)
{}

/* The filter kernel is composed of dwords each containing 3 9-bit
 * signed integers packed next to each other.
 */
#define VC4_INT_TO_COEFF(coeff)
#define VC4_PPF_FILTER_WORD(c0, c1, c2)

/* The whole filter kernel is arranged as the coefficients 0-16 going
 * up, then a pad, then 17-31 going down and reversed within the
 * dwords.  This means that a linear phase kernel (where it's
 * symmetrical at the boundary between 15 and 16) has the last 5
 * dwords matching the first 5, but reversed.
 */
#define VC4_LINEAR_PHASE_KERNEL(c0, c1, c2, c3, c4, c5, c6, c7, c8,	\
				c9, c10, c11, c12, c13, c14, c15)

#define VC4_LINEAR_PHASE_KERNEL_DWORDS
#define VC4_KERNEL_DWORDS

/* Recommended B=1/3, C=1/3 filter choice from Mitchell/Netravali.
 * http://www.cs.utexas.edu/~fussell/courses/cs384g/lectures/mitchell/Mitchell.pdf
 */
static const u32 mitchell_netravali_1_3_1_3_kernel[] =;

static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs,
					struct drm_mm_node *space,
					const u32 *kernel)
{}

static void vc4_hvs_lut_load(struct vc4_hvs *hvs,
			     struct vc4_crtc *vc4_crtc)
{}

static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs,
				     struct vc4_crtc *vc4_crtc)
{}

u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo)
{}

int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output)
{}

static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
				struct drm_display_mode *mode, bool oneshot)
{}

void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan)
{}

int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
{}

static void vc4_hvs_install_dlist(struct drm_crtc *crtc)
{}

static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
{}

void vc4_hvs_atomic_begin(struct drm_crtc *crtc,
			  struct drm_atomic_state *state)
{}

void vc4_hvs_atomic_enable(struct drm_crtc *crtc,
			   struct drm_atomic_state *state)
{}

void vc4_hvs_atomic_disable(struct drm_crtc *crtc,
			    struct drm_atomic_state *state)
{}

void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
			  struct drm_atomic_state *state)
{}

void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel)
{}

void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel)
{}

static void vc4_hvs_report_underrun(struct drm_device *dev)
{}

static irqreturn_t vc4_hvs_irq_handler(int irq, void *data)
{}

int vc4_hvs_debugfs_init(struct drm_minor *minor)
{}

struct vc4_hvs *__vc4_hvs_alloc(struct vc4_dev *vc4, struct platform_device *pdev)
{}

static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
{}

static void vc4_hvs_unbind(struct device *dev, struct device *master,
			   void *data)
{}

static const struct component_ops vc4_hvs_ops =;

static int vc4_hvs_dev_probe(struct platform_device *pdev)
{}

static void vc4_hvs_dev_remove(struct platform_device *pdev)
{}

static const struct of_device_id vc4_hvs_dt_match[] =;

struct platform_driver vc4_hvs_driver =;