aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch
blob: c99392e367df63894e1a0f05a27b8fe3ee7ff9bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 622db2862220b8fc2ae56e9caceac70cbb0c15ce Mon Sep 17 00:00:00 2001
From: Hyun Kwon <hyun.kwon@xilinx.com>
Date: Wed, 21 Jan 2015 11:53:19 -0800
Subject: [PATCH 1/1] src: drmmode_xilinx: Add the dumb gem support for Xilinx

Add the dumb gem support for Xilinx
Upstream-Status: Pending
---
 src/drmmode_xilinx/drmmode_xilinx.c | 80 +++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 src/drmmode_xilinx/drmmode_xilinx.c

diff --git a/src/drmmode_xilinx/drmmode_xilinx.c b/src/drmmode_xilinx/drmmode_xilinx.c
new file mode 100644
index 0000000..2cd4e35
--- /dev/null
+++ b/src/drmmode_xilinx/drmmode_xilinx.c
@@ -0,0 +1,80 @@
+/*
+ * Xilinx X11 ARMSOC driver
+ *
+ * Author: Hyun Woo Kwon <hyun.kwon@xilinx.com>
+ *
+ * Copyright (C) 2014 Xilinx, Inc.
+ *
+ * Based on drmmode_exynos.c
+ *
+ * Copyright © 2013 ARM Limited.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include <stdlib.h>
+
+#include <drm.h>
+#include <xf86drm.h>
+
+#include "../drmmode_driver.h"
+
+static int create_custom_gem(int fd, struct armsoc_create_gem *create_gem)
+{
+	struct drm_mode_create_dumb arg;
+	int ret;
+
+	memset(&arg, 0, sizeof(arg));
+	arg.height = create_gem->height;
+	arg.width = create_gem->width;
+	arg.bpp = create_gem->bpp;
+
+	ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg);
+	if (ret)
+		return ret;
+
+	create_gem->height = arg.height;
+	create_gem->width = arg.width;
+	create_gem->bpp = arg.bpp;
+	create_gem->handle = arg.handle;
+	create_gem->pitch = arg.pitch;
+	create_gem->size = arg.size;
+
+	return 0;
+}
+
+struct drmmode_interface xilinx_interface = {
+	1                     /* use_page_flip_events */,
+	1                     /* use_early_display */,
+	0                     /* cursor width */,
+	0                     /* cursor_height */,
+	0                     /* cursor padding */,
+	HWCURSOR_API_NONE     /* cursor_api */,
+	NULL                  /* init_plane_for_cursor */,
+	0                     /* vblank_query_supported */,
+	create_custom_gem     /* create_custom_gem */,
+};
+
+struct drmmode_interface *drmmode_interface_get_implementation(int drm_fd)
+{
+	return &xilinx_interface;
+}
+
-- 
2.1.4