From owner-svn-src-all@FreeBSD.ORG Fri Jan 15 15:36:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AAD106566B for ; Fri, 15 Jan 2010 15:36:05 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id D0BCF8FC08 for ; Fri, 15 Jan 2010 15:36:04 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2CF79.dip.t-dialin.net [217.226.207.121]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id C21918444CF for ; Fri, 15 Jan 2010 16:35:58 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 42E965A44D for ; Fri, 15 Jan 2010 16:35:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1263569755; bh=hs9g5cHAOLsLrOid7Fzjezu5IK9/Ac+3gMdPZgan7QI=; h=Message-ID:Date:From:To:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=dZyPdosTENrYQrgvZLcizGwLHZlKKE5aTn24573QpcE095yKr+J4YAceXRvSWQWT9 IGPFQlz6+dcF5450AXR5ycFDUBRSNgLjPkwec9s0dPQVhcCVGiuSQXojFroJpTZDJy Ax+mbacHnOYDIBXvfRFQyK2Dpu4FdM6vOc8Y/Hbb8ZxNi8ynvX8kl7gGXf/idP93rD CJZWM4iXMcg9KFm0NBcQHsE4GpVjwG4ss26Ydd5Hsal5e1uKiHskMq/3+dHAIZ6lSa hvsA7nOiHR7bViDUa0MZlr5U7z4s5NqDCFgQN4uBafHT1MMr8jMcBaM22AGJMQceX9 HCu4ppgclB+SA== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o0FFZsSU020155 for svn-src-all@freebsd.org; Fri, 15 Jan 2010 16:35:54 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Fri, 15 Jan 2010 16:35:54 +0100 Message-ID: <20100115163554.13391726rbwxezc0@webmail.leidinger.net> Date: Fri, 15 Jan 2010 16:35:54 +0100 From: Alexander Leidinger To: svn-src-all@freebsd.org References: <201001151458.o0FEwKsO005151@svn.freebsd.org> In-Reply-To: <201001151458.o0FEwKsO005151@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: C21918444CF.2DF23 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=0.937, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, MANGLED_AVOID 2.30, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1264174559.69685@CfeHzuXuWTg5ANVqFWA1og X-EBL-Spam-Status: No Subject: Re: svn commit: r202364 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Jan 2010 15:36:05 -0000 Quoting Alexander Leidinger (from Fri, 15 Jan 2010 14:58:20 +0000 (UTC)): > Author: netchild > Date: Fri Jan 15 14:58:19 2010 > New Revision: 202364 > URL: http://svn.freebsd.org/changeset/base/202364 > > Log: > This is v4l support for the linuxulator. This allows to access FreeBSD Ugh, this is the wrong commit log... here is the right one: ---snip--- Add video clipping support but with the caveats below. Background info: Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided. Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized. Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips. How the linuxulator handles this from this commit on: * if (clipcount == VIDEO_CLIP_BITMAP) The clips variable is a void * pointer to a 128*625 byte (1024*625 bit) memory area containing a bitmap of the clipping area. The pointer in the video_window structure is copied, but no video_clip structures are copied. * if (clipcount > 0 && clipcount <= 16384) The clips variable is pointer to a list of video_clip structures. Up to clipcount structures are copied and passed to the driver. The upper limit of 16384 was imposed here so that user code that does not properly initialize clipcount falls through below and no attempt is made to copy an uninitialized list. This value was found by examining Linux drivers that support the clip list. * else The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or positive (> 16384). All these cases are treated as invalid data. Both the clipcount field and clips pointer are forced to zero/NULL and passed to the driver. It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping. Submitted by: J.R. Oldroyd ---snip--- And I think I will MFC this after 1 month... Bye, Alexander. -- Bowie's Theorem: If an experiment works, you must be using the wrong equipment. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137