From patchwork Thu May 28 13:13:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 477498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bilbo.ozlabs.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.1 X-Original-To: jk@ozlabs.org Delivered-To: jk@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0D50A14012C for ; Thu, 28 May 2015 23:18:39 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id E1C3A1A2B29 for ; Thu, 28 May 2015 23:18:38 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 00C011A191C for ; Thu, 28 May 2015 23:13:31 +1000 (AEST) Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 May 2015 14:13:27 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 28 May 2015 14:13:25 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2410817D8059 for ; Thu, 28 May 2015 14:14:21 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4SDDP4B24445170 for ; Thu, 28 May 2015 13:13:25 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4SDDP2e002787 for ; Thu, 28 May 2015 07:13:25 -0600 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t4SDDOYT002778; Thu, 28 May 2015 07:13:25 -0600 Received: from bahia.lab.toulouse-stg.fr.ibm.com (bahia.lab.toulouse-stg.fr.ibm.com [9.101.4.41]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id CC2282202EB; Thu, 28 May 2015 15:13:24 +0200 (CEST) Subject: [PATCH 3/3] fbuffer: introduce the invert-region-x helper From: Greg Kurz To: linuxppc-dev@lists.ozlabs.org Date: Thu, 28 May 2015 15:13:24 +0200 Message-ID: <20150528131324.5240.37470.stgit@bahia.lab.toulouse-stg.fr.ibm.com> In-Reply-To: <20150528131309.5240.71135.stgit@bahia.lab.toulouse-stg.fr.ibm.com> References: <20150528131309.5240.71135.stgit@bahia.lab.toulouse-stg.fr.ibm.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052813-0009-0000-0000-00000454035C X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , Thomas Huth , Nikunj A Dadhania , David Gibson Errors-To: linuxppc-dev-bounces+jk=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch simply moves the slow RX based logic from fb8-invert-screen to board-js2x helpers and implement a fast hv-logical-memop based helper for board-qemu. And we can drop hcall-invert-screen ! Signed-off-by: Greg Kurz Reviewed-by: Thomas Huth Reviewed-by: Nikunj A Dadhania --- board-js2x/slof/helper.fs | 5 +++++ board-qemu/slof/helper.fs | 4 ++++ board-qemu/slof/pci-device_1234_1111.fs | 10 +--------- slof/fs/fbuffer.fs | 4 +--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs index 918fdc4..ea2d584 100644 --- a/board-js2x/slof/helper.fs +++ b/board-js2x/slof/helper.fs @@ -30,3 +30,8 @@ : invert-region ( addr len -- ) 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop ; + + +: invert-region-x ( addr len -- ) + /x / 0 ?DO dup dup rx@ -1 xor swap rx! xa1+ LOOP drop +; diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs index da676c7..c807bc6 100644 --- a/board-qemu/slof/helper.fs +++ b/board-qemu/slof/helper.fs @@ -36,3 +36,7 @@ : invert-region ( addr len -- ) over swap 0 swap 1 hv-logical-memop drop ; + +: invert-region-x ( addr len -- ) + over swap /x / 3 swap 1 hv-logical-memop drop +; diff --git a/board-qemu/slof/pci-device_1234_1111.fs b/board-qemu/slof/pci-device_1234_1111.fs index a5c3584..26b0623 100644 --- a/board-qemu/slof/pci-device_1234_1111.fs +++ b/board-qemu/slof/pci-device_1234_1111.fs @@ -188,16 +188,9 @@ a CONSTANT VBE_DISPI_INDEX_NB : display-remove ( -- ) ; -: hcall-invert-screen ( -- ) - frame-buffer-adr frame-buffer-adr 3 - screen-height screen-width * screen-depth * /x / - 1 hv-logical-memop - drop -; - : hcall-blink-screen ( -- ) \ 32 msec delay for visually noticing the blink - hcall-invert-screen 20 ms hcall-invert-screen + invert-screen 20 ms invert-screen ; : display-install ( -- ) @@ -211,7 +204,6 @@ a CONSTANT VBE_DISPI_INDEX_NB disp-width char-width / disp-height char-height / disp-depth 7 + 8 / ( width height #lines #cols depth ) fb-install - ['] hcall-invert-screen to invert-screen ['] hcall-blink-screen to blink-screen true to is-installed? THEN diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs index deeba6b..fcdd2fa 100644 --- a/slof/fs/fbuffer.fs +++ b/slof/fs/fbuffer.fs @@ -170,9 +170,7 @@ CREATE bitmap-buffer 400 4 * allot ; : fb8-invert-screen ( -- ) - frame-buffer-adr screen-height screen-width * screen-depth * 2dup /x / 0 ?DO - dup rx@ -1 xor over rx! xa1+ - LOOP 3drop + frame-buffer-adr screen-height screen-width * screen-depth * invert-region-x ; : fb8-blink-screen ( -- ) fb8-invert-screen fb8-invert-screen ;