From patchwork Wed Jul 20 14:27:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 12924062 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 73ECBC433EF for ; Wed, 20 Jul 2022 14:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbiGTO1h (ORCPT ); Wed, 20 Jul 2022 10:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbiGTO1h (ORCPT ); Wed, 20 Jul 2022 10:27:37 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B60AB3ED68 for ; Wed, 20 Jul 2022 07:27:36 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6CE3A2007E; Wed, 20 Jul 2022 14:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658327255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FRGx8deRD7rv9jPWgDUQa6mugDHCQ6/GgyWx9UYzCwQ=; b=QMdEtnKbdiApyIevjOpXQFoxK2ZCjLuBRP0L3Atv1dUyaLoCgEfR1Vp7MbZYDoLu7rtSkd 3wOdU9Bvyu+31wduIc9MieEbYqgCV9wJJFH3fRYZtyknjY2hYGSleGtu7LzX2CdeZZWmAb Ne5hDgEIVlszV59vq8cxUFvALuJFppk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658327255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FRGx8deRD7rv9jPWgDUQa6mugDHCQ6/GgyWx9UYzCwQ=; b=qARdayyDGwkRoOLCoWcibAcpdJouSqvJG7aL4aA1oUXL/y24GgRQR/Jq1jiZJ3X2ME97Cm pu7qf2aNFWvoqKAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1B30913AAD; Wed, 20 Jul 2022 14:27:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GJ3WBdcQ2GLfHgAAMHmgww (envelope-from ); Wed, 20 Jul 2022 14:27:35 +0000 From: Thomas Zimmermann To: javierm@redhat.com, airlied@linux.ie, daniel@ffwll.ch, deller@gmx.de, maxime@cerno.tech, sam@ravnborg.org, msuchanek@suse.de, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, geert@linux-m68k.org, mark.cave-ayland@ilande.co.uk Cc: linux-fbdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH v2 04/10] drm/simpledrm: Compute framebuffer stride if not set Date: Wed, 20 Jul 2022 16:27:26 +0200 Message-Id: <20220720142732.32041-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720142732.32041-1-tzimmermann@suse.de> References: <20220720142732.32041-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Compute the framebuffer's scanline stride length if not given by the simplefb data. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter --- drivers/gpu/drm/tiny/simpledrm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 7de477835d44..cff9e7f71f80 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -743,6 +743,9 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, drm_err(dev, "no simplefb configuration found\n"); return ERR_PTR(-ENODEV); } + if (!stride) + stride = format->cpp[0] * width; + sdev->mode = simpledrm_mode(width, height); sdev->format = format; sdev->pitch = stride;