linux/drivers/gpu/drm/sun4i/sun4i_backend.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2015 Free Electrons
 * Copyright (C) 2015 NextThing Co
 *
 * Maxime Ripard <[email protected]>
 */

#include <linux/component.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/reset.h>

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

#include "sun4i_backend.h"
#include "sun4i_drv.h"
#include "sun4i_frontend.h"
#include "sun4i_layer.h"
#include "sunxi_engine.h"

struct sun4i_backend_quirks {};

static const u32 sunxi_rgb2yuv_coef[12] =;

static void sun4i_backend_apply_color_correction(struct sunxi_engine *engine)
{}

static void sun4i_backend_disable_color_correction(struct sunxi_engine *engine)
{}

static void sun4i_backend_commit(struct sunxi_engine *engine,
				 struct drm_crtc *crtc,
				 struct drm_atomic_state *state)
{}

void sun4i_backend_layer_enable(struct sun4i_backend *backend,
				int layer, bool enable)
{}

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

static const uint32_t sun4i_backend_formats[] =;

bool sun4i_backend_format_is_supported(uint32_t fmt, uint64_t modifier)
{}

int sun4i_backend_update_layer_coord(struct sun4i_backend *backend,
				     int layer, struct drm_plane *plane)
{}

static int sun4i_backend_update_yuv_format(struct sun4i_backend *backend,
					   int layer, struct drm_plane *plane)
{}

int sun4i_backend_update_layer_formats(struct sun4i_backend *backend,
				       int layer, struct drm_plane *plane)
{}

int sun4i_backend_update_layer_frontend(struct sun4i_backend *backend,
					int layer, uint32_t fmt)
{}

static int sun4i_backend_update_yuv_buffer(struct sun4i_backend *backend,
					   struct drm_framebuffer *fb,
					   dma_addr_t paddr)
{}

int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend,
				      int layer, struct drm_plane *plane)
{}

int sun4i_backend_update_layer_zpos(struct sun4i_backend *backend, int layer,
				    struct drm_plane *plane)
{}

void sun4i_backend_cleanup_layer(struct sun4i_backend *backend,
				 int layer)
{}

static bool sun4i_backend_plane_uses_scaler(struct drm_plane_state *state)
{}

static bool sun4i_backend_plane_uses_frontend(struct drm_plane_state *state)
{}

static bool sun4i_backend_plane_is_supported(struct drm_plane_state *state,
					     bool *uses_frontend)
{}

static void sun4i_backend_atomic_begin(struct sunxi_engine *engine,
				       struct drm_crtc_state *old_state)
{}

static int sun4i_backend_atomic_check(struct sunxi_engine *engine,
				      struct drm_crtc_state *crtc_state)
{}

static void sun4i_backend_vblank_quirk(struct sunxi_engine *engine)
{
	struct sun4i_backend *backend = engine_to_sun4i_backend(engine);
	struct sun4i_frontend *frontend = backend->frontend;

	if (!frontend)
		return;

	/*
	 * In a teardown scenario with the frontend involved, we have
	 * to keep the frontend enabled until the next vblank, and
	 * only then disable it.
	 *
	 * This is due to the fact that the backend will not take into
	 * account the new configuration (with the plane that used to
	 * be fed by the frontend now disabled) until we write to the
	 * commit bit and the hardware fetches the new configuration
	 * during the next vblank.
	 *
	 * So we keep the frontend around in order to prevent any
	 * visual artifacts.
	 */
	spin_lock(&backend->frontend_lock);
	if (backend->frontend_teardown) {
		sun4i_frontend_exit(frontend);
		backend->frontend_teardown = false;
	}
	spin_unlock(&backend->frontend_lock);
};

static void sun4i_backend_mode_set(struct sunxi_engine *engine,
				   const struct drm_display_mode *mode)
{}

static int sun4i_backend_init_sat(struct device *dev) {}

static int sun4i_backend_free_sat(struct device *dev) {}

/*
 * The display backend can take video output from the display frontend, or
 * the display enhancement unit on the A80, as input for one it its layers.
 * This relationship within the display pipeline is encoded in the device
 * tree with of_graph, and we use it here to figure out which backend, if
 * there are 2 or more, we are currently probing. The number would be in
 * the "reg" property of the upstream output port endpoint.
 */
static int sun4i_backend_of_get_id(struct device_node *node)
{}

/* TODO: This needs to take multiple pipelines into account */
static struct sun4i_frontend *sun4i_backend_find_frontend(struct sun4i_drv *drv,
							  struct device_node *node)
{}

static const struct sunxi_engine_ops sun4i_backend_engine_ops =;

static const struct regmap_config sun4i_backend_regmap_config =;

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

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

static const struct component_ops sun4i_backend_ops =;

static int sun4i_backend_probe(struct platform_device *pdev)
{}

static void sun4i_backend_remove(struct platform_device *pdev)
{}

static const struct sun4i_backend_quirks sun4i_backend_quirks =;

static const struct sun4i_backend_quirks sun5i_backend_quirks =;

static const struct sun4i_backend_quirks sun6i_backend_quirks =;

static const struct sun4i_backend_quirks sun7i_backend_quirks =;

static const struct sun4i_backend_quirks sun8i_a33_backend_quirks =;

static const struct sun4i_backend_quirks sun9i_backend_quirks =;

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

static struct platform_driver sun4i_backend_platform_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();