From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 6059838E8AD for ; Tue, 12 May 2026 10:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583575; cv=none; b=CkATWKayRHTH/8WIKVxxby7e4XCwx5WhyKuNPnQpYZCgQvK1NOpVHrPLgQwGbmMPGtRUyslHJ5hZoX9fGt6TlNkUIfN4IgXb2UTd8wJZRuzSjYCa81ja0PCXSlTfiK3yiKUsAHk/vKnZNYc5OMqm8EyXiyflir+Hjj93GxXgmhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583575; c=relaxed/simple; bh=ZB2DEenZ1V39Q+b2N7YHtAMHyUeMGeFI2eS7MCxKdaE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SzQ9FyRdZWwAFshERTe8mAJBs/hs43GsrjpOd/4Q5mArviMieRqeEhUr32ijI36VZjin+hsxIYVvInEH0I5NDSz+EB7A1afa/tFiHw+Q/+mHmFwZUpc/ddaXD27SYtpzR8/o/ZJH/yEhxWCcvO+dOCOoWRaJcFinchMki8I7r3k= 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=mOhm+z4K; arc=none smtp.client-ip=209.85.216.53 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="mOhm+z4K" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-364f7c42c62so4505281a91.0 for ; Tue, 12 May 2026 03:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778583573; x=1779188373; 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=lFfxIbyksNeEtf5P/BOwbmqUFbMT5NN+UNPslcsX6G8=; b=mOhm+z4Kyx8oOxll6etR0T17ds1aOB3Hpk/fmwwfgtAMGflS9NPzU/IT3DWddXbqR2 Uytv8icotguyLBc4E6hPptBEULoPNAtfU7CvuZ5isFLnS/uosGHF/iuVhwqq2ds5rXxt KUZkiEStIkfGWk8IQWydb87JyQuA+EelZzkq87EUdxZgb0ZHxEMc283Tozf8OKERFwzm jG9/lNOz0wT3xVLbcM11rPH6MzVuKxLdYgvjFp1j4wiVvL2fi0gcaZM6lsUVJjwWlAC0 v5kaRm8a3AvC1pcJMMN2km36P6YHg2HT0Rk6qLiyCM6PkJ6dWpxz5BOAqxyTbPZ9Fw8i Saeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778583573; x=1779188373; 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=lFfxIbyksNeEtf5P/BOwbmqUFbMT5NN+UNPslcsX6G8=; b=QTTKLk6P1ot+vqo4uEBAxHbPvnlhJnvhuud2aNqxJjk8LWFC5heY2u3Hn1mFK8d23Q AkANe8TD+Yv/wHt+mDu1kNhlZqwKjrZ0zOjgiq9lpKmqA6bQTl6ZvSgPTHVh4hVCe6m6 ptyzYpDP7/o/XyZ6Cx/rkQOYqgdkAbC5xd3XfUDVdnF83diGI0CcF6d9nOaxs9kBq5fl feH6gAy1SegoPGR6SxNmMuo3DVgtPwIEDxwWbnd+y7NlSBcG1ngApi4Tb+XSa2MxTPs+ NcrjItm6igi28s8HFyxrlrySk1H+ce6gAjOnHgBm4CmHIS9e4dC+0uwJe6c7ZAylBlSs G60Q== X-Forwarded-Encrypted: i=1; AFNElJ/+Ad5tt7A9m6NV3+T8pfUgYriy2dTIVohWDgT49Dr9AylCMkX5gvzF7bxG5ZYfqEeTBaxvwj8Fpcy8JhI=@vger.kernel.org X-Gm-Message-State: AOJu0YyoF4KficsZuU6RiVLvJN1cWOimAK6gkspnmhowwm2xHu0+ZGpA tUXWGUaGiy/ewEq8j9jalUuEHEZkUGFHUq+ttYwonkpYPcvfJU0PTFwY X-Gm-Gg: Acq92OGnzuszTVvgoVPcY+czDr8mHd4j6asFK0Q36es6uzfnc9XogT+xtDVUYYeNJ6I hovbUY6A8SSYKp0bcfD0REjaa7gPzSDe1sTm729W5SWhmKJ8OG5JtXIKh26QPZND24wzLH4bqQT +8MSLGqGTy+GOUIS0cCQ2yQxqj5DgN+bKfwwfUh8FqAEQsiuluSBk9TLzEd1su5fggXx7RH5a3T sq7zpMrDlvBwbQrnkROjqvMoL/2O6cs+YuJj2nN8ImmAEZlALu5nqSS0c3T6hwjxOR80C0O9R5P 7+zI6fD+qmjwXmO2LY0wgTUqdHwxbGxvnYP2Y+iR6r39TVT+ZJVcBIf6wgJ0h5uK/Dhiic6Oope HXbWnAOjk34X47wh/PrvygVwvdIE3C1+Q9wzzRcgnZZjqR9Z+C9hpNh07guSfLMtc+IYQz2HJY1 9ab9mhaQZQ8k8xwcm6lHdtbgfA4O4UW+RiqJAlrUXXWs11Gb5ZAqIWNtBoIU5ogu7y6azdGFGR+ Gj9 X-Received: by 2002:a17:90b:3883:b0:368:6998:b49e with SMTP id 98e67ed59e1d1-3686998bc7emr7312294a91.9.1778583567896; Tue, 12 May 2026 03:59: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 98e67ed59e1d1-367d65ed459sm14241837a91.14.2026.05.12.03.59.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2026 03:59:27 -0700 (PDT) Message-ID: <1d04dd6d-f245-4b83-96b0-c5491fad8093@gmail.com> Date: Tue, 12 May 2026 18:59:21 +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: Icenowy Zheng , maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, 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> <93e69179dbc495188cfffd8015350b3a55ce7876.camel@iscas.ac.cn> <3b94806073de8bd1d79aa7ec956493f67679e46b.camel@iscas.ac.cn> <4bf6efbb222ebc4d770ad613d17c6185e7cb2fda.camel@iscas.ac.cn> Content-Language: en-US From: Joey Lu In-Reply-To: <4bf6efbb222ebc4d770ad613d17c6185e7cb2fda.camel@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/12/2026 6:01 PM, Icenowy Zheng wrote: > 在 2026-05-12二的 17:06 +0800,Joey Lu写道: > > ======= 8< ============= >>>>>> diff --git a/drivers/gpu/drm/verisilicon/vs_bridge.c >>>>>> b/drivers/gpu/drm/verisilicon/vs_bridge.c >>>>>> index 7a93049368db..225af322de32 100644 >>>>>> --- a/drivers/gpu/drm/verisilicon/vs_bridge.c >>>>>> +++ b/drivers/gpu/drm/verisilicon/vs_bridge.c >>>>>> @@ -164,13 +164,16 @@ static void >>>>>> vs_bridge_enable_common(struct >>>>>> vs_crtc *crtc, >>>>>>     VSDC_DISP_PANEL_CONFIG_CLK_EN); >>>>>>     regmap_set_bits(dc->regs, >>>>>> VSDC_DISP_PANEL_CONFIG(output), >>>>>>     VSDC_DISP_PANEL_CONFIG_RUNNING); >>>>>> - regmap_clear_bits(dc->regs, VSDC_DISP_PANEL_START, >>>>>> - >>>>>> VSDC_DISP_PANEL_START_MULTI_DISP_SYNC); >>>>>> - regmap_set_bits(dc->regs, VSDC_DISP_PANEL_START, >>>>>> - >>>>>> VSDC_DISP_PANEL_START_RUNNING(output)); >>>>>> >>>>>> - regmap_set_bits(dc->regs, >>>>>> VSDC_DISP_PANEL_CONFIG_EX(crtc- >>>>>>> id), >>>>>> - VSDC_DISP_PANEL_CONFIG_EX_COMMIT); >>>>>> + if (dc->info->has_config_ex) { >>>>>> + regmap_clear_bits(dc->regs, >>>>>> VSDC_DISP_PANEL_START, >>>>>> + >>>>>> VSDC_DISP_PANEL_START_MULTI_DISP_SYNC); >>>>>> + regmap_set_bits(dc->regs, >>>>>> VSDC_DISP_PANEL_START, >>>>>> + VSDC_DISP_PANEL_START_RUNNIN >>>>>> G(ou >>>>>> tput >>>>>> )); >>>>>> + >>>>>> + regmap_set_bits(dc->regs, >>>>>> VSDC_DISP_PANEL_CONFIG_EX(crtc->id), >>>>>> + VSDC_DISP_PANEL_CONFIG_EX_CO >>>>>> MMIT >>>>>> ); >>>>> Should the commit operation happen on DC8000/DCUltraLite too? >>>>> (By >>>>> writing to DcregFrameBufferConfig0.VALID). >>>>> >>>>> Many registers written has "Note: This field is double >>>>> buffered" in >>>>> the >>>>> DCUltraLite documentation. >>>>> >>>>> I suggest create a static function for commit -- write to the >>>>> corresponding commit bit on DC8200, and write to >>>>> DcregFrameBufferConfig0.VALID on DC8000/DCUltraLite. >>>> [a] There is no commit operation for DCUltra Lite. >>>> I'll not add a `VSDC_FB_CONFIG_VALID` macro. VALID (BIT(3)) is a >>>> hardware-managed double-buffer status bit: hardware writes >>>> 1=PENDING >>>> when a new register set is ready and clears to 0=WORKING after >>>> the >>>> VBLANK copy. Software must never write it, and there is no >>>> polling >>>> use >>> It seems to be writable and controls whether register buffering is >>> enabled, see [1]. >>> >>> The description of this bit in MA35D1 TRM says "This ensures a >>> frame >>> will always start with a valid working set if this register is >>> programmed last, which reduces the need for SW to wait for the >>> start of >>> a VBLANK signal in order to ensure all states are loaded before the >>> next VBLANK", which indicates some kind of "committing write", >>> although >>> the code at [1] seems to indicate that double buffering is only >>> enabled >>> when bit is cleared. >>> >>> Anyway this bit should be programmable, and "Software must never >>> write >>> it" contradicts with the MA35D1 TRM. >>> >>> Thanks, >>> Icenowy >>> >>> [1] >>> https://github.com/rockos-riscv/rockos-kernel/blob/rockos-v6.6.y/drivers/gpu/drm/eswin/es_dc_hw.c#L993 >> Thank you for the correction. I'll add >> `#define VSDC_FB_CONFIG_VALID BIT(3)` to vs_primary_plane_regs.h and >> write it in `vs_primary_plane_commit()` for non-config_ex variants. >>>> case in the driver that requires a named constant. For non- >>>> config_ex >>>> variants, `vs_primary_plane_commit()` performs no commit >>>> operation — >>>> `VSDC_FB_CONFIG_ENABLE` (OUTPUT, BIT(0)) is set in >>>> `vs_crtc_atomic_enable()` and `VSDC_FB_CONFIG_RESET` (BIT(4)) is >>>> set/cleared in the bridge enable/disable paths. > Well according to the driver code for DC8000 from Eswin, and the bit > named "VALID", maybe it should be cleared before programming the > registers, and set after programming registers, to make the process of > programming registers atomic from the perspective of the display > controller. > > Anyway this should require testing on real hardware to verify. > > By the way, I see multiple peripheral drivers for MA35D1 get applied in > the torvalds tree, but the device tree is still only a skeleton; when > will the device tree be updated? > > Thanks, > Icenowy Thanks for pointing this out. I’ll perform tests on real hardware since I haven’t used this bit before. As for the device tree, we plan to update it comprehensively after completing several major IPs, with the goal of releasing the update later this year. >>> ========= 8< ========== >>>