lede/target/linux/bcm27xx/patches-6.12/950-0517-dma-buf-system_heap-Allow-specifying-maximum-allocat.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

47 lines
1.5 KiB
Diff

From 64cf8b92223509fb1a1cb29568f5ef7b8a374f24 Mon Sep 17 00:00:00 2001
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date: Wed, 17 Jul 2024 09:33:21 +0100
Subject: [PATCH] dma-buf: system_heap: Allow specifying maximum allocation
order
system_heap.max_order=<uint>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
---
drivers/dma-buf/heaps/system_heap.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -54,6 +54,11 @@ static gfp_t order_flags[] = {HIGH_ORDER
static const unsigned int orders[] = {8, 4, 0};
#define NUM_ORDERS ARRAY_SIZE(orders)
+static unsigned int module_max_order = orders[0];
+
+module_param_named(max_order, module_max_order, uint, 0400);
+MODULE_PARM_DESC(max_order, "Maximum allocation order override.");
+
static struct sg_table *dup_sg_table(struct sg_table *table)
{
struct sg_table *new_table;
@@ -339,7 +344,7 @@ static struct dma_buf *system_heap_alloc
struct system_heap_buffer *buffer;
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
unsigned long size_remaining = len;
- unsigned int max_order = orders[0];
+ unsigned int max_order = module_max_order;
struct dma_buf *dmabuf;
struct sg_table *table;
struct scatterlist *sg;
@@ -433,6 +438,9 @@ static int system_heap_create(void)
if (IS_ERR(sys_heap))
return PTR_ERR(sys_heap);
+ if (module_max_order > orders[0])
+ module_max_order = orders[0];
+
return 0;
}
module_init(system_heap_create);