From patchwork Wed Feb 22 19:12:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746501 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=YxeG/0ey; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQmZ60l8z23yr for ; Thu, 23 Feb 2023 06:13:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98B4285B1F; Wed, 22 Feb 2023 20:13:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YxeG/0ey"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED4FC85AEF; Wed, 22 Feb 2023 20:13:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 00E6B85AEF for ; Wed, 22 Feb 2023 20:13:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id b12so1147509ils.8 for ; Wed, 22 Feb 2023 11:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bba+BpL/ocLbYcRjzAtGyh4XHu+D5/ZS+WW5DNn6IGs=; b=YxeG/0eycg6C91nMaiYEJgIajpM57rmeoXpFqr6d5HlngDG4+k/L9InUXD15pDSBlc QfE3rlHKsgxojz4vZzJ9GRWgHcHMujbfULsSDlcpZubgoPqdd7NMQHBQqmm6QJE6khfD Qk9X17AH8Sd2yqYb/8yzGQTqi8zDW5iWnedX8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bba+BpL/ocLbYcRjzAtGyh4XHu+D5/ZS+WW5DNn6IGs=; b=N0ieZFj+rpFmnI8ypBjQpPLFWuA4tqwB64ElxvjHEACtQGa9EWrQE2Oub7my0p2zbj yfa+qI+RKZ1Ap1SjaJ40bt5IPv4Id6LkvcLJgeq+UAAZbapE/r6IQ2xVL65yCdQjHq0T 6GNE8Kmpq5p9GFz6XTiS5Z2Kl1ViAMfUeOzGv9REB1FRXXx2D1tLwTrSK8H8IP175p5g mu/r+AVhMHh2PKMHiipuyyHUMhHEKFvS0QkDssUUvf93IrvnmHKeXrwEuLI0sx3uOD+o Q27te4Kirg2ACey7ymSQKkIeEh7Pd/yWz9sDFTkAQZNAgybvLPYcVB8mnqh0Wao1FjkU hnDg== X-Gm-Message-State: AO0yUKW8GJO7xKbzV75XiE9eaOCG6rfawflV64n3QLqlUkAhE5eGD1lW /lqTRoXYx2qdmlpWvk/wZUB61N1yA434XmDt X-Google-Smtp-Source: AK7set/qDpWECY2jyJYy8T453IH3u9ZV5dKInD8az7FWUuL3Bi+deULXiteQSHW2UOpjcNqFI3w0nQ== X-Received: by 2002:a05:6e02:1685:b0:316:f71f:fa9b with SMTP id f5-20020a056e02168500b00316f71ffa9bmr1430036ila.16.1677093184574; Wed, 22 Feb 2023 11:13:04 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:04 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 01/13] efi: video: Move payload code into a function Date: Wed, 22 Feb 2023 12:12:45 -0700 Message-Id: <20230222191257.1307427-2-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Put this into a function, as we have done for the app implementation. Comment both functions. FOr now the app still does not access it correctly. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/efi.c | 83 +++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/drivers/video/efi.c b/drivers/video/efi.c index b11e42c0ebf..fc37a68b376 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -50,6 +50,15 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) *size = len; } +/** + * get_mode_info() - Ask EFI for the mode information + * + * Gets info from the graphics-output protocol + * + * @vesa: Place to put the mode information + * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if + * the protocol is not supported by EFI + */ static int get_mode_info(struct vesa_mode_info *vesa) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; @@ -72,32 +81,54 @@ static int get_mode_info(struct vesa_mode_info *vesa) return 0; } +/** + * get_mode_from_entry() - Obtain fb info from the EFIET_GOP_MODE payload entry + * + * This gets the mode information provided by the stub to the payload and puts + * it into a vesa structure. It also returns the mode information. + * + * @vesa: Place to put the mode information + * @infop: Returns a pointer to the mode info + * Returns: 0 if OK, -ve on error + */ +static int get_mode_from_entry(struct vesa_mode_info *vesa, + struct efi_gop_mode_info **infop) +{ + struct efi_gop_mode *mode; + int size; + int ret; + + ret = efi_info_get(EFIET_GOP_MODE, (void **)&mode, &size); + if (ret) { + printf("EFI graphics output entry not found\n"); + return ret; + } + vesa->phys_base_ptr = mode->fb_base; + vesa->x_resolution = mode->info->width; + vesa->y_resolution = mode->info->height; + *infop = mode->info; + + return 0; +} + static int save_vesa_mode(struct vesa_mode_info *vesa) { - struct efi_entry_gopmode *mode; const struct efi_framebuffer *fbinfo; - int size; + struct efi_gop_mode_info *info; int ret; - if (IS_ENABLED(CONFIG_EFI_APP)) { + if (IS_ENABLED(CONFIG_EFI_APP)) ret = get_mode_info(vesa); - if (ret) { - printf("EFI graphics output protocol not found\n"); - return -ENXIO; - } - } else { - ret = efi_info_get(EFIET_GOP_MODE, (void **)&mode, &size); - if (ret == -ENOENT) { - printf("EFI graphics output protocol mode not found\n"); - return -ENXIO; - } - vesa->phys_base_ptr = mode->fb_base; - vesa->x_resolution = mode->info->width; - vesa->y_resolution = mode->info->height; + else + ret = get_mode_from_entry(vesa, &info); + if (ret) { + printf("EFI graphics output protocol not found (err=%dE)\n", + ret); + return ret; } - if (mode->info->pixel_format < EFI_GOT_BITMASK) { - fbinfo = &efi_framebuffer_format_map[mode->info->pixel_format]; + if (info->pixel_format < EFI_GOT_BITMASK) { + fbinfo = &efi_framebuffer_format_map[info->pixel_format]; vesa->red_mask_size = fbinfo->red.size; vesa->red_mask_pos = fbinfo->red.pos; vesa->green_mask_size = fbinfo->green.size; @@ -108,29 +139,29 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) vesa->reserved_mask_pos = fbinfo->rsvd.pos; vesa->bits_per_pixel = 32; - vesa->bytes_per_scanline = mode->info->pixels_per_scanline * 4; - } else if (mode->info->pixel_format == EFI_GOT_BITMASK) { - efi_find_pixel_bits(mode->info->pixel_bitmask[0], + vesa->bytes_per_scanline = info->pixels_per_scanline * 4; + } else if (info->pixel_format == EFI_GOT_BITMASK) { + efi_find_pixel_bits(info->pixel_bitmask[0], &vesa->red_mask_pos, &vesa->red_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[1], + efi_find_pixel_bits(info->pixel_bitmask[1], &vesa->green_mask_pos, &vesa->green_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[2], + efi_find_pixel_bits(info->pixel_bitmask[2], &vesa->blue_mask_pos, &vesa->blue_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[3], + efi_find_pixel_bits(info->pixel_bitmask[3], &vesa->reserved_mask_pos, &vesa->reserved_mask_size); vesa->bits_per_pixel = vesa->red_mask_size + vesa->green_mask_size + vesa->blue_mask_size + vesa->reserved_mask_size; - vesa->bytes_per_scanline = (mode->info->pixels_per_scanline * + vesa->bytes_per_scanline = (info->pixels_per_scanline * vesa->bits_per_pixel) / 8; } else { debug("efi set unknown framebuffer format: %d\n", - mode->info->pixel_format); + info->pixel_format); return -EINVAL; } From patchwork Wed Feb 22 19:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746500 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Px08sknM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQmM3FYcz23yr for ; Thu, 23 Feb 2023 06:13:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C21EC859F1; Wed, 22 Feb 2023 20:13:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Px08sknM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CCE61859F1; Wed, 22 Feb 2023 20:13:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2413885AFF for ; Wed, 22 Feb 2023 20:13:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id y140so4235284iof.6 for ; Wed, 22 Feb 2023 11:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QN1HpS1ERxfERCVLRFMIqZQ3Evshx9Xb+Y7U8/bUsWM=; b=Px08sknM2YP7Pdst8/vWn2MXFtmrXAmiF1i7WTxiYf8urXeCkZaWk5ax7DY1myPnUe G6xxkcMS41o2xTkv4AMCCyFjxYeTj19kqzejYQUgB05/hkSOs3frx4rmHdhNUN5pE4Q8 W7ossrgDDRvQ15XX60KGsF2U9qKr/jW+cNm0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QN1HpS1ERxfERCVLRFMIqZQ3Evshx9Xb+Y7U8/bUsWM=; b=pyCqvNJfxNpIqjZ7war2IZNSVh3MzwSaTNhOn0KqPuYL1xiowoOPj+6fVtooJlqNL7 Hwl7AHe5I3YDS8W9hi6VMgE7RjfL44O6Dtc9z7M5E1vd46QnCHcPIaGsAa4b1qysj+GU GwHUIb3dQmEl76kySAUTgtqXQxsKDAlxvD2xLxQFkvvm0NSbRLbalulVO+IeawSfFec3 UpNd+H2vwOvGd9QsYTcE+AebEwOshXd/460j+FXt4bwPvejK0tjIIDTJWFbl+Inreutq sYywDxpRFEhJWVlJojeyVAfIm1WaypBt33Ah2FWLIX930W7ZhkVi7kleR6gu2lLiHgDR goKg== X-Gm-Message-State: AO0yUKXIfTT+8tKJhrhBe3dPLLMkkuUI0F7Ih3hUqWNeeCM46kwKznhP hMP1vdybmKtrUT8EjDpVmrojJVhXzRsSvQAr X-Google-Smtp-Source: AK7set+H2UiqxnpmcBp6tv5AAf300swq6iPUEP9C66AXXmwSAYB56R37wjnqx2LRyzOFr0p4rvQ/QQ== X-Received: by 2002:a05:6602:2c0a:b0:72a:ef32:38fc with SMTP id w10-20020a0566022c0a00b0072aef3238fcmr4932875iov.8.1677093185411; Wed, 22 Feb 2023 11:13:05 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:05 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 02/13] efi: video: Return mode info for app also Date: Wed, 22 Feb 2023 12:12:46 -0700 Message-Id: <20230222191257.1307427-3-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The mode info is currently not initialised for the app. Fix this by returning it from the function. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/efi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/efi.c b/drivers/video/efi.c index fc37a68b376..0479f207032 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -56,10 +56,12 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) * Gets info from the graphics-output protocol * * @vesa: Place to put the mode information + * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if * the protocol is not supported by EFI */ -static int get_mode_info(struct vesa_mode_info *vesa) +static int get_mode_info(struct vesa_mode_info *vesa, + struct efi_gop_mode_info **infop) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; struct efi_boot_services *boot = efi_get_boot(); @@ -77,6 +79,7 @@ static int get_mode_info(struct vesa_mode_info *vesa) vesa->phys_base_ptr = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; + *infop = mode->info; return 0; } @@ -118,7 +121,7 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) int ret; if (IS_ENABLED(CONFIG_EFI_APP)) - ret = get_mode_info(vesa); + ret = get_mode_info(vesa, &info); else ret = get_mode_from_entry(vesa, &info); if (ret) { From patchwork Wed Feb 22 19:12:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746502 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ThOhQmU2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQmr1v2bz23yr for ; Thu, 23 Feb 2023 06:13:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38ECA85B11; Wed, 22 Feb 2023 20:13:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ThOhQmU2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A814F859F1; Wed, 22 Feb 2023 20:13:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B10CC85B10 for ; Wed, 22 Feb 2023 20:13:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id i24so3883197ila.7 for ; Wed, 22 Feb 2023 11:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BJ9f+Q/CZ2kk4jYFrZaGqpa15SvqgkCXFsv25sn+Ay8=; b=ThOhQmU2K1UDORw+AAPukP4iwzwKnZfLhU6AlW62ZeI2Bur0eoT/QCnd6M6PfqHNvg XSU2KgC56nzuCOc4P3b2Y+bqDGlSEK1bZClE/K51KiyBxfOvUJ5PyEkVfQVE1E1N+WzT IEK/vwDSj/g/RXWT10OAtWB3990JuJ7BUjAjg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BJ9f+Q/CZ2kk4jYFrZaGqpa15SvqgkCXFsv25sn+Ay8=; b=Cs6V50SZezQAxKe4fhl3gsLmuIa3VHQHkJrELlCub8CNhtbL7kueCAw/+0/U6IKFFl VniojETP/WpHPSN0empxreU5uUotx4DD+M23FGXPie+2Kl3ZB0sBqjD59serm2HMlYaI 2ZUpTO/J1bynQYp+3rA4CTLaoPaPr3k/UdvBcZ8rQsfOdMzqdo6LF9RBJZQEP5XwfNsX VqvEqC4GM/T7zso5IbbtiLzNeccgVcI/lpHCW6RUsq2P52mgl5bDgB3GwT8C9aUi6lb7 L/x6zkWvwNwl4PduI18ZMbbHXNIJOaHfC7gBDFS2ipvL3iCEKTwa35Rq/Zb0RMXiQ/X+ 4lPw== X-Gm-Message-State: AO0yUKUcakgnfzgrOluNug9c8Umu6X1Mlk3/R6h+6/j0k5AJFztNixhk +sX6Re3ZAjtOnkCM3X+ubeYCKz1eFRhE3m9Y X-Google-Smtp-Source: AK7set8aEzxyYgceadnpSfCusmOKIV+wvAQGZbdPDlk1a/uFTNFgzF3WrO/OgNm1qardK0d94xB/IQ== X-Received: by 2002:a05:6e02:1d99:b0:310:e816:8c8c with SMTP id h25-20020a056e021d9900b00310e8168c8cmr8106221ila.3.1677093186267; Wed, 22 Feb 2023 11:13:06 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:06 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass , Bin Meng Subject: [PATCH v2 03/13] efi: Support a 64-bit frame buffer address Date: Wed, 22 Feb 2023 12:12:47 -0700 Message-Id: <20230222191257.1307427-4-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The current vesa structure only provides a 32-bit value for the frame buffer. Many modern machines use an address outside the range. It is still useful to have this common struct, but add a separate frame-buffer address as well. Add a comment for vesa_setup_video_priv() while we are here. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/lib/fsp/fsp_graphics.c | 2 +- drivers/pci/pci_rom.c | 10 ++++++---- drivers/video/coreboot.c | 2 +- drivers/video/efi.c | 34 +++++++++++++++++++++------------ include/vesa.h | 16 +++++++++++++++- 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c index b07c666caf7..2bcc49f6051 100644 --- a/arch/x86/lib/fsp/fsp_graphics.c +++ b/arch/x86/lib/fsp/fsp_graphics.c @@ -106,7 +106,7 @@ static int fsp_video_probe(struct udevice *dev) vesa->phys_base_ptr = dm_pci_read_bar32(dev, 2); gd->fb_base = vesa->phys_base_ptr; - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, vesa->phys_base_ptr, uc_priv, plat); if (ret) goto err; diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 47b6e6e5bcf..f0dfe631490 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -325,7 +325,7 @@ err: return ret; } -int vesa_setup_video_priv(struct vesa_mode_info *vesa, +int vesa_setup_video_priv(struct vesa_mode_info *vesa, u64 fb, struct video_priv *uc_priv, struct video_uc_plat *plat) { @@ -348,9 +348,9 @@ int vesa_setup_video_priv(struct vesa_mode_info *vesa, /* Use double buffering if enabled */ if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->base) - plat->copy_base = vesa->phys_base_ptr; + plat->copy_base = fb; else - plat->base = vesa->phys_base_ptr; + plat->base = fb; log_debug("base = %lx, copy_base = %lx\n", plat->base, plat->copy_base); plat->size = vesa->bytes_per_scanline * vesa->y_resolution; @@ -377,7 +377,9 @@ int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void)) return ret; } - ret = vesa_setup_video_priv(&mode_info.vesa, uc_priv, plat); + ret = vesa_setup_video_priv(&mode_info.vesa, + mode_info.vesa.phys_base_ptr, uc_priv, + plat); if (ret) { if (ret == -ENFILE) { /* diff --git a/drivers/video/coreboot.c b/drivers/video/coreboot.c index d2d87c75c89..c586475e41e 100644 --- a/drivers/video/coreboot.c +++ b/drivers/video/coreboot.c @@ -57,7 +57,7 @@ static int coreboot_video_probe(struct udevice *dev) goto err; } - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, vesa->phys_base_ptr, uc_priv, plat); if (ret) { ret = log_msg_ret("setup", ret); goto err; diff --git a/drivers/video/efi.c b/drivers/video/efi.c index 0479f207032..169637c2882 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -5,6 +5,8 @@ * EFI framebuffer driver based on GOP */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include @@ -56,11 +58,12 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) * Gets info from the graphics-output protocol * * @vesa: Place to put the mode information + * @fbp: Returns the address of the frame buffer * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if * the protocol is not supported by EFI */ -static int get_mode_info(struct vesa_mode_info *vesa, +static int get_mode_info(struct vesa_mode_info *vesa, u64 *fbp, struct efi_gop_mode_info **infop) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; @@ -74,9 +77,13 @@ static int get_mode_info(struct vesa_mode_info *vesa, ret = boot->locate_protocol(&efi_gop_guid, NULL, (void **)&gop); if (ret) return log_msg_ret("prot", -ENOTSUPP); - mode = gop->mode; + log_debug("maxmode %u, mode %u, info %p, size %lx, fb %lx, fb_size %lx\n", + mode->max_mode, mode->mode, mode->info, mode->info_size, + (ulong)mode->fb_base, (ulong)mode->fb_size); + vesa->phys_base_ptr = mode->fb_base; + *fbp = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; *infop = mode->info; @@ -91,10 +98,11 @@ static int get_mode_info(struct vesa_mode_info *vesa, * it into a vesa structure. It also returns the mode information. * * @vesa: Place to put the mode information + * @fbp: Returns the address of the frame buffer * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ve on error */ -static int get_mode_from_entry(struct vesa_mode_info *vesa, +static int get_mode_from_entry(struct vesa_mode_info *vesa, u64 *fbp, struct efi_gop_mode_info **infop) { struct efi_gop_mode *mode; @@ -107,6 +115,7 @@ static int get_mode_from_entry(struct vesa_mode_info *vesa, return ret; } vesa->phys_base_ptr = mode->fb_base; + *fbp = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; *infop = mode->info; @@ -114,16 +123,17 @@ static int get_mode_from_entry(struct vesa_mode_info *vesa, return 0; } -static int save_vesa_mode(struct vesa_mode_info *vesa) +static int save_vesa_mode(struct vesa_mode_info *vesa, u64 *fbp) { const struct efi_framebuffer *fbinfo; struct efi_gop_mode_info *info; int ret; + printf("start\n"); if (IS_ENABLED(CONFIG_EFI_APP)) - ret = get_mode_info(vesa, &info); + ret = get_mode_info(vesa, fbp, &info); else - ret = get_mode_from_entry(vesa, &info); + ret = get_mode_from_entry(vesa, fbp, &info); if (ret) { printf("EFI graphics output protocol not found (err=%dE)\n", ret); @@ -163,8 +173,7 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) vesa->bytes_per_scanline = (info->pixels_per_scanline * vesa->bits_per_pixel) / 8; } else { - debug("efi set unknown framebuffer format: %d\n", - info->pixel_format); + log_err("Unknown framebuffer format: %d\n", info->pixel_format); return -EINVAL; } @@ -176,19 +185,20 @@ static int efi_video_probe(struct udevice *dev) struct video_uc_plat *plat = dev_get_uclass_plat(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); struct vesa_mode_info *vesa = &mode_info.vesa; + u64 fb; int ret; /* Initialize vesa_mode_info structure */ - ret = save_vesa_mode(vesa); + ret = save_vesa_mode(vesa, &fb); if (ret) goto err; - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, fb, uc_priv, plat); if (ret) goto err; - printf("Video: %dx%dx%d\n", uc_priv->xsize, uc_priv->ysize, - vesa->bits_per_pixel); + printf("Video: %dx%dx%d @ %lx\n", uc_priv->xsize, uc_priv->ysize, + vesa->bits_per_pixel, (ulong)fb); return 0; diff --git a/include/vesa.h b/include/vesa.h index a42c1796863..98112208114 100644 --- a/include/vesa.h +++ b/include/vesa.h @@ -108,7 +108,21 @@ extern struct vesa_state mode_info; struct video_priv; struct video_uc_plat; -int vesa_setup_video_priv(struct vesa_mode_info *vesa, + +/** + * vesa_setup_video_priv() - Set up a video device using VESA information + * + * The vesa struct is used by various x86 drivers, so this is a common function + * to use it to set up the video. + * + * @vesa: Vesa information to use (vesa->phys_base_ptr is ignored) + * @fb: Frame buffer address (since vesa->phys_base_ptr is only 32 bits) + * @uc_priv: Video device's uclass-private information + * @plat: Video devices's uclass-private platform data + * @return 0 if OK, -ENXIO if the x resolution is 0, -EEPROTONOSUPPORT if the + * pixel format is not supported + */ +int vesa_setup_video_priv(struct vesa_mode_info *vesa, u64 fb, struct video_priv *uc_priv, struct video_uc_plat *plat); int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void)); From patchwork Wed Feb 22 19:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746503 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=X9TTKONN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQn551MVz23yr for ; Thu, 23 Feb 2023 06:14:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A2DE985B24; Wed, 22 Feb 2023 20:13:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="X9TTKONN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD957859F1; Wed, 22 Feb 2023 20:13:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2C2AB85B17 for ; Wed, 22 Feb 2023 20:13:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id b12so1147605ils.8 for ; Wed, 22 Feb 2023 11:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vhKmzb7IYuxhdyl4Wh+rjHRDYnKfr14zPo0FWf5Ue3U=; b=X9TTKONNPKlJcDGkOaF7FWM0rt94m4POrI90S0NeooM0zNF+i50o2ube+gFbq+PdYc S2GCKiLlHoaDBFkejayOhKi3lxIHapLgrrpWt0qbO09Isq6QVkfy7ORd+x/NlbRpFtwt O6sidiRSLSnt0hhEuWMY1uroOJA5T+B7YOpuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vhKmzb7IYuxhdyl4Wh+rjHRDYnKfr14zPo0FWf5Ue3U=; b=A37BEoPrcUJnBR8dHjycnXxe0CihzOJvY/OhySEnaPN2NwDd/CZlr1DSL8a4yqETvx HM+OX+ts1lxFayWEsvdXUouqEXwbDxEkcTFt4SLaCdOw8cjCsvu+X9u9Rg9HhxoDot9I 2Cqlk7NZjUREix/iAAEH/rJ8BsHtC+r0aI0AYlSxLos08nVermQSO894gfCzu95E6O1b 9QBLf7ntTcAfeQkVw7p5LAHkyhij1mnS1V6sHQqSuJa8lhwByqhIs7wjrTPnUZhBTAC8 uCIZMXVpEvtWE6fK5qhIdBBQnHgXlwIu4oigW7nXThUq1qKISRHO12TjB3ZK5kwiReaq uZLA== X-Gm-Message-State: AO0yUKWN5dHjBROSRzrIR5UP0ut2ei+KYs1QXsIYnIF8CVJ3mFcBdT39 hsg4/1iq/fxKW5qw0OQdMvB7A24a+VztIsDF X-Google-Smtp-Source: AK7set+tD8Ya8wRUMZaFSPF2YjEPbK+9Fix42YFWIxi1SUUQnJeUFLqTGkO46bnGNVwTPowxkSQQhw== X-Received: by 2002:a05:6e02:2197:b0:315:4169:c5ac with SMTP id j23-20020a056e02219700b003154169c5acmr10087296ila.30.1677093187648; Wed, 22 Feb 2023 11:13:07 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:06 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass , Bin Meng Subject: [PATCH v2 04/13] x86: Add a few more items to bdinfo Date: Wed, 22 Feb 2023 12:12:48 -0700 Message-Id: <20230222191257.1307427-5-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add the timer and vendor/model information. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/lib/bdinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/lib/bdinfo.c b/arch/x86/lib/bdinfo.c index 0cb79b01bd3..896de37dce4 100644 --- a/arch/x86/lib/bdinfo.c +++ b/arch/x86/lib/bdinfo.c @@ -16,6 +16,10 @@ DECLARE_GLOBAL_DATA_PTR; void arch_print_bdinfo(void) { bdinfo_print_num_l("prev table", gd->arch.table); + bdinfo_print_num_l("clock_rate", gd->arch.clock_rate); + bdinfo_print_num_l("tsc_base", gd->arch.tsc_base); + bdinfo_print_num_l("vendor", gd->arch.x86_vendor); + bdinfo_print_num_l("model", gd->arch.x86_model); if (IS_ENABLED(CONFIG_EFI_STUB)) efi_show_bdinfo(); From patchwork Wed Feb 22 19:12:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746504 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jzW8/gXi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQnL1yKJz23yr for ; Thu, 23 Feb 2023 06:14:14 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E87B185B3C; Wed, 22 Feb 2023 20:13:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jzW8/gXi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BEE685AEF; Wed, 22 Feb 2023 20:13:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E9E0D85AF7 for ; Wed, 22 Feb 2023 20:13:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id i24so3883254ila.7 for ; Wed, 22 Feb 2023 11:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EDM7tbQr9j74WCnbLfJpKaphF1InoMYG9FfRIpM9RGM=; b=jzW8/gXidINrSO131ykQ33sAOdcdoatsoR5xJvBJBd0tnFI6mX6xnUX7jgEJkqvmbI CDzBsSJFUuHj5tslTGtiGWPEB9GSWjy2NcX+atmDLAlhLgop4RqWGrr+gexCM+pWcjK5 FuEmvbsAsm5rFVAupurP3x/XjwnBGBYYauJGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EDM7tbQr9j74WCnbLfJpKaphF1InoMYG9FfRIpM9RGM=; b=aXgZCBZ2lYBn3BALD4CSe3KpKEdF7Z3aXeIRj6uRkCjuPQIaItNYOlHd926QoKOcfi 79u0MoT4MXwUgrbFQ7tL27DSOpIWXsM+hlUZ0oj5qiVJJEDJrFAU4KW6lcmCsHXI4HdL z4eVCp/YoBTLRSaTCefrVTCfs+S4w4s1Q/1Tkj7topQimoM+HAwwsCidow2RdGYB0RSt On4hx4L6jHUZzPaaYzFPER76zWkWcSpOmkrkK32/hPCiRuB4Svb5iyhkkTaFbHvj2oNr SJGuCVMreu25Z/L3WjJOoiHWfWPxGDl/rxCZy7RlEJCXob2wCjLaCQU9gqrPa9EIGvXJ Umtg== X-Gm-Message-State: AO0yUKUtwPEU2KPzOwNkp89aFB49/QZLZDsBPfy2tmC+xd7dDXAGTQlt w66yvB69XYf5aGymupdP8FuZzS6n0dlRJzY8 X-Google-Smtp-Source: AK7set9O5zhn8EKVYudBsg6PA/d7UQV1HTlLjg/MyEOhuglq3UCXyG+Z4vylj6B0yBzWjEH1lgEaSw== X-Received: by 2002:a05:6e02:1a8c:b0:316:e793:9dba with SMTP id k12-20020a056e021a8c00b00316e7939dbamr3512796ilv.26.1677093188439; Wed, 22 Feb 2023 11:13:08 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 05/13] efi: Use a fixed value for the timer clock Date: Wed, 22 Feb 2023 12:12:49 -0700 Message-Id: <20230222191257.1307427-6-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It is not yet clear how to read the timer via EFI. The current value seems much too high on a Framework laptop I tried. Adjust it to a lower hard-coded value for now. Signed-off-by: Simon Glass --- (no changes since v1) drivers/timer/tsc_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c index 192c7b71a5a..1d2a3f20e4e 100644 --- a/drivers/timer/tsc_timer.c +++ b/drivers/timer/tsc_timer.c @@ -404,6 +404,10 @@ static void tsc_timer_ensure_setup(bool early) if (!gd->arch.clock_rate) { unsigned long fast_calibrate; + if (IS_ENABLED(CONFIG_EFI_APP)) { + fast_calibrate = 2750; + goto done; + } fast_calibrate = native_calibrate_tsc(); if (fast_calibrate) goto done; From patchwork Wed Feb 22 19:12:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746505 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ITqYAWa1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQnZ5Npkz23yr for ; Thu, 23 Feb 2023 06:14:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5CF085B4A; Wed, 22 Feb 2023 20:13:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ITqYAWa1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E881F85AE1; Wed, 22 Feb 2023 20:13:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E7C4685B3D for ; Wed, 22 Feb 2023 20:13:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x129.google.com with SMTP id e10so3836582ilu.4 for ; Wed, 22 Feb 2023 11:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pi3BuvCXsNp11Ej49ktW0I2ScelFHHjqJcGEMZDi5Wc=; b=ITqYAWa1qD7rE55+FEArYpKTH+Ei/U0pCyYwVL1DurMmTngqQVhvj6v0spN8PffHFa 0I+qA0oGQ4rbXtw+wh7MrEDAW21bd0bFFSlZoYm5OaIcIeu7rwLtGuWH/Hr2DP8zwRgd zog3qLz4694T1qK5GtlBc6Jni32rIsI9P35hA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pi3BuvCXsNp11Ej49ktW0I2ScelFHHjqJcGEMZDi5Wc=; b=0HHZ9u9IOvpztLnVLdarVEk4Rnxpm4v6OA2wCmRkcCspFvfl/jOJXT5ARnoCCEkZPV ZZQZI3lYUtaqC35eOMpMKyNnWU8y4Z26N1ZK/c+qvRmc9oS3vODDsgIO/TDdAXLQI9Sp Fhnc1HzipRJd6NMJY25lmDD9P9AwQ7L5sjMt54DhPPD4bqNchUP3pFpF69u8QUqnwbNg 7kp5ouHfnPjVFoIAAbZK3Q4n2vaeGQ1T9eb8mM+8eNaZpwuW3yFYQ0gziCAE3PeY8kYK HFCibqrLwjLG9TXCiLgEYVGuLsivo8NKDeXew9USg7M1CqVa8/ZrHl7sEDWy6g3K/HDT EMXg== X-Gm-Message-State: AO0yUKW6nHRQXtLO/feXgsKEJ0BdG4Ky8/1J9qiyZLmLg7pOw/ZdQQoV +3o3Tr8WCXVH58+tKKDnL92K7pavzDF4MP6R X-Google-Smtp-Source: AK7set+OKk65uHx/vYUV0shTo7/3OXj/Bmjy0BQxLDtPbkVzHtVco8ZuBMKgqUwN0ULIdBupjnA4wQ== X-Received: by 2002:a92:1a51:0:b0:314:22c0:49 with SMTP id z17-20020a921a51000000b0031422c00049mr6045579ill.5.1677093206390; Wed, 22 Feb 2023 11:13:26 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:26 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass , Bin Meng Subject: [PATCH v2 06/13] efi: Support copy framebuffer Date: Wed, 22 Feb 2023 12:12:50 -0700 Message-Id: <20230222191257.1307427-7-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add support for this to EFI in case it becomes useful. At present it just slows things down. You can enable CONFIG_VIDEO_COPY to turn it on. Signed-off-by: Simon Glass --- Changes in v2: - Obtain copy framebuffer size from EFI instead of using a fixed value - Dropping debugging printf() - use new bootph-xxx tag arch/x86/dts/efi-x86_app.dts | 1 + drivers/video/efi.c | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/x86/dts/efi-x86_app.dts b/arch/x86/dts/efi-x86_app.dts index 6d843a9820b..59e2e402d5e 100644 --- a/arch/x86/dts/efi-x86_app.dts +++ b/arch/x86/dts/efi-x86_app.dts @@ -27,6 +27,7 @@ }; efi-fb { compatible = "efi-fb"; + bootph-some-ram; }; }; diff --git a/drivers/video/efi.c b/drivers/video/efi.c index 169637c2882..a8e9282ab87 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -129,7 +129,6 @@ static int save_vesa_mode(struct vesa_mode_info *vesa, u64 *fbp) struct efi_gop_mode_info *info; int ret; - printf("start\n"); if (IS_ENABLED(CONFIG_EFI_APP)) ret = get_mode_info(vesa, fbp, &info); else @@ -207,6 +206,29 @@ err: return ret; } +static int efi_video_bind(struct udevice *dev) +{ + if (IS_ENABLED(CONFIG_VIDEO_COPY)) { + struct video_uc_plat *plat = dev_get_uclass_plat(dev); + struct vesa_mode_info vesa; + int ret; + u64 fb; + + /* + * Initialise vesa_mode_info structure so we can figure out the + * required framebuffer size. If something goes wrong, just do + * without a copy framebuffer + */ + ret = save_vesa_mode(&vesa, &fb); + if (!ret) { + plat->copy_size = vesa.bytes_per_scanline * + vesa.y_resolution; + } + } + + return 0; +} + static const struct udevice_id efi_video_ids[] = { { .compatible = "efi-fb" }, { } @@ -216,5 +238,6 @@ U_BOOT_DRIVER(efi_video) = { .name = "efi_video", .id = UCLASS_VIDEO, .of_match = efi_video_ids, + .bind = efi_video_bind, .probe = efi_video_probe, }; From patchwork Wed Feb 22 19:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746506 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=kRCcHjUf; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQnp4WYWz23yr for ; Thu, 23 Feb 2023 06:14:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82E3D85B37; Wed, 22 Feb 2023 20:13:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kRCcHjUf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54FEA85B2B; Wed, 22 Feb 2023 20:13:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 60C3085B47 for ; Wed, 22 Feb 2023 20:13:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id e10so3836608ilu.4 for ; Wed, 22 Feb 2023 11:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ThieIVBo48RgIRyoRylcxOKEooh4eSNiS34dnsbHvJk=; b=kRCcHjUfH427/j96c+ItXvnlLwyf6Snl2fiKznbObR+TaNVZ6DFnmFKlxJRN7Wqe7V SSNlo5Me2knMFl+/WPKhoFDAZsufIUEU+pmCc+gBLhxTf0zitAkl4zYexUsByUTg+Rdz Fre9N1gPVLZGM6Ck6//vtd5p+/FWBY2KZdxKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ThieIVBo48RgIRyoRylcxOKEooh4eSNiS34dnsbHvJk=; b=c6l3ZaVR4ZLBeNQzDJW2maR6aR2VpXGWo4XmhgVR1x1urpi8Qqp5UI68Hi8DQ5igx9 z76AfmDsrZpsbQvKrdp1Ncwh8+ffCuczjjSieZaLi5AqES1d2XptbGfSkQ4hQ8wNU5PT BzikmbIR+Cwt1hOPbmtgPSmOKmCc9ZqVV6VB2a03ZOwatboT5gwFigYdxjQhW6cojWkd FCRDJbJKNGyXCUczqlDEU2QL2ZkvOy51z0/EAhaGWLiBWl6isQdOOn4ZscR93e6kWlgq +GHtSUPjBsMwDBxB0ByvAfeavbB74KnhUSGP+E9azlMVmsWTnAZB65hR84ntTy5z3KNd +u1A== X-Gm-Message-State: AO0yUKVo4kx0e8a/17HBgUGp+PnFmHu+4b8T7it/jHhNLP9BNvh2r6DS mEje1iiqyTdKFJ+MxrcOUtXq4FDBx0ilHPix X-Google-Smtp-Source: AK7set9fmNZ1y9Js6x71Hl8GlB7SlAL8AOoHnQXDojWXerphnriUU8lqVq7nsBzPmJ4kjaZ8n4kyRA== X-Received: by 2002:a05:6e02:20c8:b0:313:f9df:2f4d with SMTP id 8-20020a056e0220c800b00313f9df2f4dmr10325706ilq.29.1677093207172; Wed, 22 Feb 2023 11:13:27 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:26 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 07/13] video: Allow a copy framebuffer with pre-allocated fb Date: Wed, 22 Feb 2023 12:12:51 -0700 Message-Id: <20230222191257.1307427-8-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean At present it is not possible for the video driver to use a pre-allocated frame buffer (such as is done with EFI) with the copy framebuffer. This can be useful to speed up the display. Adjust the implementation so that copy_size can be set to the required size, with this being allocated if the normal framebuffer size is 0. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/video-uclass.c | 32 ++++++++++++++++++++++++-------- include/video.h | 2 ++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index ab482f11e5d..da89f431441 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -78,24 +78,40 @@ void video_set_flush_dcache(struct udevice *dev, bool flush) priv->flush_dcache = flush; } +static ulong alloc_fb_(ulong align, ulong size, ulong *addrp) +{ + ulong base; + + align = align ? align : 1 << 20; + base = *addrp - size; + base &= ~(align - 1); + size = *addrp - base; + *addrp = base; + + return size; +} + static ulong alloc_fb(struct udevice *dev, ulong *addrp) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); - ulong base, align, size; + ulong size; + + if (!plat->size) { + if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->copy_size) { + size = alloc_fb_(plat->align, plat->copy_size, addrp); + plat->copy_base = *addrp; + return size; + } - if (!plat->size) return 0; + } /* Allow drivers to allocate the frame buffer themselves */ if (plat->base) return 0; - align = plat->align ? plat->align : 1 << 20; - base = *addrp - plat->size; - base &= ~(align - 1); - plat->base = base; - size = *addrp - base; - *addrp = base; + size = alloc_fb_(plat->align, plat->size, addrp); + plat->base = *addrp; return size; } diff --git a/include/video.h b/include/video.h index 3f67a93bc93..4d99e5dc27f 100644 --- a/include/video.h +++ b/include/video.h @@ -24,6 +24,7 @@ struct udevice; * @base: Base address of frame buffer, 0 if not yet known * @copy_base: Base address of a hardware copy of the frame buffer. See * CONFIG_VIDEO_COPY. + * @copy_size: Size of copy framebuffer, used if @size is 0 * @hide_logo: Hide the logo (used for testing) */ struct video_uc_plat { @@ -31,6 +32,7 @@ struct video_uc_plat { uint size; ulong base; ulong copy_base; + ulong copy_size; bool hide_logo; }; From patchwork Wed Feb 22 19:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746511 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=O9pseR9Q; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQpz0CXZz23yZ for ; Thu, 23 Feb 2023 06:15:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC91B85B77; Wed, 22 Feb 2023 20:14:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="O9pseR9Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9279485B46; Wed, 22 Feb 2023 20:13:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1E05585B54 for ; Wed, 22 Feb 2023 20:13:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1720887dfcdso11169019fac.6 for ; Wed, 22 Feb 2023 11:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GUvh21m/paCZskyU6gdjjRo+m7Y/GFkcMyEBOXzrxy4=; b=O9pseR9QoTJkmg1lZMRcmCdLB/UOfI8yBA+p3Eb69qNiO7G06zSKKVmLLU6QGeGfBI 7Szm1R2YdEP7W3Jxo1kJB1CmBeMj62v9djoPX9AEAFiGzUSAv0UZyT3DY8WSEqlQ2TYV znB1H3h43Pdfs+fz7wFk98WA5Bqplmu37ih7c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GUvh21m/paCZskyU6gdjjRo+m7Y/GFkcMyEBOXzrxy4=; b=hzt3QsIsuJAGbU+ZK7UJT6mNsarqKXc4+mGjAX7+KA6zElYWEazIzGJarttS2Hc0MA QvBSmwLGqtKSz9UHzDGVbRE3gTS2zlDxd3zcVY99UHVXg7N14HU9etXKRSRGG0eRBXRy K/v7FKUyGxFZGupoj1GpUhkXAawfup30JAWspgqzqVjx3vZ/7bwsd/FO0N7fS5nkW5sl foHDPKm1bFjugXf/vw9VFq5CvTDxf28bJGTqu9kxemLXN6cS7v0TWZSNtYJTSGyt5t2x sDamN/ycYmbXlHVyTF45g3JGg5ZmNSeMtByUrFbS76ubyo7JXty/r2tmj446CC/NfCvA zDvg== X-Gm-Message-State: AO0yUKX0x17EBVpoNVKOp6PLXF4nQ4LMMDXRI+bts+RPw4Z2f7f5DPjb 68oo59g5N5gN6FNWsJg2FjLeVA8Tdqqij+SL X-Google-Smtp-Source: AK7set/BsLBonUSpIo2FAICvimpMnlTCf69Z4FIsM3xt9q3jVhJLLszz39KAtFBFrKJBH6iYYb0QFQ== X-Received: by 2002:a05:6870:1cd:b0:172:3d65:2e2f with SMTP id n13-20020a05687001cd00b001723d652e2fmr2757313oad.14.1677093208562; Wed, 22 Feb 2023 11:13:28 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:28 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass , Jason Liu , Michal Simek , Ovidiu Panait Subject: [PATCH v2 08/13] bbinfo: Show the size of the copy framebuffer Date: Wed, 22 Feb 2023 12:12:52 -0700 Message-Id: <20230222191257.1307427-9-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean If the copy framebuffer is enabled, show its size. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to show the size of the copy framebuffer with bdinfo cmd/bdinfo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index bf002f84475..a75299f822f 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -83,11 +83,15 @@ static void show_video_info(void) device_active(dev) ? "" : "in"); if (device_active(dev)) { struct video_priv *upriv = dev_get_uclass_priv(dev); + struct video_uc_plat *plat = dev_get_uclass_plat(dev); bdinfo_print_num_ll("FB base", (ulong)upriv->fb); - if (upriv->copy_fb) + if (upriv->copy_fb) { bdinfo_print_num_ll("FB copy", (ulong)upriv->copy_fb); + bdinfo_print_num_l(" copy size", + plat->copy_size); + } printf("%-12s= %dx%dx%d\n", "FB size", upriv->xsize, upriv->ysize, 1 << upriv->bpix); } From patchwork Wed Feb 22 19:12:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746521 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RVsokORB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQwH2JTHz245s for ; Thu, 23 Feb 2023 06:20:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5237F85959; Wed, 22 Feb 2023 20:18:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RVsokORB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E02E685630; Wed, 22 Feb 2023 20:18:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E6E1A85959 for ; Wed, 22 Feb 2023 20:13:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id b16so3846021iln.3 for ; Wed, 22 Feb 2023 11:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HuHnOrs+r9kDAdYXs0q9Zrxv+WNAG8KPNh/VnFq7ghY=; b=RVsokORBMJSE16TXZXJ/pvjxQuVrlIcIhznuS/vC7nRw00KM1lC9aXztSMDcBOWwPt pA7SyTcIuVsOe08oSpocnmWzbcme5/+iKrQ6713wRpMaUlLI5YgRlTBU5XNkG8HkTrjr aOBfMTQ1HP8CDNi3fBtWAuULTmEr1h7Zlv5jw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HuHnOrs+r9kDAdYXs0q9Zrxv+WNAG8KPNh/VnFq7ghY=; b=s0KCymACrR6b2KC/Mp0d/vWX+ah1DZRE5Oto50OavjnqywiZ0Tt+FKY2C4MA5vewqG nA1+dk+C9pSHuGFmt9xuH7dBW48H+wyYPNDSeYE4kO5tpsQmgADYXnTOkMfrLvKxomJb rdO7hU1kjK6GrS1hY1sJiK6N/L3Ddyk3X0bMl5CkgS1Gvl1jMdO5vKJZ+iGeVNDoytoO dW/TlwMGF4AQhMo274kgUPA342TeA2DLcexcEXo531BjNVCRKhfiIxE+YHHEQjz24xYg egV+WSSYsWvsOi2+djcT7M1O+xsP5HmcGf70afQMKHWvSg7Q6Y6xdR3Jw2OnJBjrJ0fm DwnQ== X-Gm-Message-State: AO0yUKWvP9w2oUK+B7lPL4PzgNFo88IonD2F8AdAotJVR6cMl9NMAQBZ X9SNXMUjEXc/m4pqFja7obnlW4FG6i3gZ1QX X-Google-Smtp-Source: AK7set8MMYqYVL0TnCEaIiGmqYv0eamhUgxByzXemsiHBEV7xXyeADNSw6ysBOf7cq6mGRjm6swl/Q== X-Received: by 2002:a05:6e02:1887:b0:315:29c7:49a8 with SMTP id o7-20020a056e02188700b0031529c749a8mr9794593ilu.14.1677093209321; Wed, 22 Feb 2023 11:13:29 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:29 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 09/13] efi: Adjust script to show pre-relocation output on terminal Date: Wed, 22 Feb 2023 12:12:53 -0700 Message-Id: <20230222191257.1307427-10-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean When running with video enabled, the pre-relocation output of U-Boot is currently lost. Add a -serial flag to show it on the terminal. Signed-off-by: Simon Glass --- (no changes since v1) scripts/build-efi.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/build-efi.sh b/scripts/build-efi.sh index bc9aeebbf4f..46c28807ef1 100755 --- a/scripts/build-efi.sh +++ b/scripts/build-efi.sh @@ -96,6 +96,8 @@ run_qemu() { fi if [[ -n "${serial}" ]]; then extra="-display none -serial mon:stdio" + else + extra="-serial mon:stdio" fi echo "Running ${qemu}" # Use 512MB since U-Boot EFI likes to have 256MB to play with From patchwork Wed Feb 22 19:12:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746509 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PPQcyEAd; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQpS4b0Fz23yZ for ; Thu, 23 Feb 2023 06:15:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A798285B5E; Wed, 22 Feb 2023 20:13:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PPQcyEAd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4099185B57; Wed, 22 Feb 2023 20:13:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AE23585B22 for ; Wed, 22 Feb 2023 20:13:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id b16so3846050iln.3 for ; Wed, 22 Feb 2023 11:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TDKi4GHOgoFtHpiv4Xrf5yHqQjTxWOJrxSHD36e8RJI=; b=PPQcyEAdm5EZe7R6pz5sI+R43TgQg/R0CZgCTYOm0V/B9ALnNfs5xnM+XA5EKSuy6B /J2JDnWmD7mgM+vli7cnx6d3X/c6Z2ZqlZ4MSdLFeEZB1beSdk0tUjpGFz4ycHuTm7vs YxgozVbTxVBZ34AU2ruY7RIUsfjo0MSZ69Jak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TDKi4GHOgoFtHpiv4Xrf5yHqQjTxWOJrxSHD36e8RJI=; b=uSr0LpTPWGYnCiFpjaNJtvCl6P1tpEnDyuQRBeDr1YFGUCELLsS7DoWmb44ux9GEOt CEgSqlOZ9foxNo5UapVhpa5bA6LxENcJCeXWSDUKrd4hZ/Y37HvFb89u3bfaAzC8p6FP j09uyHv7IhalGEeoI0RXphsf36H/HRMBQqlhtAZyQkTC8LYYP8RslfHPDlgcKSpF4Tar wFKCGo/xSXfLAruX9fpn7TWDMtESttqEMHrHCYj0AxaMbBIQ0dQ/utoynelygfEq5Wso iD/Th27McXbjdHTX7lWDRbxky0rcURe904RVquvIrnvzq1C4EiJgzjdrS3r7crrgAqPw 7szw== X-Gm-Message-State: AO0yUKWFn7AoM4HGbGA7eD16bKVJGn6wsC4sjeI2k7TEjDpXeZUuin7V gV5RiAaYPpImknoazxRveetlX0IjOPXWJMcx X-Google-Smtp-Source: AK7set8DEDwuaFRUxr7CrDjYZ4HpcV+z2omiPqPpDoOk0fp+j+2e1sF0FdfEr9runCBsgkpKbcUKmA== X-Received: by 2002:a05:6e02:20ee:b0:313:bbf8:29e9 with SMTP id q14-20020a056e0220ee00b00313bbf829e9mr10183882ilv.29.1677093210124; Wed, 22 Feb 2023 11:13:30 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:29 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 10/13] video: Remove duplicate cursor-positioning function Date: Wed, 22 Feb 2023 12:12:54 -0700 Message-Id: <20230222191257.1307427-11-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean There are two functions for positioning the cursor on the console. Remove one of them. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/vidconsole-uclass.c | 44 +++++++------------------------ 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 72a13d30527..9f8b8ebe8ac 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -126,26 +126,14 @@ void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y) priv->ycur = y; } -/** - * set_cursor_position() - set cursor position - * - * @priv: private data of the video console - * @row: new row - * @col: new column - */ -static void set_cursor_position(struct vidconsole_priv *priv, int row, int col) +void vidconsole_position_cursor(struct udevice *dev, uint col, uint row) { - /* - * Ensure we stay in the bounds of the screen. - */ - if (row >= priv->rows) - row = priv->rows - 1; - if (col >= priv->cols) - col = priv->cols - 1; - - priv->ycur = row * priv->y_charsize; - priv->xcur_frac = priv->xstart_frac + - VID_TO_POS(col * priv->x_charsize); + struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + short x, y; + + x = min_t(short, col, priv->cols - 1) * priv->x_charsize; + y = min_t(short, row, priv->rows - 1) * priv->y_charsize; + vidconsole_set_cursor_pos(dev, x, y); } /** @@ -192,7 +180,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) int row = priv->row_saved; int col = priv->col_saved; - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); priv->escape = 0; return; } @@ -254,7 +242,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) if (row < 0) row = 0; /* Right and bottom overflows are handled in the callee. */ - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); break; } case 'H': @@ -278,7 +266,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) if (col) --col; - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); break; } @@ -644,15 +632,3 @@ int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, return vidconsole_sync_copy(dev, dst, dst + size); } #endif - -void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row) -{ - struct vidconsole_priv *priv = dev_get_uclass_priv(dev); - struct udevice *vid_dev = dev->parent; - struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev); - short x, y; - - x = min_t(short, col * priv->x_charsize, vid_priv->xsize - 1); - y = min_t(short, row * priv->y_charsize, vid_priv->ysize - 1); - vidconsole_set_cursor_pos(dev, x, y); -} From patchwork Wed Feb 22 19:12:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746508 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=J7mttyaR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQpD6NxZz23yr for ; Thu, 23 Feb 2023 06:15:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 048B085B55; Wed, 22 Feb 2023 20:13:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="J7mttyaR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D906B85B3D; Wed, 22 Feb 2023 20:13:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2520D85B40 for ; Wed, 22 Feb 2023 20:13:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x133.google.com with SMTP id i4so2370395ils.1 for ; Wed, 22 Feb 2023 11:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ZGdxQzNT/yBhKENhAL7jysNmicmxwrsk4LboF6mR6Q=; b=J7mttyaRJE5/d6mIf/MddOpvvuHhci6utz5igm0uGMoGuoxN3rYYfmHkowcWNdb09a gKRqnxoe86Ug3Ep7BHE8cxJUk8Z2vRxtmcKDTG7s9LUOr0PvVvWreFQuL41qGfRhRNmk dMJMHrvHISt3/m7YlxXPQde5dUd+kfR6ejy9w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ZGdxQzNT/yBhKENhAL7jysNmicmxwrsk4LboF6mR6Q=; b=dGBJaJg8LI/fO1zXbGdu5s8xWJgm5lZ9ZR/0kxWhVK2KrtyIJrYY4JazeKUpTDg/lf xdnmVYfR733NbtTj04PMUQuUmrgQxbkC1qo6XWYAzdYAms0Kx2S4FK2uw4vSEI+zUm+V HTOjk1CzEKg6pSJE2yWY/ef+r8WnneQ6cF91yRV+SKp3Nu3LsKKpyrbcSeJS8q8XniOA 8pCREKEhDIKeTGEdpkB2nOMSJ4G0ftzoeMcpTBijerwi9IXY9G2HZxG6WabG+9Cr4rar tbqGk71ypor8RT+B1KMsGq7AB/R3oRNw3LrZ5cK0Ps0cowtZ7i4Ux7fRKTT3eNk/B68W fQ4g== X-Gm-Message-State: AO0yUKVH9n9V++wmTS2YiRq/pfc8zy+gC+cYOLhXqo3f4CW1vihQ/pQF IobUTEgLzhVXQ4Sy1An8LkgPGLIz2SNEU70K X-Google-Smtp-Source: AK7set8yPsmDh7qSHqsCaTp+WEeyY1F1iVRr1jWGigeaCJm428Xrj1fK1OJITUTLzjr74GK9purLmA== X-Received: by 2002:a05:6e02:1685:b0:316:f71f:fa9b with SMTP id f5-20020a056e02168500b00316f71ffa9bmr1431506ila.16.1677093210943; Wed, 22 Feb 2023 11:13:30 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:30 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 11/13] video: Clear the vidconsole rather than the video Date: Wed, 22 Feb 2023 12:12:55 -0700 Message-Id: <20230222191257.1307427-12-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It is better to clear the console device rather than the video device, since the console has the text display. We also need to reset the cursor position with the console, but not with the video device. Add a new function to handle this and update the 'cls' command to use it. Signed-off-by: Simon Glass --- (no changes since v1) cmd/cls.c | 12 ++++++++---- drivers/video/vidconsole-uclass.c | 12 ++++++++++++ include/video_console.h | 9 +++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/cmd/cls.c b/cmd/cls.c index 40a32eeab63..073ba5a6c86 100644 --- a/cmd/cls.c +++ b/cmd/cls.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #define CSI "\x1b[" @@ -19,12 +19,16 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc, /* Send clear screen and home */ printf(CSI "2J" CSI "1;1H"); - if (IS_ENABLED(CONFIG_VIDEO) && !IS_ENABLED(CONFIG_VIDEO_ANSI)) { - if (uclass_first_device_err(UCLASS_VIDEO, &dev)) + if (IS_ENABLED(CONFIG_VIDEO_ANSI)) + return 0; + + if (IS_ENABLED(CONFIG_VIDEO)) { + if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; - if (video_clear(dev)) + if (vidconsole_clear_and_reset(dev)) return CMD_RET_FAILURE; } + return CMD_RET_SUCCESS; } diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 9f8b8ebe8ac..1bb36bd66c7 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -632,3 +632,15 @@ int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, return vidconsole_sync_copy(dev, dst, dst + size); } #endif + +int vidconsole_clear_and_reset(struct udevice *dev) +{ + int ret; + + ret = video_clear(dev_get_parent(dev)); + if (ret) + return ret; + vidconsole_position_cursor(dev, 0, 0); + + return 0; +} diff --git a/include/video_console.h b/include/video_console.h index 9d2c0f210e4..aebf1d5eb99 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -276,6 +276,15 @@ int vidconsole_put_string(struct udevice *dev, const char *str); void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row); +/** + * vidconsole_clear_and_reset() - Clear the console and reset the cursor + * + * The cursor is placed at the start of the console + * + * @dev: vidconsole device to adjust + */ +int vidconsole_clear_and_reset(struct udevice *dev); + /** * vidconsole_set_cursor_pos() - set cursor position * From patchwork Wed Feb 22 19:12:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746510 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=n1bycXxb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQpj0f3Mz23yZ for ; Thu, 23 Feb 2023 06:15:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C3CF85B5D; Wed, 22 Feb 2023 20:14:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="n1bycXxb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 47CA785B2E; Wed, 22 Feb 2023 20:13:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4176185B52 for ; Wed, 22 Feb 2023 20:13:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id f9so4440859iox.2 for ; Wed, 22 Feb 2023 11:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h79/6WCry/X8Ax/6coacrtfwhcqlCHa7bwWuF9rM/C0=; b=n1bycXxbdmmw/kvEqC3HhQDcr/amlBH2E71P8Hj+2QN26gyOfNWz5w0brLfZRO1I6i PpzaFGHctSL9vEG1qXrh++yCrrllKQgv8jT7+AQmholcf43YyBcgViUX/ATXeunY6okw +p228CuZ60mn6WtW2PaRrn5EEWvMC1JYqMbHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h79/6WCry/X8Ax/6coacrtfwhcqlCHa7bwWuF9rM/C0=; b=L2mnRTjQh+cdWlWOCMTo5lD911tpTh8gZehs9I60DNwyDRiPAmKS2GxvJFn12yowed zcYqjd/dykDe3GvY/Rg/phIutdXBetrqSX+NTQxqu8g8MA2ycheVb/y2XJTmgguwSnL8 3l4bIpGddpsRg1h9GeUsXe7XIWp9x1gqDhaBe9Sn6I13Py4YDpvOZC183Yo0aoM7uHa2 qHanMl1Dj5LZFhgWEuFBdQbIdCoDLZDmuknYsYTYoei68Jf8UGxcErvq7H0ybxARmkGr MAb7XAl+wfiTiUikX2VzyTDe4advTecoYdRBZDxZPYvA6Yy6JDfroCJbanzQ46aLKFRl 235w== X-Gm-Message-State: AO0yUKXornJ5bY871X8YSjIODbjhXk4GPsNZEqTC6NUFKPFgteXVOmDt z657r8Oc0ltspsoMULUMiRmgkS6jI3YQpW8f X-Google-Smtp-Source: AK7set89/akT3yQhGz540qeSpLlb6F7HUxkT8ug9KCO8Yv2NVbARhFpiIsoDJjEtbUVjMzF8ZHK0BQ== X-Received: by 2002:a6b:7307:0:b0:713:7b7c:46d7 with SMTP id e7-20020a6b7307000000b007137b7c46d7mr1778403ioh.21.1677093211752; Wed, 22 Feb 2023 11:13:31 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:31 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 12/13] efi: Add dhrystone, dcache and scroll lines to app Date: Wed, 22 Feb 2023 12:12:56 -0700 Message-Id: <20230222191257.1307427-13-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add these options to provide some performance measurement, see cache status and slightly speed up the appallingly slow console. Signed-off-by: Simon Glass --- (no changes since v1) configs/efi-x86_app64_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/efi-x86_app64_defconfig b/configs/efi-x86_app64_defconfig index 605d49ff8cb..dae48840493 100644 --- a/configs/efi-x86_app64_defconfig +++ b/configs/efi-x86_app64_defconfig @@ -22,6 +22,7 @@ CONFIG_SYS_PBSIZE=532 # CONFIG_CMD_BOOTM is not set CONFIG_CMD_PART=y # CONFIG_CMD_NET is not set +CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -39,7 +40,9 @@ CONFIG_BOOTFILE="bzImage" CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y +CONFIG_CONSOLE_SCROLL_LINES=5 # CONFIG_REGEX is not set +CONFIG_CMD_DHRYSTONE=y # CONFIG_GZIP is not set CONFIG_EFI=y CONFIG_EFI_APP_64BIT=y From patchwork Wed Feb 22 19:12:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1746507 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fnv8HL0H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMQp14xqDz23yr for ; Thu, 23 Feb 2023 06:14:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DB3F85B47; Wed, 22 Feb 2023 20:13:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fnv8HL0H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 23ED585B37; Wed, 22 Feb 2023 20:13:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 13CC385B08 for ; Wed, 22 Feb 2023 20:13:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id b16so3846104iln.3 for ; Wed, 22 Feb 2023 11:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VsDc8VO0qvBDad2nBa7jgc3ZEnb6SReht4Lxje5pOFo=; b=fnv8HL0Huan7PC48F6BVKfXkCODKqIAPdHi+w1RuqUwopynaF7Y4ICEvAyF5nJ334e +mOoW1adyIxMd7OEdbLDR3Em0OJpYsA7C/Ov5W13GJAhC4MOfatijQw4zTHFlUxvDoCY w2LljdZXUtHRR2vfw9kLYl+dU9qLZLNriWlb8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VsDc8VO0qvBDad2nBa7jgc3ZEnb6SReht4Lxje5pOFo=; b=xPn7laPjNupbJVrBzby9fx/HXOeOY3nN9xkK1xb07PBsJBQFtcstBAH9OkZLn7xjWN jFhuINe4Zg+IBR42oDeguJAUZmGgt3ps+bPnoQDuPI3hgU67UWNzmEBH7H/yg8y21WuG aD8KZzQwnnS6uQn+gLsxfgoU8qnwykGdirF61r2YlpCNhI3YI7Llx125c14A83bC/PE6 7UTBSMOazJKd2JrePgf1pOjwq8ZsD7AZahxsenFHy6aGdsROPxL0O9p1qhPH4HIkn/17 fsn7fA7/Tj+RqeXlsnJAsTdNpe4u1RB7un6PHw8u7IZ3J78o81Rq7eeAXM8PpZvfHU7O 7Dbg== X-Gm-Message-State: AO0yUKVs27Fi9IAW8PkNrBaS9uf7FLat/NUIocVSFotlRoHMu8dWuckH +pRfownPoLQnf+q7fdljtiNBnu3M2WTwWm2U X-Google-Smtp-Source: AK7set/SIDJSKQtGXQ9fcGEJ0e0jA1/puaV4l2HOpQ5cIguBPUJ2mGl2aCT/8n739DuJSDaSRqbIMQ== X-Received: by 2002:a05:6e02:8b1:b0:314:1cff:75a8 with SMTP id a17-20020a056e0208b100b003141cff75a8mr7058789ilt.26.1677093212539; Wed, 22 Feb 2023 11:13:32 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:ba91:a998:7b71:c020]) by smtp.gmail.com with ESMTPSA id a18-20020a029992000000b0038a3b8aaf11sm1866956jal.37.2023.02.22.11.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 11:13:32 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Anatolij Gustschin , Simon Glass Subject: [PATCH v2 13/13] video: Add a note about the broken implementation Date: Wed, 22 Feb 2023 12:12:57 -0700 Message-Id: <20230222191257.1307427-14-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230222191257.1307427-1-sjg@chromium.org> References: <20230222191257.1307427-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The cls command is broken. Previous discussion about this was at [1] and [2]. For now, add a note to the source code. [1] https://patchwork.ozlabs.org/project/uboot/patch/ 20221022092058.106052-1-heinrich.schuchardt@canonical.com/ [2] https://patchwork.ozlabs.org/project/uboot/patch/ 20230106145243.411626-12-sjg@chromium.org/ Signed-off-by: Simon Glass --- (no changes since v1) cmd/cls.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/cls.c b/cmd/cls.c index 073ba5a6c86..1125a3f81bb 100644 --- a/cmd/cls.c +++ b/cmd/cls.c @@ -17,7 +17,13 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc, { __maybe_unused struct udevice *dev; - /* Send clear screen and home */ + /* + * Send clear screen and home + * + * FIXME(Heinrich Schuchardt ): This should go + * through an API and only be written to serial terminals, not video + * displays + */ printf(CSI "2J" CSI "1;1H"); if (IS_ENABLED(CONFIG_VIDEO_ANSI)) return 0;