#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"
#define RESET_TIMEOUT …
static u32 set_hsync_pulse_width(struct mxsfb_drm_private *mxsfb, u32 val)
{ … }
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)
{ … }
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 = …;
static const struct drm_encoder_funcs mxsfb_encoder_funcs = …;
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[] = …;
int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb)
{ … }