[meta-freescale] [meta-fsl-arm PATCH v2 00/16] Machine overrides extender - reduce code duplication

Tom Hochstein tom.hochstein at nxp.com
Mon Sep 5 18:13:12 PDT 2016


> From: Otavio Salvador [mailto:otavio.salvador at ossystems.com.br]
> Sent: Monday, September 05, 2016 12:18 PM

> I know how this works BUT people assumes machine features are to be
> enabled/disabled on machine basis, that is the main reason I did not
> use it.

Okay, so assume we chose to implement using machine features, and a user has disabled a machine feature using MACHINE_FEATURES_remove. I guess he will have no problem (other than his faulty understanding) since the feature will be disabled as he wants. Is there some other problem?

> The way I designed it, the extender is applied on the BSP level so it
> provides the lift of features the SoC supports. If you want to change
> something in a recipe or so, it will be applied globally and then
> making it harder for people to make a frankenstein.

Okay, but an implementation using MACHINE_FEATURES would not be any different. Each machine configuration file would include a new SOC configuration file, like this one for 6 Quad:

GPU_FEATURES = "imxipu imxvpu imxgpu2d imxgpu3d"
MACHINE_FEATURES += "${GPU_FEATURES}"
DISTRO_FEATURES_DEFAULT += "${GPU_FEATURES}"

And here's how the gstreamer1.0-plugins-imx recipe would set its package config:

PACKAGECONFIG ?= "uniaudiodec mp3encoder v4l2src \
    ${@bb.utils.contains('COMBINED_FEATURES', 'imxpxp', 'pxp', '', d)} \
    ${@bb.utils.contains('COMBINED_FEATURES', 'imxgpu2d', 'g2d', '', d)} \
    ${@bb.utils.contains('COMBINED_FEATURES', 'imxgpu3d', 'eglvivsink', '', d)} \
    ${@bb.utils.contains('COMBINED_FEATURES', 'imxipu', 'ipu', '', d)} \
    ${@bb.utils.contains('COMBINED_FEATURES', 'imxvpu', 'vpu', '', d)} \
"

I see no problems with this design. It provides all the required functionality, plus it relies on a well-defined, existing model for enabling and disabling hardware features.

On the other hand, the override extender design adds complexity to the implementation of MACHINE, and complicates the model by adding this new SOC type of hardware feature. Also, relying on the variable override mechanism is a weakness, as we have seen the existing SOC override design to be error-prone due to the intricacies of the override mechanism. The override extender design does reduce the use of overrides, but it seems to me like we could still have some trouble with the 2d and 3d overrides.
	
Tom



More information about the meta-freescale mailing list