linux/drivers/gpu/drm/pl111/pl111_drv.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
 *
 * Parts of this file were based on sources as follows:
 *
 * Copyright (c) 2006-2008 Intel Corporation
 * Copyright (c) 2007 Dave Airlie <[email protected]>
 * Copyright (C) 2011 Texas Instruments
 */

/**
 * DOC: ARM PrimeCell PL110 and PL111 CLCD Driver
 *
 * The PL110/PL111 is a simple LCD controller that can support TFT
 * and STN displays. This driver exposes a standard KMS interface
 * for them.
 *
 * The driver currently doesn't expose the cursor.  The DRM API for
 * cursors requires support for 64x64 ARGB8888 cursor images, while
 * the hardware can only support 64x64 monochrome with masking
 * cursors.  While one could imagine trying to hack something together
 * to look at the ARGB8888 and program reasonable in monochrome, we
 * just don't expose the cursor at all instead, and leave cursor
 * support to the application software cursor layer.
 *
 * TODO:
 *
 * - Fix race between setting plane base address and getting IRQ for
 *   vsync firing the pageflip completion.
 *
 * - Read back hardware state at boot to skip reprogramming the
 *   hardware when doing a no-op modeset.
 *
 * - Use the CLKSEL bit to support switching between the two external
 *   clock parents.
 */

#include <linux/amba/bus.h>
#include <linux/dma-buf.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/of_reserved_mem.h>
#include <linux/shmem_fs.h>
#include <linux/slab.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>

#include "pl111_drm.h"
#include "pl111_versatile.h"
#include "pl111_nomadik.h"

#define DRIVER_DESC

static const struct drm_mode_config_funcs mode_config_funcs =;

static int pl111_modeset_init(struct drm_device *dev)
{}

static struct drm_gem_object *
pl111_gem_import_sg_table(struct drm_device *dev,
			  struct dma_buf_attachment *attach,
			  struct sg_table *sgt)
{}

DEFINE_DRM_GEM_DMA_FOPS(drm_fops);

static const struct drm_driver pl111_drm_driver =;

static int pl111_amba_probe(struct amba_device *amba_dev,
			    const struct amba_id *id)
{}

static void pl111_amba_remove(struct amba_device *amba_dev)
{}

static void pl111_amba_shutdown(struct amba_device *amba_dev)
{}

/*
 * This early variant lacks the 565 and 444 pixel formats.
 */
static const u32 pl110_pixel_formats[] =;

static const struct pl111_variant_data pl110_variant =;

/* RealView, Versatile Express etc use this modern variant */
static const u32 pl111_pixel_formats[] =;

static const struct pl111_variant_data pl111_variant =;

static const u32 pl110_nomadik_pixel_formats[] =;

static const struct pl111_variant_data pl110_nomadik_variant =;

static const struct amba_id pl111_id_table[] =;
MODULE_DEVICE_TABLE(amba, pl111_id_table);

static struct amba_driver pl111_amba_driver __maybe_unused =;

#ifdef CONFIG_ARM_AMBA
module_amba_driver(pl111_amba_driver);
#endif

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