video: ARM CLCD: Move registers to a separate header.
Subsystems (4)
PATCH v3 1/2 video: ARM CLCD: Move registers to a separate header.
We'd like to reuse these register definitions for the DRM CLCD driver, but there's a bunch of fbdev-specific code in the current header.
--- include/linux/amba/clcd-regs.h | 76 ++++++++++++++++++++++++++++++++++++++++++ include/linux/amba/clcd.h | 68 +------------------------------------ 2 files changed, 77 insertions(+), 67 deletions(-) create mode 100644 include/linux/amba/clcd-regs.h
include/linux/amba/clcd-regs.h new file +76 -0
@@ -0,0 +1,76 @@ +/* +* David A Rusling +* +* Copyright (C) 2001 ARM Limited +* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file COPYING in the main directory of this archive +* for more details. +*/ + +/* +* CLCD Controller Internal Register addresses +*/ +#define CLCD_TIM0 0x00000000 +#define CLCD_TIM1 0x00000004 +#define CLCD_TIM2 0x00000008 +#define CLCD_TIM3 0x0000000c +#define CLCD_UBAS 0x00000010 +#define CLCD_LBAS 0x00000014 + +#define CLCD_PL110_IENB 0x00000018 +#define CLCD_PL110_CNTL 0x0000001c +#define CLCD_PL110_STAT 0x00000020 +#define CLCD_PL110_INTR 0x00000024 +#define CLCD_PL110_UCUR 0x00000028 +#define CLCD_PL110_LCUR 0x0000002C + +#define CLCD_PL111_CNTL 0x00000018 +#define CLCD_PL111_IENB 0x0000001c +#define CLCD_PL111_RIS 0x00000020 +#define CLCD_PL111_MIS 0x00000024 +#define CLCD_PL111_ICR 0x00000028 +#define CLCD_PL111_UCUR 0x0000002c +#define CLCD_PL111_LCUR 0x00000030 + +#define CLCD_PALL 0x00000200 +#define CLCD_PALETTE 0x00000200 + +#define TIM2_CLKSEL (1 << 5) +#define TIM2_IVS (1 << 11) +#define TIM2_IHS (1 << 12) +#define TIM2_IPC (1 << 13) +#define TIM2_IOE (1 << 14) +#define TIM2_BCD (1 << 26) + +#define CNTL_LCDEN (1 << 0) +#define CNTL_LCDBPP1 (0 << 1) +#define CNTL_LCDBPP2 (1 << 1) +#define CNTL_LCDBPP4 (2 << 1) +#define CNTL_LCDBPP8 (3 << 1) +#define CNTL_LCDBPP16 (4 << 1) +#define CNTL_LCDBPP16_565 (6 << 1) +#define CNTL_LCDBPP16_444 (7 << 1) +#define CNTL_LCDBPP24 (5 << 1) +#define CNTL_LCDBW (1 << 4) +#define CNTL_LCDTFT (1 << 5) +#define CNTL_LCDMONO8 (1 << 6) +#define CNTL_LCDDUAL (1 << 7) +#define CNTL_BGR (1 << 8) +#define CNTL_BEBO (1 << 9) +#define CNTL_BEPO (1 << 10) +#define CNTL_LCDPWR (1 << 11) +#define CNTL_LCDVCOMP (x) ((x) << 12) +#define CNTL_LDMAFIFOTIME (1 << 15) +#define CNTL_WATERMARK (1 << 16) + +/* ST Microelectronics variant bits */ +#define CNTL_ST_1XBPP_444 0x0 +#define CNTL_ST_1XBPP_5551 (1 << 17) +#define CNTL_ST_1XBPP_565 (1 << 18) +#define CNTL_ST_CDWID_12 0x0 +#define CNTL_ST_CDWID_16 (1 << 19) +#define CNTL_ST_CDWID_18 (1 << 20) +#define CNTL_ST_CDWID_24 ((1 << 19)|(1 << 20)) +#define CNTL_ST_CEAEN (1 << 21) +#define CNTL_ST_LCDBPP24_PACKED (6 << 1)
include/linux/amba/clcd.h +1 -67
74 lines not on this page · raw message
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 2/2 drm/pl111: Initial drm/kms driver for pl111
From: Tom Cooksey <[email protected]>
This is a modesetting driver for the pl111 CLCD display controller found on various ARM platforms such as the Versatile Express. The driver has only been tested on the bcm911360_entphn platform so far, with PRIME-based buffer sharing between vc4 and clcd.
It reuses the existing devicetree binding, while not using quite as many of its properties as the fbdev driver does (those are left for future work).
v2: Nearly complete rewrite by anholt, cutting 2/3 of the code thanks
to DRM core's excellent new helpers.
v3: Change the driver's .name to not clash with fbdev in sysfs, drop
platform alias, drop redundant "drm" in DRM driver name.
--- Documentation/gpu/index.rst | 1 + Documentation/gpu/pl111.rst | 6 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/pl111/Kconfig | 12 ++ drivers/gpu/drm/pl111/Makefile | 8 + drivers/gpu/drm/pl111/pl111_connector.c | 127 ++++++++++++++ drivers/gpu/drm/pl111/pl111_crtc.c | 239 ++++++++++++++++++++++++++ drivers/gpu/drm/pl111/pl111_drm.h | 64 +++++++ drivers/gpu/drm/pl111/pl111_drv.c | 291 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/pl111/pl111_encoder.c | 50 ++++++ drivers/gpu/drm/pl111/pl111_gem.c | 35 ++++ drivers/gpu/drm/pl111/pl111_plane.c | 167 ++++++++++++++++++ 13 files changed, 1003 insertions(+) create mode 100644 Documentation/gpu/pl111.rst create mode 100644 drivers/gpu/drm/pl111/Kconfig create mode 100644 drivers/gpu/drm/pl111/Makefile create mode 100644 drivers/gpu/drm/pl111/pl111_connector.c create mode 100644 drivers/gpu/drm/pl111/pl111_crtc.c create mode 100644 drivers/gpu/drm/pl111/pl111_drm.h create mode 100644 drivers/gpu/drm/pl111/pl111_drv.c create mode 100644 drivers/gpu/drm/pl111/pl111_encoder.c create mode 100644 drivers/gpu/drm/pl111/pl111_gem.c create mode 100644 drivers/gpu/drm/pl111/pl111_plane.c
Documentation/gpu/index.rst +1 -0
@@ -11,6 +11,7 @@ Linux GPU Driver Developer's Guide drm-kms-helpers drm-uapi i915 + pl111 tinydrm vc4 vga-switcheroo
Documentation/gpu/pl111.rst new file +6 -0
@@ -0,0 +1,6 @@ +========================================== + drm/pl111 ARM PrimeCell PL111 CLCD Driver +========================================== + +.. kernel-doc:: drivers/gpu/drm/pl111/pl111_drv.c + :doc: ARM PrimeCell PL111 CLCD Driver
drivers/gpu/drm/Kconfig +2 -0
@@ -274,6 +274,8 @@ source "drivers/gpu/drm/meson/Kconfig" source "drivers/gpu/drm/tinydrm/Kconfig" +source "drivers/gpu/drm/pl111/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY
drivers/gpu/drm/Makefile +1 -0
@@ -96,3 +96,4 @@ obj-y += hisilicon/ obj-$(CONFIG_DRM_ZTE) += zte/ obj-$(CONFIG_DRM_MXSFB) += mxsfb/ obj-$(CONFIG_DRM_TINYDRM) += tinydrm/ +obj-$(CONFIG_DRM_PL111) += pl111/
drivers/gpu/drm/pl111/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +config DRM_PL111 + tristate "DRM Support for PL111 CLCD Controller" + depends on DRM + depends on ARM || ARM64 || COMPILE_TEST + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE + help + Choose this option for DRM support for the PL111 CLCD controller. + If M is selected the module will be called pl111_drm. +
drivers/gpu/drm/pl111/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +pl111_drm-y += pl111_connector.o \ + pl111_crtc.o \ + pl111_drv.o \ + pl111_encoder.o \ + pl111_gem.o \ + pl111_plane.o + +obj-$(CONFIG_DRM_PL111) += pl111_drm.o
drivers/gpu/drm/pl111/pl111_connector.c new file +127 -0
127 lines not on this page · raw message
drivers/gpu/drm/pl111/pl111_crtc.c new file +239 -0
239 lines not on this page · raw message
drivers/gpu/drm/pl111/pl111_drm.h new file +64 -0
64 lines not on this page · raw message
drivers/gpu/drm/pl111/pl111_drv.c new file +291 -0
291 lines not on this page · raw message
drivers/gpu/drm/pl111/pl111_encoder.c new file +50 -0
50 lines not on this page · raw message
drivers/gpu/drm/pl111/pl111_gem.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* (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 +* +* This program is free software and is provided to you under the terms of the +* GNU General Public License version 2 as published by the Free Software +* Foundation, and any use by you of this program is subject to the terms of +* such GNU licence. +* +*/ + +/** +* pl111_drm_gem.c +* Implementation of the GEM functions for PL111 DRM +*/ +#include <linux/version.h> +#include <linux/shmem_fs.h> +#include <linux/dma-buf.h> +#include <drm/drmP.h> +#include <drm/drm_crtc_helper.h> +#include <drm/drm_gem_cma_helper.h> +#include "pl111_drm.h" + +int pl111_dumb_create (struct drm_file *file_priv, +struct drm_device *dev,struct drm_mode_create_dumb *args) +{ + args->pitch =DIV_ROUND_UP (args->width * args->bpp,8 ); + +return drm_gem_cma_dumb_create_internal (file_priv, dev, args); +}
drivers/gpu/drm/pl111/pl111_plane.c new file +167 -0
167 lines not on this page · raw message
Signature · 1 line
2.11.0
Re: [PATCH v3 2/2] drm/pl111: Initial drm/kms driver for pl111
Quoted 7 lines · Eric Anholt
From: Tom Cooksey <[email protected]>
This is a modesetting driver for the pl111 CLCD display controller found on various ARM platforms such as the Versatile Express. The driver has only been tested on the
bcm911360_entphnplatform so far, with PRIME-based buffer sharing between vc4 and clcd.
Quoted 8 lines
It reuses the existing devicetree binding, while not using quite as many of its properties as the fbdev driver does (those are left for future work).
v2: Nearly complete rewrite by anholt, cutting 2/3 of the code thanks
to DRM core's excellent new helpers.
v3: Change the driver's .name to not clash with fbdev in sysfs, drop
platform alias, drop redundant "drm" in DRM driver name.
Apologies, I did these fixups on the wrong branch, thus the second "v3" patch. :(
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel