Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp303131pxx; Thu, 29 Oct 2020 03:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrLLMWggKC/Ww5TmFupKyazVZy8ysrJhHeiqA+AK/cAcil/N6wgB3emMU0mBXRnjmckcTK X-Received: by 2002:a17:907:4273:: with SMTP id nq3mr3346462ejb.439.1603965935725; Thu, 29 Oct 2020 03:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603965935; cv=none; d=google.com; s=arc-20160816; b=SyqbuLF1yJ2dEe0fJD8BkoHhsSg6dfaBt9QAdhGYvD/TFWebWX0gWorFF8VMQpIXP7 I6tbrhGotNYjX0bMnzb70rraAPz0y7eKiRpFIa8dtL4/gGwUxrIuA0Mxpka/b8uGp3zP wUtCbvEMwo4uzs9hBkzW1fhxTokbl26rUvB1BAOJ2i4ai0H4p1sRAqFPf87aYlLuEKjp gwLXXZ7iiNoOj2KSi2YDjE0H0T9IxW5wt6fqfJrdCGFnvoZfeqpdGg7JIDY7FA1XCL0w /S9Y76u5p9I69cx5PZTpf+BYPkD9UbVM15xYhfyWi9f9bt/kFefwyPTMmEnX3JnbhQBj dQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iwALOekzRrBbIeUXiCxJAjQ6lts1QD32NwN0mPcskCA=; b=l3CTvtO7EjR1VwuNUAr11dtTJxO2PCPVUJ0a1hIF3/U4LvLY50vlO7lwuz6i2AeP1a uCmxsSumM3Ge12ZjOHauOpA+TPVBJdYD6CEM+Z0UPnLPZ0sPbEsRz0XAMSU/hVOyurqx cMoRCB9ehIsKpUSqj+h1ieSGQmMZBCXrEWz5TJBD/HogY0boNMKJbH4JzifSf4XY76jC dfJacOF7P+hqB9k9DWERlK9ouZVQ7XIsxwXS9U1to92cn5MzCYj+bP3O89Bl1RPnPp6P iIm4XSwG0tv5Y/2B60oUxGuVPTYzGAIs+TSf/qnPr0quHdpjKPi4kEIFRwxgCySwq2xe LYew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si1484874ejd.44.2020.10.29.03.05.12; Thu, 29 Oct 2020 03:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbgJ2J6U (ORCPT + 99 others); Thu, 29 Oct 2020 05:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbgJ2J6M (ORCPT ); Thu, 29 Oct 2020 05:58:12 -0400 Received: from smtp3-1.goneo.de (smtp3.goneo.de [IPv6:2001:1640:5::8:37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0291C0613DD for ; Thu, 29 Oct 2020 02:58:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.goneo.de (Postfix) with ESMTP id B32E4240294; Thu, 29 Oct 2020 10:58:09 +0100 (CET) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.945 X-Spam-Level: X-Spam-Status: No, score=-2.945 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.045, BAYES_00=-1.9] autolearn=ham Received: from smtp3.goneo.de ([127.0.0.1]) by localhost (smtp3.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 853NK8BiitY4; Thu, 29 Oct 2020 10:58:08 +0100 (CET) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp3.goneo.de (Postfix) with ESMTPA id 2CFD924029E; Thu, 29 Oct 2020 10:58:08 +0100 (CET) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel , Willy Tarreau Subject: [PATCH v5 23/25] auxdisplay: charlcd: Do not print chars at end of line Date: Thu, 29 Oct 2020 10:57:27 +0100 Message-Id: <20201029095731.311528-22-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029095731.311528-1-poeschel@lemonage.de> References: <20201029095231.311083-1-poeschel@lemonage.de> <20201029095731.311528-1-poeschel@lemonage.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel Skip printing characters at the end of a display line. This fits to the behaviour we already had, that the cursor is nailed to last position of a line. This might slightly change behaviour. On hd44780 displays with one or two lines the previous implementation did still write characters to the buffer of the display even if they are currently not visible. The shift_display command could be used so set the "viewing window" to a new position in the buffer and then you could see the characters previously written. This described behaviour does not work for hd44780 displays with more than two display lines. There simply is not enough buffer. So the behaviour was a bit inconsistens across different displays. The new behaviour is to stop writing character at the end of a visible line, even if there would be room in the buffer. This allows us to have an easy implementation, that should behave equal on all supported displays. This is not hd44780 hardware dependents anymore. Reviewed-by: Willy Tarreau Signed-off-by: Lars Poeschel --- Changes in v3: - Better patch description --- drivers/auxdisplay/charlcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index ef10b5ca0e16..f43430e9dcee 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -111,6 +111,9 @@ static void charlcd_home(struct charlcd *lcd) static void charlcd_print(struct charlcd *lcd, char c) { + if (lcd->addr.x >= lcd->width) + return; + if (lcd->char_conv) c = lcd->char_conv[(unsigned char)c]; -- 2.28.0