linux/drivers/gpu/drm/sti/sti_gdp.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) STMicroelectronics SA 2014
 * Authors: Benjamin Gaignard <[email protected]>
 *          Fabien Dessenne <[email protected]>
 *          for STMicroelectronics.
 */

#include <linux/dma-mapping.h>
#include <linux/of.h>
#include <linux/seq_file.h>

#include <drm/drm_atomic.h>
#include <drm/drm_device.h>
#include <drm/drm_fb_dma_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_dma_helper.h>

#include "sti_compositor.h"
#include "sti_gdp.h"
#include "sti_plane.h"
#include "sti_vtg.h"

#define ALPHASWITCH
#define ENA_COLOR_FILL
#define BIGNOTLITTLE
#define WAIT_NEXT_VSYNC

/* GDP color formats */
#define GDP_RGB565
#define GDP_RGB888
#define GDP_RGB888_32
#define GDP_XBGR8888
#define GDP_ARGB8565
#define GDP_ARGB8888
#define GDP_ABGR8888
#define GDP_ARGB1555
#define GDP_ARGB4444

#define GDP2STR(fmt)

static struct gdp_format_to_str {} gdp_format_to_str[] =;

#define GAM_GDP_CTL_OFFSET
#define GAM_GDP_AGC_OFFSET
#define GAM_GDP_VPO_OFFSET
#define GAM_GDP_VPS_OFFSET
#define GAM_GDP_PML_OFFSET
#define GAM_GDP_PMP_OFFSET
#define GAM_GDP_SIZE_OFFSET
#define GAM_GDP_NVN_OFFSET
#define GAM_GDP_KEY1_OFFSET
#define GAM_GDP_KEY2_OFFSET
#define GAM_GDP_PPT_OFFSET
#define GAM_GDP_CML_OFFSET
#define GAM_GDP_MST_OFFSET

#define GAM_GDP_ALPHARANGE_255
#define GAM_GDP_AGC_FULL_RANGE
#define GAM_GDP_PPT_IGNORE

#define GAM_GDP_SIZE_MAX_WIDTH
#define GAM_GDP_SIZE_MAX_HEIGHT

#define GDP_NODE_NB_BANK
#define GDP_NODE_PER_FIELD

struct sti_gdp_node {};

struct sti_gdp_node_list {};

/*
 * STI GDP structure
 *
 * @sti_plane:          sti_plane structure
 * @dev:                driver device
 * @regs:               gdp registers
 * @clk_pix:            pixel clock for the current gdp
 * @clk_main_parent:    gdp parent clock if main path used
 * @clk_aux_parent:     gdp parent clock if aux path used
 * @vtg_field_nb:       callback for VTG FIELD (top or bottom) notification
 * @is_curr_top:        true if the current node processed is the top field
 * @node_list:          array of node list
 * @vtg:                registered vtg
 */
struct sti_gdp {};

#define to_sti_gdp(x)

static const uint32_t gdp_supported_formats[] =;

#define DBGFS_DUMP(reg)

static void gdp_dbg_ctl(struct seq_file *s, int val)
{}

static void gdp_dbg_vpo(struct seq_file *s, int val)
{}

static void gdp_dbg_vps(struct seq_file *s, int val)
{}

static void gdp_dbg_size(struct seq_file *s, int val)
{}

static void gdp_dbg_nvn(struct seq_file *s, struct sti_gdp *gdp, int val)
{}

static void gdp_dbg_ppt(struct seq_file *s, int val)
{}

static void gdp_dbg_mst(struct seq_file *s, int val)
{}

static int gdp_dbg_show(struct seq_file *s, void *data)
{}

static void gdp_node_dump_node(struct seq_file *s, struct sti_gdp_node *node)
{}

static int gdp_node_dbg_show(struct seq_file *s, void *arg)
{}

static struct drm_info_list gdp0_debugfs_files[] =;

static struct drm_info_list gdp1_debugfs_files[] =;

static struct drm_info_list gdp2_debugfs_files[] =;

static struct drm_info_list gdp3_debugfs_files[] =;

static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor)
{}

static int sti_gdp_fourcc2format(int fourcc)
{}

static int sti_gdp_get_alpharange(int format)
{}

/**
 * sti_gdp_get_free_nodes
 * @gdp: gdp pointer
 *
 * Look for a GDP node list that is not currently read by the HW.
 *
 * RETURNS:
 * Pointer to the free GDP node list
 */
static struct sti_gdp_node_list *sti_gdp_get_free_nodes(struct sti_gdp *gdp)
{}

/**
 * sti_gdp_get_current_nodes
 * @gdp: gdp pointer
 *
 * Look for GDP nodes that are currently read by the HW.
 *
 * RETURNS:
 * Pointer to the current GDP node list
 */
static
struct sti_gdp_node_list *sti_gdp_get_current_nodes(struct sti_gdp *gdp)
{}

/**
 * sti_gdp_disable
 * @gdp: gdp pointer
 *
 * Disable a GDP.
 */
static void sti_gdp_disable(struct sti_gdp *gdp)
{}

/**
 * sti_gdp_field_cb
 * @nb: notifier block
 * @event: event message
 * @data: private data
 *
 * Handle VTG top field and bottom field event.
 *
 * RETURNS:
 * 0 on success.
 */
static int sti_gdp_field_cb(struct notifier_block *nb,
			    unsigned long event, void *data)
{}

static void sti_gdp_init(struct sti_gdp *gdp)
{}

/**
 * sti_gdp_get_dst
 * @dev: device
 * @dst: requested destination size
 * @src: source size
 *
 * Return the cropped / clamped destination size
 *
 * RETURNS:
 * cropped / clamped destination size
 */
static int sti_gdp_get_dst(struct device *dev, int dst, int src)
{}

static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
				struct drm_atomic_state *state)
{}

static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
				  struct drm_atomic_state *state)
{}

static void sti_gdp_atomic_disable(struct drm_plane *drm_plane,
				   struct drm_atomic_state *state)
{}

static const struct drm_plane_helper_funcs sti_gdp_helpers_funcs =;

static int sti_gdp_late_register(struct drm_plane *drm_plane)
{}

static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs =;

struct drm_plane *sti_gdp_create(struct drm_device *drm_dev,
				 struct device *dev, int desc,
				 void __iomem *baseaddr,
				 unsigned int possible_crtcs,
				 enum drm_plane_type type)
{}