From patchwork Wed Jun 7 06:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 104271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp48962vqr; Tue, 6 Jun 2023 23:35:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4j67OYgU3DoihSFcYOwa6yZg5sxfrXOqrp4Un7IvHJPEphv6EhgLBj6nd3fcUkC2XXHWfG X-Received: by 2002:a05:6358:c5a0:b0:129:cbbe:5984 with SMTP id fc32-20020a056358c5a000b00129cbbe5984mr2571031rwb.13.1686119704992; Tue, 06 Jun 2023 23:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686119704; cv=none; d=google.com; s=arc-20160816; b=1JHJvFlnzyshu8MbzFspxOIPJpeYI8yr2gVOucFQvrM32zM4SL0HdZGr8fnz1HXsGm 1R/CBNgkmYv4VGzz3jFQ2NAhm6OL8yECUMs/uCq+1sRHTMX5sMy7UchAlZIaQTJ6QhoQ 2gq6ELbCUZy3j+i/2Y/o88NAcifxFDkwRnR3p6xXNbun8gw7xKAzBS1XUQ9EAY4rSVwI 8nlDx9ykIQyRWqqwWQWPIo1vjoqo8S0Y/s/gxFklPrTBHyDRwUvUzCHrtcZNMx3CSAEl V/HAt2EbRxSKYprqLknOrqnosBxCvuauQH1taV21ZOWR+xVYHDN7EWbRhQXOQlNXxSkP rsaw== 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=0czzIbDPzmvCvIyx95sX+AelyzWZB5JBWF8rpSKj8LMNLAbYav7+wRUUH+hXv9Bw5B FoRR6YkYhp6CKrDiiSx04xKv6A9d9yRe+IhW4IQ/wz+rObddWKfPIyD7tl77vrwsF+na vStw0YNsNaKG0geL2YqUIOyeqfDHXfDqOK1fU15woKwrqTj8W0sqPht5+IRR3nlqW47J UpUZmouwO8SIqpGbArGc3Rp8gYGBLtRlP2Q2McNc4qIMZ7DFlJnCLbhxDoTk0J3LadXG XxzjU3zC/Cy+i2vMGAxqPoKNWp5OBlgAVQtuq27Br7k42juykRHWLCmnbfvmfsdTFcQZ YwvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oij5WgWk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a17090a018500b0024e29660f61si652981pjc.90.2023.06.06.23.34.49; Tue, 06 Jun 2023 23:35:04 -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=oij5WgWk; 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 S236749AbjFGGcj (ORCPT + 99 others); Wed, 7 Jun 2023 02:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235241AbjFGGcD (ORCPT ); Wed, 7 Jun 2023 02:32:03 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AACA71725 for ; Tue, 6 Jun 2023 23:31:56 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-30af20f5f67so6827222f8f.1 for ; Tue, 06 Jun 2023 23:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1686119514; x=1688711514; 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=oij5WgWkvYYOUtEp7mGMYwADDCD01LfrAmCNgml9W85dFDuFYvvNhkENHGeXh9Cq9u 3pK6gWcbQ7t2LYbZXgI0BCw/6fRRB5PeqRjLTlBbp+ET9axLadAiZztH4few/0KIz34X QJqbD/+9emeAKB44hrtPdlFjhs5oBzK5xrdwM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686119514; x=1688711514; 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=RlCn9Bn2wHYyCgj30TJgFVWCTO/Nq7fo1GYh/G2/eOG0eyrHy1Fws4q93dc1IMAuzh fg216sNZ0JAyECkNsNLJBkpDQbioTaY8gPmrq53OLXQzsVT8eaidmGqTIuoV0aREy2gQ ON0nKBLrb6BsiN2QNrn88x50KTeYjWozKbGOp2HTyxbVlDUi3PEEwnFFX3VCkbe5+6Dt nAjY3+NHoGvhxR1O8UPrAXYYV/vHUpeM4TG/MRpTp355uqamKt9mNWNtpnlMdbOYSVQt gE57AV+oqf+d66f71j18mnBP/iUhuk33Q++1UzZ3tOeAb+uvYRsUzBNiFP8YiVhIf2Bu CmuQ== X-Gm-Message-State: AC+VfDwJPQ+Q3c9uFXPMUGGUoI2h2WxtF6vWCLiR9TmfFDoBHOmHsBtG qLubbU4Ayfk1iUaewTMKlhEvw3svFYDxmLs/+YKAzg== X-Received: by 2002:a5d:420e:0:b0:306:3b78:fe33 with SMTP id n14-20020a5d420e000000b003063b78fe33mr3151485wrq.32.1686119514598; Tue, 06 Jun 2023 23:31:54 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([37.159.114.163]) by smtp.gmail.com with ESMTPSA id m6-20020adff386000000b0030630120e56sm14385127wro.57.2023.06.06.23.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 23:31:54 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Raphael Gallais-Pou , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Philippe Cornu , Amarula patchwork , Maxime Coquelin , michael@amarulasolutions.com, linux-stm32@st-md-mailman.stormreply.com, Alexandre Torgue , Dario Binacchi , Daniel Vetter , David Airlie , Yannick Fertre Subject: [RESEND PATCH v2 6/6] drm/stm: add an option to change FB bpp Date: Wed, 7 Jun 2023 08:31:39 +0200 Message-Id: <20230607063139.621351-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607063139.621351-1-dario.binacchi@amarulasolutions.com> References: <20230607063139.621351-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768024655575010115?= X-GMAIL-MSGID: =?utf-8?q?1768024655575010115?= 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;