linux/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2014 Free Electrons
 * Copyright (C) 2014 Atmel
 *
 * Author: Boris BREZILLON <[email protected]>
 */

#include <linux/dmapool.h>
#include <linux/mfd/atmel-hlcdc.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.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 "atmel_hlcdc_dc.h"

/**
 * struct atmel_hlcdc_plane_state - Atmel HLCDC Plane state structure.
 *
 * @base: DRM plane state
 * @crtc_x: x position of the plane relative to the CRTC
 * @crtc_y: y position of the plane relative to the CRTC
 * @crtc_w: visible width of the plane
 * @crtc_h: visible height of the plane
 * @src_x: x buffer position
 * @src_y: y buffer position
 * @src_w: buffer width
 * @src_h: buffer height
 * @disc_x: x discard position
 * @disc_y: y discard position
 * @disc_w: discard width
 * @disc_h: discard height
 * @ahb_id: AHB identification number
 * @bpp: bytes per pixel deduced from pixel_format
 * @offsets: offsets to apply to the GEM buffers
 * @xstride: value to add to the pixel pointer between each line
 * @pstride: value to add to the pixel pointer between each pixel
 * @nplanes: number of planes (deduced from pixel_format)
 * @dscrs: DMA descriptors
 */
struct atmel_hlcdc_plane_state {};

static inline struct atmel_hlcdc_plane_state *
drm_plane_state_to_atmel_hlcdc_plane_state(struct drm_plane_state *s)
{}

#define SUBPIXEL_MASK

static uint32_t rgb_formats[] =;

struct atmel_hlcdc_formats atmel_hlcdc_plane_rgb_formats =;

static uint32_t rgb_and_yuv_formats[] =;

struct atmel_hlcdc_formats atmel_hlcdc_plane_rgb_and_yuv_formats =;

static int atmel_hlcdc_format_to_plane_mode(u32 format, u32 *mode)
{}

static u32 heo_downscaling_xcoef[] =;

static u32 heo_downscaling_ycoef[] =;

static u32 heo_upscaling_xcoef[] =;

static u32 heo_upscaling_ycoef[] =;

#define ATMEL_HLCDC_XPHIDEF
#define ATMEL_HLCDC_YPHIDEF

static u32 atmel_hlcdc_plane_phiscaler_get_factor(u32 srcsize,
						  u32 dstsize,
						  u32 phidef)
{}

static void
atmel_hlcdc_plane_scaler_set_phicoeff(struct atmel_hlcdc_plane *plane,
				      const u32 *coeff_tab, int size,
				      unsigned int cfg_offs)
{}

static
void atmel_hlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
				    struct atmel_hlcdc_plane_state *state)
{}

static
void atmel_xlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
				    struct atmel_hlcdc_plane_state *state)
{}

static void
atmel_hlcdc_plane_update_pos_and_size(struct atmel_hlcdc_plane *plane,
				      struct atmel_hlcdc_plane_state *state)
{}

static
void atmel_hlcdc_plane_update_general_settings(struct atmel_hlcdc_plane *plane,
					       struct atmel_hlcdc_plane_state *state)
{}

static
void atmel_xlcdc_plane_update_general_settings(struct atmel_hlcdc_plane *plane,
					       struct atmel_hlcdc_plane_state *state)
{}

static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane,
					struct atmel_hlcdc_plane_state *state)
{}

static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane,
					  struct atmel_hlcdc_plane_state *state)
{}

static void atmel_hlcdc_update_buffers(struct atmel_hlcdc_plane *plane,
				       struct atmel_hlcdc_plane_state *state,
				       u32 sr, int i)
{}

static void atmel_xlcdc_update_buffers(struct atmel_hlcdc_plane *plane,
				       struct atmel_hlcdc_plane_state *state,
				       u32 sr, int i)
{}

static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
					     struct atmel_hlcdc_plane_state *state)
{}

int atmel_hlcdc_plane_prepare_ahb_routing(struct drm_crtc_state *c_state)
{}

int
atmel_hlcdc_plane_prepare_disc_area(struct drm_crtc_state *c_state)
{}

static void
atmel_hlcdc_plane_update_disc_area(struct atmel_hlcdc_plane *plane,
				   struct atmel_hlcdc_plane_state *state)
{}

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

static void atmel_hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
{}

static void atmel_xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
{}

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

static void atmel_hlcdc_atomic_update(struct atmel_hlcdc_plane *plane,
				      struct atmel_hlcdc_dc *dc)
{}

static void atmel_xlcdc_atomic_update(struct atmel_hlcdc_plane *plane,
				      struct atmel_hlcdc_dc *dc)
{}

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

static void atmel_hlcdc_csc_init(struct atmel_hlcdc_plane *plane,
				 const struct atmel_hlcdc_layer_desc *desc)
{}

static void atmel_xlcdc_csc_init(struct atmel_hlcdc_plane *plane,
				 const struct atmel_hlcdc_layer_desc *desc)
{}

static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane)
{}

static void atmel_hlcdc_irq_dbg(struct atmel_hlcdc_plane *plane,
				const struct atmel_hlcdc_layer_desc *desc)
{}

static void atmel_xlcdc_irq_dbg(struct atmel_hlcdc_plane *plane,
				const struct atmel_hlcdc_layer_desc *desc)
{}

void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane)
{}

const struct atmel_lcdc_dc_ops atmel_hlcdc_ops =;

const struct atmel_lcdc_dc_ops atmel_xlcdc_ops =;

static const struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs =;

static int atmel_hlcdc_plane_alloc_dscrs(struct drm_plane *p,
					 struct atmel_hlcdc_plane_state *state)
{}

static void atmel_hlcdc_plane_reset(struct drm_plane *p)
{}

static struct drm_plane_state *
atmel_hlcdc_plane_atomic_duplicate_state(struct drm_plane *p)
{}

static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
						   struct drm_plane_state *s)
{}

static const struct drm_plane_funcs layer_plane_funcs =;

static int atmel_hlcdc_plane_create(struct drm_device *dev,
				    const struct atmel_hlcdc_layer_desc *desc)
{}

int atmel_hlcdc_create_planes(struct drm_device *dev)
{}