Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2009949rwd; Fri, 2 Jun 2023 03:36:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HTSb+cpEg5Vch1qmx0+noKUFMLfRJxu+CKQuiRX2jMjGrDScT4GRFpNK+8v4PLyqYSfb6 X-Received: by 2002:a05:620a:6889:b0:75b:23a0:de96 with SMTP id rv9-20020a05620a688900b0075b23a0de96mr12713715qkn.20.1685702206662; Fri, 02 Jun 2023 03:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685702206; cv=none; d=google.com; s=arc-20160816; b=auJ99aUTooEs2Y9mFV7ACElX42Phe/+k7uZvJiOQtQR+R3yXLgwhRQCkKAi9f4zDAB 2hl+WaRZ2x6pHZnSIEbTdH1Qh4Yq/mYQnAFhwX9yS9anq/k+6J6PMLW/3v2vJoCQ33y1 b8ieIxl873onsGclH6s26wz/AE4nxi5+UFEauu+aiHlQZ/zppxGhdiFD4yBHv3u6Eson qkOZ3n6f9F668KD12EXW+0nQexSiiAzDTRvMPNfWv+UiPJh3zGz0ziqEz0iPBv9UkLyC Lq1twwWIj0b5/pPs5C+cx6yatOPIC3tE5mQzU5tq4O/yib+qb4JLzXidQb+Rcn71b4yO f5Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yAW+zzizoPdH0S/aO5WCXuWp95MvJ4568t/x7rERkZ8=; b=0w/eHIAAYwTG4U75phKqh3joLHjHZoDyUaq1EMhunmOc0fTYVkOgqUp5ktezY0ubw4 DnwjcnDd+QeeXQHKAzSbI9lmEukZnwoQA5t1Q0crzxakxpklQuNotV3bqv8gDoDIWxvT zj6ApNeb55EYJphEzmUrKXLDmn7px21wC12/ojCDARtgPS1BSVKMcy2QTTRmlRu/f9hv B8HsqDEDtUnIS3xk/8+4Df8sw1G2qMxg/JiwF4bYmCc4nmZ8eaR4fYWakYzsFnvbp/q+ ljLBaLgHkFkII63bZgIznyB22fwobQB0hlY+dQWQRDVzx8apIQ3h3wCWzRCUs7g6iIdD LtAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GsIwW50O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u194-20020a6279cb000000b00652c20d3522si524906pfc.303.2023.06.02.03.36.29; Fri, 02 Jun 2023 03:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GsIwW50O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235335AbjFBKV7 (ORCPT + 99 others); Fri, 2 Jun 2023 06:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234526AbjFBKVq (ORCPT ); Fri, 2 Jun 2023 06:21:46 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B3E18C for ; Fri, 2 Jun 2023 03:21:44 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f60a27c4a2so2011213e87.2 for ; Fri, 02 Jun 2023 03:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685701302; x=1688293302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yAW+zzizoPdH0S/aO5WCXuWp95MvJ4568t/x7rERkZ8=; b=GsIwW50OWWABkFl4+MuMJVsJnIxd4RnUEQwdl1LBq+pD8w0HebLB/EDl2doqWRzJ8d FUc1iu7tzIbfsEjTdGKjveBeIhM3zz7X0KyRVROnmgYdIZH/WJXnskct5oE9wQHVFSwh lNzJ/DZ81S3JWUisdMUcVi1iR/gQGgqeymMQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685701302; x=1688293302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yAW+zzizoPdH0S/aO5WCXuWp95MvJ4568t/x7rERkZ8=; b=Hw3r5STD/1MUqQ7nali+P3HPZNPErI9+NOeKAPdpDlK0RknkfxBkQBvtXzp2oX+st2 O7+OSylM1FrCNDEvBwki+YCEdw5DYCI6cU3yWCenavykmP5MHj2xzmVJft4TZMRFCFIS LiOqs9ULoepEoNtglhzMPath+OgCWRQbGLZyUSemumpZ+Cwdz8fRwCpB+KmZGJkiPzl1 qh0N8JeieUY+1IElvX8nPH5Dn00E5uGZWdJN+bKMS7Qi5sg3i3dbNZO4a0Lejk9+3WPB VFeH5qY8V2Fl0Lf8/4guuYwLpRwRrvJjCx0gZ1j8Fj9qAZ4PRHVD69HW1LpA9irX8S1g FU7Q== X-Gm-Message-State: AC+VfDy424H5PPlhIT02yy6TfnL1SFEUzoMBI+OjHDkdZFwysv1c1TOy KcaqrWs+5O6OMUdQkMSdO0HmsFBR60aj6K6Ijtr16g== X-Received: by 2002:a2e:9216:0:b0:2a7:7d70:6bb with SMTP id k22-20020a2e9216000000b002a77d7006bbmr1425706ljg.2.1685701302702; Fri, 02 Jun 2023 03:21:42 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id x24-20020aa7d398000000b0051499320435sm528887edq.14.2023.06.02.03.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 03:21:42 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Daniel Vetter , David Airlie , Maxime Coquelin , Philippe Cornu , Raphael Gallais-Pou , Yannick Fertre , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v2 6/6] drm/stm: add an option to change FB bpp Date: Fri, 2 Jun 2023 12:21:22 +0200 Message-Id: <20230602102123.3345587-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230602102123.3345587-1-dario.binacchi@amarulasolutions.com> References: <20230602102123.3345587-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Boards that use the STM32F{4,7} series have limited amounts of RAM. The added parameter allows users to size, within certain limits, the memory footprint required by the framebuffer. Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/gpu/drm/stm/drv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 422220df7d8c..65be2b442a6a 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -30,6 +30,11 @@ #define STM_MAX_FB_WIDTH 2048 #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ +static uint stm_bpp = 16; + +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); +module_param_named(bpp, stm_bpp, uint, 0644); + static const struct drm_mode_config_funcs drv_mode_config_funcs = { .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) ddev->mode_config.min_height = 0; ddev->mode_config.max_width = STM_MAX_FB_WIDTH; ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; + ddev->mode_config.preferred_depth = stm_bpp; ddev->mode_config.funcs = &drv_mode_config_funcs; ddev->mode_config.normalize_zpos = true; @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) if (ret) goto err_put; - drm_fbdev_dma_setup(ddev, 16); + drm_fbdev_dma_setup(ddev, stm_bpp); return 0; -- 2.32.0