From patchwork Sat Apr 22 20:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 676357 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7228C7618E for ; Sat, 22 Apr 2023 20:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjDVUuq (ORCPT ); Sat, 22 Apr 2023 16:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjDVUug (ORCPT ); Sat, 22 Apr 2023 16:50:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2CD3270C; Sat, 22 Apr 2023 13:50:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9500B61567; Sat, 22 Apr 2023 20:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72B5BC433AA; Sat, 22 Apr 2023 20:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682196630; bh=WgattwYxV8wos1xLo0sZNXqqbXSW7bNExVNy4EwvZ+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2OqDKLpTNcdniuIt+/N4U3htRrNisGdIHm5JIiz1TJ6n46Amrm2Cdiz3EPkT+4Zx ZzSqoOCmfm9JEmwwR9JZ+rIV2P4ZC2X4dPT7TruGSXTBjaSIIfWX3fkax4ADm+KMyJ RfICR8cGE7SE+FKvJODvoODp7OVoZ1T3QvMmsQifirIEoTk8nBvWtD1DTVVLagETQo fzgiiDBGh3v6FLn0ueSfpV4NajCCrIJucOgc1HXZH8ooEVD4kcDn5gW2U4u6vkXu8b 7q6Gd9elq12dL83q06OzmKWijJsQdUEH24o8AmhcHMz0rsQlibQdqmgR4aBCKupAxP eYmMEfiRAAKeQ== Received: by mercury (Postfix, from userid 1000) id 1BA381066CCC; Sat, 22 Apr 2023 22:50:25 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Cc: Gerald Loacker , Michael Riesch , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 09/13] drm/panel: sitronix-st7789v: avoid hardcoding panel size Date: Sat, 22 Apr 2023 22:50:08 +0200 Message-Id: <20230422205012.2464933-10-sre@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230422205012.2464933-1-sre@kernel.org> References: <20230422205012.2464933-1-sre@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Move the panel size information to the mode struct, so that different panel sizes can be specified depending on the panel type. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 29c2a91f8299..0e1839e6da73 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -163,6 +163,8 @@ static const struct drm_display_mode default_mode = { .vsync_start = 320 + 8, .vsync_end = 320 + 8 + 4, .vtotal = 320 + 8 + 4 + 4, + .width_mm = 61, + .height_mm = 103, }; struct st7789_panel_info default_panel = { @@ -188,8 +190,8 @@ static int st7789v_get_modes(struct drm_panel *panel, mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); - connector->display_info.width_mm = 61; - connector->display_info.height_mm = 103; + connector->display_info.width_mm = ctx->info->mode->width_mm; + connector->display_info.height_mm = ctx->info->mode->height_mm; return 1; }