From patchwork Mon Nov 13 17:11:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 837485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=micronovasrl.com header.i=@micronovasrl.com header.b="AC2NKHtE"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ybHHN5Xmdz9sBW for ; Tue, 14 Nov 2017 04:11:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 95FDD8310A; Mon, 13 Nov 2017 17:11:36 +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 yOq0wrz6GIQd; Mon, 13 Nov 2017 17:11:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 176EB875BB; Mon, 13 Nov 2017 17:11:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 08A4B1C2CC3 for ; Mon, 13 Nov 2017 17:11:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 020C52FCE2 for ; Mon, 13 Nov 2017 17:11:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eEW7t456OJ2P for ; Mon, 13 Nov 2017 17:11:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10]) by silver.osuosl.org (Postfix) with ESMTP id 2730825AC2 for ; Mon, 13 Nov 2017 17:11:32 +0000 (UTC) Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id D9148B00CFF for ; Mon, 13 Nov 2017 18:11:30 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=x-mailer:message-id:date:date:subject:subject:to:from:from; s=dkim; t=1510593090; x=1511457091; bh=iprkMiSmXmBYWU9tG59iv/TY 6ZbqU49/4CN2LuZsXuE=; b=AC2NKHtEh1NPCTw4tJLcFGgj5CLH8LbRgWC7QusX cwBFU0rWFuynd1f0AFsyHF+2TPh2T9lQxvP6Gc/3odW5htE/mqdsGiEN/DZWbMe0 pHIceEQFPYDtJIzjkN/gS0R0IHQmc9CGJLRPLHYlrSeLwXeu6as/4swr2MAHrhzc QRE= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GKgf-L8LVy_U for ; Mon, 13 Nov 2017 18:11:30 +0100 (CET) Received: from localhost.localdomain (benettig-pc.dominio.micronovasrl.com [192.168.123.215]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 170C6B00B1B; Mon, 13 Nov 2017 18:11:30 +0100 (CET) From: Giulio Benetti To: buildroot@buildroot.org Date: Mon, 13 Nov 2017 18:11:24 +0100 Message-Id: <1510593084-14702-1-git-send-email-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH v2 1/1] sunxi-mali-mainline: new package 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: thomas.petazzoni@free-electrons.com, maxime.ripard@free-electrons.com, Giulio Benetti MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add Allwinner Mali openGL userspace driver r6p2. Used combined with kernelspace Mali driver, it gives possibility to use 3D openGL SoC acceleration. It provides both fbdev and X11 libraries and headers. It is compatible with Linux >= 4.4 as sunxi-mali-driver-mainline. Signed-off-by: Giulio Benetti --- Changes v1 -> v2: * add X11 dependencies * cleaned up .mk to respect 80 columns * used github macro * added myself to DEVELOPERS DEVELOPERS | 1 + package/sunxi-mali-mainline/Config.in | 43 +++++++++++++++ package/sunxi-mali-mainline/egl.pc | 12 +++++ package/sunxi-mali-mainline/glesv2.pc | 12 +++++ package/sunxi-mali-mainline/sunxi-mali-mainline.mk | 62 ++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 package/sunxi-mali-mainline/Config.in create mode 100644 package/sunxi-mali-mainline/egl.pc create mode 100644 package/sunxi-mali-mainline/glesv2.pc create mode 100644 package/sunxi-mali-mainline/sunxi-mali-mainline.mk diff --git a/DEVELOPERS b/DEVELOPERS index 2fe95c8..1a751b8 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -697,6 +697,7 @@ F: package/webp/ N: Giulio Benetti F: package/sunxi-mali-driver-mainline/ +F: package/sunxi-mali-mainline/ N: Gregory Dymarek F: package/ding-libs/ diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in new file mode 100644 index 0000000..652cbc5 --- /dev/null +++ b/package/sunxi-mali-mainline/Config.in @@ -0,0 +1,43 @@ +config BR2_PACKAGE_SUNXI_MALI_MAINLINE + bool "sunxi-mali-mainline" + depends on BR2_arm + depends on BR2_ARM_EABIHF + depends on BR2_TOOLCHAIN_USES_GLIBC + select BR2_PACKAGE_HAS_LIBEGL + select BR2_PACKAGE_HAS_LIBGLES + select BR2_PACKAGE_LIBDRM if BR2_PACKAGE_XORG7 + select BR2_PACKAGE_XLIB_LIBX11 if BR2_PACKAGE_XORG7 + select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_XORG7 + select BR2_PACKAGE_XLIB_LIBXFIXES if BR2_PACKAGE_XORG7 + select BR2_PACKAGE_XLIB_LIBXDAMAGE if BR2_PACKAGE_XORG7 + help + Install the ARM Mali drivers for sunxi based systems (i.e + systems based on ARM Allwinner SoCs). This driver requires + either the sunxi-kernel with the ARM Mali driver enabled or + the installation of the ARM Mali drivers as an external + module. + +if BR2_PACKAGE_SUNXI_MALI_MAINLINE + +config BR2_PACKAGE_PROVIDES_LIBEGL + default "sunxi-mali-mainline" + +config BR2_PACKAGE_PROVIDES_LIBGLES + default "sunxi-mali-mainline" + +choice + prompt "Version" + default BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2 + help + Select the version of the kernel module. + +config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2 + bool "r6p2" + +endchoice + +endif + +comment "sunxi-mali needs an EABIhf glibc toolchain" + depends on BR2_arm + depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_ARM_EABIHF diff --git a/package/sunxi-mali-mainline/egl.pc b/package/sunxi-mali-mainline/egl.pc new file mode 100644 index 0000000..3854e5f --- /dev/null +++ b/package/sunxi-mali-mainline/egl.pc @@ -0,0 +1,12 @@ +prefix=/usr/ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: egl +Description: ARM Mali implementation of EGL +Version: 1.4 +Requires: +Libs: -L${libdir} -lEGL -lGLESv2 +Cflags: -I${includedir} + diff --git a/package/sunxi-mali-mainline/glesv2.pc b/package/sunxi-mali-mainline/glesv2.pc new file mode 100644 index 0000000..6910b46 --- /dev/null +++ b/package/sunxi-mali-mainline/glesv2.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: glesv2 +Description: ARM Mali implementation of OpenGL ESv2 +Version: 2.0 +Requires: +Libs: -L${libdir} -lGLESv2 -lGLESv1_CM +Cflags: -I${includedir} + diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk new file mode 100644 index 0000000..6540b2c --- /dev/null +++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk @@ -0,0 +1,62 @@ +################################################################################ +# +# sunxi-mali-mainline +# +################################################################################ + +SUNXI_MALI_MAINLINE_VERSION = cb3e8ece9b2c3a70cbeb3204cd6f30eceaa32023 +SUNXI_MALI_MAINLINE_SITE = $(call github,free-electrons,mali-blobs,$(SUNXI_MALI_MAINLINE_VERSION)) +SUNXI_MALI_MAINLINE_INSTALL_STAGING = YES +SUNXI_MALI_MAINLINE_PROVIDES = libegl libgles + +ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2),y) +SUNXI_MALI_LIB_VER=r6p2 +endif + +ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) +SUNXI_MALI_MAINLINE_DEPENDENCIES += xlib_libX11 xlib_libXfixes \ + xlib_libXext xlib_libXdamage libdrm +endif + +define SUNXI_MALI_MAINLINE_BUILD_CMDS +endef + +ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) +define SUNXI_MALI_MAINLINE_INSTALL_STAGING_CMDS + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/x11_dma_buf/lib_x11_dma_buf/* \ + $(STAGING_DIR)/usr/lib + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/x11_ump/include/* \ + $(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 +endef +else +define SUNXI_MALI_MAINLINE_INSTALL_STAGING_CMDS + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/fbdev/lib/lib_fb_dev/* \ + $(STAGING_DIR)/usr/lib/ + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/fbdev/include/* \ + $(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 +endef +endif + +ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) +define SUNXI_MALI_MAINLINE_INSTALL_TARGET_CMDS + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/x11_dma_buf/lib_x11_dma_buf/* \ + $(TARGET_DIR)/usr/lib +endef +else +define SUNXI_MALI_MAINLINE_INSTALL_TARGET_CMDS + cp -rf $(@D)/$(SUNXI_MALI_LIB_VER)/fbdev/lib/lib_fb_dev/* \ + $(TARGET_DIR)/usr/lib/ +endef +endif + +$(eval $(generic-package))