From patchwork Mon Oct 6 20:58:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 519 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784368; bh=0iu+2fEfVIDletf7vW2nB3xw1Tk6FLd812u+m1YTiMw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lRS8fHTtK46tMEU5Bw51/jGePIp0RcljVJtF3++D+GGaAY4YV2ZczEKUYqAwEl4ra AKYxyaxP7ODfPYjnTdJDs/OTEENBW9C6ElasuEfHvYrF3VTG3hodyWvpdHbLh/7y75 hVHoWg0jVamEwJgVQ6PNmS1zkFeOFFp425dMKaXrwoBGyVuHDOfDqY5ArW8I+Too5E 11dzfrbMhX6n1lh+RV8jeXuMXA17De0TY/TlR61bO7DaNhCeSLspVjWHuQWqi+2AEY eWcQ41jNa4y1+CErKTEVweN5XswYjHjZb2iLo6da8pLyUY8I6MDPfdXIxAk+FBVTFc +X+LeCB8+OEgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 679D967F8D for ; Mon, 6 Oct 2025 14:59:28 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cYfQfwCxSbXs for ; Mon, 6 Oct 2025 14:59:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784368; bh=0iu+2fEfVIDletf7vW2nB3xw1Tk6FLd812u+m1YTiMw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lRS8fHTtK46tMEU5Bw51/jGePIp0RcljVJtF3++D+GGaAY4YV2ZczEKUYqAwEl4ra AKYxyaxP7ODfPYjnTdJDs/OTEENBW9C6ElasuEfHvYrF3VTG3hodyWvpdHbLh/7y75 hVHoWg0jVamEwJgVQ6PNmS1zkFeOFFp425dMKaXrwoBGyVuHDOfDqY5ArW8I+Too5E 11dzfrbMhX6n1lh+RV8jeXuMXA17De0TY/TlR61bO7DaNhCeSLspVjWHuQWqi+2AEY eWcQ41jNa4y1+CErKTEVweN5XswYjHjZb2iLo6da8pLyUY8I6MDPfdXIxAk+FBVTFc +X+LeCB8+OEgg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5470667F59 for ; Mon, 6 Oct 2025 14:59:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784365; bh=4rQxxWyexHUxpno+Loat7WtT5N+4bmtSc2JbWn6bapQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MAzCThqnYhPYYQDzbNCZvojST7R/YbXT7YNRiwtT0WQ/TeMsEKiT3tRz3ELfkDyiN 7EylXD34FDTdaykyVdr5bPnma6P9s7c2F5b9YlJhuf4cf32KJ9ZA5wVLmHGWHuczSd ePLo26OOqmE2XcEpfql4P1b3sEFAd169OTq8NE4e0mf/i6ZXs125kh42s0iOqtDYHK CDPsom8rtq0N7YPWlDGwkI9DOt/hhX+5iBbtd2H+l3OkdpIxjCs4v38Wbick8pDMN3 VUHdFWcl3MqcCLQcfNlnoPJ1/j7tKl72wk51DpVRJcBwdVR/V6LRGU8l9jj2mKc5mP dscB0fUEsjoJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7682167F10; Mon, 6 Oct 2025 14:59:25 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id AopvGFMoLNJd; Mon, 6 Oct 2025 14:59:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784358; bh=p/7er+8J/WFm1QpUuBLLwEhseaom6fJisD4zIk/NPyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CeXDsHPT1hW/NgtzJVf4bGSjmb9NyWIXjtSFA3g8dN1hTXo5dMX96YWg4BVhkWxO3 7cu3a5Eain2UVUUrLWLWrHP/cy/KL5+WI2eQ1b9jeqH4slH+VWTSUVNzVGP3eZwhWI TZwBGWZ98dcLt4QDZTx8bokYLIoyHqVYxsThGGPOlZoA1Eek69k1oFFLok7ztpD/oN 9hJH94cTS2dIsS/CLj3Zgl03clTVtd5CM4zZaBMmxe45x1cfom16oXD+/1Xl2ghAs/ K5yavrX4+/lxNnA49oxymXdcP/78Xacwiqu7kiwEBvqz1ecutLmnn6Xb0qzasxVLG2 HxYjlOUq3HHlg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5544367F8E; Mon, 6 Oct 2025 14:59:18 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 14:58:36 -0600 Message-ID: <20251006205856.2009292-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006205856.2009292-1-sjg@u-boot.org> References: <20251006205856.2009292-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: INQJLF4MZBA47NTBZ5PLUDJ7ZHIS4B5Z X-Message-ID-Hash: INQJLF4MZBA47NTBZ5PLUDJ7ZHIS4B5Z X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/14] video: Add a little more documentation to the uclass List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The copy buffer is a bit confusing, so add some more documentation for it. Signed-off-by: Simon Glass --- drivers/video/video-uclass.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 37171f6b2da..f50452cc956 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -47,10 +47,32 @@ * @size and @align information and this time video_post_bind() checks that * the drivers does not overflow the allocated memory. * - * The frame buffer address is actually set (to plat->base) in - * video_post_probe(). This function also clears the frame buffer and - * allocates a suitable text console device. This can then be used to write - * text to the video device. + * The driver's probe() function is called, which should set up the hardware + * and fill in any required fields in struct video_uc_plat and + * struct video_priv. + * + * After the driver's probe() completes, video_post_probe() is called. This + * converts the framebuffer addresses (plat->base and plat->copy_base) to + * pointers (priv->fb and priv->copy_fb), clears the frame buffer, and + * allocates a suitable text-console device. The console can then be used to + * write text to the video device. + * + * Copy framebuffer (CONFIG_VIDEO_COPY): + * + * To avoid flicker, some drivers need to draw to an off-screen buffer and + * then copy to the visible framebuffer. Drivers can enable this in two ways: + * + * 1) If the framebuffer is in fixed memory (common on x86 hardware), in + * bind() leave plat->size as 0 but set up plat->copy_size. This will allocate a + * copy buffer. The driver must then set copy_base to the fixed-memory address + * and base to the allocated copy_base. See for example vesa_setup_video_priv(). + * + * 2) Otherwise, since plat->size to the required value. The off-screen + * framebuffer will be allocated. The driver must then set up copy_base in the + * probe() method. + * + * In both cases, U-Boot draws to priv->fb and video_sync() copies the + * damaged regions from priv->fb to priv->copy_fb to make them visible. */ DECLARE_GLOBAL_DATA_PTR;