From patchwork Fri Feb 27 19:15:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scot Doyle X-Patchwork-Id: 5902781 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C2CD9F269 for ; Fri, 27 Feb 2015 19:18:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57F7A20253 for ; Fri, 27 Feb 2015 19:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FF672020E for ; Fri, 27 Feb 2015 19:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105AbbB0TSW (ORCPT ); Fri, 27 Feb 2015 14:18:22 -0500 Received: from mx1.scotdoyle.com ([23.226.141.211]:43972 "EHLO mx1.scotdoyle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbbB0TSV (ORCPT ); Fri, 27 Feb 2015 14:18:21 -0500 Received: by mx1.scotdoyle.com (Postfix) id 93B813700024; Fri, 27 Feb 2015 19:18:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.scotdoyle.com (Postfix) with ESMTP id 5CF473700020; Fri, 27 Feb 2015 19:18:19 +0000 (UTC) Date: Fri, 27 Feb 2015 19:15:48 +0000 (UTC) From: Scot Doyle To: Tomi Valkeinen , Jean-Christophe Plagniol-Villard cc: Greg Kroah-Hartman , Jiri Slaby , Michael Kerrisk , Pavel Machek , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org Subject: [PATCH 2/2] fbcon: use the cursor blink interval provided by vt In-Reply-To: Message-ID: References: <20150225094946.GA24627@amd> <20150226220243.GC9935@amd> User-Agent: Alpine 2.11 (LNX 23 2013-08-11) MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vt now provides a cursor blink interval via vc_data. Use this interval instead of the currently hardcoded 200 msecs. Store it in fbcon_ops to avoid locking the console in cursor_timer_handler(). Signed-off-by: Scot Doyle Acked-by: Pavel Machek --- drivers/video/console/fbcon.c | 10 +++++----- drivers/video/console/fbcon.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index b972106..05b1d1a 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -402,7 +402,7 @@ static void cursor_timer_handler(unsigned long dev_addr) struct fbcon_ops *ops = info->fbcon_par; queue_work(system_power_efficient_wq, &info->queue); - mod_timer(&ops->cursor_timer, jiffies + HZ/5); + mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); } static void fbcon_add_cursor_timer(struct fb_info *info) @@ -417,7 +417,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info) init_timer(&ops->cursor_timer); ops->cursor_timer.function = cursor_timer_handler; - ops->cursor_timer.expires = jiffies + HZ / 5; + ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies; ops->cursor_timer.data = (unsigned long ) info; add_timer(&ops->cursor_timer); ops->flags |= FBCON_FLAGS_CURSOR_TIMER; @@ -1309,9 +1309,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode) if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1) return; - if (vc->vc_cursor_type & 0x10) - fbcon_del_cursor_timer(info); - else + ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); + fbcon_del_cursor_timer(info); + if (!(vc->vc_cursor_type & 0x10)) fbcon_add_cursor_timer(info); ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 6bd2e0c..7aaa4ea 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h @@ -70,6 +70,7 @@ struct fbcon_ops { struct fb_cursor cursor_state; struct display *p; int currcon; /* Current VC. */ + int cur_blink_jiffies; int cursor_flash; int cursor_reset; int blank_state;