From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 3 16:00:23 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 153FC16A41C for ; Fri, 3 Jun 2005 16:00:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AB1E43D48 for ; Fri, 3 Jun 2005 16:00:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j53G0McQ052366 for ; Fri, 3 Jun 2005 16:00:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j53G0MRX052365; Fri, 3 Jun 2005 16:00:22 GMT (envelope-from gnats) Resent-Date: Fri, 3 Jun 2005 16:00:22 GMT Resent-Message-Id: <200506031600.j53G0MRX052365@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Antoine Brodin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C22A016A41C for ; Fri, 3 Jun 2005 15:59:09 +0000 (GMT) (envelope-from antoine@mna75-2-82-67-196-50.fbx.proxad.net) Received: from barton.dreadbsd.org (madhouse.dreadbsd.org [82.67.196.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1548D43D48 for ; Fri, 3 Jun 2005 15:59:08 +0000 (GMT) (envelope-from antoine@mna75-2-82-67-196-50.fbx.proxad.net) Received: from barton.dreadbsd.org (localhost [127.0.0.1]) by barton.dreadbsd.org (8.13.3/8.13.1) with ESMTP id j53Fx6kl028183 for ; Fri, 3 Jun 2005 17:59:06 +0200 (CEST) (envelope-from antoine@mna75-2-82-67-196-50.fbx.proxad.net) Received: (from antoine@localhost) by barton.dreadbsd.org (8.13.3/8.13.1/Submit) id j53Fx6VP028182; Fri, 3 Jun 2005 17:59:06 +0200 (CEST) (envelope-from antoine) Message-Id: <200506031559.j53Fx6VP028182@barton.dreadbsd.org> Date: Fri, 3 Jun 2005 17:59:06 +0200 (CEST) From: Antoine Brodin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/81867: ioctl collision between pcvt(4) and vga(4) after recent vesa changes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Antoine Brodin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2005 16:00:23 -0000 >Number: 81867 >Category: kern >Synopsis: ioctl collision between pcvt(4) and vga(4) after recent vesa changes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 03 16:00:21 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Antoine Brodin >Release: FreeBSD 6.0-CURRENT i386 >Organization: none >Environment: System: FreeBSD barton.dreadbsd.org 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Sun May 29 17:26:31 CEST 2005 antoine@barton.dreadbsd.org:/usr/obj/usr/src/sys/BARTON i386 >Description: I've already sent a description to current@ without feedback: http://docs.freebsd.org/cgi/mid.cgi?20050602171012.61b4568e.antoine.brodin The recent vesa changes cause a problem on my laptop. During startup, when ispcvt is called by syscons_precmd (in /etc/rc.d/syscons), it clears my screen and the screen keeps cleared. My kernel doesn't have pcvt compiled in so it's strange. I investigated a bit, and chmod'ing -x ispcvt solves the problem. vidcontrol -i mode shows that mode 369 is supported but mode 369 doesn't work so I think that there is an ioctl collision between: . this mode: _IO('V', 369 - 256) (from vga(4)) . and VGAPCVTID: _IOWR('V',113, struct pcvtid) (form pcvt(4), used by ispcvt(8)) >How-To-Repeat: Run ispcvt on a computer where mode 369 is claimed to be supported but doesn't work. The screen is cleared and it stays cleared. >Fix: Collisions must be avoided. The attached patch works: --- scvesactl.diff begins here --- Index: scvesactl.c =================================================================== RCS file: /home/ncvs/src/sys/dev/syscons/scvesactl.c,v retrieving revision 1.21 diff -u -p -r1.21 scvesactl.c --- scvesactl.c 29 May 2005 08:43:43 -0000 1.21 +++ scvesactl.c 2 Jun 2005 14:56:09 -0000 @@ -115,7 +115,9 @@ vesa_ioctl(struct cdev *dev, u_long cmd, mode = (cmd & 0xff) + M_VESA_BASE; - if ((mode > M_VESA_FULL_1280) && + /* Avoid collisions with pcvt. */ + if (((cmd & IOC_DIRMASK) == IOC_VOID) && + (mode > M_VESA_FULL_1280) && (mode < M_VESA_MODE_MAX)) return sc_set_graphics_mode(scp, tp, mode); } --- scvesactl.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: