From dff906c3f91c642ef04731e63c3b5f0e520f7778 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Oct 2018 09:26:35 -0700 Subject: drm/tinydrm: Advertise that we can do only DRM_FORMAT_MOD_LINEAR. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, the xserver relies on what the 3D driver exposes and assumes that the display can handle it, and then the DRM driver happily tries to scan out a tiled format. Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20181025162635.6689-1-eric@anholt.net Acked-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 1 + drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/tinydrm') diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c index 255341ee4eb9..9af51d982a33 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c @@ -146,6 +146,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev, drm->dev_private = tdev; drm_mode_config_init(drm); drm->mode_config.funcs = &tinydrm_mode_config_funcs; + drm->mode_config.allow_fb_modifiers = true; return 0; } diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c index 7e8e24d0b7a7..eacfc0ec8ff1 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c @@ -184,6 +184,10 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, struct drm_display_mode mode_copy; struct drm_connector *connector; int ret; + static const uint64_t modifiers[] = { + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_INVALID + }; drm_mode_copy(&mode_copy, mode); ret = tinydrm_rotate_mode(&mode_copy, rotation); @@ -202,6 +206,6 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev, return PTR_ERR(connector); return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats, - format_count, NULL, connector); + format_count, modifiers, connector); } EXPORT_SYMBOL(tinydrm_display_pipe_init); -- cgit v1.2.3-59-g8ed1b From f300c86e33a686c7abcf0c37deee04ef666ed78b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 24 Oct 2018 11:43:12 -0700 Subject: drm: Add an hx8367d tinydrm driver. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I want to sort out support for tinydrm in vc4, so I needed to get a tinydrm-appropriate panel working and this is what I had on hand. This is derived from a combination of ili9341.c from tinydrm and fb_hx8357d.c from staging's fbtft. v2: Write my own register defs from the spec to not need the header from fbtft. Fix spi device string to enable module autoloading. (Suggestions by Noralf) Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20181024184313.2967-3-eric@anholt.net Reviewed-by: Noralf Trønnes (v1) --- MAINTAINERS | 7 + drivers/gpu/drm/tinydrm/Kconfig | 11 ++ drivers/gpu/drm/tinydrm/Makefile | 1 + drivers/gpu/drm/tinydrm/hx8357d.c | 270 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 289 insertions(+) create mode 100644 drivers/gpu/drm/tinydrm/hx8357d.c (limited to 'drivers/gpu/drm/tinydrm') diff --git a/MAINTAINERS b/MAINTAINERS index 1fa3432e9e33..ff1f2878e14b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4623,6 +4623,13 @@ S: Maintained F: drivers/gpu/drm/tinydrm/ili9225.c F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt +DRM DRIVER FOR HX8357D PANELS +M: Eric Anholt +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/tinydrm/hx8357d.c +F: Documentation/devicetree/bindings/display/himax,hx8357d.txt + DRM DRIVER FOR INTEL I810 VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/i810/ diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig index 16f4b5c91f1b..2c408ac1a900 100644 --- a/drivers/gpu/drm/tinydrm/Kconfig +++ b/drivers/gpu/drm/tinydrm/Kconfig @@ -10,6 +10,17 @@ menuconfig DRM_TINYDRM config TINYDRM_MIPI_DBI tristate +config TINYDRM_HX8357D + tristate "DRM support for HX8357D display panels" + depends on DRM_TINYDRM && SPI + depends on BACKLIGHT_CLASS_DEVICE + select TINYDRM_MIPI_DBI + help + DRM driver for the following HX8357D panels: + * YX350HV15-T 3.5" 340x350 TFT (Adafruit 3.5") + + If M is selected the module will be called hx8357d. + config TINYDRM_ILI9225 tristate "DRM support for ILI9225 display panels" depends on DRM_TINYDRM && SPI diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile index 14d99080665a..f823066f7743 100644 --- a/drivers/gpu/drm/tinydrm/Makefile +++ b/drivers/gpu/drm/tinydrm/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_DRM_TINYDRM) += core/ obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o # Displays +obj-$(CONFIG_TINYDRM_HX8357D) += hx8357d.o obj-$(CONFIG_TINYDRM_ILI9225) += ili9225.o obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o diff --git a/drivers/gpu/drm/tinydrm/hx8357d.c b/drivers/gpu/drm/tinydrm/hx8357d.c new file mode 100644 index 000000000000..c3e51c2baebc --- /dev/null +++ b/drivers/gpu/drm/tinydrm/hx8357d.c @@ -0,0 +1,270 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * DRM driver for the HX8357D LCD controller + * + * Copyright 2018 Broadcom + * Copyright 2018 David Lechner + * Copyright 2016 Noralf Trønnes + * Copyright (C) 2015 Adafruit Industries + * Copyright (C) 2013 Christian Vogelgsang + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include