public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	thomas.petazzoni@free-electrons.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/7] drm: Add DRM support for tiny LCD displays
Date: Mon, 6 Feb 2017 10:17:43 +0100	[thread overview]
Message-ID: <20170206091743.GE27607@ulmo.ba.sec> (raw)
In-Reply-To: <20170131160319.9695-2-noralf@tronnes.org>

[-- Attachment #1: Type: text/plain, Size: 3336 bytes --]

On Tue, Jan 31, 2017 at 05:03:13PM +0100, Noralf Trønnes wrote:
> tinydrm provides helpers for very simple displays that can use
> CMA backed framebuffers and need flushing on changes.
> 
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> 
> Changes since version 2:
> - Remove fbdev after drm unregister, not before.
> 
> Changes since version 1:
> - Add tinydrm.rst
> - Set tdev->fbdev_cma=NULL on unregister (lastclose is called after that).
> - Remove some DRM_DEBUG*()
> 
>  Documentation/gpu/index.rst                 |   1 +
>  Documentation/gpu/tinydrm.rst               |  21 ++
>  drivers/gpu/drm/Kconfig                     |   2 +
>  drivers/gpu/drm/Makefile                    |   1 +
>  drivers/gpu/drm/tinydrm/Kconfig             |   8 +
>  drivers/gpu/drm/tinydrm/Makefile            |   1 +
>  drivers/gpu/drm/tinydrm/core/Makefile       |   3 +
>  drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 377 ++++++++++++++++++++++++++++
>  drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 234 +++++++++++++++++
>  include/drm/tinydrm/tinydrm.h               | 115 +++++++++
>  10 files changed, 763 insertions(+)
>  create mode 100644 Documentation/gpu/tinydrm.rst
>  create mode 100644 drivers/gpu/drm/tinydrm/Kconfig
>  create mode 100644 drivers/gpu/drm/tinydrm/Makefile
>  create mode 100644 drivers/gpu/drm/tinydrm/core/Makefile
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-core.c
>  create mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
>  create mode 100644 include/drm/tinydrm/tinydrm.h

I realize this is totally subjective, but this feels somewhat too much
of a separation. Given the helper nature of TinyDRM, I think it would be
more appropriate to move the helpers themselves into drm_tiny.[ch] and
then maybe add a subdirectory drivers/gpu/drm/tiny that contains all the
drivers that use the helpers.

The separation above further shows in subsequent patches where helpers
are added to tinydrm that aren't specific to TinyDRM. So this make the
new helpers appear as more of a subsystem in DRM rather than a helper
library. It also makes things somewhat inconsistent with existing
infrastructure.

[...]
> +static int tinydrm_register(struct tinydrm_device *tdev)
> +{
> +	struct drm_device *drm = tdev->drm;
> +	int bpp = drm->mode_config.preferred_depth;
> +	struct drm_fbdev_cma *fbdev;
> +	int ret;
> +
> +	ret = drm_dev_register(tdev->drm, 0);
> +	if (ret)
> +		return ret;
> +
> +	fbdev = drm_fbdev_cma_init_with_funcs(drm, bpp ? bpp : 32,

Does this make sense? The helpers and the driver later in this series
suggest that these panels will usually be 16-bit. Wouldn't that be a
more sensible default?

> +static enum drm_connector_status
> +tinydrm_connector_detect(struct drm_connector *connector, bool force)
> +{
> +	if (drm_device_is_unplugged(connector->dev))
> +		return connector_status_disconnected;

Is this really what you wanted? drm_device_is_unplugged() returns true
if the device is in the process of being removed. It only really makes
sense if you also call drm_device_is_unplugged() somewhere in the
driver, usually via drm_unplug_dev(), but I don't see that in the code
which means this will always return false anyway.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-02-06  9:17 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 16:03 [PATCH v3 0/7] drm: Add support for tiny LCD displays Noralf Trønnes
2017-01-31 16:03 ` [PATCH v3 1/7] drm: Add DRM " Noralf Trønnes
2017-01-31 16:23   ` Daniel Vetter
2017-01-31 18:01     ` Noralf Trønnes
2017-01-31 20:10       ` Daniel Vetter
2017-02-06  9:17   ` Thierry Reding [this message]
2017-02-06 19:23     ` Noralf Trønnes
2017-02-07  6:58       ` Daniel Vetter
2017-02-07 11:48         ` Thierry Reding
2017-02-06 10:12   ` Jani Nikula
2017-01-31 16:03 ` [PATCH v3 2/7] drm/tinydrm: Add helper functions Noralf Trønnes
2017-02-06  8:56   ` Thierry Reding
2017-02-06  9:09     ` Daniel Vetter
2017-02-06  9:35       ` Thierry Reding
     [not found]         ` <CAKMK7uHgW15EPpPSU2se7r89JCGD_oTvn9ZJptYaNJAWMKb9Fg@mail.gmail.com>
2017-02-06 11:08           ` Thierry Reding
2017-02-06 15:53             ` Daniel Vetter
2017-02-06 22:11               ` Noralf Trønnes
2017-02-07 11:38                 ` Thierry Reding
2017-02-06 22:28               ` Dave Airlie
2017-02-07  7:00                 ` Daniel Vetter
2017-02-07 11:11                 ` Thierry Reding
2017-02-07 11:21                   ` Daniel Vetter
2017-02-07 11:44                     ` Thierry Reding
2017-02-07 13:23                       ` Daniel Vetter
2017-02-06 22:55             ` Rob Herring
2017-02-07  7:08               ` Daniel Vetter
2017-02-06 10:10   ` Jani Nikula
2017-01-31 16:03 ` [PATCH v3 3/7] drm/tinydrm: Add MIPI DBI support Noralf Trønnes
2017-02-06  8:48   ` Thierry Reding
2017-02-06 11:30     ` Jani Nikula
2017-02-06 11:53       ` Thierry Reding
2017-02-06 12:34         ` Andrzej Hajda
2017-02-06 15:45           ` Noralf Trønnes
2017-02-06 11:25   ` Jani Nikula
2017-01-31 16:03 ` [PATCH v3 4/7] of: Add vendor prefix for Multi-Inno Noralf Trønnes
2017-01-31 16:03 ` [PATCH v3 5/7] dt-bindings: display: Add common rotation property Noralf Trønnes
2017-02-01 17:41   ` Rob Herring
2017-02-03 12:16     ` Noralf Trønnes
2017-02-06  7:10       ` Thierry Reding
2017-01-31 16:03 ` [PATCH v3 6/7] dt-bindings: Add Multi-Inno MI0283QT binding Noralf Trønnes
2017-02-01 17:42   ` Rob Herring
2017-01-31 16:03 ` [PATCH v3 7/7] drm/tinydrm: Add support for Multi-Inno MI0283QT display Noralf Trønnes
2017-02-06  8:25   ` Thierry Reding
2017-02-07 12:00 ` [PATCH v3 0/7] drm: Add support for tiny LCD displays Thierry Reding

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=20170206091743.GE27607@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /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