linux/drivers/gpu/drm/exynos/exynos_drm_gsc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2012 Samsung Electronics Co.Ltd
 * Authors:
 *	Eunchul Kim <[email protected]>
 *	Jinyoung Jeon <[email protected]>
 *	Sangmin Lee <[email protected]>
 */

#include <linux/clk.h>
#include <linux/component.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regmap.h>

#include <drm/drm_fourcc.h>
#include <drm/drm_print.h>
#include <drm/exynos_drm.h>

#include "exynos_drm_drv.h"
#include "exynos_drm_ipp.h"
#include "regs-gsc.h"

/*
 * GSC stands for General SCaler and
 * supports image scaler/rotator and input/output DMA operations.
 * input DMA reads image data from the memory.
 * output DMA writes image data to memory.
 * GSC supports image rotation and image effect functions.
 */


#define GSC_MAX_CLOCKS
#define GSC_MAX_SRC
#define GSC_MAX_DST
#define GSC_RESET_TIMEOUT
#define GSC_BUF_STOP
#define GSC_BUF_START
#define GSC_REG_SZ
#define GSC_WIDTH_ITU_709
#define GSC_SC_UP_MAX_RATIO
#define GSC_SC_DOWN_RATIO_7_8
#define GSC_SC_DOWN_RATIO_6_8
#define GSC_SC_DOWN_RATIO_5_8
#define GSC_SC_DOWN_RATIO_4_8
#define GSC_SC_DOWN_RATIO_3_8
#define GSC_SC_DOWN_RATIO_2_8
#define GSC_CROP_MAX
#define GSC_CROP_MIN
#define GSC_SCALE_MAX
#define GSC_SCALE_MIN
#define GSC_COEF_RATIO
#define GSC_COEF_PHASE
#define GSC_COEF_ATTR
#define GSC_COEF_H_8T
#define GSC_COEF_V_4T
#define GSC_COEF_DEPTH
#define GSC_AUTOSUSPEND_DELAY

#define get_gsc_context(dev)
#define gsc_read(offset)
#define gsc_write(cfg, offset)

/*
 * A structure of scaler.
 *
 * @range: narrow, wide.
 * @pre_shfactor: pre sclaer shift factor.
 * @pre_hratio: horizontal ratio of the prescaler.
 * @pre_vratio: vertical ratio of the prescaler.
 * @main_hratio: the main scaler's horizontal ratio.
 * @main_vratio: the main scaler's vertical ratio.
 */
struct gsc_scaler {};

/*
 * A structure of gsc context.
 *
 * @regs: memory mapped io registers.
 * @gsc_clk: gsc gate clock.
 * @sc: scaler infomations.
 * @id: gsc id.
 * @irq: irq number.
 * @rotation: supports rotation of src.
 */
struct gsc_context {};

/**
 * struct gsc_driverdata - per device type driver data for init time.
 *
 * @limits: picture size limits array
 * @num_limits: number of items in the aforementioned array
 * @clk_names: names of clocks needed by this variant
 * @num_clocks: the number of clocks needed by this variant
 */
struct gsc_driverdata {};

/* 8-tap Filter Coefficient */
static const int h_coef_8t[GSC_COEF_RATIO][GSC_COEF_ATTR][GSC_COEF_H_8T] =;

/* 4-tap Filter Coefficient */
static const int v_coef_4t[GSC_COEF_RATIO][GSC_COEF_ATTR][GSC_COEF_V_4T] =;

static int gsc_sw_reset(struct gsc_context *ctx)
{}

static void gsc_handle_irq(struct gsc_context *ctx, bool enable,
		bool overflow, bool done)
{}


static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt, bool tiled)
{}

static void gsc_src_set_transf(struct gsc_context *ctx, unsigned int rotation)
{}

static void gsc_src_set_size(struct gsc_context *ctx,
			     struct exynos_drm_ipp_buffer *buf)
{}

static void gsc_src_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
			       bool enqueue)
{}

static void gsc_src_set_addr(struct gsc_context *ctx, u32 buf_id,
			    struct exynos_drm_ipp_buffer *buf)
{}

static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt, bool tiled)
{}

static int gsc_get_ratio_shift(struct gsc_context *ctx, u32 src, u32 dst,
			       u32 *ratio)
{}

static void gsc_get_prescaler_shfactor(u32 hratio, u32 vratio, u32 *shfactor)
{}

static int gsc_set_prescaler(struct gsc_context *ctx, struct gsc_scaler *sc,
			     struct drm_exynos_ipp_task_rect *src,
			     struct drm_exynos_ipp_task_rect *dst)
{}

static void gsc_set_h_coef(struct gsc_context *ctx, unsigned long main_hratio)
{}

static void gsc_set_v_coef(struct gsc_context *ctx, unsigned long main_vratio)
{}

static void gsc_set_scaler(struct gsc_context *ctx, struct gsc_scaler *sc)
{}

static void gsc_dst_set_size(struct gsc_context *ctx,
			     struct exynos_drm_ipp_buffer *buf)
{}

static int gsc_dst_get_buf_seq(struct gsc_context *ctx)
{}

static void gsc_dst_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
				bool enqueue)
{}

static void gsc_dst_set_addr(struct gsc_context *ctx,
			     u32 buf_id, struct exynos_drm_ipp_buffer *buf)
{}

static int gsc_get_src_buf_index(struct gsc_context *ctx)
{}

static int gsc_get_dst_buf_index(struct gsc_context *ctx)
{}

static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
{}

static int gsc_reset(struct gsc_context *ctx)
{}

static void gsc_start(struct gsc_context *ctx)
{}

static int gsc_commit(struct exynos_drm_ipp *ipp,
			  struct exynos_drm_ipp_task *task)
{}

static void gsc_abort(struct exynos_drm_ipp *ipp,
			  struct exynos_drm_ipp_task *task)
{}

static struct exynos_drm_ipp_funcs ipp_funcs =;

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

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

static const struct component_ops gsc_component_ops =;

static const unsigned int gsc_formats[] =;

static const unsigned int gsc_tiled_formats[] =;

static int gsc_probe(struct platform_device *pdev)
{}

static void gsc_remove(struct platform_device *pdev)
{}

static int __maybe_unused gsc_runtime_suspend(struct device *dev)
{}

static int __maybe_unused gsc_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops gsc_pm_ops =;

static const struct drm_exynos_ipp_limit gsc_5250_limits[] =;

static const struct drm_exynos_ipp_limit gsc_5420_limits[] =;

static const struct drm_exynos_ipp_limit gsc_5433_limits[] =;

static struct gsc_driverdata gsc_exynos5250_drvdata =;

static struct gsc_driverdata gsc_exynos5420_drvdata =;

static struct gsc_driverdata gsc_exynos5433_drvdata =;

static const struct of_device_id exynos_drm_gsc_of_match[] =;
MODULE_DEVICE_TABLE(of, exynos_drm_gsc_of_match);

struct platform_driver gsc_driver =;