From patchwork Tue Feb 6 12:07:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 20002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1492100dyb; Tue, 6 Feb 2024 04:10:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IH++3ZMcft0g9CXuPyEugco3uv26wcqyHDdhnob1cFUjWs0TDGo0e1pprvLZIRAPe97OyBT X-Received: by 2002:a05:6214:5090:b0:68c:aa46:c624 with SMTP id kk16-20020a056214509000b0068caa46c624mr7082390qvb.24.1707221448454; Tue, 06 Feb 2024 04:10:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707221448; cv=pass; d=google.com; s=arc-20160816; b=MAXPzczvnTmehAPmVJM36I1J+RH6D49OXa4amkRTQaC11VqItNDvH+jSG0TY3Y1gGm dxqTN4npJCSJbRmNUN8QiRbihp9GTLTPDVOCsjm+AS4+yHX5NjyuIYk32xvmfWDzP5TZ 43jPHmLvsBL7EYeHjqGNfLLmLLJn9uQP9E3lslQL6JLKZFwiCU+BVULZILFSJFOrU4Ps dr2otzlESXV+XP7tCys8fc50cK4cN8iLvYOdYjyBziq4ZZbvZbwoPmjvKbtJTgQyO8OA 63A+N7qygjEUEe2z2S33ee1dilcSPaSIA1PAJeAuQWY1C1bqWeRRe0+1cVeY0B4oCFCx bR6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=3AJfilpWGVVCgWf2+uJrbEPq/HIxVIIzsz0p+YLaXtM=; fh=1Ag+BD5SRNKqjcdc14cjuYF3ZpsEPEcApmhqhISe54c=; b=Cyegj5f7wFLn7cAjysvs9RUredlVNsJPSnq75QgtO204d86pR3vO87cpW/7zXigf4M Mqke0lk2uxo0yNVicljWXHzTk20TaOL5olsdoM3zQYR75XVAjEtn3egcHVvtM3D7JPxN iVZ4sY1sx7ttBtPMp709QuegOJFHbJ59XuyhqWIXby1Vt9xC0p4y155C5jbUOeswx/b/ sCyD4nIiA7W+ZYKShlRkje/rhI7QaQ4701yosA1I5nmTFFkIkqwXhqgS3Q+4/5OrmawF G5HMQDyaZyoZc2WTxfEwE2aaaEzKROUJoqZrcuR9pTILLTFIyQyvE9unqXZz75gccvif TjrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ORy0tUp0; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54858-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54858-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCUlLLVC5w/tv5xpbbMUMprdZVB9sHcxvFPLvIWsiyjHnahJo6Yqel50ocxjNgSb6HF9+8ijS/kfSxT1A7svF2LHSqAO3Q== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f15-20020a05621400cf00b0067f955d1353si2159029qvs.566.2024.02.06.04.10.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:10:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54858-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ORy0tUp0; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54858-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54858-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3FA521C20FC4 for ; Tue, 6 Feb 2024 12:10:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C453912FF68; Tue, 6 Feb 2024 12:08:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ORy0tUp0" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85BF631A60 for ; Tue, 6 Feb 2024 12:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221276; cv=none; b=dKOURaYNAWEj2O425LaSu9BpGCswrO5qi414g3RnwCyw0J55s1DaR/hfPhDyaY+cKdsFa6jdmfZteVWOooZGQ3i9UWCRdYAyuirQO+wBiFQlnWlW5gzeOcs1ivqwt5/6xFblJijv6gGbpVGEUehHSGx0Q30tf3bIwAZZVB2+V3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221276; c=relaxed/simple; bh=Mv6zf86XoMmKd7NcYaO5kG+cRiZYMBMgYxftUMxYBJE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HXH7yZ/JwXYlh4N04Xala6TnuMgF5B6aYr7ijcpCz7ENuK/lJ4WQLgXN2QLxgGQQkNc6vJE0lC4mvQXfUpNtIP3NKOeKwKI/ciMz/5rMnJkZFfYTN930BQKCUoEb5DYFTOG2FS4FXh9oyXc7aK0cQkdKGDIg9Ev/KcDPGLI5jEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ORy0tUp0; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707221272; bh=Mv6zf86XoMmKd7NcYaO5kG+cRiZYMBMgYxftUMxYBJE=; h=From:To:Cc:Subject:Date:From; b=ORy0tUp0WLvNg2y025fU0e1/OBcibOUv+i13OzSeb+EpmrAgEFen9ZCVyeHqx+cJP 81dwl8H1W9dPWiOtLMAbuVC3bPH0sdv4MNAtfJ0XfLSBbZ0huLbvwDenbjz7U9vxxS 10hrbxkb1qOFkOBKa17Y393/WEHrKHWTcMyU5E70DkAUugg01RKjQKt4KfE1kSom1t 5+mtVQwQTuc4YnaIN55KJLyTdnm7TRkvaWgdy0s/lLob2D83ypjiJPV1Lsq2Vl2Rdg ApXKcBmTbyXw9ydDjUuBsdOuYCM8bF88ffDeFouow+OIZHPtrFcyEWyX9UF+gCdSr6 SB/gZ3EIswHNA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id CBA4B3781F8E; Tue, 6 Feb 2024 12:07:51 +0000 (UTC) From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: fshao@chromium.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH v4 0/9] MediaTek DRM - DSI driver cleanups Date: Tue, 6 Feb 2024 13:07:39 +0100 Message-ID: <20240206120748.136610-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790151437669834116 X-GMAIL-MSGID: 1790151437669834116 Changes in v4: - Added a fix for RGB666 formats setting and for wrong register definitions for packed vs loosely packed formats - Added a commit to make use of mipi_dsi_pixel_format_to_bpp() helper instead of open coding the same Changes in v3: - Rebased over next-20240131 - Added bitfield.h inclusion in patch 3 - Added three more cleanup commits to the mix to simplify the probe function and remove gotos. Changes in v2: - Rebased over next-20231213 This series performs some cleanups for mtk_dsi, enhancing human readability, using kernel provided macros where possible and also reducing code size. Tested on MT8173 and MT8192 Chromebooks (using a DSI<->DP bridge) and on MT6795 Sony Xperia M5 (DSI video mode panel). AngeloGioacchino Del Regno (9): drm/mediatek: dsi: Use GENMASK() for register mask definitions drm/mediatek: dsi: Fix DSI RGB666 formats and definitions drm/mediatek: dsi: Cleanup functions mtk_dsi_ps_control{_vact}() drm/mediatek: dsi: Use bitfield macros where useful drm/mediatek: dsi: Replace open-coded instance of HZ_PER_MHZ drm/mediatek: dsi: Register DSI host after acquiring clocks and PHY drm/mediatek: dsi: Simplify with dev_err_probe and remove gotos drm/mediatek: dsi: Compress of_device_id entries and add sentinel drm/mediatek: dsi: Use mipi_dsi_pixel_format_to_bpp() helper function drivers/gpu/drm/mediatek/mtk_dsi.c | 310 ++++++++++++----------------- 1 file changed, 126 insertions(+), 184 deletions(-)