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: 13270054 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 847ACC83003 for ; Wed, 7 Jun 2023 06:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AuG4djw7zDTmV810WTuxA2O7dTXWL54t4ZSNlb2gCmI=; b=B7x9PCRtMQn9IO C3I8ue3AUh5zE/51FQiDU31rywzqgygCbWxjkCWUyOT/BZ6ImVRSz8GOxGcHksE4uXTLaH5fQfnHs Nizil5yFA8l+eVXB3I0dxXS2uTW8ZXrekUI6TmMtXwcHDvSUfzS4NEAZB2N6ZVeKCr18gsVJgiakG bsIZESgxXthu5zexM5d4gzJa0mAbk+iDoSAQjLNmhopqBCjwKAcWw7nPk6xFOZzU6Y5hLiXYNSFRT 8qRT/47Q3rUBG0jtQuis5eU6Pgo7KL9wJjeEXML5HB8z+Qszrg1NE+yCxTs8q0kxqhSnFcAPiOPiq Nm1+aGmmjt58Bj+ULwlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6miD-004Z5T-0z; Wed, 07 Jun 2023 06:32:05 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6mi6-004Yyf-0y for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 06:31:59 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30d181952a2so4886583f8f.0 for ; Tue, 06 Jun 2023 23:31:55 -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=N4r9QvVHntC294xErDfN/+mcGjFTp+nFUCrPFvuRK+GzKY6M8Ve2GdcG/34VUyevn/ WXomDpThIMRWgaH4ks4NpkwUsiR1C3mBYoZx/c85BfXG1u0OADn82mSi9CMwfnEuH95n 9ks50yl+Kd/AolN2FcNkWeWBIDIkRSmhRJwkjyGoT/o1XgK71lmXLZslvaHg/XSJ8P/C vbdORzDjE2zYAJI6PsWSVX05lep2ZogWpjMLdeRjYIFnu+qAUT7QGFVItbXcL9233JUp PUpesTGTdh1eurveI+7GZSkdp6FjF2q8JNGdrV0ibYpo9/RLm4pO2bd3bXiE2l17MfQA R2iw== X-Gm-Message-State: AC+VfDwekWa7fzfLhrhnX0zEhSh0Q8w90I6E0AsIkRvYW5nTF06+TfuZ YfQR2MKkazsv2LmVgXzOP1uOvDdzCxUIDw/Ss3slFQ== X-Google-Smtp-Source: ACHHUZ43EByLSLWH1Hp4CJmVlLkzIZdJ1bFJA5cBLjDViBWwpcPQQjpHCIvTkQJTIAxM2+k+COUtcA== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_233158_414382_E2E7C2DB X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;