linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Sebastian Götte" <linux@jaseg.net>
To: dri-devel@lists.freedesktop.org
Cc: "Noralf Trønnes" <noralf@tronnes.org>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/6] tiny: Add driver for gooddisplay epaper panels
Date: Tue, 30 Jul 2019 22:46:21 +0900	[thread overview]
Message-ID: <3c8fccc9-63f7-18bb-dcb5-dcd0b9e151d2@jaseg.net> (raw)

Hi,

I've been working on a tinydrm-based driver for black/white/red, b/w/yellow and b/w epaper displays made by good display[sic!][0]. These panels are fairly popular since waveshare[1] sells raspberry pi and arduino-compatible breakout boards with them.

The current state of the art in open source software as well as the vendors examples on how to drive these seems to be "pour some fairy dust into /dev/mem". This cannot stand, so here is a (tested, working) tinydrm driver. I've got working color output on two black/white/red panels (2.7" and 4.2") from python[2], and I have a kernel console showing up[3,4] and I can print colorful cows using cowsay and some ANSI escape sequences[5].

In this rfc patch I've added a couple ioctls to allow userspace to control refresh behavior. IMO this is necessary for a fully working driver: These displays support partial refresh, and you can use that to do proper animations[6]. But for this to work, you need to fine-tune the display's driving waveforms depending on the content displayed.

I have a couple of questions regarding this driver, thus the RFC:
(1) By default, when loading the module a vt console binds to the fb. I think this is useful, but the cursor blink of the vt leads to an eternal refresh loop. Refresh on these displays is *extremely* slow (1 frame per 15s), so ideally I'd want the cursor to not blink. Is there some nice way to tell the vt/console driver to do this by default?
(2) Is ioctl the correct interface for the driving waveform/refresh stuff?
(3) I read that any drm driver has to be committed along with a libdrm implementation. I think the most likely interface for anyone to interact with this driver would be the fb dev. Do I have to make some userspace implementation as well anyway? If so, where would that go: libdrm or some sort of new libepaper?
(4) The driver accepts both XRGB8888 and RGB565 (for compatibility with small LCDs). The driver's current approach to calculate a b/w/r "ternary" image from this data is to just take the MSBs of each color component, then make anything red (R>127, G,B<=127) red, anything black (R,G,B each <=127) black and anything else white. This is since the display's default state is white, and a pixel can turn either red or black from that. Note that it's the actual pixel changing color, i.e. there is no black and red sub-pixels. If you try to drive black and red at the same time, the chip just selects red for that pixel. What are your thoughts on this interface? I was thinking about using some indexed color mode, but that would limit possible future grayscale support[7].

The following patches all apply on v5.2. This is my first linux driver, so please be gentle but please do point out all my mistakes :) I'm aware the dt binding doc is still lacking.

Best regards,
Jan Sebastian Götte

[0] https://www.good-display.com/
[1] https://www.waveshare.com/product/modules/oleds-lcds/e-paper.htm
[2] https://blog.jaseg.net/images/epaper3.jpg
[3] https://blog.jaseg.net/images/epaper1.jpg
[4] https://blog.jaseg.net/images/epaper2.jpg
[5] https://blog.jaseg.net/images/epaper4.jpg
[6] https://www.youtube.com/watch?v=MsbiO8EAsGw
[7] https://github.com/zkarcher/FancyEPD

             reply	other threads:[~2019-07-30 13:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 13:46 Jan Sebastian Götte [this message]
2019-07-30 13:47 ` [PATCH 1/6] drm: tiny: gdepaper: add TINYDRM_GDEPAPER config option Jan Sebastian Götte
2019-07-30 13:48 ` [PATCH 2/6] dt-bindings: add gooddisplay vendor prefix Jan Sebastian Götte
2019-07-30 13:48 ` [PATCH 3/6] dt-bindings: add good display epaper header Jan Sebastian Götte
2019-07-30 13:48 ` [PATCH 4/6] dt-bindings: add gdepaper documentation Jan Sebastian Götte
2019-07-30 13:48 ` [PATCH 5/6] drm: uapi: add gdepaper uapi header Jan Sebastian Götte
2019-07-30 14:08   ` Emil Velikov
2019-07-30 16:21     ` Jan Sebastian Götte
2019-07-30 16:49       ` Emil Velikov
2019-07-31  2:01         ` Jan Sebastian Götte
2019-07-31  6:47           ` Daniel Vetter
2019-07-30 13:48 ` [PATCH 6/6] drm: tiny: gdepaper: add driver for 2/3 color epaper displays Jan Sebastian Götte
2019-08-06 16:06   ` Noralf Trønnes
2019-08-10  5:17     ` Jan Sebastian Götte
2019-07-30 14:26 ` [RFC PATCH 0/6] tiny: Add driver for gooddisplay epaper panels Daniel Vetter
2019-07-30 16:24   ` Jan Sebastian Götte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c8fccc9-63f7-18bb-dcb5-dcd0b9e151d2@jaseg.net \
    --to=linux@jaseg.net \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).