linux/drivers/gpu/drm/mxsfb/mxsfb_kms.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2016 Marek Vasut <[email protected]>
 *
 * This code is based on drivers/video/fbdev/mxsfb.c :
 * Copyright (C) 2010 Juergen Beisert, Pengutronix
 * Copyright (C) 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
 * Copyright (C) 2008 Embedded Alley Solutions, Inc All Rights Reserved.
 */

#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/media-bus-format.h>
#include <linux/pm_runtime.h>
#include <linux/spinlock.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.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_plane.h>
#include <drm/drm_vblank.h>

#include "mxsfb_drv.h"
#include "mxsfb_regs.h"

/* 1 second delay should be plenty of time for block reset */
#define RESET_TIMEOUT

/* -----------------------------------------------------------------------------
 * CRTC
 */

static u32 set_hsync_pulse_width(struct mxsfb_drm_private *mxsfb, u32 val)
{}

/*
 * Setup the MXSFB registers for decoding the pixels out of the framebuffer and
 * outputting them on the bus.
 */
static void mxsfb_set_formats(struct mxsfb_drm_private *mxsfb,
			      const u32 bus_format)
{}

static void mxsfb_set_mode(struct mxsfb_drm_private *mxsfb, u32 bus_flags)
{}

static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb)
{}

static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb)
{}

/*
 * Clear the bit and poll it cleared.  This is usually called with
 * a reset address and mask being either SFTRST(bit 31) or CLKGATE
 * (bit 30).
 */
static int clear_poll_bit(void __iomem *addr, u32 mask)
{}

static int mxsfb_reset_block(struct mxsfb_drm_private *mxsfb)
{}

static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb,
				     struct drm_bridge_state *bridge_state,
				     const u32 bus_format)
{}

static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc,
				   struct drm_atomic_state *state)
{}

static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc,
				    struct drm_atomic_state *state)
{}

static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
				     struct drm_atomic_state *state)
{}

static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc,
				      struct drm_atomic_state *state)
{}

static int mxsfb_crtc_enable_vblank(struct drm_crtc *crtc)
{}

static void mxsfb_crtc_disable_vblank(struct drm_crtc *crtc)
{}

static int mxsfb_crtc_set_crc_source(struct drm_crtc *crtc, const char *source)
{}

static int mxsfb_crtc_verify_crc_source(struct drm_crtc *crtc,
					const char *source, size_t *values_cnt)
{}

static const struct drm_crtc_helper_funcs mxsfb_crtc_helper_funcs =;

static const struct drm_crtc_funcs mxsfb_crtc_funcs =;

static const struct drm_crtc_funcs mxsfb_crtc_with_crc_funcs =;

/* -----------------------------------------------------------------------------
 * Encoder
 */

static const struct drm_encoder_funcs mxsfb_encoder_funcs =;

/* -----------------------------------------------------------------------------
 * Planes
 */

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

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

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

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

static bool mxsfb_format_mod_supported(struct drm_plane *plane,
				       uint32_t format,
				       uint64_t modifier)
{}

static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs =;

static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs =;

static const struct drm_plane_funcs mxsfb_plane_funcs =;

static const uint32_t mxsfb_primary_plane_formats[] =;

static const uint32_t mxsfb_overlay_plane_formats[] =;

static const uint64_t mxsfb_modifiers[] =;

/* -----------------------------------------------------------------------------
 * Initialization
 */

int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb)
{}