+++ /dev/null
-From 95d666d27f4c989feb728dca27363e83bccf00a6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 93f5669b4aa1..a12ba19e6460 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -91,6 +91,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -140,8 +143,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
afs-fix-the-usage-of-read_seqbegin_or_lock-in-afs_fi.patch
rxrpc_find_service_conn_rcu-fix-the-usage-of-read_se.patch
jfs-fix-array-index-out-of-bounds-in-dinewext.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sunrpc-fix-a-suspicious-rcu-usage-warning.patch
+++ /dev/null
-From a14d465b46cbe0834b8d90a959ad050f703f17b0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 13 Oct 2023 16:13:59 +0300
-Subject: drm: Fix color LUT rounding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ville Syrjälä <ville.syrjala@linux.intel.com>
-
-[ Upstream commit c6fbb6bca10838485b820e8a26c23996f77ce580 ]
-
-The current implementation of drm_color_lut_extract()
-generates weird results. Eg. if we go through all the
-values for 16->8bpc conversion we see the following pattern:
-
-in out (count)
- 0 - 7f -> 0 (128)
- 80 - 17f -> 1 (256)
- 180 - 27f -> 2 (256)
- 280 - 37f -> 3 (256)
-...
-fb80 - fc7f -> fc (256)
-fc80 - fd7f -> fd (256)
-fd80 - fe7f -> fe (256)
-fe80 - ffff -> ff (384)
-
-So less values map to 0 and more values map 0xff, which
-doesn't seem particularly great.
-
-To get just the same number of input values to map to
-the same output values we'd just need to drop the rounding
-entrirely. But perhaps a better idea would be to follow the
-OpenGL int<->float conversion rules, in which case we get
-the following results:
-
-in out (count)
- 0 - 80 -> 0 (129)
- 81 - 181 -> 1 (257)
- 182 - 282 -> 2 (257)
- 283 - 383 -> 3 (257)
-...
-fc7c - fd7c -> fc (257)
-fd7d - fe7d -> fd (257)
-fe7e - ff7e -> fe (257)
-ff7f - ffff -> ff (129)
-
-Note that since the divisor is constant the compiler
-is able to optimize away the integer division in most
-cases. The only exception is the _ULL() case on 32bit
-architectures since that gets emitted as inline asm
-via do_div() and thus the compiler doesn't get to
-optimize it.
-
-Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-2-ville.syrjala@linux.intel.com
-Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
-Reviewed-by: Jani Nikula <jani.nikula@intel.com>
-Acked-by: Maxime Ripard <mripard@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/drm/drm_color_mgmt.h | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
-index 81c298488b0c..54b2b2467bfd 100644
---- a/include/drm/drm_color_mgmt.h
-+++ b/include/drm/drm_color_mgmt.h
-@@ -36,20 +36,17 @@ struct drm_plane;
- *
- * Extract a degamma/gamma LUT value provided by user (in the form of
- * &drm_color_lut entries) and round it to the precision supported by the
-- * hardware.
-+ * hardware, following OpenGL int<->float conversion rules
-+ * (see eg. OpenGL 4.6 specification - 2.3.5 Fixed-Point Data Conversions).
- */
- static inline u32 drm_color_lut_extract(u32 user_input, int bit_precision)
- {
-- u32 val = user_input;
-- u32 max = 0xffff >> (16 - bit_precision);
--
-- /* Round only if we're not using full precision. */
-- if (bit_precision < 16) {
-- val += 1UL << (16 - bit_precision - 1);
-- val >>= 16 - bit_precision;
-- }
--
-- return clamp_val(val, 0, max);
-+ if (bit_precision > 16)
-+ return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
-+ (1 << 16) - 1);
-+ else
-+ return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
-+ (1 << 16) - 1);
- }
-
- u64 drm_color_ctm_s31_32_to_qm_n(u64 user_input, u32 m, u32 n);
---
-2.43.0
-
+++ /dev/null
-From 239406643c60bd7c448c5b3a1ef1138ac2c4cb90 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 7cbf719c578e..2d8c681c3469 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -126,8 +129,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
afs-fix-the-usage-of-read_seqbegin_or_lock-in-afs_fi.patch
rxrpc_find_service_conn_rcu-fix-the-usage-of-read_se.patch
jfs-fix-array-index-out-of-bounds-in-dinewext.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sunrpc-fix-a-suspicious-rcu-usage-warning.patch
f2fs-fix-to-check-return-value-of-f2fs_reserve_new_b.patch
alsa-hda-refer-to-correct-stream-index-at-loops.patch
asoc-doc-fix-undefined-snd_soc_dapm_nopm-argument.patch
-drm-fix-color-lut-rounding.patch
fast_dput-handle-underflows-gracefully.patch
rdma-ipoib-fix-error-code-return-in-ipoib_mcast_join.patch
drm-amd-display-fix-tiled-display-misalignment.patch
+++ /dev/null
-From 4d6c545c4dc74312af21a9a4f3d1fab2a8ffa74d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 13 Oct 2023 16:13:59 +0300
-Subject: drm: Fix color LUT rounding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ville Syrjälä <ville.syrjala@linux.intel.com>
-
-[ Upstream commit c6fbb6bca10838485b820e8a26c23996f77ce580 ]
-
-The current implementation of drm_color_lut_extract()
-generates weird results. Eg. if we go through all the
-values for 16->8bpc conversion we see the following pattern:
-
-in out (count)
- 0 - 7f -> 0 (128)
- 80 - 17f -> 1 (256)
- 180 - 27f -> 2 (256)
- 280 - 37f -> 3 (256)
-...
-fb80 - fc7f -> fc (256)
-fc80 - fd7f -> fd (256)
-fd80 - fe7f -> fe (256)
-fe80 - ffff -> ff (384)
-
-So less values map to 0 and more values map 0xff, which
-doesn't seem particularly great.
-
-To get just the same number of input values to map to
-the same output values we'd just need to drop the rounding
-entrirely. But perhaps a better idea would be to follow the
-OpenGL int<->float conversion rules, in which case we get
-the following results:
-
-in out (count)
- 0 - 80 -> 0 (129)
- 81 - 181 -> 1 (257)
- 182 - 282 -> 2 (257)
- 283 - 383 -> 3 (257)
-...
-fc7c - fd7c -> fc (257)
-fd7d - fe7d -> fd (257)
-fe7e - ff7e -> fe (257)
-ff7f - ffff -> ff (129)
-
-Note that since the divisor is constant the compiler
-is able to optimize away the integer division in most
-cases. The only exception is the _ULL() case on 32bit
-architectures since that gets emitted as inline asm
-via do_div() and thus the compiler doesn't get to
-optimize it.
-
-Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-2-ville.syrjala@linux.intel.com
-Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
-Reviewed-by: Jani Nikula <jani.nikula@intel.com>
-Acked-by: Maxime Ripard <mripard@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/drm/drm_color_mgmt.h | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
-index 81c298488b0c..54b2b2467bfd 100644
---- a/include/drm/drm_color_mgmt.h
-+++ b/include/drm/drm_color_mgmt.h
-@@ -36,20 +36,17 @@ struct drm_plane;
- *
- * Extract a degamma/gamma LUT value provided by user (in the form of
- * &drm_color_lut entries) and round it to the precision supported by the
-- * hardware.
-+ * hardware, following OpenGL int<->float conversion rules
-+ * (see eg. OpenGL 4.6 specification - 2.3.5 Fixed-Point Data Conversions).
- */
- static inline u32 drm_color_lut_extract(u32 user_input, int bit_precision)
- {
-- u32 val = user_input;
-- u32 max = 0xffff >> (16 - bit_precision);
--
-- /* Round only if we're not using full precision. */
-- if (bit_precision < 16) {
-- val += 1UL << (16 - bit_precision - 1);
-- val >>= 16 - bit_precision;
-- }
--
-- return clamp_val(val, 0, max);
-+ if (bit_precision > 16)
-+ return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
-+ (1 << 16) - 1);
-+ else
-+ return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
-+ (1 << 16) - 1);
- }
-
- u64 drm_color_ctm_s31_32_to_qm_n(u64 user_input, u32 m, u32 n);
---
-2.43.0
-
+++ /dev/null
-From 582300da72fe746e214401253bb7c7366ac26603 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 7cbf719c578e..2d8c681c3469 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -126,8 +129,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
rxrpc_find_service_conn_rcu-fix-the-usage-of-read_se.patch
jfs-fix-array-index-out-of-bounds-in-dinewext.patch
arch-consolidate-arch_irq_work_raise-prototypes.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sunrpc-fix-a-suspicious-rcu-usage-warning.patch
f2fs-fix-to-check-return-value-of-f2fs_reserve_new_b.patch
alsa-hda-refer-to-correct-stream-index-at-loops.patch
asoc-doc-fix-undefined-snd_soc_dapm_nopm-argument.patch
-drm-fix-color-lut-rounding.patch
fast_dput-handle-underflows-gracefully.patch
rdma-ipoib-fix-error-code-return-in-ipoib_mcast_join.patch
drm-amd-display-fix-tiled-display-misalignment.patch
+++ /dev/null
-From c1a197811f9c734797534e605c0f4d3dd577b50a Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index ee31f36f48f3..62976e38a963 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -127,8 +130,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
afs-fix-the-usage-of-read_seqbegin_or_lock-in-afs_fi.patch
rxrpc_find_service_conn_rcu-fix-the-usage-of-read_se.patch
jfs-fix-array-index-out-of-bounds-in-dinewext.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sunrpc-fix-a-suspicious-rcu-usage-warning.patch
+++ /dev/null
-From e8a78b7c4cfbdfec5fb226370530228335b1f1ae Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 13 Oct 2023 16:13:59 +0300
-Subject: drm: Fix color LUT rounding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ville Syrjälä <ville.syrjala@linux.intel.com>
-
-[ Upstream commit c6fbb6bca10838485b820e8a26c23996f77ce580 ]
-
-The current implementation of drm_color_lut_extract()
-generates weird results. Eg. if we go through all the
-values for 16->8bpc conversion we see the following pattern:
-
-in out (count)
- 0 - 7f -> 0 (128)
- 80 - 17f -> 1 (256)
- 180 - 27f -> 2 (256)
- 280 - 37f -> 3 (256)
-...
-fb80 - fc7f -> fc (256)
-fc80 - fd7f -> fd (256)
-fd80 - fe7f -> fe (256)
-fe80 - ffff -> ff (384)
-
-So less values map to 0 and more values map 0xff, which
-doesn't seem particularly great.
-
-To get just the same number of input values to map to
-the same output values we'd just need to drop the rounding
-entrirely. But perhaps a better idea would be to follow the
-OpenGL int<->float conversion rules, in which case we get
-the following results:
-
-in out (count)
- 0 - 80 -> 0 (129)
- 81 - 181 -> 1 (257)
- 182 - 282 -> 2 (257)
- 283 - 383 -> 3 (257)
-...
-fc7c - fd7c -> fc (257)
-fd7d - fe7d -> fd (257)
-fe7e - ff7e -> fe (257)
-ff7f - ffff -> ff (129)
-
-Note that since the divisor is constant the compiler
-is able to optimize away the integer division in most
-cases. The only exception is the _ULL() case on 32bit
-architectures since that gets emitted as inline asm
-via do_div() and thus the compiler doesn't get to
-optimize it.
-
-Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-2-ville.syrjala@linux.intel.com
-Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
-Reviewed-by: Jani Nikula <jani.nikula@intel.com>
-Acked-by: Maxime Ripard <mripard@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/drm/drm_color_mgmt.h | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
-index 81c298488b0c..54b2b2467bfd 100644
---- a/include/drm/drm_color_mgmt.h
-+++ b/include/drm/drm_color_mgmt.h
-@@ -36,20 +36,17 @@ struct drm_plane;
- *
- * Extract a degamma/gamma LUT value provided by user (in the form of
- * &drm_color_lut entries) and round it to the precision supported by the
-- * hardware.
-+ * hardware, following OpenGL int<->float conversion rules
-+ * (see eg. OpenGL 4.6 specification - 2.3.5 Fixed-Point Data Conversions).
- */
- static inline u32 drm_color_lut_extract(u32 user_input, int bit_precision)
- {
-- u32 val = user_input;
-- u32 max = 0xffff >> (16 - bit_precision);
--
-- /* Round only if we're not using full precision. */
-- if (bit_precision < 16) {
-- val += 1UL << (16 - bit_precision - 1);
-- val >>= 16 - bit_precision;
-- }
--
-- return clamp_val(val, 0, max);
-+ if (bit_precision > 16)
-+ return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
-+ (1 << 16) - 1);
-+ else
-+ return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
-+ (1 << 16) - 1);
- }
-
- u64 drm_color_ctm_s31_32_to_qm_n(u64 user_input, u32 m, u32 n);
---
-2.43.0
-
+++ /dev/null
-From 02b196c50da8e9de024532d4d7ddf53a73060a41 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 7cbf719c578e..2d8c681c3469 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -126,8 +129,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
jfs-fix-array-index-out-of-bounds-in-dinewext.patch
arch-consolidate-arch_irq_work_raise-prototypes.patch
s390-vfio-ap-fix-sysfs-status-attribute-for-ap-queue.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sunrpc-fix-a-suspicious-rcu-usage-warning.patch
f2fs-fix-to-check-return-value-of-f2fs_reserve_new_b.patch
alsa-hda-refer-to-correct-stream-index-at-loops.patch
asoc-doc-fix-undefined-snd_soc_dapm_nopm-argument.patch
-drm-fix-color-lut-rounding.patch
fast_dput-handle-underflows-gracefully.patch
rdma-ipoib-fix-error-code-return-in-ipoib_mcast_join.patch
drm-panel-edp-add-override_edid_mode-quirk-for-gener.patch
+++ /dev/null
-From 5ca610239fb933a0793ab29761ef568f79fa3cdd Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 13 Oct 2023 16:13:59 +0300
-Subject: drm: Fix color LUT rounding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ville Syrjälä <ville.syrjala@linux.intel.com>
-
-[ Upstream commit c6fbb6bca10838485b820e8a26c23996f77ce580 ]
-
-The current implementation of drm_color_lut_extract()
-generates weird results. Eg. if we go through all the
-values for 16->8bpc conversion we see the following pattern:
-
-in out (count)
- 0 - 7f -> 0 (128)
- 80 - 17f -> 1 (256)
- 180 - 27f -> 2 (256)
- 280 - 37f -> 3 (256)
-...
-fb80 - fc7f -> fc (256)
-fc80 - fd7f -> fd (256)
-fd80 - fe7f -> fe (256)
-fe80 - ffff -> ff (384)
-
-So less values map to 0 and more values map 0xff, which
-doesn't seem particularly great.
-
-To get just the same number of input values to map to
-the same output values we'd just need to drop the rounding
-entrirely. But perhaps a better idea would be to follow the
-OpenGL int<->float conversion rules, in which case we get
-the following results:
-
-in out (count)
- 0 - 80 -> 0 (129)
- 81 - 181 -> 1 (257)
- 182 - 282 -> 2 (257)
- 283 - 383 -> 3 (257)
-...
-fc7c - fd7c -> fc (257)
-fd7d - fe7d -> fd (257)
-fe7e - ff7e -> fe (257)
-ff7f - ffff -> ff (129)
-
-Note that since the divisor is constant the compiler
-is able to optimize away the integer division in most
-cases. The only exception is the _ULL() case on 32bit
-architectures since that gets emitted as inline asm
-via do_div() and thus the compiler doesn't get to
-optimize it.
-
-Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-2-ville.syrjala@linux.intel.com
-Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
-Reviewed-by: Jani Nikula <jani.nikula@intel.com>
-Acked-by: Maxime Ripard <mripard@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/drm/drm_color_mgmt.h | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
-index 81c298488b0c..54b2b2467bfd 100644
---- a/include/drm/drm_color_mgmt.h
-+++ b/include/drm/drm_color_mgmt.h
-@@ -36,20 +36,17 @@ struct drm_plane;
- *
- * Extract a degamma/gamma LUT value provided by user (in the form of
- * &drm_color_lut entries) and round it to the precision supported by the
-- * hardware.
-+ * hardware, following OpenGL int<->float conversion rules
-+ * (see eg. OpenGL 4.6 specification - 2.3.5 Fixed-Point Data Conversions).
- */
- static inline u32 drm_color_lut_extract(u32 user_input, int bit_precision)
- {
-- u32 val = user_input;
-- u32 max = 0xffff >> (16 - bit_precision);
--
-- /* Round only if we're not using full precision. */
-- if (bit_precision < 16) {
-- val += 1UL << (16 - bit_precision - 1);
-- val >>= 16 - bit_precision;
-- }
--
-- return clamp_val(val, 0, max);
-+ if (bit_precision > 16)
-+ return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
-+ (1 << 16) - 1);
-+ else
-+ return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
-+ (1 << 16) - 1);
- }
-
- u64 drm_color_ctm_s31_32_to_qm_n(u64 user_input, u32 m, u32 n);
---
-2.43.0
-
+++ /dev/null
-From 8f284513b8c1713b605b61bf7e6fa23d87392ea2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 9c03b9965f07..10f1bc07423c 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -125,8 +128,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
s390-boot-always-align-vmalloc-area-on-segment-bound.patch
arch-consolidate-arch_irq_work_raise-prototypes.patch
s390-vfio-ap-fix-sysfs-status-attribute-for-ap-queue.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sysctl-fix-out-of-bounds-access-for-empty-sysctl-reg.patch
f2fs-fix-to-check-return-value-of-f2fs_reserve_new_b.patch
alsa-hda-refer-to-correct-stream-index-at-loops.patch
asoc-doc-fix-undefined-snd_soc_dapm_nopm-argument.patch
-drm-fix-color-lut-rounding.patch
fast_dput-handle-underflows-gracefully.patch
reiserfs-avoid-touching-renamed-directory-if-parent-.patch
rdma-ipoib-fix-error-code-return-in-ipoib_mcast_join.patch
+++ /dev/null
-From 09bb383f88338316b11ca2270176a3439efef22f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 13 Oct 2023 16:13:59 +0300
-Subject: drm: Fix color LUT rounding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ville Syrjälä <ville.syrjala@linux.intel.com>
-
-[ Upstream commit c6fbb6bca10838485b820e8a26c23996f77ce580 ]
-
-The current implementation of drm_color_lut_extract()
-generates weird results. Eg. if we go through all the
-values for 16->8bpc conversion we see the following pattern:
-
-in out (count)
- 0 - 7f -> 0 (128)
- 80 - 17f -> 1 (256)
- 180 - 27f -> 2 (256)
- 280 - 37f -> 3 (256)
-...
-fb80 - fc7f -> fc (256)
-fc80 - fd7f -> fd (256)
-fd80 - fe7f -> fe (256)
-fe80 - ffff -> ff (384)
-
-So less values map to 0 and more values map 0xff, which
-doesn't seem particularly great.
-
-To get just the same number of input values to map to
-the same output values we'd just need to drop the rounding
-entrirely. But perhaps a better idea would be to follow the
-OpenGL int<->float conversion rules, in which case we get
-the following results:
-
-in out (count)
- 0 - 80 -> 0 (129)
- 81 - 181 -> 1 (257)
- 182 - 282 -> 2 (257)
- 283 - 383 -> 3 (257)
-...
-fc7c - fd7c -> fc (257)
-fd7d - fe7d -> fd (257)
-fe7e - ff7e -> fe (257)
-ff7f - ffff -> ff (129)
-
-Note that since the divisor is constant the compiler
-is able to optimize away the integer division in most
-cases. The only exception is the _ULL() case on 32bit
-architectures since that gets emitted as inline asm
-via do_div() and thus the compiler doesn't get to
-optimize it.
-
-Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-2-ville.syrjala@linux.intel.com
-Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
-Reviewed-by: Jani Nikula <jani.nikula@intel.com>
-Acked-by: Maxime Ripard <mripard@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/drm/drm_color_mgmt.h | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
-index 81c298488b0c..54b2b2467bfd 100644
---- a/include/drm/drm_color_mgmt.h
-+++ b/include/drm/drm_color_mgmt.h
-@@ -36,20 +36,17 @@ struct drm_plane;
- *
- * Extract a degamma/gamma LUT value provided by user (in the form of
- * &drm_color_lut entries) and round it to the precision supported by the
-- * hardware.
-+ * hardware, following OpenGL int<->float conversion rules
-+ * (see eg. OpenGL 4.6 specification - 2.3.5 Fixed-Point Data Conversions).
- */
- static inline u32 drm_color_lut_extract(u32 user_input, int bit_precision)
- {
-- u32 val = user_input;
-- u32 max = 0xffff >> (16 - bit_precision);
--
-- /* Round only if we're not using full precision. */
-- if (bit_precision < 16) {
-- val += 1UL << (16 - bit_precision - 1);
-- val >>= 16 - bit_precision;
-- }
--
-- return clamp_val(val, 0, max);
-+ if (bit_precision > 16)
-+ return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
-+ (1 << 16) - 1);
-+ else
-+ return DIV_ROUND_CLOSEST(user_input * ((1 << bit_precision) - 1),
-+ (1 << 16) - 1);
- }
-
- u64 drm_color_ctm_s31_32_to_qm_n(u64 user_input, u32 m, u32 n);
---
-2.43.0
-
+++ /dev/null
-From deb098153a1c5b383d996b43a5ed9bf29f143a2d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 15 Nov 2023 14:28:15 +0100
-Subject: Hexagon: Make pfn accessors statics inlines
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit d6e81532b10d8deb2bc30f7b44f09534876893e3 ]
-
-Making virt_to_pfn() a static inline taking a strongly typed
-(const void *) makes the contract of a passing a pointer of that
-type to the function explicit and exposes any misuse of the
-macro virt_to_pfn() acting polymorphic and accepting many types
-such as (void *), (unitptr_t) or (unsigned long) as arguments
-without warnings.
-
-For symmetry do the same with pfn_to_virt().
-
-For compiletime resolution of __pa() we need PAGE_OFFSET which
-was not available to __pa() and resolved by the preprocessor
-wherever __pa() was used. Fix this by explicitly including
-<asm/mem-layout.h> where required, following the pattern of the
-architectures page.h file.
-
-Acked-by: Brian Cain <bcain@quicinc.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/hexagon/include/asm/page.h | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
-index 9c03b9965f07..10f1bc07423c 100644
---- a/arch/hexagon/include/asm/page.h
-+++ b/arch/hexagon/include/asm/page.h
-@@ -78,6 +78,9 @@ typedef struct page *pgtable_t;
- #define __pgd(x) ((pgd_t) { (x) })
- #define __pgprot(x) ((pgprot_t) { (x) })
-
-+/* Needed for PAGE_OFFSET used in the macro right below */
-+#include <asm/mem-layout.h>
-+
- /*
- * We need a __pa and a __va routine for kernel space.
- * MIPS says they're only used during mem_init.
-@@ -125,8 +128,16 @@ static inline void clear_page(void *page)
- */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
--#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
--#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-+static inline unsigned long virt_to_pfn(const void *kaddr)
-+{
-+ return __pa(kaddr) >> PAGE_SHIFT;
-+}
-+
-+static inline void *pfn_to_virt(unsigned long pfn)
-+{
-+ return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
-+}
-+
-
- #define page_to_virt(page) __va(page_to_phys(page))
-
---
-2.43.0
-
arch-consolidate-arch_irq_work_raise-prototypes.patch
arch-fix-asm-offsets.c-building-with-wmissing-protot.patch
s390-vfio-ap-fix-sysfs-status-attribute-for-ap-queue.patch
-hexagon-make-pfn-accessors-statics-inlines.patch
s390-ptrace-handle-setting-of-fpc-register-correctly.patch
kvm-s390-fix-setting-of-fpc-register.patch
sysctl-fix-out-of-bounds-access-for-empty-sysctl-reg.patch
f2fs-fix-to-check-return-value-of-f2fs_reserve_new_b.patch
alsa-hda-refer-to-correct-stream-index-at-loops.patch
asoc-doc-fix-undefined-snd_soc_dapm_nopm-argument.patch
-drm-fix-color-lut-rounding.patch
fast_dput-handle-underflows-gracefully.patch
reiserfs-avoid-touching-renamed-directory-if-parent-.patch
ocfs2-avoid-touching-renamed-directory-if-parent-doe.patch