mirror of
https://github.com/armbian/build.git
synced 2025-08-15 15:46:58 +02:00
I have changed the way the patches are generated a bit. Instead of using orange-pi branch from megous tree for 6.6 kernel, I have used the following kernel branches a83t-suspend, af8133j, anx, audio, axp, cam, drm, err, fixes, mbus, modem, opi3, pb, pinetab, pp, ppkb, samuel, speed, tbs-a711, ths These branches were carefully chosen to include only allwinner related patches and remove importing of the rockchip related patches into the allwinner kernel. Following patches are modified to fix patch application failure - patches.armbian/arm64-dts-sun50i-h616-orangepi-zero2-reg_usb1_vbus-status-ok.patch - patches.armbian/arm64-dts-sun50i-h616-orangepi-zero2-Enable-GPU-mali.patch - patches.armbian/arm64-dts-allwinner-h616-Add-efuse_xlate-cpu-frequency-scaling-v1_6_2.patch - patches.armbian/arm64-dts-allwinner-h616-LED-green_power_on-red_status_heartbeat.patch - patches.armbian/arm64-dts-allwinner-overlay-Add-Overlays-for-sunxi64.patch - patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch Following patches are modified because of kernel api change to fix compilation failure - patches.armbian/drv-gpu-drm-sun4i-Add-HDMI-audio-sun4i-hdmi-encoder.patch - patches.armbian/drv-of-Device-Tree-Overlay-ConfigFS-interface.patch
103 lines
2.9 KiB
Diff
103 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime.ripard@free-electrons.com>
|
|
Date: Mon, 7 Dec 2015 09:47:34 +0100
|
|
Subject: drv:gpu:drm:sun4i: Add GEM allocator
|
|
|
|
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
|
|
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
|
|
---
|
|
drivers/gpu/drm/sun4i/sun4i_drv.c | 27 +++++++++
|
|
include/uapi/drm/sun4i_drm.h | 29 ++++++++++
|
|
2 files changed, 56 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
|
|
index 6a8dfc022d3c..4f7d8818d3f6 100644
|
|
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
|
|
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
|
|
@@ -24,6 +24,8 @@
|
|
#include <drm/drm_probe_helper.h>
|
|
#include <drm/drm_vblank.h>
|
|
|
|
+#include <uapi/drm/sun4i_drm.h>
|
|
+
|
|
#include "sun4i_drv.h"
|
|
#include "sun4i_frontend.h"
|
|
#include "sun4i_framebuffer.h"
|
|
@@ -42,6 +44,27 @@ static int drm_sun4i_gem_dumb_create(struct drm_file *file_priv,
|
|
|
|
DEFINE_DRM_GEM_DMA_FOPS(sun4i_drv_fops);
|
|
|
|
+static int sun4i_gem_create_ioctl(struct drm_device *drm, void *data,
|
|
+ struct drm_file *file_priv)
|
|
+{
|
|
+ struct drm_sun4i_gem_create *args = data;
|
|
+ struct drm_gem_dma_object *dma_obj;
|
|
+ size_t size;
|
|
+
|
|
+ /* The Mali requires a 64 bytes alignment */
|
|
+ size = ALIGN(args->size, 64);
|
|
+
|
|
+ dma_obj = drm_gem_dma_create_with_handle(file_priv, drm, size,
|
|
+ &args->handle);
|
|
+
|
|
+ return PTR_ERR_OR_ZERO(dma_obj);
|
|
+}
|
|
+
|
|
+static const struct drm_ioctl_desc sun4i_drv_ioctls[] = {
|
|
+ DRM_IOCTL_DEF_DRV(SUN4I_GEM_CREATE, sun4i_gem_create_ioctl,
|
|
+ DRM_UNLOCKED | DRM_AUTH),
|
|
+};
|
|
+
|
|
static const struct drm_driver sun4i_drv_driver = {
|
|
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
|
|
|
@@ -53,6 +76,10 @@ static const struct drm_driver sun4i_drv_driver = {
|
|
.major = 1,
|
|
.minor = 0,
|
|
|
|
+ /* Custom ioctls */
|
|
+ .ioctls = sun4i_drv_ioctls,
|
|
+ .num_ioctls = ARRAY_SIZE(sun4i_drv_ioctls),
|
|
+
|
|
/* GEM Operations */
|
|
DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE(drm_sun4i_gem_dumb_create),
|
|
};
|
|
diff --git a/include/uapi/drm/sun4i_drm.h b/include/uapi/drm/sun4i_drm.h
|
|
new file mode 100644
|
|
index 000000000000..67b9dd4ee594
|
|
--- /dev/null
|
|
+++ b/include/uapi/drm/sun4i_drm.h
|
|
@@ -0,0 +1,29 @@
|
|
+/*
|
|
+ * Copyright (C) 2015 Free Electrons
|
|
+ * Copyright (C) 2015 NextThing Co
|
|
+ *
|
|
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
|
|
+ *
|
|
+ * This program is free software; you can redistribute it and/or
|
|
+ * modify it under the terms of the GNU General Public License as
|
|
+ * published by the Free Software Foundation; either version 2 of
|
|
+ * the License, or (at your option) any later version.
|
|
+ */
|
|
+
|
|
+#ifndef _UAPI_SUN4I_DRM_H_
|
|
+#define _UAPI_SUN4I_DRM_H_
|
|
+
|
|
+#include <drm/drm.h>
|
|
+
|
|
+struct drm_sun4i_gem_create {
|
|
+ __u64 size;
|
|
+ __u32 flags;
|
|
+ __u32 handle;
|
|
+};
|
|
+
|
|
+#define DRM_SUN4I_GEM_CREATE 0x00
|
|
+
|
|
+#define DRM_IOCTL_SUN4I_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_SUN4I_GEM_CREATE, \
|
|
+ struct drm_sun4i_gem_create)
|
|
+
|
|
+#endif
|
|
--
|
|
Armbian
|
|
|