From patchwork Mon Jan 13 15:27:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 13938509 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 43041E77188 for ; Tue, 14 Jan 2025 08:34:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D5B010E44A; Tue, 14 Jan 2025 08:34:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b="cTbdG2LS"; dkim-atps=neutral Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2123.outbound.protection.outlook.com [40.107.236.123]) by gabe.freedesktop.org (Postfix) with ESMTPS id B236410E6E5 for ; Mon, 13 Jan 2025 15:28:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p8b8kRkgIRGTc4i3gMO8UdI/STn4irVoAu40JA5i3VapYK9Xv3qgRqjSZ32SPRz30r60Y75vZ9kVcPrC2rxjOWDekS9UeLEV1A/oaIUUUqyKj2O77DY4x4GHkBfEkOF5q9G22WMLH8t+tIWuK5KhOtGMgpZvVJeHszcHxbGH8U0ZKBVREiEzA4IKYQXMYNf9lF1iQHhwtYPxTGqLtN6Wt0qsJNMh0Oerp6eFCIstAXOaxs+SycS0lcsAiFmQcte9b0Tbhckb0tQ/fE08EvmluksTMnNUPoydN8oP4vu3bXFDKYWP9qYGd+/p8UvtN9Y5JFX7ZeJpG4I62VRH2ALqKA== 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=r3JVBf06rT6OZJlPNsZPT+2+04Zi3Zhs3/v+TZCc6e4=; b=S3qt/UhtA9cGqQEux1qtGee9XVJ9zxHXtg0w+UbwKOiB6Xsr8SVa0s3bki20oiK7L5sc1E9ZA9LFg+UaMQyJa0fDURq23XjM76V78lJ7KBjQMhw0TsF99yJIsRYEcn/FMGlHQ3AETR2tZHuR+xZUqZOJLxyZA1YLtGuyRxM4kYKcIamiNZVRjRByXBU89PmvFfjb0bSutlzXNY0KP1xQLdNByFXyjhSsLfA0nh6k9MZXNna7Eai6MQs+UfGpb9NlKyo8Dqt3L4ZmbCeiIYZntm7VZtIzqPqZ0t93fdD+xz2pFpeAK4PCit3ujdrZKJFF+tTQSOwrdrhDp2/s4lQpiA== 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=r3JVBf06rT6OZJlPNsZPT+2+04Zi3Zhs3/v+TZCc6e4=; b=cTbdG2LSU6cP0QjJRnMu/IdDre528b2cNSE4PxafRQbIM3BSYRSqjaH/t9/Wsgt+I7v3SK8rdpR4yCXXgdnhejDTHnnVq5SAP7p9lo2rKYaJirVPI2+h/IgKsm8KmGQ6/Gr30w9MDUPYGuk25FAaWX142k2nhz9msunG618m4hE= 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 CH3PR08MB9065.namprd08.prod.outlook.com (2603:10b6:610:1c9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Mon, 13 Jan 2025 15:28:10 +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; Mon, 13 Jan 2025 15:28:10 +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 2/3] drm/ssd130x: fix ssd132x encoding Date: Mon, 13 Jan 2025 15:27:50 +0000 Message-ID: <20250113152752.3369731-3-jkeeping@inmusicbrands.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113152752.3369731-1-jkeeping@inmusicbrands.com> References: <20250113152752.3369731-1-jkeeping@inmusicbrands.com> X-ClientProxiedBy: LO3P265CA0015.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::20) To MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR08MB8282:EE_|CH3PR08MB9065:EE_ X-MS-Office365-Filtering-Correlation-Id: ea36fb3f-9650-4d2a-1c9c-08dd33e6e307 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: 9ltebddyMWGSv6asHPe715TDv3eoEW+vrarFWGZgeRSi8yZJiKu+EHvaWftePM7xAUYTYo76l9rpaGFJwXCPyTv+cTCzmIZCsB1GxDsOYjesQi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ksrt5NQefPqpifTAmERXhSVWf3ZA10igXh7FBd3EY03bP3etftzMSNaQbnA02zs5Xx3SRbBGKfJy8gNubWcN75V6ir9MIfjCKuuAXkTbR/h44Lxa9JWwjEYk/Q5bK6NcOk+LGMReFj6n1K/4rqkfrGB8liumPe654up6kq2I+izhiW/Kl8oKqdQElgc9sRaHlWIFMH1IQFhsK/lufTjFj6PKiRCGQUOzfNiFP10NSjAOuzHCUfTq6p18v6gI+UOfMT1RUtHVerE95ZK0zw5DITXs40MJcc 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)(366016)(1800799024)(52116014)(376014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n/OZ1D3Hz9rcFegNEv0SjYK9D1p5pE9TW05KgFKW2MrlIYO6kvd9DKG4xRTu8yAcRluUhQkukE2CSBPscisktSaF996NBPjcfwUlOekTT7H2LlV+E27UNMJelUpcQKFUGRXk61RH+m5trofxUrHhvqzRbx0Y10vFm2VmQuqXqNaN+g/JXa1XcCkekXAE6+2wAU5Csx0mxZbBGlbpS5jQjozoqHdcAyLMpq6oJrAPZAQceg/HOMNdUZxr404CRYtx6jNpVGDuep/84URwYFjPwyeahO9PcgZMBfNYeuj+nHho/QUqOz9XUVW0Jw/PMytnXOGBwh3unzca0PG8IHkMbEHk8Up4of8wgweBq1Wd4Hsk2m7XQa/4EpfwOyw+uCOLlUJFpq+jr+rkMWaJPJmPjIx10s5hhPC4ISxuTEhSQAiVtcejlKdhsscQ9jfWKiBh2Ha9VCm5km6/56/3CIkh+lRWunqxrfD3EVf990F9mqvYNL9u2Y+Qt6SGxYV/eW2JGxEhB7yuxnuCwRVURYKShJFP7Hhyabfsv2s38hMHZsRYF1pmwbQhNuvtbJ8izNW5U+bT96RlLHw6MdBRm1Rr73HF9lFFOKsaOifZafKRQIAh0EO//cFTvMNYbmH2OGDWVmdQl0pvgVeq5dXx06n8mDP8ACVbnoEgTAyQMgoxj61G0XN14OjehxQlmf/Cge1mpiunAWtJfO3nusgL0BgTuW0EDNywJXjloBMC9rSuPe2h4bJ/9eZ7TamcCf6yJGztyihI2meF3YivEEqvI6puR02xad+4K6r5YjevONwi5amT/OBM2sQHaqVLYcmBMsernVkdAMlWGNkfFUVLx//dZW9fhSlaQtcrFytI4uum7+WqIzWRBjCF3ST/p+xxa/z1HQq9gozShFyNC+wGx3wrLRfVn0I+azT5E8/3seqoMwuBdk5nFkwPRdmU5CzxB/UHsNbyLkF8l7kLdThCVLwcSKJKP3OVBXUnpN//WQHQXJJSU6lt+VnEjhal/YuumqlHtH8aJais32TYwzxLS9ICePPaUt83OjdkFY0oG2dxPCPSZZu2TcQBIafTfeS1xwbLHIPqJ2KVNoCu9/2nVtdK1Znwbk7uplgD0qPd8xvo/fN5JRC9aJXmfx6q2NZ74NIlc6cCiQsMnJM2VcU0PHASz/wHEKcFCPksOe54skk85FJjGlbQHMgYvyIhijryPXUy0LZZzBVHqY7VVaDBRg2XDHnmuoa/+jZSjTxobOyJQnhRDjviSypuesH1SJLrVRKCrBS6MRyweTpd8dl5alYikOM5ADvYxX0cJZG7aylmeIcXP/S6ktbBfH7B0Ks7twdMWby7N1eC5BfkZAHOkxiwlROdGthq7vIV3X4r5YekGkFEvtAWKUGobzYTKB5PNWYMygPFWFS/hDoju8JYIEACj2naR3uGcG0gB8mym0jagElQr1VxuTCXgHyUPLJFDl5TY0wY9t6IToK1z2j/pKN1fAatU4qD8qIyZ5D9y3GNoDQN4fpgOf5+W/3XHrXojfiLbvhiQYYQXLskYQTAK7BY3Ah0VRV7GhwYQ+O9KGxe1ObkVJZVCIfPrXhTqx98U4eoQxp7ay9cFSYzda1zfk5scA== X-OriginatorOrg: inmusicbrands.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea36fb3f-9650-4d2a-1c9c-08dd33e6e307 X-MS-Exchange-CrossTenant-AuthSource: MW4PR08MB8282.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2025 15:28:10.3428 (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: zip10aXRCHB3C8z4PJVOiW/+lE+k9u2GSypOGq35E8jep9o1nlULFGF8iNjC8qxBT+LbNtDVVnTGjj7eIvfRBu1noIbDQSI11/DbMoHD7vQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR08MB9065 X-Mailman-Approved-At: Tue, 14 Jan 2025 08:33: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 ssd132x buffer is encoded one pixel per nibble, with two pixels in each byte. When encoding and 8-bit greyscale input, take the top 4-bits as the value and ensure the two pixels are distinct and do not overwrite each other. Signed-off-by: John Keeping Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/solomon/ssd130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 2622172228361..64f1123080996 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -880,7 +880,7 @@ static int ssd132x_update_rect(struct ssd130x_device *ssd130x, u8 n1 = buf[i * width + j]; u8 n2 = buf[i * width + j + 1]; - data_array[array_idx++] = (n2 << 4) | n1; + data_array[array_idx++] = (n2 & 0xf0) | (n1 >> 4); } }