From owner-svn-src-all@FreeBSD.ORG Fri Feb 7 15:07:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F8B8A7D; Fri, 7 Feb 2014 15:07:10 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 17FF716F6; Fri, 7 Feb 2014 15:07:09 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 6ABBBC492D; Fri, 7 Feb 2014 17:07:02 +0200 (EET) Date: Fri, 7 Feb 2014 17:10:25 +0200 From: Aleksandr Rybalko To: Ed Schouten Subject: Re: svn commit: r261585 - head/sys/dev/vt/hw/vga Message-Id: <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org> In-Reply-To: References: <201402071239.s17CdwIH007683@svn.freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:07:10 -0000 On Fri, 7 Feb 2014 15:04:47 +0100 Ed Schouten wrote: > Hi Aleksandr, > > On 7 February 2014 13:39, Aleksandr Rybalko wrote: > > +static void > > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) > > +{ > > +} > > + > > +static void > > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, > > + term_color_t color) > > +{ > > +} > > + > > static inline void > > vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, > > u_long ldst, uint8_t shift, unsigned int width, unsigned int height, > > My question is, why do the setpixel and drawrect functions take signed > coordinates, whereas bitblt does not? Wouldn' it be better to use > unsigned coordinates all over the place? Theoretically unsigned a bit better, practically does not matter (+/-2G or 4G). Using signed int we also can ask to draw object which is partially out of screen. (and strlen("int") < strlen("unsigned int") :)) If you have objections, let discuss it. Also people asking me about advanced features of vt(9), like use multiple displays. I'm not sure, but signed coordinates may help with some things on that way (or makes more problems :) ). > > Furthermore, I think it's a bit weird that vga_bitbltchr() contains > explicit bounds checking. What happened there? I remember at one point > in time, we had the nice invariant that vt(9) never attempted to draw > outside of the display resolution. What caused us to give up on that? Mouse cursor allowed to partially go out of screen, so we have to check (or use special function for mouse cursor). > > -- > Ed Schouten -- Aleksandr Rybalko