Re: [RFC 0/5] drm: Add support for tiny LCD displays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 16, 2016 at 02:34:14PM +0100, Noralf Trønnes wrote:
> This is an attempt at providing a DRM version of drivers/staging/fbtft.
> I'm sending this early before cleaning up the code hoping to get some
> feedback in case there are better ways to structure this.
> 
> The tinydrm module provides a very simplified view of DRM for displays that
> has onboard video memory and is connected through a slow bus like SPI/I2C.
> A driver using tinydrm has to provide a function that will be called from
> the dirtyfb ioctl and optionally drm_panel functions which can be used to
> set up the display controller and control backlight.
> 
> tinydrm also has fbdev support using fb_deferred_io which is tied in through
> the dirtyfb function call. A driver can use the provided deferred work code
> to collect dirtyfb calls and schedule display memory updates if it whishes.
> The various display controllers can have library modules that handles
> display updates.

fbdev fb_deferred_io should be part of the fbdev helper, not a separate
library. We already have hand-rolled fbdev deferred io in qxl, i915 & udl,
no need to invent yet another one. Well the one in i915 is a bit a hack.

I think the best option would be to extract the code from qxl (since it
already uses a work automatically if needed) and put it into drm_fb_helper.c.
Otherwise the layering goes bust. We already have drm_fb_helper_* hooks
for everything, so only thing to do in drivers is to remove lots of code
\o/

I haven't looked at any of the other parts, just a quick comment on this
part here.
-Daniel

> Display controllers that have a similar register interface as the MIPI DBI/DCS
> controllers can use the lcdreg module for register access.
> 
> struct tinydrm_device {
> 	struct drm_device *base;
> 	u32 width, height;
> 	struct drm_panel panel;
> [...]
> 	int (*dirtyfb)(struct drm_framebuffer *fb, void *vmem, unsigned flags,
> 		       unsigned color, struct drm_clip_rect *clips,
> 		       unsigned num_clips);
> };
> 
> +------------------------------+---------+
> |                              |  fbdev  |
> |                  DRM         +------+  |
> |                                     |  |
> +-------------------------------------+--+
> |                                        |
> |                tinydrm                 |
> |                                        |
> +------------------+ .  .  .  .  .  .  . |
> |                  |    deferred work    |
> |  Display driver  +---------------------+
> |                  |  Controller module  |
> +------------------+---------------------+
> |                 lcdreg                 |
> +----------------------------------------+
> |     Interface (SPI, I2C, parallel)     |
> +----------------------------------------+
> 
> 
> Noralf Trønnes (5):
>   drm: Add DRM support for tiny LCD displays
>   drm/tinydrm: Add lcd register abstraction
>   drm/tinydrm/lcdreg: Add SPI support
>   drm/tinydrm: Add mipi-dbi support
>   drm/tinydrm: Add support for several Adafruit TFT displays
> 
>  drivers/gpu/drm/Kconfig                            |   2 +
>  drivers/gpu/drm/Makefile                           |   1 +
>  drivers/gpu/drm/tinydrm/Kconfig                    |  27 +
>  drivers/gpu/drm/tinydrm/Makefile                   |   8 +
>  drivers/gpu/drm/tinydrm/adafruit-tft.c             | 256 ++++++++
>  drivers/gpu/drm/tinydrm/core/Makefile              |   8 +
>  drivers/gpu/drm/tinydrm/core/internal.h            |  43 ++
>  drivers/gpu/drm/tinydrm/core/tinydrm-core.c        | 194 ++++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-crtc.c        | 203 ++++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-deferred.c    | 116 ++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-fbdev.c       | 345 ++++++++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-framebuffer.c | 112 ++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c     |  97 +++
>  drivers/gpu/drm/tinydrm/core/tinydrm-plane.c       |  50 ++
>  drivers/gpu/drm/tinydrm/lcdreg/Kconfig             |   8 +
>  drivers/gpu/drm/tinydrm/lcdreg/Makefile            |   5 +
>  drivers/gpu/drm/tinydrm/lcdreg/internal.h          |   8 +
>  drivers/gpu/drm/tinydrm/lcdreg/lcdreg-core.c       | 190 ++++++
>  drivers/gpu/drm/tinydrm/lcdreg/lcdreg-debugfs.c    | 281 ++++++++
>  drivers/gpu/drm/tinydrm/lcdreg/lcdreg-spi.c        | 720 +++++++++++++++++++++
>  drivers/gpu/drm/tinydrm/mipi-dbi.c                 | 231 +++++++
>  include/drm/tinydrm/ili9340.h                      |  85 +++
>  include/drm/tinydrm/lcdreg-spi.h                   |  63 ++
>  include/drm/tinydrm/lcdreg.h                       | 126 ++++
>  include/drm/tinydrm/mipi-dbi.h                     |  24 +
>  include/drm/tinydrm/tinydrm.h                      | 142 ++++
>  26 files changed, 3345 insertions(+)
>  create mode 100644 drivers/gpu/drm/tinydrm/Kconfig
>  create mode 100644 drivers/gpu/drm/tinydrm/Makefile
>  create mode 100644 drivers/gpu/drm/tinydrm/adafruit-tft.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/Makefile
>  create mode 100644 drivers/gpu/drm/tinydrm/core/internal.h
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-core.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-crtc.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-deferred.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-fbdev.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-framebuffer.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-plane.c
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/Kconfig
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/Makefile
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/internal.h
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/lcdreg-core.c
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/lcdreg-debugfs.c
>  create mode 100644 drivers/gpu/drm/tinydrm/lcdreg/lcdreg-spi.c
>  create mode 100644 drivers/gpu/drm/tinydrm/mipi-dbi.c
>  create mode 100644 include/drm/tinydrm/ili9340.h
>  create mode 100644 include/drm/tinydrm/lcdreg-spi.h
>  create mode 100644 include/drm/tinydrm/lcdreg.h
>  create mode 100644 include/drm/tinydrm/mipi-dbi.h
>  create mode 100644 include/drm/tinydrm/tinydrm.h
> 
> --
> 2.2.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux