You can subscribe to this list here.
| 1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(59) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2000 |
Jan
(467) |
Feb
(445) |
Mar
(274) |
Apr
(212) |
May
(526) |
Jun
(365) |
Jul
(299) |
Aug
(239) |
Sep
(255) |
Oct
(268) |
Nov
(183) |
Dec
(120) |
| 2001 |
Jan
(174) |
Feb
(221) |
Mar
(316) |
Apr
(196) |
May
(195) |
Jun
(163) |
Jul
(39) |
Aug
(81) |
Sep
(62) |
Oct
(73) |
Nov
(77) |
Dec
(56) |
| 2002 |
Jan
(36) |
Feb
(130) |
Mar
(129) |
Apr
(170) |
May
(151) |
Jun
(183) |
Jul
(199) |
Aug
(192) |
Sep
(171) |
Oct
(188) |
Nov
(194) |
Dec
(119) |
| 2003 |
Jan
(119) |
Feb
(165) |
Mar
(198) |
Apr
(284) |
May
(277) |
Jun
(204) |
Jul
(67) |
Aug
(78) |
Sep
(201) |
Oct
(100) |
Nov
(30) |
Dec
(170) |
| 2004 |
Jan
(69) |
Feb
(111) |
Mar
(82) |
Apr
(88) |
May
(63) |
Jun
(56) |
Jul
(30) |
Aug
(59) |
Sep
(57) |
Oct
(58) |
Nov
(39) |
Dec
(18) |
| 2005 |
Jan
(44) |
Feb
(34) |
Mar
(22) |
Apr
(12) |
May
(16) |
Jun
(54) |
Jul
(15) |
Aug
(44) |
Sep
(24) |
Oct
(21) |
Nov
(57) |
Dec
(13) |
| 2006 |
Jan
(37) |
Feb
(36) |
Mar
(45) |
Apr
(11) |
May
(12) |
Jun
(16) |
Jul
(11) |
Aug
(55) |
Sep
(44) |
Oct
(43) |
Nov
(23) |
Dec
(34) |
| 2007 |
Jan
(59) |
Feb
(42) |
Mar
(38) |
Apr
(109) |
May
(45) |
Jun
(54) |
Jul
(65) |
Aug
(75) |
Sep
(44) |
Oct
(95) |
Nov
(82) |
Dec
(41) |
| 2008 |
Jan
(58) |
Feb
(64) |
Mar
(82) |
Apr
(37) |
May
(51) |
Jun
(112) |
Jul
(95) |
Aug
(53) |
Sep
(34) |
Oct
(43) |
Nov
(21) |
Dec
(25) |
| 2009 |
Jan
(25) |
Feb
(94) |
Mar
(46) |
Apr
(20) |
May
(16) |
Jun
(10) |
Jul
(20) |
Aug
(17) |
Sep
(8) |
Oct
(22) |
Nov
(29) |
Dec
(27) |
| 2010 |
Jan
(22) |
Feb
(19) |
Mar
(22) |
Apr
(10) |
May
(6) |
Jun
(14) |
Jul
(2) |
Aug
(4) |
Sep
(8) |
Oct
(6) |
Nov
(4) |
Dec
(6) |
| 2011 |
Jan
(2) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(6) |
Oct
(6) |
Nov
(3) |
Dec
(16) |
| 2012 |
Jan
(9) |
Feb
(13) |
Mar
(14) |
Apr
(8) |
May
(7) |
Jun
(22) |
Jul
(7) |
Aug
(19) |
Sep
(8) |
Oct
(9) |
Nov
(9) |
Dec
|
| 2013 |
Jan
(14) |
Feb
(7) |
Mar
(12) |
Apr
(11) |
May
(9) |
Jun
(4) |
Jul
(6) |
Aug
(4) |
Sep
(8) |
Oct
(5) |
Nov
(19) |
Dec
(6) |
| 2014 |
Jan
(14) |
Feb
(1) |
Mar
(4) |
Apr
(9) |
May
(7) |
Jun
(4) |
Jul
(10) |
Aug
(5) |
Sep
(17) |
Oct
|
Nov
(7) |
Dec
|
| 2015 |
Jan
(9) |
Feb
(10) |
Mar
(25) |
Apr
(8) |
May
(11) |
Jun
(5) |
Jul
(5) |
Aug
(32) |
Sep
(15) |
Oct
(4) |
Nov
(6) |
Dec
(6) |
| 2016 |
Jan
(9) |
Feb
(11) |
Mar
(3) |
Apr
(7) |
May
(1) |
Jun
(6) |
Jul
(13) |
Aug
(4) |
Sep
(8) |
Oct
(8) |
Nov
(16) |
Dec
(5) |
| 2017 |
Jan
(17) |
Feb
(6) |
Mar
(8) |
Apr
(29) |
May
(9) |
Jun
(11) |
Jul
(8) |
Aug
(13) |
Sep
(5) |
Oct
(21) |
Nov
(16) |
Dec
(9) |
| 2018 |
Jan
(19) |
Feb
(27) |
Mar
(24) |
Apr
(4) |
May
(8) |
Jun
(2) |
Jul
(7) |
Aug
(21) |
Sep
(55) |
Oct
(11) |
Nov
(5) |
Dec
(6) |
| 2019 |
Jan
(7) |
Feb
(9) |
Mar
(5) |
Apr
(9) |
May
(3) |
Jun
(7) |
Jul
(8) |
Aug
(2) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(12) |
| 2020 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(12) |
May
(9) |
Jun
(3) |
Jul
(1) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
(7) |
| 2021 |
Jan
(9) |
Feb
(9) |
Mar
(6) |
Apr
(12) |
May
(4) |
Jun
(8) |
Jul
(5) |
Aug
(6) |
Sep
(7) |
Oct
(3) |
Nov
(12) |
Dec
(6) |
| 2022 |
Jan
(5) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(4) |
Jun
(5) |
Jul
(8) |
Aug
(16) |
Sep
(1) |
Oct
(7) |
Nov
(8) |
Dec
(2) |
| 2023 |
Jan
(1) |
Feb
(5) |
Mar
(4) |
Apr
|
May
(2) |
Jun
|
Jul
(6) |
Aug
(4) |
Sep
(13) |
Oct
(7) |
Nov
(6) |
Dec
(2) |
| 2024 |
Jan
(5) |
Feb
(8) |
Mar
(5) |
Apr
(3) |
May
(2) |
Jun
(13) |
Jul
(2) |
Aug
(5) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(2) |
| 2025 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
(5) |
May
(11) |
Jun
(9) |
Jul
(4) |
Aug
(2) |
Sep
|
Oct
(8) |
Nov
(8) |
Dec
(12) |
| 2026 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(9) |
May
(3) |
Jun
(1) |
Jul
(5) |
Aug
(1) |
Sep
(3) |
Oct
(1) |
Nov
|
Dec
|
|
From: GitLab M. <git...@ke...> - 2026-10-27 20:36:45
|
amdgpu/amdgpu_asic_id.c | 151 ++++++++++++++++++++++++++++++++++++++++++++---
amdgpu/amdgpu_gpu_info.c | 15 ++++
amdgpu/amdgpu_internal.h | 4 +
data/amdgpu.ids | 4 +
4 files changed, 166 insertions(+), 8 deletions(-)
New commits:
commit 33fab8cbca7f7581e955a675597d14412702edc4
Author: Flora Cui <flo...@am...>
Date: Tue Oct 27 14:41:24 2026 +0800
amdgpu: fix memory leak in ASIC ID table lookup
Signed-off-by: Flora Cui <flo...@am...>
diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c
index d39e8dc3..29f0db34 100644
--- a/amdgpu/amdgpu_asic_id.c
+++ b/amdgpu/amdgpu_asic_id.c
@@ -396,6 +396,7 @@ static char *find_asic_id_table(void)
found_path = full_path;
break;
}
+ free(full_path);
}
split_env_var_free(paths);
return found_path;
commit 3b5e41a44cd1842297e17447c3984c85c2a6d837
Author: Flora Cui <flo...@am...>
Date: Fri Oct 9 17:29:05 2026 +0800
amdgpu: support 4ID marketing names in amdgpu.ids
Terminology:
SSVID - SubSystem Vendor ID
SSDID - SubSystem Device ID
Entries in amdgpu.ids may now be followed by indented child lines of
the form "SSVID, SSDID, name". After a DID/RID match, the children of
that entry are read from the same stream and compared with the board's
SSVID/SSDID. The first match replaces the 2ID name; otherwise the 2ID
name is kept. A malformed child line is skipped with a warning instead
of stopping the parse. Hex fields must fit in 16 bits.
The SSVID/SSDID are fetched once with drmGetDevice2() in
amdgpu_query_gpu_info_init() and cached in struct amdgpu_device, so no
new kernel ioctl is needed. If they are unavailable (non-PCI device or
lookup failure), children are not read and the 2ID name is used.
File format rules:
- A child line starts with whitespace (TAB or spaces). A 2ID line must
start in column 0.
- While searching for a 2ID match, any line starting with whitespace is
skipped. Such a 2ID line is therefore ignored.
- A child line must follow the 2ID entry it belongs to.
- Comments start with '#' in column 0. No indented comments and no
whitespace-only lines.
- SSDID must be greater than 0xFF.
Older parsers also read child lines of non-matching entries, as 2ID
lines (strtol skips the leading whitespace, so SSVID is compared as
DID). A well-formed child line is harmless: it returns -EAGAIN on a DID
mismatch. A false match needs SSVID == DID and SSDID == RID, which is
impossible when SSDID > 0xFF because RID is a single byte. A malformed
child line, an indented comment or a whitespace-only line makes older
parsers stop with -EINVAL, hence the rules above.
Also fix the line number in diagnostics (it was one behind) and free
candidate paths that fail access() in find_asic_id_table().
Signed-off-by: Flora Cui <flo...@am...>
diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c
index 885465fc..d39e8dc3 100644
--- a/amdgpu/amdgpu_asic_id.c
+++ b/amdgpu/amdgpu_asic_id.c
@@ -39,6 +39,11 @@
#include "amdgpu_drm.h"
#include "amdgpu_internal.h"
+static int is_empty_or_comment_line(const char *line)
+{
+ return line[0] == '\0' || line[0] == '#';
+}
+
static int parse_one_line(struct amdgpu_device *dev, const char *line)
{
char *buf, *saveptr;
@@ -51,7 +56,7 @@ static int parse_one_line(struct amdgpu_device *dev, const char *line)
int r = -EINVAL;
/* ignore empty line and commented line */
- if (strlen(line) == 0 || line[0] == '#')
+ if (is_empty_or_comment_line(line))
return -EAGAIN;
buf = strdup(line);
@@ -109,6 +114,128 @@ out:
return r;
}
+/* Parse a whole 16-bit hex token; rejects empty, signed, overflowing or trailing-garbage input. */
+static int parse_hex(const char *tok, uint32_t *val)
+{
+ char *endptr;
+ unsigned long v;
+
+ while (isspace((unsigned char)*tok))
+ tok++;
+ if (!isxdigit((unsigned char)*tok))
+ return -EINVAL;
+
+ errno = 0;
+ v = strtoul(tok, &endptr, 16);
+ if (errno || *endptr || v > 0xFFFF)
+ return -EINVAL;
+
+ *val = v;
+
+ return 0;
+}
+
+/*
+ * Child line: SSVID, SSDID, name (leading indentation already stripped).
+ * Returns 0 and a malloc'd name on match, -EAGAIN on mismatch.
+ */
+static int parse_child_line(const char *line, uint32_t svid, uint32_t sdid,
+ char **name)
+{
+ char *buf, *saveptr;
+ char *s_svid, *s_sdid, *s_name;
+ uint32_t line_svid, line_sdid;
+ int r = -EINVAL;
+
+ buf = strdup(line);
+ if (!buf)
+ return -ENOMEM;
+
+ s_svid = strtok_r(buf, ",", &saveptr);
+ if (!s_svid || parse_hex(s_svid, &line_svid))
+ goto out;
+
+ s_sdid = strtok_r(NULL, ",", &saveptr);
+ if (!s_sdid || parse_hex(s_sdid, &line_sdid))
+ goto out;
+
+ s_name = strtok_r(NULL, ",", &saveptr);
+ if (!s_name)
+ goto out;
+
+ /* trim leading whitespaces or tabs */
+ while (isblank(*s_name))
+ s_name++;
+ if (strlen(s_name) == 0)
+ goto out;
+
+ if (line_svid != svid || line_sdid != sdid) {
+ r = -EAGAIN;
+ goto out;
+ }
+
+ *name = strdup(s_name);
+ r = *name ? 0 : -ENOMEM;
+
+out:
+ free(buf);
+
+ return r;
+}
+
+/*
+ * Read the indented children of the 2ID entry just matched; the first
+ * child matching the board's SSVID/SSDID replaces the 2ID name.
+ * line_num is the number of the last line read.
+ */
+static void parse_child_lines(struct amdgpu_device *dev, FILE *fp,
+ char **line, size_t *len, int line_num,
+ const char *path)
+{
+ ssize_t n;
+
+ if (!dev->has_subsys_id)
+ return;
+
+ while ((n = getline(line, len, fp)) != -1) {
+ char *name = NULL;
+ char *p = *line;
+ int r;
+
+ line_num++;
+
+ /* trim trailing newline */
+ if (p[n - 1] == '\n')
+ p[n - 1] = '\0';
+
+ /* blank and comment lines may sit between children */
+ if (p[0] == '\0' || p[0] == '#')
+ continue;
+
+ /* next 2ID entry */
+ if (!isblank((unsigned char)p[0]))
+ break;
+
+ while (isblank((unsigned char)*p))
+ p++;
+ if (*p == '\0' || *p == '#')
+ continue;
+
+ r = parse_child_line(p, dev->subsystem_vendor_id,
+ dev->subsystem_device_id, &name);
+ if (r == 0) {
+ free(dev->marketing_name);
+ dev->marketing_name = name;
+ break;
+ }
+ if (r == -EINVAL)
+ fprintf(stderr, "Invalid format, skipped: %s: line %d: %s\n",
+ path, line_num, *line);
+ else if (r != -EAGAIN)
+ break;
+ }
+}
+
static void amdgpu_parse_proc_cpuinfo(struct amdgpu_device *dev)
{
const char *search_key = "model name";
@@ -281,7 +408,7 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
char *line = NULL;
size_t len = 0;
ssize_t n;
- int line_num = 1;
+ int line_num = 0;
int r = 0;
char *amdgpu_asic_id_table_path = NULL;
@@ -303,33 +430,40 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
/* 1st valid line is file version */
while ((n = getline(&line, &len, fp)) != -1) {
+ line_num++;
+
/* trim trailing newline */
if (line[n - 1] == '\n')
line[n - 1] = '\0';
/* ignore empty line and commented line */
- if (strlen(line) == 0 || line[0] == '#') {
- line_num++;
+ if (is_empty_or_comment_line(line))
continue;
- }
drmMsg("%s version: %s\n", amdgpu_asic_id_table_path, line);
break;
}
while ((n = getline(&line, &len, fp)) != -1) {
+ line_num++;
+
/* trim trailing newline */
if (line[n - 1] == '\n')
line[n - 1] = '\0';
+ /* indented line: child of a non-matching 2ID entry */
+ if (isblank((unsigned char)line[0]))
+ continue;
+
r = parse_one_line(dev, line);
if (r != -EAGAIN)
break;
-
- line_num++;
}
- if (r == -EINVAL) {
+ if (r == 0 && dev->marketing_name) {
+ parse_child_lines(dev, fp, &line, &len, line_num,
+ amdgpu_asic_id_table_path);
+ } else if (r == -EINVAL) {
fprintf(stderr, "Invalid format: %s: line %d: %s\n",
amdgpu_asic_id_table_path, line_num, line);
} else if (r && r != -EAGAIN) {
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index ec186bbf..6e031a76 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -189,6 +189,21 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
dev->info.vce_harvest_config = dev->dev_info.vce_harvest_config;
dev->info.pci_rev_id = dev->dev_info.pci_rev;
+ {
+ drmDevicePtr device;
+
+ if (!drmGetDevice2(dev->fd, 0, &device)) {
+ if (device->bustype == DRM_BUS_PCI) {
+ dev->subsystem_vendor_id =
+ device->deviceinfo.pci->subvendor_id;
+ dev->subsystem_device_id =
+ device->deviceinfo.pci->subdevice_id;
+ dev->has_subsys_id = true;
+ }
+ drmFreeDevice(&device);
+ }
+ }
+
if (dev->info.family_id < AMDGPU_FAMILY_AI) {
unsigned nse = MIN2(dev->info.num_shader_engines,
ARRAY_SIZE(dev->info.backend_disable));
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 593b9f81..a6820964 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -88,6 +88,10 @@ struct amdgpu_device {
unsigned minor_version;
char *marketing_name;
+ /** PCI subsystem ids; valid only if has_subsys_id is set. */
+ uint16_t subsystem_vendor_id;
+ uint16_t subsystem_device_id;
+ bool has_subsys_id;
/** List of buffer handles. Protected by bo_table_mutex. */
struct handle_table bo_handles;
/** List of buffer GEM flink names. Protected by bo_table_mutex. */
diff --git a/data/amdgpu.ids b/data/amdgpu.ids
index 5792cdbf..9970ba47 100644
--- a/data/amdgpu.ids
+++ b/data/amdgpu.ids
@@ -2,6 +2,10 @@
#
# Syntax:
# device_id, revision_id, product_name <-- single tab after comma
+#
+# An entry may be followed by child lines that override the product name
+# for a specific board:
+# subsystem_vendor_id, subsystem_device_id, product_name
1.0.0
1114, C2, AMD Radeon 860M Graphics
|
|
From: GitLab M. <git...@ke...> - 2026-09-18 13:16:24
|
data/amdgpu.ids | 37 ++++++++++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 3 deletions(-)
New commits:
commit b97cbde15c5c3abfe44d78e8f57139e50f612fec
Author: Slava Abramov <sla...@am...>
Date: Thu Sep 17 18:36:18 2026 -0400
amdgpu: add missing marketing names and minor name fixes
Signed-off-by: Slava Abramov <sla...@am...>
diff --git a/data/amdgpu.ids b/data/amdgpu.ids
index 99034400..5792cdbf 100644
--- a/data/amdgpu.ids
+++ b/data/amdgpu.ids
@@ -340,6 +340,7 @@
66A1, 02, AMD Instinct MI60 / MI50
66A1, 06, AMD Radeon Pro VII
66AF, C1, AMD Radeon VII
+66AF, F6, AMD Radeon VII
6780, 00, AMD FirePro W9000
6784, 00, ATI FirePro V (FireGL V) Graphics Adapter
6788, 00, ATI FirePro V (FireGL V) Graphics Adapter
@@ -358,12 +359,14 @@
67B9, 00, AMD Radeon R9 200 Series
67C0, 00, AMD Radeon Pro WX 7100 Graphics
67C0, 80, AMD Radeon E9550
+67C2, 00, AMD Radeon Pro V7300X / V7350x2
67C2, 01, AMD Radeon Pro V7350x2
67C2, 02, AMD Radeon Pro V7300X
67C4, 00, AMD Radeon Pro WX 7100 Graphics
67C4, 80, AMD Radeon E9560 / E9565 Graphics
67C7, 00, AMD Radeon Pro WX 5100 Graphics
67C7, 80, AMD Radeon E9390 Graphics
+67D0, 00, AMD Radeon Pro V7300X / V7350x2
67D0, 01, AMD Radeon Pro V7350x2
67D0, 02, AMD Radeon Pro V7300X
67DF, C0, AMD Radeon Pro 580X
@@ -451,12 +454,15 @@
6860, 03, AMD Radeon Pro V340
6860, 04, AMD Radeon Instinct MI25x2
6860, 07, AMD Radeon Pro V320
+6860, C0, AMD Radeon Instinct MI25
6861, 00, AMD Radeon Pro WX 9100
6862, 00, AMD Radeon Pro SSG
6863, 00, AMD Radeon Vega Frontier Edition
+6864, 00, AMD Radeon Pro V340
6864, 03, AMD Radeon Pro V340
6864, 04, AMD Radeon Instinct MI25x2
6864, 05, AMD Radeon Pro V340
+6867, 00, AMD Radeon Pro Vega 56
6868, 00, AMD Radeon Pro WX 8200
686C, 00, AMD Radeon Instinct MI25 MxGPU
686C, 01, AMD Radeon Instinct MI25 MxGPU
@@ -465,10 +471,12 @@
686C, 04, AMD Radeon Instinct MI25x2 MxGPU
686C, 05, AMD Radeon Pro V340L MxGPU
686C, 06, AMD Radeon Instinct MI25 MxGPU
+686C, C1, AMD Radeon V340 / Instinct MI25 MxGPU
687F, 01, AMD Radeon RX Vega
687F, C0, AMD Radeon RX Vega
687F, C1, AMD Radeon RX Vega
687F, C3, AMD Radeon RX Vega
+687F, C4, AMD Radeon RX Vega
687F, C7, AMD Radeon RX Vega
6900, 00, AMD Radeon R7 M260
6900, 81, AMD Radeon R7 M360
@@ -478,7 +486,7 @@
6900, D1, AMD Radeon 530 Series
6900, D3, AMD Radeon 530 Series
6901, 00, AMD Radeon R5 M255
-6902, 00, AMD Radeon Series
+6902, 00, AMD Radeon R7 M265
6907, 00, AMD Radeon R5 M255
6907, 87, AMD Radeon R5 M315
6920, 00, AMD Radeon R9 M395X
@@ -499,6 +507,8 @@
6981, 00, AMD Radeon Pro WX 3200 Series
6981, 01, AMD Radeon Pro WX 3200 Series
6981, 10, AMD Radeon Pro WX 3200 Series
+6981, C0, AMD Radeon Pro WX 3200 Series
+6984, 80, AMD Radeon Pro WX 2100 Series
6985, 00, AMD Radeon Pro WX 3100
6986, 00, AMD Radeon Pro WX 2100
6987, 80, AMD Embedded Radeon E9171
@@ -514,8 +524,19 @@
699F, C3, AMD Radeon 500 Series
699F, C7, AMD Radeon RX 550 / 550 Series
699F, C9, AMD Radeon 540
+69A0, 00, AMD Radeon Vega 12
+69A1, 00, AMD Radeon Vega 12
+69A2, 00, AMD Radeon Vega 12
+69A3, 00, AMD Radeon Vega 12
+69AF, C0, AMD Radeon Pro Vega 20
+69AF, C1, AMD Radeon Pro Vega 20
+69AF, C3, AMD Radeon Pro Vega 20
+69AF, C7, AMD Radeon Pro Vega 16
+69AF, CF, AMD Radeon RX Vega (mobile / OEM)
+69AF, FF, AMD Radeon RX Vega (engineering / OEM final)
6FDF, E7, AMD Radeon RX 590 GME
6FDF, EF, AMD Radeon RX 580 2048SP
+6FDF, FF, AMD Radeon RX 580 2048SP
7300, C1, AMD FirePro S9300 x2
7300, C8, AMD Radeon R9 Fury Series
7300, C9, AMD Radeon Pro Duo
@@ -541,6 +562,7 @@
7341, 00, AMD Radeon Pro W5500
7347, 00, AMD Radeon Pro W5500M
7360, 41, AMD Radeon Pro 5600M
+7360, C1, AMD Radeon Pro V520
7360, C3, AMD Radeon Pro V520
7362, C1, AMD Radeon Pro V540
7362, C3, AMD Radeon Pro V520
@@ -581,6 +603,7 @@
7408, 00, AMD Instinct MI250X
740C, 01, AMD Instinct MI250X / MI250
740F, 02, AMD Instinct MI210
+7410, 02, AMD Instinct MI210 VF
7421, 00, AMD Radeon Pro W6500M
7422, 00, AMD Radeon Pro W6400
7423, 00, AMD Radeon Pro W6300M
@@ -627,24 +650,32 @@
74A0, 00, AMD Instinct MI300A
74A1, 00, AMD Instinct MI300X
74A2, 00, AMD Instinct MI308X
+74A2, A1, AMD Instinct MI300X
74A5, 00, AMD Instinct MI325X
74A8, 00, AMD Instinct MI308X HF
74A9, 00, AMD Instinct MI300X HF
74B5, 00, AMD Instinct MI300X VF
74B6, 00, AMD Instinct MI308X
+74B6, A1, AMD Instinct MI300X
+74B9, 00, AMD Instinct MI325X VF
74BD, 00, AMD Instinct MI300X HF
7550, C0, AMD Radeon RX 9070 XT
7550, C2, AMD Radeon RX 9070 GRE
7550, C3, AMD Radeon RX 9070
-7551, C0, AMD Radeon AI PRO R9700
-7551, C8, AMD Radeon AI PRO R9600D
+7551, C0, AMD Radeon AI Pro R9700
+7551, C1, AMD Radeon AI Pro R9700S
+7551, C8, AMD Radeon AI Pro R9600D
7590, C0, AMD Radeon RX 9060 XT
7590, C1, AMD Radeon RX 9060 XT LP
7590, C7, AMD Radeon RX 9060
+7590, CF, AMD Radeon RX 9050
+7590, DF, AMD Radeon RX 9050 4GB
75A0, 00, AMD Instinct MI350X
75A3, 00, AMD Instinct MI355X
+75A8, 00, AMD Instinct MI350P
75B0, 00, AMD Instinct MI350X VF
75B3, 00, AMD Instinct MI355X VF
+75B8, 00, AMD Instinct MI350P VF
9830, 00, AMD Radeon HD 8400 / R3 Series
9831, 00, AMD Radeon HD 8400E
9832, 00, AMD Radeon HD 8330
|
|
From: GitLab M. <git...@ke...> - 2026-09-17 10:40:12
|
xf86drmMode.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
New commits:
commit 3f5ee2c3b189f77e2ca873dcd16786edb4c1f05b
Author: Mario Limonciello <mar...@am...>
Date: Fri Jul 10 13:51:48 2026 -0500
xf86drmMode: validate event length in drmHandleEvent
drmHandleEvent walks the buffer returned by read() by advancing the
offset with i += e->length, where e->length is taken directly from the
buffer contents. Nothing validated this length, allowing a malformed or
untrusted event stream to misbehave:
- e->length == 0 causes the offset to never advance, producing an
infinite loop.
- e->length < sizeof(struct drm_event) leaves fewer bytes than the
header, so the next iteration casts a struct drm_event that straddles
the end of the buffer.
- e->length larger than the bytes remaining makes the handlers and the
next cast read past the end of the buffer.
Validate that a full struct drm_event fits in the remaining bytes, and
that the event length is at least sizeof(struct drm_event) and does not
exceed the bytes remaining. When validation fails, log the specific error
via drmMsg() and return -1 to signal the caller that event processing
failed. This helps diagnose kernel bugs or corrupted event streams rather
than silently skipping or causing undefined behavior.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/xf86drmMode.c b/xf86drmMode.c
index d4493430..5b5d7053 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1033,6 +1033,23 @@ drm_public int drmHandleEvent(int fd, drmEventContextPtr evctx)
i = 0;
while (i < len) {
e = (struct drm_event *)(buffer + i);
+ if (len - i < (int)sizeof(*e)) {
+ fprintf(stderr, "drmHandleEvent: incomplete event header at offset %d, len %d, sizeof(*e) %zu\n", i, len, sizeof(*e));
+ errno = EINVAL;
+ return -1;
+ }
+ if (e->length < sizeof(*e)) {
+ fprintf(stderr, "drmHandleEvent: event length %u smaller than header size %zu\n",
+ e->length, sizeof(*e));
+ errno = EINVAL;
+ return -1;
+ }
+ if (e->length > (uint32_t)(len - i)) {
+ fprintf(stderr, "drmHandleEvent: event length %u exceeds remaining buffer size %d\n",
+ e->length, len - i);
+ errno = EINVAL;
+ return -1;
+ }
switch (e->type) {
case DRM_EVENT_VBLANK:
if (evctx->version < 1 ||
|
|
From: GitLab M. <git...@ke...> - 2026-09-16 18:28:45
|
data/amdgpu.ids | 7 -------
1 file changed, 7 deletions(-)
New commits:
commit 06675b4fbede3c8547cf9de09444424672d06066
Author: Slava Abramov <sla...@am...>
Date: Tue Sep 15 19:23:43 2026 -0400
amdgpu: fix dups in amdgpu.ids
Signed-off-by: Slava Abramov <sla...@am...>
diff --git a/data/amdgpu.ids b/data/amdgpu.ids
index 978e5f74..99034400 100644
--- a/data/amdgpu.ids
+++ b/data/amdgpu.ids
@@ -130,9 +130,7 @@
15C8, D7, AMD Radeon 740M Graphics
15C8, D8, AMD Radeon 740M Graphics
15D8, 00, AMD Radeon RX Vega 8 Graphics WS
-15D8, 91, AMD Radeon Vega 3 Graphics
15D8, 91, AMD Ryzen Embedded R1606G with Radeon Vega Gfx
-15D8, 92, AMD Radeon Vega 3 Graphics
15D8, 92, AMD Ryzen Embedded R1505G with Radeon Vega Gfx
15D8, 93, AMD Radeon Vega 1 Graphics
15D8, A1, AMD Radeon Vega 10 Graphics
@@ -163,7 +161,6 @@
15D8, D9, AMD Radeon Vega 8 Graphics
15D8, DA, AMD Radeon Vega 11 Graphics
15D8, DB, AMD Radeon Vega 3 Graphics
-15D8, DB, AMD Radeon Vega 8 Graphics
15D8, DC, AMD Radeon Vega 3 Graphics
15D8, DD, AMD Radeon Vega 3 Graphics
15D8, DE, AMD Radeon Vega 3 Graphics
@@ -321,7 +318,6 @@
6640, 80, AMD Radeon R9 M380
6646, 00, AMD Radeon R9 M280X
6646, 80, AMD Radeon R9 M385
-6646, 80, AMD Radeon R9 M470X
6647, 00, AMD Radeon R9 M200X Series
6647, 80, AMD Radeon R9 M380
6649, 00, AMD FirePro W5100
@@ -418,7 +414,6 @@
6801, 00, AMD Radeon HD 8970M
6806, 00, AMD Radeon R9 M290X
6808, 00, AMD FirePro W7000
-6808, 00, ATI FirePro V (FireGL V) Graphics Adapter
6809, 00, ATI FirePro W5000
6810, 00, AMD Radeon R9 200 Series
6810, 81, AMD Radeon R9 370 Series
@@ -592,7 +587,6 @@
7423, 01, AMD Radeon Pro W6300
7424, 00, AMD Radeon RX 6300
743F, C1, AMD Radeon RX 6500 XT
-743F, C3, AMD Radeon RX 6500
743F, C3, AMD Radeon RX 6500M
743F, C7, AMD Radeon RX 6400
743F, C8, AMD Radeon RX 6500M
@@ -746,4 +740,3 @@
98E4, E9, AMD Radeon R4 Graphics
98E4, EA, AMD Radeon R4 Graphics
98E4, EB, AMD Radeon R3 Graphics
-98E4, EB, AMD Radeon R4 Graphics
|
|
From: GitLab M. <git...@ke...> - 2026-08-13 22:40:50
|
amdgpu/amdgpu_asic_id.c | 4 ++++
amdgpu/amdgpu_bo.c | 4 ++++
amdgpu/amdgpu_cs.c | 27 ++++++++++++++++++++++++++-
amdgpu/amdgpu_device.c | 5 +++++
amdgpu/amdgpu_gpu_info.c | 10 +++++++++-
amdgpu/handle_table.c | 7 ++++++-
6 files changed, 54 insertions(+), 3 deletions(-)
New commits:
commit 773536b1e5dde694dd743815528aff8bb2cf2cc3
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:12:50 2026 -0500
amdgpu: handle malloc failure in split_env_var
split_env_var() allocated the array of char pointers with malloc() and
immediately dereferenced it by writing ret[0] without checking whether
the allocation succeeded. Under memory pressure malloc() can return NULL,
resulting in a NULL pointer write and a crash.
Check the return value and, on failure, free the previously duplicated
environment string and return NULL. The caller already handles a NULL
return.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c
index fed3a531..885465fc 100644
--- a/amdgpu/amdgpu_asic_id.c
+++ b/amdgpu/amdgpu_asic_id.c
@@ -213,6 +213,10 @@ static char **split_env_var(const char *env_var_content)
return NULL;
}
ret = malloc(sizeof(char *) * (elements + 1));
+ if (!ret) {
+ free(dup_env_val);
+ return NULL;
+ }
ret[0] = dup_env_val;
for(char *p = (char *)dup_env_val; *p; p++) {
if (*p == ':') {
commit 10425b1f35feeeb56d5ac0ad24f193442d744094
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:13:00 2026 -0500
amdgpu: check drmGetVersion result before dereferencing
drmGetVersion() can return NULL when the DRM_IOCTL_VERSION ioctl fails
or an internal allocation fails. _amdgpu_device_initialize() used the
returned pointer immediately, reading version->version_major without a
NULL check, causing a NULL-pointer dereference and crash.
Check the return value and, on failure, jump to the existing cleanup
path which frees the partially initialized device, releases dev_mutex
and returns an error, mirroring the neighbouring version-mismatch path.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index 41c70fd5..b25e8f04 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -262,6 +262,11 @@ static int _amdgpu_device_initialize(int fd,
atomic_set(&dev->refcount, 1);
version = drmGetVersion(fd);
+ if (!version) {
+ fprintf(stderr, "%s: drmGetVersion failed\n", __func__);
+ r = -EBADF;
+ goto cleanup;
+ }
if (version->version_major != 3) {
fprintf(stderr, "%s: DRM version is %d.%d.%d but this driver is "
"only compatible with 3.x.x.\n",
commit c9b52c358979dff8d9117b95178dee5fbcd5b017
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:16:03 2026 -0500
amdgpu: bound alloca sizes in CS submission paths
Several command-submission helpers compute alloca() sizes from
caller-controlled uint32_t counts (number_of_ibs, number_of_dependencies,
fence_count and num_chunks) without any upper bound. A very large count
produces a multi-megabyte stack allocation that can jump over the stack
guard page (stack clash); on 32-bit the size multiplication can also wrap,
producing a tiny reservation that is subsequently overrun by the
full-count copy. The trailing "if (!dependencies)" style NULL checks after
alloca() never trigger and provide no protection.
Reject clearly out-of-range counts with -EINVAL before the corresponding
alloca(). The number of IBs is limited to the existing
AMDGPU_CS_MAX_IBS_PER_SUBMIT; dependencies, fences and raw chunk counts
are limited to a new AMDGPU_CS_MAX_ALLOCA_COUNT that is far above any
legitimate request. The raw chunk paths also reject non-positive counts so
a negative int cannot be sign-extended into a huge allocation.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index e138bc73..9e11cebe 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -39,6 +39,16 @@
static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem);
static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem);
+/*
+ * Upper bound for caller-controlled counts that are used to size on-stack
+ * alloca() buffers. Without a cap a large count produces a multi-megabyte
+ * allocation that can skip the stack guard page (stack clash), and on 32-bit
+ * the size multiplication can overflow, yielding a tiny buffer that is then
+ * overrun by the full-count copy. The number of IBs has its own, tighter
+ * limit (AMDGPU_CS_MAX_IBS_PER_SUBMIT).
+ */
+#define AMDGPU_CS_MAX_ALLOCA_COUNT 4096
+
/**
* Create command submission context
*
@@ -272,6 +282,10 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
return -EINVAL;
if (ibs_request->ring >= AMDGPU_CS_MAX_RINGS)
return -EINVAL;
+ if (ibs_request->number_of_ibs > AMDGPU_CS_MAX_IBS_PER_SUBMIT)
+ return -EINVAL;
+ if (ibs_request->number_of_dependencies > AMDGPU_CS_MAX_ALLOCA_COUNT)
+ return -EINVAL;
if (ibs_request->number_of_ibs == 0) {
ibs_request->seq_no = AMDGPU_NULL_SUBMIT_SEQ;
return 0;
@@ -522,6 +536,8 @@ static int amdgpu_ioctl_wait_fences(struct amdgpu_cs_fence *fences,
int r;
uint32_t i;
+ if (fence_count > AMDGPU_CS_MAX_ALLOCA_COUNT)
+ return -EINVAL;
drm_fences = alloca(sizeof(struct drm_amdgpu_fence) * fence_count);
for (i = 0; i < fence_count; i++) {
drm_fences[i].ctx_id = fences[i].context->id;
@@ -909,7 +925,7 @@ drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
union drm_amdgpu_cs cs;
uint64_t *chunk_array;
int i, r;
- if (num_chunks == 0)
+ if (num_chunks < 1 || num_chunks > AMDGPU_CS_MAX_ALLOCA_COUNT)
return -EINVAL;
memset(&cs, 0, sizeof(cs));
@@ -941,6 +957,9 @@ drm_public int amdgpu_cs_submit_raw2(amdgpu_device_handle dev,
uint64_t *chunk_array;
int i, r;
+ if (num_chunks < 1 || num_chunks > AMDGPU_CS_MAX_ALLOCA_COUNT)
+ return -EINVAL;
+
memset(&cs, 0, sizeof(cs));
chunk_array = alloca(sizeof(uint64_t) * num_chunks);
for (i = 0; i < num_chunks; i++)
commit b629efddb7597d7e741c46983ac49dabff6c14d4
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:12:45 2026 -0500
amdgpu: guard against overflow in handle_table_insert
The key passed to handle_table_insert() is a kernel-assigned GEM handle
(uint32_t) and is not validated before being used to size the table. When
the key is near UINT32_MAX, "key + 1" wraps to 0 and ALIGN(0, alignment)
yields a max_key of 0. realloc(ptr, 0) then frees the table (returning
NULL or a minimal allocation), after which "table->values[key] = value"
writes far past the end of the freed/NULL buffer.
On ILP32, the "max_key * sizeof(void *)" multiplication can also overflow
and request an allocation far smaller than the index that follows.
Reject implausibly large keys up front and perform the size arithmetic in
size_t so the allocation size and offset calculations cannot wrap.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/handle_table.c b/amdgpu/handle_table.c
index 4fdd29d3..eb3bacb7 100644
--- a/amdgpu/handle_table.c
+++ b/amdgpu/handle_table.c
@@ -33,9 +33,14 @@ drm_private int handle_table_insert(struct handle_table *table, uint32_t key,
{
if (key >= table->max_key) {
uint32_t alignment = sysconf(_SC_PAGESIZE) / sizeof(void*);
- uint32_t max_key = ALIGN(key + 1, alignment);
+ size_t max_key;
void **values;
+ if (key >= (1u << 28))
+ return -EINVAL;
+
+ max_key = ALIGN((size_t)key + 1, alignment);
+
values = realloc(table->values, max_key * sizeof(void *));
if (!values)
return -ENOMEM;
commit 95942a95aaaeaf3e7213d0fb285bde98bd4640be
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:13:30 2026 -0500
amdgpu: clamp num_shader_engines loop to array size
amdgpu_query_gpu_info_init() copies dev->info.num_shader_engines
verbatim from the kernel-provided DRM_AMDGPU_INFO data. For pre-GFX9
families (family_id < AMDGPU_FAMILY_AI) it then loops over that count,
writing amdgpu_read_mm_registers() results into backend_disable[i],
pa_sc_raster_cfg[i] and pa_sc_raster_cfg1[i]. All three are declared
uint32_t[4] in struct amdgpu_gpu_info, so a reported value greater
than 4 overflows these fixed-size arrays.
Clamp the loop bound to the array size with MIN2()/ARRAY_SIZE() so the
loop can never write past the end of the arrays regardless of the value
supplied by the kernel.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index 62552a97..ec186bbf 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -28,8 +28,13 @@
#include "amdgpu.h"
#include "amdgpu_drm.h"
#include "amdgpu_internal.h"
+#include "util_math.h"
#include "xf86drm.h"
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
drm_public int amdgpu_query_info(amdgpu_device_handle dev, unsigned info_id,
unsigned size, void *value)
{
@@ -185,7 +190,10 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
dev->info.pci_rev_id = dev->dev_info.pci_rev;
if (dev->info.family_id < AMDGPU_FAMILY_AI) {
- for (i = 0; i < (int)dev->info.num_shader_engines; i++) {
+ unsigned nse = MIN2(dev->info.num_shader_engines,
+ ARRAY_SIZE(dev->info.backend_disable));
+
+ for (i = 0; i < (int)nse; i++) {
unsigned instance = (i << AMDGPU_INFO_MMR_SE_INDEX_SHIFT) |
(AMDGPU_INFO_MMR_SH_INDEX_MASK <<
AMDGPU_INFO_MMR_SH_INDEX_SHIFT);
commit c6c86ca1ab4d1d5607d46aa0e7fa071d24c788d3
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:12:39 2026 -0500
amdgpu: reject out-of-range ip_instance in CS and semaphore APIs
amdgpu_cs_submit_one(), amdgpu_cs_signal_semaphore() and
amdgpu_cs_wait_semaphore() validate ip_type against AMDGPU_HW_IP_NUM and
ring against AMDGPU_CS_MAX_RINGS, but never bound ip_instance. The
unchecked value is then used to index the fixed-size context arrays
last_seq[][][] and sem_list[][][], both dimensioned by
AMDGPU_HW_IP_INSTANCE_MAX_COUNT. A caller-supplied ip_instance beyond
that bound results in out-of-bounds reads and, via list_add() into
sem_list, an out-of-bounds pointer write.
Validate ip_instance against AMDGPU_HW_IP_INSTANCE_MAX_COUNT alongside
the existing ip_type and ring checks in all three functions.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 2db49675..e138bc73 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -268,6 +268,8 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
if (ibs_request->ip_type >= AMDGPU_HW_IP_NUM)
return -EINVAL;
+ if (ibs_request->ip_instance >= AMDGPU_HW_IP_INSTANCE_MAX_COUNT)
+ return -EINVAL;
if (ibs_request->ring >= AMDGPU_CS_MAX_RINGS)
return -EINVAL;
if (ibs_request->number_of_ibs == 0) {
@@ -604,6 +606,8 @@ drm_public int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
return -EINVAL;
if (ip_type >= AMDGPU_HW_IP_NUM)
return -EINVAL;
+ if (ip_instance >= AMDGPU_HW_IP_INSTANCE_MAX_COUNT)
+ return -EINVAL;
if (ring >= AMDGPU_CS_MAX_RINGS)
return -EINVAL;
@@ -635,6 +639,8 @@ drm_public int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
return -EINVAL;
if (ip_type >= AMDGPU_HW_IP_NUM)
return -EINVAL;
+ if (ip_instance >= AMDGPU_HW_IP_INSTANCE_MAX_COUNT)
+ return -EINVAL;
if (ring >= AMDGPU_CS_MAX_RINGS)
return -EINVAL;
/* must signal first */
commit 7c22100f0aab8f4cc5ee1d43ad53397cb0264ff1
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:13:12 2026 -0500
amdgpu: fix self-deadlock in amdgpu_bo_import error path
amdgpu_bo_import() holds dev->bo_table_mutex across the whole import.
On a late failure it jumps to the free_bo_handle label, which calls
amdgpu_bo_free() while the mutex is still held. amdgpu_bo_free() takes
dev->bo_table_mutex itself, and since it is a plain non-recursive mutex
this results in a permanent self-deadlock.
Release the mutex before cleaning up in the error path so amdgpu_bo_free()
can acquire it normally, then return. The dedicated unlock label used by
the early error paths (where no bo has been created yet) keeps unlocking
exactly once, and the success paths are unchanged, so every path still
unlocks the mutex exactly once and returns the correct value.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 74e63984..a65c7b27 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -381,10 +381,14 @@ free_bo_handle:
if (flink_name && open_arg.handle)
drmCloseBufferHandle(dev->flink_fd, open_arg.handle);
+ /* Drop the lock before amdgpu_bo_free(), which re-acquires the same
+ * non-recursive mutex and would otherwise self-deadlock. */
+ pthread_mutex_unlock(&dev->bo_table_mutex);
if (bo)
amdgpu_bo_free(bo);
else
drmCloseBufferHandle(dev->fd, handle);
+ return r;
unlock:
pthread_mutex_unlock(&dev->bo_table_mutex);
return r;
|
|
From: GitLab M. <git...@ke...> - 2026-07-28 18:32:39
|
LICENSES/MIT.txt | 18 ++++++++++++++++++
libdrm_lists.h | 24 ++----------------------
libdrm_macros.h | 21 ++-------------------
util_double_list.h | 26 ++------------------------
util_math.h | 22 ++--------------------
xf86atomic.h | 27 +++------------------------
xf86drm.c | 29 +++++------------------------
xf86drm.h | 28 ++++------------------------
xf86drmHash.c | 26 +++-----------------------
xf86drmHash.h | 26 +++-----------------------
xf86drmMode.c | 33 ++++++---------------------------
xf86drmMode.h | 32 ++++++--------------------------
xf86drmRandom.c | 26 +++-----------------------
xf86drmRandom.h | 26 +++-----------------------
xf86drmSL.c | 26 +++-----------------------
15 files changed, 65 insertions(+), 325 deletions(-)
New commits:
commit 82f74e7a5a7403392e91352af00210ae26a81f19
Author: Ian Forbes <ian...@br...>
Date: Wed Jul 22 11:48:38 2026 -0500
Add SPDX Licenses to top level files using the REUSE layout
The license was verified to be MIT by https://tools.spdx.org/app/check_license
Signed-off-by: Ian Forbes <ian...@br...>
diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt
new file mode 100644
index 00000000..a019b57d
--- /dev/null
+++ b/LICENSES/MIT.txt
@@ -0,0 +1,18 @@
+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
+PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
diff --git a/libdrm_lists.h b/libdrm_lists.h
index 7f55fc0d..cf059e19 100644
--- a/libdrm_lists.h
+++ b/libdrm_lists.h
@@ -1,27 +1,7 @@
/**************************************************************************
*
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
- * All Rights Reserved.
- *
- * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
+ * SPDX-FileCopyrightText: 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
+ * SPDX-License-Identifier: MIT
*/
/*
diff --git a/libdrm_macros.h b/libdrm_macros.h
index 0dca8273..81af2702 100644
--- a/libdrm_macros.h
+++ b/libdrm_macros.h
@@ -1,23 +1,6 @@
/*
- * Copyright © 2014 NVIDIA Corporation
- *
- * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
+ * SPDX-FileCopyrightText: 2014 NVIDIA Corporation
+ * SPDX-License-Identifier: MIT
*/
#ifndef LIBDRM_LIBDRM_H
diff --git a/util_double_list.h b/util_double_list.h
index 9bdca137..f62d1d09 100644
--- a/util_double_list.h
+++ b/util_double_list.h
@@ -1,28 +1,6 @@
/*
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
- * All Rights Reserved.
- *
- * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
+ * SPDX-FileCopyrightText: 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
+ * SPDX-License-Identifier: MIT
*/
/**
diff --git a/util_math.h b/util_math.h
index 04a0966c..2f9de2e1 100644
--- a/util_math.h
+++ b/util_math.h
@@ -1,24 +1,6 @@
/*
- * Copyright 2014 Advanced Micro Devices, Inc.
- *
- * 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- *
+ * SPDX-FileCopyrightText: 2014 Advanced Micro Devices, Inc.
+ * SPDX-License-Identifier: MIT
*/
#ifndef _UTIL_MATH_H_
diff --git a/xf86atomic.h b/xf86atomic.h
index c19e493b..e6ad5074 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -1,28 +1,7 @@
/*
- * Copyright © 2009 Intel Corporation
- *
- * 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.
- *
- * Authors:
- * Chris Wilson <ch...@ch...>
- *
+ * SPDX-FileCopyrightText: 2009 Intel Corporation
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Chris Wilson <ch...@ch...>
*/
/**
diff --git a/xf86drm.c b/xf86drm.c
index a8b39a31..07dec49f 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2,33 +2,14 @@
* \file xf86drm.c
* User-level interface to DRM device
*
- * \author Rickard E. (Rik) Faith <fa...@va...>
- * \author Kevin E. Martin <ma...@va...>
*/
/*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileContributor: Kevin E. Martin <ma...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-FileCopyrightText: 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * SPDX-License-Identifier: MIT
*/
#include <stdio.h>
diff --git a/xf86drm.h b/xf86drm.h
index b45337a4..b9f4fd40 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -2,33 +2,13 @@
* \file xf86drm.h
* OS-independent header for DRM user-level library interface.
*
- * \author Rickard E. (Rik) Faith <fa...@va...>
*/
/*
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-FileCopyrightText: 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * SPDX-License-Identifier: MIT
*/
#ifndef _XF86DRM_H_
diff --git a/xf86drmHash.c b/xf86drmHash.c
index 2cf2b80e..c7b4a36f 100644
--- a/xf86drmHash.c
+++ b/xf86drmHash.c
@@ -1,29 +1,9 @@
/* xf86drmHash.c -- Small hash table support for integer -> integer mapping
* Created: Sun Apr 18 09:35:45 1999 by fa...@pr...
*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
- * Authors: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
*
* DESCRIPTION
*
diff --git a/xf86drmHash.h b/xf86drmHash.h
index 38fd84b7..00b36546 100644
--- a/xf86drmHash.h
+++ b/xf86drmHash.h
@@ -1,27 +1,7 @@
/*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
- * Authors: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
*/
#define HASH_SIZE 512 /* Good for about 100 entries */
diff --git a/xf86drmMode.c b/xf86drmMode.c
index a456e411..d4493430 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -2,35 +2,14 @@
* \file xf86drmMode.c
* Header for DRM modesetting interface.
*
- * \author Jakob Bornecrantz <wal...@gm...>
- *
- * \par Acknowledgements:
- * Feb 2007, Dave Airlie <ai...@li...>
*/
-/*
- * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright (c) 2007-2008 Dave Airlie <ai...@li...>
- * Copyright (c) 2007-2008 Jakob Bornecrantz <wal...@gm...>
- *
- * 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 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.
- *
+/* SPDX-FileContributor: Jakob Bornecrantz <wal...@gm...>
+ * SPDX-FileContributor: Dave Airlie <ai...@li...>
+ * SPDX-FileCopyrightText: 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * SPDX-FileCopyrightText: 2007-2008 Dave Airlie <ai...@li...>
+ * SPDX-FileCopyrightText: 2007-2008 Jakob Bornecrantz <wal...@gm...>
+ * SPDX-License-Identifier: MIT
*/
#include <assert.h>
diff --git a/xf86drmMode.h b/xf86drmMode.h
index 08487887..2a7156db 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -2,34 +2,14 @@
* \file xf86drmMode.h
* Header for DRM modesetting interface.
*
- * \author Jakob Bornecrantz <wal...@gm...>
- *
- * \par Acknowledgements:
- * Feb 2007, Dave Airlie <ai...@li...>
*/
-/*
- * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright (c) 2007-2008 Dave Airlie <ai...@li...>
- * Copyright (c) 2007-2008 Jakob Bornecrantz <wal...@gm...>
- *
- * 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 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.
+/* SPDX-FileContributor: Jakob Bornecrantz <wal...@gm...>
+ * SPDX-FileContributor: Dave Airlie <ai...@li...>
+ * SPDX-FileCopyrightText: 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * SPDX-FileCopyrightText: 2007-2008 Dave Airlie <ai...@li...>
+ * SPDX-FileCopyrightText: 2007-2008 Jakob Bornecrantz <wal...@gm...>
+ * SPDX-License-Identifier: MIT
*
*/
diff --git a/xf86drmRandom.c b/xf86drmRandom.c
index 51e9676f..3b9d93b5 100644
--- a/xf86drmRandom.c
+++ b/xf86drmRandom.c
@@ -1,29 +1,9 @@
/* xf86drmRandom.c -- "Minimal Standard" PRNG Implementation
* Created: Mon Apr 19 08:28:13 1999 by fa...@pr...
*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
- * Authors: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
*
* DESCRIPTION
*
diff --git a/xf86drmRandom.h b/xf86drmRandom.h
index 43b730ce..c006a932 100644
--- a/xf86drmRandom.h
+++ b/xf86drmRandom.h
@@ -1,27 +1,7 @@
/*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
- * Authors: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
*/
typedef struct RandomState {
diff --git a/xf86drmSL.c b/xf86drmSL.c
index 3826df97..938df0c7 100644
--- a/xf86drmSL.c
+++ b/xf86drmSL.c
@@ -1,29 +1,9 @@
/* xf86drmSL.c -- Skip list support
* Created: Mon May 10 09:28:13 1999 by fa...@pr...
*
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
- *
- * Authors: Rickard E. (Rik) Faith <fa...@va...>
+ * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * SPDX-License-Identifier: MIT
+ * SPDX-FileContributor: Rickard E. (Rik) Faith <fa...@va...>
*
* DESCRIPTION
*
|
|
From: GitLab M. <git...@ke...> - 2026-07-28 14:30:38
|
CleanSpec.mk | 1
freedreno/freedreno-symbols.txt | 45 --
freedreno/freedreno_bo.c | 359 -------------------
freedreno/freedreno_bo_cache.c | 220 -----------
freedreno/freedreno_device.c | 145 -------
freedreno/freedreno_drmif.h | 140 -------
freedreno/freedreno_pipe.c | 102 -----
freedreno/freedreno_priv.h | 258 -------------
freedreno/freedreno_ringbuffer.c | 182 ---------
freedreno/freedreno_ringbuffer.h | 142 -------
freedreno/kgsl/README | 26 -
freedreno/kgsl/kgsl_bo.c | 309 ----------------
freedreno/kgsl/kgsl_device.c | 63 ---
freedreno/kgsl/kgsl_drm.h | 192 ----------
freedreno/kgsl/kgsl_pipe.c | 282 ---------------
freedreno/kgsl/kgsl_priv.h | 120 ------
freedreno/kgsl/kgsl_ringbuffer.c | 235 ------------
freedreno/kgsl/msm_kgsl.h | 519 ---------------------------
freedreno/libdrm_freedreno.pc.in | 11
freedreno/meson.build | 80 ----
freedreno/msm/msm_bo.c | 170 ---------
freedreno/msm/msm_device.c | 63 ---
freedreno/msm/msm_pipe.c | 212 -----------
freedreno/msm/msm_priv.h | 141 -------
freedreno/msm/msm_ringbuffer.c | 723 ---------------------------------------
meson.build | 18
meson_options.txt | 11
27 files changed, 4769 deletions(-)
New commits:
commit d7a6f5fc6ef97f129b0d422a3c2c92ec7264eea0
Author: Rob Clark <rob...@fr...>
Date: Tue Jul 28 06:45:25 2026 -0700
Remove libdrm_freedreno
The copy in libdrm has not been maintained so much since mesa (being the
only consumer) copied this into the mesa tree in ~2018)
Signed-off-by: Rob Clark <rob...@fr...>
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 28a11db4..ea954d40 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -1,4 +1,3 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/libdrm)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/freedreno)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libdrm_*intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libdrm_*intermediates)
diff --git a/freedreno/freedreno-symbols.txt b/freedreno/freedreno-symbols.txt
deleted file mode 100644
index 471ca997..00000000
--- a/freedreno/freedreno-symbols.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-fd_bo_cpu_fini
-fd_bo_cpu_prep
-fd_bo_del
-fd_bo_dmabuf
-fd_bo_from_dmabuf
-fd_bo_from_fbdev
-fd_bo_from_handle
-fd_bo_from_name
-fd_bo_get_iova
-fd_bo_get_name
-fd_bo_handle
-fd_bo_map
-fd_bo_new
-fd_bo_put_iova
-fd_bo_ref
-fd_bo_size
-fd_device_del
-fd_device_fd
-fd_device_new
-fd_device_new_dup
-fd_device_ref
-fd_device_version
-fd_pipe_del
-fd_pipe_get_param
-fd_pipe_new
-fd_pipe_new2
-fd_pipe_ref
-fd_pipe_wait
-fd_pipe_wait_timeout
-fd_ringbuffer_cmd_count
-fd_ringbuffer_del
-fd_ringbuffer_emit_reloc_ring_full
-fd_ringbuffer_flush
-fd_ringbuffer_grow
-fd_ringbuffer_new
-fd_ringbuffer_new_flags
-fd_ringbuffer_new_object
-fd_ringbuffer_ref
-fd_ringbuffer_reloc
-fd_ringbuffer_reloc2
-fd_ringbuffer_reset
-fd_ringbuffer_set_parent
-fd_ringbuffer_size
-fd_ringbuffer_timestamp
-fd_ringbuffer_flush2
diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c
deleted file mode 100644
index 3cdc9737..00000000
--- a/freedreno/freedreno_bo.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-
-drm_private pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
-drm_private void bo_del(struct fd_bo *bo);
-
-/* set buffer name, and add to table, call w/ table_lock held: */
-static void set_name(struct fd_bo *bo, uint32_t name)
-{
- bo->name = name;
- /* add ourself into the handle table: */
- drmHashInsert(bo->dev->name_table, name, bo);
-}
-
-/* lookup a buffer, call w/ table_lock held: */
-static struct fd_bo * lookup_bo(void *tbl, uint32_t key)
-{
- struct fd_bo *bo = NULL;
- if (!drmHashLookup(tbl, key, (void **)&bo)) {
- /* found, incr refcnt and return: */
- bo = fd_bo_ref(bo);
-
- /* don't break the bucket if this bo was found in one */
- list_delinit(&bo->list);
- }
- return bo;
-}
-
-/* allocate a new buffer object, call w/ table_lock held */
-static struct fd_bo * bo_from_handle(struct fd_device *dev,
- uint32_t size, uint32_t handle)
-{
- struct fd_bo *bo;
-
- bo = dev->funcs->bo_from_handle(dev, size, handle);
- if (!bo) {
- drmCloseBufferHandle(dev->fd, handle);
- return NULL;
- }
- bo->dev = fd_device_ref(dev);
- bo->size = size;
- bo->handle = handle;
- atomic_set(&bo->refcnt, 1);
- list_inithead(&bo->list);
- /* add ourself into the handle table: */
- drmHashInsert(dev->handle_table, handle, bo);
- return bo;
-}
-
-static struct fd_bo *
-bo_new(struct fd_device *dev, uint32_t size, uint32_t flags,
- struct fd_bo_cache *cache)
-{
- struct fd_bo *bo = NULL;
- uint32_t handle;
- int ret;
-
- bo = fd_bo_cache_alloc(cache, &size, flags);
- if (bo)
- return bo;
-
- ret = dev->funcs->bo_new_handle(dev, size, flags, &handle);
- if (ret)
- return NULL;
-
- pthread_mutex_lock(&table_lock);
- bo = bo_from_handle(dev, size, handle);
- pthread_mutex_unlock(&table_lock);
-
- VG_BO_ALLOC(bo);
-
- return bo;
-}
-
-drm_public struct fd_bo *
-fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags)
-{
- struct fd_bo *bo = bo_new(dev, size, flags, &dev->bo_cache);
- if (bo)
- bo->bo_reuse = BO_CACHE;
- return bo;
-}
-
-/* internal function to allocate bo's that use the ringbuffer cache
- * instead of the normal bo_cache. The purpose is, because cmdstream
- * bo's get vmap'd on the kernel side, and that is expensive, we want
- * to re-use cmdstream bo's for cmdstream and not unrelated purposes.
- */
-drm_private struct fd_bo *
-fd_bo_new_ring(struct fd_device *dev, uint32_t size, uint32_t flags)
-{
- struct fd_bo *bo = bo_new(dev, size, flags, &dev->ring_cache);
- if (bo)
- bo->bo_reuse = RING_CACHE;
- return bo;
-}
-
-drm_public struct fd_bo *
-fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size)
-{
- struct fd_bo *bo = NULL;
-
- pthread_mutex_lock(&table_lock);
-
- bo = lookup_bo(dev->handle_table, handle);
- if (bo)
- goto out_unlock;
-
- bo = bo_from_handle(dev, size, handle);
-
- VG_BO_ALLOC(bo);
-
-out_unlock:
- pthread_mutex_unlock(&table_lock);
-
- return bo;
-}
-
-drm_public struct fd_bo *
-fd_bo_from_dmabuf(struct fd_device *dev, int fd)
-{
- int ret, size;
- uint32_t handle;
- struct fd_bo *bo;
-
- pthread_mutex_lock(&table_lock);
- ret = drmPrimeFDToHandle(dev->fd, fd, &handle);
- if (ret) {
- pthread_mutex_unlock(&table_lock);
- return NULL;
- }
-
- bo = lookup_bo(dev->handle_table, handle);
- if (bo)
- goto out_unlock;
-
- /* lseek() to get bo size */
- size = lseek(fd, 0, SEEK_END);
- lseek(fd, 0, SEEK_CUR);
-
- bo = bo_from_handle(dev, size, handle);
-
- VG_BO_ALLOC(bo);
-
-out_unlock:
- pthread_mutex_unlock(&table_lock);
-
- return bo;
-}
-
-drm_public struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name)
-{
- struct drm_gem_open req = {
- .name = name,
- };
- struct fd_bo *bo;
-
- pthread_mutex_lock(&table_lock);
-
- /* check name table first, to see if bo is already open: */
- bo = lookup_bo(dev->name_table, name);
- if (bo)
- goto out_unlock;
-
- if (drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req)) {
- ERROR_MSG("gem-open failed: %s", strerror(errno));
- goto out_unlock;
- }
-
- bo = lookup_bo(dev->handle_table, req.handle);
- if (bo)
- goto out_unlock;
-
- bo = bo_from_handle(dev, req.size, req.handle);
- if (bo) {
- set_name(bo, name);
- VG_BO_ALLOC(bo);
- }
-
-out_unlock:
- pthread_mutex_unlock(&table_lock);
-
- return bo;
-}
-
-drm_public uint64_t fd_bo_get_iova(struct fd_bo *bo)
-{
- return bo->funcs->iova(bo);
-}
-
-drm_public void fd_bo_put_iova(struct fd_bo *bo)
-{
- /* currently a no-op */
-}
-
-drm_public struct fd_bo * fd_bo_ref(struct fd_bo *bo)
-{
- atomic_inc(&bo->refcnt);
- return bo;
-}
-
-drm_public void fd_bo_del(struct fd_bo *bo)
-{
- struct fd_device *dev = bo->dev;
-
- if (!atomic_dec_and_test(&bo->refcnt))
- return;
-
- pthread_mutex_lock(&table_lock);
-
- if ((bo->bo_reuse == BO_CACHE) && (fd_bo_cache_free(&dev->bo_cache, bo) == 0))
- goto out;
- if ((bo->bo_reuse == RING_CACHE) && (fd_bo_cache_free(&dev->ring_cache, bo) == 0))
- goto out;
-
- bo_del(bo);
- fd_device_del_locked(dev);
-out:
- pthread_mutex_unlock(&table_lock);
-}
-
-/* Called under table_lock */
-drm_private void bo_del(struct fd_bo *bo)
-{
- VG_BO_FREE(bo);
-
- if (bo->map)
- drm_munmap(bo->map, bo->size);
-
- /* TODO probably bo's in bucket list get removed from
- * handle table??
- */
-
- if (bo->handle) {
- drmHashDelete(bo->dev->handle_table, bo->handle);
- if (bo->name)
- drmHashDelete(bo->dev->name_table, bo->name);
- drmCloseBufferHandle(bo->dev->fd, bo->handle);
- }
-
- bo->funcs->destroy(bo);
-}
-
-drm_public int fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
-{
- if (!bo->name) {
- struct drm_gem_flink req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_FLINK, &req);
- if (ret) {
- return ret;
- }
-
- pthread_mutex_lock(&table_lock);
- set_name(bo, req.name);
- pthread_mutex_unlock(&table_lock);
- bo->bo_reuse = NO_CACHE;
- }
-
- *name = bo->name;
-
- return 0;
-}
-
-drm_public uint32_t fd_bo_handle(struct fd_bo *bo)
-{
- return bo->handle;
-}
-
-drm_public int fd_bo_dmabuf(struct fd_bo *bo)
-{
- int ret, prime_fd;
-
- ret = drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC,
- &prime_fd);
- if (ret) {
- ERROR_MSG("failed to get dmabuf fd: %d", ret);
- return ret;
- }
-
- bo->bo_reuse = NO_CACHE;
-
- return prime_fd;
-}
-
-drm_public uint32_t fd_bo_size(struct fd_bo *bo)
-{
- return bo->size;
-}
-
-drm_public void * fd_bo_map(struct fd_bo *bo)
-{
- if (!bo->map) {
- uint64_t offset;
- int ret;
-
- ret = bo->funcs->offset(bo, &offset);
- if (ret) {
- return NULL;
- }
-
- bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED,
- bo->dev->fd, offset);
- if (bo->map == MAP_FAILED) {
- ERROR_MSG("mmap failed: %s", strerror(errno));
- bo->map = NULL;
- }
- }
- return bo->map;
-}
-
-/* a bit odd to take the pipe as an arg, but it's a, umm, quirk of kgsl.. */
-drm_public int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
-{
- return bo->funcs->cpu_prep(bo, pipe, op);
-}
-
-drm_public void fd_bo_cpu_fini(struct fd_bo *bo)
-{
- bo->funcs->cpu_fini(bo);
-}
-
-#if !HAVE_FREEDRENO_KGSL
-drm_public struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size)
-{
- return NULL;
-}
-#endif
diff --git a/freedreno/freedreno_bo_cache.c b/freedreno/freedreno_bo_cache.c
deleted file mode 100644
index bb0605ab..00000000
--- a/freedreno/freedreno_bo_cache.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2016 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-
-drm_private void bo_del(struct fd_bo *bo);
-drm_private extern pthread_mutex_t table_lock;
-
-static void
-add_bucket(struct fd_bo_cache *cache, int size)
-{
- unsigned int i = cache->num_buckets;
-
- assert(i < ARRAY_SIZE(cache->cache_bucket));
-
- list_inithead(&cache->cache_bucket[i].list);
- cache->cache_bucket[i].size = size;
- cache->num_buckets++;
-}
-
-/**
- * @coarse: if true, only power-of-two bucket sizes, otherwise
- * fill in for a bit smoother size curve..
- */
-drm_private void
-fd_bo_cache_init(struct fd_bo_cache *cache, int coarse)
-{
- unsigned long size, cache_max_size = 64 * 1024 * 1024;
-
- /* OK, so power of two buckets was too wasteful of memory.
- * Give 3 other sizes between each power of two, to hopefully
- * cover things accurately enough. (The alternative is
- * probably to just go for exact matching of sizes, and assume
- * that for things like composited window resize the tiled
- * width/height alignment and rounding of sizes to pages will
- * get us useful cache hit rates anyway)
- */
- add_bucket(cache, 4096);
- add_bucket(cache, 4096 * 2);
- if (!coarse)
- add_bucket(cache, 4096 * 3);
-
- /* Initialize the linked lists for BO reuse cache. */
- for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
- add_bucket(cache, size);
- if (!coarse) {
- add_bucket(cache, size + size * 1 / 4);
- add_bucket(cache, size + size * 2 / 4);
- add_bucket(cache, size + size * 3 / 4);
- }
- }
-}
-
-/* Frees older cached buffers. Called under table_lock */
-drm_private void
-fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time)
-{
- int i;
-
- if (cache->time == time)
- return;
-
- for (i = 0; i < cache->num_buckets; i++) {
- struct fd_bo_bucket *bucket = &cache->cache_bucket[i];
- struct fd_bo *bo;
-
- while (!LIST_IS_EMPTY(&bucket->list)) {
- bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
-
- /* keep things in cache for at least 1 second: */
- if (time && ((time - bo->free_time) <= 1))
- break;
-
- VG_BO_OBTAIN(bo);
- list_del(&bo->list);
- bo_del(bo);
- }
- }
-
- cache->time = time;
-}
-
-static struct fd_bo_bucket * get_bucket(struct fd_bo_cache *cache, uint32_t size)
-{
- int i;
-
- /* hmm, this is what intel does, but I suppose we could calculate our
- * way to the correct bucket size rather than looping..
- */
- for (i = 0; i < cache->num_buckets; i++) {
- struct fd_bo_bucket *bucket = &cache->cache_bucket[i];
- if (bucket->size >= size) {
- return bucket;
- }
- }
-
- return NULL;
-}
-
-static int is_idle(struct fd_bo *bo)
-{
- return fd_bo_cpu_prep(bo, NULL,
- DRM_FREEDRENO_PREP_READ |
- DRM_FREEDRENO_PREP_WRITE |
- DRM_FREEDRENO_PREP_NOSYNC) == 0;
-}
-
-static struct fd_bo *find_in_bucket(struct fd_bo_bucket *bucket, uint32_t flags)
-{
- struct fd_bo *bo = NULL;
-
- /* TODO .. if we had an ALLOC_FOR_RENDER flag like intel, we could
- * skip the busy check.. if it is only going to be a render target
- * then we probably don't need to stall..
- *
- * NOTE that intel takes ALLOC_FOR_RENDER bo's from the list tail
- * (MRU, since likely to be in GPU cache), rather than head (LRU)..
- */
- pthread_mutex_lock(&table_lock);
- if (!LIST_IS_EMPTY(&bucket->list)) {
- bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
- /* TODO check for compatible flags? */
- if (is_idle(bo)) {
- list_del(&bo->list);
- } else {
- bo = NULL;
- }
- }
- pthread_mutex_unlock(&table_lock);
-
- return bo;
-}
-
-/* NOTE: size is potentially rounded up to bucket size: */
-drm_private struct fd_bo *
-fd_bo_cache_alloc(struct fd_bo_cache *cache, uint32_t *size, uint32_t flags)
-{
- struct fd_bo *bo = NULL;
- struct fd_bo_bucket *bucket;
-
- *size = ALIGN(*size, 4096);
- bucket = get_bucket(cache, *size);
-
- /* see if we can be green and recycle: */
-retry:
- if (bucket) {
- *size = bucket->size;
- bo = find_in_bucket(bucket, flags);
- if (bo) {
- VG_BO_OBTAIN(bo);
- if (bo->funcs->madvise(bo, TRUE) <= 0) {
- /* we've lost the backing pages, delete and try again: */
- pthread_mutex_lock(&table_lock);
- bo_del(bo);
- pthread_mutex_unlock(&table_lock);
- goto retry;
- }
- atomic_set(&bo->refcnt, 1);
- fd_device_ref(bo->dev);
- return bo;
- }
- }
-
- return NULL;
-}
-
-drm_private int
-fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo)
-{
- struct fd_bo_bucket *bucket = get_bucket(cache, bo->size);
-
- /* see if we can be green and recycle: */
- if (bucket) {
- struct timespec time;
-
- bo->funcs->madvise(bo, FALSE);
-
- clock_gettime(CLOCK_MONOTONIC, &time);
-
- bo->free_time = time.tv_sec;
- VG_BO_RELEASE(bo);
- list_addtail(&bo->list, &bucket->list);
- fd_bo_cache_cleanup(cache, time.tv_sec);
-
- /* bo's in the bucket cache don't have a ref and
- * don't hold a ref to the dev:
- */
- fd_device_del_locked(bo->dev);
-
- return 0;
- }
-
- return -1;
-}
diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c
deleted file mode 100644
index ac234304..00000000
--- a/freedreno/freedreno_device.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-
-static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
-
-struct fd_device * kgsl_device_new(int fd);
-struct fd_device * msm_device_new(int fd);
-
-drm_public struct fd_device * fd_device_new(int fd)
-{
- struct fd_device *dev;
- drmVersionPtr version;
-
- /* figure out if we are kgsl or msm drm driver: */
- version = drmGetVersion(fd);
- if (!version) {
- ERROR_MSG("cannot get version: %s", strerror(errno));
- return NULL;
- }
-
- if (!strcmp(version->name, "msm")) {
- DEBUG_MSG("msm DRM device");
- if (version->version_major != 1) {
- ERROR_MSG("unsupported version: %u.%u.%u", version->version_major,
- version->version_minor, version->version_patchlevel);
- dev = NULL;
- goto out;
- }
-
- dev = msm_device_new(fd);
- dev->version = version->version_minor;
-#if HAVE_FREEDRENO_KGSL
- } else if (!strcmp(version->name, "kgsl")) {
- DEBUG_MSG("kgsl DRM device");
- dev = kgsl_device_new(fd);
-#endif
- } else {
- ERROR_MSG("unknown device: %s", version->name);
- dev = NULL;
- }
-
-out:
- drmFreeVersion(version);
-
- if (!dev)
- return NULL;
-
- atomic_set(&dev->refcnt, 1);
- dev->fd = fd;
- dev->handle_table = drmHashCreate();
- dev->name_table = drmHashCreate();
- fd_bo_cache_init(&dev->bo_cache, FALSE);
- fd_bo_cache_init(&dev->ring_cache, TRUE);
-
- return dev;
-}
-
-/* like fd_device_new() but creates it's own private dup() of the fd
- * which is close()d when the device is finalized.
- */
-drm_public struct fd_device * fd_device_new_dup(int fd)
-{
- int dup_fd = dup(fd);
- struct fd_device *dev = fd_device_new(dup_fd);
- if (dev)
- dev->closefd = 1;
- else
- close(dup_fd);
- return dev;
-}
-
-drm_public struct fd_device * fd_device_ref(struct fd_device *dev)
-{
- atomic_inc(&dev->refcnt);
- return dev;
-}
-
-static void fd_device_del_impl(struct fd_device *dev)
-{
- int close_fd = dev->closefd ? dev->fd : -1;
- fd_bo_cache_cleanup(&dev->bo_cache, 0);
- drmHashDestroy(dev->handle_table);
- drmHashDestroy(dev->name_table);
- dev->funcs->destroy(dev);
- if (close_fd >= 0)
- close(close_fd);
-}
-
-drm_private void fd_device_del_locked(struct fd_device *dev)
-{
- if (!atomic_dec_and_test(&dev->refcnt))
- return;
- fd_device_del_impl(dev);
-}
-
-drm_public void fd_device_del(struct fd_device *dev)
-{
- if (!atomic_dec_and_test(&dev->refcnt))
- return;
- pthread_mutex_lock(&table_lock);
- fd_device_del_impl(dev);
- pthread_mutex_unlock(&table_lock);
-}
-
-drm_public int fd_device_fd(struct fd_device *dev)
-{
- return dev->fd;
-}
-
-drm_public enum fd_version fd_device_version(struct fd_device *dev)
-{
- return dev->version;
-}
diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h
deleted file mode 100644
index c95c21be..00000000
--- a/freedreno/freedreno_drmif.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#ifndef FREEDRENO_DRMIF_H_
-#define FREEDRENO_DRMIF_H_
-
-#include <xf86drm.h>
-#include <stdint.h>
-
-#if defined(__GNUC__)
-# define drm_deprecated __attribute__((__deprecated__))
-#else
-# define drm_deprecated
-#endif
-
-/* an empty marker for things that will be deprecated in the future: */
-#define will_be_deprecated
-
-struct fd_bo;
-struct fd_pipe;
-struct fd_device;
-
-enum fd_pipe_id {
- FD_PIPE_3D = 1,
- FD_PIPE_2D = 2,
- /* some devices have two 2d blocks.. not really sure how to
- * use that yet, so just ignoring the 2nd 2d pipe for now
- */
- FD_PIPE_MAX
-};
-
-enum fd_param_id {
- FD_DEVICE_ID,
- FD_GMEM_SIZE,
- FD_GPU_ID,
- FD_CHIP_ID,
- FD_MAX_FREQ,
- FD_TIMESTAMP,
- FD_NR_RINGS, /* # of rings == # of distinct priority levels */
-};
-
-/* bo flags: */
-#define DRM_FREEDRENO_GEM_TYPE_SMI 0x00000001
-#define DRM_FREEDRENO_GEM_TYPE_KMEM 0x00000002
-#define DRM_FREEDRENO_GEM_TYPE_MEM_MASK 0x0000000f
-#define DRM_FREEDRENO_GEM_CACHE_NONE 0x00000000
-#define DRM_FREEDRENO_GEM_CACHE_WCOMBINE 0x00100000
-#define DRM_FREEDRENO_GEM_CACHE_WTHROUGH 0x00200000
-#define DRM_FREEDRENO_GEM_CACHE_WBACK 0x00400000
-#define DRM_FREEDRENO_GEM_CACHE_WBACKWA 0x00800000
-#define DRM_FREEDRENO_GEM_CACHE_MASK 0x00f00000
-#define DRM_FREEDRENO_GEM_GPUREADONLY 0x01000000
-
-/* bo access flags: (keep aligned to MSM_PREP_x) */
-#define DRM_FREEDRENO_PREP_READ 0x01
-#define DRM_FREEDRENO_PREP_WRITE 0x02
-#define DRM_FREEDRENO_PREP_NOSYNC 0x04
-
-/* device functions:
- */
-
-struct fd_device * fd_device_new(int fd);
-struct fd_device * fd_device_new_dup(int fd);
-struct fd_device * fd_device_ref(struct fd_device *dev);
-void fd_device_del(struct fd_device *dev);
-int fd_device_fd(struct fd_device *dev);
-
-enum fd_version {
- FD_VERSION_MADVISE = 1, /* kernel supports madvise */
- FD_VERSION_UNLIMITED_CMDS = 1, /* submits w/ >4 cmd buffers (growable ringbuffer) */
- FD_VERSION_FENCE_FD = 2, /* submit command supports in/out fences */
- FD_VERSION_SUBMIT_QUEUES = 3, /* submit queues and multiple priority levels */
- FD_VERSION_BO_IOVA = 3, /* supports fd_bo_get/put_iova() */
-};
-enum fd_version fd_device_version(struct fd_device *dev);
-
-/* pipe functions:
- */
-
-struct fd_pipe * fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id);
-struct fd_pipe * fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio);
-struct fd_pipe * fd_pipe_ref(struct fd_pipe *pipe);
-void fd_pipe_del(struct fd_pipe *pipe);
-int fd_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id param,
- uint64_t *value);
-int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp);
-/* timeout in nanosec */
-int fd_pipe_wait_timeout(struct fd_pipe *pipe, uint32_t timestamp,
- uint64_t timeout);
-
-
-/* buffer-object functions:
- */
-
-struct fd_bo * fd_bo_new(struct fd_device *dev,
- uint32_t size, uint32_t flags);
-struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe,
- int fbfd, uint32_t size);
-struct fd_bo *fd_bo_from_handle(struct fd_device *dev,
- uint32_t handle, uint32_t size);
-struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name);
-struct fd_bo * fd_bo_from_dmabuf(struct fd_device *dev, int fd);
-uint64_t fd_bo_get_iova(struct fd_bo *bo);
-void fd_bo_put_iova(struct fd_bo *bo);
-struct fd_bo * fd_bo_ref(struct fd_bo *bo);
-void fd_bo_del(struct fd_bo *bo);
-int fd_bo_get_name(struct fd_bo *bo, uint32_t *name);
-uint32_t fd_bo_handle(struct fd_bo *bo);
-int fd_bo_dmabuf(struct fd_bo *bo);
-uint32_t fd_bo_size(struct fd_bo *bo);
-void * fd_bo_map(struct fd_bo *bo);
-int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op);
-void fd_bo_cpu_fini(struct fd_bo *bo);
-
-#endif /* FREEDRENO_DRMIF_H_ */
diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c
deleted file mode 100644
index e82e6448..00000000
--- a/freedreno/freedreno_pipe.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-
-/**
- * priority of zero is highest priority, and higher numeric values are
- * lower priorities
- */
-drm_public struct fd_pipe *
-fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
-{
- struct fd_pipe *pipe;
- uint64_t val;
-
- if (id > FD_PIPE_MAX) {
- ERROR_MSG("invalid pipe id: %d", id);
- return NULL;
- }
-
- if ((prio != 1) && (fd_device_version(dev) < FD_VERSION_SUBMIT_QUEUES)) {
- ERROR_MSG("invalid priority!");
- return NULL;
- }
-
- pipe = dev->funcs->pipe_new(dev, id, prio);
- if (!pipe) {
- ERROR_MSG("allocation failed");
- return NULL;
- }
-
- pipe->dev = dev;
- pipe->id = id;
- atomic_set(&pipe->refcnt, 1);
-
- fd_pipe_get_param(pipe, FD_GPU_ID, &val);
- pipe->gpu_id = val;
-
- return pipe;
-}
-
-drm_public struct fd_pipe *
-fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
-{
- return fd_pipe_new2(dev, id, 1);
-}
-
-drm_public struct fd_pipe * fd_pipe_ref(struct fd_pipe *pipe)
-{
- atomic_inc(&pipe->refcnt);
- return pipe;
-}
-
-drm_public void fd_pipe_del(struct fd_pipe *pipe)
-{
- if (!atomic_dec_and_test(&pipe->refcnt))
- return;
- pipe->funcs->destroy(pipe);
-}
-
-drm_public int fd_pipe_get_param(struct fd_pipe *pipe,
- enum fd_param_id param, uint64_t *value)
-{
- return pipe->funcs->get_param(pipe, param, value);
-}
-
-drm_public int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp)
-{
- return fd_pipe_wait_timeout(pipe, timestamp, ~0);
-}
-
-drm_public int fd_pipe_wait_timeout(struct fd_pipe *pipe, uint32_t timestamp,
- uint64_t timeout)
-{
- return pipe->funcs->wait(pipe, timestamp, timeout);
-}
diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
deleted file mode 100644
index b8eac4b2..00000000
--- a/freedreno/freedreno_priv.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#ifndef FREEDRENO_PRIV_H_
-#define FREEDRENO_PRIV_H_
-
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "libdrm_macros.h"
-#include "xf86drm.h"
-#include "xf86atomic.h"
-
-#include "util_double_list.h"
-#include "util_math.h"
-
-#include "freedreno_drmif.h"
-#include "freedreno_ringbuffer.h"
-#include "drm.h"
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-struct fd_device_funcs {
- int (*bo_new_handle)(struct fd_device *dev, uint32_t size,
- uint32_t flags, uint32_t *handle);
- struct fd_bo * (*bo_from_handle)(struct fd_device *dev,
- uint32_t size, uint32_t handle);
- struct fd_pipe * (*pipe_new)(struct fd_device *dev, enum fd_pipe_id id,
- unsigned prio);
- void (*destroy)(struct fd_device *dev);
-};
-
-struct fd_bo_bucket {
- uint32_t size;
- struct list_head list;
-};
-
-struct fd_bo_cache {
- struct fd_bo_bucket cache_bucket[14 * 4];
- int num_buckets;
- time_t time;
-};
-
-struct fd_device {
- int fd;
- enum fd_version version;
- atomic_t refcnt;
-
- /* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects:
- *
- * handle_table: maps handle to fd_bo
- * name_table: maps flink name to fd_bo
- *
- * We end up needing two tables, because DRM_IOCTL_GEM_OPEN always
- * returns a new handle. So we need to figure out if the bo is already
- * open in the process first, before calling gem-open.
- */
- void *handle_table, *name_table;
-
- const struct fd_device_funcs *funcs;
-
- struct fd_bo_cache bo_cache;
- struct fd_bo_cache ring_cache;
-
- int closefd; /* call close(fd) upon destruction */
-
- /* just for valgrind: */
- int bo_size;
-};
-
-drm_private void fd_bo_cache_init(struct fd_bo_cache *cache, int coarse);
-drm_private void fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time);
-drm_private struct fd_bo * fd_bo_cache_alloc(struct fd_bo_cache *cache,
- uint32_t *size, uint32_t flags);
-drm_private int fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo);
-
-/* for where @table_lock is already held: */
-drm_private void fd_device_del_locked(struct fd_device *dev);
-
-struct fd_pipe_funcs {
- struct fd_ringbuffer * (*ringbuffer_new)(struct fd_pipe *pipe, uint32_t size,
- enum fd_ringbuffer_flags flags);
- int (*get_param)(struct fd_pipe *pipe, enum fd_param_id param, uint64_t *value);
- int (*wait)(struct fd_pipe *pipe, uint32_t timestamp, uint64_t timeout);
- void (*destroy)(struct fd_pipe *pipe);
-};
-
-struct fd_pipe {
- struct fd_device *dev;
- enum fd_pipe_id id;
- uint32_t gpu_id;
- atomic_t refcnt;
- const struct fd_pipe_funcs *funcs;
-};
-
-struct fd_ringbuffer_funcs {
- void * (*hostptr)(struct fd_ringbuffer *ring);
- int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start,
- int in_fence_fd, int *out_fence_fd);
- void (*grow)(struct fd_ringbuffer *ring, uint32_t size);
- void (*reset)(struct fd_ringbuffer *ring);
- void (*emit_reloc)(struct fd_ringbuffer *ring,
- const struct fd_reloc *reloc);
- uint32_t (*emit_reloc_ring)(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx);
- uint32_t (*cmd_count)(struct fd_ringbuffer *ring);
- void (*destroy)(struct fd_ringbuffer *ring);
-};
-
-struct fd_bo_funcs {
- int (*offset)(struct fd_bo *bo, uint64_t *offset);
- int (*cpu_prep)(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op);
- void (*cpu_fini)(struct fd_bo *bo);
- int (*madvise)(struct fd_bo *bo, int willneed);
- uint64_t (*iova)(struct fd_bo *bo);
- void (*destroy)(struct fd_bo *bo);
-};
-
-struct fd_bo {
- struct fd_device *dev;
- uint32_t size;
- uint32_t handle;
- uint32_t name;
- void *map;
- atomic_t refcnt;
- const struct fd_bo_funcs *funcs;
-
- enum {
- NO_CACHE = 0,
- BO_CACHE = 1,
- RING_CACHE = 2,
- } bo_reuse;
-
- struct list_head list; /* bucket-list entry */
- time_t free_time; /* time when added to bucket-list */
-};
-
-drm_private struct fd_bo *fd_bo_new_ring(struct fd_device *dev,
- uint32_t size, uint32_t flags);
-
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
-#define enable_debug 0 /* TODO make dynamic */
-
-#define INFO_MSG(fmt, ...) \
- do { drmMsg("[I] "fmt " (%s:%d)\n", \
- ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
-#define DEBUG_MSG(fmt, ...) \
- do if (enable_debug) { drmMsg("[D] "fmt " (%s:%d)\n", \
- ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
-#define WARN_MSG(fmt, ...) \
- do { drmMsg("[W] "fmt " (%s:%d)\n", \
- ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
-#define ERROR_MSG(fmt, ...) \
- do { drmMsg("[E] " fmt " (%s:%d)\n", \
- ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
-
-#define U642VOID(x) ((void *)(unsigned long)(x))
-#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
-
-static inline uint32_t
-offset_bytes(void *end, void *start)
-{
- return ((char *)end) - ((char *)start);
-}
-
-#if HAVE_VALGRIND
-# include <memcheck.h>
-
-/*
- * For tracking the backing memory (if valgrind enabled, we force a mmap
- * for the purposes of tracking)
- */
-static inline void VG_BO_ALLOC(struct fd_bo *bo)
-{
- if (bo && RUNNING_ON_VALGRIND) {
- VALGRIND_MALLOCLIKE_BLOCK(fd_bo_map(bo), bo->size, 0, 1);
- }
-}
-
-static inline void VG_BO_FREE(struct fd_bo *bo)
-{
- VALGRIND_FREELIKE_BLOCK(bo->map, 0);
-}
-
-/*
- * For tracking bo structs that are in the buffer-cache, so that valgrind
- * doesn't attribute ownership to the first one to allocate the recycled
- * bo.
- *
- * Note that the list_head in fd_bo is used to track the buffers in cache
- * so disable error reporting on the range while they are in cache so
- * valgrind doesn't squawk about list traversal.
- *
- */
-static inline void VG_BO_RELEASE(struct fd_bo *bo)
-{
- if (RUNNING_ON_VALGRIND) {
- VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE(bo, bo->dev->bo_size);
- VALGRIND_MAKE_MEM_NOACCESS(bo, bo->dev->bo_size);
- VALGRIND_FREELIKE_BLOCK(bo->map, 0);
- }
-}
-static inline void VG_BO_OBTAIN(struct fd_bo *bo)
-{
- if (RUNNING_ON_VALGRIND) {
- VALGRIND_MAKE_MEM_DEFINED(bo, bo->dev->bo_size);
- VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE(bo, bo->dev->bo_size);
- VALGRIND_MALLOCLIKE_BLOCK(bo->map, bo->size, 0, 1);
- }
-}
-#else
-static inline void VG_BO_ALLOC(struct fd_bo *bo) {}
-static inline void VG_BO_FREE(struct fd_bo *bo) {}
-static inline void VG_BO_RELEASE(struct fd_bo *bo) {}
-static inline void VG_BO_OBTAIN(struct fd_bo *bo) {}
-#endif
-
-
-#endif /* FREEDRENO_PRIV_H_ */
diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c
deleted file mode 100644
index 8f0093ae..00000000
--- a/freedreno/freedreno_ringbuffer.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include <assert.h>
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-#include "freedreno_ringbuffer.h"
-
-drm_public struct fd_ringbuffer *
-fd_ringbuffer_new_flags(struct fd_pipe *pipe, uint32_t size,
- enum fd_ringbuffer_flags flags)
-{
- struct fd_ringbuffer *ring;
-
- /* we can't really support "growable" rb's in general for
- * stateobj's since we need a single gpu addr (ie. can't
- * do the trick of a chain of IB packets):
- */
- if (flags & FD_RINGBUFFER_OBJECT)
- assert(size);
-
- ring = pipe->funcs->ringbuffer_new(pipe, size, flags);
- if (!ring)
- return NULL;
-
- ring->flags = flags;
- ring->pipe = pipe;
- ring->start = ring->funcs->hostptr(ring);
- ring->end = &(ring->start[ring->size/4]);
-
- ring->cur = ring->last_start = ring->start;
-
- return ring;
-}
-
-drm_public struct fd_ringbuffer *
-fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size)
-{
- return fd_ringbuffer_new_flags(pipe, size, 0);
-}
-
-drm_public struct fd_ringbuffer *
-fd_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size)
-{
- return fd_ringbuffer_new_flags(pipe, size, FD_RINGBUFFER_OBJECT);
-}
-
-drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring)
-{
- if (!atomic_dec_and_test(&ring->refcnt))
- return;
-
- fd_ringbuffer_reset(ring);
- ring->funcs->destroy(ring);
-}
-
-drm_public struct fd_ringbuffer *
-fd_ringbuffer_ref(struct fd_ringbuffer *ring)
-{
- STATIC_ASSERT(sizeof(ring->refcnt) <= sizeof(ring->__pad));
- atomic_inc(&ring->refcnt);
- return ring;
-}
-
-/* ringbuffers which are IB targets should set the toplevel rb (ie.
- * the IB source) as it's parent before emitting reloc's, to ensure
- * the bookkeeping works out properly.
- */
-drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *parent)
-{
- /* state objects should not be parented! */
- assert(!(ring->flags & FD_RINGBUFFER_OBJECT));
- ring->parent = parent;
-}
-
-drm_public void fd_ringbuffer_reset(struct fd_ringbuffer *ring)
-{
- uint32_t *start = ring->start;
- if (ring->pipe->id == FD_PIPE_2D)
- start = &ring->start[0x140];
- ring->cur = ring->last_start = start;
- if (ring->funcs->reset)
- ring->funcs->reset(ring);
-}
-
-drm_public int fd_ringbuffer_flush(struct fd_ringbuffer *ring)
-{
- return ring->funcs->flush(ring, ring->last_start, -1, NULL);
-}
-
-drm_public int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd,
- int *out_fence_fd)
-{
- return ring->funcs->flush(ring, ring->last_start, in_fence_fd, out_fence_fd);
-}
-
-drm_public void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords)
-{
- assert(ring->funcs->grow); /* unsupported on kgsl */
-
- /* there is an upper bound on IB size, which appears to be 0x100000 */
- if (ring->size < 0x100000)
- ring->size *= 2;
-
- ring->funcs->grow(ring, ring->size);
-
- ring->start = ring->funcs->hostptr(ring);
- ring->end = &(ring->start[ring->size/4]);
-
- ring->cur = ring->last_start = ring->start;
-}
-
-drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring)
-{
- return ring->last_timestamp;
-}
-
-drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring,
- const struct fd_reloc *reloc)
-{
- assert(ring->pipe->gpu_id < 500);
- ring->funcs->emit_reloc(ring, reloc);
-}
-
-drm_public void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring,
- const struct fd_reloc *reloc)
-{
- ring->funcs->emit_reloc(ring, reloc);
-}
-
-drm_public uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring)
-{
- if (!ring->funcs->cmd_count)
- return 1;
- return ring->funcs->cmd_count(ring);
-}
-
-drm_public uint32_t
-fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx)
-{
- return ring->funcs->emit_reloc_ring(ring, target, cmd_idx);
-}
-
-drm_public uint32_t
-fd_ringbuffer_size(struct fd_ringbuffer *ring)
-{
- /* only really needed for stateobj ringbuffers, and won't really
- * do what you expect for growable rb's.. so lets just restrict
- * this to stateobj's for now:
- */
- assert(ring->flags & FD_RINGBUFFER_OBJECT);
- return offset_bytes(ring->cur, ring->start);
-}
-
diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h
deleted file mode 100644
index bc41a31c..00000000
--- a/freedreno/freedreno_ringbuffer.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2012 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#ifndef FREEDRENO_RINGBUFFER_H_
-#define FREEDRENO_RINGBUFFER_H_
-
-#include <freedreno_drmif.h>
-
-/* the ringbuffer object is not opaque so that OUT_RING() type stuff
- * can be inlined. Note that users should not make assumptions about
- * the size of this struct.
- */
-
-struct fd_ringbuffer_funcs;
-
-enum fd_ringbuffer_flags {
-
- /* Ringbuffer is a "state object", which is potentially reused
- * many times, rather than being used in one-shot mode linked
- * to a parent ringbuffer.
- */
- FD_RINGBUFFER_OBJECT = 0x1,
-
- /* Hint that the stateobj will be used for streaming state
- * that is used once or a few times and then discarded.
- *
- * For sub-allocation, non streaming stateobj's should be
- * sub-allocated from a page size buffer, so one long lived
- * state obj doesn't prevent other pages from being freed.
- * (Ie. it would be no worse than allocating a page sized
- * bo for each small non-streaming stateobj).
- *
- * But streaming stateobj's could be sub-allocated from a
- * larger buffer to reduce the alloc/del overhead.
- */
- FD_RINGBUFFER_STREAMING = 0x2,
-};
-
-struct fd_ringbuffer {
- int size;
- uint32_t *cur, *end, *start, *last_start;
- struct fd_pipe *pipe;
- const struct fd_ringbuffer_funcs *funcs;
- uint32_t last_timestamp;
- struct fd_ringbuffer *parent;
-
- /* for users of fd_ringbuffer to store their own private per-
- * ringbuffer data
- */
- void *user;
-
- enum fd_ringbuffer_flags flags;
-
- /* This is a bit gross, but we can't use atomic_t in exported
- * headers. OTOH, we don't need the refcnt to be publicly
- * visible. The only reason that this struct is exported is
- * because fd_ringbuffer_emit needs to be something that can
- * be inlined for performance reasons.
- */
- union {
-#ifdef HAS_ATOMIC_OPS
- atomic_t refcnt;
-#endif
- uint64_t __pad;
- };
-};
-
-struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe,
- uint32_t size);
-will_be_deprecated
-struct fd_ringbuffer * fd_ringbuffer_new_object(struct fd_pipe *pipe,
- uint32_t size);
-struct fd_ringbuffer * fd_ringbuffer_new_flags(struct fd_pipe *pipe,
- uint32_t size, enum fd_ringbuffer_flags flags);
-
-struct fd_ringbuffer *fd_ringbuffer_ref(struct fd_ringbuffer *ring);
-void fd_ringbuffer_del(struct fd_ringbuffer *ring);
-void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *parent);
-will_be_deprecated
-void fd_ringbuffer_reset(struct fd_ringbuffer *ring);
-int fd_ringbuffer_flush(struct fd_ringbuffer *ring);
-/* in_fence_fd: -1 for no in-fence, else fence fd
- * out_fence_fd: NULL for no output-fence requested, else ptr to return out-fence
- */
-int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd,
- int *out_fence_fd);
-void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords);
-uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring);
-
-static inline void fd_ringbuffer_emit(struct fd_ringbuffer *ring,
- uint32_t data)
-{
- (*ring->cur++) = data;
-}
-
-struct fd_reloc {
- struct fd_bo *bo;
-#define FD_RELOC_READ 0x0001
-#define FD_RELOC_WRITE 0x0002
- uint32_t flags;
- uint32_t offset;
- uint32_t or;
- int32_t shift;
- uint32_t orhi; /* used for a5xx+ */
-};
-
-/* NOTE: relocs are 2 dwords on a5xx+ */
-
-void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
-will_be_deprecated void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
-uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring);
-uint32_t fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx);
-uint32_t fd_ringbuffer_size(struct fd_ringbuffer *ring);
-
-#endif /* FREEDRENO_RINGBUFFER_H_ */
diff --git a/freedreno/kgsl/README b/freedreno/kgsl/README
deleted file mode 100644
index c46ba08b..00000000
--- a/freedreno/kgsl/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This is a historical description of what is now the kgsl backend
-in libdrm freedreno (before the upstream drm/msm driver). Note
-that the kgsl backend requires the "kgsl-drm" shim driver, which
-usually is in disrepair (QCOM does not build it for android), and
-due to random differences between different downstream android
-kernel branches it may or may not work. So YMMV.
-
-Original README:
-----------------
-
-Note that current msm kernel driver is a bit strange. It provides a
-DRM interface for GEM, which is basically sufficient to have DRI2
-working. But it does not provide KMS. And interface to 2d and 3d
-cores is via different other devices (/dev/kgsl-*). This is not
-quite how I'd write a DRM driver, but at this stage it is useful for
-xf86-video-freedreno and fdre (and eventual gallium driver) to be
-able to work on existing kernel driver from QCOM, to allow to
-capture cmdstream dumps from the binary blob drivers without having
-to reboot. So libdrm_freedreno attempts to hide most of the crazy.
-The intention is that when there is a proper kernel driver, it will
-be mostly just changes in libdrm_freedreno to adapt the gallium
-driver and xf86-video-freedreno (ignoring the fbdev->KMS changes).
-
-So don't look at freedreno as an example of how to write a libdrm
-module or a DRM driver.. it is just an attempt to paper over a non-
-standard kernel driver architecture.
diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c
deleted file mode 100644
index 55b6e5c0..00000000
--- a/freedreno/kgsl/kgsl_bo.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2013 Rob Clark <rob...@fr...>
- *
- * 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.
- *
- * Authors:
- * Rob Clark <rob...@fr...>
- */
-
-#include "kgsl_priv.h"
-
-static int set_memtype(struct fd_device *dev, uint32_t handle, uint32_t flags)
-{
- struct drm_kgsl_gem_memtype req = {
- .handle = handle,
- .type = flags & DRM_FREEDRENO_GEM_TYPE_MEM_MASK,
- };
-
- return drmCommandWrite(dev->fd, DRM_KGSL_GEM_SETMEMTYPE,
- &req, sizeof(req));
-}
-
-static int bo_alloc(struct kgsl_bo *kgsl_bo)
-{
- struct fd_bo *bo = &kgsl_bo->base;
- if (!kgsl_bo->offset) {
- struct drm_kgsl_gem_alloc req = {
- .handle = bo->handle,
- };
- int ret;
-
- /* if the buffer is already backed by pages then this
- * doesn't actually do anything (other than giving us
- * the offset)
- */
- ret = drmCommandWriteRead(bo->dev->fd, DRM_KGSL_GEM_ALLOC,
- &req, sizeof(req));
- if (ret) {
- ERROR_MSG("alloc failed: %s", strerror(errno));
- return ret;
- }
-
- kgsl_bo->offset = req.offset;
- }
-
- return 0;
-}
-
-static int kgsl_bo_offset(struct fd_bo *bo, uint64_t *offset)
-{
- struct kgsl_bo *kgsl_bo = to_kgsl_bo(bo);
- int ret = bo_alloc(kgsl_bo);
- if (ret)
- return ret;
- *offset = kgsl_bo->offset;
- return 0;
-}
-
-static int kgsl_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
-{
- uint32_t timestamp = kgsl_bo_get_timestamp(to_kgsl_bo(bo));
-
- if (op & DRM_FREEDRENO_PREP_NOSYNC) {
- uint32_t current;
- int ret;
-
- /* special case for is_idle().. we can't really handle that
- * properly in kgsl (perhaps we need a way to just disable
- * the bo-cache for kgsl?)
- */
- if (!pipe)
- return -EBUSY;
-
- ret = kgsl_pipe_timestamp(to_kgsl_pipe(pipe), ¤t);
- if (ret)
- return ret;
-
- if (timestamp > current)
- return -EBUSY;
-
- return 0;
- }
-
- if (timestamp)
- fd_pipe_wait(pipe, timestamp);
-
- return 0;
-}
-
-static void kgsl_bo_cpu_fini(struct fd_bo *bo)
-{
-}
-
-static int kgsl_bo_madvise(struct fd_bo *bo, int willneed)
-{
- return willneed; /* not supported by kgsl */
-}
-
-static void kgsl_bo_destroy(struct fd_bo *bo)
-{
- struct kgsl_bo *kgsl_bo = to_kgsl_bo(bo);
- free(kgsl_bo);
-
-}
-
-static const struct fd_bo_funcs funcs = {
- .offset = kgsl_bo_offset,
- .cpu_prep = kgsl_bo_cpu_prep,
- .cpu_fini = kgsl_bo_cpu_fini,
- .madvise = kgsl_bo_madvise,
- .destroy = kgsl_bo_destroy,
-};
-
-/* allocate a buffer handle: */
-drm_private int kgsl_bo_new_handle(struct fd_device *dev,
- uint32_t size, uint32_t flags, uint32_t *handle)
-{
- struct drm_kgsl_gem_create req = {
- .size = size,
- };
- int ret;
-
- ret = drmCommandWriteRead(dev->fd, DRM_KGSL_GEM_CREATE,
- &req, sizeof(req));
- if (ret)
- return ret;
-
- // TODO make flags match msm driver, since kgsl is legacy..
- // translate flags in kgsl..
-
- set_memtype(dev, req.handle, flags);
-
- *handle = req.handle;
-
- return 0;
-}
-
-/* allocate a new buffer object */
-drm_private struct fd_bo * kgsl_bo_from_handle(struct fd_device *dev,
- uint32_t size, uint32_t handle)
-{
- struct kgsl_bo *kgsl_bo;
- struct fd_bo *bo;
- unsigned i;
-
- kgsl_bo = calloc(1, sizeof(*kgsl_bo));
- if (!kgsl_bo)
- return NULL;
-
- bo = &kgsl_bo->base;
- bo->funcs = &funcs;
-
- for (i = 0; i < ARRAY_SIZE(kgsl_bo->list); i++)
- list_inithead(&kgsl_bo->list[i]);
-
- return bo;
-}
-
-drm_public struct fd_bo *
-fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size)
-{
- struct fd_bo *bo;
-
- if (!is_kgsl_pipe(pipe))
- return NULL;
-
- bo = fd_bo_new(pipe->dev, 1, 0);
-
- /* this is fugly, but works around a bug in the kernel..
- * priv->memdesc.size never gets set, so getbufinfo ioctl
- * thinks the buffer hasn't be allocate and fails
- */
- if (bo) {
- void *fbmem = drm_mmap(NULL, size, PROT_READ | PROT_WRITE,
- MAP_SHARED, fbfd, 0);
- struct kgsl_map_user_mem req = {
- .memtype = KGSL_USER_MEM_TYPE_ADDR,
- .len = size,
- .offset = 0,
- .hostptr = (unsigned long)fbmem,
- };
- struct kgsl_bo *kgsl_bo = to_kgsl_bo(bo);
- int ret;
-
- ret = ioctl(to_kgsl_pipe(pipe)->fd, IOCTL_KGSL_MAP_USER_MEM, &req);
- if (ret) {
- ERROR_MSG("mapping user mem failed: %s",
- strerror(errno));
- goto fail;
- }
- kgsl_bo->gpuaddr = req.gpuaddr;
- bo->map = fbmem;
- }
-
- return bo;
-fail:
- if (bo)
- fd_bo_del(bo);
- return NULL;
-}
-
-drm_private uint32_t kgsl_bo_gpuaddr(struct kgsl_bo *kgsl_bo, uint32_t offset)
-{
- struct fd_bo *bo = &kgsl_bo->base;
- if (!kgsl_bo->gpuaddr) {
- struct drm_kgsl_gem_bufinfo req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = bo_alloc(kgsl_bo);
- if (ret) {
- return ret;
- }
-
- ret = drmCommandWriteRead(bo->dev->fd, DRM_KGSL_GEM_GET_BUFINFO,
- &req, sizeof(req));
- if (ret) {
- ERROR_MSG("get bufinfo failed: %s", strerror(errno));
- return 0;
- }
-
- kgsl_bo->gpuaddr = req.gpuaddr[0];
- }
- return kgsl_bo->gpuaddr + offset;
-}
-
-/*
- * Super-cheezy way to synchronization between mesa and ddx.. the
- * SET_ACTIVE ioctl gives us a way to stash a 32b # w/ a GEM bo, and
- * GET_BUFINFO gives us a way to retrieve it. We use this to stash
- * the timestamp of the last ISSUEIBCMDS on the buffer.
- *
- * To avoid an obscene amount of syscalls, we:
- * 1) Only set the timestamp for buffers w/ an flink name, ie.
- * only buffers shared across processes. This is enough to
- * catch the DRI2 buffers.
- * 2) Only set the timestamp for buffers submitted to the 3d ring
- * and only check the timestamps on buffers submitted to the
- * 2d ring. This should be enough to handle synchronizing of
- * presentation blit. We could do synchronization in the other
- * direction too, but that would be problematic if we are using
- * the 3d ring from DDX, since client side wouldn't know this.
- *
- * The waiting on timestamp happens before flush, and setting of
- * timestamp happens after flush. It is transparent to the user
- * of libdrm_freedreno as all the tracking of buffers happens via
- * _emit_reloc()..
- */
-
-drm_private void kgsl_bo_set_timestamp(struct kgsl_bo *kgsl_bo,
- uint32_t timestamp)
-{
- struct fd_bo *bo = &kgsl_bo->base;
- if (bo->name) {
- struct drm_kgsl_gem_active req = {
- .handle = bo->handle,
- .active = timestamp,
- };
- int ret;
-
- ret = drmCommandWrite(bo->dev->fd, DRM_KGSL_GEM_SET_ACTIVE,
- &req, sizeof(req));
- if (ret) {
- ERROR_MSG("set active failed: %s", strerror(errno));
- }
- }
-}
-
-drm_private uint32_t kgsl_bo_get_timestamp(struct kgsl_bo *kgsl_bo)
-{
- struct fd_bo *bo = &kgsl_bo->base;
- uint32_t timestamp = 0;
- if (bo->name) {
- struct drm_kgsl_gem_bufinfo req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmCommandWriteRead(bo->dev->fd, DRM_KGSL_GEM_GET_BUFINFO,
- &req, sizeof(req));
- if (ret) {
- ERROR_MSG("get bufinfo failed: %s", strerror(errno));
- return 0;
- }
-
- timestamp = req.active;
- }
- return timestamp;
-}
diff --git a/freedreno/kgsl/kgsl_device.c b/freedreno/kgsl/kgsl_device.c
deleted file mode 100644
index 914f3412..00000000
--- a/freedreno/kgsl/kgsl_device.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2013 Rob Clark <rob...@fr...>
- *
- * 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 wit...
[truncated message content] |
|
From: GitLab M. <git...@ke...> - 2026-07-20 09:53:59
|
xf86drm.c | 14 +++++++-------
xf86drmMode.c | 46 ++++++++++++++++++++++------------------------
2 files changed, 29 insertions(+), 31 deletions(-)
New commits:
commit f198c21dfcb89127083413dd4779a13b3f9a6507
Author: Mario Limonciello <mar...@am...>
Date: Fri Jul 10 12:17:35 2026 -0500
xf86drm: fix integer overflow in allocations
drmAllocCpy() and many resource-fetching functions took kernel-returned
counts as int or __u32, multiplied them by sizeof(...) as ints, and
passed the product to drmMalloc(int size). On LP64 systems this
truncates any size_t result down to a signed 32-bit quantity. Products
at or above 2^31 become negative and are sign-extended when passed to
calloc(), so the allocation either fails (yielding a NULL that is
subsequently used as a write target) or, combined with an overflowing
multiply, succeeds with an undersized buffer.
drmAllocCpy() compounded this: it multiplied count and entry_size as
ints before handing the result to drmMalloc(), and iterated with an int
index. A large count could wrap the product to a small positive value,
producing an undersized allocation filled by a full-count memcpy.
Fix by replacing drmMalloc(count * sizeof(T)) with calloc(count,
sizeof(T)) at all call sites where count originates from the kernel.
calloc's two-argument form performs the multiplication in size_t and
rejects overflowing products, and drmAllocCpy now takes size_t
parameters and iterates with a size_t index so all arithmetic stays in
an unsigned 64-bit domain on LP64.
Affected functions: drmAllocCpy, drmModeGetResources,
drmModeGetConnector, drmModeGetProperty, drmModeObjectGetProperties,
drmModeAtomicDuplicate, drmModeAtomicCommit, drmMarkBufs, drmGetBufInfo,
drmMapBufs, drmDMA, drmGetReservedContextList.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/xf86drm.c b/xf86drm.c
index 16eda782..a8b39a31 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1690,7 +1690,7 @@ drm_public int drmMarkBufs(int fd, double low, double high)
if (!info.count)
return -EINVAL;
- if (!(info.list = drmMalloc(info.count * sizeof(*info.list))))
+ if (!(info.list = calloc(info.count, sizeof(*info.list))))
return -ENOMEM;
if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) {
@@ -1828,7 +1828,7 @@ drm_public drmBufInfoPtr drmGetBufInfo(int fd)
return NULL;
if (info.count) {
- if (!(info.list = drmMalloc(info.count * sizeof(*info.list))))
+ if (!(info.list = calloc(info.count, sizeof(*info.list))))
return NULL;
if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) {
@@ -1838,7 +1838,7 @@ drm_public drmBufInfoPtr drmGetBufInfo(int fd)
retval = drmMalloc(sizeof(*retval));
retval->count = info.count;
- if (!(retval->list = drmMalloc(info.count * sizeof(*retval->list)))) {
+ if (!(retval->list = calloc(info.count, sizeof(*retval->list)))) {
drmFree(retval);
drmFree(info.list);
return NULL;
@@ -1884,7 +1884,7 @@ drm_public drmBufMapPtr drmMapBufs(int fd)
if (!bufs.count)
return NULL;
- if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list))))
+ if (!(bufs.list = calloc(bufs.count, sizeof(*bufs.list))))
return NULL;
if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) {
@@ -1894,7 +1894,7 @@ drm_public drmBufMapPtr drmMapBufs(int fd)
retval = drmMalloc(sizeof(*retval));
retval->count = bufs.count;
- retval->list = drmMalloc(bufs.count * sizeof(*retval->list));
+ retval->list = calloc(bufs.count, sizeof(*retval->list));
for (i = 0; i < bufs.count; i++) {
retval->list[i].idx = bufs.list[i].idx;
retval->list[i].total = bufs.list[i].total;
@@ -2041,9 +2041,9 @@ drm_public drm_context_t *drmGetReservedContextList(int fd, int *count)
if (!res.count)
return NULL;
- if (!(list = drmMalloc(res.count * sizeof(*list))))
+ if (!(list = calloc(res.count, sizeof(*list))))
return NULL;
- if (!(retval = drmMalloc(res.count * sizeof(*retval))))
+ if (!(retval = calloc(res.count, sizeof(*retval))))
goto err_free_list;
res.contexts = list;
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 950b9843..a456e411 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -72,15 +72,15 @@ static inline int DRM_IOCTL(int fd, unsigned long cmd, void *arg)
* Util functions
*/
-static void* drmAllocCpy(char *array, int count, int entry_size)
+static void* drmAllocCpy(char *array, size_t count, size_t entry_size)
{
char *r;
- int i;
+ size_t i;
if (!count || !array || !entry_size)
return 0;
- if (!(r = drmMalloc(count*entry_size)))
+ if (!(r = calloc(count, entry_size)))
return 0;
for (i = 0; i < count; i++)
@@ -174,22 +174,22 @@ retry:
counts = res;
if (res.count_fbs) {
- res.fb_id_ptr = VOID2U64(drmMalloc(res.count_fbs*sizeof(uint32_t)));
+ res.fb_id_ptr = VOID2U64(calloc(res.count_fbs, sizeof(uint32_t)));
if (!res.fb_id_ptr)
goto err_allocs;
}
if (res.count_crtcs) {
- res.crtc_id_ptr = VOID2U64(drmMalloc(res.count_crtcs*sizeof(uint32_t)));
+ res.crtc_id_ptr = VOID2U64(calloc(res.count_crtcs, sizeof(uint32_t)));
if (!res.crtc_id_ptr)
goto err_allocs;
}
if (res.count_connectors) {
- res.connector_id_ptr = VOID2U64(drmMalloc(res.count_connectors*sizeof(uint32_t)));
+ res.connector_id_ptr = VOID2U64(calloc(res.count_connectors, sizeof(uint32_t)));
if (!res.connector_id_ptr)
goto err_allocs;
}
if (res.count_encoders) {
- res.encoder_id_ptr = VOID2U64(drmMalloc(res.count_encoders*sizeof(uint32_t)));
+ res.encoder_id_ptr = VOID2U64(calloc(res.count_encoders, sizeof(uint32_t)));
if (!res.encoder_id_ptr)
goto err_allocs;
}
@@ -525,16 +525,16 @@ retry:
counts = conn;
if (conn.count_props) {
- conn.props_ptr = VOID2U64(drmMalloc(conn.count_props*sizeof(uint32_t)));
+ conn.props_ptr = VOID2U64(calloc(conn.count_props, sizeof(uint32_t)));
if (!conn.props_ptr)
goto err_allocs;
- conn.prop_values_ptr = VOID2U64(drmMalloc(conn.count_props*sizeof(uint64_t)));
+ conn.prop_values_ptr = VOID2U64(calloc(conn.count_props, sizeof(uint64_t)));
if (!conn.prop_values_ptr)
goto err_allocs;
}
if (conn.count_modes) {
- conn.modes_ptr = VOID2U64(drmMalloc(conn.count_modes*sizeof(struct drm_mode_modeinfo)));
+ conn.modes_ptr = VOID2U64(calloc(conn.count_modes, sizeof(struct drm_mode_modeinfo)));
if (!conn.modes_ptr)
goto err_allocs;
} else {
@@ -543,7 +543,7 @@ retry:
}
if (conn.count_encoders) {
- conn.encoders_ptr = VOID2U64(drmMalloc(conn.count_encoders*sizeof(uint32_t)));
+ conn.encoders_ptr = VOID2U64(calloc(conn.count_encoders, sizeof(uint32_t)));
if (!conn.encoders_ptr)
goto err_allocs;
}
@@ -681,14 +681,14 @@ drm_public drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
return 0;
if (prop.count_values)
- prop.values_ptr = VOID2U64(drmMalloc(prop.count_values * sizeof(uint64_t)));
+ prop.values_ptr = VOID2U64(calloc(prop.count_values, sizeof(uint64_t)));
if (prop.count_enum_blobs && (prop.flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)))
- prop.enum_blob_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(struct drm_mode_property_enum)));
+ prop.enum_blob_ptr = VOID2U64(calloc(prop.count_enum_blobs, sizeof(struct drm_mode_property_enum)));
if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_BLOB)) {
- prop.values_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(uint32_t)));
- prop.enum_blob_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(uint32_t)));
+ prop.values_ptr = VOID2U64(calloc(prop.count_enum_blobs, sizeof(uint32_t)));
+ prop.enum_blob_ptr = VOID2U64(calloc(prop.count_enum_blobs, sizeof(uint32_t)));
}
if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPERTY, &prop)) {
@@ -1290,12 +1290,10 @@ retry:
count = properties.count_props;
if (count) {
- properties.props_ptr = VOID2U64(drmMalloc(count *
- sizeof(uint32_t)));
+ properties.props_ptr = VOID2U64(calloc(count, sizeof(uint32_t)));
if (!properties.props_ptr)
goto err_allocs;
- properties.prop_values_ptr = VOID2U64(drmMalloc(count *
- sizeof(uint64_t)));
+ properties.prop_values_ptr = VOID2U64(calloc(count, sizeof(uint64_t)));
if (!properties.prop_values_ptr)
goto err_allocs;
}
@@ -1400,7 +1398,7 @@ drm_public drmModeAtomicReqPtr drmModeAtomicDuplicate(const drmModeAtomicReqPtr
new->size_items = old->size_items;
if (old->size_items) {
- new->items = drmMalloc(old->size_items * sizeof(*new->items));
+ new->items = calloc(old->size_items, sizeof(*new->items));
if (!new->items) {
free(new);
return NULL;
@@ -1569,25 +1567,25 @@ drm_public int drmModeAtomicCommit(int fd, const drmModeAtomicReqPtr req,
for (i = 0; i < sorted->cursor; i++)
sorted->items[i].cursor = i;
- objs_ptr = drmMalloc(atomic.count_objs * sizeof objs_ptr[0]);
+ objs_ptr = calloc(atomic.count_objs, sizeof objs_ptr[0]);
if (!objs_ptr) {
errno = ENOMEM;
goto out;
}
- count_props_ptr = drmMalloc(atomic.count_objs * sizeof count_props_ptr[0]);
+ count_props_ptr = calloc(atomic.count_objs, sizeof count_props_ptr[0]);
if (!count_props_ptr) {
errno = ENOMEM;
goto out;
}
- props_ptr = drmMalloc(sorted->cursor * sizeof props_ptr[0]);
+ props_ptr = calloc(sorted->cursor, sizeof props_ptr[0]);
if (!props_ptr) {
errno = ENOMEM;
goto out;
}
- prop_values_ptr = drmMalloc(sorted->cursor * sizeof prop_values_ptr[0]);
+ prop_values_ptr = calloc(sorted->cursor, sizeof prop_values_ptr[0]);
if (!prop_values_ptr) {
errno = ENOMEM;
goto out;
|
|
From: GitLab M. <git...@ke...> - 2026-07-14 20:18:47
|
xf86drm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit f9816a42b0d6138851cbe5eb7a33ee1a2f2a15ca
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:12:47 2026 -0500
xf86drm: guard against negative read() return in drmOpenByName
In the /proc/dri name lookup path, the return value of read() was
tested with a plain truthiness check before being used to index the
stack buffer: "if (retcode) buf[retcode-1] = '\0';". read() returns
-1 on error, which is truthy, so the code would write to buf[-2],
corrupting memory before the start of the buffer.
Test "retcode > 0" instead so the NUL terminator is only written when
at least one byte was actually read.
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/xf86drm.c b/xf86drm.c
index 53d13546..16eda782 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1202,7 +1202,7 @@ static int drmOpenByName(const char *name, int type)
if ((fd = open(proc_name, O_RDONLY)) >= 0) {
retcode = read(fd, buf, sizeof(buf)-1);
close(fd);
- if (retcode) {
+ if (retcode > 0) {
buf[retcode-1] = '\0';
for (driver = pt = buf; *pt && *pt != ' '; ++pt)
;
|
|
From: GitLab M. <git...@ke...> - 2026-07-14 19:55:53
|
xf86drmMode.c | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 005c0f54d8d59bbd0e9ecf9ba185d32ba5e7857e
Author: Mario Limonciello <mar...@am...>
Date: Thu Jul 9 19:12:46 2026 -0500
xf86drmMode: avoid double-free of connector arrays on hot-plug retry
_drmModeGetConnector() allocates arrays for the connector's props,
prop values, modes and encoders, then re-runs the GETCONNECTOR ioctl.
If a hotplug event between the two ioctls raises any of the counts, the
allocated buffers are too small, so they are freed and the function
loops back to retry with the larger counts.
On that retry path the freed pointers were left dangling in the local
conn struct. During the retry each pointer is only re-assigned when its
corresponding count is non-zero. If the subsequent ioctl reports a count
of zero for one of those fields, the stale (already freed) pointer
survives all the way down to err_allocs, where it is freed a second
time, resulting in a double free.
NULL out each pointer immediately after freeing it on the retry path so
that a zero count on the next iteration leaves the pointer as NULL and
the cleanup in err_allocs becomes a harmless drmFree(NULL).
Signed-off-by: Mario Limonciello <mar...@am...>
diff --git a/xf86drmMode.c b/xf86drmMode.c
index a4873a0f..950b9843 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -559,10 +559,14 @@ retry:
counts.count_modes < conn.count_modes ||
counts.count_encoders < conn.count_encoders) {
drmFree(U642VOID(conn.props_ptr));
+ conn.props_ptr = 0;
drmFree(U642VOID(conn.prop_values_ptr));
+ conn.prop_values_ptr = 0;
if (U642VOID(conn.modes_ptr) != &stack_mode)
drmFree(U642VOID(conn.modes_ptr));
+ conn.modes_ptr = 0;
drmFree(U642VOID(conn.encoders_ptr));
+ conn.encoders_ptr = 0;
goto retry;
}
|
|
From: GitLab M. <git...@ke...> - 2026-06-11 23:56:59
|
amdgpu/amdgpu_device.c | 47 ++++++++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 15 deletions(-)
New commits:
commit 35c7c536d5d1c0124a416a531df4432508d7d2f1
Author: Yogesh Mohan Marimuthu <yog...@am...>
Date: Tue Jun 9 22:59:32 2026 +0530
amdgpu: disable SMEM loads on NULL PRT wa for gfx1156
Reviewed-by: Pierre-Eric Pelloux-Prayer <pie...@am...>
Reviewed-by: Samuel Pitoiset <sam...@gm...>
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index b7d5589a..41c70fd5 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -144,14 +144,17 @@ static void amdgpu_device_reference(struct amdgpu_device **dst,
*dst = src;
}
-static int amdgpu_query_gfx_level_major(amdgpu_device_handle dev,
- uint8_t *gfx_ip_version_major)
+#define IP_VERSION_MAJ(ver) ((ver >> 16) & 0xFF)
+#define IP_VERSION_MIN(ver) ((ver >> 8) & 0xFF)
+#define IP_VERSION_REV(ver) (ver & 0xFF)
+
+static int amdgpu_query_gfx_version(amdgpu_device_handle dev, uint32_t *gfx_version)
{
struct drm_amdgpu_info_hw_ip ip_info;
uint32_t gfx_ip_count = 0;
int r;
- *gfx_ip_version_major = 0;
+ *gfx_version = 0;
r = amdgpu_query_hw_ip_count(dev, AMDGPU_HW_IP_GFX, &gfx_ip_count);
if (r)
@@ -169,14 +172,34 @@ static int amdgpu_query_gfx_level_major(amdgpu_device_handle dev,
/* GFX6-8 don't set ip_discovery_version. */
if (dev->minor_version >= 48 && ip_info.ip_discovery_version) {
- *gfx_ip_version_major = (ip_info.ip_discovery_version >> 16) & 0xff;
+ *gfx_version = ip_info.ip_discovery_version;
} else {
- *gfx_ip_version_major = ip_info.hw_ip_version_major;
+ *gfx_version = ip_info.hw_ip_version_major << 16 |
+ ip_info.hw_ip_version_minor << 8;
}
return r;
}
+static bool amdgpu_needs_smem_prt_wa(amdgpu_device_handle dev)
+{
+ uint32_t gfx_version;
+ int r;
+
+ r = amdgpu_query_gfx_version(dev, &gfx_version);
+ if (r) {
+ /* Ignore if it's not possible to determine the GFX version. */
+ return false;
+ }
+
+ return IP_VERSION_MAJ(gfx_version) >= 6 &&
+ IP_VERSION_MAJ(gfx_version) <= 12 &&
+ IP_VERSION_MAJ(gfx_version) != 9 &&
+ !(IP_VERSION_MAJ(gfx_version) == 11 &&
+ IP_VERSION_MIN(gfx_version) == 5 &&
+ IP_VERSION_REV(gfx_version) == 6);
+}
+
static int _amdgpu_device_initialize(int fd,
uint32_t *major_version,
uint32_t *minor_version,
@@ -184,7 +207,6 @@ static int _amdgpu_device_initialize(int fd,
bool deduplicate_device)
{
struct amdgpu_device *dev = NULL;
- uint8_t gfx_ip_version_major = 0;
drmVersionPtr version;
int r;
int flag_auth = 0;
@@ -279,16 +301,11 @@ static int _amdgpu_device_initialize(int fd,
goto cleanup;
}
- r = amdgpu_query_gfx_level_major(dev, &gfx_ip_version_major);
- if (!r) {
- /* Split the HIGH addr space for GFX6-GFX12, except GFX9 to
- * implement a workaround for SMEM loads with NULL PRT pages.
- * This is silently ignored if querying the GFX level failed.
+ if (amdgpu_needs_smem_prt_wa(dev)) {
+ /* Reserve half of the addr space to implement a workaround for SMEM loads
+ * with NULL PRT pages.
*/
- if (gfx_ip_version_major >= 6 && gfx_ip_version_major <= 12 &&
- gfx_ip_version_major != 9) {
- va_mgr_flags |= AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT;
- }
+ va_mgr_flags |= AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT;
}
amdgpu_va_manager_init2(&dev->va_mgr,
|
|
From: GitLab M. <git...@ke...> - 2026-05-29 08:50:39
|
Tag 'libdrm-2.4.134' created by Simon Ser <co...@em...> at 2026-05-29 08:50 +0000
libdrm-2.4.134
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEENP+VJs/vDpejQOLkD9574OiPXkgFAmoZU0YACgkQD9574OiP
XkjmaBAAgChJfLGP3PEj8Sq07jpvp9IR78gClua9n+ewMooB4/qY0Ks6NA8bLHN8
aoANc0zi/253X2Mr3rm0x/JPfuHKa5pqm7oF1kf1wNHRVyIXN+kXh2X086ubIATK
y95h26Js+nzDY0mdeMUH7sFK8dXlJ0H0PUI7hUnDJ/CTrFR726SzziO39HpMlx28
6dJVFyrQq8RWRzuUPJA+aJnxGOXkRfv4troqJwNkrBYSEHmA1gf7gIlux7aXA9mA
RtJNJ1H+LJmObO2jKyBYDkVQ12aEIfGj1UFEfHxTJkvTURzXnJJltJuyyNK/5QJx
+FDQGYqQi/YDOBukJt+a7GcZNIg946iUjUwrNEFMonWXuwBk5q8ElHOYOdqpXG91
9ED+pNTTSZdiXKnzxrBIWXuAVsH0a3dsScmbxqrSbbtYIn1g4MuLGKxR7Ls8J7Rd
VP11DdX8zxVIzaRh6rPAl5fsJIvQCqBbYEnRSofrGBtVtxLxGDjgdOw6D5qlOvhL
Q/QW96oyKE0zGV9zx0wHSt3kR/7M4lgrmfBFlEjo8h1d+51gso5ftW9SJsIntrLP
1rka6DpJJ1/4mkuJ/1VgB5FbdwPmmIaWZUtxmcfmZge7k9z/8WUJN6upJyl4C4FB
moIAATVMn7qBiCYRUT71ML3QEtEIC71x9mnQLpGANZjLy4msQp0=
=9wMk
-----END PGP SIGNATURE-----
Changes since libdrm-2.4.132:
Eric Engestrom (2):
ci: fix indentation
ci: bump debian from bookworm to trixie
Rudi Heitbaum (2):
amdgpu: fix discards 'const' qualifier from pointer target type
modetest: fix discards 'const' qualifier from pointer target type
Samuel Pitoiset (4):
add missing include to util_math.h
build: bump version to 2.4.133
omap: stop including linux/types.h
meson: do not mark exynos/omap/tegra as disabled features
Simon Ser (2):
Sync drm_fourcc.h with drm-next
build: bump version to 2.4.134
---
.gitlab-ci.yml | 10 ++---
amdgpu/amdgpu_asic_id.c | 2 -
include/drm/drm_fourcc.h | 82 ++++++++++++++++++++++++++++++----------------
meson.build | 2 -
meson_options.txt | 3 -
omap/omap_drm.c | 1
tests/modetest/modetest.c | 10 +++--
util_math.h | 2 +
8 files changed, 69 insertions(+), 43 deletions(-)
---
|
|
From: GitLab M. <git...@ke...> - 2026-05-29 08:50:20
|
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e984d448b8b17aab853369e6c203e53719f46de1
Author: Simon Ser <co...@em...>
Date: Fri May 29 10:49:42 2026 +0200
build: bump version to 2.4.134
Signed-off-by: Simon Ser <co...@em...>
diff --git a/meson.build b/meson.build
index 1d09e45a..1796b213 100644
--- a/meson.build
+++ b/meson.build
@@ -26,7 +26,7 @@
project(
'libdrm',
['c'],
- version : '2.4.133',
+ version : '2.4.134',
license : 'MIT',
meson_version : '>= 0.59',
default_options : ['buildtype=debugoptimized', 'c_std=c11'],
|
|
From: GitLab M. <git...@ke...> - 2026-05-29 08:45:12
|
include/drm/drm_fourcc.h | 82 ++++++++++++++++++++++++++++++-----------------
1 file changed, 54 insertions(+), 28 deletions(-)
New commits:
commit 264c2dea8eb4e224f1540744c8b7b49738fe6b07
Author: Simon Ser <co...@em...>
Date: Thu May 14 15:19:21 2026 +0200
Sync drm_fourcc.h with drm-next
Generated using make headers_install
Generated from drm-next branch commit 565626e74db94686f2389cbdea845891f468f044
Signed-off-by: Simon Ser <co...@em...>
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index 4a138b5f..d340ec20 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -1,24 +1,6 @@
+/* SPDX-License-Identifier: MIT */
/*
* Copyright 2011 Intel Corporation
- *
- * 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
*/
#ifndef DRM_FOURCC_H
@@ -242,9 +224,9 @@ extern "C" {
* [31:0] sign:exponent:mantissa 1:8:23
*/
#define DRM_FORMAT_R32F fourcc_code('R', ' ', ' ', 'F') /* [31:0] R 32 little endian */
-#define DRM_FORMAT_GR3232F fourcc_code('G', 'R', ' ', 'F') /* [63:0] R:G 32:32 little endian */
-#define DRM_FORMAT_BGR323232F fourcc_code('B', 'G', 'R', 'F') /* [95:0] R:G:B 32:32:32 little endian */
-#define DRM_FORMAT_ABGR32323232F fourcc_code('A', 'B', '8', 'F') /* [127:0] R:G:B:A 32:32:32:32 little endian */
+#define DRM_FORMAT_GR3232F fourcc_code('G', 'R', ' ', 'F') /* [63:0] G:R 32:32 little endian */
+#define DRM_FORMAT_BGR323232F fourcc_code('B', 'G', 'R', 'F') /* [95:0] B:G:R 32:32:32 little endian */
+#define DRM_FORMAT_ABGR32323232F fourcc_code('A', 'B', '8', 'F') /* [127:0] A:B:G:R 32:32:32:32 little endian */
/*
* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits
@@ -264,6 +246,7 @@ extern "C" {
#define DRM_FORMAT_XVUY8888 fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
+#define DRM_FORMAT_XVUY2101010 fourcc_code('X', 'Y', '3', '0') /* [31:0] x:Cr:Cb:Y 2:10:10:10 little endian */
/*
* packed Y2xx indicate for each component, xx valid data occupy msb
@@ -379,6 +362,14 @@ extern "C" {
*/
#define DRM_FORMAT_P030 fourcc_code('P', '0', '3', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel packed */
+/*
+ * 2 plane YCbCr422.
+ * 3 10 bit components and 2 padding bits packed into 4 bytes.
+ * index 0 = Y plane, [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian
+ * index 1 = Cr:Cb plane, [63:0] x:Cr2:Cb2:Cr1:x:Cb1:Cr0:Cb0 [2:10:10:10:2:10:10:10] little endian
+ */
+#define DRM_FORMAT_P230 fourcc_code('P', '2', '3', '0') /* 2x1 subsampled Cr:Cb plane 10 bits per channel packed */
+
/* 3 plane non-subsampled (444) YCbCr
* 16 bits per component, but only 10 bits are used and 6 bits are padded
* index 0: Y plane, [15:0] Y:x [10:6] little endian
@@ -395,14 +386,23 @@ extern "C" {
*/
#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1')
+/*
+ * 3 plane non-subsampled (444) YCbCr LSB aligned
+ * 10 bpc, 30 bits per sample image data in a single contiguous buffer.
+ * index 0: Y plane, [31:0] x:Y2:Y1:Y0 [2:10:10:10] little endian
+ * index 1: Cb plane, [31:0] x:Cb2:Cb1:Cb0 [2:10:10:10] little endian
+ * index 2: Cr plane, [31:0] x:Cr2:Cr1:Cr0 [2:10:10:10] little endian
+ */
+#define DRM_FORMAT_T430 fourcc_code('T', '4', '3', '0')
+
/*
* 3 plane YCbCr LSB aligned
* In order to use these formats in a similar fashion to MSB aligned ones
* implementation can multiply the values by 2^6=64. For that reason the padding
* must only contain zeros.
* index 0 = Y plane, [15:0] z:Y [6:10] little endian
- * index 1 = Cr plane, [15:0] z:Cr [6:10] little endian
- * index 2 = Cb plane, [15:0] z:Cb [6:10] little endian
+ * index 1 = Cb plane, [15:0] z:Cb [6:10] little endian
+ * index 2 = Cr plane, [15:0] z:Cr [6:10] little endian
*/
#define DRM_FORMAT_S010 fourcc_code('S', '0', '1', '0') /* 2x2 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
#define DRM_FORMAT_S210 fourcc_code('S', '2', '1', '0') /* 2x1 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
@@ -414,8 +414,8 @@ extern "C" {
* implementation can multiply the values by 2^4=16. For that reason the padding
* must only contain zeros.
* index 0 = Y plane, [15:0] z:Y [4:12] little endian
- * index 1 = Cr plane, [15:0] z:Cr [4:12] little endian
- * index 2 = Cb plane, [15:0] z:Cb [4:12] little endian
+ * index 1 = Cb plane, [15:0] z:Cb [4:12] little endian
+ * index 2 = Cr plane, [15:0] z:Cr [4:12] little endian
*/
#define DRM_FORMAT_S012 fourcc_code('S', '0', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
#define DRM_FORMAT_S212 fourcc_code('S', '2', '1', '2') /* 2x1 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
@@ -424,8 +424,8 @@ extern "C" {
/*
* 3 plane YCbCr
* index 0 = Y plane, [15:0] Y little endian
- * index 1 = Cr plane, [15:0] Cr little endian
- * index 2 = Cb plane, [15:0] Cb little endian
+ * index 1 = Cb plane, [15:0] Cb little endian
+ * index 2 = Cr plane, [15:0] Cr little endian
*/
#define DRM_FORMAT_S016 fourcc_code('S', '0', '1', '6') /* 2x2 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
#define DRM_FORMAT_S216 fourcc_code('S', '2', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
@@ -451,6 +451,16 @@ extern "C" {
#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
+/*
+ * Y-only (greyscale) formats
+ *
+ * The Y-only formats are handled similarly to the YCbCr formats in the display
+ * pipeline, with the Cb and Cr implicitly neutral (0.0 in nominal values). This
+ * also means that COLOR_RANGE property applies to the Y-only formats.
+ */
+
+#define DRM_FORMAT_Y8 fourcc_code('G', 'R', 'E', 'Y') /* 8-bit Y-only */
+#define DRM_FORMAT_XYYY2101010 fourcc_code('Y', 'P', 'A', '4') /* [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian */
/*
* Format Modifiers:
@@ -1422,6 +1432,22 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \
DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)
+/*
+ * ARM 64k interleaved modifier
+ *
+ * This is used by ARM Mali v10+ GPUs. With this modifier, the plane is divided
+ * into 64k byte 1:1 or 2:1 -sided tiles. The 64k tiles are laid out linearly.
+ * Each 64k tile is divided into blocks of 16x16 texel blocks, which are
+ * themselves laid out linearly within a 64k tile. Then within each 16x16
+ * block, texel blocks are laid out according to U order, similar to
+ * 16X16_BLOCK_U_INTERLEAVED.
+ *
+ * Note that unlike 16X16_BLOCK_U_INTERLEAVED, the layout does not change
+ * depending on whether a format is compressed or not.
+ */
+#define DRM_FORMAT_MOD_ARM_INTERLEAVED_64K \
+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 2ULL)
+
/*
* Allwinner tiled modifier
*
|
|
From: GitLab M. <git...@ke...> - 2026-04-28 06:11:29
|
meson_options.txt | 3 ---
omap/omap_drm.c | 1 -
2 files changed, 4 deletions(-)
New commits:
commit b8b7c57c00954b22ac182543602bd8f654ea1c30
Author: Samuel Pitoiset <sam...@gm...>
Date: Mon Apr 27 18:05:50 2026 +0200
meson: do not mark exynos/omap/tegra as disabled features
Otherwise, using `--auto-features=enabled` wouldn't work because it
only "forces" auto options to be enabled.
This will enable these backends in CI to catch possible build errors.
Closes: https://gitlab.freedesktop.org/mesa/libdrm/-/work_items/128
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/meson_options.txt b/meson_options.txt
index e80d79e2..922145af 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -46,13 +46,11 @@ option(
option(
'omap',
type : 'feature',
- value : 'disabled',
description : '''Enable support for OMAP's experimental KMS API.''',
)
option(
'exynos',
type : 'feature',
- value : 'disabled',
description : '''Enable support for EXYNOS's experimental KMS API.''',
)
option(
@@ -63,7 +61,6 @@ option(
option(
'tegra',
type : 'feature',
- value : 'disabled',
description : '''Enable support for Tegra's experimental KMS API.''',
)
option(
commit 7f86e45164e7fd39a3fe911add207c3da1d9a7f0
Author: Samuel Pitoiset <sam...@gm...>
Date: Mon Apr 27 18:22:20 2026 +0200
omap: stop including linux/types.h
Nothing uses __u32 and friends, so it should be safe to remove.
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index 7aed6806..273e449f 100644
--- a/omap/omap_drm.c
+++ b/omap/omap_drm.c
@@ -27,7 +27,6 @@
*/
#include <stdlib.h>
-#include <linux/types.h>
#include <errno.h>
#include <sys/mman.h>
#include <fcntl.h>
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 15:57:40
|
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cb4669afe87470752643f46c81bddb45b0db48e4
Author: Samuel Pitoiset <sam...@gm...>
Date: Mon Apr 27 17:47:19 2026 +0200
build: bump version to 2.4.133
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/meson.build b/meson.build
index 4c161f4e..1d09e45a 100644
--- a/meson.build
+++ b/meson.build
@@ -26,7 +26,7 @@
project(
'libdrm',
['c'],
- version : '2.4.132',
+ version : '2.4.133',
license : 'MIT',
meson_version : '>= 0.59',
default_options : ['buildtype=debugoptimized', 'c_std=c11'],
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 15:49:24
|
amdgpu/amdgpu_asic_id.c | 2 +-
tests/modetest/modetest.c | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 91f7cd0ba22d1b4a9ea91dd653cfd3c031aa0736
Author: Rudi Heitbaum <ru...@he...>
Date: Mon Feb 16 13:28:48 2026 +0000
modetest: fix discards 'const' qualifier from pointer target type
Since glibc-2.43:
For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into their input arrays now have definitions as macros that return a
pointer to a const-qualified type when the input argument is a pointer
to a const-qualified type.
fixes:
tests/modetest/modetest.c: In function 'parse_connector':
tests/modetest/modetest.c:1997:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1997 | endp = strpbrk(p, ",@:");
| ^
Signed-off-by: Rudi Heitbaum <ru...@he...>
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 24c0e2dc..3c0a8803 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -1974,7 +1974,8 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
unsigned int len;
unsigned int i;
const char *p;
- char *endp;
+ const char *endp;
+ char *endp_tok;
pipe->vrefresh = 0;
pipe->crtc_id = (uint32_t)-1;
@@ -2012,7 +2013,8 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
return -1;
if (*endp == '@') {
arg = endp + 1;
- pipe->crtc_id = strtoul(arg, &endp, 10);
+ pipe->crtc_id = strtoul(arg, &endp_tok, 10);
+ endp = endp_tok;
}
if (*endp != ':')
return -1;
@@ -2028,8 +2030,8 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
pipe->mode_str[len] = '\0';
if (*p == '-') {
- pipe->vrefresh = strtof(p + 1, &endp);
- p = endp;
+ pipe->vrefresh = strtof(p + 1, &endp_tok);
+ p = endp_tok;
}
if (*p == '@') {
commit ff123399267e3cb44be54208011f9c8fab8198ef
Author: Rudi Heitbaum <ru...@he...>
Date: Mon Feb 16 13:24:05 2026 +0000
amdgpu: fix discards 'const' qualifier from pointer target type
Since glibc-2.43:
For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into their input arrays now have definitions as macros that return a
pointer to a const-qualified type when the input argument is a pointer
to a const-qualified type.
fixes:
amdgpu/amdgpu_asic_id.c: In function 'find_asic_id_table':
amdgpu/amdgpu_asic_id.c:249:19: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
249 | file_name = strrchr(AMDGPU_ASIC_ID_TABLE, '/');
| ^
Signed-off-by: Rudi Heitbaum <ru...@he...>
diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c
index cd8ee596..fed3a531 100644
--- a/amdgpu/amdgpu_asic_id.c
+++ b/amdgpu/amdgpu_asic_id.c
@@ -238,7 +238,7 @@ static char *find_asic_id_table(void)
{
// first check the paths in AMDGPU_ASIC_ID_TABLE_PATHS environment variable
const char *amdgpu_asic_id_table_paths = secure_getenv("AMDGPU_ASIC_ID_TABLE_PATHS");
- char *file_name = NULL;
+ const char *file_name = NULL;
char *found_path = NULL;
char **paths = NULL;
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 15:44:57
|
util_math.h | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit a6e1316d034160b7e37aedc88654de6724aa7576
Author: Samuel Pitoiset <sam...@gm...>
Date: Mon Apr 27 17:32:43 2026 +0200
add missing include to util_math.h
This fixes a build error with Tegra.
Fixes: 8cc2d09c ("amdgpu: reserve half of the addr space to implement a workaround for PRT")
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/util_math.h b/util_math.h
index 1799545b..04a0966c 100644
--- a/util_math.h
+++ b/util_math.h
@@ -24,6 +24,8 @@
#ifndef _UTIL_MATH_H_
#define _UTIL_MATH_H_
+#include <stdint.h>
+
#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 15:38:34
|
.gitlab-ci.yml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 31c62328962bb75a468c990a364ff5de2032ae57
Author: Eric Engestrom <er...@ig...>
Date: Mon Apr 27 17:31:38 2026 +0200
ci: bump debian from bookworm to trixie
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 55005ad0..e19abe4b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -39,11 +39,11 @@ stages:
.os-debian:
variables:
BUILD_OS: debian
- FDO_DISTRIBUTION_VERSION: bookworm
+ FDO_DISTRIBUTION_VERSION: trixie-slim
FDO_DISTRIBUTION_PACKAGES: 'build-essential docbook-xsl libatomic-ops-dev libcairo2-dev libcunit1-dev libpciaccess-dev meson ninja-build pkg-config python3 python3-pip python3-wheel python3-setuptools python3-docutils valgrind'
# bump this tag every time you change something which requires rebuilding the
# base image
- FDO_DISTRIBUTION_TAG: "2024-06-25.0"
+ FDO_DISTRIBUTION_TAG: "2026-04-27.0"
.debian-x86_64:
extends:
commit b1144c21ca8abe9cd715665d4fa4a5f7f3328992
Author: Eric Engestrom <er...@ig...>
Date: Mon Apr 27 17:31:23 2026 +0200
ci: fix indentation
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 051f354e..55005ad0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,9 +18,9 @@ include:
- project: 'freedesktop/ci-templates'
ref: *template_sha
file:
- - '/templates/debian.yml'
- - '/templates/freebsd.yml'
- - '/templates/ci-fairy.yml'
+ - '/templates/debian.yml'
+ - '/templates/freebsd.yml'
+ - '/templates/ci-fairy.yml'
variables:
FDO_UPSTREAM_REPO: mesa/libdrm
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 10:43:00
|
Tag 'libdrm-2.4.132' created by Samuel Pitoiset <sam...@gm...> at 2026-04-27 09:17 +0000
libdrm-2.4.132
-----BEGIN PGP SIGNATURE-----
iJAEABYKADgWIQTpKeoRuC+mnnhDeuXLx3ukNXodjQUCae8puRocc2FtdWVsLnBp
dG9pc2V0QGdtYWlsLmNvbQAKCRDLx3ukNXodjceVAP97KEzWUIuNB/8Lwn96cA4G
n3HTOjxWUgqe4k30OHUrjgD6Axb0qjtA5WjJVRxU2Z5DMizd8oQiOWEdZqsZOihZ
VQY=
=Flyt
-----END PGP SIGNATURE-----
Changes since libdrm-2.4.131:
Alex Deucher (2):
amdgpu: update marketing names
amdgpu: update marketing names
Ilya Zlobintsev (1):
amdgpu: update marketing names for strix point revisions
Janne Grunau (1):
gen_table_fourcc: Add Apple as vendor
Rudi Heitbaum (1):
drm: handle asprintf() allocation failures in format modifier name functions
Samuel Pitoiset (2):
amdgpu: reserve half of the addr space to implement a workaround for PRT
build: bump version to 2.4.132
---
amdgpu/amdgpu-symbols.txt | 2 +
amdgpu/amdgpu.h | 36 ++++++++++++++++++++++
amdgpu/amdgpu_device.c | 63 ++++++++++++++++++++++++++++++++++----
amdgpu/amdgpu_internal.h | 5 +++
amdgpu/amdgpu_vamgr.c | 53 ++++++++++++++++++++++++++++++--
data/amdgpu.ids | 75 ++++++++++++++++++++++++++++++++++++++--------
gen_table_fourcc.py | 2 -
meson.build | 2 -
util_math.h | 21 ++++++++++++
xf86drm.c | 11 ++++--
10 files changed, 242 insertions(+), 28 deletions(-)
---
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 08:58:35
|
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 979f607906ad64f629967ac1f3ba3590e756442c
Author: Samuel Pitoiset <sam...@gm...>
Date: Mon Apr 27 10:28:45 2026 +0200
build: bump version to 2.4.132
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/meson.build b/meson.build
index 4af9372c..4c161f4e 100644
--- a/meson.build
+++ b/meson.build
@@ -26,7 +26,7 @@
project(
'libdrm',
['c'],
- version : '2.4.131',
+ version : '2.4.132',
license : 'MIT',
meson_version : '>= 0.59',
default_options : ['buildtype=debugoptimized', 'c_std=c11'],
|
|
From: GitLab M. <git...@ke...> - 2026-04-27 08:30:27
|
amdgpu/amdgpu-symbols.txt | 2 +
amdgpu/amdgpu.h | 36 ++++++++++++++++++++++++++
amdgpu/amdgpu_device.c | 63 +++++++++++++++++++++++++++++++++++++++++-----
amdgpu/amdgpu_internal.h | 5 +++
amdgpu/amdgpu_vamgr.c | 53 ++++++++++++++++++++++++++++++++++++--
util_math.h | 21 +++++++++++++++
6 files changed, 171 insertions(+), 9 deletions(-)
New commits:
commit 8cc2d09c2967e71edc01b76aea888f33bc95a57d
Author: Samuel Pitoiset <sam...@gm...>
Date: Thu Apr 9 18:20:10 2026 +0200
amdgpu: reserve half of the addr space to implement a workaround for PRT
On GFX6-GFX12, except GFX9, SMEM loads on NULL PRT pages would just
fault and hang the GPU. The better workaround that we found is to split
the address space in two equal parts "LOW"/"HIGH", here's more details:
To workaround that, the driver splits the total VA space in half, so
that a single bit controls whether it's the "HIGH" or the "LOW"
address space. Every sparse residency buffer allocations that might
be used with SMEM get two allocations:
- the "HIGH" address space is mapped normally and its VA is returned
to the application.
- the "LOW" address space is explicitly mapped to a zero-initialized
buffer when it's allocated or when it's unmapped.
Other buffer allocations are always allocated in the "LOW" address.
The driver also creates a zero-allocated BO that will be used to map
partially resident buffers at creation and when explicitly unmapped.
The size is arbitrary but it seems that allocating 8MiB is perfectly
reasonable and fast enough in most cases. This BO is marked as
read-only for the GPU because the backend compilers don't use SMEM
stores.
For example this makes the "LOW" half of the HIGH VA range like
[0xffff800100000000,0xffffbfffffbfe000], and the "HIGH" half is left
for PRT.
Signed-off-by: Samuel Pitoiset <sam...@gm...>
diff --git a/amdgpu/amdgpu-symbols.txt b/amdgpu/amdgpu-symbols.txt
index 8cd5559c..60c7d065 100644
--- a/amdgpu/amdgpu-symbols.txt
+++ b/amdgpu/amdgpu-symbols.txt
@@ -76,7 +76,9 @@ amdgpu_query_video_caps_info
amdgpu_read_mm_registers
amdgpu_va_manager_alloc
amdgpu_va_manager_init
+amdgpu_va_manager_init2
amdgpu_va_manager_deinit
+amdgpu_va_manager_query_sw_info
amdgpu_va_range_alloc
amdgpu_va_range_alloc2
amdgpu_va_range_free
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 6fb2b60b..6efb7a7d 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -105,6 +105,19 @@ enum amdgpu_gpu_va_range
enum amdgpu_sw_info {
amdgpu_sw_info_address32_hi = 0,
+ /** Query the PRT control bit when the half VA range is reserved for
+ * PRT when the device is initialized. This depends on the GFX version.
+ * A return value of ~0 should be ignored.
+ */
+ amdgpu_sw_info_address_prt_wa_control_bit = 1,
+};
+
+enum amdgpu_va_manager_sw_info {
+ /** Query the PRT control bit when the half VA range is reserved for
+ * PRT with AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT. The default value of
+ * ~0 shouldn't be considered a valid value.
+ */
+ amdgpu_va_manager_sw_info_address_prt_wa_control_bit = 0,
};
/*--------------------------------------------------------------------------*/
@@ -1467,6 +1480,14 @@ void amdgpu_va_manager_init(amdgpu_va_manager_handle va_mgr,
uint64_t high_va_offset, uint64_t high_va_max,
uint32_t virtual_address_alignment);
+#define AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT 0x1
+
+void amdgpu_va_manager_init2(struct amdgpu_va_manager *va_mgr,
+ uint64_t low_va_offset, uint64_t low_va_max,
+ uint64_t high_va_offset, uint64_t high_va_max,
+ uint32_t virtual_address_alignment,
+ uint32_t flags);
+
void amdgpu_va_manager_deinit(amdgpu_va_manager_handle va_mgr);
/**
@@ -1484,6 +1505,21 @@ int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr,
amdgpu_va_handle *va_range_handle,
uint64_t flags);
+/**
+ * Query VA manager information.
+ *
+ * \param va_mgr - \c [in] VA manager
+ * \param info - \c [in] amdgpu_va_manager_sw_info_*
+ * \param value - \c [out] Pointer to the return value.
+ *
+ * \return 0 on success\n
+ * <0 - Negative POSIX error code
+ *
+*/
+int amdgpu_va_manager_query_sw_info(struct amdgpu_va_manager *va_mgr,
+ enum amdgpu_va_manager_sw_info info,
+ void *value);
+
/**
* VA mapping/unmapping for the buffer object
*
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index 34463b53..b7d5589a 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -144,6 +144,39 @@ static void amdgpu_device_reference(struct amdgpu_device **dst,
*dst = src;
}
+static int amdgpu_query_gfx_level_major(amdgpu_device_handle dev,
+ uint8_t *gfx_ip_version_major)
+{
+ struct drm_amdgpu_info_hw_ip ip_info;
+ uint32_t gfx_ip_count = 0;
+ int r;
+
+ *gfx_ip_version_major = 0;
+
+ r = amdgpu_query_hw_ip_count(dev, AMDGPU_HW_IP_GFX, &gfx_ip_count);
+ if (r)
+ return r;
+
+ /* No graphics support. */
+ if (gfx_ip_count == 0)
+ return 0;
+
+ memset(&ip_info, 0, sizeof(ip_info));
+
+ r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_GFX, 0, &ip_info);
+ if (r)
+ return r;
+
+ /* GFX6-8 don't set ip_discovery_version. */
+ if (dev->minor_version >= 48 && ip_info.ip_discovery_version) {
+ *gfx_ip_version_major = (ip_info.ip_discovery_version >> 16) & 0xff;
+ } else {
+ *gfx_ip_version_major = ip_info.hw_ip_version_major;
+ }
+
+ return r;
+}
+
static int _amdgpu_device_initialize(int fd,
uint32_t *major_version,
uint32_t *minor_version,
@@ -151,11 +184,13 @@ static int _amdgpu_device_initialize(int fd,
bool deduplicate_device)
{
struct amdgpu_device *dev = NULL;
+ uint8_t gfx_ip_version_major = 0;
drmVersionPtr version;
int r;
int flag_auth = 0;
int flag_authexist=0;
uint32_t accel_working = 0;
+ uint32_t va_mgr_flags = 0;
*device_handle = NULL;
@@ -244,12 +279,25 @@ static int _amdgpu_device_initialize(int fd,
goto cleanup;
}
- amdgpu_va_manager_init(&dev->va_mgr,
- dev->dev_info.virtual_address_offset,
- dev->dev_info.virtual_address_max,
- dev->dev_info.high_va_offset,
- dev->dev_info.high_va_max,
- dev->dev_info.virtual_address_alignment);
+ r = amdgpu_query_gfx_level_major(dev, &gfx_ip_version_major);
+ if (!r) {
+ /* Split the HIGH addr space for GFX6-GFX12, except GFX9 to
+ * implement a workaround for SMEM loads with NULL PRT pages.
+ * This is silently ignored if querying the GFX level failed.
+ */
+ if (gfx_ip_version_major >= 6 && gfx_ip_version_major <= 12 &&
+ gfx_ip_version_major != 9) {
+ va_mgr_flags |= AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT;
+ }
+ }
+
+ amdgpu_va_manager_init2(&dev->va_mgr,
+ dev->dev_info.virtual_address_offset,
+ dev->dev_info.virtual_address_max,
+ dev->dev_info.high_va_offset,
+ dev->dev_info.high_va_max,
+ dev->dev_info.virtual_address_alignment,
+ va_mgr_flags);
amdgpu_parse_asic_ids(dev);
@@ -322,6 +370,9 @@ drm_public int amdgpu_query_sw_info(amdgpu_device_handle dev,
else
*val32 = (dev->va_mgr.vamgr_32.va_max - 1) >> 32;
return 0;
+ case amdgpu_sw_info_address_prt_wa_control_bit:
+ *val32 = dev->va_mgr.address_prt_wa_control_bit;
+ return 0;
}
return -EINVAL;
}
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index af85b849..593b9f81 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -72,6 +72,11 @@ struct amdgpu_va_manager {
struct amdgpu_bo_va_mgr vamgr_high;
/** The VA manager for the 32bit high address space */
struct amdgpu_bo_va_mgr vamgr_high_32;
+
+ /** The bit to control whether it's the "LOW" or "HIGH" halves, when
+ * half of the address space is reserved for PRT to implement a SW
+ * workaround. */
+ unsigned address_prt_wa_control_bit;
};
struct amdgpu_device {
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 29944ec8..6e9cb654 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -323,19 +323,42 @@ drm_public amdgpu_va_manager_handle amdgpu_va_manager_alloc(void)
}
drm_public void amdgpu_va_manager_init(struct amdgpu_va_manager *va_mgr,
+ uint64_t low_va_offset, uint64_t low_va_max,
+ uint64_t high_va_offset, uint64_t high_va_max,
+ uint32_t virtual_address_alignment)
+{
+ amdgpu_va_manager_init2(va_mgr, low_va_offset, low_va_max,
+ high_va_offset, high_va_max,
+ virtual_address_alignment, 0);
+}
+
+drm_public void amdgpu_va_manager_init2(struct amdgpu_va_manager *va_mgr,
uint64_t low_va_offset, uint64_t low_va_max,
uint64_t high_va_offset, uint64_t high_va_max,
- uint32_t virtual_address_alignment)
+ uint32_t virtual_address_alignment,
+ uint32_t flags)
{
uint64_t start, max;
+ va_mgr->address_prt_wa_control_bit = ~0;
+
start = low_va_offset;
max = MIN2(low_va_max, 0x100000000ULL);
amdgpu_vamgr_init(&va_mgr->vamgr_32, start, max,
virtual_address_alignment);
start = max;
- max = MAX2(low_va_max, 0x100000000ULL);
+ if ((flags & AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT) && !high_va_max) {
+ /* Reserve the half VA range for PRT by splitting it in two
+ * equal halves where one bit controls whether it's the LOW or
+ * HIGH half.
+ */
+ va_mgr->address_prt_wa_control_bit = util_last_bit64(low_va_offset ^ low_va_max) - 1;
+ max = low_va_max ^ (1ull << va_mgr->address_prt_wa_control_bit);
+ } else {
+ max = MAX2(low_va_max, 0x100000000ULL);
+ }
+
amdgpu_vamgr_init(&va_mgr->vamgr_low, start, max,
virtual_address_alignment);
@@ -345,7 +368,17 @@ drm_public void amdgpu_va_manager_init(struct amdgpu_va_manager *va_mgr,
virtual_address_alignment);
start = max;
- max = MAX2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL);
+ if ((flags & AMDGPU_VA_MGR_RESERVE_HALF_VA_FOR_PRT) && high_va_max) {
+ /* Reserve the half VA range for PRT by splitting it in two
+ * equal halves where one bit controls whether it's the LOW or
+ * HIGH half.
+ */
+ va_mgr->address_prt_wa_control_bit = util_last_bit64(high_va_offset ^ high_va_max) - 1;
+ max = high_va_max ^ (1ull << va_mgr->address_prt_wa_control_bit);
+ } else {
+ max = MAX2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL);
+ }
+
amdgpu_vamgr_init(&va_mgr->vamgr_high, start, max,
virtual_address_alignment);
}
@@ -357,3 +390,17 @@ drm_public void amdgpu_va_manager_deinit(struct amdgpu_va_manager *va_mgr)
amdgpu_vamgr_deinit(&va_mgr->vamgr_high_32);
amdgpu_vamgr_deinit(&va_mgr->vamgr_high);
}
+
+drm_public int amdgpu_va_manager_query_sw_info(struct amdgpu_va_manager *va_mgr,
+ enum amdgpu_va_manager_sw_info info,
+ void *value)
+{
+ uint32_t *val32 = (uint32_t*)value;
+
+ switch (info) {
+ case amdgpu_va_manager_sw_info_address_prt_wa_control_bit:
+ *val32 = va_mgr->address_prt_wa_control_bit;
+ return 0;
+ }
+ return -EINVAL;
+}
diff --git a/util_math.h b/util_math.h
index 35bf4512..1799545b 100644
--- a/util_math.h
+++ b/util_math.h
@@ -31,4 +31,25 @@
#define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
#define ALIGN(value, alignment) __align_mask(value, (__typeof__(value))((alignment) - 1))
+static inline unsigned
+util_last_bit64(uint64_t u)
+{
+#if defined(HAVE___BUILTIN_CLZLL)
+ return u == 0 ? 0 : 64 - __builtin_clzll(u);
+#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM64 || _M_IA64)
+ unsigned long index;
+ if (_BitScanReverse64(&index, u))
+ return index + 1;
+ else
+ return 0;
+#else
+ unsigned r = 0;
+ while (u) {
+ r++;
+ u >>= 1;
+ }
+ return r;
+#endif
+}
+
#endif /*_UTIL_MATH_H_*/
|
|
From: GitLab M. <git...@ke...> - 2026-04-06 08:02:13
|
xf86drm.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 8de45ef60d69472a0f8ba898f91250dac88bb81f
Author: Rudi Heitbaum <ru...@he...>
Date: Thu Apr 2 07:43:09 2026 +0000
drm: handle asprintf() allocation failures in format modifier name functions
Check the return value of asprintf() in drmGetFormatModifierNameFromNvidia(),
drmGetFormatModifierNameFromAmlogic(), and drmGetFormatModifierNameFromVivante()
to avoid leaving pointers uninitialized on allocation failure.
asprintf() returns -1 on failure and does not guarantee the output pointer
is set to NULL, which could lead to undefined behavior if the pointer is
used subsequently. Set the pointer to NULL explicitly on failure.
Fixes: -Wunused-result warnings from GCC
Signed-off-by: Rudi Heitbaum <ru...@he...>
diff --git a/xf86drm.c b/xf86drm.c
index d4bfec8a..53d13546 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -348,9 +348,10 @@ drmGetFormatModifierNameFromNvidia(uint64_t modifier)
* testing against TEGRA_TILE */
if ((modifier & 0x10) == 0x10) {
char *mod_nvidia;
- asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64","
+ if (asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64","
"GEN=%"PRIu64",SECTOR=%"PRIu64",COMPRESSION=%"PRIu64"", height,
- kind, gen, sector, compression);
+ kind, gen, sector, compression) < 0)
+ mod_nvidia = NULL;
return mod_nvidia;
}
@@ -542,7 +543,8 @@ drmGetFormatModifierNameFromAmlogic(uint64_t modifier)
else
opts_str = "0";
- asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str);
+ if (asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str) < 0)
+ mod_amlogic = NULL;
return mod_amlogic;
}
@@ -606,7 +608,8 @@ drmGetFormatModifierNameFromVivante(uint64_t modifier)
break;
}
- asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression);
+ if (asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression) < 0)
+ mod_vivante = NULL;
return mod_vivante;
}
|
|
From: GitLab M. <git...@ke...> - 2026-03-08 20:29:34
|
gen_table_fourcc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b9dea73dfa310bc945ae6f09004a08fd624952ec
Author: Janne Grunau <j...@ja...>
Date: Fri Mar 6 13:06:12 2026 +0100
gen_table_fourcc: Add Apple as vendor
The modifiers for DRM_FORMAT_MOD_VENDOR_APPLE are simple and cna be
represented in a static table. Add "APPLE" as pattern.
Signed-off-by: Janne Grunau <j...@ja...>
diff --git a/gen_table_fourcc.py b/gen_table_fourcc.py
index 1473d437..cb8f1626 100644
--- a/gen_table_fourcc.py
+++ b/gen_table_fourcc.py
@@ -34,7 +34,7 @@ towrite = sys.argv[2]
fm_re = {
'intel': r'^#define I915_FORMAT_MOD_(\w+)',
- 'others': r'^#define DRM_FORMAT_MOD_((?:ARM|SAMSUNG|QCOM|VIVANTE|NVIDIA|BROADCOM|ALLWINNER)\w+)\s',
+ 'others': r'^#define DRM_FORMAT_MOD_((?:ARM|APPLE|SAMSUNG|QCOM|VIVANTE|NVIDIA|BROADCOM|ALLWINNER)\w+)\s',
'vendors': r'^#define DRM_FORMAT_MOD_VENDOR_(\w+)'
}
|
|
From: GitLab M. <git...@ke...> - 2026-02-25 22:45:41
|
data/amdgpu.ids | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 15cdcfe9e1c4b00f2a819bc1f4b3efa1326ac6bc
Author: Alex Deucher <ale...@am...>
Date: Wed Feb 25 17:36:48 2026 -0500
amdgpu: update marketing names
From ROCm 7.2.
Signed-off-by: Alex Deucher <ale...@am...>
diff --git a/data/amdgpu.ids b/data/amdgpu.ids
index 1cc069da..978e5f74 100644
--- a/data/amdgpu.ids
+++ b/data/amdgpu.ids
@@ -645,11 +645,12 @@
7551, C0, AMD Radeon AI PRO R9700
7551, C8, AMD Radeon AI PRO R9600D
7590, C0, AMD Radeon RX 9060 XT
+7590, C1, AMD Radeon RX 9060 XT LP
7590, C7, AMD Radeon RX 9060
-75A0, C0, AMD Instinct MI350X
-75A3, C0, AMD Instinct MI355X
-75B0, C0, AMD Instinct MI350X VF
-75B3, C0, AMD Instinct MI355X VF
+75A0, 00, AMD Instinct MI350X
+75A3, 00, AMD Instinct MI355X
+75B0, 00, AMD Instinct MI350X VF
+75B3, 00, AMD Instinct MI355X VF
9830, 00, AMD Radeon HD 8400 / R3 Series
9831, 00, AMD Radeon HD 8400E
9832, 00, AMD Radeon HD 8330
|