linux/drivers/gpu/drm/ingenic/ingenic-ipu.c

// SPDX-License-Identifier: GPL-2.0
//
// Ingenic JZ47xx IPU driver
//
// Copyright (C) 2020, Paul Cercueil <[email protected]>
// Copyright (C) 2020, Daniel Silsby <[email protected]>

#include "ingenic-drm.h"
#include "ingenic-ipu.h"

#include <linux/clk.h>
#include <linux/component.h>
#include <linux/gcd.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/time.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_dma_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_plane.h>
#include <drm/drm_property.h>
#include <drm/drm_vblank.h>

struct ingenic_ipu;

struct soc_info {};

struct ingenic_ipu_private_state {};

struct ingenic_ipu {};

/* Signed 15.16 fixed-point math (for bicubic scaling coefficients) */
#define I2F(i)
#define F2I(f)
#define FMUL(fa, fb)
#define SHARPNESS_INCR

static inline struct ingenic_ipu *plane_to_ingenic_ipu(struct drm_plane *plane)
{}

static inline struct ingenic_ipu_private_state *
to_ingenic_ipu_priv_state(struct drm_private_state *state)
{}

static struct ingenic_ipu_private_state *
ingenic_ipu_get_priv_state(struct ingenic_ipu *priv, struct drm_atomic_state *state)
{}

static struct ingenic_ipu_private_state *
ingenic_ipu_get_new_priv_state(struct ingenic_ipu *priv, struct drm_atomic_state *state)
{}

/*
 * Apply conventional cubic convolution kernel. Both parameters
 *  and return value are 15.16 signed fixed-point.
 *
 *  @f_a: Sharpness factor, typically in range [-4.0, -0.25].
 *        A larger magnitude increases perceived sharpness, but going past
 *        -2.0 might cause ringing artifacts to outweigh any improvement.
 *        Nice values on a 320x240 LCD are between -0.75 and -2.0.
 *
 *  @f_x: Absolute distance in pixels from 'pixel 0' sample position
 *        along horizontal (or vertical) source axis. Range is [0, +2.0].
 *
 *  returns: Weight of this pixel within 4-pixel sample group. Range is
 *           [-2.0, +2.0]. For moderate (i.e. > -3.0) sharpness factors,
 *           range is within [-1.0, +1.0].
 */
static inline s32 cubic_conv(s32 f_a, s32 f_x)
{}

/*
 * On entry, "weight" is a coefficient suitable for bilinear mode,
 *  which is converted to a set of four suitable for bicubic mode.
 *
 * "weight 512" means all of pixel 0;
 * "weight 256" means half of pixel 0 and half of pixel 1;
 * "weight 0" means all of pixel 1;
 *
 * "offset" is increment to next source pixel sample location.
 */
static void jz4760_set_coefs(struct ingenic_ipu *ipu, unsigned int reg,
			     unsigned int sharpness, bool downscale,
			     unsigned int weight, unsigned int offset)
{}

static void jz4725b_set_coefs(struct ingenic_ipu *ipu, unsigned int reg,
			      unsigned int sharpness, bool downscale,
			      unsigned int weight, unsigned int offset)
{}

static void ingenic_ipu_set_downscale_coefs(struct ingenic_ipu *ipu,
					    unsigned int reg,
					    unsigned int num,
					    unsigned int denom)
{}

static void ingenic_ipu_set_integer_upscale_coefs(struct ingenic_ipu *ipu,
						  unsigned int reg,
						  unsigned int num)
{}

static void ingenic_ipu_set_upscale_coefs(struct ingenic_ipu *ipu,
					  unsigned int reg,
					  unsigned int num,
					  unsigned int denom)
{}

static void ingenic_ipu_set_coefs(struct ingenic_ipu *ipu, unsigned int reg,
				  unsigned int num, unsigned int denom)
{}

static int reduce_fraction(unsigned int *num, unsigned int *denom)
{}

static inline bool osd_changed(struct drm_plane_state *state,
			       struct drm_plane_state *oldstate)
{}

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

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

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

static const struct drm_plane_helper_funcs ingenic_ipu_plane_helper_funcs =;

static int
ingenic_ipu_plane_atomic_get_property(struct drm_plane *plane,
				      const struct drm_plane_state *state,
				      struct drm_property *property, u64 *val)
{}

static int
ingenic_ipu_plane_atomic_set_property(struct drm_plane *plane,
				      struct drm_plane_state *state,
				      struct drm_property *property, u64 val)
{}

static const struct drm_plane_funcs ingenic_ipu_plane_funcs =;

static struct drm_private_state *
ingenic_ipu_duplicate_state(struct drm_private_obj *obj)
{}

static void ingenic_ipu_destroy_state(struct drm_private_obj *obj,
				      struct drm_private_state *state)
{}

static const struct drm_private_state_funcs ingenic_ipu_private_state_funcs =;

static irqreturn_t ingenic_ipu_irq_handler(int irq, void *arg)
{}

static const struct regmap_config ingenic_ipu_regmap_config =;

static int ingenic_ipu_bind(struct device *dev, struct device *master, void *d)
{}

static void ingenic_ipu_unbind(struct device *dev,
			       struct device *master, void *d)
{}

static const struct component_ops ingenic_ipu_ops =;

static int ingenic_ipu_probe(struct platform_device *pdev)
{}

static void ingenic_ipu_remove(struct platform_device *pdev)
{}

static const u32 jz4725b_ipu_formats[] =;

static const struct soc_info jz4725b_soc_info =;

static const u32 jz4760_ipu_formats[] =;

static const struct soc_info jz4760_soc_info =;

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

static struct platform_driver ingenic_ipu_driver =;

struct platform_driver *ingenic_ipu_driver_ptr =;