Date: Wed, 22 Feb 2017 11:42:25 -0800 From: Conrad Meyer <cem@freebsd.org> To: Hans Petter Selasky <hselasky@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314105 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <CAG6CVpX%2Bgxf8-H%2BdDMq-2--QJxwwtT3RA%2BU=sW-NWmd4cByssQ@mail.gmail.com> In-Reply-To: <201702221931.v1MJV3nm034253@repo.freebsd.org> References: <201702221931.v1MJV3nm034253@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 22, 2017 at 11:31 AM, Hans Petter Selasky <hselasky@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpX%2Bgxf8-H%2BdDMq-2--QJxwwtT3RA%2BU=sW-NWmd4cByssQ>