From patchwork Mon Jul 31 19:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9873025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7931B6037D for ; Mon, 31 Jul 2017 19:10:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E9E0285CF for ; Mon, 31 Jul 2017 19:10:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D03D285E4; Mon, 31 Jul 2017 19:10:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100CD285DA for ; Mon, 31 Jul 2017 19:10:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbdGaTKB (ORCPT ); Mon, 31 Jul 2017 15:10:01 -0400 Received: from vern.gendns.com ([206.190.152.46]:35887 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdGaTJ7 (ORCPT ); Mon, 31 Jul 2017 15:09:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BD9ID/LBexTnR/iXitbnTgb4Ot88jaHoqWDJ1BjEBY0=; b=k6BwSGOESmqACWsaVQcCsykH0 Qy1MVFL6NwrvmiYhQc74p1BQjANBPay0IMAa5AnSSeabkPGGSOUDY1TyJmJHIjeRBTRLpK7xIw5VX 4g+oeI3QP9wMw2USy8C5UcvKNA9g/7TzKZjWI1mFIk7oXTeXkTiPAttvP8z1wJwLoc0HEvQ67q/O0 HGvYatqZQMnO7r4UF3Y30QEpoAvzUUGZJfUrQQV7myaJrbbulRArETBoeCkOsPr0eb0YnU6Kvsl6t RobdNqR2sWPHM4EzEu4dn6azAHcS7bMKdxHd2v+c5RtemRtx8717GZ2s9ZSFJX0u8+3cheyzqHKlS pQXo0ZS7w==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:43550 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1dcG25-002KeC-4P; Mon, 31 Jul 2017 15:07:13 -0400 From: David Lechner To: linux-fbdev@vger.kernel.org Cc: David Lechner , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] fbcon: Invert margin colors when terminal is inverted Date: Mon, 31 Jul 2017 14:09:44 -0500 Message-Id: <1501528185-9976-2-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501528185-9976-1-git-send-email-david@lechnology.com> References: <1501528185-9976-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This uses white (7) for the margin color when a fbcon terminal is inverted, e.g. with `setterm -inverse on`. The motivation for this is screens where the black does not blend into the screen. For example, using an LCD (not the backlit kind), white text on a black background is hard to read, so inverting the colors is preferred. However, if the margins are not also inverted, it leaves ugly black bars on the right and bottom of the text area. Signed-off-by: David Lechner --- drivers/video/console/bitblit.c | 2 +- drivers/video/console/fbcon_ccw.c | 2 +- drivers/video/console/fbcon_cw.c | 2 +- drivers/video/console/fbcon_ud.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index dbfe4ee..13cad9e 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -213,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bs = info->var.yres - bh; struct fb_fillrect region; - region.color = 0; + region.color = vc->vc_decscnm ? 7 : 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c index 5a3cbf6..371f0155 100644 --- a/drivers/video/console/fbcon_ccw.c +++ b/drivers/video/console/fbcon_ccw.c @@ -198,7 +198,7 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bs = vc->vc_rows*ch; struct fb_fillrect region; - region.color = 0; + region.color = vc->vc_decscnm ? 7 : 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c index e7ee44d..541e66c 100644 --- a/drivers/video/console/fbcon_cw.c +++ b/drivers/video/console/fbcon_cw.c @@ -181,7 +181,7 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int rs = info->var.yres - rw; struct fb_fillrect region; - region.color = 0; + region.color = vc->vc_decscnm ? 7 : 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c index 19e3714..61fe137 100644 --- a/drivers/video/console/fbcon_ud.c +++ b/drivers/video/console/fbcon_ud.c @@ -228,7 +228,7 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bh = info->var.yres - (vc->vc_rows*ch); struct fb_fillrect region; - region.color = 0; + region.color = vc->vc_decscnm ? 7 : 0; region.rop = ROP_COPY; if (rw && !bottom_only) {