[PATCH 3/3] drm/amd/pm/powerplay/smumgr/ci: use bitwise or for bitmasks addition

2023-01-14 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
index 5ca3c422f7d4..a164d12b88ad 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
@@ -2203,7 +2203,7 @@ static int ci_program_mem_timing_parameters(struct 
pp_hwmgr *hwmgr)
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
if (data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_OD_UPDATE_MCLK))
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_OD_UPDATE_MCLK))
return ci_program_memory_timing_parameters(hwmgr);
 
return 0;
-- 
2.34.1





[PATCH 2/3] drm/amd/pm/powerplay/hwmgr: use bitwise or for bitmasks addition

2023-01-14 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
index 7ef7e81525a3..bf9bcc4e5338 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
@@ -4153,7 +4153,7 @@ static int smu7_freeze_sclk_mclk_dpm(struct pp_hwmgr 
*hwmgr)
 
if ((0 == data->sclk_dpm_key_disabled) &&
(data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_UPDATE_SCLK))) {
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_UPDATE_SCLK))) {
PP_ASSERT_WITH_CODE(true == smum_is_dpm_running(hwmgr),
"Trying to freeze SCLK DPM when DPM is 
disabled",
);
@@ -4210,7 +4210,7 @@ static int smu7_populate_and_upload_sclk_mclk_dpm_levels(
}
 
if (data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_UPDATE_SCLK)) {
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_UPDATE_SCLK)) {
result = smum_populate_all_graphic_levels(hwmgr);
PP_ASSERT_WITH_CODE((0 == result),
"Failed to populate SCLK during 
PopulateNewDPMClocksStates Function!",
@@ -4218,7 +4218,7 @@ static int smu7_populate_and_upload_sclk_mclk_dpm_levels(
}
 
if (data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_MCLK + DPMTABLE_UPDATE_MCLK)) {
+   (DPMTABLE_OD_UPDATE_MCLK | DPMTABLE_UPDATE_MCLK)) {
/*populate MCLK dpm table to SMU7 */
result = smum_populate_all_memory_levels(hwmgr);
PP_ASSERT_WITH_CODE((0 == result),
@@ -4309,7 +4309,7 @@ static int smu7_unfreeze_sclk_mclk_dpm(struct pp_hwmgr 
*hwmgr)
 
if ((0 == data->sclk_dpm_key_disabled) &&
(data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_UPDATE_SCLK))) {
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_UPDATE_SCLK))) {
 
PP_ASSERT_WITH_CODE(true == smum_is_dpm_running(hwmgr),
"Trying to Unfreeze SCLK DPM when DPM is 
disabled",
-- 
2.34.1





[PATCH 1/3] drm/amd/pm/powerplay/smumgr: use bitwise or for addition

2023-01-14 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
index 03df35dee8ba..060fc140c574 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
@@ -2165,7 +2165,7 @@ static int iceland_program_mem_timing_parameters(struct 
pp_hwmgr *hwmgr)
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
if (data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_OD_UPDATE_MCLK))
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_OD_UPDATE_MCLK))
return iceland_program_memory_timing_parameters(hwmgr);
 
return 0;
diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
index 04b561f5d932..acbe41174d7e 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
@@ -2554,7 +2554,7 @@ static int tonga_program_mem_timing_parameters(struct 
pp_hwmgr *hwmgr)
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 
if (data->need_update_smu7_dpm_table &
-   (DPMTABLE_OD_UPDATE_SCLK + DPMTABLE_OD_UPDATE_MCLK))
+   (DPMTABLE_OD_UPDATE_SCLK | DPMTABLE_OD_UPDATE_MCLK))
return tonga_program_memory_timing_parameters(hwmgr);
 
return 0;
-- 
2.34.1





[PATCH 0/3] drm/amd/pm/powerplay: use bitwise or for bitmasks addition

2023-01-14 Thread Deepak R Varma
The patch series proposes usage of bitwise or "|" operator for addition of
bitmasks instead of using numerial additions. The former is quicker and cleaner.

The proposed change is compile tested.

Deepak R Varma (3):
  drm/amd/pm/powerplay/smumgr: use bitwise or for addition
  drm/amd/pm/powerplay/hwmgr: use bitwise or for bitmasks addition
  drm/amd/pm/powerplay/smumgr/ci: use bitwise or for bitmasks addition

 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c  | 8 
 drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c   | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.34.1





Re: [PATCH 02/22] usb: remove the dead USB_OHCI_SH option

2023-01-14 Thread Rob Landley



On 1/13/23 01:12, Greg Kroah-Hartman wrote:
> On Fri, Jan 13, 2023 at 07:23:19AM +0100, Christoph Hellwig wrote:
>> USB_OHCI_SH is a dummy option that never builds any code, remove it.
>> 
>> Signed-off-by: Christoph Hellwig 
>> ---
>>  drivers/usb/host/Kconfig | 11 ---
>>  1 file changed, 11 deletions(-)
>> 
>> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
>> index 8d799d23c476e1..ca5f657c092cf4 100644
>> --- a/drivers/usb/host/Kconfig
>> +++ b/drivers/usb/host/Kconfig
>> @@ -548,17 +548,6 @@ config USB_OHCI_HCD_SSB
>>  
>>If unsure, say N.
>>  
>> -config USB_OHCI_SH
>> -bool "OHCI support for SuperH USB controller (DEPRECATED)"
>> -depends on SUPERH || COMPILE_TEST
>> -select USB_OHCI_HCD_PLATFORM
>> -help
>> -  This option is deprecated now and the driver was removed, use
>> -  USB_OHCI_HCD_PLATFORM instead.
>> -
>> -  Enables support for the on-chip OHCI controller on the SuperH.
>> -  If you use the PCI OHCI controller, this option is not necessary.
>> -
>>  config USB_OHCI_EXYNOS
>>  tristate "OHCI support for Samsung S5P/Exynos SoC Series"
>>  depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
>> -- 
>> 2.39.0
>> 
> 
> Do you want all of these to go through a single tree, or can they go
> through the different driver subsystem trees?

Neither please. Multiple people are objecting.

Rob


[PATCH 4/4] drm/amd/display: dcn32: Use min()/max() helper macros

2023-01-14 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable
comparison using if/else blocks or ternary operator. Change identified
using minmax.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
index f94abd124021..80820f012891 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
@@ -908,7 +908,7 @@ static bool subvp_drr_schedulable(struct dc *dc, struct 
dc_state *context, struc
stretched_drr_us = drr_frame_us + mall_region_us + SUBVP_DRR_MARGIN_US;
drr_stretched_vblank_us = (drr_timing->v_total - 
drr_timing->v_addressable) * drr_timing->h_total /
(double)(drr_timing->pix_clk_100hz * 100) * 100 + 
(stretched_drr_us - drr_frame_us);
-   max_vblank_mallregion = drr_stretched_vblank_us > mall_region_us ? 
drr_stretched_vblank_us : mall_region_us;
+   max_vblank_mallregion = max(drr_stretched_vblank_us, mall_region_us);
 
/* We consider SubVP + DRR schedulable if the stretched frame duration 
of the DRR display (i.e. the
 * highest refresh rate + margin that can support UCLK P-State switch) 
passes the static analysis
@@ -999,7 +999,7 @@ static bool subvp_vblank_schedulable(struct dc *dc, struct 
dc_state *context)
(double)(vblank_timing->pix_clk_100hz * 100) * 
100;
subvp_active_us = main_timing->v_addressable * 
main_timing->h_total /
(double)(main_timing->pix_clk_100hz * 100) * 
100;
-   max_vblank_mallregion = vblank_blank_us > mall_region_us ? 
vblank_blank_us : mall_region_us;
+   max_vblank_mallregion = max(vblank_blank_us, mall_region_us);
 
// Schedulable if VACTIVE region of the SubVP pipe can fit the 
MALL prefetch, VBLANK frame time,
// and the max of (VBLANK blanking time, MALL region)
-- 
2.34.1





[PATCH 3/4] drm/amd/display: dcn21: Use min()/max() helper macros

2023-01-14 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable
comparison using if/else blocks or ternary operator. Change identified
using minmax.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 .../gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c   | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
index 1d84ae50311d..41fb5fddd85d 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
@@ -838,10 +838,7 @@ static bool CalculatePrefetchSchedule(
 
dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 
4.0;
 
-   if (dst_y_prefetch_oto < dst_y_prefetch_equ)
-   *DestinationLinesForPrefetch = dst_y_prefetch_oto;
-   else
-   *DestinationLinesForPrefetch = dst_y_prefetch_equ;
+   *DestinationLinesForPrefetch = min(dst_y_prefetch_oto, 
dst_y_prefetch_equ);
 
// Limit to prevent overflow in DST_Y_PREFETCH register
*DestinationLinesForPrefetch = dml_min(*DestinationLinesForPrefetch, 
63.75);
-- 
2.34.1





[PATCH 2/4] drm/amd/display: dcn20: Use min()/max() helper macros

2023-01-14 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable
comparison using if/else blocks or ternary operator. Change identified
using minmax.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 .../gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c   | 5 +
 .../gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c | 5 +
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index d3b5b6fedf04..850bb0f973d4 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -626,10 +626,7 @@ static bool CalculatePrefetchSchedule(
 
dst_y_prefetch_oto = Tpre_oto / LineTime;
 
-   if (dst_y_prefetch_oto < dst_y_prefetch_equ)
-   *DestinationLinesForPrefetch = dst_y_prefetch_oto;
-   else
-   *DestinationLinesForPrefetch = dst_y_prefetch_equ;
+   *DestinationLinesForPrefetch = min(dst_y_prefetch_oto, 
dst_y_prefetch_equ);
 
*DestinationLinesForPrefetch = dml_floor(4.0 * 
(*DestinationLinesForPrefetch + 0.125), 1)
/ 4;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
index edd098c7eb92..6f4903525acc 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
@@ -686,10 +686,7 @@ static bool CalculatePrefetchSchedule(
 
dst_y_prefetch_oto = Tpre_oto / LineTime;
 
-   if (dst_y_prefetch_oto < dst_y_prefetch_equ)
-   *DestinationLinesForPrefetch = dst_y_prefetch_oto;
-   else
-   *DestinationLinesForPrefetch = dst_y_prefetch_equ;
+   *DestinationLinesForPrefetch = min(dst_y_prefetch_oto, 
dst_y_prefetch_equ);
 
*DestinationLinesForPrefetch = dml_floor(4.0 * 
(*DestinationLinesForPrefetch + 0.125), 1)
/ 4;
-- 
2.34.1





[PATCH 1/4] drm/amd/display: Use min()/max() macros in dcn_calc_math

2023-01-14 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable
comparison using if/else blocks or ternary operator. Change identified
using minmax.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 .../gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c   | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c 
b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c
index cac72413a097..81629f3715d3 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c
@@ -52,12 +52,12 @@ float dcn_bw_min2(const float arg1, const float arg2)
return arg2;
if (isNaN(arg2))
return arg1;
-   return arg1 < arg2 ? arg1 : arg2;
+   return min(arg1, arg2);
 }
 
 unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)
 {
-   return arg1 > arg2 ? arg1 : arg2;
+   return max(arg1, arg2);
 }
 float dcn_bw_max2(const float arg1, const float arg2)
 {
@@ -65,7 +65,7 @@ float dcn_bw_max2(const float arg1, const float arg2)
return arg2;
if (isNaN(arg2))
return arg1;
-   return arg1 > arg2 ? arg1 : arg2;
+   return max(arg1, arg2);
 }
 
 float dcn_bw_floor2(const float arg, const float significance)
@@ -93,12 +93,12 @@ float dcn_bw_ceil2(const float arg, const float 
significance)
 
 float dcn_bw_max3(float v1, float v2, float v3)
 {
-   return v3 > dcn_bw_max2(v1, v2) ? v3 : dcn_bw_max2(v1, v2);
+   return max(v3, dcn_bw_max2(v1, v2));
 }
 
 float dcn_bw_max5(float v1, float v2, float v3, float v4, float v5)
 {
-   return dcn_bw_max3(v1, v2, v3) > dcn_bw_max2(v4, v5) ? dcn_bw_max3(v1, 
v2, v3) : dcn_bw_max2(v4, v5);
+   return max(dcn_bw_max3(v1, v2, v3), dcn_bw_max2(v4, v5));
 }
 
 float dcn_bw_pow(float a, float exp)
-- 
2.34.1





[PATCH 0/4] drm/amd/display: Use min()/max() helper macros

2023-01-14 Thread Deepak R Varma
This patch series proposes using standard min() / max() helper macros instead of
direct variable comparison using the ternary operator or if/else evaluations. I
have tested the change using a dummy module and similar simulations on my x86
machine.

Deepak R Varma (4):
  drm/amd/display: Use min()/max() macros in dcn_calc_math
  drm/amd/display: dcn20: Use min()/max() helper macros
  drm/amd/display: dcn21: Use min()/max() helper macros
  drm/amd/display: dcn32: Use min()/max() helper macros

 .../gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c   | 10 +-
 .../drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c |  5 +
 .../amd/display/dc/dml/dcn20/display_mode_vba_20v2.c   |  5 +
 .../drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c |  5 +
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c   |  4 ++--
 5 files changed, 10 insertions(+), 19 deletions(-)

-- 
2.34.1





[PATCH 2/2] Docs: Add some missing SPDX license identifiers of subsystem docs

2023-01-14 Thread SeongJae Park
Some subsystem documents are missing SPDX license identifiers.  Add
those.

Signed-off-by: SeongJae Park 
---
 Documentation/crypto/index.rst | 2 ++
 Documentation/driver-api/index.rst | 2 ++
 Documentation/gpu/index.rst| 2 ++
 Documentation/hwmon/index.rst  | 2 ++
 Documentation/input/index.rst  | 2 ++
 Documentation/mm/index.rst | 2 ++
 Documentation/scheduler/index.rst  | 2 ++
 Documentation/sound/index.rst  | 2 ++
 8 files changed, 16 insertions(+)

diff --git a/Documentation/crypto/index.rst b/Documentation/crypto/index.rst
index da5d5ad2bdf3..95b0870e09b8 100644
--- a/Documentation/crypto/index.rst
+++ b/Documentation/crypto/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 ==
 Crypto API
 ==
diff --git a/Documentation/driver-api/index.rst 
b/Documentation/driver-api/index.rst
index b208e0dac3a0..7a2584ab63c4 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 ==
 Driver implementer's API guide
 ==
diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst
index eee5996acf2c..ff06a6b12c5e 100644
--- a/Documentation/gpu/index.rst
+++ b/Documentation/gpu/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 
 GPU Driver Developer's Guide
 
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index c2b3c1a822dd..2186d732654f 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 ===
 Hardware Monitoring
 ===
diff --git a/Documentation/input/index.rst b/Documentation/input/index.rst
index 35581cd18e91..d60bf9cfe005 100644
--- a/Documentation/input/index.rst
+++ b/Documentation/input/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 ===
 Input Documentation
 ===
diff --git a/Documentation/mm/index.rst b/Documentation/mm/index.rst
index 5a94a921ea40..c4e9fbacaf38 100644
--- a/Documentation/mm/index.rst
+++ b/Documentation/mm/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 ===
 Memory Management Documentation
 ===
diff --git a/Documentation/scheduler/index.rst 
b/Documentation/scheduler/index.rst
index 1aac972a652f..ae0229f5a9cf 100644
--- a/Documentation/scheduler/index.rst
+++ b/Documentation/scheduler/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 =
 Scheduler
 =
diff --git a/Documentation/sound/index.rst b/Documentation/sound/index.rst
index 5abed5fc6485..7e67e12730d3 100644
--- a/Documentation/sound/index.rst
+++ b/Documentation/sound/index.rst
@@ -1,3 +1,5 @@
+.. SPDX-License-Identifier: GPL-2.0
+
 =
 Sound Subsystem Documentation
 =
-- 
2.25.1



[PATCH 1/2] Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents

2023-01-14 Thread SeongJae Park
Some documents that listed on subsystem-apis have 'Linux' or 'The Linux'
title prefixes.  It's duplicated information, and makes finding the
document of interest with human eyes not easy.  Remove the prefixes from
the titles.

Signed-off-by: SeongJae Park 
---
 Documentation/PCI/index.rst| 6 +++---
 Documentation/cpu-freq/index.rst   | 6 +++---
 Documentation/crypto/index.rst | 6 +++---
 Documentation/driver-api/index.rst | 6 +++---
 Documentation/gpu/index.rst| 6 +++---
 Documentation/hwmon/index.rst  | 6 +++---
 Documentation/input/index.rst  | 6 +++---
 Documentation/mm/index.rst | 6 +++---
 Documentation/peci/index.rst   | 6 +++---
 Documentation/scheduler/index.rst  | 6 +++---
 Documentation/scsi/index.rst   | 6 +++---
 Documentation/sound/index.rst  | 6 +++---
 Documentation/virt/index.rst   | 6 +++---
 Documentation/watchdog/index.rst   | 6 +++---
 14 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/Documentation/PCI/index.rst b/Documentation/PCI/index.rst
index c17c87af1968..e73f84aebde3 100644
--- a/Documentation/PCI/index.rst
+++ b/Documentation/PCI/index.rst
@@ -1,8 +1,8 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-===
-Linux PCI Bus Subsystem
-===
+=
+PCI Bus Subsystem
+=
 
 .. toctree::
:maxdepth: 2
diff --git a/Documentation/cpu-freq/index.rst b/Documentation/cpu-freq/index.rst
index 2fe32dad562a..de25740651f7 100644
--- a/Documentation/cpu-freq/index.rst
+++ b/Documentation/cpu-freq/index.rst
@@ -1,8 +1,8 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-==
-Linux CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel
-==
+
+CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel
+
 
 Author: Dominik Brodowski  
 
diff --git a/Documentation/crypto/index.rst b/Documentation/crypto/index.rst
index 21338fa92642..da5d5ad2bdf3 100644
--- a/Documentation/crypto/index.rst
+++ b/Documentation/crypto/index.rst
@@ -1,6 +1,6 @@
-===
-Linux Kernel Crypto API
-===
+==
+Crypto API
+==
 
 :Author: Stephan Mueller
 :Author: Marek Vasut
diff --git a/Documentation/driver-api/index.rst 
b/Documentation/driver-api/index.rst
index d3a58f77328e..b208e0dac3a0 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -1,6 +1,6 @@
-
-The Linux driver implementer's API guide
-
+==
+Driver implementer's API guide
+==
 
 The kernel offers a wide variety of interfaces to support the development
 of device drivers.  This document is an only somewhat organized collection
diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst
index b99dede9a5b1..eee5996acf2c 100644
--- a/Documentation/gpu/index.rst
+++ b/Documentation/gpu/index.rst
@@ -1,6 +1,6 @@
-==
-Linux GPU Driver Developer's Guide
-==
+
+GPU Driver Developer's Guide
+
 
 .. toctree::
 
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index fe2cc6b73634..c2b3c1a822dd 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -1,6 +1,6 @@
-=
-Linux Hardware Monitoring
-=
+===
+Hardware Monitoring
+===
 
 .. toctree::
:maxdepth: 1
diff --git a/Documentation/input/index.rst b/Documentation/input/index.rst
index 9888f5cbf6d5..35581cd18e91 100644
--- a/Documentation/input/index.rst
+++ b/Documentation/input/index.rst
@@ -1,6 +1,6 @@
-=
-The Linux Input Documentation
-=
+===
+Input Documentation
+===
 
 Contents:
 
diff --git a/Documentation/mm/index.rst b/Documentation/mm/index.rst
index 4aa12b8be278..5a94a921ea40 100644
--- a/Documentation/mm/index.rst
+++ b/Documentation/mm/index.rst
@@ -1,6 +1,6 @@
-=
-Linux Memory Management Documentation
-=
+===
+Memory Management Documentation
+===
 
 Memory Management Guide
 ===
diff --git a/Documentation/peci/index.rst b/Documentation/peci/index.rst
index 989de10416e7..930e75217c33 100644
--- a/Documentation/peci/index.rst
+++ b/Documentation/peci/index.rst
@@ -1,8 +1,8 @@
 .. SPDX-License-Identifier: GPL-2.0-only
 
-
-Linux PECI Subsystem

Re: [REGRESSION] GM20B probe fails after commit 2541626cfb79

2023-01-14 Thread Karol Herbst
On Sat, Jan 14, 2023 at 5:07 PM Diogo Ivo  wrote:
>
> On Sat, Jan 14, 2023 at 04:27:38AM +0100, Karol Herbst wrote:
> > I tried to look into it, but my jetson nano, just constantly behaves
> > in very strange ways. I tried to compile and install a 6.1 kernel onto
> > it, but any kernel just refuses to boot and I have no idea what's up
> > with that device. The kernel starts to boot and it just stops in the
> > middle. From what I can tell is that most of the tegra devices never
> > worked reliably in the first place and there are a couple of random
> > and strange bugs around. I've attached my dmesg, so if anybody has any
> > clues why the kernel just stops doing anything, it would really help
> > me.
>
> Hello,
>
> Thank you for looking into this! I have seen this type of hang in
> mainline on this SoC, and it was due to a reset not being deasserted.
> Would you mind getting a log with initcall_debug enabled to pinpoint
> where the hang occurs? I would be happy to help if I can.
>

the last thing printed is:

[   20.517642] calling  clk_disable_unused+0x0/0xe0 @ 1

> > But maybe it would be for the best to just pull tegra support out of
> > nouveau, because in the current situation we really can't spare much
> > time dealing with them and we are already busy enough just dealing
> > with the desktop GPUs. And the firmware we got from Nvidia is so
> > ancient and different from the desktop GPU ones, that without actually
> > having all those boards available and properly tested, we can't be
> > sure to not break them.
> >
> > And afaik there are almost no _actual_ users, just distribution folks
> > wanting to claim "support" for those devices, but then ending up using
> > Nvidia's out of tree Tegra driver in deployments anyway.
>
> > If there are actual users using them for their daily life, I'd like to
> > know, because I'm aware of none.
>
> For what it's worth, I consider myself a user of nouveau. Granted, I'm
> using it as a hobby project, but in its current state it is not far from
> a usable desktop experience on the Pixel C.
>

okay. I mean, I'm happy to keep fixing regressions and figuring out
what's wrong with booting the devices and such if regular users come
around and file bugs. And until today I wasn't really aware of anybody
:)

It's just not worth my time, if there are no users using them at all.
Or rather.. if there would only be commercial users (like.. companies
deploying those for money), then they could get involved and help us
out, because I wouldn't be willing to spend my time on this, if that
would be the case.

> Diogo
>



Re: [REGRESSION] GM20B probe fails after commit 2541626cfb79

2023-01-14 Thread Diogo Ivo
On Sat, Jan 14, 2023 at 04:27:38AM +0100, Karol Herbst wrote:
> I tried to look into it, but my jetson nano, just constantly behaves
> in very strange ways. I tried to compile and install a 6.1 kernel onto
> it, but any kernel just refuses to boot and I have no idea what's up
> with that device. The kernel starts to boot and it just stops in the
> middle. From what I can tell is that most of the tegra devices never
> worked reliably in the first place and there are a couple of random
> and strange bugs around. I've attached my dmesg, so if anybody has any
> clues why the kernel just stops doing anything, it would really help
> me.

Hello,

Thank you for looking into this! I have seen this type of hang in
mainline on this SoC, and it was due to a reset not being deasserted.
Would you mind getting a log with initcall_debug enabled to pinpoint
where the hang occurs? I would be happy to help if I can.

> But maybe it would be for the best to just pull tegra support out of
> nouveau, because in the current situation we really can't spare much
> time dealing with them and we are already busy enough just dealing
> with the desktop GPUs. And the firmware we got from Nvidia is so
> ancient and different from the desktop GPU ones, that without actually
> having all those boards available and properly tested, we can't be
> sure to not break them.
> 
> And afaik there are almost no _actual_ users, just distribution folks
> wanting to claim "support" for those devices, but then ending up using
> Nvidia's out of tree Tegra driver in deployments anyway.

> If there are actual users using them for their daily life, I'd like to
> know, because I'm aware of none.

For what it's worth, I consider myself a user of nouveau. Granted, I'm
using it as a hobby project, but in its current state it is not far from
a usable desktop experience on the Pixel C.

Diogo


Re: [REGRESSION] GM20B probe fails after commit 2541626cfb79

2023-01-14 Thread Diogo Ivo
On Fri, Jan 13, 2023 at 02:19:06PM +0100, Linux kernel regression tracking 
(Thorsten Leemhuis) wrote:
> Diogo, for that it would be really helpful to known: is the issue still
> happening with latest mainline? Is it possible to revert 2541626cfb79
> easily? And if so: do things work afterwards again?

Hello,

Thank you for your attention to this! I have checked the latest mainline and
it still occurs. As for reverting, I think it is complicated to do,
since this commit is a part of a larger rework, but I'm afraid I don't know
enough about the code to give a proper answer.

Diogo


[PATCH] drm/i915/gvt: Remove extra semicolon

2023-01-14 Thread Deepak R Varma
Remove the extra semicolon at end. Issue identified using
semicolon.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/i915/gvt/vgpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index a5497440484f..08ad1bd651f1 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -323,7 +323,7 @@ int intel_gvt_create_vgpu(struct intel_vgpu *vgpu,
ret = idr_alloc(>vgpu_idr, vgpu, IDLE_VGPU_IDR + 1, GVT_MAX_VGPU,
GFP_KERNEL);
if (ret < 0)
-   goto out_unlock;;
+   goto out_unlock;
 
vgpu->id = ret;
vgpu->sched_ctl.weight = conf->weight;
-- 
2.34.1





[PATCH] drm/mediatek: dp: Remove extra semicolon

2023-01-14 Thread Deepak R Varma
Remove unnecessary semicolon at the end of switch block closing brace.
Issue identified using semicolon Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/mediatek/mtk_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c 
b/drivers/gpu/drm/mediatek/mtk_dp.c
index 9d085c05c49c..9da58ac5a8b8 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1693,7 +1693,7 @@ static int mtk_dp_training(struct mtk_dp *mtk_dp)
break;
default:
return -EINVAL;
-   };
+   }
continue;
}
 
-- 
2.34.1





Re: [PATCH v3 4/6] ARM: dts: omap: Use new media bus type macros

2023-01-14 Thread Laurent Pinchart
Tony, could you take this patch in your tree for v6.3 ? The two patches
that it depends on have both been merged in v6.2.

On Thu, Jun 16, 2022 at 01:14:08AM +0300, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  arch/arm/boot/dts/omap3-n900.dts | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts 
> b/arch/arm/boot/dts/omap3-n900.dts
> index d40c3d2c4914..9cad9d6a83e2 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -9,6 +9,7 @@
>  #include "omap34xx.dtsi"
>  #include 
>  #include 
> +#include 
>  
>  /*
>   * Default secure signed bootloader (Nokia X-Loader) does not enable L3 
> firewall
> @@ -194,7 +195,7 @@ port@1 {
>  
>   csi_isp: endpoint {
>   remote-endpoint = <_cam1>;
> - bus-type = <3>; /* CCP2 */
> + bus-type = ;
>   clock-lanes = <1>;
>   data-lanes = <0>;
>   lane-polarity = <0 0>;
> @@ -835,7 +836,7 @@ cam1: camera@3e {
>  
>   port {
>   csi_cam1: endpoint {
> - bus-type = <3>; /* CCP2 */
> + bus-type = ;
>   strobe = <1>;
>   clock-inv = <0>;
>   crc = <1>;

-- 
Regards,

Laurent Pinchart


[PATCH] drm/nouveau/gr/gf100-: remove unnecessary semicolon

2023-01-14 Thread Deepak R Varma
Remove extra unnecessary semicolon. Issue identified using
semcolon.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
index 5f20079c3660..204516891ece 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -420,7 +420,7 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct 
nvkm_fifo_chan *fifoch,
return ret;
} else {
ret = nvkm_memory_map(gr->attrib_cb, 0, chan->vmm, 
chan->attrib_cb,
- , sizeof(args));;
+ , sizeof(args));
if (ret)
return ret;
}
-- 
2.34.1





Re: [PATCH v3 6/6] ARM: dts: stm32: Use new media bus type macros

2023-01-14 Thread Laurent Pinchart
Hugues, Maxime, Alexandre, could one of you take this patch in your tree
for v6.3 ? The two patches that it depends on have both been merged in
v6.2.

On Thu, Jun 16, 2022 at 01:14:10AM +0300, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  arch/arm/boot/dts/stm32429i-eval.dts  | 3 ++-
>  arch/arm/boot/dts/stm32mp157c-ev1.dts | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts 
> b/arch/arm/boot/dts/stm32429i-eval.dts
> index 0d98aca01736..5fae11e6607b 100644
> --- a/arch/arm/boot/dts/stm32429i-eval.dts
> +++ b/arch/arm/boot/dts/stm32429i-eval.dts
> @@ -50,6 +50,7 @@
>  #include "stm32f429-pinctrl.dtsi"
>  #include 
>  #include 
> +#include 
>  
>  / {
>   model = "STMicroelectronics STM32429i-EVAL board";
> @@ -186,7 +187,7 @@  {
>   port {
>   dcmi_0: endpoint {
>   remote-endpoint = <_0>;
> - bus-type = <5>;
> + bus-type = ;
>   bus-width = <8>;
>   hsync-active = <0>;
>   vsync-active = <0>;
> diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts 
> b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> index d142dd30e16b..306d41a6138f 100644
> --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
> +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
> @@ -8,6 +8,7 @@
>  #include "stm32mp157c-ed1.dts"
>  #include 
>  #include 
> +#include 
>  
>  / {
>   model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
> @@ -90,7 +91,7 @@  {
>   port {
>   dcmi_0: endpoint {
>   remote-endpoint = <_0>;
> - bus-type = <5>;
> + bus-type = ;
>   bus-width = <8>;
>   hsync-active = <0>;
>   vsync-active = <0>;

-- 
Regards,

Laurent Pinchart


Re: [PATCH v3 3/6] ARM: dts: freescale: Use new media bus type macros

2023-01-14 Thread Laurent Pinchart
Shawn, could you please take this in your tree for v6.3 ? The two
patches that the DT changes depend on have been merged in v6.2.

On Thu, Jun 16, 2022 at 01:14:07AM +0300, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  arch/arm/boot/dts/imx6ul-14x14-evk.dtsi | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi 
> b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> index 1a18c41ce385..d98111f2100f 100644
> --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> @@ -2,6 +2,8 @@
>  //
>  // Copyright (C) 2015 Freescale Semiconductor, Inc.
>  
> +#include 
> +
>  / {
>   chosen {
>   stdout-path = 
> @@ -170,7 +172,7 @@  {
>   port {
>   parallel_from_ov5640: endpoint {
>   remote-endpoint = <_to_parallel>;
> - bus-type = <5>; /* Parallel bus */
> + bus-type = ;
>   };
>   };
>  };

-- 
Regards,

Laurent Pinchart


Re: [PATCH v3 5/6] ARM: dts: renesas: Use new media bus type macros

2023-01-14 Thread Laurent Pinchart
Geert, could you please take this in your tree for v6.3 ? The two
patches that the DT changes depend on have been merged in v6.2.

On Thu, Jun 16, 2022 at 01:14:09AM +0300, Laurent Pinchart wrote:
> Now that a header exists with macros for the media interface bus-type
> values, replace hardcoding numerical constants with the corresponding
> macros in the DT sources.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts   | 11 +++
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi |  4 +++-
>  .../dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi |  4 +++-
>  3 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts 
> b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> index 4e58c54cde17..33ac4bd1e63b 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
> @@ -7,6 +7,9 @@
>   */
>  
>  /dts-v1/;
> +
> +#include 
> +
>  #include "r8a7742-iwg21d-q7.dts"
>  
>  / {
> @@ -242,7 +245,7 @@ port {
>   vin0ep: endpoint {
>   remote-endpoint = <>;
>   bus-width = <8>;
> - bus-type = <6>;
> + bus-type = ;
>   };
>   };
>  };
> @@ -273,7 +276,7 @@ port {
>   vin1ep: endpoint {
>   remote-endpoint = <>;
>   bus-width = <8>;
> - bus-type = <6>;
> + bus-type = ;
>   };
>   };
>  };
> @@ -305,7 +308,7 @@ vin2ep: endpoint {
>   remote-endpoint = <>;
>   bus-width = <8>;
>   data-shift = <8>;
> - bus-type = <6>;
> + bus-type = ;
>   };
>   };
>  };
> @@ -335,7 +338,7 @@ port {
>   vin3ep: endpoint {
>   remote-endpoint = <>;
>   bus-width = <8>;
> - bus-type = <6>;
> + bus-type = ;
>   };
>   };
>  };
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi 
> b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> index 40cef0b1d1e6..c73160df619d 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi
> @@ -7,6 +7,8 @@
>   * Copyright (C) 2020 Renesas Electronics Corp.
>   */
>  
> +#include 
> +
>  #define CAM_ENABLED  1
>  
>  _PARENT_I2C {
> @@ -26,7 +28,7 @@ port {
>   CAM_EP: endpoint {
>   bus-width = <8>;
>   data-shift = <2>;
> - bus-type = <6>;
> + bus-type = ;
>   pclk-sample = <1>;
>   remote-endpoint = <_EP>;
>   };
> diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi 
> b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> index f5e77f024251..a7f5cfec64b8 100644
> --- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> +++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi
> @@ -7,6 +7,8 @@
>   * Copyright (C) 2020 Renesas Electronics Corp.
>   */
>  
> +#include 
> +
>  #define CAM_ENABLED  1
>  
>  _PARENT_I2C {
> @@ -21,7 +23,7 @@ ov7725@21 {
>   port {
>   CAM_EP: endpoint {
>   bus-width = <8>;
> - bus-type = <6>;
> + bus-type = ;
>   remote-endpoint = <_EP>;
>   };
>   };

-- 
Regards,

Laurent Pinchart


nvkm_devinit_func.disable() to be made void

2023-01-14 Thread Deepak R Varma
Hello,
It appears that the callback function disable() of struct nvkm_devinit_func does
not need return U64 and can be transformed to be a void. This will impact a few
drivers that have currently implementation of this callback since those always
return 0ULL. So,

Change from
  8 struct nvkm_devinit_func {
... ...
15  u64  (*disable)(struct nvkm_devinit *);
  1 };

Change to
  8 struct nvkm_devinit_func {
... ...
15  void  (*disable)(struct nvkm_devinit *);
  1 };


I am unsure if this change will have any UAPI impact. Hence wanted to confirm
with you if you think this transformation is useful. If yes, I will be happy to
submit a patch for your consideration.

Please let me know.

Thank you,
./drv




[PATCH] drm/i915/display: Convert i9xx_pipe_crc_auto_source to void

2023-01-14 Thread Deepak R Varma
Convert function i9xx_pipe_crc_auto_source() to return void instead
of int since the current implementation always returns 0 to the caller.
Issue identified using returnvar Coccinelle semantic patch.

Signed-off-by: Deepak R Varma 
---
Please note: The change is compile tested only.


 drivers/gpu/drm/i915/display/intel_pipe_crc.c | 23 ++-
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c 
b/drivers/gpu/drm/i915/display/intel_pipe_crc.c
index e9774670e3f6..8d3ea8d7b737 100644
--- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c
@@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source 
*source,
return 0;
 }
 
-static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
-enum pipe pipe,
-enum intel_pipe_crc_source *source)
+static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
+ enum pipe pipe,
+ enum intel_pipe_crc_source *source)
 {
struct intel_encoder *encoder;
struct intel_crtc *crtc;
struct intel_digital_port *dig_port;
-   int ret = 0;
 
*source = INTEL_PIPE_CRC_SOURCE_PIPE;
 
@@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct 
drm_i915_private *dev_priv,
}
}
drm_modeset_unlock_all(_priv->drm);
-
-   return ret;
 }
 
 static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
@@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private 
*dev_priv,
 {
bool need_stable_symbols = false;
 
-   if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) {
-   int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
-   if (ret)
-   return ret;
-   }
+   if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
+   i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
 
switch (*source) {
case INTEL_PIPE_CRC_SOURCE_PIPE:
@@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private 
*dev_priv,
 enum intel_pipe_crc_source *source,
 u32 *val)
 {
-   if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) {
-   int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
-   if (ret)
-   return ret;
-   }
+   if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
+   i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
 
switch (*source) {
case INTEL_PIPE_CRC_SOURCE_PIPE:
-- 
2.34.1





[PATCH] drm/amd/display: Fix warning caused by a bad fake property

2023-01-14 Thread Guilherme G. Piccoli
Commit 5468c36d6285 ("drm/amd/display: Filter Invalid 420 Modes for HDMI TMDS")
added a validation on driver probe to prevent invalid TMDS modes. For that,
it requires to fake some plane properties before submitting to the validation
routines.

Happens that one of such fake properties (swizzle) causes a boot-time
warning due to an assert on swizzle routines. Since it's a fake property,
change it hereby to a valid value to prevent such warning. Also, while at
it, fix the unnecessary double assignment of this same property in code.

Fixes: 5468c36d6285 ("drm/amd/display: Filter Invalid 420 Modes for HDMI TMDS")
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2264
Reported-by: Melissa Wen 
Cc: Fangzhi Zuo 
Cc: Harry Wentland 
Cc: Leo Li 
Cc: Mark Broadworth 
Cc: Rodrigo Siqueira 
Cc: Sung Joon Kim 
Signed-off-by: Guilherme G. Piccoli 
---


Hi folks, notice my choice here was to set swizzle to DC_SW_LINEAR;
I've considered creating a new enum member (like "DC_SW_FAKE", or
something like that) but seems it's easier to just use the LINEAR
one. In my (very cheap!) understanding, this shouldn't affect the
purpose of the TMDS validation thing.

Lemme know if there's something to improve here, and thanks in
advance for reviews/comments.
Cheers,


Guilherme


 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 1b7f20a9d4ae..35ab39fd9345 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6261,9 +6261,8 @@ static enum dc_status 
dm_validate_stream_and_context(struct dc *dc,
dc_plane_state->plane_size.surface_size.width  = stream->src.width;
dc_plane_state->plane_size.chroma_size.height  = stream->src.height;
dc_plane_state->plane_size.chroma_size.width   = stream->src.width;
-   dc_plane_state->tiling_info.gfx9.swizzle =  DC_SW_UNKNOWN;
dc_plane_state->format = SURFACE_PIXEL_FORMAT_GRPH_ARGB;
-   dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_UNKNOWN;
+   dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_LINEAR;
dc_plane_state->rotation = ROTATION_ANGLE_0;
dc_plane_state->is_tiling_rotated = false;
dc_plane_state->tiling_info.gfx8.array_mode = DC_ARRAY_LINEAR_GENERAL;
-- 
2.39.0



Re: [RFC PATCH v2 1/2] drm/dsi-mipi: Fix byte order of DCS set/get brightness

2023-01-14 Thread Richard Acayan
On Fri, Jan 13, 2023 at 08:00:05PM -0500, Richard Acayan wrote:
> From: Daniel Mentz 
> 
> The MIPI DCS specification demands that brightness values are sent in
> big endian byte order. It also states that one parameter (i.e. one byte)
> shall be sent/received for 8 bit wide values, and two parameters shall
> be used for values that are between 9 and 16 bits wide.
> 
> Fixes: 1a9d759331b8 ("drm/dsi: Implement DCS set/get display brightness")
> Signed-off-by: Daniel Mentz 
> Change-Id: I24306e21ec6a5ff48ea121d977419a81d5b44152
I need to check which local commits I'm actually emailing...

This line will be removed in v3.

> Link: 
> https://android.googlesource.com/kernel/msm/+/754affd62d0ee268c686c53169b1dbb7deac8550
> [richard: fix 16-bit brightness_get]
> [richard: use separate functions instead of switch/case]
> Signed-off-by: Richard Acayan 
> ---
>  drivers/gpu/drm/drm_mipi_dsi.c | 52 ++
>  include/drm/drm_mipi_dsi.h |  4 +++
>  2 files changed, 56 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index 497ef4b6a90a..4bc15fbd009d 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -1224,6 +1224,58 @@ int mipi_dsi_dcs_get_display_brightness(struct 
> mipi_dsi_device *dsi,
>  }
>  EXPORT_SYMBOL(mipi_dsi_dcs_get_display_brightness);
>  
> +/**
> + * mipi_dsi_dcs_set_display_brightness_large() - sets the 16-bit brightness 
> value
> + *of the display
> + * @dsi: DSI peripheral device
> + * @brightness: brightness value
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int mipi_dsi_dcs_set_display_brightness_large(struct mipi_dsi_device *dsi,
> +  u16 brightness)
> +{
> + u8 payload[2] = { brightness >> 8, brightness & 0xff };
> + ssize_t err;
> +
> + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
> +  payload, sizeof(payload));
> + if (err < 0)
> + return err;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(mipi_dsi_dcs_set_display_brightness_large);
> +
> +/**
> + * mipi_dsi_dcs_get_display_brightness_large() - gets the current 16-bit
> + *brightness value of the display
> + * @dsi: DSI peripheral device
> + * @brightness: brightness value
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,
> +  u16 *brightness)
> +{
> + u8 brightness_be[2];
> + ssize_t err;
> +
> + err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DISPLAY_BRIGHTNESS,
> + brightness_be, sizeof(brightness_be));
> + if (err <= 0) {
> + if (err == 0)
> + err = -ENODATA;
> +
> + return err;
> + }
> +
> + *brightness = (brightness_be[0] << 8) | brightness_be[1];
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(mipi_dsi_dcs_get_display_brightness_large);
> +
>  static int mipi_dsi_drv_probe(struct device *dev)
>  {
>   struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver);
> diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
> index 4f503d99f668..16f30975b22b 100644
> --- a/include/drm/drm_mipi_dsi.h
> +++ b/include/drm/drm_mipi_dsi.h
> @@ -296,6 +296,10 @@ int mipi_dsi_dcs_set_display_brightness(struct 
> mipi_dsi_device *dsi,
>   u16 brightness);
>  int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi,
>   u16 *brightness);
> +int mipi_dsi_dcs_set_display_brightness_large(struct mipi_dsi_device *dsi,
> +  u16 brightness);
> +int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,
> +  u16 *brightness);
>  
>  /**
>   * mipi_dsi_generic_write_seq - transmit data using a generic write packet
> -- 
> 2.39.0
> 


[RFC PATCH v2 1/2] drm/dsi-mipi: Fix byte order of DCS set/get brightness

2023-01-14 Thread Richard Acayan
From: Daniel Mentz 

The MIPI DCS specification demands that brightness values are sent in
big endian byte order. It also states that one parameter (i.e. one byte)
shall be sent/received for 8 bit wide values, and two parameters shall
be used for values that are between 9 and 16 bits wide.

Fixes: 1a9d759331b8 ("drm/dsi: Implement DCS set/get display brightness")
Signed-off-by: Daniel Mentz 
Change-Id: I24306e21ec6a5ff48ea121d977419a81d5b44152
Link: 
https://android.googlesource.com/kernel/msm/+/754affd62d0ee268c686c53169b1dbb7deac8550
[richard: fix 16-bit brightness_get]
[richard: use separate functions instead of switch/case]
Signed-off-by: Richard Acayan 
---
 drivers/gpu/drm/drm_mipi_dsi.c | 52 ++
 include/drm/drm_mipi_dsi.h |  4 +++
 2 files changed, 56 insertions(+)

diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 497ef4b6a90a..4bc15fbd009d 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -1224,6 +1224,58 @@ int mipi_dsi_dcs_get_display_brightness(struct 
mipi_dsi_device *dsi,
 }
 EXPORT_SYMBOL(mipi_dsi_dcs_get_display_brightness);
 
+/**
+ * mipi_dsi_dcs_set_display_brightness_large() - sets the 16-bit brightness 
value
+ *of the display
+ * @dsi: DSI peripheral device
+ * @brightness: brightness value
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int mipi_dsi_dcs_set_display_brightness_large(struct mipi_dsi_device *dsi,
+u16 brightness)
+{
+   u8 payload[2] = { brightness >> 8, brightness & 0xff };
+   ssize_t err;
+
+   err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
+payload, sizeof(payload));
+   if (err < 0)
+   return err;
+
+   return 0;
+}
+EXPORT_SYMBOL(mipi_dsi_dcs_set_display_brightness_large);
+
+/**
+ * mipi_dsi_dcs_get_display_brightness_large() - gets the current 16-bit
+ *brightness value of the display
+ * @dsi: DSI peripheral device
+ * @brightness: brightness value
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,
+u16 *brightness)
+{
+   u8 brightness_be[2];
+   ssize_t err;
+
+   err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DISPLAY_BRIGHTNESS,
+   brightness_be, sizeof(brightness_be));
+   if (err <= 0) {
+   if (err == 0)
+   err = -ENODATA;
+
+   return err;
+   }
+
+   *brightness = (brightness_be[0] << 8) | brightness_be[1];
+
+   return 0;
+}
+EXPORT_SYMBOL(mipi_dsi_dcs_get_display_brightness_large);
+
 static int mipi_dsi_drv_probe(struct device *dev)
 {
struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver);
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 4f503d99f668..16f30975b22b 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -296,6 +296,10 @@ int mipi_dsi_dcs_set_display_brightness(struct 
mipi_dsi_device *dsi,
u16 brightness);
 int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi,
u16 *brightness);
+int mipi_dsi_dcs_set_display_brightness_large(struct mipi_dsi_device *dsi,
+u16 brightness);
+int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,
+u16 *brightness);
 
 /**
  * mipi_dsi_generic_write_seq - transmit data using a generic write packet
-- 
2.39.0



Re: [RFC PATCH] drm/dsi-mipi: Fix byte order of DCS set/get brightness

2023-01-14 Thread Richard Acayan
On Fri, Jan 13, 2023 at 05:34:55PM +0100, Sam Ravnborg wrote:
> Hi Richard/Daniel.
Not sure if you saw the original commit that I linked.

This patch was written in 2017 for the Pixel 3 and Pixel 3 XL
smartphones. I didn't contact the original author before sending this,
since the kernel that this patch originated from is EOL.

This greeting is still fine because it would be great if the original
author took responsibility for getting this patch applied.

>
> On Thu, Jan 12, 2023 at 11:18:48PM -0500, Richard Acayan wrote:
>> From: Daniel Mentz 
>> 
>> The MIPI DCS specification demands that brightness values are sent in
>> big endian byte order. It also states that one parameter (i.e. one byte)
>> shall be sent/received for 8 bit wide values, and two parameters shall
>> be used for values that are between 9 and 16 bits wide.
> It is only a few week ago someone write they needed a byteswap to use
> the kernel provided mipi_dsi_dcs_set_display_brightness(). I did not
> realize then that this is because it is buggy.
I didn't even consider sending this patch when I initially saw it. I
would have performed the byte swap in a new S6E3FA7 panel driver just
like in SOFEF00.

>
> Some comments on the patch:
> - It would be nice to split it up so first patch fixes that the
>   parameters are in big-endian. This would go for both set and get.
The brightness is only big endian if it's 16-bit.

Most MIPI panel drivers in the kernel tree only send an 8-bit
brightness, or none at all. For these panels, the brightness can be sent
as a 16-bit integer in little endian, as it has the same effect as an
8-bit integer, with a zero byte appended. The original MIPI brightness
functions work properly with no changes for 8-bit brightness panels
only.

If we want separate 8-bit (original) and 16-bit functions, the 8-bit
functions shouldn't pass the brightness in big endian. That doesn't mean
we shouldn't change them at all.

>
> - Second patch could then introduce the possibility to a driver to
>   use a variant that matches the display.
>   I would suggest to go for two functions:
>   mipi_dsi_dcs_set_display_brightness()
>   mipi_dsi_dcs_set_display_brightness_two()
I'm thinking of a "_large" or "_wide" suffix instead. This would make a
32-bit suffix tricky though, if it is ever needed.

>   So it is obvious when you go for the two byte version without adding a
>   bool parameter.
>   If the implementation is done using a helper or two independent
>   functions are up to you.
These get_display_brightness and set_display_brightness functions are
already helpers. I'll have them duplicated.

>
> The patch split would be nice, but at least we should have two functions
> and not a bool parameter.
Yes, that was a bad idea on my part. With separate functions for 16-bit
brightness, there is no API change, less panel driver touching, and
panel driver changes can happen in separate patches. Thank you for the
suggestion.

> Both patches should have the same Fixes tag.
>
>   Sam
>
>
>> 
>> Fixes: 1a9d759331b8 ("drm/dsi: Implement DCS set/get display brightness")
>> Signed-off-by: Daniel Mentz 
>> Change-Id: I24306e21ec6a5ff48ea121d977419a81d5b44152
>> Link: 
>> https://android.googlesource.com/kernel/msm/+/754affd62d0ee268c686c53169b1dbb7deac8550
>> [richard: fix 16-bit brightness_get; change brightness call by all panels on 
>> the -next tree]
>> Signed-off-by: Richard Acayan 
>> ---
>>  drivers/gpu/drm/drm_mipi_dsi.c| 44 ---
>>  .../drm/panel/panel-asus-z00t-tm5p5-n35596.c  |  4 +-
>>  .../gpu/drm/panel/panel-boe-bf060y8m-aj0.c|  4 +-
>>  drivers/gpu/drm/panel/panel-ebbg-ft8719.c |  2 +-
>>  drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c  |  2 +-
>>  .../gpu/drm/panel/panel-jdi-lt070me05000.c|  4 +-
>>  drivers/gpu/drm/panel/panel-raydium-rm67191.c |  4 +-
>>  .../gpu/drm/panel/panel-samsung-s6e63j0x03.c  |  2 +-
>>  drivers/gpu/drm/panel/panel-samsung-sofef00.c |  4 +-
>>  .../panel/panel-sony-tulip-truly-nt35521.c|  4 +-
>>  include/drm/drm_mipi_dsi.h|  4 +-
>>  11 files changed, 55 insertions(+), 23 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
>> index 497ef4b6a90a..1e6dbf986d97 100644
>> --- a/drivers/gpu/drm/drm_mipi_dsi.c
>> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
>> @@ -1180,17 +1180,33 @@ EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline);
>>   *display
>>   * @dsi: DSI peripheral device
>>   * @brightness: brightness value
>> + * @num_params: Number of parameters (bytes) to encode brightness value in. 
>> The
>> + *  MIPI specification states that one parameter shall be sent 
>> for
>> + *  devices that support 8-bit brightness levels. For devices 
>> that
>> + *  support brightness levels wider than 8-bit, two parameters
>> + *  shall be sent.
>>   *
>>   * Return: 0 on success or a negative error code on failure.
>>   */
>>  int 

[RFC PATCH v2 2/2] drm/panel: sofef00: Use 16-bit panel brightness

2023-01-14 Thread Richard Acayan
These panels communicate brightness in big endian. This is not a quirk
of the panels themselves, but rather, a part of the MIPI standard. Use
the new mipi_dsi_dcs_set_display_brightness_wide() function that
properly handles 16-bit brightness instead of doing special processing
of the brightness values.

Signed-off-by: Richard Acayan 
---
 drivers/gpu/drm/panel/panel-samsung-sofef00.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c 
b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
index 1a0d24595faa..014fe350bc59 100644
--- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -221,13 +220,9 @@ static int sofef00_panel_bl_update_status(struct 
backlight_device *bl)
 {
struct mipi_dsi_device *dsi = bl_get_data(bl);
int err;
-   u16 brightness;
+   u16 brightness = (u16)backlight_get_brightness(bl);
 
-   brightness = (u16)backlight_get_brightness(bl);
-   // This panel needs the high and low bytes swapped for the brightness 
value
-   brightness = __swab16(brightness);
-
-   err = mipi_dsi_dcs_set_display_brightness(dsi, brightness);
+   err = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
if (err < 0)
return err;
 
-- 
2.39.0



[RFC PATCH v2 0/2] drm/dsi-mipi: 16-bit Brightness Endianness Fix

2023-01-14 Thread Richard Acayan
Changes since v1:
 - move 16-bit brightness handling to new functions and revert API
   change (1/2)
 - remove Change-Id in compliance with checkpatch.pl (1/2)
 - separate panel driver changes (2/2)

This series adds proper support for 16-bit MIPI DSI brightness and
cleans up existing panel drivers.

I cannot test the SOFEF00 change, although I tested an equivalent change
to an external S6E3FA7 driver generated with the same generator. Both
setting and getting works on S6E3FA7.

Daniel Mentz (1):
  drm/dsi-mipi: Fix byte order of DCS set/get brightness

Richard Acayan (1):
  drm/panel: sofef00: Use 16-bit panel brightness

 drivers/gpu/drm/drm_mipi_dsi.c| 52 +++
 drivers/gpu/drm/panel/panel-samsung-sofef00.c |  9 +---
 include/drm/drm_mipi_dsi.h|  4 ++
 3 files changed, 58 insertions(+), 7 deletions(-)

-- 
2.39.0



[PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool()

2023-01-14 Thread Christophe JAILLET
strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.

In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.

While at it, include the corresponding header file ()

Signed-off-by: Christophe JAILLET 
---
This patch was already sent as a part of a serie ([1]) that axed all usages
of strtobool().
Most of the patches have been merged in -next.

I synch'ed with latest -next and re-send the remaining ones as individual
patches.

Changes in v2:
  - No change

[1]: 
https://lore.kernel.org/all/cover.1667336095.git.christophe.jail...@wanadoo.fr/
---
 drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c | 7 ---
 drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c | 7 ---
 drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c | 3 ++-
 drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c  | 3 ++-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c 
b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c
index bc5a44c2a144..ae937854403b 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c
@@ -10,6 +10,7 @@
 #define DSS_SUBSYS_NAME "DISPLAY"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,7 @@ static ssize_t display_enabled_store(struct omap_dss_device 
*dssdev,
int r;
bool enable;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
@@ -73,7 +74,7 @@ static ssize_t display_tear_store(struct omap_dss_device 
*dssdev,
if (!dssdev->driver->enable_te || !dssdev->driver->get_te)
return -ENOENT;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
@@ -183,7 +184,7 @@ static ssize_t display_mirror_store(struct omap_dss_device 
*dssdev,
if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
return -ENOENT;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c 
b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c
index ba21c4a2633d..1b644be5fe2e 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c
@@ -10,6 +10,7 @@
 #define DSS_SUBSYS_NAME "MANAGER"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -246,7 +247,7 @@ static ssize_t manager_trans_key_enabled_store(struct 
omap_overlay_manager *mgr,
bool enable;
int r;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
@@ -290,7 +291,7 @@ static ssize_t manager_alpha_blending_enabled_store(
if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
return -ENODEV;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
@@ -329,7 +330,7 @@ static ssize_t manager_cpr_enable_store(struct 
omap_overlay_manager *mgr,
if (!dss_has_feature(FEAT_CPR))
return -ENODEV;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c 
b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c
index 601c0beb6de9..1da4fb1c77b4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -210,7 +211,7 @@ static ssize_t overlay_enabled_store(struct omap_overlay 
*ovl, const char *buf,
int r;
bool enable;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c 
b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
index 06dc41aa0354..831b2c2fbdf9 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -96,7 +97,7 @@ static ssize_t store_mirror(struct device *dev,
int r;
struct fb_var_screeninfo new_var;
 
-   r = strtobool(buf, );
+   r = kstrtobool(buf, );
if (r)
return r;
 
-- 
2.34.1