Guide to contribute to kernel video drivers

Nikola Pajkovsky n.pajkovsky at gmail.com
Mon Feb 22 11:46:01 UTC 2016


Alexander Mishurov <alexander.m.mishurov at gmail.com> writes:

> I agreed that the first thing we have to do is to move to linux
> kpi. But this step causes some questions.
>
> 1. Linux kpi is conflicting with drm_os_freebsd and drm_scatter and
> may be some other things from drm. This means we have to migrate whole
> drm core to linux kpi and therefore that affects at least radeon
> drivers. It's quite huge amount of work in comparison to only
> i915. What about existing non i915 drivers depend on drm and
> drm_os_freebsd ?
>
> 2. Move to linux kpi is not enough, I'm sure there should be one more
> layer like drm_os_freebsd on top of linux kpi with our own macros,
> inlines and other things for minimizing modifications of the original
> Linux driver sources because linux kpi covers only basic things.
>

If you start depending on drm_os_freebsd, you will very likely duplicate
work from linuxkpi. I saw, that quite lot of drivers have its own
implementation of linuxkpi. See le16_to_cpu() and le* types.

le16_to_cpu        45 contrib/ofed/include/infiniband/byteorder.h #define	le16_to_cpu	le16toh
le16_to_cpu         7 contrib/wpa/src/utils/platform.h #define le16_to_cpu		le_to_host16
le16_to_cpu        49 sys/compat/linuxkpi/common/include/asm/byteorder.h #define	le16_to_cpu	le16toh
le16_to_cpu       231 sys/dev/cxgb/cxgb_osdep.h #define le16_to_cpu(x) le16toh(x)
le16_to_cpu        11 sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_ib_intfc.h #undef le16_to_cpu
le16_to_cpu        96 sys/dev/cxgbe/osdep.h #define le16_to_cpu(x) le16toh(x)
le16_to_cpu        34 sys/dev/drm2/drm_os_freebsd.h #define	le16_to_cpu(x)	le16toh(x)
le16_to_cpu        87 sys/dev/ixgb/if_ixgb_osdep.h #define le16_to_cpu 
le16_to_cpu       162 sys/dev/ixgbe/ixgbe_osdep.h #define le16_to_cpu 
le16_to_cpu       141 sys/dev/ixl/i40e_osdep.h #define le16_to_cpu 

Since all of them are ports from linux kernel, they should have use include/asm/byteorder.h

> 3. Did anyone already start to work on moving to linux kpi?

I wanted to, but I somehow don't know, how to balance my work with
porting drm to use linuxkpi :(

-- 
Nikola


More information about the freebsd-x11 mailing list