[Buildroot] [PATCH v3 4/7] package/sunxi-mali-mainline: add support for different outputs

Giulio Benetti giulio.benetti at benettiengineering.com
Thu Oct 7 20:25:53 UTC 2021


Hi Kamel,

I've forgotten...

On 10/7/21 10:03 PM, Giulio Benetti wrote:
> Hi Kamel,
> 
> On 10/7/21 11:51 AM, Kamel Bouhara wrote:
>> From: Thomas Petazzoni<thomas.petazzoni at bootlin.com>
>>
>> Adds support for selecting one of the four display API supported: fbdev,
>> wayland, x11-dmabuf, x11-ump.
>>
>> Signed-off-by: Thomas Petazzoni<thomas.petazzoni at bootlin.com>
>> Signed-off-by: Kamel Bouhara<kamel.bouhara at bootlin.com>
>> ---
>> Changes v2 -> v3:
>>    - Moved gbm.pc install into patch 5/7
>>
>>    package/sunxi-mali-mainline/Config.in         | 26 +++++++++++++++++
>>    .../sunxi-mali-mainline.mk                    | 28 +++++++++++++++++--
>>    2 files changed, 51 insertions(+), 3 deletions(-)
>>
>> diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in
>> index a2fb95bd79..31a9152407 100644
>> --- a/package/sunxi-mali-mainline/Config.in
>> +++ b/package/sunxi-mali-mainline/Config.in
>> @@ -17,6 +17,24 @@ config BR2_PACKAGE_PROVIDES_LIBEGL
>>    config BR2_PACKAGE_PROVIDES_LIBGLES
>>    	default "sunxi-mali-mainline"
>>    
>> +choice
>> +	prompt "Output"
>> +
>> +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
>> +	bool "fbdev"
>> +
>> +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
>> +	bool "wayland"
>> +	depends on BR2_PACKAGE_WAYLAND
>> +
>> +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF
>> +	bool "x11 dma-buf"
> as done for "wayland" here ^^^ I would add "depends on BR2_PACKAGE_XORG7"
> 
>> +
>> +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP
>> +	bool "x11 ump"
> ditto
> 
>> +
>> +endchoice
>> +
>>    choice
>>    	prompt "Version"
>>    	default BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
>> @@ -27,9 +45,17 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
>>    	bool "r6p2"
>>    config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R8P1
>>    	bool "r8p1"
>> +	depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
> This is not enough because this way, when you select r8p1, you still can
> see "x11 ump" and "x11 dma-buf". So I would invert the depends on by
> removing the above one and adding the depends on
> BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2 to
> BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND/X11_DMABUF/X11_UMP
> 
> Also I would invert the order of the 2 choices, first I would place the
> Version to choose and then the Output, this way is more intuitive for me.
> 
> And please, add me to Cc since I'm the maintainer on
> sunxi-mali-mainline* in DEVELOPERS. As already pointed you on previous
> e-mail, please use ./utils/get-developers script to obtain the already
> ready git send-mail command.
> 
> Thank you!
> 
> Best regards
> -- Giulio Benetti Benetti Engineering sas
>>    
>>    endchoice
>>    
>> +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT
>> +	string
>> +	default "fbdev"		if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
>> +	default "wayland"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
>> +	default "x11_dma_buf" 	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF
>> +	default "x11_ump"     	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP
>> +
>>    config BR2_PACKAGE_SUNXI_MALI_MAINLINE_REVISION
>>    	string
>>    	default "r6p2"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
>> diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
>> index b46f572311..e058b5c3cd 100644
>> --- a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
>> +++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
>> @@ -21,22 +21,44 @@ else ifeq ($(BR2_aarch64),y)
>>    SUNXI_MALI_MAINLINE_ARCH=arm64
>>    endif
>>    
>> +SUNXI_MALI_MAINLINE_OUTPUT = $(call qstrip,$(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT))
>> +SUNXI_MALI_MAINLINE_LIB_SUBDIR = \
>> +	$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/$(SUNXI_MALI_MAINLINE_OUTPUT)
>> +
>> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF)$(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP),y)
>> +SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR = include/x11
>> +else
>> +SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR = \
>> +	include/$(SUNXI_MALI_MAINLINE_OUTPUT)
>> +define SUNXI_MALI_MAINLINE_FIXUP_EGL_PC
>> +	$(SED) "s/Cflags: /Cflags: -DMESA_EGL_NO_X11_HEADERS /" \
>> +		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
>> +endef
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND),y)
>> +SUNXI_MALI_MAINLINE_DEPENDENCIES += wayland
>> +endif

...here ^^^ you need to add the same thing for x11

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

>> +# FIXME: install gbm.pc conditionally
>>    define SUNXI_MALI_MAINLINE_INSTALL_STAGING_CMDS
>>    	mkdir -p $(STAGING_DIR)/usr/lib $(STAGING_DIR)/usr/include
>>    
>> -	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
>> +	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_LIB_SUBDIR)/*.so* \
>>    		$(STAGING_DIR)/usr/lib/
>> -	cp -rf $(@D)/include/fbdev/* $(STAGING_DIR)/usr/include/
>> +	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR)/* \
>> +		$(STAGING_DIR)/usr/include/
>>    
>>    	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/egl.pc \
>>    		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
>>    	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/glesv2.pc \
>>    		$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
>> +	$(SUNXI_MALI_MAINLINE_FIXUP_EGL_PC)
>>    endef
>>    
>>    define SUNXI_MALI_MAINLINE_INSTALL_TARGET_CMDS
>>    	mkdir -p $(TARGET_DIR)/usr/lib
>> -	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
>> +	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_LIB_SUBDIR)/*.so* \
>>    		$(TARGET_DIR)/usr/lib/
>>    endef
>>    
>>
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 



More information about the buildroot mailing list