diff options
| author | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-12-06 16:06:35 -0800 |
|---|---|---|
| committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-12-13 16:11:14 -0800 |
| commit | a18947c20dba2c0c38db8bde1ad4684995df4bbd (patch) | |
| tree | 917bf2abbe439a6f99ede8cfafb25812dca54a9a /meta-xilinx-bsp/recipes-graphics | |
| parent | 6ddc5873b0ede30e6542f0ab151a6236acc37944 (diff) | |
| download | meta-xilinx-a18947c20dba2c0c38db8bde1ad4684995df4bbd.tar.gz | |
meta-xilinx: Restructuring meta-xilinx to support multiple layers
As discussed previously on mailing list, we are proceeding with layer
restructuring. For rocko release we will have the following layers
meta-xilinx
->meta-xilinx-bsp (current meta-xilinx)
->meta-xilinx-contrib
In the subsequent releases we will add other layers from Xilinx
meta-xilinx
->meta-xilinx-bsp (current meta-xilinx)
->meta-petalinux
->meta-xilinx-tools
->meta-xilinx-contrib
This will provide one clone to get all the required meta layers from
Xilinx for a complete solution, and the users can blacklist any layer
which they don't want to use using bblayer.conf.
This will enables us to help our vendors/partners to add their reference
designs, board definitions etc.
Recipe changes :
* Move reference design zybo-linux-bd.bb to meta-xilinx-contrib
* Move kernel patches realted to zybo-linux-bd-zynq7 board to
meta-xilinx-contrib
* Update README
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp/recipes-graphics')
15 files changed, 724 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb new file mode 100644 index 00000000..edd8cbe9 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | SUMMARY = "A Mali 400 Linux Kernel module" | ||
| 2 | SECTION = "kernel/modules" | ||
| 3 | |||
| 4 | LICENSE = "GPLv2" | ||
| 5 | LIC_FILES_CHKSUM = " \ | ||
| 6 | file://linux/license/gpl/mali_kernel_license.h;md5=1436c0d104589824163a3eb50fbb5050 \ | ||
| 7 | " | ||
| 8 | |||
| 9 | PV = "r7p0-00rel0" | ||
| 10 | |||
| 11 | SRC_URI = " \ | ||
| 12 | https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \ | ||
| 13 | file://0001-Change-Makefile-to-be-compatible-with-Yocto.patch \ | ||
| 14 | file://0002-staging-mali-r7p0-00rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch \ | ||
| 15 | file://0003-staging-mali-r7p0-00rel0-Remove-unused-trace-macros.patch \ | ||
| 16 | file://0004-staging-mali-r7p0-00rel0-Don-t-include-mali_read_phy.patch \ | ||
| 17 | file://0005-mali-r7p0-PAGE_CACHE_SHIFT-to-PAGE_CACHE.patch \ | ||
| 18 | file://0006-staging-mali-r7p0-page_cache_release-to-put_page.patch \ | ||
| 19 | file://0007-mali_memory_os_alloc.c-Align-with-dma_attrs-changes-.patch \ | ||
| 20 | file://0008-arm.c-dma_ops-will-be-modified-by-the-driver-only-ti.patch \ | ||
| 21 | file://0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \ | ||
| 22 | file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \ | ||
| 23 | " | ||
| 24 | SRC_URI[md5sum] = "db3ef3258eb55700484ecadfdce1fee1" | ||
| 25 | SRC_URI[sha256sum] = "496ba80684aa4236806891a8445978849f7dd07299f5e58b14d52cd5e7ba0536" | ||
| 26 | |||
| 27 | inherit module | ||
| 28 | |||
| 29 | do_make_scripts[depends] += "virtual/kernel:do_unpack" | ||
| 30 | |||
| 31 | S = "${WORKDIR}/DX910-SW-99002-${PV}/driver/src/devicedrv/mali" | ||
| 32 | |||
| 33 | COMPATIBLE_MACHINE = "^$" | ||
| 34 | COMPATIBLE_MACHINE_zynqmp = "zynqmp" | ||
| 35 | |||
| 36 | EXTRA_OEMAKE = 'KDIR="${STAGING_KERNEL_DIR}" \ | ||
| 37 | ARCH="${ARCH}" \ | ||
| 38 | BUILD=release \ | ||
| 39 | MALI_PLATFORM="arm" \ | ||
| 40 | USING_DT=1 \ | ||
| 41 | MALI_SHARED_INTERRUPTS=1 \ | ||
| 42 | CROSS_COMPILE="${TARGET_PREFIX}" \ | ||
| 43 | O=${STAGING_KERNEL_BUILDDIR} \ | ||
| 44 | MALI_QUIET=1 \ | ||
| 45 | ' | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch new file mode 100644 index 00000000..0314734e --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From d9a4441c31faef60b7f39692df6913d58ec69d1b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Thu, 8 Sep 2016 09:56:40 -0700 | ||
| 4 | Subject: [PATCH 1/6] Change Makefile to be compatible with Yocto | ||
| 5 | |||
| 6 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | ||
| 7 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 8 | Upstream Status: Pending | ||
| 9 | --- | ||
| 10 | driver/src/devicedrv/mali/Makefile | 13 +++++++++++-- | ||
| 11 | 1 file changed, 11 insertions(+), 2 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/driver/src/devicedrv/mali/Makefile b/driver/src/devicedrv/mali/Makefile | ||
| 14 | index f39ae4d..9ef9713 100755 | ||
| 15 | --- Makefile | ||
| 16 | +++ b/Makefile | ||
| 17 | @@ -88,7 +88,11 @@ endif | ||
| 18 | # Define host system directory | ||
| 19 | KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build | ||
| 20 | |||
| 21 | -include $(KDIR)/.config | ||
| 22 | +ifeq ($(O),) | ||
| 23 | + include $(KDIR)/.config | ||
| 24 | +else | ||
| 25 | + include $(O)/.config | ||
| 26 | +endif | ||
| 27 | |||
| 28 | ifeq ($(ARCH), arm) | ||
| 29 | # when compiling for ARM we're cross compiling | ||
| 30 | @@ -193,10 +197,15 @@ ifeq ($(MALI_MEM_SWAP_TRACKING),1) | ||
| 31 | EXTRA_DEFINES += -DMALI_MEM_SWAP_TRACKING=1 | ||
| 32 | endif | ||
| 33 | |||
| 34 | +EXTRA_DEFINES += -Wno-error=date-time | ||
| 35 | + | ||
| 36 | all: $(UMP_SYMVERS_FILE) | ||
| 37 | - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules | ||
| 38 | + $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) O=$(O) modules | ||
| 39 | @rm $(FILES_PREFIX)__malidrv_build_info.c $(FILES_PREFIX)__malidrv_build_info.o | ||
| 40 | |||
| 41 | +modules_install: | ||
| 42 | + $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules_install | ||
| 43 | + | ||
| 44 | clean: | ||
| 45 | $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean | ||
| 46 | |||
| 47 | -- | ||
| 48 | 2.7.4 | ||
| 49 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r7p0-00rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r7p0-00rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch new file mode 100644 index 00000000..363153ee --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r7p0-00rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From 65a8f9eb32322538396607805dcbc28aa0aadcb7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Thu, 25 Jun 2015 17:14:42 -0700 | ||
| 4 | Subject: [PATCH 2/6] staging: mali: r7p0-00rel0: Add the ZYNQ/ZYNQMP platform | ||
| 5 | |||
| 6 | Add the number of PP cores that is required for Zynq/ZynqMP configuration. | ||
| 7 | |||
| 8 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 9 | Signed-off-by: Michal Simek <michal.simek@xilinx.com> | ||
| 10 | Upstream Status: Pending | ||
| 11 | --- | ||
| 12 | driver/src/devicedrv/mali/platform/arm/arm.c | 10 ++++++++++ | ||
| 13 | 1 file changed, 10 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c | ||
| 16 | index a7ff1b2..0682842 100755 | ||
| 17 | --- platform/arm/arm.c | ||
| 18 | +++ b/platform/arm/arm.c | ||
| 19 | @@ -261,6 +261,10 @@ static struct mali_gpu_device_data mali_gpu_data = { | ||
| 20 | .dedicated_mem_start = 0x80000000, /* Physical start address (use 0xD0000000 for old indirect setup) */ | ||
| 21 | .dedicated_mem_size = 0x10000000, /* 256MB */ | ||
| 22 | #endif | ||
| 23 | +#if defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) | ||
| 24 | + .fb_start = 0x00000000, | ||
| 25 | + .fb_size = 0xfffff000, | ||
| 26 | +#else | ||
| 27 | #if defined(CONFIG_ARM64) | ||
| 28 | /* Some framebuffer drivers get the framebuffer dynamically, such as through GEM, | ||
| 29 | * in which the memory resource can't be predicted in advance. | ||
| 30 | @@ -271,6 +275,7 @@ static struct mali_gpu_device_data mali_gpu_data = { | ||
| 31 | .fb_start = 0xe0000000, | ||
| 32 | .fb_size = 0x01000000, | ||
| 33 | #endif | ||
| 34 | +#endif /* !defined(CONFIG_ARCH_ZYNQ) && !defined(CONFIG_ARCH_ZYNQMP) */ | ||
| 35 | .control_interval = 1000, /* 1000ms */ | ||
| 36 | .utilization_callback = mali_gpu_utilization_callback, | ||
| 37 | .get_clock_info = NULL, | ||
| 38 | @@ -505,6 +510,11 @@ int mali_platform_device_init(struct platform_device *device) | ||
| 39 | mali_write_phys(0xC0010020, 0xA); /* Enable direct memory mapping for FPGA */ | ||
| 40 | } | ||
| 41 | } | ||
| 42 | +#elif defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) | ||
| 43 | + | ||
| 44 | + MALI_DEBUG_PRINT(4, ("Registering Zynq/ZynqMP Mali-400 device\n")); | ||
| 45 | + num_pp_cores = 2; | ||
| 46 | + | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* After kernel 3.15 device tree will default set dev | ||
| 50 | -- | ||
| 51 | 2.7.4 | ||
| 52 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r7p0-00rel0-Remove-unused-trace-macros.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r7p0-00rel0-Remove-unused-trace-macros.patch new file mode 100644 index 00000000..fc0dc6e6 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r7p0-00rel0-Remove-unused-trace-macros.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From c86d22f1133647518a68f9f1cbe73e1797e68fa8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Tue, 3 May 2016 08:11:38 -0700 | ||
| 4 | Subject: [PATCH 3/6] staging: mali: r7p0-00rel0: Remove unused trace macros | ||
| 5 | |||
| 6 | TRACE_SYSTEM_STRING is not need in each trace file anymore. | ||
| 7 | |||
| 8 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 9 | Upstream Status: Pending | ||
| 10 | --- | ||
| 11 | driver/src/devicedrv/mali/linux/mali_linux_trace.h | 2 -- | ||
| 12 | 1 file changed, 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/driver/src/devicedrv/mali/linux/mali_linux_trace.h b/driver/src/devicedrv/mali/linux/mali_linux_trace.h | ||
| 15 | index 2c91ddc..d4e45ab 100755 | ||
| 16 | --- linux/mali_linux_trace.h | ||
| 17 | +++ b/linux/mali_linux_trace.h | ||
| 18 | @@ -13,12 +13,10 @@ | ||
| 19 | |||
| 20 | #include <linux/types.h> | ||
| 21 | |||
| 22 | -#include <linux/stringify.h> | ||
| 23 | #include <linux/tracepoint.h> | ||
| 24 | |||
| 25 | #undef TRACE_SYSTEM | ||
| 26 | #define TRACE_SYSTEM mali | ||
| 27 | -#define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM) | ||
| 28 | |||
| 29 | #define TRACE_INCLUDE_PATH . | ||
| 30 | #define TRACE_INCLUDE_FILE mali_linux_trace | ||
| 31 | -- | ||
| 32 | 2.7.4 | ||
| 33 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r7p0-00rel0-Don-t-include-mali_read_phy.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r7p0-00rel0-Don-t-include-mali_read_phy.patch new file mode 100644 index 00000000..ce3bea0a --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r7p0-00rel0-Don-t-include-mali_read_phy.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From 3e6fb4697bddc4cfbb82e6a0b2f9f28d5c1d0a04 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Wed, 29 Jun 2016 09:14:37 -0700 | ||
| 4 | Subject: [PATCH 4/6] staging: mali: r7p0-00rel0: Don't include | ||
| 5 | mali_read_phys() for zynq/zynqmp | ||
| 6 | |||
| 7 | mali_read_phys() is not used with CONFIG_ARCH_ZYNQ and CONFIG_ARCH_ZYNQMP. | ||
| 8 | |||
| 9 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 10 | Upstream Status: Pending | ||
| 11 | --- | ||
| 12 | driver/src/devicedrv/mali/platform/arm/arm.c | 4 ++++ | ||
| 13 | 1 file changed, 4 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c | ||
| 16 | index 0682842..c6f58d8 100755 | ||
| 17 | --- platform/arm/arm.c | ||
| 18 | +++ b/platform/arm/arm.c | ||
| 19 | @@ -38,7 +38,9 @@ | ||
| 20 | static int mali_core_scaling_enable = 0; | ||
| 21 | |||
| 22 | void mali_gpu_utilization_callback(struct mali_gpu_utilization_data *data); | ||
| 23 | +#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) | ||
| 24 | static u32 mali_read_phys(u32 phys_addr); | ||
| 25 | +#endif | ||
| 26 | #if defined(CONFIG_ARCH_REALVIEW) | ||
| 27 | static void mali_write_phys(u32 phys_addr, u32 value); | ||
| 28 | #endif | ||
| 29 | @@ -578,6 +580,7 @@ int mali_platform_device_deinit(struct platform_device *device) | ||
| 30 | |||
| 31 | #endif /* CONFIG_MALI_DT */ | ||
| 32 | |||
| 33 | +#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) | ||
| 34 | static u32 mali_read_phys(u32 phys_addr) | ||
| 35 | { | ||
| 36 | u32 phys_addr_page = phys_addr & 0xFFFFE000; | ||
| 37 | @@ -592,6 +595,7 @@ static u32 mali_read_phys(u32 phys_addr) | ||
| 38 | |||
| 39 | return ret; | ||
| 40 | } | ||
| 41 | +#endif | ||
| 42 | |||
| 43 | #if defined(CONFIG_ARCH_REALVIEW) | ||
| 44 | static void mali_write_phys(u32 phys_addr, u32 value) | ||
| 45 | -- | ||
| 46 | 2.7.4 | ||
| 47 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0005-mali-r7p0-PAGE_CACHE_SHIFT-to-PAGE_CACHE.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0005-mali-r7p0-PAGE_CACHE_SHIFT-to-PAGE_CACHE.patch new file mode 100644 index 00000000..32dd9d45 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0005-mali-r7p0-PAGE_CACHE_SHIFT-to-PAGE_CACHE.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From ac3baaacbaa564e768529dcb2353a84eb47ae847 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Mon, 12 Sep 2016 13:12:46 -0700 | ||
| 4 | Subject: [PATCH 5/6] mali: r7p0: PAGE_CACHE_SHIFT to PAGE_CACHE | ||
| 5 | |||
| 6 | 09cbfea removed PAGE_CACHE_*. | ||
| 7 | |||
| 8 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 9 | Upstream Status: Pending | ||
| 10 | --- | ||
| 11 | driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | 2 +- | ||
| 12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | ||
| 15 | index 4793328..1aea47b 100755 | ||
| 16 | --- linux/mali_memory_swap_alloc.c | ||
| 17 | +++ b/linux/mali_memory_swap_alloc.c | ||
| 18 | @@ -52,7 +52,7 @@ extern struct mali_mem_os_allocator mali_mem_os_allocator; | ||
| 19 | #define MALI_SWAP_LOW_MEM_DEFAULT_VALUE (60*1024*1024) | ||
| 20 | #define MALI_SWAP_INVALIDATE_MALI_ADDRESS (0) /* Used to mark the given memory cookie is invalidate. */ | ||
| 21 | #define MALI_SWAP_GLOBAL_SWAP_FILE_SIZE (0xFFFFFFFF) | ||
| 22 | -#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_CACHE_SHIFT) | ||
| 23 | +#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_SHIFT) | ||
| 24 | #define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX_RESERVE (1 << 15) /* Reserved for CoW nonlinear swap backend memory, the space size is 128MB. */ | ||
| 25 | |||
| 26 | unsigned int mali_mem_swap_out_threshold_value = MALI_SWAP_LOW_MEM_DEFAULT_VALUE; | ||
| 27 | -- | ||
| 28 | 2.7.4 | ||
| 29 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0006-staging-mali-r7p0-page_cache_release-to-put_page.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0006-staging-mali-r7p0-page_cache_release-to-put_page.patch new file mode 100644 index 00000000..5582bfa4 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0006-staging-mali-r7p0-page_cache_release-to-put_page.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 9dd708ba609b826c07fa91d8a5ee56b368ae8183 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "madhurki@xilinx.com" <madhurki@xilinx.com> | ||
| 3 | Date: Mon, 12 Sep 2016 17:14:34 -0700 | ||
| 4 | Subject: [PATCH 6/6] staging: mali: r7p0: page_cache_release() to put_page() | ||
| 5 | |||
| 6 | 09cbfea replaced page_cache_release() to put_page(). | ||
| 7 | |||
| 8 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 9 | Signed-off-by: madhurki@xilinx.com <madhurki@xilinx.com> | ||
| 10 | Upstream Status: Pending | ||
| 11 | --- | ||
| 12 | driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | ||
| 16 | index 1aea47b..068e4d0 100755 | ||
| 17 | --- linux/mali_memory_swap_alloc.c | ||
| 18 | +++ b/linux/mali_memory_swap_alloc.c | ||
| 19 | @@ -183,7 +183,7 @@ static void mali_mem_swap_out_page_node(mali_page_node *page_node) | ||
| 20 | dma_unmap_page(&mali_platform_device->dev, page_node->swap_it->dma_addr, | ||
| 21 | _MALI_OSK_MALI_PAGE_SIZE, DMA_TO_DEVICE); | ||
| 22 | set_page_dirty(page_node->swap_it->page); | ||
| 23 | - page_cache_release(page_node->swap_it->page); | ||
| 24 | + put_page(page_node->swap_it->page); | ||
| 25 | } | ||
| 26 | |||
| 27 | void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend) | ||
| 28 | -- | ||
| 29 | 2.7.4 | ||
| 30 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-mali_memory_os_alloc.c-Align-with-dma_attrs-changes-.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-mali_memory_os_alloc.c-Align-with-dma_attrs-changes-.patch new file mode 100644 index 00000000..79c507d2 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-mali_memory_os_alloc.c-Align-with-dma_attrs-changes-.patch | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | From f0a49bccbdd910c48aab59e07aed98093f4a0fea Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Wed, 25 Jan 2017 02:59:40 -0800 | ||
| 4 | Subject: [PATCH 1/2] mali_memory_os_alloc.c: Align with dma_attrs changes from | ||
| 5 | 4.8 Kernel | ||
| 6 | |||
| 7 | From 4.8 Kernel the DMA attributes is no longer a pointer but an unsigned long. | ||
| 8 | |||
| 9 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 10 | Upstream Status: Pending | ||
| 11 | --- | ||
| 12 | .../devicedrv/mali/linux/mali_memory_os_alloc.c | 25 +++++++++++++++++----- | ||
| 13 | 1 file changed, 20 insertions(+), 5 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | ||
| 16 | index 7f229eb..08fa2fb 100755 | ||
| 17 | --- linux/mali_memory_os_alloc.c | ||
| 18 | +++ b/linux/mali_memory_os_alloc.c | ||
| 19 | @@ -26,9 +26,11 @@ | ||
| 20 | #define MALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_PAGES (MALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB * 256) | ||
| 21 | #define MALI_OS_MEMORY_POOL_TRIM_JIFFIES (10 * CONFIG_HZ) /* Default to 10s */ | ||
| 22 | |||
| 23 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
| 24 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 25 | /* Write combine dma_attrs */ | ||
| 26 | static DEFINE_DMA_ATTRS(dma_attrs_wc); | ||
| 27 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | ||
| 28 | +static unsigned long dma_attrs_wc; | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) | ||
| 32 | @@ -511,10 +513,14 @@ _mali_osk_errcode_t mali_mem_os_get_table_page(mali_dma_addr *phys, mali_io_addr | ||
| 33 | spin_unlock(&mali_mem_page_table_page_pool.lock); | ||
| 34 | |||
| 35 | if (_MALI_OSK_ERR_OK != ret) { | ||
| 36 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
| 37 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 38 | *mapping = dma_alloc_attrs(&mali_platform_device->dev, | ||
| 39 | _MALI_OSK_MALI_PAGE_SIZE, &tmp_phys, | ||
| 40 | GFP_KERNEL, &dma_attrs_wc); | ||
| 41 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | ||
| 42 | + *mapping = dma_alloc_attrs(&mali_platform_device->dev, | ||
| 43 | + _MALI_OSK_MALI_PAGE_SIZE, &tmp_phys, | ||
| 44 | + GFP_KERNEL, dma_attrs_wc); | ||
| 45 | #else | ||
| 46 | *mapping = dma_alloc_writecombine(&mali_platform_device->dev, | ||
| 47 | _MALI_OSK_MALI_PAGE_SIZE, &tmp_phys, GFP_KERNEL); | ||
| 48 | @@ -550,10 +556,14 @@ void mali_mem_os_release_table_page(mali_dma_addr phys, void *virt) | ||
| 49 | } else { | ||
| 50 | spin_unlock(&mali_mem_page_table_page_pool.lock); | ||
| 51 | |||
| 52 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
| 53 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 54 | dma_free_attrs(&mali_platform_device->dev, | ||
| 55 | _MALI_OSK_MALI_PAGE_SIZE, virt, phys, | ||
| 56 | &dma_attrs_wc); | ||
| 57 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | ||
| 58 | + dma_free_attrs(&mali_platform_device->dev, | ||
| 59 | + _MALI_OSK_MALI_PAGE_SIZE, virt, phys, | ||
| 60 | + dma_attrs_wc); | ||
| 61 | #else | ||
| 62 | dma_free_writecombine(&mali_platform_device->dev, | ||
| 63 | _MALI_OSK_MALI_PAGE_SIZE, virt, phys); | ||
| 64 | @@ -606,9 +616,12 @@ static void mali_mem_os_page_table_pool_free(size_t nr_to_free) | ||
| 65 | |||
| 66 | /* After releasing the spinlock: free the pages we removed from the pool. */ | ||
| 67 | for (i = 0; i < nr_to_free; i++) { | ||
| 68 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
| 69 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 70 | dma_free_attrs(&mali_platform_device->dev, _MALI_OSK_MALI_PAGE_SIZE, | ||
| 71 | virt_arr[i], (dma_addr_t)phys_arr[i], &dma_attrs_wc); | ||
| 72 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | ||
| 73 | + dma_free_attrs(&mali_platform_device->dev, _MALI_OSK_MALI_PAGE_SIZE, | ||
| 74 | + virt_arr[i], (dma_addr_t)phys_arr[i], dma_attrs_wc); | ||
| 75 | #else | ||
| 76 | dma_free_writecombine(&mali_platform_device->dev, | ||
| 77 | _MALI_OSK_MALI_PAGE_SIZE, | ||
| 78 | @@ -757,8 +770,10 @@ _mali_osk_errcode_t mali_mem_os_init(void) | ||
| 79 | return _MALI_OSK_ERR_NOMEM; | ||
| 80 | } | ||
| 81 | |||
| 82 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
| 83 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 84 | dma_set_attr(DMA_ATTR_WRITE_COMBINE, &dma_attrs_wc); | ||
| 85 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | ||
| 86 | + dma_attrs_wc |= DMA_ATTR_WRITE_COMBINE; | ||
| 87 | #endif | ||
| 88 | |||
| 89 | register_shrinker(&mali_mem_os_allocator.shrinker); | ||
| 90 | -- | ||
| 91 | 2.7.4 | ||
| 92 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-arm.c-dma_ops-will-be-modified-by-the-driver-only-ti.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-arm.c-dma_ops-will-be-modified-by-the-driver-only-ti.patch new file mode 100644 index 00000000..c11b60a8 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-arm.c-dma_ops-will-be-modified-by-the-driver-only-ti.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 4bb78550d818b9e6491fa2d3b9706bb217a1597b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Wed, 25 Jan 2017 10:00:33 -0800 | ||
| 4 | Subject: [PATCH 2/2] arm.c: dma_ops will be modified by the driver only till | ||
| 5 | Kernel v4.7 | ||
| 6 | |||
| 7 | From v4.8(Platform specific) Kernel the arch_setup_dma_ops will | ||
| 8 | not give a dummy_dma_ops if acpi is disabled rather pass a valid | ||
| 9 | dma_ops. | ||
| 10 | |||
| 11 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 12 | Upstream Status: Pending | ||
| 13 | --- | ||
| 14 | driver/src/devicedrv/mali/platform/arm/arm.c | 3 ++- | ||
| 15 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c | ||
| 18 | index c6f58d8..36965fe 100755 | ||
| 19 | --- platform/arm/arm.c | ||
| 20 | +++ b/platform/arm/arm.c | ||
| 21 | @@ -529,8 +529,9 @@ int mali_platform_device_init(struct platform_device *device) | ||
| 22 | */ | ||
| 23 | if (!device->dev.dma_mask) | ||
| 24 | device->dev.dma_mask = &device->dev.coherent_dma_mask; | ||
| 25 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) | ||
| 26 | device->dev.archdata.dma_ops = dma_ops; | ||
| 27 | - | ||
| 28 | +#endif | ||
| 29 | err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data)); | ||
| 30 | |||
| 31 | if (0 == err) { | ||
| 32 | -- | ||
| 33 | 2.7.4 | ||
| 34 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch new file mode 100644 index 00000000..34cbccf4 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | From ba8c94302a1c606315109a9d1cee342213fdbf98 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Thu, 16 Feb 2017 12:15:58 -0800 | ||
| 4 | Subject: [PATCH] linux/mali_kernel_linux.c: Handle clock when probed and | ||
| 5 | removed | ||
| 6 | |||
| 7 | This patch will handle the clock through clock | ||
| 8 | specifier for GPU PP0 and PP1. | ||
| 9 | |||
| 10 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 11 | Upstream-Status: Inappropriate [Specific to Xilinx ZynqMP] | ||
| 12 | --- | ||
| 13 | .../src/devicedrv/mali/linux/mali_kernel_linux.c | 40 +++++++++++++++++++++- | ||
| 14 | 1 file changed, 39 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c | ||
| 17 | index 9bfa2bd..cfde20f 100755 | ||
| 18 | --- linux/mali_kernel_linux.c | ||
| 19 | +++ b/linux/mali_kernel_linux.c | ||
| 20 | @@ -45,6 +45,14 @@ | ||
| 21 | #if defined(CONFIG_MALI400_INTERNAL_PROFILING) | ||
| 22 | #include "mali_profiling_internal.h" | ||
| 23 | #endif | ||
| 24 | + | ||
| 25 | +#if defined(CONFIG_ARCH_ZYNQMP) | ||
| 26 | +/* Initialize variables for clocks */ | ||
| 27 | +struct clk *clk_gpu; | ||
| 28 | +struct clk *clk_gpu_pp0; | ||
| 29 | +struct clk *clk_gpu_pp1; | ||
| 30 | +#endif | ||
| 31 | + | ||
| 32 | #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS) | ||
| 33 | #include "mali_osk_profiling.h" | ||
| 34 | #include "mali_dvfs_policy.h" | ||
| 35 | @@ -580,7 +588,23 @@ static int mali_probe(struct platform_device *pdev) | ||
| 36 | } | ||
| 37 | #endif | ||
| 38 | |||
| 39 | - | ||
| 40 | +#if defined(CONFIG_ARCH_ZYNQMP) | ||
| 41 | + /* Initialize clocks for GPU and PP */ | ||
| 42 | + clk_gpu = devm_clk_get(&pdev->dev, "gpu"); | ||
| 43 | + if (IS_ERR(clk_gpu)) | ||
| 44 | + return PTR_ERR(clk_gpu); | ||
| 45 | + clk_prepare_enable(clk_gpu); | ||
| 46 | + | ||
| 47 | + clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); | ||
| 48 | + if (IS_ERR(clk_gpu_pp0)) | ||
| 49 | + return PTR_ERR(clk_gpu_pp0); | ||
| 50 | + clk_prepare_enable(clk_gpu_pp0); | ||
| 51 | + | ||
| 52 | + clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); | ||
| 53 | + if (IS_ERR(clk_gpu_pp1)) | ||
| 54 | + return PTR_ERR(clk_gpu_pp1); | ||
| 55 | + clk_prepare_enable(clk_gpu_pp1); | ||
| 56 | +#endif | ||
| 57 | if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { | ||
| 58 | /* Initialize the Mali GPU HW specified by pdev */ | ||
| 59 | if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { | ||
| 60 | @@ -608,6 +632,12 @@ static int mali_probe(struct platform_device *pdev) | ||
| 61 | _mali_osk_wq_term(); | ||
| 62 | } | ||
| 63 | |||
| 64 | +#if defined(CONFIG_ARCH_ZYNQMP) | ||
| 65 | + clk_disable_unprepare(clk_gpu); | ||
| 66 | + clk_disable_unprepare(clk_gpu_pp0); | ||
| 67 | + clk_disable_unprepare(clk_gpu_pp1); | ||
| 68 | +#endif | ||
| 69 | + | ||
| 70 | #ifdef CONFIG_MALI_DEVFREQ | ||
| 71 | mali_devfreq_term(mdev); | ||
| 72 | devfreq_init_failed: | ||
| 73 | @@ -673,6 +703,14 @@ static int mali_remove(struct platform_device *pdev) | ||
| 74 | mali_platform_device_deinit(mali_platform_device); | ||
| 75 | #endif | ||
| 76 | mali_platform_device = NULL; | ||
| 77 | + | ||
| 78 | +#if defined(CONFIG_ARCH_ZYNQMP) | ||
| 79 | + /* Remove clock */ | ||
| 80 | + clk_disable_unprepare(clk_gpu); | ||
| 81 | + clk_disable_unprepare(clk_gpu_pp0); | ||
| 82 | + clk_disable_unprepare(clk_gpu_pp1); | ||
| 83 | +#endif | ||
| 84 | + | ||
| 85 | return 0; | ||
| 86 | } | ||
| 87 | |||
| 88 | -- | ||
| 89 | 2.7.4 | ||
| 90 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch new file mode 100644 index 00000000..ad159ba6 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 572d234259158bf9f046c2393a65e2800bec1062 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Mon, 28 Aug 2017 09:40:37 -0700 | ||
| 4 | Subject: [PATCH] common/mali_pm.c: Add PM runtime barrier after removing | ||
| 5 | suspend | ||
| 6 | |||
| 7 | Runtime PM suspend "put" results in addition of PM suspend | ||
| 8 | API in work queue. This barrier API will remove it from | ||
| 9 | the work queue. | ||
| 10 | |||
| 11 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 12 | Upstream-Status: Pending | ||
| 13 | --- | ||
| 14 | driver/src/devicedrv/mali/common/mali_pm.c | 1 + | ||
| 15 | 1 file changed, 1 insertion(+) | ||
| 16 | |||
| 17 | diff --git a/driver/src/devicedrv/mali/common/mali_pm.c b/driver/src/devicedrv/mali/common/mali_pm.c | ||
| 18 | index 1ef03a6..0343ad3 100755 | ||
| 19 | --- common/mali_pm.c | ||
| 20 | +++ b/common/mali_pm.c | ||
| 21 | @@ -301,6 +301,7 @@ void mali_pm_init_end(void) | ||
| 22 | } | ||
| 23 | |||
| 24 | _mali_osk_pm_dev_ref_put(); | ||
| 25 | + _mali_osk_pm_dev_barrier(); | ||
| 26 | } | ||
| 27 | |||
| 28 | void mali_pm_update_sync(void) | ||
| 29 | -- | ||
| 30 | 2.7.4 | ||
| 31 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch new file mode 100644 index 00000000..50f43393 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch | |||
| @@ -0,0 +1,141 @@ | |||
| 1 | From 630a8ea035fe2f075f6ea7f4bad0928f5b541c80 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 3 | Date: Wed, 21 Jan 2015 11:53:19 -0800 | ||
| 4 | Subject: [PATCH] src: drmmode_xilinx: Add the dumb gem support for Xilinx | ||
| 5 | |||
| 6 | Add the dumb gem support for Xilinx | ||
| 7 | |||
| 8 | Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 9 | Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> | ||
| 10 | Upstream-Status: Pending | ||
| 11 | --- | ||
| 12 | src/Makefile.am | 3 +- | ||
| 13 | src/armsoc_driver.c | 1 + | ||
| 14 | src/drmmode_driver.h | 1 + | ||
| 15 | src/drmmode_xilinx/drmmode_xilinx.c | 76 +++++++++++++++++++++++++++++++++++++ | ||
| 16 | 4 files changed, 80 insertions(+), 1 deletion(-) | ||
| 17 | create mode 100644 src/drmmode_xilinx/drmmode_xilinx.c | ||
| 18 | |||
| 19 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
| 20 | index 3b2601927c..db5f110fb2 100644 | ||
| 21 | --- a/src/Makefile.am | ||
| 22 | +++ b/src/Makefile.am | ||
| 23 | @@ -43,7 +43,8 @@ armsoc_drv_ladir = @moduledir@/drivers | ||
| 24 | DRMMODE_SRCS = drmmode_exynos/drmmode_exynos.c \ | ||
| 25 | drmmode_pl111/drmmode_pl111.c \ | ||
| 26 | drmmode_kirin/drmmode_kirin.c \ | ||
| 27 | - drmmode_sti/drmmode_sti.c | ||
| 28 | + drmmode_sti/drmmode_sti.c \ | ||
| 29 | + drmmode_xilinx/drmmode_xilinx.c | ||
| 30 | |||
| 31 | |||
| 32 | armsoc_drv_la_SOURCES = \ | ||
| 33 | diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c | ||
| 34 | index 83e74a7ed1..3ace3c7be5 100644 | ||
| 35 | --- a/src/armsoc_driver.c | ||
| 36 | +++ b/src/armsoc_driver.c | ||
| 37 | @@ -737,6 +737,7 @@ static struct drmmode_interface *get_drmmode_implementation(int drm_fd) | ||
| 38 | &pl111_interface, | ||
| 39 | &kirin_interface, | ||
| 40 | &sti_interface, | ||
| 41 | + &xilinx_interface, | ||
| 42 | }; | ||
| 43 | int i; | ||
| 44 | |||
| 45 | diff --git a/src/drmmode_driver.h b/src/drmmode_driver.h | ||
| 46 | index 879fc60ddc..18245d591a 100644 | ||
| 47 | --- a/src/drmmode_driver.h | ||
| 48 | +++ b/src/drmmode_driver.h | ||
| 49 | @@ -106,6 +106,7 @@ extern struct drmmode_interface exynos_interface; | ||
| 50 | extern struct drmmode_interface pl111_interface; | ||
| 51 | extern struct drmmode_interface kirin_interface; | ||
| 52 | extern struct drmmode_interface sti_interface; | ||
| 53 | +extern struct drmmode_interface xilinx_interface; | ||
| 54 | |||
| 55 | |||
| 56 | #endif | ||
| 57 | diff --git a/src/drmmode_xilinx/drmmode_xilinx.c b/src/drmmode_xilinx/drmmode_xilinx.c | ||
| 58 | new file mode 100644 | ||
| 59 | index 0000000000..f4faceb0b4 | ||
| 60 | --- /dev/null | ||
| 61 | +++ b/src/drmmode_xilinx/drmmode_xilinx.c | ||
| 62 | @@ -0,0 +1,76 @@ | ||
| 63 | +/* | ||
| 64 | + * Xilinx X11 ARMSOC driver | ||
| 65 | + * | ||
| 66 | + * Author: Hyun Woo Kwon <hyun.kwon@xilinx.com> | ||
| 67 | + * | ||
| 68 | + * Copyright (C) 2014 Xilinx, Inc. | ||
| 69 | + * | ||
| 70 | + * Based on drmmode_exynos.c | ||
| 71 | + * | ||
| 72 | + * Copyright © 2013 ARM Limited. | ||
| 73 | + * | ||
| 74 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 75 | + * copy of this software and associated documentation files (the "Software"), | ||
| 76 | + * to deal in the Software without restriction, including without limitation | ||
| 77 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 78 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
| 79 | + * Software is furnished to do so, subject to the following conditions: | ||
| 80 | + * | ||
| 81 | + * The above copyright notice and this permission notice (including the next | ||
| 82 | + * paragraph) shall be included in all copies or substantial portions of the | ||
| 83 | + * Software. | ||
| 84 | + * | ||
| 85 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 86 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 87 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 88 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 89 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 90 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 91 | + * SOFTWARE. | ||
| 92 | + * | ||
| 93 | + */ | ||
| 94 | + | ||
| 95 | +#include <stdlib.h> | ||
| 96 | + | ||
| 97 | +#include <drm.h> | ||
| 98 | +#include <xf86drm.h> | ||
| 99 | + | ||
| 100 | +#include "../drmmode_driver.h" | ||
| 101 | + | ||
| 102 | +static int create_custom_gem(int fd, struct armsoc_create_gem *create_gem) | ||
| 103 | +{ | ||
| 104 | + struct drm_mode_create_dumb arg; | ||
| 105 | + int ret; | ||
| 106 | + | ||
| 107 | + memset(&arg, 0, sizeof(arg)); | ||
| 108 | + arg.height = create_gem->height; | ||
| 109 | + arg.width = create_gem->width; | ||
| 110 | + arg.bpp = create_gem->bpp; | ||
| 111 | + | ||
| 112 | + ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); | ||
| 113 | + if (ret) | ||
| 114 | + return ret; | ||
| 115 | + | ||
| 116 | + create_gem->height = arg.height; | ||
| 117 | + create_gem->width = arg.width; | ||
| 118 | + create_gem->bpp = arg.bpp; | ||
| 119 | + create_gem->handle = arg.handle; | ||
| 120 | + create_gem->pitch = arg.pitch; | ||
| 121 | + create_gem->size = arg.size; | ||
| 122 | + | ||
| 123 | + return 0; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +struct drmmode_interface xilinx_interface = { | ||
| 127 | + "xilinx_drm" /* name of drm driver */, | ||
| 128 | + 1 /* use_page_flip_events */, | ||
| 129 | + 1 /* use_early_display */, | ||
| 130 | + 0 /* cursor width */, | ||
| 131 | + 0 /* cursor_height */, | ||
| 132 | + 0 /* cursor padding */, | ||
| 133 | + HWCURSOR_API_NONE /* cursor_api */, | ||
| 134 | + NULL /* init_plane_for_cursor */, | ||
| 135 | + 0 /* vblank_query_supported */, | ||
| 136 | + create_custom_gem /* create_custom_gem */, | ||
| 137 | +}; | ||
| 138 | + | ||
| 139 | -- | ||
| 140 | 2.11.0 | ||
| 141 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_git.bb b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_git.bb new file mode 100644 index 00000000..7a671fe0 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_git.bb | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | require recipes-graphics/xorg-driver/xorg-driver-video.inc | ||
| 2 | |||
| 3 | SUMMARY = "X.Org X server -- Xilinx ARM SOC display driver" | ||
| 4 | DESCRIPTION = "Xilinx ARM SOC display driver " | ||
| 5 | |||
| 6 | LICENSE = "MIT-X & GPLv2+" | ||
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602" | ||
| 8 | |||
| 9 | DEPENDS += "virtual/libx11 libdrm xf86driproto" | ||
| 10 | RDEPENDS_${PN} += "xserver-xorg-module-exa" | ||
| 11 | |||
| 12 | PV = "1.4.1+git${SRCPV}" | ||
| 13 | |||
| 14 | SRCREV = "8bbdb2ae3bb8ef649999a8da33ddbe11a04763b8" | ||
| 15 | SRC_URI = " \ | ||
| 16 | git://anongit.freedesktop.org/xorg/driver/xf86-video-armsoc \ | ||
| 17 | file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch \ | ||
| 18 | " | ||
| 19 | |||
| 20 | S = "${WORKDIR}/git" | ||
| 21 | |||
| 22 | EXTRA_OECONF = " --enable-maintainer-mode" | ||
| 23 | CFLAGS += " -I${STAGING_INCDIR}/xorg " | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/zynqmp/xorg.conf b/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/zynqmp/xorg.conf new file mode 100644 index 00000000..9ef39462 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/zynqmp/xorg.conf | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | Section "InputDevice" | ||
| 2 | Identifier "System Mouse" | ||
| 3 | Driver "mouse" | ||
| 4 | Option "Device" "/dev/input/mouse0" | ||
| 5 | EndSection | ||
| 6 | |||
| 7 | Section "InputDevice" | ||
| 8 | Identifier "System Keyboard" | ||
| 9 | Driver "kbd" | ||
| 10 | Option "Device" "/dev/input/event0" | ||
| 11 | EndSection | ||
| 12 | |||
| 13 | Section "Device" | ||
| 14 | Identifier "ZynqMP" | ||
| 15 | Driver "armsoc" | ||
| 16 | Option "DRI2" "true" | ||
| 17 | Option "DRI2_PAGE_FLIP" "false" | ||
| 18 | Option "DRI2_WAIT_VSYNC" "true" | ||
| 19 | Option "SWcursorLCD" "false" | ||
| 20 | Option "DEBUG" "false" | ||
| 21 | EndSection | ||
| 22 | |||
| 23 | Section "Screen" | ||
| 24 | Identifier "DefaultScreen" | ||
| 25 | Device "ZynqMP" | ||
| 26 | DefaultDepth 16 | ||
| 27 | EndSection | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend b/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend new file mode 100644 index 00000000..72d991c7 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend | |||
| @@ -0,0 +1 @@ | |||
| FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | |||
