From nobody Fri Oct 31 11:38:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1755765345; cv=none; d=zohomail.com; s=zohoarc; b=BiabMqD0YAgz0U7Ko4DsiWbghSELo+NKuvcRgJWadAPB+3iklwWg+pNZ3iiBgD5MCuX0caARQXEQL+MkI4GfskjNSCwb6llKRL8F234JYJYKaCAH/JTLbQXIu364D1tOqC6rEZ1MTK8n5Qw6R1789WUxCDxyyCSnzFsmazF8UuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755765345; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u5+AEmH+qzHnQx6Du9Jd2lQI8ZPqXlMkW0HaOuXapYU=; b=IHQgMakMyBANk+9Vjht5ph//mvPiK1mtTHBXNgV19igjuuKjf0qGHxrnfwxuYxRKEG9oMhWB6YZUtE3Mz8g1MY4v8wHbsiiItHHluXgPJ+GGPtDKUtIBrh+XQ3NVMWascSGeDUWl7Xlt4OMshy2IZcjAusAyGDNrcYUqWQpXzTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1755765345957670.1695360579341; Thu, 21 Aug 2025 01:35:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1088113.1445924 (Exim 4.92) (envelope-from ) id 1up0lf-0006RC-Uo; Thu, 21 Aug 2025 08:35:31 +0000 Received: by outflank-mailman (output) from mailman id 1088113.1445924; Thu, 21 Aug 2025 08:35:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1up0lf-0006Ph-RV; Thu, 21 Aug 2025 08:35:31 +0000 Received: by outflank-mailman (input) for mailman id 1088113; Thu, 21 Aug 2025 08:35:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1up0Zl-0001aA-8b for xen-devel@lists.xenproject.org; Thu, 21 Aug 2025 08:23:13 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0a2b76c6-7e68-11f0-a32b-13f23c93f187; Thu, 21 Aug 2025 10:22:56 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 692BC1FB65; Thu, 21 Aug 2025 08:22:23 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CD3E8139A8; Thu, 21 Aug 2025 08:22:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0PesMD7XpmhzEwAAD6G6ig (envelope-from ); Thu, 21 Aug 2025 08:22:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0a2b76c6-7e68-11f0-a32b-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755764543; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u5+AEmH+qzHnQx6Du9Jd2lQI8ZPqXlMkW0HaOuXapYU=; b=jyWmRdyVS6SWIrgsOYhRs9LlvIGSYRJ/MOwdpH6BZS7r9f7AqKAApHfCwAY4utEk/i8fQi ja6lr2g7kouZOLWLuDszH45AXU4LQLi7cKqEKBepKmyjJYRNHm3Ke5xDDpGkHFxjSHm0s0 7mtVly7i6uVHDLFiFnaH11L37NGtQBA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755764543; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u5+AEmH+qzHnQx6Du9Jd2lQI8ZPqXlMkW0HaOuXapYU=; b=HxtrMZ0xISBvzUDDf4B6HiNqPLgsrOM0J+iImirqOuQ7LXjeigfkChT69xMe3GhKAuYd5F jWIKRM/gGMqKTpCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755764543; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u5+AEmH+qzHnQx6Du9Jd2lQI8ZPqXlMkW0HaOuXapYU=; b=jyWmRdyVS6SWIrgsOYhRs9LlvIGSYRJ/MOwdpH6BZS7r9f7AqKAApHfCwAY4utEk/i8fQi ja6lr2g7kouZOLWLuDszH45AXU4LQLi7cKqEKBepKmyjJYRNHm3Ke5xDDpGkHFxjSHm0s0 7mtVly7i6uVHDLFiFnaH11L37NGtQBA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755764543; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u5+AEmH+qzHnQx6Du9Jd2lQI8ZPqXlMkW0HaOuXapYU=; b=HxtrMZ0xISBvzUDDf4B6HiNqPLgsrOM0J+iImirqOuQ7LXjeigfkChT69xMe3GhKAuYd5F jWIKRM/gGMqKTpCA== From: Thomas Zimmermann To: simona@ffwll.ch, airlied@gmail.com, mripard@kernel.org, maarten.lankhorst@linux.intel.com, geert@linux-m68k.org, tomi.valkeinen@ideasonboard.com Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, linux-samsung-soc@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, Thomas Zimmermann , Heiko Stuebner , Sandy Huang , Andy Yan Subject: [PATCH v6 19/25] drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb() Date: Thu, 21 Aug 2025 10:17:26 +0200 Message-ID: <20250821081918.79786-20-tzimmermann@suse.de> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250821081918.79786-1-tzimmermann@suse.de> References: <20250821081918.79786-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Level: X-Spamd-Result: default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWELVE(0.00)[24]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; R_RATELIMIT(0.00)[to(RLbwen1niosrcqbxsafh1),to_ip_from(RLqirfcw6gnbcr9a9yhi49fhi6)]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[ffwll.ch,gmail.com,kernel.org,linux.intel.com,linux-m68k.org,ideasonboard.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid] X-Spam-Flag: NO X-Spam-Score: -1.80 X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1755765347397124101 Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann Acked-by: Heiko Stuebner Cc: Sandy Huang Cc: "Heiko St=C3=BCbner" Cc: Andy Yan --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/= rockchip/rockchip_drm_gem.c index 6330b883efc3..3bd06202e232 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -9,6 +9,7 @@ #include =20 #include +#include #include #include #include @@ -403,13 +404,12 @@ int rockchip_gem_dumb_create(struct drm_file *file_pr= iv, struct drm_mode_create_dumb *args) { struct rockchip_gem_object *rk_obj; - int min_pitch =3D DIV_ROUND_UP(args->width * args->bpp, 8); + int ret; =20 - /* - * align to 64 bytes since Mali requires it. - */ - args->pitch =3D ALIGN(min_pitch, 64); - args->size =3D args->pitch * args->height; + /* 64-byte alignment required by Mali */ + ret =3D drm_mode_size_dumb(dev, args, SZ_64, 0); + if (ret) + return ret; =20 rk_obj =3D rockchip_gem_create_with_handle(file_priv, dev, args->size, &args->handle); --=20 2.50.1