svn commit: r314105 - head/sys/compat/linuxkpi/common/include/linux

Conrad Meyer cem at freebsd.org
Wed Feb 22 19:42:35 UTC 2017


On Wed, Feb 22, 2017 at 11:31 AM, Hans Petter Selasky
<hselasky at 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


More information about the svn-src-all mailing list