From owner-svn-src-head@freebsd.org Wed Feb 22 19:42:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12546CE6113; Wed, 22 Feb 2017 19:42:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A715E89A; Wed, 22 Feb 2017 19:42:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f67.google.com with SMTP id v77so2143919wmv.0; Wed, 22 Feb 2017 11:42:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=XwmjiGG4/4g2aZjA1R/W4W7Vj3IjhAzVDAoHEca/Kos=; b=KI2ngqsFO3oBLbWARdohV0XwovBfDwGK0QJdcJEiyt71tG2KHDYXFybyq4MLKkYNIv r8cj1jvfCi/AEEK/QInrtrW/NBR7Fj0wv8ofIhbUmfPdQo/1cBQaGdwr+deexbeWsVpC DB/3GFCv49DEMWz2TJ74JPkJiZtJcYB6D9V2lMEyJ8YPbgwcNVbUxNQNVs+zo2RGnvWw YdZMrThR/8JJks0gzqEqoPfqDTDZZOH4imk2e7/isJat35MwA0sQ9vb6EhHVuj+6Jq0h Nt3goywdV4xsfpYLi5PQ/68ldt1EqhYXquspy1gVDKD1jMx29Xuo+jiOOgcMlTnFbHcN wOuw== X-Gm-Message-State: AMke39nWp+ucs7vzWFh6Dh3iEOMklSvNG+xMEKtu6H50jObIGI9QO363ksRoFvJjouVmXg== X-Received: by 10.28.45.213 with SMTP id t204mr3850757wmt.113.1487792546748; Wed, 22 Feb 2017 11:42:26 -0800 (PST) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com. [74.125.82.51]) by smtp.gmail.com with ESMTPSA id 186sm3732071wmw.24.2017.02.22.11.42.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Feb 2017 11:42:26 -0800 (PST) Received: by mail-wm0-f51.google.com with SMTP id t18so37246824wmt.0; Wed, 22 Feb 2017 11:42:26 -0800 (PST) X-Received: by 10.28.174.14 with SMTP id x14mr3798387wme.75.1487792546465; Wed, 22 Feb 2017 11:42:26 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.152.82 with HTTP; Wed, 22 Feb 2017 11:42:25 -0800 (PST) In-Reply-To: <201702221931.v1MJV3nm034253@repo.freebsd.org> References: <201702221931.v1MJV3nm034253@repo.freebsd.org> From: Conrad Meyer Date: Wed, 22 Feb 2017 11:42:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r314105 - head/sys/compat/linuxkpi/common/include/linux To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 22 Feb 2017 19:42:35 -0000 On Wed, Feb 22, 2017 at 11:31 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Feb 22 19:31:02 2017 > New Revision: 314105 > URL: https://svnweb.freebsd.org/changeset/base/314105 > > Log: > Improve LinuxKPI scatter list support. > > The i915kms driver in Linux 4.9 reimplement parts of the scatter list > functions with regards to performance. In other words there is not so > much room for changing structure layouts and functionality if the > i915kms should be built AS-IS. This patch aligns the scatter list > support to what is expected by the i915kms driver. Remove some > comments not needed while at it. > > ... > > +CTASSERT((sizeof(struct scatterlist) & 0x3) == 0); > + > struct sg_table { > struct scatterlist *sgl; > unsigned int nents; > @@ -56,58 +55,79 @@ struct sg_page_iter { > struct scatterlist *sg; > unsigned int sg_pgoffset; > unsigned int maxents; > + struct { > + unsigned int nents; > + int pg_advance; > + } internal; > }; > > #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) > > +#define SG_MAGIC 0x87654321UL > + > +#define sg_is_chain(sg) ((sg)->page_link & 0x01) > +#define sg_is_last(sg) ((sg)->page_link & 0x02) > +#define sg_chain_ptr(sg) \ > + ((struct scatterlist *) ((sg)->page_link & ~0x03)) Hi Hans, Thanks for all of the linuxkpi work you've done lately. i915 support is very important to me! It would be nice to have some named constants for these masks. The bare numbers are used throughout this change. Thanks, Conrad