All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: devicetree@vger.kernel.org, david@lechnology.com,
	dave.stevenson@raspberrypi.com, dri-devel@lists.freedesktop.org,
	robh+dt@kernel.org, thierry.reding@gmail.com, maxime@cerno.tech
Subject: Re: [PATCH v4 3/3] drm/tiny: Add MIPI DBI compatible SPI driver
Date: Sun, 20 Feb 2022 11:04:42 +0100	[thread overview]
Message-ID: <YhISOrwTYsn2w6zo@ravnborg.org> (raw)
In-Reply-To: <YhFqxklH9hsLrI1X@ravnborg.org>

Hi Noralf,

> > +static int panel_mipi_dbi_get_mode(struct mipi_dbi_dev *dbidev, struct drm_display_mode *mode)
> > +{
> > +	struct device *dev = dbidev->drm.dev;
> > +	u32 width_mm = 0, height_mm = 0;
> > +	struct display_timing timing;
> > +	struct videomode vm;
> > +	int ret;
> > +
> > +	ret = of_get_display_timing(dev->of_node, "panel-timing", &timing);
> > +	if (ret) {
> > +		dev_err(dev, "%pOF: failed to get panel-timing (error=%d)\n", dev->of_node, ret);
> > +		return ret;
> > +	}
> > +
> > +	videomode_from_timing(&timing, &vm);
> > +
> > +	if (!vm.hactive || vm.hfront_porch || vm.hsync_len ||
> > +	    (vm.hback_porch + vm.hactive) > 0xffff ||
> > +	    !vm.vactive || vm.vfront_porch || vm.vsync_len ||
> > +	    (vm.vback_porch + vm.vactive) > 0xffff ||
> > +	    vm.flags) {
> > +		dev_err(dev, "%pOF: panel-timing out of bounds\n", dev->of_node);
> > +		return -EINVAL;
> > +	}
> We should have a helper that implements this. Maybe the display_timing
> => display_mode helper could do it.

It would be nice with a drm_display_timing_to_mode() but that can come
later - the comment above should not be understood that I consider it
mandatory for this driver.

	Sam

  reply	other threads:[~2022-02-20 10:04 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 15:11 [PATCH v4 0/3] drm/tiny: Add MIPI DBI compatible SPI driver Noralf Trønnes
2022-02-18 15:11 ` Noralf Trønnes
2022-02-18 15:11 ` [PATCH v4 1/3] dt-bindings: display: add bindings for MIPI DBI compatible SPI panels Noralf Trønnes
2022-02-18 15:11   ` Noralf Trønnes
2022-02-19 15:25   ` Sam Ravnborg
2022-02-19 15:25     ` Sam Ravnborg
2022-02-21  2:36   ` Rob Herring
2022-02-21  2:36     ` Rob Herring
2022-02-21 11:31   ` Noralf Trønnes
2022-02-21 11:31     ` Noralf Trønnes
2022-02-22 17:26     ` Rob Herring
2022-02-22 17:26       ` Rob Herring
2022-02-18 15:11 ` [PATCH v4 2/3] drm/mipi-dbi: Add driver_private member to struct mipi_dbi_dev Noralf Trønnes
2022-02-18 15:11   ` Noralf Trønnes
2022-02-19 15:25   ` Sam Ravnborg
2022-02-19 15:25     ` Sam Ravnborg
2022-02-18 15:11 ` [PATCH v4 3/3] drm/tiny: Add MIPI DBI compatible SPI driver Noralf Trønnes
2022-02-18 15:11   ` Noralf Trønnes
2022-02-19 22:10   ` Sam Ravnborg
2022-02-19 22:10     ` Sam Ravnborg
2022-02-20 10:04     ` Sam Ravnborg [this message]
2022-02-20 14:19       ` Noralf Trønnes
2022-02-20 18:11         ` Noralf Trønnes
2022-02-20 18:11           ` Noralf Trønnes
2022-02-20 19:57           ` Sam Ravnborg
2022-02-20 19:57             ` Sam Ravnborg
2022-02-20 20:34             ` Noralf Trønnes
2022-02-20 20:34               ` Noralf Trønnes
2022-02-20 21:30               ` Sam Ravnborg
2022-02-20 21:30                 ` Sam Ravnborg
2022-02-20 15:59     ` Noralf Trønnes
2022-02-20 15:59       ` Noralf Trønnes
2022-02-20 21:32       ` Sam Ravnborg
2022-02-20 21:32         ` Sam Ravnborg
2022-02-21  9:05         ` Maxime Ripard
2022-02-21  9:05           ` Maxime Ripard

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=YhISOrwTYsn2w6zo@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=david@lechnology.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime@cerno.tech \
    --cc=noralf@tronnes.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.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 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.