Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754542AbbBZWCu (ORCPT ); Thu, 26 Feb 2015 17:02:50 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:47777 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969AbbBZWCs (ORCPT ); Thu, 26 Feb 2015 17:02:48 -0500 Date: Thu, 26 Feb 2015 23:02:43 +0100 From: Pavel Machek To: Scot Doyle Cc: Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Geert Uytterhoeven , linux-fbdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] fbcon: expose cursor blink interval via sysfs Message-ID: <20150226220243.GC9935@amd> References: <20150225094946.GA24627@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2243 Lines: 52 On Wed 2015-02-25 23:32:00, Scot Doyle wrote: > On Wed, 25 Feb 2015, Pavel Machek wrote: > > On Mon 2015-01-26 20:41:53, Scot Doyle wrote: > > > The fbcon cursor, when set to blink, is hardcoded to toggle display state > > > five times per second. Expose this setting via > > > /sys/class/graphics/fbcon/cursor_blink_ms > > > > > > Values written to the interface set the approximate time interval in > > > milliseconds between cursor toggles, from 1 to 32767. Since the interval > > > is stored internally as a number of jiffies, the millisecond value read > > > from the interface may not exactly match the entered value. > > > > > > An outstanding blink timer is reset after a new value is entered. > > > > > > If the cursor blink is disabled, either via the 'cursor_blink' boolean > > > setting or some other mechanism, the 'cursor_blink_ms' setting may still > > > be modified. The new value will be used if the blink is reactivated. > > > > > > Signed-off-by: Scot Doyle > > > > Normally, this would be set by ansi escape sequences, no? We can hide > > cursor using them, set its appearance.. makes sense to change timing > > value there, too.... > > Pavel > > Hi Pavel, what about something like this? For example, > "echo -e '\033[16;500]' would set the blink interval to 500 milliseconds. > > The duration is stored twice to avoid locking the console in > cursor_timer_handler(). Yes, I'd say this matches the existing code better. Acked-by: Pavel Machek > + case 16: /* set cursor blink duration in msec */ > + if (vc->vc_npar >= 1 && vc->vc_par[1] > 0 && > + vc->vc_par[1] <= USHRT_MAX) > + vc->vc_cur_blink_ms = vc->vc_par[1]; > + else Actually, vc_cur_blink_ms less then about 50 probably does not make sense (and may overload the system). Should that be checked? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/