From patchwork Tue Jul 17 13:30:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?I=C3=B1igo_Huguet?= X-Patchwork-Id: 945068 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=fanamoel.com Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=fanamoel.com header.i=@fanamoel.com header.b="ShxgJc0h"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41VMXd18l5z9rxs for ; Wed, 18 Jul 2018 00:06:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7CE1189540; Tue, 17 Jul 2018 14:06:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V6jrKy8nvvuK; Tue, 17 Jul 2018 14:06:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C0B44897C4; Tue, 17 Jul 2018 14:06:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D2FCB1C0D83 for ; Tue, 17 Jul 2018 14:06:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D08C5897CF for ; Tue, 17 Jul 2018 14:06:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ucv7PMVjf7bQ for ; Tue, 17 Jul 2018 14:06:02 +0000 (UTC) X-Greylist: delayed 00:34:25 by SQLgrey-1.7.6 Received: from europa.20disenoweb.com (europa.20disenoweb.com [164.138.212.123]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3987B897B0 for ; Tue, 17 Jul 2018 14:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fanamoel.com; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=okvOWJI4CWGy5VEoa2hAPzRbIrHd9SgcP9fREb+T1cg=; b=ShxgJc0hdMSE8qZWIaTUnWbnCc KkrT8pcteR/YBFDtKWKy8xYZPT3i6GUCao6rFHnoagWnbO9sOFJQQo6CHlKc+bmzy2Oq2XPhHEh45 9sGrrmAijGw/jJ/Mupclp4kCcUML/UbJJeR0R4oz2v3cJlqlV0fSoppwYsbOB9jkqgVKrPnZntGbQ Xhtg52+47jt6ccZG/5X+xERIJ5BgZkrKF7VSa/QSoWpblOnGrtu0mHyc7kYeM/KTbbLl08xiSS4r/ BP8BdF03bIUWj4VsFEI0IZbz6uHaYst9yoeshwnGiAhZvQOg6QjvlPw82P1FVeKbGsgld3dt4mbna 3dh8fV/A==; Received: from 202.red-2-141-4.dynamicip.rima-tde.net ([2.141.4.202] helo=localhost.localdomain) by europa.20disenoweb.com with esmtpa (Exim 4.91) (envelope-from ) id 1ffQ4w-00053W-11; Tue, 17 Jul 2018 15:31:46 +0200 From: =?utf-8?q?I=C3=B1igo_Huguet?= To: buildroot@buildroot.org Date: Tue, 17 Jul 2018 15:30:36 +0200 Message-Id: <1531834236-23072-1-git-send-email-inigohuguet@fanamoel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Authenticated-Id: inigohuguet@fanamoel.com Subject: [Buildroot] [PATCH 1/1] package/sunxi-mali: allow EGL type = X11 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: inigohuguet@hotmail.com, =?utf-8?q?I=C3=B1igo_Huguet?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch allow to use sunxi-mali for OpenGLES acceleration for apps running on top of X11 with EGL interface. For example, QT Quick 2 apps have to use GLX or EGL to run in an X server, but GLX is not always available, specially in OpenGLES only capable systems, like the ones with GPU Mali. Signed-off-by: IƱigo Huguet --- package/sunxi-mali/Config.in | 30 ++++++++++++++++++++++++++++++ package/sunxi-mali/sunxi-mali.mk | 32 +++++++++++++++++++++++++++----- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/package/sunxi-mali/Config.in b/package/sunxi-mali/Config.in index 554ee68..aa7a3fb 100644 --- a/package/sunxi-mali/Config.in +++ b/package/sunxi-mali/Config.in @@ -17,6 +17,9 @@ config BR2_PACKAGE_SUNXI_MALI either the sunxi-kernel with the ARM Mali driver enabled or the installation of the ARM Mali drivers as an external module. + + Note: for recent kernels (>4.4) consider using package + sunxi-mali-mainline instead. http://github.com/linux-sunxi/sunxi-mali @@ -36,6 +39,29 @@ config BR2_PACKAGE_SUNXI_MALI_DBG version. choice + prompt "EGL Type" + default BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_FB + help + If you are going to run your OpenGLES accelerated programs + directly on the framebuffer, choose framebuffer. If you are + going to run them over X11, choose X11. + +config BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_FB + bool "framebuffer" + +config BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_X11 + bool "X11" + select BR2_PACKAGE_LIBDRI2 + select BR2_PACKAGE_XLIB_LIBX11 + depends on BR2_PACKAGE_XORG7 + depends on BR2_TOOLCHAIN_HAS_THREADS # libdri2->libdrm + +comment "X11 EGL type needs Xorg and a toolchain with threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_PACKAGE_XORG7 + +endchoice + +choice prompt "Version" default BR2_PACKAGE_SUNXI_MALI_R3P0 help @@ -49,6 +75,10 @@ config BR2_PACKAGE_SUNXI_MALI_R3P0 config BR2_PACKAGE_SUNXI_MALI_R3P1 bool "r3p1" + depends on BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_FB + +comment "r3p1 version only available for framebuffer EGL type" + depends on BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_X11 endchoice diff --git a/package/sunxi-mali/sunxi-mali.mk b/package/sunxi-mali/sunxi-mali.mk index 90b580f..c826fc8 100644 --- a/package/sunxi-mali/sunxi-mali.mk +++ b/package/sunxi-mali/sunxi-mali.mk @@ -28,8 +28,15 @@ SUNXI_MALI_MAKE_ENV = \ CFLAGS="$(TARGET_CFLAGS) -lm -ldl -lpthread" \ $(TARGET_MAKE_ENV) -SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer \ - ABI=armhf +SUNXI_MALI_MAKE_OPTS += ABI=armhf + +ifeq ($(BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_X11),y) +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=x11 +SUNXI_MALI_DEPENDENCIES += xlib_libX11 libdri2 +endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_FB),y) +SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer +endif ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y) SUNXI_MALI_MAKE_OPTS += VERSION=r3p0 @@ -38,10 +45,23 @@ ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y) SUNXI_MALI_MAKE_OPTS += VERSION=r3p1 endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI_DBG)$(BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_X11),yy) +SUNXI_MALI_TEST_MAKE_ENV = \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -lm -ldl -lpthread -lX11" \ + $(TARGET_MAKE_ENV) +endif +ifeq ($(BR2_PACKAGE_SUNXI_MALI_DBG)$(BR2_PACKAGE_SUNXI_MALI_EGL_TYPE_FB),yy) +SUNXI_MALI_TEST_MAKE_ENV = $(SUNXI_MALI_MAKE_ENV) +endif + + define SUNXI_MALI_BUILD_CMDS $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all - $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version \ - $(@D)/version/version.c + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), + $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version \ + $(@D)/version/version.c + ) endef define SUNXI_MALI_INSTALL_STAGING_CMDS @@ -49,7 +69,9 @@ define SUNXI_MALI_INSTALL_STAGING_CMDS $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install # test must be built after install because it depends on headers that are # generated during the install above. - $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test + $(if $(BR2_PACKAGE_SUNXI_MALI_DBG), + $(SUNXI_MALI_TEST_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test + ) $(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc \ $(STAGING_DIR)/usr/lib/pkgconfig/egl.pc $(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc \