All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/tinydrm: Add tinydrm_panel abstraction
@ 2017-03-11 21:35 Noralf Trønnes
  2017-03-11 21:35 ` [PATCH 1/5] drm/tinydrm: Add tinydrm_rgb565_buf_copy() Noralf Trønnes
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Noralf Trønnes @ 2017-03-11 21:35 UTC (permalink / raw)
  To: dri-devel; +Cc: treding

Add support for displays that have a register interface and can be
operated using a simple vtable.

I have looked through the staging/fbtft drivers and it seems that,
except the MIPI controllers, most if not all controllers are operated
through a register. And since most controllers have more than one bus
interface option, regmap seems like a good choice to describe the
interface (tested[1,2]).
MIPI DCS can't be represented using regmap since some commands doesn't
have a parameter. That would be like a register without a value, which
doesn't make sense.

In my second RFC of tinydrm I used drm_panel to decribe the panels
since it was a good match to the fbtft displays. I was then told that
drm_panel wasn't supposed to used like that, so I dropped it and have
tried to use the drm_simple_display_pipe_funcs vtable directly. This
hasn't been all successful, since I ended up using devm_add_action() to
power down the controller at the right time. Thierry Reding wasn't
happy with this and suggested "to add an explicit callback somewhere".
My solution has been to copy the drm_panel_funcs vtable.
Since I now have a vtable, I also added a callback to flush the
framebuffer. So presumably all the fbtft drivers can now be operated
through the tinydrm_panel_funcs vtable.


After having done this the question arises:
Why not extend tinydrm_device instead of subclassing it?

The benefit of subclassing is that it keeps the door open for drivers
that can use tinydrm_device, but not tinydrm_panel. But I don't know of
such a driver now, then again who knows what the future brings.
Something that might or might not happen isn't a good reason, so it
seems that I want it this way because I just like it. And it's easy to
merge the two should it be that no one uses tinydrm_device directly
three years down the line. But I'm actually not sure what's best.

To recap:

tinydrm_device
- Combines drm_simple_display_pipe with CMA backed framebuffer and fbdev.
- Optional pipe setup with a connector with one mode, but the driver
  can do it's own.

tinydrm_panel
- All drm operations are distilled down to tinydrm_panel_funcs.
- Some common driver properties


Noralf.

[1] https://github.com/notro/tinydrm/blob/master/tinydrm-ili9325.c
[2] https://github.com/notro/tinydrm/blob/master/fb_ili9325.c


Noralf Trønnes (5):
  drm/tinydrm: Add tinydrm_rgb565_buf_copy()
  drm/tinydrm: Add tinydrm_panel abstraction
  drm/tinydrm/mipi-dbi: Start conversion to tinydrm_panel
  drm/tinydrm/mi0283qt: Use tinydrm_panel
  drm/tinydrm/mipi-dbi: Clean up after tinydrm_panel conversion

 Documentation/gpu/tinydrm.rst                  |  12 +
 drivers/gpu/drm/tinydrm/Kconfig                |   1 +
 drivers/gpu/drm/tinydrm/core/Makefile          |   2 +-
 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |  56 ++-
 drivers/gpu/drm/tinydrm/core/tinydrm-panel.c   | 532 +++++++++++++++++++++++++
 drivers/gpu/drm/tinydrm/mi0283qt.c             | 113 ++----
 drivers/gpu/drm/tinydrm/mipi-dbi.c             | 246 ++++--------
 include/drm/tinydrm/mipi-dbi.h                 |  35 +-
 include/drm/tinydrm/tinydrm-helpers.h          |   2 +
 include/drm/tinydrm/tinydrm-panel.h            | 153 +++++++
 10 files changed, 867 insertions(+), 285 deletions(-)
 create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-panel.c
 create mode 100644 include/drm/tinydrm/tinydrm-panel.h

--
2.10.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-03-16  6:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-11 21:35 [PATCH 0/5] drm/tinydrm: Add tinydrm_panel abstraction Noralf Trønnes
2017-03-11 21:35 ` [PATCH 1/5] drm/tinydrm: Add tinydrm_rgb565_buf_copy() Noralf Trønnes
2017-03-12 18:00   ` Daniel Vetter
2017-03-13 12:30     ` Noralf Trønnes
2017-03-14  7:17       ` Daniel Vetter
2017-03-15 12:15         ` Noralf Trønnes
2017-03-15 12:39           ` Daniel Vetter
2017-03-15 15:14             ` Noralf Trønnes
2017-03-15 16:38               ` Daniel Vetter
2017-03-16  6:48               ` Michel Dänzer
2017-03-11 21:35 ` [PATCH 2/5] drm/tinydrm: Add tinydrm_panel abstraction Noralf Trønnes
2017-03-11 21:35 ` [PATCH 3/5] drm/tinydrm/mipi-dbi: Start conversion to tinydrm_panel Noralf Trønnes
2017-03-11 21:35 ` [PATCH 4/5] drm/tinydrm/mi0283qt: Use tinydrm_panel Noralf Trønnes
2017-03-11 21:35 ` [PATCH 5/5] drm/tinydrm/mipi-dbi: Clean up after tinydrm_panel conversion Noralf Trønnes
2017-03-12 17:50 ` [PATCH 0/5] drm/tinydrm: Add tinydrm_panel abstraction Daniel Vetter
2017-03-12 18:55   ` Daniel Vetter
2017-03-13 12:20     ` Noralf Trønnes
2017-03-12 19:16   ` Daniel Vetter
2017-03-12 20:17     ` Noralf Trønnes
2017-03-12 20:40       ` Daniel Vetter
2017-03-13 15:12         ` Noralf Trønnes
2017-03-14  7:24           ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.