From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 498EC15815E for ; Tue, 6 Feb 2024 17:27:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7783CE29FD; Tue, 6 Feb 2024 17:27:56 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 57F42E29FD for ; Tue, 6 Feb 2024 17:27:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 21CD63430CC for ; Tue, 6 Feb 2024 17:27:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9783714AB for ; Tue, 6 Feb 2024 17:27:53 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1707240458.0f521208256c7f4efececb3421cda662c7bbfaf6.mpagano@gentoo> Subject: [gentoo-commits] proj/linux-patches:6.6 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 2700_solo6x10-mem-resource-reduction-fix.patch X-VCS-Directories: / X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: 0f521208256c7f4efececb3421cda662c7bbfaf6 X-VCS-Branch: 6.6 Date: Tue, 6 Feb 2024 17:27:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8bd13656-561f-40fa-960e-751828bb8e9c X-Archives-Hash: 5586e63745e6caad09a2a53cafbabdd7 commit: 0f521208256c7f4efececb3421cda662c7bbfaf6 Author: Mike Pagano gentoo org> AuthorDate: Tue Feb 6 17:27:38 2024 +0000 Commit: Mike Pagano gentoo org> CommitDate: Tue Feb 6 17:27:38 2024 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0f521208 Fix x86 compilation patch Signed-off-by: Mike Pagano gentoo.org> 2700_solo6x10-mem-resource-reduction-fix.patch | 128 ++++++++++++------------- 1 file changed, 59 insertions(+), 69 deletions(-) diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch index a0b55a8c..bfc7cd80 100644 --- a/2700_solo6x10-mem-resource-reduction-fix.patch +++ b/2700_solo6x10-mem-resource-reduction-fix.patch @@ -1,70 +1,60 @@ -diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch -new file mode 100644 -index 00000000..bf406a92 ---- /dev/null -+++ b/2700_solo6x10-mem-resource-reduction-fix.patch -@@ -0,0 +1,61 @@ -+From 31e97d7c9ae3de072d7b424b2cf706a03ec10720 Mon Sep 17 00:00:00 2001 -+From: Aurelien Jarno -+Date: Sat, 13 Jan 2024 19:33:31 +0100 -+Subject: media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) -+ -+This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10 -+driver. This improves the readability and more importantly, for the -+solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13): -+ -+ - the preprocessed size from 121 MiB to 4.5 MiB; -+ -+ - the build CPU time from 46.8 s to 1.6 s; -+ -+ - the build memory from 2786 MiB to 98MiB. -+ -+In fine, this allows this relatively simple C file to be built on a -+32-bit system. -+ -+Reported-by: Jiri Slaby -+Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/ -+Cc: # v6.7+ -+Suggested-by: David Laight -+Signed-off-by: Aurelien Jarno -+Reviewed-by: David Laight -+Reviewed-by: Hans Verkuil -+Signed-off-by: Linus Torvalds -+--- -+ drivers/media/pci/solo6x10/solo6x10-offsets.h | 10 +++++----- -+ 1 file changed, 5 insertions(+), 5 deletions(-) -+ -+(limited to 'drivers/media/pci/solo6x10/solo6x10-offsets.h') -+ -+diff --git a/drivers/media/pci/solo6x10/solo6x10-offsets.h b/drivers/media/pci/solo6x10/solo6x10-offsets.h -+index f414ee1316f29c..fdbb817e63601c 100644 -+--- a/drivers/media/pci/solo6x10/solo6x10-offsets.h -++++ b/drivers/media/pci/solo6x10/solo6x10-offsets.h -+@@ -57,16 +57,16 @@ -+ #define SOLO_MP4E_EXT_ADDR(__solo) \ -+ (SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo)) -+ #define SOLO_MP4E_EXT_SIZE(__solo) \ -+- max((__solo->nr_chans * 0x00080000), \ -+- min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \ -+- __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000)) -++ clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \ -++ __SOLO_JPEG_MIN_SIZE(__solo), \ -++ __solo->nr_chans * 0x00080000, 0x00ff0000) -+ -+ #define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000) -+ #define SOLO_JPEG_EXT_ADDR(__solo) \ -+ (SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo)) -+ #define SOLO_JPEG_EXT_SIZE(__solo) \ -+- max(__SOLO_JPEG_MIN_SIZE(__solo), \ -+- min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000)) -++ clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \ -++ __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000) -+ -+ #define SOLO_SDRAM_END(__solo) \ -+ (SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo)) -+-- -+cgit 1.2.3-korg -+ --- -cgit v1.2.3 +From 31e97d7c9ae3de072d7b424b2cf706a03ec10720 Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Sat, 13 Jan 2024 19:33:31 +0100 +Subject: media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) + +This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10 +driver. This improves the readability and more importantly, for the +solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13): + + - the preprocessed size from 121 MiB to 4.5 MiB; + + - the build CPU time from 46.8 s to 1.6 s; + + - the build memory from 2786 MiB to 98MiB. +In fine, this allows this relatively simple C file to be built on a +32-bit system. + +Reported-by: Jiri Slaby +Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/ +Cc: # v6.7+ +Suggested-by: David Laight +Signed-off-by: Aurelien Jarno +Reviewed-by: David Laight +Reviewed-by: Hans Verkuil +Signed-off-by: Linus Torvalds +--- + drivers/media/pci/solo6x10/solo6x10-offsets.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +(limited to 'drivers/media/pci/solo6x10/solo6x10-offsets.h') + +diff --git a/drivers/media/pci/solo6x10/solo6x10-offsets.h b/drivers/media/pci/solo6x10/solo6x10-offsets.h +index f414ee1316f29c..fdbb817e63601c 100644 +--- a/drivers/media/pci/solo6x10/solo6x10-offsets.h ++++ b/drivers/media/pci/solo6x10/solo6x10-offsets.h +@@ -57,16 +57,16 @@ + #define SOLO_MP4E_EXT_ADDR(__solo) \ + (SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo)) + #define SOLO_MP4E_EXT_SIZE(__solo) \ +- max((__solo->nr_chans * 0x00080000), \ +- min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \ +- __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000)) ++ clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \ ++ __SOLO_JPEG_MIN_SIZE(__solo), \ ++ __solo->nr_chans * 0x00080000, 0x00ff0000) + + #define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000) + #define SOLO_JPEG_EXT_ADDR(__solo) \ + (SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo)) + #define SOLO_JPEG_EXT_SIZE(__solo) \ +- max(__SOLO_JPEG_MIN_SIZE(__solo), \ +- min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000)) ++ clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \ ++ __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000) + + #define SOLO_SDRAM_END(__solo) \ + (SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo)) +-- +cgit 1.2.3-korg