From patchwork Wed Jan 15 11:01:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 13941418 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 76EFBC02188 for ; Thu, 16 Jan 2025 08:08:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAA3910E8DE; Thu, 16 Jan 2025 08:08:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b="fbPLGm/R"; dkim-atps=neutral Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2094.outbound.protection.outlook.com [40.107.93.94]) by gabe.freedesktop.org (Postfix) with ESMTPS id 736A310E5DB for ; Wed, 15 Jan 2025 11:01:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JGdtDlKKzZLJhE3VQLZnBd/AQGayhKXsgGK38iwee1+ywGZ+fgQ+FNao6N8dkr9Y4Kd+dMqf7NgmK7vikNOta8IydvYOZpETEzDWnip79LjxaCp2TpfahjGYv7L7Y9AA+fmbedndr/6AFl6xSY8+Rh+7a8hMNfIjpnD1zxPwjSk+iTIN6zccv4nYqhiTrRNk3SPgTyE7r7wvUth9VpB005yveF6R8q/fFBK4C3GC2QcgMVmvQdwUHVIeAb/AePouFNx0Ze///JzbgwDanZEF1G2RaAatAkr8HAb9yyQAMHiQsVGQDR6OfMmHXmhiVBIn97o8c7SL1d/aZwxMm3H64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=exkryPA9kC4YcCxJyZEE8U8u9uu36BXbsDs6dLKoCJI=; b=uZP2gnDMnAq7TgvdmSj+Z+HXy/tJCWPCt7O2oSsqRhT1ySgVBg39/TitdwLWcZGXO4GMKTa3qJIEIAd74HdHQojdin0sWHaNRzP/cAFXcMg7ZeYRtQKaumyVyB3xIMhOcrjORecorRogFq2EDwUTMjgW/OZdrzntK6GsG1+A2/IP6wjyKB/Mp9yqyZDV1Yw03KKH1atrO1z3WuhsrYd83EIeTI67BFOBn+cCRk6DobVwyFIGQePB6k3BhV0utBCpXK41N3aIQoY6vN3g/6Hhtrq+/84ngknPJ8P8yEqlMAV7LeesggBwwSmiXFujpDvt+jO4mzsRT+9HUnA+0YrpTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=inmusicbrands.com; dmarc=pass action=none header.from=inmusicbrands.com; dkim=pass header.d=inmusicbrands.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inmusicbrands.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=exkryPA9kC4YcCxJyZEE8U8u9uu36BXbsDs6dLKoCJI=; b=fbPLGm/RLbhv/S1cluhO5GCcvhLvLw2W2k4z9R6w5eM1yCRUEiKbTWD3Ms0hfFWqjK2i1fu4ITtcWB4gtuwR8HsjDXB6XVDofBxXJnLjHUlxu5GLccRL0TbGcpdtSgte+F+KeDoWbiS4+162nWFS1zIEyW9OKUmD9YoMXwCR83U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=inmusicbrands.com; Received: from MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) by CH0PR08MB6842.namprd08.prod.outlook.com (2603:10b6:610:c8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan 2025 11:01:55 +0000 Received: from MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401]) by MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401%3]) with mapi id 15.20.8335.015; Wed, 15 Jan 2025 11:01:55 +0000 From: John Keeping To: Javier Martinez Canillas Cc: John Keeping , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/ssd130x: ensure ssd132x pitch is correct Date: Wed, 15 Jan 2025 11:01:38 +0000 Message-ID: <20250115110139.1672488-3-jkeeping@inmusicbrands.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250115110139.1672488-1-jkeeping@inmusicbrands.com> References: <20250115110139.1672488-1-jkeeping@inmusicbrands.com> X-ClientProxiedBy: LO4P123CA0215.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::22) To MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR08MB8282:EE_|CH0PR08MB6842:EE_ X-MS-Office365-Filtering-Correlation-Id: b6fa193c-0f35-405e-c77b-08dd355405f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014|7053199007; X-Microsoft-Antispam-Message-Info: Ni0XLmCm6kidoXINeaE0TcffQyA3JFAIN43yOX/kPjmLjSoGVTjyZpTkZJmnux1wLxIAieRVBc0d63zP1hA+YKylz/ZKai39rZu0Pjq+uKHAaoraq5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+6xQ6MCqoD9HCH7a+3+WqPYqI6eZnRCA+xYMxAahcrFOmoeFNv/5GGRgpmQtgF7dUTT7wQgyqDkXKhS/Ck7poWDqUAJT61h9HbUklhSJ9Q0ffnnbMzCtKsJOfgeR5QuSj2mRxXhS7BsyHQTPruPpfeRnTxQivop2LYvnZt7bkA/ralL9WrYKPPNGqwgvpV4yjU0JblHo/CEkDkPj8OmEHSvZU6VJW/q2dg2FUIiH/LmE3BMG6SxNTv5nbbnBsGipAMiA23wpGq+ulR/8d0daj X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR08MB8282.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014)(7053199007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vkKOBRpuZfbnion6+MX2jM9o0AXZKYr1hKPCXSiEqtv7ZHG491hPNDYNWu+9GqxeT3iqoEYbk3yZLcDkEZYzBXK5fvWrh5dIZV7wmVJ51VD7II4N9zP6sOYfuT0EXf4yUgKilt0+NqQkZz557+K5SargqMupWY8z62vX9ztRlcpRNRRi56EoghMu3DJbSmaz4whEg+hR1IC+i1oORKrGazqVfbL/096TtUPD2Z3h0da+OmXjBpsS7KeFw/Ve4uCbrepYFJf0feBSFY8ttNiHMOWuPGTu5jplJfDRIX8w1eQLDDyD3/Xcwd8dwiuizLprFLtgL1RAHEP1gTSKrujAJfEFhyQh5FC1lX8Rns8iWaOt8CM645hwTyjU+/NQH861z2lP0fI4Jl6lai0H8iNfCp+qhvz0Mce1Mf5Z3VSkhoDMw9jvSqJeLuZAAPu9Ld8tMA/SCP4VOfs/id1ndVhFqcp0X5NRp75yoRNQN8j3nBOLQkBt0fQQ7PwLu+83/L1/kLfJW9DiwbfjLLVwcQmReuCF1qXp91QdaTwdDyJZEQDH5fJJc8F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MS-Exchange-CrossTenant-Network-Message-Id: b6fa193c-0f35-405e-c77b-08dd355405f1 X-MS-Exchange-CrossTenant-AuthSource: MW4PR08MB8282.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 11:01:55.0428 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 24507e43-fb7c-4b60-ab03-f78fafaf0a65 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sdZBMxAXYR6dck3dM6cF89G4T6SzFGt9VoIrYilqVIAJGzb0XGBqbg3vFVb8kqJFU8/Wpxn5pSljgt92Bz8IZyZAPFX/e9rFxJQZLXVVvG4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR08MB6842 X-Mailman-Approved-At: Thu, 16 Jan 2025 08:07:59 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The bounding rectangle is adjusted to ensure it aligns to SSD132X_SEGMENT_WIDTH, which may adjust the pitch. Calculate the pitch after aligning the left and right edge. Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family") Signed-off-by: John Keeping Reviewed-by: Javier Martinez Canillas --- Changes since v1: - Correct typos in the commit message - Add Fixes and Reviewed-by tags (thanks Javier!) drivers/gpu/drm/solomon/ssd130x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 4bb663f984ce3..dd2006d51c7a2 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -1037,7 +1037,7 @@ static int ssd132x_fb_blit_rect(struct drm_framebuffer *fb, struct drm_format_conv_state *fmtcnv_state) { struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev); - unsigned int dst_pitch = drm_rect_width(rect); + unsigned int dst_pitch; struct iosys_map dst; int ret = 0; @@ -1046,6 +1046,8 @@ static int ssd132x_fb_blit_rect(struct drm_framebuffer *fb, rect->x2 = min_t(unsigned int, round_up(rect->x2, SSD132X_SEGMENT_WIDTH), ssd130x->width); + dst_pitch = drm_rect_width(rect); + ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE); if (ret) return ret;