From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 330673921D5 for ; Tue, 12 May 2026 09:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778577030; cv=none; b=OKyjcgGYLS6FioM2BhcrpKHwH4N//954OCd/wgG0gG7DbPUfkyBfbhRUfgP0mqrmpKPRUoO+20lMiowtGZxFKPYxsJfaPwwAKgKnAP2olhdZ2+vQZNz65ciAOrCNcahWU4LBsIHoBqMHcgvfWwOyN6eoKCLbQYvGK1y6korFRLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778577030; c=relaxed/simple; bh=Grg20u364HDLtV8oYPQ/WPGaG2f/jnq2CL/1dztZOiw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=n7jxp5W7TOZ+7jvAxOxNAZ4AAeGXuKN/XlgzzbegqVPVT4fFgTMSg5EThX1D+kKvFLNmj08rRb7EmLvEnMp3Hx4mn9AErbP66V6laTtSsDFHvQm8MZAG5nEF3hvNbfQx4pJckUIAb5qbgNvvnslSDaYEqXlowvmfcVNjHpzu6NA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PEm0kTcj; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PEm0kTcj" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-83975e992e1so2567240b3a.2 for ; Tue, 12 May 2026 02:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778577027; x=1779181827; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Z33mAnUolaaopuhgkgsSsR1XqxZfuAXYGKr6UlpMNF4=; b=PEm0kTcjG1MeFEgRFD6sF/DiLHwKbzA9RgY3mtqi3cCyCc0ZZX0mlzgwVqUqyGQefc Sz5ZTL0UUHO5QpftD85PKqYaV2cMzFIatyUygq8KYTupgtT5JuRc9N4bE+36ROcQFtqr X2X4tbsvFtOlkxnldib62Ac4A3jW0ZxBMKkD3XFWI9kYGr+D3XzjyUhq6MtmEmM5Po5M 1cDWa45IAvdm0VndnjLEJ+O8Vrgi4tlNX6uMh887vs3RNjtD6lzxSuDRgJImkRf6b7Cc Y8otm89UV/5UMkA8pqmjWhPsWQ+oszvlApuL/Z02afW7k/ntCjTbjZj/N9fVQK17MT2C 2++g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778577027; x=1779181827; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z33mAnUolaaopuhgkgsSsR1XqxZfuAXYGKr6UlpMNF4=; b=c4Te7n934GYOCHfi6vaQSvZcRKLbta4pqadRN4CGPoiKKhBtcST92rkUpkDzuhutFG yprtP+Cv5mYXcfh67Sqh8xuzHB9ZBjQxbPzewwhWQyXVeqkw0G/0mC4lANsh0L21klJm y/DSnhdRxjeUEDFf8aE/66QjmhBjyIOHcX1EyOZXgkuulmMVzOz2xKoyu8xKEBq56Y1s BDxw324mQ5e3TeCPPfWKUgNgl2VwQ/RjrsJEmenvDylkAbNxt2Oz1sPVSd7O7R1HKzav 6i6VDLq+0d2RfdI7vzAkT3c86Qhw7rSiwawIbo9BLxTLYZDAFf0TKFBryyo8bqac9cvj 9sXA== X-Forwarded-Encrypted: i=1; AFNElJ/+LOgET1Yy1Y9/7tnVJqKsULGuCpvTQZy4cagZ8GqgOhVrUJzOW9mnSSctU7M/o8P25Crb/CFXy0kyPos=@vger.kernel.org X-Gm-Message-State: AOJu0Yyi2bqXq2bgu/aNhVa/c4/ADt+a/WpAlKxHqeJz1/zTxuTjz2QO ZkSBrLq+nY82UYzl4XU5jeWTBsn6i0EQyNZE2P5TwSeqv073Q6ULx5jo X-Gm-Gg: Acq92OHcMO/r1YWJgUr2dznCGjTsqKe1UTBna9FJF60ScJqarau6EMBbnSLJ26XLpzv x8lSRlmYIQGPoh8nOUj2DyX4PnkXsPn11/wig68qzmn3y1XjKl9d4/eBbD3xHYlTE1ChcneY7v3 7UFUqMnSyFrYpo4BM69jwi6SxhhxPVEmkhf0iuTSXaKuMrKXyVdS3ex5sGYgE8Amq7jK68jWV+2 11Jgz9y5Zki0hEOxbaAwqKnHxYLVGxytq2sgvG34uFsU5RvbMbiTLpXYEjsAsoFSCUnFoQPnfNL rhl+6/tO8W1X03LCRPguykhJROqnxdcxalJDCXwskvXmi0YqXZ4Biy+biwmORRfijOBNtHNFgDf gxCdHlpoLDOuB5KTw4jJTc4NCTFywzQGa7aYxm4vuhp8XaBcpS108nkcGW1XSEs0cmJYhRcnPs5 Une4YNQjYwk1XzZS2AKgo1p+Nu564UCacZkW5TVD2Yt7NksUfYlF+1zBGtQ2Zx75UNqmHyp4gsh EqBIKavAHBK0A4= X-Received: by 2002:a05:6a00:9a8:b0:835:5557:31fa with SMTP id d2e1a72fcca58-83eebe7fd90mr2418145b3a.46.1778577027383; Tue, 12 May 2026 02:10:27 -0700 (PDT) Received: from [192.168.0.100] (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83965946543sm28990915b3a.16.2026.05.12.02.10.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2026 02:10:26 -0700 (PDT) Message-ID: <07ca65f6-33da-40b1-afcd-0b0ceabd49f9@gmail.com> Date: Tue, 12 May 2026 17:10:22 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drm/verisilicon: add support for Nuvoton MA35D1 DCUltra Lite display controller To: Thomas Zimmermann , zhengxingda@iscas.ac.cn, maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: ychuang3@nuvoton.com, schung@nuvoton.com, yclu4@nuvoton.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260511075142.54752-1-a0987203069@gmail.com> <20260511075142.54752-3-a0987203069@gmail.com> <5157ab4d-3195-49f3-a3e9-aef6d58e869e@suse.de> Content-Language: en-US From: Joey Lu In-Reply-To: <5157ab4d-3195-49f3-a3e9-aef6d58e869e@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/12/2026 4:24 PM, Thomas Zimmermann wrote: > Hi, > > instead of this if-else branchery, I strongly recommend to add a new > file with a new mode-setting pipeline for the new chipset. You can > share existing helpers where possible, and implement variants where > chips differ.  It's a bit more code, but will be a lot easier to > maintain in the future. > > See ast and mgag200 for example. Both drivers support various > revisions of their chipset, where each rev has its oddities. > > Best regards > Thomas Thank you for the detailed suggestion. I see your point and will refactor by adding a new file with a mode-setting pipeline for the chipset, reusing helpers where possible and handling variants as needed. > > Am 11.05.26 um 09:51 schrieb Joey Lu: >> The Nuvoton MA35D1 SoC integrates a Verisilicon DCUltra Lite display >> controller, which is a previous generation of the DC8000 series. While >> the general register layout is similar to the DC8000, there are several >> key differences that require per-variant handling in the driver. >> >> Add a vs_dc_info platform data structure (in vs_hwdb.h) to describe >> per-IP-variant capabilities, and use it throughout the driver to select >> the correct code paths at runtime. >> >> Key differences between DC8000 and DCUltra Lite handled: >> >> 1. No chip identity registers (0x0020-0x0030): DCUltra Lite uses static >>     platform data instead of reading model/revision/customer_id from HW. >> >> 2. No CONFIG_EX commit mechanism: DC8000 uses registers at 0x1CC0 >>     (FB_CONFIG_EX), 0x24D8 (FB_TOP_LEFT), 0x24E0 (FB_BOTTOM_RIGHT), >>     0x2510 (FB_BLEND_CONFIG), 0x2518 (PANEL_CONFIG_EX). DCUltra Lite >>     omits all of these and instead uses enable/reset bits in FB_CONFIG >>     (bit 0 = enable, bit 4 = reset) for direct framebuffer updates. >> >> 3. No PANEL_START register (0x1CCC): DCUltra Lite panel output starts >>     when PANEL_CONFIG.RUNNING is set; no separate multi-display sync >>     start register is needed. >> >> 4. Different IRQ registers: DCUltra Lite uses 0x147C (IRQ_STA) / >>     0x1480 (IRQ_EN); DC8000 uses 0x0010 (IRQ_ACK) / 0x0014 (IRQ_EN). >> >> 5. Different clock/reset topology: DCUltra Lite requires only "core" >>     (bus gate) and "pix0" (pixel divider) clocks with no reset lines >>     managed by the driver. DC8000 needs core/axi/ahb clocks and three >>     resets. >> >> 6. Single output only: DCUltra Lite has one display output; per-output >>     index logic is still in place but display_count is fixed at 1. >> >> 7. Reduced register space: max_register is 0x2000 vs DC8000's 0x2544. >> >> Add the "nuvoton,ma35d1-dcu" compatible string to the OF match table, >> extend Kconfig to allow building on ARCH_MA35 platforms, and expose >> vs_formats_no_yuv444 as the default format table for DCUltra Lite >> (YUV444 blending is a DC8000-only feature). >> >> All changes have been tested on Nuvoton MA35D1 hardware and are >> functioning correctly. >> >> Signed-off-by: Joey Lu >> --- >>   drivers/gpu/drm/verisilicon/Kconfig           |   2 +- >>   drivers/gpu/drm/verisilicon/vs_bridge.c       |  28 ++-- >>   drivers/gpu/drm/verisilicon/vs_crtc.c         |  13 +- >>   drivers/gpu/drm/verisilicon/vs_dc.c           | 129 ++++++++++++------ >>   drivers/gpu/drm/verisilicon/vs_dc.h           |   1 + >>   drivers/gpu/drm/verisilicon/vs_drm.c          |  16 ++- >>   drivers/gpu/drm/verisilicon/vs_hwdb.c         |   2 +- >>   drivers/gpu/drm/verisilicon/vs_hwdb.h         |  25 ++++ >>   .../gpu/drm/verisilicon/vs_primary_plane.c    |  43 +++--- >>   .../drm/verisilicon/vs_primary_plane_regs.h   |   2 + >>   10 files changed, 187 insertions(+), 74 deletions(-) >> >> >