dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory
@ 2022-04-11  0:47 Marek Vasut
  2022-04-11  0:47 ` [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marek Vasut @ 2022-04-11  0:47 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, Christoph Niedermaier, Daniel Vetter, robert.foss,
	Rob Herring, Noralf Trønnes, Laurent Pinchart,
	Thomas Zimmermann, Dmitry Osipenko, Sam Ravnborg

All users of this function require width-mm/height-mm DT property to be
present per their DT bindings, make width-mm/height-mm check mandatory.
It is generally a good idea to specify panel dimensions, so userspace
can configure e.g. scaling accordingly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
To: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_modes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 6e7e10f16ec03..f0b000ddaddb5 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -735,8 +735,8 @@ EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
  * @dmode: will be set to the return value
  * @bus_flags: information about pixelclk, sync and DE polarity
  *
- * The Device Tree properties width-mm and height-mm will be read and set on
- * the display mode if they are present.
+ * The mandatory Device Tree properties width-mm and height-mm
+ * are read and set on the display mode.
  *
  * Returns:
  * Zero on success, negative error code on failure.
@@ -761,11 +761,11 @@ int of_get_drm_panel_display_mode(struct device_node *np,
 		drm_bus_flags_from_videomode(&vm, bus_flags);
 
 	ret = of_property_read_u32(np, "width-mm", &width_mm);
-	if (ret && ret != -EINVAL)
+	if (ret)
 		return ret;
 
 	ret = of_property_read_u32(np, "height-mm", &height_mm);
-	if (ret && ret != -EINVAL)
+	if (ret)
 		return ret;
 
 	dmode->width_mm = width_mm;
-- 
2.35.1


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

* [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check
  2022-04-11  0:47 [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Marek Vasut
@ 2022-04-11  0:47 ` Marek Vasut
  2022-04-11 16:42   ` Noralf Trønnes
  2022-04-11 16:41 ` [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Noralf Trønnes
  2022-04-21 21:15 ` Marek Vasut
  2 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2022-04-11  0:47 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, Christoph Niedermaier, Daniel Vetter, robert.foss,
	Rob Herring, Noralf Trønnes, Laurent Pinchart,
	Thomas Zimmermann, Dmitry Osipenko, Sam Ravnborg

The check for mandatory DT properties width-mm and height-mm is now
part of of_get_drm_panel_display_mode(), drop the redundant check
from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
To: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/panel/panel-lvds.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index eca067e785796..f11252fb00fea 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -128,18 +128,6 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 		return ret;
 	}
 
-	if (lvds->dmode.width_mm == 0) {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "width-mm");
-		return -ENODEV;
-	}
-
-	if (lvds->dmode.height_mm == 0) {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "height-mm");
-		return -ENODEV;
-	}
-
 	of_property_read_string(np, "label", &lvds->label);
 
 	ret = drm_of_lvds_get_data_mapping(np);
-- 
2.35.1


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

* Re: [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory
  2022-04-11  0:47 [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Marek Vasut
  2022-04-11  0:47 ` [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check Marek Vasut
@ 2022-04-11 16:41 ` Noralf Trønnes
  2022-04-21 21:15 ` Marek Vasut
  2 siblings, 0 replies; 5+ messages in thread
From: Noralf Trønnes @ 2022-04-11 16:41 UTC (permalink / raw)
  To: Marek Vasut, dri-devel
  Cc: Christoph Niedermaier, Daniel Vetter, robert.foss, Rob Herring,
	Laurent Pinchart, Thomas Zimmermann, Dmitry Osipenko,
	Sam Ravnborg



Den 11.04.2022 02.47, skrev Marek Vasut:
> All users of this function require width-mm/height-mm DT property to be
> present per their DT bindings, make width-mm/height-mm check mandatory.
> It is generally a good idea to specify panel dimensions, so userspace
> can configure e.g. scaling accordingly.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dmitry Osipenko <digetx@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> To: dri-devel@lists.freedesktop.org
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

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

* Re: [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check
  2022-04-11  0:47 ` [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check Marek Vasut
@ 2022-04-11 16:42   ` Noralf Trønnes
  0 siblings, 0 replies; 5+ messages in thread
From: Noralf Trønnes @ 2022-04-11 16:42 UTC (permalink / raw)
  To: Marek Vasut, dri-devel
  Cc: Christoph Niedermaier, Daniel Vetter, robert.foss, Rob Herring,
	Laurent Pinchart, Thomas Zimmermann, Dmitry Osipenko,
	Sam Ravnborg



Den 11.04.2022 02.47, skrev Marek Vasut:
> The check for mandatory DT properties width-mm and height-mm is now
> part of of_get_drm_panel_display_mode(), drop the redundant check
> from this driver.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dmitry Osipenko <digetx@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> To: dri-devel@lists.freedesktop.org
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

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

* Re: [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory
  2022-04-11  0:47 [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Marek Vasut
  2022-04-11  0:47 ` [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check Marek Vasut
  2022-04-11 16:41 ` [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Noralf Trønnes
@ 2022-04-21 21:15 ` Marek Vasut
  2 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2022-04-21 21:15 UTC (permalink / raw)
  To: dri-devel
  Cc: Christoph Niedermaier, Daniel Vetter, robert.foss, Rob Herring,
	Noralf Trønnes, Laurent Pinchart, Thomas Zimmermann,
	Dmitry Osipenko, Sam Ravnborg

On 4/11/22 02:47, Marek Vasut wrote:
> All users of this function require width-mm/height-mm DT property to be
> present per their DT bindings, make width-mm/height-mm check mandatory.
> It is generally a good idea to specify panel dimensions, so userspace
> can configure e.g. scaling accordingly.

I will apply these two patches soon.

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

end of thread, other threads:[~2022-04-21 21:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  0:47 [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Marek Vasut
2022-04-11  0:47 ` [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check Marek Vasut
2022-04-11 16:42   ` Noralf Trønnes
2022-04-11 16:41 ` [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Noralf Trønnes
2022-04-21 21:15 ` Marek Vasut

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).