From owner-svn-src-head@FreeBSD.ORG Tue Jun 18 20:19:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 541A5563; Tue, 18 Jun 2013 20:19:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1991138; Tue, 18 Jun 2013 20:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IKJATg097784; Tue, 18 Jun 2013 20:19:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IKJ9YG097781; Tue, 18 Jun 2013 20:19:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306182019.r5IKJ9YG097781@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jun 2013 20:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251961 - in head/sys/dev: drm2/i915 syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 20:19:10 -0000 Author: kib Date: Tue Jun 18 20:19:09 2013 New Revision: 251961 URL: http://svnweb.freebsd.org/changeset/base/251961 Log: On some generations of the Intel GPU, disabling of the VGA Display stops updating the vertical retrace indicator. The text mouse renderer in syscons is executing from the callout and spins waiting for the start of next frame. As result, after the X server finishes, since the VGA cannot be turned on, but syscons does not know about this, the clock swi spins forever. Hack around the problem by disabling wait for the retrace if KMS is activated. Diagnosed and tested by: Michiel Boland Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- head/sys/dev/drm2/i915/intel_fb.c Tue Jun 18 20:02:52 2013 (r251960) +++ head/sys/dev/drm2/i915/intel_fb.c Tue Jun 18 20:19:09 2013 (r251961) @@ -207,6 +207,8 @@ static void intel_fbdev_destroy(struct d } } +extern int sc_txtmouse_no_retrace_wait; + int intel_fbdev_init(struct drm_device *dev) { struct intel_fbdev *ifbdev; @@ -229,6 +231,7 @@ int intel_fbdev_init(struct drm_device * drm_fb_helper_single_add_all_connectors(&ifbdev->helper); drm_fb_helper_initial_config(&ifbdev->helper, 32); + sc_txtmouse_no_retrace_wait = 1; return 0; } Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Tue Jun 18 20:02:52 2013 (r251960) +++ head/sys/dev/syscons/scvgarndr.c Tue Jun 18 20:19:09 2013 (r251961) @@ -395,6 +395,8 @@ vga_txtblink(scr_stat *scp, int at, int { } +int sc_txtmouse_no_retrace_wait; + #ifndef SC_NO_CUTPASTE static void @@ -445,7 +447,9 @@ draw_txtmouse(scr_stat *scp, int x, int #if 1 /* wait for vertical retrace to avoid jitter on some videocards */ crtc_addr = scp->sc->adp->va_crtc_addr; - while (!(inb(crtc_addr + 6) & 0x08)) /* idle */ ; + while (!sc_txtmouse_no_retrace_wait && + !(inb(crtc_addr + 6) & 0x08)) + /* idle */ ; #endif c = scp->sc->mouse_char; vidd_load_font(scp->sc->adp, 0, 32, 8, font_buf, c, 4);