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

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright © 2018 Broadcom
 *
 * Authors:
 *	Eric Anholt <[email protected]>
 *	Boris Brezillon <[email protected]>
 */

#include <linux/clk.h>
#include <linux/component.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_fb_dma_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>
#include <drm/drm_writeback.h>

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

/* Base address of the output.  Raster formats must be 4-byte aligned,
 * T and LT must be 16-byte aligned or maybe utile-aligned (docs are
 * inconsistent, but probably utile).
 */
#define TXP_DST_PTR

/* Pitch in bytes for raster images, 16-byte aligned.  For tiled, it's
 * the width in tiles.
 */
#define TXP_DST_PITCH
/* For T-tiled imgaes, DST_PITCH should be the number of tiles wide,
 * shifted up.
 */
#define TXP_T_TILE_WIDTH_SHIFT
/* For LT-tiled images, DST_PITCH should be the number of utiles wide,
 * shifted up.
 */
#define TXP_LT_TILE_WIDTH_SHIFT

/* Pre-rotation width/height of the image.  Must match HVS config.
 *
 * If TFORMAT and 32-bit, limit is 1920 for 32-bit and 3840 to 16-bit
 * and width/height must be tile or utile-aligned as appropriate.  If
 * transposing (rotating), width is limited to 1920.
 *
 * Height is limited to various numbers between 4088 and 4095.  I'd
 * just use 4088 to be safe.
 */
#define TXP_DIM
#define TXP_HEIGHT_SHIFT
#define TXP_HEIGHT_MASK
#define TXP_WIDTH_SHIFT
#define TXP_WIDTH_MASK

#define TXP_DST_CTRL
/* These bits are set to 0x54 */
#define TXP_PILOT_SHIFT
#define TXP_PILOT_MASK
/* Bits 22-23 are set to 0x01 */
#define TXP_VERSION_SHIFT
#define TXP_VERSION_MASK

/* Powers down the internal memory. */
#define TXP_POWERDOWN

/* Enables storing the alpha component in 8888/4444, instead of
 * filling with ~ALPHA_INVERT.
 */
#define TXP_ALPHA_ENABLE

/* 4 bits, each enables stores for a channel in each set of 4 bytes.
 * Set to 0xf for normal operation.
 */
#define TXP_BYTE_ENABLE_SHIFT
#define TXP_BYTE_ENABLE_MASK

/* Debug: Generate VSTART again at EOF. */
#define TXP_VSTART_AT_EOF

/* Debug: Terminate the current frame immediately.  Stops AXI
 * writes.
 */
#define TXP_ABORT

#define TXP_DITHER

/* Inverts alpha if TXP_ALPHA_ENABLE, chooses fill value for
 * !TXP_ALPHA_ENABLE.
 */
#define TXP_ALPHA_INVERT

/* Note: I've listed the channels here in high bit (in byte 3/2/1) to
 * low bit (in byte 0) order.
 */
#define TXP_FORMAT_SHIFT
#define TXP_FORMAT_MASK
#define TXP_FORMAT_ABGR4444
#define TXP_FORMAT_ARGB4444
#define TXP_FORMAT_BGRA4444
#define TXP_FORMAT_RGBA4444
#define TXP_FORMAT_BGR565
#define TXP_FORMAT_RGB565
/* 888s are non-rotated, raster-only */
#define TXP_FORMAT_BGR888
#define TXP_FORMAT_RGB888
#define TXP_FORMAT_ABGR8888
#define TXP_FORMAT_ARGB8888
#define TXP_FORMAT_BGRA8888
#define TXP_FORMAT_RGBA8888

/* If TFORMAT is set, generates LT instead of T format. */
#define TXP_LINEAR_UTILE

/* Rotate output by 90 degrees. */
#define TXP_TRANSPOSE

/* Generate a tiled format for V3D. */
#define TXP_TFORMAT

/* Generates some undefined test mode output. */
#define TXP_TEST_MODE

/* Request odd field from HVS. */
#define TXP_FIELD

/* Raise interrupt when idle. */
#define TXP_EI

/* Set when generating a frame, clears when idle. */
#define TXP_BUSY

/* Starts a frame.  Self-clearing. */
#define TXP_GO

/* Number of lines received and committed to memory. */
#define TXP_PROGRESS

#define TXP_READ(offset)

#define TXP_WRITE(offset, val)

struct vc4_txp {};

#define encoder_to_vc4_txp(_encoder)

#define connector_to_vc4_txp(_connector)

static const struct debugfs_reg32 txp_regs[] =;

static int vc4_txp_connector_get_modes(struct drm_connector *connector)
{}

static enum drm_mode_status
vc4_txp_connector_mode_valid(struct drm_connector *connector,
			     struct drm_display_mode *mode)
{}

static const u32 drm_fmts[] =;

static const u32 txp_fmts[] =;

static void vc4_txp_armed(struct drm_crtc_state *state)
{}

static int vc4_txp_connector_atomic_check(struct drm_connector *conn,
					  struct drm_atomic_state *state)
{}

static void vc4_txp_connector_atomic_commit(struct drm_connector *conn,
					struct drm_atomic_state *state)
{}

static const struct drm_connector_helper_funcs vc4_txp_connector_helper_funcs =;

static enum drm_connector_status
vc4_txp_connector_detect(struct drm_connector *connector, bool force)
{}

static const struct drm_connector_funcs vc4_txp_connector_funcs =;

static void vc4_txp_encoder_disable(struct drm_encoder *encoder)
{}

static const struct drm_encoder_helper_funcs vc4_txp_encoder_helper_funcs =;

static int vc4_txp_enable_vblank(struct drm_crtc *crtc)
{}

static void vc4_txp_disable_vblank(struct drm_crtc *crtc) {}

static const struct drm_crtc_funcs vc4_txp_crtc_funcs =;

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

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

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

static const struct drm_crtc_helper_funcs vc4_txp_crtc_helper_funcs =;

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

const struct vc4_crtc_data vc4_txp_crtc_data =;

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

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

static const struct component_ops vc4_txp_ops =;

static int vc4_txp_probe(struct platform_device *pdev)
{}

static void vc4_txp_remove(struct platform_device *pdev)
{}

static const struct of_device_id vc4_txp_dt_match[] =;

struct platform_driver vc4_txp_driver =;