From patchwork Fri Apr 1 16:37:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12798497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D287EC433EF for ; Fri, 1 Apr 2022 16:38:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 814F010E1A4; Fri, 1 Apr 2022 16:38:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id C571A10E152 for ; Fri, 1 Apr 2022 16:38:19 +0000 (UTC) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 28DC384042; Fri, 1 Apr 2022 18:38:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1648831098; bh=681/ecAfuGyug/aKomT5gTVBLC3jqCPuH5Xv9vjRARY=; h=From:To:Cc:Subject:Date:From; b=ajUimAb5nrq0PXOK+abU7Q0HPvmGiJfxe5v5zjUTIKJnaW6daJq5zbDrBoPwEKAaR Eyt9H0Xm/9i3z/QDIIMDuqIH5L+gCCFoctXWJ4OdPgv+HKa/5Gc8F5rkG6vi9zVo8A +v46Cq+YE0fTT/SemFmnR2zOiYc4Xo66lmlrlrJCd0PgLb48TfdvdzFmBrfYHLpTZr pFLUikor/GouKzqdhS715+I+YemFAscsSn0k3f4lgzMd5kZX8us0DbV4cdBzNAKFPq TmCa0Eki2kcAaV+bGSJclTNFljNXdHngeeT3qiKzeg2nIIVnFoLv02oRVCr/7xt+/k hpbF9RtbrTqkw== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 1/3] dt-bindings: display: panel: mipi-dbi-spi: Make width-mm/height-mm mandatory Date: Fri, 1 Apr 2022 18:37:53 +0200 Message-Id: <20220401163755.302548-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Christoph Niedermaier , devicetree@vger.kernel.org, Daniel Vetter , robert.foss@linaro.org, Rob Herring , =?utf-8?q?Noralf_?= =?utf-8?q?Tr=C3=B8nnes?= , Laurent Pinchart , Thomas Zimmermann , Dmitry Osipenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Make the width-mm/height-mm panel properties mandatory to correctly report the panel dimensions to the OS. Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org --- .../devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml index f29789994b18..c2df8d28aaf5 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml @@ -83,6 +83,8 @@ properties: required: - compatible - reg + - width-mm + - height-mm - panel-timing unevaluatedProperties: false From patchwork Fri Apr 1 16:37:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12798496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E98EC433F5 for ; Fri, 1 Apr 2022 16:38:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F2E210E152; Fri, 1 Apr 2022 16:38:21 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4AB2A10E152 for ; Fri, 1 Apr 2022 16:38:20 +0000 (UTC) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 989C88414B; Fri, 1 Apr 2022 18:38:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1648831098; bh=MqxLzsbMhRw9VjH2aYnLwjjRt41X1WJA5IIkQnIaeKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MRTAu0ehn49Ah/srAbqEGWF0V52tcURfrzeRil1k5jXJokxNHQY8lUbIdcNJ52LOO ue3HStxqHJQKE9uy+DBd6msi0njZt21mpeVlTSwTUSv8ei7VRr6oz51sfDAkcedSIl kskXcdrA9gHhh4cxugzeHfbdPom49G9XISOwTYJPdch8LcUY3DEsbgKqU0UtVY4nWd 0+FPDx1KZmIV9MrCv3nPnD+XKFJacIT8P26B1v8nhyoH/wnEovem9GQqixbSP2Hh6G npVC1KCXsG/kj/u1I7Qtz3tCzVnadVZMcz90HFED9/K6RH+8GFhn35SfGMe/arEyUQ hsif/MbF5wvog== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 2/3] drm/modes: Make width-mm/height-mm mandatory in of_get_drm_panel_display_mode() Date: Fri, 1 Apr 2022 18:37:54 +0200 Message-Id: <20220401163755.302548-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220401163755.302548-1-marex@denx.de> References: <20220401163755.302548-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Christoph Niedermaier , devicetree@vger.kernel.org, Daniel Vetter , robert.foss@linaro.org, Rob Herring , =?utf-8?q?Noralf_?= =?utf-8?q?Tr=C3=B8nnes?= , Laurent Pinchart , Thomas Zimmermann , Dmitry Osipenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Make the width-mm/height-mm panel properties mandatory in of_get_drm_panel_display_mode(), print error message and return -ve in case these DT properties are not present. This is needed to correctly report panel dimensions. Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_modes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 3f819c7a021b..45dc2d5c3ea6 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -761,12 +761,16 @@ 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 < 0) { + pr_err("%pOF: invalid or missing width-mm DT property\n", np); return ret; + } ret = of_property_read_u32(np, "height-mm", &height_mm); - if (ret && ret != -EINVAL) + if (ret < 0) { + pr_err("%pOF: invalid or missing height-mm DT property\n", np); return ret; + } dmode->width_mm = width_mm; dmode->height_mm = height_mm; From patchwork Fri Apr 1 16:37:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12798498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2623C433EF for ; Fri, 1 Apr 2022 16:38:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C02B010E1E2; Fri, 1 Apr 2022 16:38:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id C07BB10E152 for ; Fri, 1 Apr 2022 16:38:20 +0000 (UTC) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 03F6884198; Fri, 1 Apr 2022 18:38:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1648831099; bh=ryF4sSVCN4xDNmiRgk+WutxWax/YEB5T15DxI47nwGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=auJ9GjOXNWyM7OFfoXoByaVt3XKjCAG2ErK0xvIOPkKtpUenMh6ANTlJagu1decMf Hkp5yl3nr4ZsF2TTTUbbYE+9UFrc82Y6qbnfWw7qcOVJ5QmbY6Tuw+ndOXp9pWjF2A VMnFx8DI3DOmDtVRK5aj4DxCEsYDlKYHytA3I3cbN9JoL4ZxuQh9W2jbL2SSBhjlUu 3SVm5gGgWXtscTvnCnthI7sRKi2KSu4kPJIvheXK9hcjjgXihdg9NJTNP4VFU7TB7r R3AHyZyXnPMLx+lxie4JnLjAaAZbju4vg+yy+wYILJ7VIaF5pFE8UUXoLn8dkXs6Pb bnLJrKaWPb7NQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 3/3] drm/panel: lvds: Drop duplicate width-mm/height-mm check Date: Fri, 1 Apr 2022 18:37:55 +0200 Message-Id: <20220401163755.302548-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220401163755.302548-1-marex@denx.de> References: <20220401163755.302548-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Christoph Niedermaier , devicetree@vger.kernel.org, Daniel Vetter , robert.foss@linaro.org, Rob Herring , =?utf-8?q?Noralf_?= =?utf-8?q?Tr=C3=B8nnes?= , Laurent Pinchart , Thomas Zimmermann , Dmitry Osipenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The of_get_drm_panel_display_mode() now does check for presence of width-mm/height-mm DT properties, drop the duplicate check here. Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart --- 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 eca067e78579..f11252fb00fe 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);