Re: [PATCH] dma-buf: add DMA_BUF_IOCTL_SYNC_PARTIAL support

2024-04-10 Thread Rong Qianfeng



在 2024/4/9 23:34, Christian König 写道:

Am 09.04.24 um 09:32 schrieb Rong Qianfeng:


在 2024/4/8 15:58, Christian König 写道:

Am 07.04.24 um 09:50 schrieb Rong Qianfeng:

[SNIP]

Am 13.11.21 um 07:22 schrieb Jianqun Xu:

Add DMA_BUF_IOCTL_SYNC_PARTIAL support for user to sync dma-buf with
offset and len.


You have not given an use case for this so it is a bit hard to 
review. And from the existing use cases I don't see why this 
should be necessary.


Even worse from the existing backend implementation I don't even 
see how drivers should be able to fulfill this semantics.


Please explain further,
Christian.

Here is a practical case:
The user space can allocate a large chunk of dma-buf for 
self-management, used as a shared memory pool.
Small dma-buf can be allocated from this shared memory pool and 
released back to it after use, thus improving the speed of dma-buf 
allocation and release.
Additionally, custom functionalities such as memory statistics and 
boundary checking can be implemented in the user space.
Of course, the above-mentioned functionalities require the 
implementation of a partial cache sync interface.


Well that is obvious, but where is the code doing that?

You can't send out code without an actual user of it. That will 
obviously be rejected.


Regards,
Christian.


In fact, we have already used the user-level dma-buf memory pool in 
the camera shooting scenario on the phone.


From the test results, The execution time of the photo shooting 
algorithm has been reduced from 3.8s to 3s.


To be honest, I didn't understand your concern "...how drivers should 
be able to fulfill this semantics." Can you please help explain it in 
more detail?


Well you don't give any upstream driver code which actually uses this 
interface.


If you want to suggest some changes to the core Linux kernel your 
driver actually needs to be upstream.


As long as that isn't the case this approach here is a completely no-go.


Ok, I get it now, thanks!

Regards,

Rong Qianfeng.



Regards,
Christian.



Thanks,

Rong Qianfeng.





Thanks
Rong Qianfeng.






[PATCH] drm/amd/display: Fix division by zero in setup_dsc_config

2024-04-10 Thread Jose Fernandez
When slice_height is 0, the division by slice_height in the calculation
of the number of slices will cause a division by zero driver crash. This
leaves the kernel in a state that requires a reboot. This patch adds a
check to avoid the division by zero.

The stack trace below is for the 6.8.4 Kernel. I reproduced the issue on
a Z16 Gen 2 Lenovo Thinkpad with a Apple Studio Display monitor
connected via Thunderbolt. The amdgpu driver crashed with this exception
when I rebooted the system with the monitor connected.

kernel: ? die (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:434 
arch/x86/kernel/dumpstack.c:447)
kernel: ? do_trap (arch/x86/kernel/traps.c:113 arch/x86/kernel/traps.c:154)
kernel: ? setup_dsc_config 
(drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dc_dsc.c:1053) amdgpu
kernel: ? do_error_trap (./arch/x86/include/asm/traps.h:58 
arch/x86/kernel/traps.c:175)
kernel: ? setup_dsc_config 
(drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dc_dsc.c:1053) amdgpu
kernel: ? exc_divide_error (arch/x86/kernel/traps.c:194 (discriminator 2))
kernel: ? setup_dsc_config 
(drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dc_dsc.c:1053) amdgpu
kernel: ? asm_exc_divide_error (./arch/x86/include/asm/idtentry.h:548)
kernel: ? setup_dsc_config 
(drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dc_dsc.c:1053) amdgpu
kernel: dc_dsc_compute_config 
(drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dc_dsc.c:1109) amdgpu

After applying this patch, the driver no longer crashes when the monitor
is connected and the system is rebooted. I believe this is the same
issue reported for 3113.

Signed-off-by: Jose Fernandez 
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3113
---
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c 
b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index ac41f9c0a283..597d5425d6cb 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -1055,7 +1055,12 @@ static bool setup_dsc_config(
if (!is_dsc_possible)
goto done;
 
-   dsc_cfg->num_slices_v = pic_height/slice_height;
+   if (slice_height > 0)
+   dsc_cfg->num_slices_v = pic_height/slice_height;
+   else {
+   is_dsc_possible = false;
+   goto done;
+   }
 
if (target_bandwidth_kbps > 0) {
is_dsc_possible = decide_dsc_target_bpp_x16(
-- 
2.44.0



[PATCH v1 0/2] Support BOE nv110wum-l60 and IVO t109nw41 MIPI-DSI panel

2024-04-10 Thread Cong Yang
BOE nv110wum-l60 and IVO t109nw41 both 11.0" WUXGA TFT LCD panel,
which fits in nicely with the existing panel-boe-tv101wum-nl6 driver.
Add compatible for BOE nv110wum-l60 and IVO t109nw41
in dt-bindings.

Cong Yang (4):
  dt-bindings: display: panel: Add compatible for BOE nv110wum-l60
  drm/panel: boe-tv101wum-nl6: Support for BOE nv110wum-l60 MIPI-DSI
panel
  dt-bindings: display: panel: Add compatible for IVO t109nw41
  drm/panel: boe-tv101wum-nl6: Support for IVO t109nw41 MIPI-DSI panel

 .../display/panel/boe,tv101wum-nl6.yaml   |   4 +
 .../gpu/drm/panel/panel-boe-tv101wum-nl6.c| 213 ++
 2 files changed, 217 insertions(+)

-- 
2.25.1



[PATCH v1 1/4] dt-bindings: display: panel: Add compatible for BOE nv110wum-l60

2024-04-10 Thread Cong Yang
The BOE nv110wum-l60 is a 11.0" WUXGA TFT LCD panel, which fits in nicely
with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new
compatible with panel specific config.

Signed-off-by: Cong Yang 
---
 .../devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml 
b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
index 906ef62709b8..50351dd3d6e5 100644
--- a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
+++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
@@ -36,6 +36,8 @@ properties:
   - starry,himax83102-j02
 # STARRY ili9882t 10.51" WUXGA TFT LCD panel
   - starry,ili9882t
+# Boe nv110wum-l60 11.0" WUXGA TFT LCD panel
+  - boe,nv110wum-l60
 
   reg:
 description: the virtual channel number of a DSI peripheral
-- 
2.25.1



[PATCH v1 2/4] drm/panel: boe-tv101wum-nl6: Support for BOE nv110wum-l60 MIPI-DSI panel

2024-04-10 Thread Cong Yang
The BOE nv110wum-l60 is a 11.0" WUXGA TFT LCD panel, which fits in nicely
with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new
compatible with panel specific config.

Signed-off-by: Cong Yang 
---
 .../gpu/drm/panel/panel-boe-tv101wum-nl6.c| 115 ++
 1 file changed, 115 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c 
b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 0ffe8f8c01de..f91827e1548c 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1368,6 +1368,91 @@ static const struct panel_init_cmd 
starry_himax83102_j02_init_cmd[] = {
{},
 };
 
+static const struct panel_init_cmd boe_nv110wum_init_cmd[] = {
+   _INIT_DELAY_CMD(60),
+   _INIT_DCS_CMD(0xB9, 0x83, 0x10, 0x21, 0x55, 0x00),
+   _INIT_DCS_CMD(0xB1, 0x2C, 0xAF, 0xAF, 0x2B, 0xEB, 0x42, 0xE1, 0x4D, 
0x36, 0x36, 0x36, 0x36, 0x1A, 0x8B, 0x11, 0x65, 0x00, 0x88, 0xFA, 0xFF, 0xFF, 
0x8F, 0xFF, 0x08, 0x9A, 0x33),
+   _INIT_DCS_CMD(0xB2, 0x00, 0x47, 0xB0, 0x80, 0x00, 0x12, 0x71, 0x3C, 
0xA3, 0x11, 0x00, 0x00, 0x00, 0x88, 0xF5, 0x22, 0x8F),
+   _INIT_DCS_CMD(0xB4, 0x49, 0x49, 0x32, 0x32, 0x14, 0x32, 0x84, 0x6E, 
0x84, 0x6E, 0x01, 0x9C),
+   _INIT_DCS_CMD(0xE9, 0xCD),
+   _INIT_DCS_CMD(0xBA, 0x84),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+
+   _INIT_DCS_CMD(0xBC, 0x1B, 0x04),
+   _INIT_DCS_CMD(0xBE, 0x20),
+   _INIT_DCS_CMD(0xBF, 0xFC, 0x84),
+
+   _INIT_DCS_CMD(0xC0, 0x36, 0x36, 0x22, 0x00, 0x00, 0xA0, 0x61, 0x08, 
0xF5, 0x03),
+   _INIT_DCS_CMD(0xE9, 0xCC),
+   _INIT_DCS_CMD(0xC7, 0x80),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xE9, 0xC6),
+   _INIT_DCS_CMD(0xC8, 0x97),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+
+   _INIT_DCS_CMD(0xC9, 0x00, 0x1E, 0x30, 0xD4, 0x01),
+   _INIT_DCS_CMD(0xCB, 0x08, 0x13, 0x07, 0x00, 0x0F, 0x34),
+   _INIT_DCS_CMD(0xCC, 0x02, 0x03, 0x44),
+   _INIT_DCS_CMD(0xE9, 0xC4),
+   _INIT_DCS_CMD(0xD0, 0x03),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xD1, 0x37, 0x06, 0x00, 0x02, 0x04, 0x0C, 0xFF),
+   _INIT_DCS_CMD(0xD2, 0x1F, 0x11, 0x1F, 0x11),
+
+   _INIT_DCS_CMD(0xD3, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x04, 
0x08, 0x37, 0x37, 0x64, 0x4B, 0x11, 0x11, 0x03, 0x03, 0x32, 0x10, 0x0E, 0x00, 
0x0E, 0x32, 0x10, 0x0A, 0x00, 0x0A, 0x32,
+   0x17, 0x98, 0x07, 0x98, 0x00, 0x00),
+   _INIT_DCS_CMD(0xD5, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x1E, 0x1E, 0x1E, 
0x1F, 0x1F, 0x1F, 0x1F, 0x24, 0x24, 0x24, 0x24, 0x07, 0x06, 0x07, 0x06, 0x05, 
0x04, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01, 0x00, 0x01, 0x00, 0x21, 0x20, 
0x21, 0x20, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18),
+   _INIT_DCS_CMD(0xD8, 0xAF, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0xAF, 0xAA, 
0xAA, 0xAA, 0xAA, 0xA0),
+
+   _INIT_DCS_CMD(0xE0, 0x00, 0x05, 0x0D, 0x14, 0x1B, 0x2C, 0x44, 0x49, 
0x51, 0x4C, 0x67, 0x6C, 0x71, 0x80, 0x7D, 0x84, 0x8D, 0xA0, 0xA0, 0x4F, 0x58, 
0x64, 0x73, 0x00, 0x05, 0x0D, 0x14, 0x1B, 0x2C, 0x44, 0x49, 0x51, 0x4C, 0x67, 
0x6C, 0x71, 0x80, 0x7D, 0x84, 0x8D, 0xA0, 0xA0, 0x4F, 0x58, 0x64, 0x73),
+   _INIT_DCS_CMD(0xE7, 0x07, 0x10, 0x10, 0x1A, 0x26, 0x9E, 0x00, 0x53, 
0x9B, 0x14, 0x14),
+   _INIT_DCS_CMD(0xE1, 0x11, 0x00, 0x00, 0x89, 0x30, 0x80, 0x07, 0x80, 
0x02, 0x58, 0x00, 0x14, 0x02, 0x58, 0x02, 0x58, 0x02, 0x00, 0x02, 0x2C, 0x00, 
0x20, 0x02, 0x02, 0x00, 0x08, 0x00, 0x0C,
+   0x05, 0x0E, 0x04, 0x94, 0x18, 0x00, 0x10, 0xF0, 0x03, 
0x0C, 0x20, 0x00, 0x06, 0x0B, 0x0B, 0x33, 0x0E),
+   _INIT_DCS_CMD(0xBD, 0x01),
+   _INIT_DCS_CMD(0xD8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA0, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFA, 0xA0),
+   _INIT_DCS_CMD(0xB1, 0x01, 0xBF, 0x11),
+   _INIT_DCS_CMD(0xCB, 0x86),
+   _INIT_DCS_CMD(0xD2, 0x96),
+   _INIT_DCS_CMD(0xE9, 0xC9),
+   _INIT_DCS_CMD(0xD3, 0x84),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xE9, 0xD1),
+   _INIT_DCS_CMD(0xE1, 0xF6, 0x2B, 0x34, 0x2B, 0x74, 0x3B, 0x74, 0x6B, 
0x74),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+
+   _INIT_DCS_CMD(0xE7, 0x02, 0x00, 0x2B, 0x01, 0x7E, 0x0F, 0x7E, 0x10, 
0xA0, 0x00, 0x00),
+   _INIT_DCS_CMD(0xBD, 0x02),
+   _INIT_DCS_CMD(0xB4, 0x02, 0x00, 0xBB, 0x11),
+   _INIT_DCS_CMD(0xD8, 0xFF, 0xAF, 0xFF, 0xFF, 0xFA, 0xA0, 0xFF, 0xAF, 
0xFF, 0xFF, 0xFA, 0xA0),
+   _INIT_DCS_CMD(0xE7, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0x00, 0x00, 
0x00, 0x23, 0x00, 0x23, 0x81, 0x02, 0x40, 0x00, 0x20, 0x65, 0x02, 0x01, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00),
+
+   _INIT_DCS_CMD(0xBD, 0x03),
+   _INIT_DCS_CMD(0xD8, 0xAA, 0xAF, 0xAA, 0xAA, 0xA0, 0x00, 0xAA, 0xAF, 
0xAA, 0xAA, 0xA0, 0x00, 0xAA, 0xAF, 0xAA, 0xAA, 0xA0, 0x00, 0xAA, 0xAF, 0xAA, 
0xAA, 0xA0, 0x00),
+   _INIT_DCS_CMD(0xE9, 0xC6),
+   _INIT_DCS_CMD(0xB4, 0x03, 0xFF, 0xF8),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xE1, 0x00),
+
+   _INIT_DCS_CMD(0xBD, 0x00),
+   _INIT_D

[PATCH v1 4/4] drm/panel: boe-tv101wum-nl6: Support for IVO t109nw41 MIPI-DSI panel

2024-04-10 Thread Cong Yang
The IVO t109nw41 is a 11.0" WUXGA TFT LCD panel, which fits in nicely with
the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new compatible
with panel specific config.

Signed-off-by: Cong Yang 
---
 .../gpu/drm/panel/panel-boe-tv101wum-nl6.c| 98 +++
 1 file changed, 98 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c 
b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index f91827e1548c..201a82415e1e 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1453,6 +1453,72 @@ static const struct panel_init_cmd 
boe_nv110wum_init_cmd[] = {
_INIT_DELAY_CMD(25),
{},
 };
+
+static const struct panel_init_cmd ivo_t109nw41_init_cmd[] = {
+   _INIT_DELAY_CMD(60),
+   _INIT_DCS_CMD(0xB9, 0x83, 0x10, 0x21, 0x55, 0x00),
+   _INIT_DCS_CMD(0xB1, 0x2C, 0xED, 0xED, 0x27, 0xE7, 0x42, 0xF5, 0x39, 
0x36, 0x36, 0x36, 0x36, 0x32, 0x8B, 0x11, 0x65, 0x00, 0x88, 0xFA, 0xFF, 0xFF, 
0x8F, 0xFF, 0x08, 0xD6, 0x33),
+   _INIT_DCS_CMD(0xB2, 0x00, 0x47, 0xB0, 0x80, 0x00, 0x12, 0x71, 0x3C, 
0xA3, 0x22, 0x20, 0x00, 0x00, 0x88, 0x01),
+   _INIT_DCS_CMD(0xB4, 0x35, 0x35, 0x43, 0x43, 0x35, 0x35, 0x30, 0x7A, 
0x30, 0x7A, 0x01, 0x9D),
+   _INIT_DCS_CMD(0xB6, 0x34, 0x34, 0x03),
+   _INIT_DCS_CMD(0xE9, 0xCD),
+   _INIT_DCS_CMD(0xBA, 0x84),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xBC, 0x1B, 0x04),
+   _INIT_DCS_CMD(0xBE, 0x20),
+   _INIT_DCS_CMD(0xBF, 0xFC, 0xC4),
+   _INIT_DCS_CMD(0xC0, 0x34, 0x34, 0x22, 0x11, 0x22, 0xA0, 0x31, 0x08, 
0xF5, 0x03),
+   _INIT_DCS_CMD(0xE9, 0xCC),
+   _INIT_DCS_CMD(0xC7, 0x80),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xE9, 0xC6),
+   _INIT_DCS_CMD(0xC8, 0x97),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xC9, 0x00, 0x1E, 0x13, 0x88, 0x01),
+   _INIT_DCS_CMD(0xCB, 0x08, 0x13, 0x07, 0x00, 0x0F, 0x34),
+   _INIT_DCS_CMD(0xCC, 0x02, 0x03, 0x44),
+   _INIT_DCS_CMD(0xE9, 0xC4),
+   _INIT_DCS_CMD(0xD0, 0x03),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xD1, 0x07, 0x06, 0x00, 0x02, 0x04, 0x2C, 0xFF),
+   _INIT_DCS_CMD(0xD3, 0x06, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 
0x08, 0x37, 0x07, 0x64, 0x7C, 0x11, 0x11, 0x03, 0x03, 0x32, 0x10, 0x0E, 0x00, 
0x0E, 0x32, 0x17, 0x97, 0x07, 0x97, 0x32,
+   0x00, 0x02, 0x00, 0x02, 0x00, 0x00),
+   _INIT_DCS_CMD(0xD5, 0x25, 0x24, 0x25, 0x24, 0x18, 0x18, 0x18, 0x18, 
0x07, 0x06, 0x07, 0x06, 0x05, 0x04, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01, 
0x00, 0x01, 0x00, 0xA8, 0xA8, 0xA8, 0xA8, 0x29, 0x29, 0x29, 0x29, 0x21, 0x20, 
0x21, 0x20, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18),
+   _INIT_DCS_CMD(0xD8, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0xAA, 0xAA, 
0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00),
+   _INIT_DCS_CMD(0xE7, 0x07, 0x10, 0x10, 0x1A, 0x26, 0x9E, 0x00, 0x4F, 
0xA0, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0A, 0x02, 0x02, 0x00, 0x33, 
0x02, 0x04, 0x18, 0x01),
+   _INIT_DCS_CMD(0xBD, 0x01),
+   _INIT_DCS_CMD(0xB1, 0x01, 0x7F, 0x11, 0xFD),
+   _INIT_DCS_CMD(0xCB, 0x86),
+   _INIT_DCS_CMD(0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0xAA, 0xAA, 0xAA, 
0xAA, 0xAA, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00),
+   _INIT_DCS_CMD(0xE7, 0x02, 0x00, 0x2B, 0x01, 0x7E, 0x0F, 0x7E, 0x10, 
0xA0, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00),
+   _INIT_DCS_CMD(0xBD, 0x02),
+   _INIT_DCS_CMD(0xBF, 0xF2),
+   _INIT_DCS_CMD(0xCB, 0x03, 0x07, 0x00, 0x10, 0x79),
+   _INIT_DCS_CMD(0xD8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA0, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFA, 0xA0),
+   _INIT_DCS_CMD(0xE7, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0x00, 0x00, 
0x00, 0x23, 0x00, 0x23, 0x81, 0x02, 0x40, 0x00, 0x20, 0x6E, 0x02, 0x01, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
+   _INIT_DCS_CMD(0xBD, 0x03),
+   _INIT_DCS_CMD(0xD8, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0xAA, 0xAA, 
0xAA, 0xAA, 0xAA, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA0, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFA, 0xA0, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0xAA, 0xAA, 0xAA, 0xAA, 
0xAA, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00),
+   _INIT_DCS_CMD(0xE9, 0xC6),
+   _INIT_DCS_CMD(0xB4, 0x03, 0xFF, 0xF8),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xE1, 0x00),
+   _INIT_DCS_CMD(0xBD, 0x00),
+   _INIT_DCS_CMD(0xE9, 0xC4),
+   _INIT_DCS_CMD(0xBA, 0x96),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xBD, 0x01),
+   _INIT_DCS_CMD(0xE9, 0xC5),
+   _INIT_DCS_CMD(0xBA, 0x4F),
+   _INIT_DCS_CMD(0xE9, 0x3F),
+   _INIT_DCS_CMD(0xBD, 0x00),
+   _INIT_DELAY_CMD(50),
+   _INIT_DCS_CMD(0x11),
+   _INIT_DELAY_CMD(110),

[PATCH v1 3/4] dt-bindings: display: panel: Add compatible for IVO t109nw41

2024-04-10 Thread Cong Yang
The IVO t109nw41 is a 11.0" WUXGA TFT LCD panel, which fits in nicely with
the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new compatible
with panel specific config.

Signed-off-by: Cong Yang 
---
 .../devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml 
b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
index 50351dd3d6e5..f15588a2641c 100644
--- a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
+++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
@@ -38,6 +38,8 @@ properties:
   - starry,ili9882t
 # Boe nv110wum-l60 11.0" WUXGA TFT LCD panel
   - boe,nv110wum-l60
+# Ivo t109nw41 11.0" WUXGA TFT LCD panel
+  - ivo,t109nw41
 
   reg:
 description: the virtual channel number of a DSI peripheral
-- 
2.25.1



Re: [PATCH v2 00/25] virtio: store owner from modules with register_virtio_driver()

2024-04-10 Thread Krzysztof Kozlowski
On 31/03/2024 10:43, Krzysztof Kozlowski wrote:
> Changes in v2:
> - Three new patches: virtio mem+input+balloon
> - Minor commit msg adjustments
> - Add tags
> - Link to v1: 
> https://lore.kernel.org/r/20240327-module-owner-virtio-v1-0-0feffab77...@linaro.org
> 
> Merging
> ===
> All further patches depend on the first virtio patch, therefore please ack
> and this should go via one tree: maybe virtio?

Michael, Jason, Xuan,

Will you be able to take the entire patchset through virtio?

Best regards,
Krzysztof




Re: [PATCH] drm: remove unused header gma_drm.h

2024-04-10 Thread Javier Martinez Canillas
Jani Nikula  writes:

> gma_drm.h has become an empty, unused header. Remove.
>
> Cc: Patrik Jakobsson 
> Signed-off-by: Jani Nikula 
> ---

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH 01/11] drm/mediatek: aal: drop driver owner initialization

2024-04-10 Thread Krzysztof Kozlowski
On 01/04/2024 05:44, CK Hu (胡俊光) wrote:
> Hi, Krzysztof:
> 
> On Sat, 2024-03-30 at 21:43 +0100, Krzysztof Kozlowski wrote:
>>   
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>  Core in platform_driver_register() already sets the .owner, so
>> driver
>> does not need to.  Whatever is set here will be anyway overwritten by
>> main driver calling platform_driver_register().
> 
> For the whole series,
> 
> Reviewed-by: CK Hu 

For the tag to work on entire series, you need to provide it to the
cover letter.

Anyway, Philipp,

Everything good here from your side? Will you be able to take everything
to mediatek/drm? I think drm window is slowly closing.

Best regards,
Krzysztof



Re: [PATCH v12 1/9] drm/panic: Add drm panic locking

2024-04-10 Thread Daniel Vetter
On Tue, Apr 09, 2024 at 06:30:40PM +0200, Jocelyn Falempe wrote:
> From: Daniel Vetter 
> 
> Rough sketch for the locking of drm panic printing code. The upshot of
> this approach is that we can pretty much entirely rely on the atomic
> commit flow, with the pair of raw_spin_lock/unlock providing any
> barriers we need, without having to create really big critical
> sections in code.
> 
> This also avoids the need that drivers must explicitly update the
> panic handler state, which they might forget to do, or not do
> consistently, and then we blow up in the worst possible times.
> 
> It is somewhat racy against a concurrent atomic update, and we might
> write into a buffer which the hardware will never display. But there's
> fundamentally no way to avoid that - if we do the panic state update
> explicitly after writing to the hardware, we might instead write to an
> old buffer that the user will barely ever see.
> 
> Note that an rcu protected deference of plane->state would give us the
> the same guarantees, but it has the downside that we then need to
> protect the plane state freeing functions with call_rcu too. Which
> would very widely impact a lot of code and therefore doesn't seem
> worth the complexity compared to a raw spinlock with very tiny
> critical sections. Plus rcu cannot be used to protect access to
> peek/poke registers anyway, so we'd still need it for those cases.
> 
> Peek/poke registers for vram access (or a gart pte reserved just for
> panic code) are also the reason I've gone with a per-device and not
> per-plane spinlock, since usually these things are global for the
> entire display. Going with per-plane locks would mean drivers for such
> hardware would need additional locks, which we don't want, since it
> deviates from the per-console takeoverlocks design.
> 
> Longer term it might be useful if the panic notifiers grow a bit more
> structure than just the absolute bare
> EXPORT_SYMBOL(panic_notifier_list) - somewhat aside, why is that not
> EXPORT_SYMBOL_GPL ... If panic notifiers would be more like console
> drivers with proper register/unregister interfaces we could perhaps
> reuse the very fancy console lock with all it's check and takeover
> semantics that John Ogness is developing to fix the console_lock mess.
> But for the initial cut of a drm panic printing support I don't think
> we need that, because the critical sections are extremely small and
> only happen once per display refresh. So generally just 60 tiny locked
> sections per second, which is nothing compared to a serial console
> running a 115kbaud doing really slow mmio writes for each byte. So for
> now the raw spintrylock in drm panic notifier callback should be good
> enough.
> 
> Another benefit of making panic notifiers more like full blown
> consoles (that are used in panics only) would be that we get the two
> stage design, where first all the safe outputs are used. And then the
> dangerous takeover tricks are deployed (where for display drivers we
> also might try to intercept any in-flight display buffer flips, which
> if we race and misprogram fifos and watermarks can hang the memory
> controller on some hw).
> 
> For context the actual implementation on the drm side is by Jocelyn
> and this patch is meant to be combined with the overall approach in
> v7 (v8 is a bit less flexible, which I think is the wrong direction):
> 
> https://lore.kernel.org/dri-devel/20240104160301.185915-1-jfale...@redhat.com/
> 
> Note that the locking is very much not correct there, hence this
> separate rfc.
> 
> v2:
> - fix authorship, this was all my typing
> - some typo oopsies
> - link to the drm panic work by Jocelyn for context

Please annotate that v10 and later is your work, credit where credit is
due and all that :-)

> v10:
> - Use spinlock_irqsave/restore (John Ogness)
> 
> v11:
> - Use macro instead of inline functions for drm_panic_lock/unlock (John 
> Ogness)
> 
> Signed-off-by: Daniel Vetter 
> Cc: Jocelyn Falempe 
> Cc: Andrew Morton 
> Cc: "Peter Zijlstra (Intel)" 
> Cc: Lukas Wunner 
> Cc: Petr Mladek 
> Cc: Steven Rostedt 
> Cc: John Ogness 
> Cc: Sergey Senozhatsky 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Thomas Zimmermann 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Signed-off-by: Jocelyn Falempe 
> ---
>  drivers/gpu/drm/drm_atomic_helper.c |   4 ++
>  drivers/gpu/drm/drm_drv.c   |   1 +
>  include/drm/drm_mode_config.h   |  10 +++
>  include/drm/drm_panic.h | 100 
>  4 files changed, 115 insertions(+)
>  create mode 100644 include/drm/drm_panic.h
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> b/drivers/gpu/drm/drm_atomic_helper.c
> index 39ef0a6addeb..fb97b51b38f1 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -38,6 +38,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -3016,6 +3017,7 @@ int drm_atomic_helper_swap_state(struc

Re: [PATCH v12 4/9] drm/panic: Add debugfs entry to test without triggering panic.

2024-04-10 Thread Daniel Vetter
On Tue, Apr 09, 2024 at 06:30:43PM +0200, Jocelyn Falempe wrote:
> Add a debugfs file, so you can test drm_panic without freezing
> your machine. This is unsafe, and should be enabled only for
> developer or tester.
> 
> To display the drm_panic screen on the device 0:
> echo 1 > /sys/kernel/debug/dri/0/drm_panic_plane_0
> 
> v9:
>  * Create a debugfs file for each plane in the device's debugfs
>directory. This allows to test for each plane of each GPU
>independently.
> 
> Signed-off-by: Jocelyn Falempe 

I was pondering whether this guarantees that the debugfs file disappears
before drm_dev_unregister finishes (otherwise we have a bit a problem),
and looks like we're good.

Maybe add a todo that it would be nice to simulate nmi context, not sure
lockdept can help here ...

Anyway Reviewed-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/Kconfig |  9 
>  drivers/gpu/drm/drm_panic.c | 43 -
>  2 files changed, 51 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index f8a26423369e..959b19a04101 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -127,6 +127,15 @@ config DRM_PANIC_BACKGROUND_COLOR
>   depends on DRM_PANIC
>   default 0x00
>  
> +config DRM_PANIC_DEBUG
> + bool "Add a debug fs entry to trigger drm_panic"
> + depends on DRM_PANIC && DEBUG_FS
> + help
> +   Add dri/[device]/drm_panic_plane_x in the kernel debugfs, to force the
> +   panic handler to write the panic message to this plane scanout buffer.
> +   This is unsafe and should not be enabled on a production build.
> +   If in doubt, say "N".
> +
>  config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
>  bool "Enable refcount backtrace history in the DP MST helpers"
>   depends on STACKTRACE_SUPPORT
> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
> index e1ec30b6c04a..78fd6d5d7adc 100644
> --- a/drivers/gpu/drm/drm_panic.c
> +++ b/drivers/gpu/drm/drm_panic.c
> @@ -495,6 +495,45 @@ static void drm_panic(struct kmsg_dumper *dumper, enum 
> kmsg_dump_reason reason)
>   draw_panic_plane(plane);
>  }
>  
> +
> +/*
> + * DEBUG FS, This is currently unsafe.
> + * Create one file per plane, so it's possible to debug one plane at a time.
> + */
> +#ifdef CONFIG_DRM_PANIC_DEBUG
> +#include 
> +
> +static ssize_t debugfs_trigger_write(struct file *file, const char __user 
> *user_buf,
> +  size_t count, loff_t *ppos)
> +{
> + bool run;
> +
> + if (kstrtobool_from_user(user_buf, count, &run) == 0 && run) {
> + struct drm_plane *plane = file->private_data;
> +
> + draw_panic_plane(plane);
> + }
> + return count;
> +}
> +
> +static const struct file_operations dbg_drm_panic_ops = {
> + .owner = THIS_MODULE,
> + .write = debugfs_trigger_write,
> + .open = simple_open,
> +};
> +
> +static void debugfs_register_plane(struct drm_plane *plane, int index)
> +{
> + char fname[32];
> +
> + snprintf(fname, 32, "drm_panic_plane_%d", index);
> + debugfs_create_file(fname, 0200, plane->dev->debugfs_root,
> + plane, &dbg_drm_panic_ops);
> +}
> +#else
> +static void debugfs_register_plane(struct drm_plane *plane, int index) {}
> +#endif /* CONFIG_DRM_PANIC_DEBUG */
> +
>  /**
>   * drm_panic_register() - Initialize DRM panic for a device
>   * @dev: the drm device on which the panic screen will be displayed.
> @@ -514,8 +553,10 @@ void drm_panic_register(struct drm_device *dev)
>   plane->kmsg_panic.max_reason = KMSG_DUMP_PANIC;
>   if (kmsg_dump_register(&plane->kmsg_panic))
>   drm_warn(dev, "Failed to register panic handler\n");
> - else
> + else {
> + debugfs_register_plane(plane, registered_plane);
>   registered_plane++;
> + }
>   }
>   if (registered_plane)
>   drm_info(dev, "Registered %d planes with drm panic\n", 
> registered_plane);
> -- 
> 2.44.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


Re: [PATCH v2 00/25] virtio: store owner from modules with register_virtio_driver()

2024-04-10 Thread Michael S. Tsirkin
On Wed, Apr 10, 2024 at 09:41:57AM +0200, Krzysztof Kozlowski wrote:
> On 31/03/2024 10:43, Krzysztof Kozlowski wrote:
> > Changes in v2:
> > - Three new patches: virtio mem+input+balloon
> > - Minor commit msg adjustments
> > - Add tags
> > - Link to v1: 
> > https://lore.kernel.org/r/20240327-module-owner-virtio-v1-0-0feffab77...@linaro.org
> > 
> > Merging
> > ===
> > All further patches depend on the first virtio patch, therefore please ack
> > and this should go via one tree: maybe virtio?
> 
> Michael, Jason, Xuan,
> 
> Will you be able to take the entire patchset through virtio?
> 
> Best regards,
> Krzysztof


Hello!
Yes I intend to take it for the next merge window.
I am also merging the 1st patch for this release (it's a bugfix).

-- 
MST



Re: (subset) [PATCH 00/34] address all -Wunused-const warnings

2024-04-10 Thread Sebastian Reichel


On Wed, 03 Apr 2024 10:06:18 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann 
> 
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
> 
> [...]

Applied, thanks!

[09/34] power: rt9455: hide unused rt9455_boost_voltage_values
commit: 452d8950db3e839aba1bb13bc5378f4bac11fa04

Best regards,
-- 
Sebastian Reichel 




Re: [PATCH v12 2/9] drm/panic: Add a drm panic handler

2024-04-10 Thread Daniel Vetter
On Tue, Apr 09, 2024 at 06:30:41PM +0200, Jocelyn Falempe wrote:
> This module displays a user friendly message when a kernel panic
> occurs. It currently doesn't contain any debug information,
> but that can be added later.
> 
> v2
>  * Use get_scanout_buffer() instead of the drm client API.
>   (Thomas Zimmermann)
>  * Add the panic reason to the panic message (Nerdopolis)
>  * Add an exclamation mark (Nerdopolis)
> 
> v3
>  * Rework the drawing functions, to write the pixels line by line and
>  to use the drm conversion helper to support other formats.
>  (Thomas Zimmermann)
> 
> v4
>  * Use drm_fb_r1_to_32bit for fonts (Thomas Zimmermann)
>  * Remove the default y to DRM_PANIC config option (Thomas Zimmermann)
>  * Add foreground/background color config option
>  * Fix the bottom lines not painted if the framebuffer height
>is not a multiple of the font height.
>  * Automatically register the device to drm_panic, if the function
>get_scanout_buffer exists. (Thomas Zimmermann)
> 
> v5
>  * Change the drawing API, use drm_fb_blit_from_r1() to draw the font.
>  * Also add drm_fb_fill() to fill area with background color.
>  * Add draw_pixel_xy() API for drivers that can't provide a linear buffer.
>  * Add a flush() callback for drivers that needs to synchronize the buffer.
>  * Add a void *private field, so drivers can pass private data to
>draw_pixel_xy() and flush().
> 
> v6
>  * Fix sparse warning for panic_msg and logo.
> 
> v7
>  * Add select DRM_KMS_HELPER for the color conversion functions.
> 
> v8
>  * Register directly each plane to the panic notifier (Sima)
>  * Add raw_spinlock to properly handle concurrency (Sima)
>  * Register plane instead of device, to avoid looping through plane
>list, and simplify code.
>  * Replace get_scanout_buffer() logic with drm_panic_set_buffer()
>   (Thomas Zimmermann)
>  * Removed the draw_pixel_xy() API, will see later if it can be added back.
> 
> v9
>  * Revert to using get_scanout_buffer() (Sima)
>  * Move get_scanout_buffer() and panic_flush() to the plane helper
>functions (Thomas Zimmermann)
>  * Register all planes with get_scanout_buffer() to the panic notifier
>  * Use drm_panic_lock() to protect against race (Sima)
> 
> v10
>  * Move blit and fill functions back in drm_panic (Thomas Zimmermann).
>  * Simplify the text drawing functions.
>  * Use kmsg_dumper instead of panic_notifier (Sima).
> 
> v12
>  * Use array for map and pitch in struct drm_scanout_buffer
>to support multi-planar format later. (Thomas Zimmermann)
>  * Better indent struct drm_scanout_buffer declaration. (Thomas Zimmermann)
> 
> Signed-off-by: Jocelyn Falempe 

Some detail suggestions for the kerneldoc but those aside Acked-by: Daniel
Vetter 
> ---
>  Documentation/gpu/drm-kms.rst|  12 +
>  drivers/gpu/drm/Kconfig  |  23 ++
>  drivers/gpu/drm/Makefile |   1 +
>  drivers/gpu/drm/drm_drv.c|   4 +
>  drivers/gpu/drm/drm_panic.c  | 289 +++
>  include/drm/drm_modeset_helper_vtables.h |  37 +++
>  include/drm/drm_panic.h  |  57 +
>  include/drm/drm_plane.h  |   6 +
>  8 files changed, 429 insertions(+)
>  create mode 100644 drivers/gpu/drm/drm_panic.c
> 
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index 13d3627d8bc0..b64334661aeb 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -398,6 +398,18 @@ Plane Damage Tracking Functions Reference
>  .. kernel-doc:: include/drm/drm_damage_helper.h
> :internal:
>  
> +Plane Panic Feature
> +---
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_panic.c
> +   :doc: overview
> +
> +Plane Panic Functions Reference
> +---
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_panic.c
> +   :export:
> +
>  Display Modes Function Reference
>  
>  
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3914aaf443a8..f8a26423369e 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -104,6 +104,29 @@ config DRM_KMS_HELPER
>   help
> CRTC helpers for KMS drivers.
>  
> +config DRM_PANIC
> + bool "Display a user-friendly message when a kernel panic occurs"
> + depends on DRM && !FRAMEBUFFER_CONSOLE
> + select DRM_KMS_HELPER
> + select FONT_SUPPORT
> + help
> +   Enable a drm panic handler, which will display a user-friendly message
> +   when a kernel panic occurs. It's useful when using a user-space
> +   console instead of fbcon.
> +   It will only work if your graphic driver supports this feature.
> +   To support Hi-DPI Display, you can enable bigger fonts like
> +   FONT_TER16x32
> +
> +config DRM_PANIC_FOREGROUND_COLOR
> + hex "Drm panic screen foreground color, in RGB"
> + depends on DRM_PANIC
> + default 0xff
> +
> +config DRM_PANIC_BACKGROUND_COLOR
> + hex

Re: [PATCH v12 0/9] drm/panic: Add a drm panic handler

2024-04-10 Thread Daniel Vetter
On Tue, Apr 09, 2024 at 06:30:39PM +0200, Jocelyn Falempe wrote:
> drm/panic: Add a drm panic handler
> 
> This introduces a new drm panic handler, which displays a message when a 
> panic occurs.
> So when fbcon is disabled, you can still see a kernel panic.
> 
> This is one of the missing feature, when disabling VT/fbcon in the kernel:
> https://www.reddit.com/r/linux/comments/10eccv9/config_vtn_in_2023/
> Fbcon can be replaced by a userspace kms console, but the panic screen must 
> be done in the kernel.
> 
> It works with simpledrm, mgag200, ast, and imx.
> 
> To test it, make sure you're using one of the supported driver, and trigger a 
> panic:
> echo c > /proc/sysrq-trigger
> 
> or you can enable CONFIG_DRM_PANIC_DEBUG and echo 1 > 
> /sys/kernel/debug/dri/0/drm_panic_plane_0
> 
> Even if this is not yet useful, it will allows to work on more driver 
> support, and better debug information to be added.
> 
> v2:
>  * Use get_scanout_buffer() instead of the drm client API. (Thomas Zimmermann)
>  * Add the panic reason to the panic message (Nerdopolis)
>  * Add an exclamation mark (Nerdopolis)
>  
> v3:
>  * Rework the drawing functions, to write the pixels line by line and
>  to use the drm conversion helper to support other formats.
>  (Thomas Zimmermann)
>  
> v4:
>  * Fully support all simpledrm formats using drm conversion helpers
>  * Rename dpanic_* to drm_panic_*, and have more coherent function name.
>(Thomas Zimmermann)
>  * Use drm_fb_r1_to_32bit for fonts (Thomas Zimmermann)
>  * Remove the default y to DRM_PANIC config option (Thomas Zimmermann)
>  * Add foreground/background color config option
>  * Fix the bottom lines not painted if the framebuffer height
>is not a multiple of the font height.
>  * Automatically register the driver to drm_panic, if the function
>get_scanout_buffer() exists. (Thomas Zimmermann)
>  * Add mgag200 support.
>  
> v5:
>  * Change the drawing API, use drm_fb_blit_from_r1() to draw the font.
>(Thomas Zimmermann)
>  * Also add drm_fb_fill() to fill area with background color.
>  * Add draw_pixel_xy() API for drivers that can't provide a linear buffer.
>  * Add a flush() callback for drivers that needs to synchronize the buffer.
>  * Add a void *private field, so drivers can pass private data to
>draw_pixel_xy() and flush(). 
>  * Add ast support.
>  * Add experimental imx/ipuv3 support, to test on an ARM hw. (Maxime Ripard)
> 
> v6:
>  * Fix sparse and __le32 warnings
>  * Drop the IMX/IPUV3 experiment, it was just to show that it works also on
>ARM devices.
> 
> v7:
>  * Add a check to see if the 4cc format is supported by drm_panic.
>  * Add a drm/plane helper to loop over all visible primary buffer,
>simplifying the get_scanout_buffer implementations
>  * Add a generic implementation for drivers that uses drm_fb_dma. (Maxime 
> Ripard)
>  * Add back the IMX/IPUV3 support, and use the generic implementation. 
> (Maxime Ripard)
> 
> v8:
>  * Directly register each plane to the panic notifier (Sima)
>  * Replace get_scanout_buffer() with set_scanout_buffer() to simplify
>the locking. (Thomas Zimmermann)
>  * Add a debugfs entry, to trigger the drm_panic without a real panic (Sima)
>  * Fix the drm_panic Documentation, and include it in drm-kms.rst
> 
> v9:
>  * Revert to using get_scanout_buffer() (Sima)
>  * Move get_scanout_buffer() and panic_flush() to the plane helper
>functions (Thomas Zimmermann)
>  * Register all planes with get_scanout_buffer() to the panic notifier
>  * Use drm_panic_lock() to protect against race (Sima)
>  * Create a debugfs file for each plane in the device's debugfs
>directory. This allows to test for each plane of each GPU
>independently.
> v10:
>  * Move blit and fill functions back in drm_panic (Thomas Zimmermann).
>  * Simplify the text drawing functions.
>  * Use kmsg_dumper instead of panic_notifier (Sima).
>  * Use spinlock_irqsave/restore (John Ogness)
> 
> v11:
>  * Use macro instead of inline functions for drm_panic_lock/unlock (John 
> Ogness)
> 
> v12:
>  * Use array for map and pitch in struct drm_scanout_buffer
>to support multi-planar format later. (Thomas Zimmermann)
>  * Rename drm_panic_gem_get_scanout_buffer to drm_fb_dma_get_scanout_buffer
>and build it unconditionally (Thomas Zimmermann)
>  * Better indent struct drm_scanout_buffer declaration. (Thomas Zimmermann)

On the series: Acked-by: Daniel Vetter 

And apologies for the detours this patch set took and my part in the (too
many) revisions. I think we should land this and do anything more once
it's merged and we extend the panic support to more drivers.

Thanks a lot to you for seeing this through!

Cheers, Sima
> 
> 
> Best regards,
> 
> 
> Daniel Vetter (1):
>   drm/panic: Add drm panic locking
> 
> Jocelyn Falempe (8):
>   drm/panic: Add a drm panic handler
>   drm/panic: Add support for color format conversion
>   drm/panic: Add debugfs entry to test without triggering panic.
>   drm/fb_dma: Add generic

Re: [PATCH v11 2/9] drm/panic: Add a drm panic handler

2024-04-10 Thread Thomas Zimmermann

Hi

Am 09.04.24 um 16:11 schrieb Jocelyn Falempe:

Hi,

On 09/04/2024 10:30, Thomas Zimmermann wrote:

Hi

Am 28.03.24 um 13:03 schrieb Jocelyn Falempe:

+/**
+ * struct drm_scanout_buffer - DRM scanout buffer
+ *
+ * This structure holds the information necessary for drm_panic to 
draw the

+ * panic screen, and display it.
+ */
+struct drm_scanout_buffer {
+    /**
+ * @format:
+ *
+ * drm format of the scanout buffer.
+ */
+    const struct drm_format_info *format;


Newline here and among the other fields please.


Done in v12.



+    /**
+ * @map:
+ *
+ * Virtual address of the scanout buffer, either in memory or 
iomem.
+ * The scanout buffer should be in linear format, and can be 
directly
+ * sent to the display hardware. Tearing is not an issue for 
the panic

+ * screen.
+ */
+    struct iosys_map map;


I would make this an array of DRM_FORMAT_MAX_PLANES. Its 
functionality is then equivalent to the fields in struct 
drm_framebuffer. Supporting multiple color planes is the general 
expectation in the DRM code, even if not all parts actually implement 
it. In the panic code, you simply test that the scan-out format has 
only a single plane.


   struct iosys_map map[DRM_FORMAT_MAX_PLANES]


Sure, that was on my todo list, done in v12.



+    /**
+ * @width: Width of the scanout buffer, in pixels.
+ */
+    unsigned int width;
+    /**
+ * @height: Height of the scanout buffer, in pixels.
+ */
+    unsigned int height;
+    /**
+ * @pitch: Length in bytes between the start of two consecutive 
lines.

+ */
+    unsigned int pitch;


Also use an array of DRM_FORMAT_MAX_PLANES.


+};


This data structure looks like something I could use for the 
shadow-plane helpers. Expect it to be moved elsewhere at some point.


Yes, this can even be part of the struct drm_framebuffer.


Please not. These are two separate things (even though they look very 
similar).


Best regards
Thomas



Best regards
Thomas




Thanks for the reviews,



--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



Re: [PATCH 01/11] drm/mediatek: aal: drop driver owner initialization

2024-04-10 Thread 胡俊光


[PATCH RESEND] drm: use capital "OR" for multiple licenses in SPDX

2024-04-10 Thread Krzysztof Kozlowski
Documentation/process/license-rules.rst expects the SPDX identifier
syntax for multiple licenses to use capital "OR".  Correct it to keep
consistent format and avoid copy-paste issues.

Signed-off-by: Krzysztof Kozlowski 

---

Resend...

Cc: Dmitry Baryshkov 
Cc: Neil Armstrong 
---
 drivers/gpu/drm/drm_client.c| 2 +-
 drivers/gpu/drm/drm_format_helper.c | 2 +-
 include/drm/drm_client.h| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
index 77fe217aeaf3..d8e3427ae205 100644
--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0 or MIT
+// SPDX-License-Identifier: GPL-2.0 OR MIT
 /*
  * Copyright 2018 Noralf Trønnes
  */
diff --git a/drivers/gpu/drm/drm_format_helper.c 
b/drivers/gpu/drm/drm_format_helper.c
index b1be458ed4dd..2348135fb6c0 100644
--- a/drivers/gpu/drm/drm_format_helper.c
+++ b/drivers/gpu/drm/drm_format_helper.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0 or MIT
+// SPDX-License-Identifier: GPL-2.0 OR MIT
 /*
  * Copyright (C) 2016 Noralf Trønnes
  *
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index bc0e66f9c425..1b907709115e 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 or MIT */
+/* SPDX-License-Identifier: GPL-2.0 OR MIT */
 
 #ifndef _DRM_CLIENT_H_
 #define _DRM_CLIENT_H_
-- 
2.34.1



[PATCH RESEND] drm/armada: drop unneeded MODULE_ALIAS

2024-04-10 Thread Krzysztof Kozlowski
The MODULE_DEVICE_TABLE already creates proper alias for platform
driver.  Having another MODULE_ALIAS causes the alias to be duplicated.

Signed-off-by: Krzysztof Kozlowski 

---

Resent third time
https://lore.kernel.org/all/20220407202443.23000-1-krzysztof.kozlow...@linaro.org/

Cc: Dmitry Baryshkov 
Cc: Neil Armstrong 
---
 drivers/gpu/drm/armada/armada_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index e51ecc4f7ef4..f48e2cf8de43 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -283,4 +283,3 @@ module_exit(armada_drm_exit);
 MODULE_AUTHOR("Russell King ");
 MODULE_DESCRIPTION("Armada DRM Driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:armada-drm");
-- 
2.34.1



Re: [PATCH v1 1/4] dt-bindings: display: panel: Add compatible for BOE nv110wum-l60

2024-04-10 Thread Krzysztof Kozlowski
On 10/04/2024 09:14, Cong Yang wrote:
> The BOE nv110wum-l60 is a 11.0" WUXGA TFT LCD panel, which fits in nicely
> with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new
> compatible with panel specific config.
> 
> Signed-off-by: Cong Yang 
> ---
>  .../devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml 
> b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> index 906ef62709b8..50351dd3d6e5 100644
> --- a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> @@ -36,6 +36,8 @@ properties:
>- starry,himax83102-j02
>  # STARRY ili9882t 10.51" WUXGA TFT LCD panel
>- starry,ili9882t
> +# Boe nv110wum-l60 11.0" WUXGA TFT LCD panel
> +  - boe,nv110wum-l60

Isn't the list ordered?

Best regards,
Krzysztof



Re: [PATCH v1 3/4] dt-bindings: display: panel: Add compatible for IVO t109nw41

2024-04-10 Thread Krzysztof Kozlowski
On 10/04/2024 09:14, Cong Yang wrote:
> The IVO t109nw41 is a 11.0" WUXGA TFT LCD panel, which fits in nicely with
> the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new compatible
> with panel specific config.
> 
> Signed-off-by: Cong Yang 
> ---
>  .../devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml 
> b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> index 50351dd3d6e5..f15588a2641c 100644
> --- a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> @@ -38,6 +38,8 @@ properties:
>- starry,ili9882t
>  # Boe nv110wum-l60 11.0" WUXGA TFT LCD panel
>- boe,nv110wum-l60
> +# Ivo t109nw41 11.0" WUXGA TFT LCD panel
> +  - ivo,t109nw41
>  

Same problem...

Best regards,
Krzysztof



[PATCH 0/1] fbdev: Handle HAS_IOPORT dependencies

2024-04-10 Thread Niklas Schnelle
Hi Helge,

This is a follow up in my ongoing effort of making inb()/outb() and
similar I/O port accessors compile-time optional. Previously I sent this
as a treewide series titled "treewide: Remove I/O port accessors for
HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant
subset of patches merged I've changed over to per-subsystem series. These
series are stand alone and should be merged via the relevant tree such
that with all subsystems complete we can follow this up with the final
patch that will make the I/O port accessors compile-time optional.

The current state of the full series with changes to the remaining subsystems
and the aforementioned final patch can be found for your convenience on my
git.kernel.org tree in the has_ioport branch[1]. As for compile-time vs runtime
see Linus' reply to my first attempt[2].

Thanks,
Niklas

[0] https://lore.kernel.org/all/20230522105049.1467313-1-schne...@linux.ibm.com/
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=has_ioport
[2] 
https://lore.kernel.org/lkml/CAHk-=wg80je=k7madf4e7wrrnp37e3qh6y10svhdc7o8sz_...@mail.gmail.com/

Niklas Schnelle (1):
  fbdev: add HAS_IOPORT dependencies

 drivers/video/fbdev/Kconfig | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

-- 
2.40.1



[PATCH 1/1] fbdev: add HAS_IOPORT dependencies

2024-04-10 Thread Niklas Schnelle
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at
compile time. We thus need to add HAS_IOPORT as dependency for those
drivers using them.

Co-developed-by: Arnd Bergmann 
Signed-off-by: Arnd Bergmann 
Signed-off-by: Niklas Schnelle 
---
Note: This patch does not depend any not-yet-mainline HAS_IOPORT changes
and may be merged via subsystem specific trees at your earliest
convenience.

 drivers/video/fbdev/Kconfig | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 197b6d5268e9..f90b191dc68b 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -157,7 +157,7 @@ config FB_IMX
 
 config FB_CYBER2000
tristate "CyberPro 2000/2010/5000 support"
-   depends on FB && PCI && (BROKEN || !SPARC64)
+   depends on FB && PCI && HAS_IOPORT && (BROKEN || !SPARC64)
select FB_IOMEM_HELPERS
help
  This enables support for the Integraphics CyberPro 20x0 and 5000
@@ -1046,7 +1046,7 @@ config FB_ATY_BACKLIGHT
 
 config FB_S3
tristate "S3 Trio/Virge support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1107,7 +1107,7 @@ config FB_SAVAGE_ACCEL
 
 config FB_SIS
tristate "SiS/XGI display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select BOOT_VESA_SUPPORT if FB_SIS = y
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -1138,7 +1138,7 @@ config FB_SIS_315
 
 config FB_VIA
tristate "VIA UniChrome (Pro) and Chrome9 display support"
-   depends on FB && PCI && GPIOLIB && I2C && (X86 || COMPILE_TEST)
+   depends on FB && PCI && GPIOLIB && I2C && HAS_IOPORT && (X86 || 
COMPILE_TEST)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1177,7 +1177,7 @@ endif
 
 config FB_NEOMAGIC
tristate "NeoMagic display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1204,7 +1204,7 @@ config FB_KYRO
 
 config FB_3DFX
tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1252,7 +1252,7 @@ config FB_VOODOO1
 
 config FB_VT8623
tristate "VIA VT8623 support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1267,7 +1267,7 @@ config FB_VT8623
 
 config FB_TRIDENT
tristate "Trident/CyberXXX/CyberBlade support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1290,7 +1290,7 @@ config FB_TRIDENT
 
 config FB_ARK
tristate "ARK 2000PV support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1814,7 +1814,7 @@ config FB_SSD1307
 
 config FB_SM712
tristate "Silicon Motion SM712 framebuffer support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_IOMEM_HELPERS
help
  Frame buffer driver for the Silicon Motion SM710, SM712, SM721
-- 
2.40.1



Re: [PATCH 4/4] gpu: ipu-v3: Convert to platform remove callback returning void

2024-04-10 Thread Philipp Zabel
On Di, 2024-04-09 at 19:02 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> 
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> Trivially convert the ipu-v3 platform drivers from always returning zero
> in the remove callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König 

Reviewed-by: Philipp Zabel 

regards
Philipp


Re: [PATCH net-next v8 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool

2024-04-10 Thread Julien Panis

On 4/10/24 02:39, Jakub Kicinski wrote:

On Mon, 08 Apr 2024 11:38:03 +0200 Julien Panis wrote:

goto gen_pool_create_fail;
}
  
+	pool->desc_infos = kcalloc(pool->num_desc,

+  sizeof(*pool->desc_infos), GFP_KERNEL);
+   if (!pool->desc_infos) {
+   ret = -ENOMEM;
+   dev_err(pool->dev,
+   "pool descriptor infos alloc failed %d\n", ret);

Please don't add errors on mem alloc failures. They just bloat the
kernel, there will be a rather large OOM splat in the logs if GFP_KERNEL
allocation fails.


+   kfree_const(pool_name);
+   goto gen_pool_desc_infos_alloc_fail;
+   }
+
pool->gen_pool->name = pool_name;

If you add the new allocation after this line, I think you wouldn't
have to free pool_name under the if () explicitly.


Hello Jakub,

Thanks for these suggestions, I'll implement them in next version.

Also, about mem alloc failures, shouldn't we free 'pool' on kstrdup_const()
error at the beginning of k3_cppi_desc_pool_create_name() ?
I mean, it's not visible in my patch but I now wonder if this was done
properly even before I modify the file.

Currently, we have:
    pool_name = kstrdup_const(...)
    if (!pool_name)
    return ERR_PTR(ret);

Shouldnt we have instead:
    pool_name = kstrdup_const(...)
    if (!pool_name)
    goto gen_pool_create_fail;
(maybe label to be renamed)
...so that 'pool' can be freed before returning error.

Julien


Re: [PATCH 1/1] fbdev: add HAS_IOPORT dependencies

2024-04-10 Thread Niklas Schnelle
On Wed, 2024-04-10 at 10:27 +0200, Niklas Schnelle wrote:
> In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at
> compile time. We thus need to add HAS_IOPORT as dependency for those
> drivers using them.
> 
> Co-developed-by: Arnd Bergmann 
> Signed-off-by: Arnd Bergmann 
> Signed-off-by: Niklas Schnelle 
> ---
> Note: This patch does not depend any not-yet-mainline HAS_IOPORT changes
> and may be merged via subsystem specific trees at your earliest
> convenience.
> 
>  drivers/video/fbdev/Kconfig | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)

Sorry, I just noticed that one of the fbdev Kconfig changes slipped
into my patch for video. This one is missing the below hunk and I'll
send a v2.

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index f90b191dc68b..76bbfd3767da 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -245,7 +245,7 @@ config FB_FM2
 
 config FB_ARC
tristate "Arc Monochrome LCD board support"
-   depends on FB && (X86 || COMPILE_TEST)
+   depends on FB && HAS_IOPORT && (X86 || COMPILE_TEST)
select FB_SYSMEM_HELPERS_DEFERRED
help
  This enables support for the Arc Monochrome LCD board. The board





Re: (subset) [PATCH v12 0/7] drm/meson: add support for MIPI DSI Display

2024-04-10 Thread Jerome Brunet
Applied to clk-meson (v6.10/drivers), thanks!

[2/7] clk: meson: add vclk driver
  https://github.com/BayLibre/clk-meson/commit/bb5aa08572b5
[3/7] clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF
  https://github.com/BayLibre/clk-meson/commit/b70cb1a21a54

Best regards,
--
Jerome



Re: (subset) [PATCH v12 0/7] drm/meson: add support for MIPI DSI Display

2024-04-10 Thread Neil Armstrong
Hi,

On Wed, 03 Apr 2024 09:46:31 +0200, Neil Armstrong wrote:
> The Amlogic G12A, G12B & SM1 SoCs embeds a Synopsys DW-MIPI-DSI transceiver 
> (ver 1.21a),
> with a custom glue managing the IP resets, clock and data input similar to 
> the DW-HDMI
> glue on the same Amlogic SoCs.
> 
> This is a follow-up of v5 now the DRM patches are applied, the clk & DT 
> changes
> remains for a full DSI support on G12A & SM1 platforms.
> 
> [...]

Thanks, Applied to 
https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git 
(v6.10/arm64-dt)

[1/7] dt-bindings: arm: amlogic: Document the MNT Reform 2 CM4 adapter with a 
BPI-CM4 Module
  https://git.kernel.org/amlogic/c/ef5a84d716042871599ff7c8ff571a6390b99718
[5/7] arm64: meson: g12-common: add the MIPI DSI nodes
  https://git.kernel.org/amlogic/c/6f1c2a12ed1138c3e680935718672d361afee372
[6/7] arm64: meson: khadas-vim3l: add TS050 DSI panel overlay
  https://git.kernel.org/amlogic/c/2a885bad5ba4d553758d3f1689000cee8e6dae87
[7/7] arm64: dts: amlogic: meson-g12b-bananapi-cm4: add support for MNT Reform2 
with CM4 adaper
  https://git.kernel.org/amlogic/c/fde2d69c1626bebb3a8851909c912e582db1ca95

These changes has been applied on the intermediate git tree [1].

The v6.10/arm64-dt branch will then be sent via a formal Pull Request to the 
Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus 
during
the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by 
revert
patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

-- 
Neil



Re: [PATCH v11 0/7] drm/meson: add support for MIPI DSI Display

2024-04-10 Thread Neil Armstrong
Hi,

On Mon, 25 Mar 2024 12:09:46 +0100, Neil Armstrong wrote:
> The Amlogic G12A, G12B & SM1 SoCs embeds a Synopsys DW-MIPI-DSI transceiver 
> (ver 1.21a),
> with a custom glue managing the IP resets, clock and data input similar to 
> the DW-HDMI
> glue on the same Amlogic SoCs.
> 
> This is a follow-up of v5  now the DRM patches are applied, the clk & DT 
> changes
> remains for a full DSI support on G12A & SM1 platforms.
> 
> [...]

Thanks, Applied to 
https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git 
(v6.10/arm64-dt)

[1/7] dt-bindings: arm: amlogic: Document the MNT Reform 2 CM4 adapter with a 
BPI-CM4 Module
  https://git.kernel.org/amlogic/c/ef5a84d716042871599ff7c8ff571a6390b99718
[2/7] clk: meson: add vclk driver
  (no commit info)
[3/7] clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF
  (no commit info)
[4/7] drm/meson: gate px_clk when setting rate
  (no commit info)
[5/7] arm64: meson: g12-common: add the MIPI DSI nodes
  https://git.kernel.org/amlogic/c/6f1c2a12ed1138c3e680935718672d361afee372
[6/7] arm64: meson: khadas-vim3l: add TS050 DSI panel overlay
  https://git.kernel.org/amlogic/c/2a885bad5ba4d553758d3f1689000cee8e6dae87
[7/7] arm64: dts: amlogic: meson-g12b-bananapi-cm4: add support for MNT Reform2 
with CM4 adaper
  https://git.kernel.org/amlogic/c/fde2d69c1626bebb3a8851909c912e582db1ca95

These changes has been applied on the intermediate git tree [1].

The v6.10/arm64-dt branch will then be sent via a formal Pull Request to the 
Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus 
during
the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by 
revert
patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

-- 
Neil



Re: [PATCH] drm: remove unused header gma_drm.h

2024-04-10 Thread Jani Nikula
On Wed, 10 Apr 2024, Javier Martinez Canillas  wrote:
> Jani Nikula  writes:
>
>> gma_drm.h has become an empty, unused header. Remove.
>>
>> Cc: Patrik Jakobsson 
>> Signed-off-by: Jani Nikula 
>> ---
>
> Reviewed-by: Javier Martinez Canillas 

Thanks, pushed to drm-misc-next.

BR,
Jani.

-- 
Jani Nikula, Intel


Re: [PATCH 12/21] drm/tilcdc: Allow build without __iowmb()

2024-04-10 Thread Tomi Valkeinen

On 08/04/2024 20:04, Ville Syrjala wrote:

From: Ville Syrjälä 

__iowmb() isn't available on most architectures. Make
its use optional so that the driver can be built on
other architectures with COMPILE_TEST=y.

Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
Signed-off-by: Ville Syrjälä 
---
  drivers/gpu/drm/tilcdc/tilcdc_regs.h | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h 
b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
index f90e2dc3457c..44e4ada30fba 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
@@ -125,7 +125,9 @@ static inline void tilcdc_write64(struct drm_device *dev, 
u32 reg, u64 data)
  #if defined(iowrite64) && !defined(iowrite64_is_nonatomic)
iowrite64(data, addr);
  #else
+#ifdef __iowmb
__iowmb();
+#endif
/* This compiles to strd (=64-bit write) on ARM7 */
*(volatile u64 __force *)addr = __cpu_to_le64(data);
  #endif


As the memory barrier is an important part there, would it be better to 
ifdef based on COMPILE_TEST, to make it clear why it's being done?


 Tomi



Re: [PATCH 13/21] drm/tilcdc: Allow build with COMPILE_TEST=y

2024-04-10 Thread Tomi Valkeinen

On 08/04/2024 20:04, Ville Syrjala wrote:

From: Ville Syrjälä 

Allow tilcdc to be built with COMPILE_TEST=y for greater
coverage. Builds fine on x86/x86_64 at least.

Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
Signed-off-by: Ville Syrjälä 
---
  drivers/gpu/drm/tilcdc/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig
index d3bd2d7a181e..1897ef91c70b 100644
--- a/drivers/gpu/drm/tilcdc/Kconfig
+++ b/drivers/gpu/drm/tilcdc/Kconfig
@@ -1,7 +1,7 @@
  # SPDX-License-Identifier: GPL-2.0-only
  config DRM_TILCDC
tristate "DRM Support for TI LCDC Display Controller"
-   depends on DRM && OF && ARM
+   depends on DRM && OF && (ARM || COMPILE_TEST)
select DRM_KMS_HELPER
select DRM_GEM_DMA_HELPER
select DRM_BRIDGE


Reviewed-by: Tomi Valkeinen 

 Tomi



Re: [PATCH RESEND] drm: use capital "OR" for multiple licenses in SPDX

2024-04-10 Thread Neil Armstrong

On 10/04/2024 10:22, Krzysztof Kozlowski wrote:

Documentation/process/license-rules.rst expects the SPDX identifier
syntax for multiple licenses to use capital "OR".  Correct it to keep
consistent format and avoid copy-paste issues.

Signed-off-by: Krzysztof Kozlowski 

---

Resend...

Cc: Dmitry Baryshkov 
Cc: Neil Armstrong 
---
  drivers/gpu/drm/drm_client.c| 2 +-
  drivers/gpu/drm/drm_format_helper.c | 2 +-
  include/drm/drm_client.h| 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
index 77fe217aeaf3..d8e3427ae205 100644
--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0 or MIT
+// SPDX-License-Identifier: GPL-2.0 OR MIT
  /*
   * Copyright 2018 Noralf Trønnes
   */
diff --git a/drivers/gpu/drm/drm_format_helper.c 
b/drivers/gpu/drm/drm_format_helper.c
index b1be458ed4dd..2348135fb6c0 100644
--- a/drivers/gpu/drm/drm_format_helper.c
+++ b/drivers/gpu/drm/drm_format_helper.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0 or MIT
+// SPDX-License-Identifier: GPL-2.0 OR MIT
  /*
   * Copyright (C) 2016 Noralf Trønnes
   *
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index bc0e66f9c425..1b907709115e 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 or MIT */
+/* SPDX-License-Identifier: GPL-2.0 OR MIT */
  
  #ifndef _DRM_CLIENT_H_

  #define _DRM_CLIENT_H_


Reviewed-by: Neil Armstrong 

I think we'll need maxime or thomas ack to apply this via drm-misc-next

Neil


Re: [PATCH 14/21] drm/omap: Open code phys_to_page()

2024-04-10 Thread Tomi Valkeinen

On 08/04/2024 20:04, Ville Syrjala wrote:

From: Ville Syrjälä 

phys_to_page() is not available on most architectures.
Just open code it like msm does. Allows COMPILE_TEST=y
builds of omapdrm on other architectures.

Cc: Tomi Valkeinen 
Signed-off-by: Ville Syrjälä 
---
  drivers/gpu/drm/omapdrm/omap_gem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c 
b/drivers/gpu/drm/omapdrm/omap_gem.c
index 3421e8389222..c4454e7f1c94 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1022,8 +1022,8 @@ struct sg_table *omap_gem_get_sg(struct drm_gem_object 
*obj,
  
  	if (addr) {

for_each_sg(sgt->sgl, sg, count, i) {
-   sg_set_page(sg, phys_to_page(addr), len,
-   offset_in_page(addr));
+   sg_set_page(sg, pfn_to_page(__phys_to_pfn(addr)),
+   len, offset_in_page(addr));
sg_dma_address(sg) = addr;
sg_dma_len(sg) = len;
  


Reviewed-by: Tomi Valkeinen 

 Tomi



Re: [PATCH 15/21] drm/omap: Allow build with COMPILE_TEST=y

2024-04-10 Thread Tomi Valkeinen

On 08/04/2024 20:04, Ville Syrjala wrote:

From: Ville Syrjälä 

Allow omapdrm to be built with COMPILE_TEST=y for greater
coverage.

FIXME: Still borked due to ?

Cc: Tomi Valkeinen 
Signed-off-by: Ville Syrjälä 
---
  drivers/gpu/drm/omapdrm/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index 6c49270cb290..85ed92042b74 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -2,7 +2,7 @@
  config DRM_OMAP
tristate "OMAP DRM"
depends on DRM && OF
-   depends on ARCH_OMAP2PLUS
+   depends on ARCH_OMAP2PLUS || COMPILE_TEST
select DRM_KMS_HELPER
select FB_DMAMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
select VIDEOMODE_HELPERS


Reviewed-by: Tomi Valkeinen 

 Tomi



Re: [PATCH v1 1/4] dt-bindings: display: panel: Add compatible for BOE nv110wum-l60

2024-04-10 Thread cong yang
Hi,

Krzysztof Kozlowski  于2024年4月10日周三 16:24写道:
>
> On 10/04/2024 09:14, Cong Yang wrote:
> > The BOE nv110wum-l60 is a 11.0" WUXGA TFT LCD panel, which fits in nicely
> > with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new
> > compatible with panel specific config.
> >
> > Signed-off-by: Cong Yang 
> > ---
> >  .../devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git 
> > a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml 
> > b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> > index 906ef62709b8..50351dd3d6e5 100644
> > --- a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> > +++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.yaml
> > @@ -36,6 +36,8 @@ properties:
> >- starry,himax83102-j02
> >  # STARRY ili9882t 10.51" WUXGA TFT LCD panel
> >- starry,ili9882t
> > +# Boe nv110wum-l60 11.0" WUXGA TFT LCD panel
> > +  - boe,nv110wum-l60
>
> Isn't the list ordered?

Sorry, will be fix in V2 patch . Thanks.
>
> Best regards,
> Krzysztof
>


Re: [PATCH v3 01/18] ASoC: dt-bindings: mediatek,mt8365-afe: Add audio afe document

2024-04-10 Thread Alexandre Mergnat




On 09/04/2024 17:46, Krzysztof Kozlowski wrote:

+soc {
+#address-cells = <2>;
+#size-cells = <2>;
+
+afe@1122 {

Did you implement the comment or decided to keep afe?



Though it was clear according to [1]:
"
Audio Front End, this is the same name used for other MTK SoC, to be
consistent.

Cook a new patch serie to change "afe" by "audio-controller" for all MTK
SoC would be great.
"

I want to keep it and fix it later with ALL other MTK SoC.
You didn't answer after that, I though it was ok for you...
So if you don't agree with that, just tell me to change it instead of 
let me think I've the choice.




BTW, whatever "consistency" you have in mind, it does not really matter
that much for that example. And for sure do not add incorrect code
intentionally just to fix it in next patch.


I don't get your point.
What do you mean by "do not add incorrect code intentionally" please ???


My PoV: I implement my bindings aligned to ALL other MTK SoC, which have 
been validated by you in the past. I can understand the copied code is 
wrong, but I've suggested a solution and you didn't NACK it.


I fell like you bully me. Are you ok to stop insinuating bad things 
please and tell me directly if a fix is mandatory and if you are waiting 
for a specific one, tell me directly to avoid this kind of unpleasant 
talk and waste of time, I know maintainers are busy persons.


Beside that, thanks for your reviews.

[1]: 
https://lore.kernel.org/all/eeb3329b-0558-4237-8343-4e11f65a6...@baylibre.com/


--
Regards,
Alexandre


[PATCH 00/10] drm: move Intel drm headers to a subdirectory

2024-04-10 Thread Jani Nikula
We've accumulated enough Intel specific header files under include/drm
that they warrant a subdirectory of their own. Clean up the top drm
header directory by moving the Intel files under include/drm/intel.

Since i915 is most impacted, I suggest merging the lot via
drm-intel-next. Please ack if this is fine for you.

BR,
Jani.


Cc: Bjorn Helgaas 
Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Hans de Goede 
Cc: Ilpo Järvinen 
Cc: Jaroslav Kysela 
Cc: Lucas De Marchi 
Cc: Takashi Iwai 
Cc: Tomas Winkler 

Jani Nikula (10):
  drm/i915: use system include for drm headers
  drm: move intel-gtt.h under include/drm/intel
  drm: move i915_gsc_proxy_mei_interface.h under include/drm/intel
  drm: move i915_component.h under include/drm/intel
  drm: move intel_lpe_audio.h under include/drm/intel
  drm: move i915_drm.h under include/drm/intel
  drm: move i915_pxp_tee_interface.h under include/drm/intel
  drm: move i915_pciids.h under include/drm/intel
  drm: move xe_pciids.h under include/drm/intel
  drm: move i915_hdcp_interface.h under include/drm/intel

 arch/x86/kernel/early-quirks.c | 4 ++--
 drivers/char/agp/intel-agp.c   | 2 +-
 drivers/char/agp/intel-gtt.c   | 2 +-
 drivers/gpu/drm/i915/display/intel_audio.c | 2 +-
 drivers/gpu/drm/i915/display/intel_display_device.c| 2 +-
 drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_lpe_audio.c | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c   | 4 ++--
 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c  | 2 +-
 drivers/gpu/drm/i915/gt/intel_gt.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_rps.c| 2 +-
 drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c   | 4 ++--
 drivers/gpu/drm/i915/i915_pci.c| 2 +-
 drivers/gpu/drm/i915/intel_device_info.c   | 2 +-
 drivers/gpu/drm/i915/pxp/intel_pxp_tee.c   | 4 ++--
 drivers/gpu/drm/i915/soc/intel_gmch.c  | 2 +-
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c   | 2 +-
 drivers/gpu/drm/xe/xe_ggtt.c   | 2 +-
 drivers/gpu/drm/xe/xe_gsc_proxy.c  | 4 ++--
 drivers/gpu/drm/xe/xe_pci.c| 2 +-
 drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c | 4 ++--
 drivers/misc/mei/hdcp/mei_hdcp.c   | 4 ++--
 drivers/misc/mei/pxp/mei_pxp.c | 4 ++--
 drivers/platform/x86/intel_ips.c   | 2 +-
 include/drm/{ => intel}/i915_component.h   | 2 +-
 include/drm/{ => intel}/i915_drm.h | 0
 include/drm/{ => intel}/i915_gsc_proxy_mei_interface.h | 0
 include/drm/{ => intel}/i915_hdcp_interface.h  | 0
 include/drm/{ => intel}/i915_pciids.h  | 0
 include/drm/{ => intel}/i915_pxp_tee_interface.h   | 0
 include/drm/{ => intel}/intel-gtt.h| 0
 include/drm/{ => intel}/intel_lpe_audio.h  | 0
 include/drm/{ => intel}/xe_pciids.h| 0
 include/sound/hdaudio.h| 2 +-
 sound/x86/intel_hdmi_audio.c   | 2 +-
 40 files changed, 40 insertions(+), 40 deletions(-)
 rename include/drm/{ => intel}/i915_component.h (98%)
 rename include/drm/{ => intel}/i915_drm.h (100%)
 rename include/drm/{ => intel}/i915_gsc_proxy_mei_interface.h (100%)
 rename include/drm/{ => intel}/i915_hdcp_interface.h (100%)
 rename include/drm/{ => intel}/i915_pciids.h (100%)
 rename include/drm/{ => intel}/i915_pxp_tee_interface.h (100%)
 rename include/drm/{ => intel}/intel-gtt.h (100%)
 rename include/drm/{ => intel}/intel_lpe_audio.h (100%)
 rename include/drm/{ => intel}/xe_pciids.h (100%)

-- 
2.39.2



[PATCH 01/10] drm/i915: use system include for drm headers

2024-04-10 Thread Jani Nikula
Use <> instead of "" for including headers from include/, even if the
file is in the same directory.

Signed-off-by: Jani Nikula 
---
 include/drm/i915_component.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
index 56a84ee1c64c..4ea3b17aa143 100644
--- a/include/drm/i915_component.h
+++ b/include/drm/i915_component.h
@@ -24,7 +24,7 @@
 #ifndef _I915_COMPONENT_H_
 #define _I915_COMPONENT_H_
 
-#include "drm_audio_component.h"
+#include 
 
 enum i915_component_type {
I915_COMPONENT_AUDIO = 1,
-- 
2.39.2



[PATCH 02/10] drm: move intel-gtt.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Signed-off-by: Jani Nikula 
---
 drivers/char/agp/intel-agp.c  | 2 +-
 drivers/char/agp/intel-gtt.c  | 2 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c  | 2 +-
 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_gt.c| 2 +-
 include/drm/{ => intel}/intel-gtt.h   | 0
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename include/drm/{ => intel}/intel-gtt.h (100%)

diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index c518b3a9db04..eec80db6402d 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -12,7 +12,7 @@
 #include 
 #include "agp.h"
 #include "intel-agp.h"
-#include 
+#include 
 
 static int intel_fetch_size(void)
 {
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index bf6716ff863b..11f5cf853c46 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -25,7 +25,7 @@
 #include 
 #include "agp.h"
 #include "intel-agp.h"
-#include 
+#include 
 #include 
 
 /*
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c 
b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index 0d0a0dc9f610..2717699c6591 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -10,7 +10,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "display/intel_display.h"
 #include "gem/i915_gem_lmem.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c 
b/drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c
index 866c416afb73..59eed0a0ce90 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c
@@ -5,7 +5,7 @@
 
 #include "intel_ggtt_gmch.h"
 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c 
b/drivers/gpu/drm/i915/gt/intel_gt.c
index 580b5141ce1e..bab805ca4f0d 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -4,7 +4,7 @@
  */
 
 #include 
-#include 
+#include 
 
 #include "gem/i915_gem_internal.h"
 #include "gem/i915_gem_lmem.h"
diff --git a/include/drm/intel-gtt.h b/include/drm/intel/intel-gtt.h
similarity index 100%
rename from include/drm/intel-gtt.h
rename to include/drm/intel/intel-gtt.h
-- 
2.39.2



[PATCH 03/10] drm: move i915_gsc_proxy_mei_interface.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Tomas Winkler 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c   | 2 +-
 drivers/gpu/drm/xe/xe_gsc_proxy.c  | 2 +-
 drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c | 2 +-
 include/drm/{ => intel}/i915_gsc_proxy_mei_interface.h | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename include/drm/{ => intel}/i915_gsc_proxy_mei_interface.h (100%)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c 
b/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
index a7d5465655f9..e7619d81353c 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
@@ -6,7 +6,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_print.h"
diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c 
b/drivers/gpu/drm/xe/xe_gsc_proxy.c
index 35e397b68dfc..ea7b5ffb8954 100644
--- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
+++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
@@ -10,7 +10,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "abi/gsc_proxy_commands_abi.h"
 #include "regs/xe_gsc_regs.h"
diff --git a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c 
b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
index 89364bdbb129..d5fbaf5d0c8e 100644
--- a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
+++ b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /**
  * mei_gsc_proxy_send - Sends a proxy message to ME FW.
diff --git a/include/drm/i915_gsc_proxy_mei_interface.h 
b/include/drm/intel/i915_gsc_proxy_mei_interface.h
similarity index 100%
rename from include/drm/i915_gsc_proxy_mei_interface.h
rename to include/drm/intel/i915_gsc_proxy_mei_interface.h
-- 
2.39.2



[PATCH 04/10] drm: move i915_component.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Tomas Winkler 
Cc: Jaroslav Kysela 
Cc: Takashi Iwai 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/display/intel_audio.c   | 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c| 2 +-
 drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c | 2 +-
 drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 2 +-
 drivers/gpu/drm/xe/xe_gsc_proxy.c| 2 +-
 drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c   | 2 +-
 drivers/misc/mei/hdcp/mei_hdcp.c | 2 +-
 drivers/misc/mei/pxp/mei_pxp.c   | 2 +-
 include/drm/{ => intel}/i915_component.h | 0
 include/sound/hdaudio.h  | 2 +-
 10 files changed, 9 insertions(+), 9 deletions(-)
 rename include/drm/{ => intel}/i915_component.h (100%)

diff --git a/drivers/gpu/drm/i915/display/intel_audio.c 
b/drivers/gpu/drm/i915/display/intel_audio.c
index 07e0c73204f3..53951c50b504 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -26,7 +26,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "intel_atomic.h"
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c 
b/drivers/gpu/drm/i915/display/intel_hdcp.c
index d5ed4c7dfbc0..183ea437d623 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -13,7 +13,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "i915_reg.h"
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c 
b/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
index e7619d81353c..d8edd7c054c8 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_proxy.c
@@ -5,7 +5,7 @@
 
 #include 
 
-#include 
+#include 
 #include 
 
 #include "gt/intel_gt.h"
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c 
b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
index b00d6c280159..051b6cdcf721 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
@@ -6,7 +6,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "gem/i915_gem_lmem.h"
 #include "gt/intel_gt_print.h"
diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c 
b/drivers/gpu/drm/xe/xe_gsc_proxy.c
index ea7b5ffb8954..a278d08b343c 100644
--- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
+++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
@@ -9,7 +9,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
 #include "abi/gsc_proxy_commands_abi.h"
diff --git a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c 
b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
index d5fbaf5d0c8e..f52fe23a6c0b 100644
--- a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
+++ b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 /**
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index f8759a6c9ed3..e43ea536c947 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "mei_hdcp.h"
diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index b1e4c23b31a3..5a7a4d8b0e23 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -19,7 +19,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "mei_pxp.h"
diff --git a/include/drm/i915_component.h b/include/drm/intel/i915_component.h
similarity index 100%
rename from include/drm/i915_component.h
rename to include/drm/intel/i915_component.h
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index a73d7f34f4e5..00d1ab6936dd 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /* codec node id */
 typedef u16 hda_nid_t;
-- 
2.39.2



[PATCH 06/10] drm: move i915_drm.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Bjorn Helgaas 
Cc: Hans de Goede 
Cc: Ilpo Järvinen 
Signed-off-by: Jani Nikula 
---
 arch/x86/kernel/early-quirks.c | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c   | 2 +-
 drivers/gpu/drm/i915/gt/intel_rps.c| 2 +-
 drivers/gpu/drm/i915/soc/intel_gmch.c  | 2 +-
 drivers/gpu/drm/xe/xe_ggtt.c   | 2 +-
 drivers/platform/x86/intel_ips.c   | 2 +-
 include/drm/{ => intel}/i915_drm.h | 0
 8 files changed, 7 insertions(+), 7 deletions(-)
 rename include/drm/{ => intel}/i915_drm.h (100%)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 59f4aefc6bc1..5b867c02d2b5 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index ad6dd7f3259b..30595b2b63e1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -8,7 +8,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_region.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c 
b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index 2717699c6591..206a5e0fedf1 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -9,7 +9,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
 #include "display/intel_display.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c 
b/drivers/gpu/drm/i915/gt/intel_rps.c
index c9cb2a391942..70176be269d3 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -5,7 +5,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include "display/intel_display.h"
 #include "display/intel_display_irq.h"
diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c 
b/drivers/gpu/drm/i915/soc/intel_gmch.c
index 40874ebfb64c..734e9f2801ea 100644
--- a/drivers/gpu/drm/i915/soc/intel_gmch.c
+++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
@@ -8,7 +8,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "intel_gmch.h"
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index ff2239c0eda5..7af1a48f3b59 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -9,7 +9,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "regs/xe_gt_regs.h"
 #include "regs/xe_gtt_defs.h"
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index ba38649cc142..2a88012958eb 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -59,7 +59,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include "intel_ips.h"
diff --git a/include/drm/i915_drm.h b/include/drm/intel/i915_drm.h
similarity index 100%
rename from include/drm/i915_drm.h
rename to include/drm/intel/i915_drm.h
-- 
2.39.2



[PATCH 08/10] drm: move i915_pciids.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Bjorn Helgaas 
Signed-off-by: Jani Nikula 
---
 arch/x86/kernel/early-quirks.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_display_device.c | 2 +-
 drivers/gpu/drm/i915/i915_pci.c | 2 +-
 drivers/gpu/drm/i915/intel_device_info.c| 2 +-
 include/drm/{ => intel}/i915_pciids.h   | 0
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename include/drm/{ => intel}/i915_pciids.h (100%)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 5b867c02d2b5..6019949a3f68 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c 
b/drivers/gpu/drm/i915/display/intel_display_device.c
index b8903bd0e82a..15525fbf91c1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -3,7 +3,7 @@
  * Copyright © 2023 Intel Corporation
  */
 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 405ca17a990b..983848e5b5b4 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -24,7 +24,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "display/intel_display.h"
 #include "display/intel_display_driver.h"
diff --git a/drivers/gpu/drm/i915/intel_device_info.c 
b/drivers/gpu/drm/i915/intel_device_info.c
index a0a43ea07f11..12948d586143 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -25,7 +25,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "gt/intel_gt_regs.h"
 #include "i915_drv.h"
diff --git a/include/drm/i915_pciids.h b/include/drm/intel/i915_pciids.h
similarity index 100%
rename from include/drm/i915_pciids.h
rename to include/drm/intel/i915_pciids.h
-- 
2.39.2



[PATCH 05/10] drm: move intel_lpe_audio.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Jaroslav Kysela 
Cc: Takashi Iwai 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/display/intel_hdmi.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_lpe_audio.c | 2 +-
 include/drm/{ => intel}/intel_lpe_audio.h  | 0
 sound/x86/intel_hdmi_audio.c   | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename include/drm/{ => intel}/intel_lpe_audio.h (100%)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c 
b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 5f6deceaf8ba..959aa1143a7d 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -38,7 +38,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "g4x_hdmi.h"
 #include "i915_drv.h"
diff --git a/drivers/gpu/drm/i915/display/intel_lpe_audio.c 
b/drivers/gpu/drm/i915/display/intel_lpe_audio.c
index 5863763de530..4e3f78d1d4f9 100644
--- a/drivers/gpu/drm/i915/display/intel_lpe_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_lpe_audio.c
@@ -68,7 +68,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "i915_irq.h"
diff --git a/include/drm/intel_lpe_audio.h b/include/drm/intel/intel_lpe_audio.h
similarity index 100%
rename from include/drm/intel_lpe_audio.h
rename to include/drm/intel/intel_lpe_audio.h
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 02f5a7f9b728..d41ea09ffbe5 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -31,7 +31,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "intel_hdmi_audio.h"
 
 #define INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS  5000
-- 
2.39.2



[PATCH 07/10] drm: move i915_pxp_tee_interface.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Tomas Winkler 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 2 +-
 drivers/misc/mei/pxp/mei_pxp.c   | 2 +-
 include/drm/{ => intel}/i915_pxp_tee_interface.h | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename include/drm/{ => intel}/i915_pxp_tee_interface.h (100%)

diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c 
b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
index 051b6cdcf721..1784153f0cf8 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
@@ -5,7 +5,7 @@
 
 #include 
 
-#include 
+#include 
 #include 
 
 #include "gem/i915_gem_lmem.h"
diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index 5a7a4d8b0e23..4268a868255f 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "mei_pxp.h"
 
diff --git a/include/drm/i915_pxp_tee_interface.h 
b/include/drm/intel/i915_pxp_tee_interface.h
similarity index 100%
rename from include/drm/i915_pxp_tee_interface.h
rename to include/drm/intel/i915_pxp_tee_interface.h
-- 
2.39.2



[PATCH 10/10] drm: move i915_hdcp_interface.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Tomas Winkler 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/display/intel_display_types.h| 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 2 +-
 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c | 2 +-
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c  | 2 +-
 drivers/misc/mei/hdcp/mei_hdcp.c  | 2 +-
 include/drm/{ => intel}/i915_hdcp_interface.h | 0
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename include/drm/{ => intel}/i915_hdcp_interface.h (100%)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index 0f4bd5710796..98d3b6a57b82 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -44,7 +44,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "i915_vma.h"
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c 
b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c
index 35823e1f65d6..16afeb8a3a8d 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c
@@ -3,7 +3,7 @@
  * Copyright 2023, Intel Corporation.
  */
 
-#include 
+#include 
 
 #include "gem/i915_gem_region.h"
 #include "gt/intel_gt.h"
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c 
b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
index 240b00849f3d..6548e71b4c49 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
@@ -4,7 +4,7 @@
  */
 
 #include 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "intel_hdcp_gsc_message.h"
diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c 
b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
index ac4b870f73fa..378ee3f426dc 100644
--- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
+++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
@@ -4,7 +4,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 
 #include "abi/gsc_command_header_abi.h"
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index e43ea536c947..323f10620d90 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "mei_hdcp.h"
 
diff --git a/include/drm/i915_hdcp_interface.h 
b/include/drm/intel/i915_hdcp_interface.h
similarity index 100%
rename from include/drm/i915_hdcp_interface.h
rename to include/drm/intel/i915_hdcp_interface.h
-- 
2.39.2



[PATCH 09/10] drm: move xe_pciids.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/xe/xe_pci.c | 2 +-
 include/drm/{ => intel}/xe_pciids.h | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename include/drm/{ => intel}/xe_pciids.h (100%)

diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 3b30353dbc09..46b3ee310ee7 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -13,7 +13,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include "display/xe_display.h"
 #include "regs/xe_gt_regs.h"
diff --git a/include/drm/xe_pciids.h b/include/drm/intel/xe_pciids.h
similarity index 100%
rename from include/drm/xe_pciids.h
rename to include/drm/intel/xe_pciids.h
-- 
2.39.2



Re: [PATCH 06/10] drm: move i915_drm.h under include/drm/intel

2024-04-10 Thread Ilpo Järvinen
On Wed, 10 Apr 2024, Jani Nikula wrote:

> Clean up the top level include/drm directory by grouping all the Intel
> specific files under a common subdirectory.
> 
> Cc: Daniel Vetter 
> Cc: Dave Airlie 
> Cc: Lucas De Marchi 
> Cc: Bjorn Helgaas 
> Cc: Hans de Goede 
> Cc: Ilpo Järvinen 
> Signed-off-by: Jani Nikula 
> ---
>  arch/x86/kernel/early-quirks.c | 2 +-
>  drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +-
>  drivers/gpu/drm/i915/gt/intel_ggtt.c   | 2 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c| 2 +-
>  drivers/gpu/drm/i915/soc/intel_gmch.c  | 2 +-
>  drivers/gpu/drm/xe/xe_ggtt.c   | 2 +-
>  drivers/platform/x86/intel_ips.c   | 2 +-
>  include/drm/{ => intel}/i915_drm.h | 0
>  8 files changed, 7 insertions(+), 7 deletions(-)
>  rename include/drm/{ => intel}/i915_drm.h (100%)
> 
> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
> index 59f4aefc6bc1..5b867c02d2b5 100644
> --- a/arch/x86/kernel/early-quirks.c
> +++ b/arch/x86/kernel/early-quirks.c
> @@ -17,7 +17,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c 
> b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> index ad6dd7f3259b..30595b2b63e1 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> @@ -8,7 +8,7 @@
>  #include 
>  
>  #include 
> -#include 
> +#include 
>  
>  #include "gem/i915_gem_lmem.h"
>  #include "gem/i915_gem_region.h"
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c 
> b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> index 2717699c6591..206a5e0fedf1 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> @@ -9,7 +9,7 @@
>  #include 
>  
>  #include 
> -#include 
> +#include 
>  #include 
>  
>  #include "display/intel_display.h"
> diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c 
> b/drivers/gpu/drm/i915/gt/intel_rps.c
> index c9cb2a391942..70176be269d3 100644
> --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> @@ -5,7 +5,7 @@
>  
>  #include 
>  
> -#include 
> +#include 
>  
>  #include "display/intel_display.h"
>  #include "display/intel_display_irq.h"
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c 
> b/drivers/gpu/drm/i915/soc/intel_gmch.c
> index 40874ebfb64c..734e9f2801ea 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.c
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
> @@ -8,7 +8,7 @@
>  #include 
>  
>  #include 
> -#include 
> +#include 
>  
>  #include "i915_drv.h"
>  #include "intel_gmch.h"
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index ff2239c0eda5..7af1a48f3b59 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
> @@ -9,7 +9,7 @@
>  #include 
>  
>  #include 
> -#include 
> +#include 
>  
>  #include "regs/xe_gt_regs.h"
>  #include "regs/xe_gtt_defs.h"
> diff --git a/drivers/platform/x86/intel_ips.c 
> b/drivers/platform/x86/intel_ips.c
> index ba38649cc142..2a88012958eb 100644
> --- a/drivers/platform/x86/intel_ips.c
> +++ b/drivers/platform/x86/intel_ips.c
> @@ -59,7 +59,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include "intel_ips.h"
> diff --git a/include/drm/i915_drm.h b/include/drm/intel/i915_drm.h
> similarity index 100%
> rename from include/drm/i915_drm.h
> rename to include/drm/intel/i915_drm.h

Could you please also address the comment in 
drivers/gpu/drm/i915/intel_pci_config.h.

-- 
 i.


Re: [PATCH 06/10] drm: move i915_drm.h under include/drm/intel

2024-04-10 Thread Jani Nikula
On Wed, 10 Apr 2024, Ilpo Järvinen  wrote:
> Could you please also address the comment in 
> drivers/gpu/drm/i915/intel_pci_config.h.

Ack.

-- 
Jani Nikula, Intel


[PATCH v2] drm: move i915_drm.h under include/drm/intel

2024-04-10 Thread Jani Nikula
Clean up the top level include/drm directory by grouping all the Intel
specific files under a common subdirectory.

v2: Also fix comment in intel_pci_config.h (Ilpo)

Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Lucas De Marchi 
Cc: Bjorn Helgaas 
Cc: Hans de Goede 
Cc: Ilpo Järvinen 
Signed-off-by: Jani Nikula 
---
 arch/x86/kernel/early-quirks.c | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c   | 2 +-
 drivers/gpu/drm/i915/gt/intel_rps.c| 2 +-
 drivers/gpu/drm/i915/intel_pci_config.h| 2 +-
 drivers/gpu/drm/i915/soc/intel_gmch.c  | 2 +-
 drivers/gpu/drm/xe/xe_ggtt.c   | 2 +-
 drivers/platform/x86/intel_ips.c   | 2 +-
 include/drm/{ => intel}/i915_drm.h | 0
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename include/drm/{ => intel}/i915_drm.h (100%)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 59f4aefc6bc1..5b867c02d2b5 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index ad6dd7f3259b..30595b2b63e1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -8,7 +8,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_region.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c 
b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index 2717699c6591..206a5e0fedf1 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -9,7 +9,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
 #include "display/intel_display.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c 
b/drivers/gpu/drm/i915/gt/intel_rps.c
index c9cb2a391942..70176be269d3 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -5,7 +5,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include "display/intel_display.h"
 #include "display/intel_display_irq.h"
diff --git a/drivers/gpu/drm/i915/intel_pci_config.h 
b/drivers/gpu/drm/i915/intel_pci_config.h
index 23b8e519f333..ebe040828e20 100644
--- a/drivers/gpu/drm/i915/intel_pci_config.h
+++ b/drivers/gpu/drm/i915/intel_pci_config.h
@@ -31,7 +31,7 @@ static inline int intel_mmio_bar(int graphics_ver)
}
 }
 
-/* BSM in include/drm/i915_drm.h */
+/* BSM in include/drm/intel/i915_drm.h */
 
 #define MCHBAR_I9150x44
 #define MCHBAR_I9650x48
diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c 
b/drivers/gpu/drm/i915/soc/intel_gmch.c
index 40874ebfb64c..734e9f2801ea 100644
--- a/drivers/gpu/drm/i915/soc/intel_gmch.c
+++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
@@ -8,7 +8,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "i915_drv.h"
 #include "intel_gmch.h"
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index ff2239c0eda5..7af1a48f3b59 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -9,7 +9,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "regs/xe_gt_regs.h"
 #include "regs/xe_gtt_defs.h"
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index ba38649cc142..2a88012958eb 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -59,7 +59,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include "intel_ips.h"
diff --git a/include/drm/i915_drm.h b/include/drm/intel/i915_drm.h
similarity index 100%
rename from include/drm/i915_drm.h
rename to include/drm/intel/i915_drm.h
-- 
2.39.2



[PATCH v2 1/1] fbdev: add HAS_IOPORT dependencies

2024-04-10 Thread Niklas Schnelle
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at
compile time. We thus need to add HAS_IOPORT as dependency for those
drivers using them.

Co-developed-by: Arnd Bergmann 
Signed-off-by: Arnd Bergmann 
Signed-off-by: Niklas Schnelle 
---
Note: This patch does not depend any not-yet-mainline HAS_IOPORT changes
and may be merged via subsystem specific trees at your earliest
convenience.

v1 -> v2:
- Add dependency for FB_ARC

 drivers/video/fbdev/Kconfig | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 197b6d5268e9..76bbfd3767da 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -157,7 +157,7 @@ config FB_IMX
 
 config FB_CYBER2000
tristate "CyberPro 2000/2010/5000 support"
-   depends on FB && PCI && (BROKEN || !SPARC64)
+   depends on FB && PCI && HAS_IOPORT && (BROKEN || !SPARC64)
select FB_IOMEM_HELPERS
help
  This enables support for the Integraphics CyberPro 20x0 and 5000
@@ -245,7 +245,7 @@ config FB_FM2
 
 config FB_ARC
tristate "Arc Monochrome LCD board support"
-   depends on FB && (X86 || COMPILE_TEST)
+   depends on FB && HAS_IOPORT && (X86 || COMPILE_TEST)
select FB_SYSMEM_HELPERS_DEFERRED
help
  This enables support for the Arc Monochrome LCD board. The board
@@ -1046,7 +1046,7 @@ config FB_ATY_BACKLIGHT
 
 config FB_S3
tristate "S3 Trio/Virge support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1107,7 +1107,7 @@ config FB_SAVAGE_ACCEL
 
 config FB_SIS
tristate "SiS/XGI display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select BOOT_VESA_SUPPORT if FB_SIS = y
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -1138,7 +1138,7 @@ config FB_SIS_315
 
 config FB_VIA
tristate "VIA UniChrome (Pro) and Chrome9 display support"
-   depends on FB && PCI && GPIOLIB && I2C && (X86 || COMPILE_TEST)
+   depends on FB && PCI && GPIOLIB && I2C && HAS_IOPORT && (X86 || 
COMPILE_TEST)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1177,7 +1177,7 @@ endif
 
 config FB_NEOMAGIC
tristate "NeoMagic display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1204,7 +1204,7 @@ config FB_KYRO
 
 config FB_3DFX
tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1252,7 +1252,7 @@ config FB_VOODOO1
 
 config FB_VT8623
tristate "VIA VT8623 support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1267,7 +1267,7 @@ config FB_VT8623
 
 config FB_TRIDENT
tristate "Trident/CyberXXX/CyberBlade support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1290,7 +1290,7 @@ config FB_TRIDENT
 
 config FB_ARK
tristate "ARK 2000PV support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1814,7 +1814,7 @@ config FB_SSD1307
 
 config FB_SM712
tristate "Silicon Motion SM712 framebuffer support"
-   depends on FB && PCI
+   depends on FB && PCI && HAS_IOPORT
select FB_IOMEM_HELPERS
help
  Frame buffer driver for the Silicon Motion SM710, SM712, SM721
-- 
2.40.1



[PATCH v2 0/1] fbdev: Handle HAS_IOPORT dependencies

2024-04-10 Thread Niklas Schnelle
Hi Helge,

This is a follow up in my ongoing effort of making inb()/outb() and
similar I/O port accessors compile-time optional. Previously I sent this
as a treewide series titled "treewide: Remove I/O port accessors for
HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant
subset of patches merged I've changed over to per-subsystem series. These
series are stand alone and should be merged via the relevant tree such
that with all subsystems complete we can follow this up with the final
patch that will make the I/O port accessors compile-time optional.

The current state of the full series with changes to the remaining subsystems
and the aforementioned final patch can be found for your convenience on my
git.kernel.org tree in the has_ioport branch[1]. As for compile-time vs runtime
see Linus' reply to my first attempt[2].

Thanks,
Niklas

[0] https://lore.kernel.org/all/20230522105049.1467313-1-schne...@linux.ibm.com/
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=has_ioport
[2] 
https://lore.kernel.org/lkml/CAHk-=wg80je=k7madf4e7wrrnp37e3qh6y10svhdc7o8sz_...@mail.gmail.com/

v1 -> v2:
- Add dependency for FB_ARC

Niklas Schnelle (1):
  fbdev: add HAS_IOPORT dependencies

 drivers/video/fbdev/Kconfig | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

-- 
2.40.1



Re: [PATCH] drm: xlnx: db: fix a memory leak in probe

2024-04-10 Thread Tomi Valkeinen

On 04/04/2024 10:32, Dan Carpenter wrote:

Free "dp" before returning.

Fixes: be318d01a903 ("drm: xlnx: dp: Reset DisplayPort IP")
Signed-off-by: Dan Carpenter 
---
  drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index 5a40aa1d4283..8a15d18a65a6 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -1716,7 +1716,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)
  
  	ret = zynqmp_dp_reset(dp, true);

if (ret < 0)
-   return ret;
+   goto err_free;
  
  	ret = zynqmp_dp_reset(dp, false);

if (ret < 0)


Thanks, applying to drm-misc-next.

 Tomi



Re: [PATCH] drm/omap: dmm_tiler: drop driver owner assignment

2024-04-10 Thread Tomi Valkeinen

On 30/03/2024 22:28, Krzysztof Kozlowski wrote:

Core in platform_driver_register() already sets the .owner, so driver
does not need to.  Whatever is set here will be anyway overwritten by
main driver calling platform_driver_register().

Signed-off-by: Krzysztof Kozlowski 
---
  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c 
b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index 9753c1e1f994..1aca3060333e 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -1212,7 +1212,6 @@ struct platform_driver omap_dmm_driver = {
.probe = omap_dmm_probe,
.remove_new = omap_dmm_remove,
.driver = {
-   .owner = THIS_MODULE,
.name = DMM_DRIVER_NAME,
.of_match_table = of_match_ptr(dmm_of_match),
.pm = &omap_dmm_pm_ops,


Thanks, applying to drm-misc-next.

 Tomi



Re: [PATCH] drm: tilcdc: don't use devm_pinctrl_get_select_default() in probe

2024-04-10 Thread Tomi Valkeinen

On 22/09/2023 10:37, Wolfram Sang wrote:

Since commit ab78029ecc34 ("drivers/pinctrl: grab default handles from
device core"), we can rely on device core for setting the default pins.

Signed-off-by: Wolfram Sang 
---
  drivers/gpu/drm/tilcdc/tilcdc_panel.c | 6 --
  1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 9aefd010acde..68093d6b6b16 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -6,7 +6,6 @@
  
  #include 

  #include 
-#include 
  #include 
  
  #include 

@@ -308,7 +307,6 @@ static int panel_probe(struct platform_device *pdev)
struct backlight_device *backlight;
struct panel_module *panel_mod;
struct tilcdc_module *mod;
-   struct pinctrl *pinctrl;
int ret;
  
  	/* bail out early if no DT data: */

@@ -342,10 +340,6 @@ static int panel_probe(struct platform_device *pdev)
  
  	tilcdc_module_init(mod, "panel", &panel_module_ops);
  
-	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);

-   if (IS_ERR(pinctrl))
-   dev_warn(&pdev->dev, "pins are not configured\n");
-
panel_mod->timings = of_get_display_timings(node);
if (!panel_mod->timings) {
dev_err(&pdev->dev, "could not get panel timings\n");


Thanks, applying to drm-misc-next.

 Tomi



Re: [PATCH 4/6] drm/msm/adreno: Implement SMEM-based speed bin

2024-04-10 Thread Konrad Dybcio




On 4/6/24 05:23, Dmitry Baryshkov wrote:

On Fri, Apr 05, 2024 at 10:41:32AM +0200, Konrad Dybcio wrote:

On recent (SM8550+) Snapdragon platforms, the GPU speed bin data is
abstracted through SMEM, instead of being directly available in a fuse.

Add support for SMEM-based speed binning, which includes getting
"feature code" and "product code" from said source and parsing them
to form something that lets us match OPPs against.

Signed-off-by: Konrad Dybcio 
---


[...]


-   return nvmem_cell_read_variable_le_u32(dev, "speed_bin", speedbin);
+   u32 fcode, pcode;
+   int ret;
+
+   /* Try reading the speedbin via a nvmem cell first */
+   ret = nvmem_cell_read_variable_le_u32(dev, "speed_bin", speedbin);
+   if (!ret && ret != -EINVAL)


This is always false.


Right, a better condition would be (!ret || ret != EINVAL)..





+   return ret;
+
+   ret = qcom_smem_get_feature_code(&fcode);
+   if (ret) {
+   dev_err(dev, "Couldn't get feature code from SMEM!\n");
+   return ret;


This brings in QCOM_SMEM dependency (which is not mentioned in the
Kconfig). Please keep iMX5 hardware in mind, so the dependency should be
optional. Respective functions should be stubbed in the header.


OK, I had this in mind early on, but forgot to actually impl it.




+   }
+
+   ret = qcom_smem_get_product_code(&pcode);
+   if (ret) {
+   dev_err(dev, "Couldn't get product code from SMEM!\n");
+   return ret;
+   }
+
+   /* Don't consider fcode for external feature codes */
+   if (fcode <= SOCINFO_FC_EXT_RESERVE)
+   fcode = SOCINFO_FC_UNKNOWN;
+
+   *speedbin = FIELD_PREP(ADRENO_SKU_ID_PCODE, pcode) |
+   FIELD_PREP(ADRENO_SKU_ID_FCODE, fcode);


What about just asking the qcom_smem for the 'gpu_bin' and hiding gory
details there? It almost feels that handling raw PCODE / FCODE here is
too low-level and a subject to change depending on the socinfo format.


No, the FCODE & PCODE can be interpreted differently across consumers.




+
+   return ret;
  }
  
  int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,

@@ -1098,9 +1129,9 @@ int adreno_gpu_init(struct drm_device *drm, struct 
platform_device *pdev,
devm_pm_opp_set_clkname(dev, "core");
}
  
-	if (adreno_read_speedbin(dev, &speedbin) || !speedbin)

+   if (adreno_read_speedbin(adreno_gpu, dev, &speedbin) || !speedbin)
speedbin = 0x;
-   adreno_gpu->speedbin = (uint16_t) (0x & speedbin);


the &= 0x should probably go to the adreno_read_speedbin / nvmem
case. WDYT?


Ok, I can keep it, though realistically if this ever does anything
useful, it likely means the dt is wrong

Konrad


Re: [PATCH] drm/bridge: ti-sn65dsi86: Fix ti_sn_bridge_set_dsi_rate function

2024-04-10 Thread Jayesh Choudhary

Hello Doug,

Thanks for the review.

On 08/04/24 14:33, Doug Anderson wrote:

Hi,

On Mon, Apr 8, 2024 at 12:36 AM Jayesh Choudhary  wrote:


Due to integer calculations, the rounding off can cause errors in the final
value propagated in the registers.
Considering the example of 1080p (very common resolution), the mode->clock
is 148500, dsi->lanes = 4, and bpp = 24, with the previous logic, the DSI
clock frequency would come as 444 when we are expecting the value 445.5
which would reflect in SN_DSIA_CLK_FREQ_REG.
So move the division to be the last operation where rounding off will not
impact the register value.


Given that this driver is used on a whole pile of shipping Chromebooks
and those devices have been working just fine (with 1080p resolution)
for years, I'm curious how you noticed this. Was it actually causing
real problems for you, or did you notice it just from code inspection?
You should include this information in the commit message.


I am trying to add display support for TI SoC which uses this particular
bridge. While debugging, I was trying to get all the register value in
sync with the datasheet and it was then that I observed this issue while
inspecting the code.
Maybe Chromebooks are using different set of parameters which does not
expose this issue. Since parameters for my display (mentioned in commit
message) yields the frequency at the border, I saw this issue. My debug
is still ongoing but since the value is not in sync with the
documentation, I sent out this patch.



I'm travelling for the next two weeks so I can't actually check on a
device to see if your patch makes any difference on hardware I have,
but I'd presume that things were working "well enough" with the old
value and they'll still work with the new value?




Yes, ideally they should still work well with this change.


Also according to the SN65DSI86 datasheet[0], the minimum value for that
reg is 0x08 (inclusive) and the maximum value is 0x97 (exclusive). So add
check for that.


Maybe the range checking should be a separate patch?


Check should be done before propagating the register value so I added it
in the same function and hence in the same patch.





[0]: 

Fixes: ca1b885cbe9e ("drm/bridge: ti-sn65dsi86: Split the setting of the dp and dsi 
rates")


Are you sure that's the commit you're fixing? In the commit text of
that commit I wrote that it was supposed to "have zero functional
change". Looking back at the change I still believe it had zero
functional change. The rounding error looks like it predates the
patch.

As far as I can tell the rounding error has been there since commit
a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver").



Yes. Now I see that it fixes the initial support patch.
I will fix that.




Signed-off-by: Jayesh Choudhary 


It's great to see a TI engineer contributing to this driver! Awesome!



---
  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 48 +--
  1 file changed, 37 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 84698a0b27a8..f9cf6b14d85e 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -111,7 +111,14 @@
  #define  AUX_IRQ_STATUS_AUX_SHORT  BIT(5)
  #define  AUX_IRQ_STATUS_NAT_I2C_FAIL   BIT(6)

-#define MIN_DSI_CLK_FREQ_MHZ   40
+/*
+ * NOTE: DSI clock frequency range: [40MHz,755MHz)
+ * DSI clock frequency range is in 5-MHz increments
+ * So minimum frequency 40MHz translates to 0x08
+ * And maximum frequency 755MHz translates to 0x97
+ */
+#define MIN_DSI_CLK_RANGE  0x8
+#define MAX_DSI_CLK_RANGE  0x97


It's a little weird to call this min/max and have one be inclusive and
one be exclusive. Be consistent and say that this is the minimum legal
value and the maximum legal value. I think that means the MAX should
be 0x96.


The comment above does specify the inclusive/exclusive behavior.
Since a value corresponds to 5MHz range, associating the value with
the range makes more sense if I keep it 0x97 (0x97 * 5 -> 755MHz)
0x96 corresponds to the range of [750Mz,755MHz).

If this argument does not make sense, I can change it to 0x96 and handle
it with the inequalities in the function call.





  /* fudge factor required to account for 8b/10b encoding */
  #define DP_CLK_FUDGE_NUM   10
@@ -820,22 +827,37 @@ static void ti_sn_bridge_atomic_disable(struct drm_bridge 
*bridge,
 regmap_update_bits(pdata->regmap, SN_ENH_FRAME_REG, VSTREAM_ENABLE, 0);
  }

-static void ti_sn_bridge_set_dsi_rate(struct ti_sn65dsi86 *pdata)
+static int ti_sn_bridge_set_dsi_rate(struct ti_sn65dsi86 *pdata)
  {
-   unsigned int bit_rate_mhz, clk_freq_mhz;
+   unsigned int bit_rate_khz;
 unsigned int val;
 struct drm_display_mode *mode =
 &pdata->bridge.encoder->crtc->state->adjusted_mode;

-   /* set DSIA clk frequency */

Re: [PATCH 3/6] drm/msm/adreno: Allow specifying default speedbin value

2024-04-10 Thread Konrad Dybcio




On 4/9/24 20:31, Dmitry Baryshkov wrote:

On Tue, 9 Apr 2024 at 21:27, Konrad Dybcio  wrote:




On 4/9/24 20:15, Dmitry Baryshkov wrote:

On Tue, Apr 09, 2024 at 08:07:56PM +0200, Konrad Dybcio wrote:



On 4/9/24 20:04, Dmitry Baryshkov wrote:

On Tue, Apr 09, 2024 at 10:12:00AM -0700, Rob Clark wrote:

On Tue, Apr 9, 2024 at 8:23 AM Dmitry Baryshkov
 wrote:


On Tue, Apr 09, 2024 at 05:12:46PM +0200, Konrad Dybcio wrote:



On 4/6/24 04:56, Dmitry Baryshkov wrote:

On Fri, Apr 05, 2024 at 10:41:31AM +0200, Konrad Dybcio wrote:

From: Neil Armstrong 

Usually, speedbin 0 is the "super SKU", a.k.a the one which can clock
the highest. Falling back to it when things go wrong is largely
suboptimal, as more often than not, the top frequencies are not
supposed to work on other bins.


Isn't it better to just return an error here instead of trying to guess
which speedbin to use?


Not sure. I'd rather better compatibility for e.g. booting up a new
laptop with just dt.


New speedbin can have lower max speed, so by attempting to run it at
higher freq you might be breaking it.


Usually there are some OPPs in common to all speedbins, so picking a
freq from that set would seem like the safe thing to do


Well, the issue is about an uknown speed bin. So in theory we know
nothing about the set of speeds itsupports. My point is that we should
simplfy fail in such case.


Or we could allow e.g. the lowest frequency (or 2) which if often shared
across the board to work, giving a compromise between OOBE and sanity


That's also an option. But we should not be using existing speed table for
the unknown bin.


I derived this logic from msm-5.15 where it's "intended behavior".. I
suppose we can do better as you said though

There have been cases in the past where the default speed bin ended up
having a higher max freq than subsequent ones, and I don't think I can
trust this product/feature code approach to guarantee this never
happening again.

So. I think sticking to a single lowest freq and printing a big red line
in dmesg makes sense here


Make 0x80 the default supported-hw, make sure that the lowest freq has
0xff. Plus big-red-line.
And hope that we'll never see 16 speed bins for the hardware.


opp-supported-hw is a u32 bitmask fwiw

I was thinking, either 0x or some driver-side hackery
(dev_pm_opp_enable).

Perhaps I'd be more in favor of the latter, as putting meaningless gobblygoo
in dt is not good

Konrad


Re: [PATCH] drm/msm/dpu: Add callback function pointer check before its call

2024-04-10 Thread Aleksandr Mishin




On 08.04.2024 19:51, Abhinav Kumar wrote:



On 4/8/2024 1:55 AM, Aleksandr Mishin wrote:
In dpu_core_irq_callback_handler() callback function pointer is 
compared to NULL,

but then callback function is unconditionally called by this pointer.
Fix this bug by adding conditional return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.



Yes , as dmitry wrote, this should be Reported-by.



It is an established practice for our project, you can find 700+ applied
patches with similar line:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=linuxtesting.org


But rest LGTM.


Fixes: c929ac60b3ed ("drm/msm/dpu: allow just single IRQ callback")
Signed-off-by: Aleksandr Mishin 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c

index 946dd0135dff..03a16fbd4c99 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
@@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct 
dpu_kms *dpu_kms, unsigned int

  VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
-    if (!irq_entry->cb)
+    if (!irq_entry->cb) {
  DRM_ERROR("no registered cb, IRQ=[%d, %d]\n",
    DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
+    return;
+    }
  atomic_inc(&irq_entry->count);


--
Kind regards
Aleksandr


Re: [PATCH v2] drm: ensure drm headers are self-contained and pass kernel-doc

2024-04-10 Thread Jani Nikula
On Tue, 02 Apr 2024, Jani Nikula  wrote:
> Ensure drm headers build, are self-contained, have header guards, and
> have no kernel-doc warnings, when CONFIG_DRM_HEADER_TEST=y.
>
> The mechanism follows similar patters used in i915, xe, and usr/include.
>
> To cover include/drm, we need to recurse there using the top level
> Kbuild and the new include/Kbuild files.

Masahiro, any input? Ack?

BR,
Jani.

>
> v2: make DRM_HEADER_TEST depend on DRM
>
> Suggested-by: Daniel Vetter 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Thomas Zimmermann 
> Cc: Masahiro Yamada 
> Acked-by: Thomas Zimmermann 
> Signed-off-by: Jani Nikula 
> ---
>  Kbuild   |  1 +
>  drivers/gpu/drm/Kconfig  | 11 +++
>  drivers/gpu/drm/Makefile | 18 ++
>  include/Kbuild   |  1 +
>  include/drm/Makefile | 18 ++
>  5 files changed, 49 insertions(+)
>  create mode 100644 include/Kbuild
>  create mode 100644 include/drm/Makefile
>
> diff --git a/Kbuild b/Kbuild
> index 464b34a08f51..f327ca86990c 100644
> --- a/Kbuild
> +++ b/Kbuild
> @@ -97,3 +97,4 @@ obj-$(CONFIG_SAMPLES)   += samples/
>  obj-$(CONFIG_NET)+= net/
>  obj-y+= virt/
>  obj-y+= $(ARCH_DRIVERS)
> +obj-$(CONFIG_DRM_HEADER_TEST)+= include/
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3914aaf443a8..a388c4fda984 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -431,3 +431,14 @@ config DRM_WERROR
> this config option is disabled by default.
>  
> If in doubt, say N.
> +
> +config DRM_HEADER_TEST
> + bool "Ensure DRM headers are self-contained and pass kernel-doc"
> + depends on DRM && EXPERT
> + default n
> + help
> +   Ensure the DRM subsystem headers both under drivers/gpu/drm and
> +   include/drm compile, are self-contained, have header guards, and have
> +   no kernel-doc warnings.
> +
> +   If in doubt, say N.
> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
> index a73c04d2d7a3..6605d5686d01 100644
> --- a/drivers/gpu/drm/Makefile
> +++ b/drivers/gpu/drm/Makefile
> @@ -218,3 +218,21 @@ obj-y+= solomon/
>  obj-$(CONFIG_DRM_SPRD) += sprd/
>  obj-$(CONFIG_DRM_LOONGSON) += loongson/
>  obj-$(CONFIG_DRM_POWERVR) += imagination/
> +
> +# Ensure drm headers are self-contained and pass kernel-doc
> +hdrtest-files := \
> + $(shell cd $(srctree)/$(src) && find . -maxdepth 1 -name 'drm_*.h') \
> + $(shell cd $(srctree)/$(src) && find display lib -name '*.h')
> +
> +always-$(CONFIG_DRM_HEADER_TEST) += \
> + $(patsubst %.h,%.hdrtest, $(hdrtest-files))
> +
> +# Include the header twice to detect missing include guard.
> +quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
> +  cmd_hdrtest = \
> + $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< 
> -include $<; \
> + $(srctree)/scripts/kernel-doc -none $(if 
> $(CONFIG_DRM_WERROR),-Werror) $<; \
> + touch $@
> +
> +$(obj)/%.hdrtest: $(src)/%.h FORCE
> + $(call if_changed_dep,hdrtest)
> diff --git a/include/Kbuild b/include/Kbuild
> new file mode 100644
> index ..5e76a599e2dd
> --- /dev/null
> +++ b/include/Kbuild
> @@ -0,0 +1 @@
> +obj-$(CONFIG_DRM_HEADER_TEST)+= drm/
> diff --git a/include/drm/Makefile b/include/drm/Makefile
> new file mode 100644
> index ..b9f391d7aadd
> --- /dev/null
> +++ b/include/drm/Makefile
> @@ -0,0 +1,18 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# Ensure drm headers are self-contained and pass kernel-doc
> +hdrtest-files := \
> + $(shell cd $(srctree)/$(src) && find * -name '*.h' 2>/dev/null)
> +
> +always-$(CONFIG_DRM_HEADER_TEST) += \
> + $(patsubst %.h,%.hdrtest, $(hdrtest-files))
> +
> +# Include the header twice to detect missing include guard.
> +quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
> +  cmd_hdrtest = \
> + $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< 
> -include $<; \
> + $(srctree)/scripts/kernel-doc -none $(if 
> $(CONFIG_DRM_WERROR),-Werror) $<; \
> + touch $@
> +
> +$(obj)/%.hdrtest: $(src)/%.h FORCE
> + $(call if_changed_dep,hdrtest)

-- 
Jani Nikula, Intel


Re: [PATCH] drm/msm/dpu: Add callback function pointer check before its call

2024-04-10 Thread Aleksandr Mishin




On 08.04.2024 12:03, Dmitry Baryshkov wrote:

On Mon, 8 Apr 2024 at 11:57, Aleksandr Mishin  wrote:


In dpu_core_irq_callback_handler() callback function pointer is compared to 
NULL,
but then callback function is unconditionally called by this pointer.
Fix this bug by adding conditional return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.


This should be converted to a proper Reported-by: trailer.



It is an established practice for our project, you can find 700+ applied
patches with similar line:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=linuxtesting.org



Fixes: c929ac60b3ed ("drm/msm/dpu: allow just single IRQ callback")
Signed-off-by: Aleksandr Mishin 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
index 946dd0135dff..03a16fbd4c99 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
@@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct dpu_kms 
*dpu_kms, unsigned int

 VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));

-   if (!irq_entry->cb)
+   if (!irq_entry->cb) {
 DRM_ERROR("no registered cb, IRQ=[%d, %d]\n",
   DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
+   return;
+   }

 atomic_inc(&irq_entry->count);

--
2.30.2







--
Kind regards
Aleksandr


[PATCH v2 2/5] drm/udl: Move drm_dev_{enter, exit}() into udl_get_edid_block()

2024-04-10 Thread Thomas Zimmermann
Protect the code in udl_get_edid_block() with drm_dev_enter() and
drm_dev_exit(), so that all callers automatically invoke it. The
function uses hardware resources, which can be hot-unplugged at
any time. The other code in udl_connector_detect() does not use the
resources of the hardware device and therefore does not require
protection.

This change will allow to use udl_get_edid_block() in various
contexts easily.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/udl/udl_modeset.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_modeset.c 
b/drivers/gpu/drm/udl/udl_modeset.c
index 751da3a294c44..3df9fc38388b4 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -434,13 +434,18 @@ static int udl_get_edid_block(void *data, u8 *buf, 
unsigned int block, size_t le
struct drm_device *dev = &udl->drm;
struct usb_device *udev = udl_to_usb_device(udl);
u8 *read_buff;
-   int ret;
+   int idx, ret;
size_t i;
 
read_buff = kmalloc(2, GFP_KERNEL);
if (!read_buff)
return -ENOMEM;
 
+   if (!drm_dev_enter(dev, &idx)) {
+   ret = -ENODEV;
+   goto err_kfree;
+   }
+
for (i = 0; i < len; i++) {
int bval = (i + block * EDID_LENGTH) << 8;
 
@@ -449,20 +454,23 @@ static int udl_get_edid_block(void *data, u8 *buf, 
unsigned int block, size_t le
  0xA1, read_buff, 2, USB_CTRL_GET_TIMEOUT);
if (ret < 0) {
drm_err(dev, "Read EDID byte %zu failed err %x\n", i, 
ret);
-   goto err_kfree;
+   goto err_drm_dev_exit;
} else if (ret < 1) {
ret = -EIO;
drm_err(dev, "Read EDID byte %zu failed\n", i);
-   goto err_kfree;
+   goto err_drm_dev_exit;
}
 
buf[i] = read_buff[1];
}
 
+   drm_dev_exit(idx);
kfree(read_buff);
 
return 0;
 
+err_drm_dev_exit:
+   drm_dev_exit(idx);
 err_kfree:
kfree(read_buff);
return ret;
@@ -474,21 +482,15 @@ static enum drm_connector_status 
udl_connector_detect(struct drm_connector *conn
struct udl_device *udl = to_udl(dev);
struct udl_connector *udl_connector = to_udl_connector(connector);
enum drm_connector_status status = connector_status_disconnected;
-   int idx;
 
/* cleanup previous EDID */
kfree(udl_connector->edid);
udl_connector->edid = NULL;
 
-   if (!drm_dev_enter(dev, &idx))
-   return connector_status_disconnected;
-
udl_connector->edid = drm_do_get_edid(connector, udl_get_edid_block, 
udl);
if (udl_connector->edid)
status = connector_status_connected;
 
-   drm_dev_exit(idx);
-
return status;
 }
 
-- 
2.44.0



[PATCH v2 0/5] drm/udl: Convert to struct drm_edid

2024-04-10 Thread Thomas Zimmermann
Convert udl to use struct drm_edid and its helpers. Also clean up
a few things in the process.

Patch 1 fixes a bug.

Patches 2 to 4 convert the current EDID handling to struct drm_edid
and its helpers. Patch 4 also separates the helpers for .get_modes()
and .detect_ctx() from each other.

Patch 5 removes the obsolete struct udl_connector.

v2:
- drop the generic EDID probing (Jani)
- fixes

Thomas Zimmermann (5):
  drm/udl: Remove DRM_CONNECTOR_POLL_HPD
  drm/udl: Move drm_dev_{enter,exit}() into udl_get_edid_block()
  drm/udl: Clean up Makefile
  drm/udl: Untangle .get_modes() and .detect_ctx()
  drm/udl: Remove struct udl_connector

 drivers/gpu/drm/udl/Makefile  |   8 +-
 drivers/gpu/drm/udl/udl_drv.h |  12 +--
 drivers/gpu/drm/udl/udl_edid.c|  79 +
 drivers/gpu/drm/udl/udl_edid.h|  15 
 drivers/gpu/drm/udl/udl_modeset.c | 138 +++---
 5 files changed, 131 insertions(+), 121 deletions(-)
 create mode 100644 drivers/gpu/drm/udl/udl_edid.c
 create mode 100644 drivers/gpu/drm/udl/udl_edid.h

-- 
2.44.0



[PATCH v2 3/5] drm/udl: Clean up Makefile

2024-04-10 Thread Thomas Zimmermann
Clean up Makefile before listing new object files. No functional
changes.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/udl/Makefile | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/udl/Makefile b/drivers/gpu/drm/udl/Makefile
index 3f6db179455d1..00690741db376 100644
--- a/drivers/gpu/drm/udl/Makefile
+++ b/drivers/gpu/drm/udl/Makefile
@@ -1,4 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
-udl-y := udl_drv.o udl_modeset.o udl_main.o udl_transfer.o
+
+udl-y := \
+   udl_drv.o \
+   udl_main.o \
+   udl_modeset.o \
+   udl_transfer.o
 
 obj-$(CONFIG_DRM_UDL) := udl.o
-- 
2.44.0



[PATCH v2 5/5] drm/udl: Remove struct udl_connector

2024-04-10 Thread Thomas Zimmermann
Udl's struct udl_connector is an empty wrapper around struct
drm_connector. Remove it. Allocate the connector as part of struct
udl_device and inline the init function into its only caller.

v2:
- fix return value in udl_modeset_init() (Dan)

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/udl/udl_drv.h | 10 +--
 drivers/gpu/drm/udl/udl_modeset.c | 49 +++
 2 files changed, 11 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index f112cfb270f31..1eb716d9dad57 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -49,15 +49,6 @@ struct urb_list {
size_t size;
 };
 
-struct udl_connector {
-   struct drm_connector connector;
-};
-
-static inline struct udl_connector *to_udl_connector(struct drm_connector 
*connector)
-{
-   return container_of(connector, struct udl_connector, connector);
-}
-
 struct udl_device {
struct drm_device drm;
struct device *dev;
@@ -66,6 +57,7 @@ struct udl_device {
struct drm_plane primary_plane;
struct drm_crtc crtc;
struct drm_encoder encoder;
+   struct drm_connector connector;
 
struct mutex gem_lock;
 
diff --git a/drivers/gpu/drm/udl/udl_modeset.c 
b/drivers/gpu/drm/udl/udl_modeset.c
index 4236ce57f5945..bbb04f98886a2 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -444,49 +444,14 @@ static const struct drm_connector_helper_funcs 
udl_connector_helper_funcs = {
.detect_ctx = udl_connector_helper_detect_ctx,
 };
 
-static void udl_connector_destroy(struct drm_connector *connector)
-{
-   struct udl_connector *udl_connector = to_udl_connector(connector);
-
-   drm_connector_cleanup(connector);
-   kfree(udl_connector);
-}
-
 static const struct drm_connector_funcs udl_connector_funcs = {
.reset = drm_atomic_helper_connector_reset,
.fill_modes = drm_helper_probe_single_connector_modes,
-   .destroy = udl_connector_destroy,
+   .destroy = drm_connector_cleanup,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
-struct drm_connector *udl_connector_init(struct drm_device *dev)
-{
-   struct udl_connector *udl_connector;
-   struct drm_connector *connector;
-   int ret;
-
-   udl_connector = kzalloc(sizeof(*udl_connector), GFP_KERNEL);
-   if (!udl_connector)
-   return ERR_PTR(-ENOMEM);
-
-   connector = &udl_connector->connector;
-   ret = drm_connector_init(dev, connector, &udl_connector_funcs, 
DRM_MODE_CONNECTOR_VGA);
-   if (ret)
-   goto err_kfree;
-
-   drm_connector_helper_add(connector, &udl_connector_helper_funcs);
-
-   connector->polled = DRM_CONNECTOR_POLL_CONNECT |
-   DRM_CONNECTOR_POLL_DISCONNECT;
-
-   return connector;
-
-err_kfree:
-   kfree(udl_connector);
-   return ERR_PTR(ret);
-}
-
 /*
  * Modesetting
  */
@@ -556,9 +521,15 @@ int udl_modeset_init(struct drm_device *dev)
return ret;
encoder->possible_crtcs = drm_crtc_mask(crtc);
 
-   connector = udl_connector_init(dev);
-   if (IS_ERR(connector))
-   return PTR_ERR(connector);
+   connector = &udl->connector;
+   ret = drm_connector_init(dev, connector, &udl_connector_funcs, 
DRM_MODE_CONNECTOR_VGA);
+   if (ret)
+   return ret;
+   drm_connector_helper_add(connector, &udl_connector_helper_funcs);
+
+   connector->polled = DRM_CONNECTOR_POLL_CONNECT |
+   DRM_CONNECTOR_POLL_DISCONNECT;
+
ret = drm_connector_attach_encoder(connector, encoder);
if (ret)
return ret;
-- 
2.44.0



[PATCH v2 1/5] drm/udl: Remove DRM_CONNECTOR_POLL_HPD

2024-04-10 Thread Thomas Zimmermann
DisplayLink devices do not generate hotplug events. Remove the poll
flag DRM_CONNECTOR_POLL_HPD, as it may not be specified together with
DRM_CONNECTOR_POLL_CONNECT or DRM_CONNECTOR_POLL_DISCONNECT.

Signed-off-by: Thomas Zimmermann 
Fixes: afdfc4c6f55f ("drm/udl: Fixed problem with UDL adpater reconnection")
Cc: Robert Tarasov 
Cc: Alex Deucher 
Cc: Dave Airlie 
Cc: Sean Paul 
Cc: Thomas Zimmermann 
Cc: dri-devel@lists.freedesktop.org
Cc:  # v4.15+
---
 drivers/gpu/drm/udl/udl_modeset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_modeset.c 
b/drivers/gpu/drm/udl/udl_modeset.c
index 7702359c90c22..751da3a294c44 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -527,8 +527,7 @@ struct drm_connector *udl_connector_init(struct drm_device 
*dev)
 
drm_connector_helper_add(connector, &udl_connector_helper_funcs);
 
-   connector->polled = DRM_CONNECTOR_POLL_HPD |
-   DRM_CONNECTOR_POLL_CONNECT |
+   connector->polled = DRM_CONNECTOR_POLL_CONNECT |
DRM_CONNECTOR_POLL_DISCONNECT;
 
return connector;
-- 
2.44.0



[PATCH v2 4/5] drm/udl: Untangle .get_modes() and .detect_ctx()

2024-04-10 Thread Thomas Zimmermann
Provide separate implementations of .get_modes() and .detect_ctx()
from struct drm_connector. Switch to struct drm_edid.

Udl's .detect() helper used to fetch the EDID from the adapter and the
.get_modes() helper provided display modes from the data. But this
relied on the DRM helpers to call the functions in the correct order.
When no EDID could be retrieved, .detect() regularly printed a warning
to the kernel log.

Switching to the new helpers around struct drm_edid separates both from
each other. The .get_modes() helper now fetches the EDID by itself and
the .detect_ctx() helper only tests for its presence. The patch does a
number of things to implement this.

- Move udl_get_edid_block() to udl_edid.c and rename it to
udl_read_edid_block(). Then use the helper to implement probing in
udl_probe_edid() and reading in udl_edid_read(). The latter helper
is build on top of DRM helpers.

- Replace the existing code in .get_modes() and .detect() with udl's
new EDID helpers. The new code behaves like DRM's similar DDC-based
helpers. Instead of .detect(), udl now implements .detect_ctx().

- Remove the edid data from struct udl_connector. The field cached
the EDID data between calls to .detect() and .get_modes(), but is now
unused.

v2:
- implement udl_probe_edid() within udl
- reword commit description

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/udl/Makefile  |  1 +
 drivers/gpu/drm/udl/udl_drv.h |  2 -
 drivers/gpu/drm/udl/udl_edid.c| 79 +++
 drivers/gpu/drm/udl/udl_edid.h| 15 ++
 drivers/gpu/drm/udl/udl_modeset.c | 90 +++
 5 files changed, 114 insertions(+), 73 deletions(-)
 create mode 100644 drivers/gpu/drm/udl/udl_edid.c
 create mode 100644 drivers/gpu/drm/udl/udl_edid.h

diff --git a/drivers/gpu/drm/udl/Makefile b/drivers/gpu/drm/udl/Makefile
index 00690741db376..43d69a16af183 100644
--- a/drivers/gpu/drm/udl/Makefile
+++ b/drivers/gpu/drm/udl/Makefile
@@ -2,6 +2,7 @@
 
 udl-y := \
udl_drv.o \
+   udl_edid.o \
udl_main.o \
udl_modeset.o \
udl_transfer.o
diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 282ebd6c02fda..f112cfb270f31 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -51,8 +51,6 @@ struct urb_list {
 
 struct udl_connector {
struct drm_connector connector;
-   /* last udl_detect edid */
-   struct edid *edid;
 };
 
 static inline struct udl_connector *to_udl_connector(struct drm_connector 
*connector)
diff --git a/drivers/gpu/drm/udl/udl_edid.c b/drivers/gpu/drm/udl/udl_edid.c
new file mode 100644
index 0..626f1badea90a
--- /dev/null
+++ b/drivers/gpu/drm/udl/udl_edid.c
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include 
+#include 
+
+#include "udl_drv.h"
+#include "udl_edid.h"
+
+static int udl_read_edid_block(void *data, u8 *buf, unsigned int block, size_t 
len)
+{
+   struct udl_device *udl = data;
+   struct drm_device *dev = &udl->drm;
+   struct usb_device *udev = udl_to_usb_device(udl);
+   u8 *read_buff;
+   int idx, ret;
+   size_t i;
+
+   read_buff = kmalloc(2, GFP_KERNEL);
+   if (!read_buff)
+   return -ENOMEM;
+
+   if (!drm_dev_enter(dev, &idx)) {
+   ret = -ENODEV;
+   goto err_kfree;
+   }
+
+   for (i = 0; i < len; i++) {
+   int bval = (i + block * EDID_LENGTH) << 8;
+
+   ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+ 0x02, (0x80 | (0x02 << 5)), bval,
+ 0xA1, read_buff, 2, USB_CTRL_GET_TIMEOUT);
+   if (ret < 0) {
+   drm_err(dev, "Read EDID byte %zu failed err %x\n", i, 
ret);
+   goto err_drm_dev_exit;
+   } else if (ret < 1) {
+   ret = -EIO;
+   drm_err(dev, "Read EDID byte %zu failed\n", i);
+   goto err_drm_dev_exit;
+   }
+
+   buf[i] = read_buff[1];
+   }
+
+   drm_dev_exit(idx);
+   kfree(read_buff);
+
+   return 0;
+
+err_drm_dev_exit:
+   drm_dev_exit(idx);
+err_kfree:
+   kfree(read_buff);
+   return ret;
+}
+
+bool udl_probe_edid(struct udl_device *udl)
+{
+   static const u8 no_edid[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00};
+   u8 hdr[8];
+   int ret;
+
+   ret = udl_read_edid_block(udl, hdr, 0, sizeof(hdr));
+   if (ret)
+   return false;
+
+   /*
+* The adapter sends all-zeros if no monitor has been
+* connected. We consider anything else a connection.
+*/
+   return memcmp(no_edid, hdr, 8) != 0;
+}
+
+const struct drm_edid *udl_edid_read(struct drm_connector *connector)
+{
+   struct udl_device *udl = to_udl(connector->dev);
+
+   return drm_edid_read_custom(connector, udl_read_edid_block, u

Re: [RESEND v7 09/37] dt-binding: Add compatible SH7750 SoC

2024-04-10 Thread Rob Herring


On Thu, 04 Apr 2024 14:14:20 +0900, Yoshinori Sato wrote:
> Signed-off-by: Yoshinori Sato 
> ---
>  Documentation/devicetree/bindings/timer/renesas,tmu.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Rob Herring 



Re: [PATCH 21/21] drm/stm: Allow build with COMPILE_TEST=y

2024-04-10 Thread Raphael Gallais-Pou
Hi Ville

On 4/8/24 19:04, Ville Syrjala wrote:
> From: Ville Syrjälä 
>
> Allow stm to be built with COMPILE_TEST=y for greater
> coverage. Builds fine on x86/x86_64 at least.
>
> Cc: Yannick Fertre 
> Cc: Raphael Gallais-Pou 
> Cc: Philippe Cornu 
> Signed-off-by: Ville Syrjälä 

Thank you for this ! :)

Acked-by: Raphaël Gallais-Pou 


> ---
>  drivers/gpu/drm/stm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/stm/Kconfig b/drivers/gpu/drm/stm/Kconfig
> index fa49cde43bb2..4c906d602825 100644
> --- a/drivers/gpu/drm/stm/Kconfig
> +++ b/drivers/gpu/drm/stm/Kconfig
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config DRM_STM
>   tristate "DRM Support for STMicroelectronics SoC Series"
> - depends on DRM && ARCH_STM32
> + depends on DRM && (ARCH_STM32 || COMPILE_TEST)
>   select DRM_KMS_HELPER
>   select DRM_GEM_DMA_HELPER
>   select DRM_PANEL_BRIDGE



Re: [RESEND v7 12/37] dt-bindings: pci: pci-sh7751: Add SH7751 PCI

2024-04-10 Thread Rob Herring
On Thu, Apr 04, 2024 at 02:14:23PM +0900, Yoshinori Sato wrote:
> Renesas SH7751 PCI Controller json-schema.
> 
> Signed-off-by: Yoshinori Sato 
> ---
>  .../bindings/pci/renesas,sh7751-pci.yaml  | 89 +++
>  1 file changed, 89 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml
> 
> diff --git a/Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml 
> b/Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml
> new file mode 100644
> index ..115c2bb67339
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml
> @@ -0,0 +1,89 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pci/renesas,sh7751-pci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas SH7751 PCI Host controller
> +
> +maintainers:
> +  - Yoshinori Sato 
> +
> +allOf:
> +  - $ref: /schemas/pci/pci-bus.yaml#
> +
> +properties:
> +  compatible:
> +const: renesas,sh7751-pci
> +
> +  reg:
> +minItems: 2
> +maxItems: 2
> +
> +  reg-names:
> +items:
> +  - const: PCI Controller
> +  - const: Bus State Controller
> +

> +  "#interrupt-cells":
> +const: 1
> +
> +  "#address-cells":
> +const: 3
> +
> +  "#size-cells":
> +const: 2
> +
> +  ranges: true
> +
> +  dma-ranges: true

All 5 of these are defined in pci-bus-common.yaml, so you can drop them.

> +
> +  interrupt-controller: true
> +
> +  renesas,bus-arbit-round-robin:
> +$ref: /schemas/types.yaml#/definitions/flag
> +description: |

Don't need '|'.

> +  Set DMA bus arbitration to round robin.
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#interrupt-cells"

> +  - "#address-cells"
> +  - "#size-cells"
> +  - ranges

These 3 are already required, so drop.

> +  - interrupt-map
> +  - interrupt-map-mask
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +#include 
> +pci@fe20 {
> +compatible = "renesas,sh7751-pci";
> +#address-cells = <3>;
> +#size-cells = <2>;
> +#interrupt-cells = <1>;
> +interrupt-controller;
> +device_type = "pci";
> +bus-range = <0 0>;
> +ranges = <0x0200 0 0xfd00 0xfd00 0 0x0100>,
> + <0x0100 0 0x 0xfe24 0 0x0004>;
> +dma-ranges = <0x0200 0 0xc00 0x0c00 0 0x0400>;
> +reg = <0xfe20 0x0400>,
> +  <0xff80 0x0100>;
> +interrupt-map = <0x 0 0 1 &julianintc 5 IRQ_TYPE_LEVEL_LOW>,
> +<0x 0 0 2 &julianintc 6 IRQ_TYPE_LEVEL_LOW>,
> +<0x 0 0 3 &julianintc 7 IRQ_TYPE_LEVEL_LOW>,
> +<0x 0 0 4 &julianintc 8 IRQ_TYPE_LEVEL_LOW>,
> +<0x0800 0 0 1 &julianintc 6 IRQ_TYPE_LEVEL_LOW>,
> +<0x0800 0 0 2 &julianintc 7 IRQ_TYPE_LEVEL_LOW>,
> +<0x0800 0 0 3 &julianintc 8 IRQ_TYPE_LEVEL_LOW>,
> +<0x0800 0 0 4 &julianintc 5 IRQ_TYPE_LEVEL_LOW>,
> +<0x1000 0 0 1 &julianintc 7 IRQ_TYPE_LEVEL_LOW>,
> +<0x1000 0 0 2 &julianintc 8 IRQ_TYPE_LEVEL_LOW>,
> +<0x1000 0 0 3 &julianintc 5 IRQ_TYPE_LEVEL_LOW>,
> +<0x1000 0 0 4 &julianintc 6 IRQ_TYPE_LEVEL_LOW>;
> +interrupt-map-mask = <0x1800 0 0 7>;
> +};
> -- 
> 2.39.2
> 


Re: [PATCH 1/3] drm/ast: Set DDC timeout in milliseconds

2024-04-10 Thread Jocelyn Falempe

Hi,

Thanks for the patch, it looks good to me.

Reviewed-by: Jocelyn Falempe 

--

Jocelyn


On 03/04/2024 12:31, Thomas Zimmermann wrote:

Compute the i2c timeout in jiffies from a value in milliseconds. The
original values of 2 jiffies equals 2 milliseconds if HZ has been
configured to a value of 1000. This corresponds to 2.2 milliseconds
used by most other DRM drivers. Update ast accordingly.

Signed-off-by: Thomas Zimmermann 
Fixes: 312fec1405dd ("drm: Initial KMS driver for AST (ASpeed Technologies) 2000 
series (v2)")
Cc: Dave Airlie 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Thomas Zimmermann 
Cc: Jocelyn Falempe 
Cc: dri-devel@lists.freedesktop.org
Cc:  # v3.5+
---
  drivers/gpu/drm/ast/ast_ddc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_ddc.c b/drivers/gpu/drm/ast/ast_ddc.c
index b7718084422f3..3e156a6b6831d 100644
--- a/drivers/gpu/drm/ast/ast_ddc.c
+++ b/drivers/gpu/drm/ast/ast_ddc.c
@@ -153,7 +153,7 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast)
  
  	bit = &ddc->bit;

bit->udelay = 20;
-   bit->timeout = 2;
+   bit->timeout = usecs_to_jiffies(2200);
bit->data = ddc;
bit->setsda = ast_ddc_algo_bit_data_setsda;
bit->setscl = ast_ddc_algo_bit_data_setscl;




Re: [PATCH 2/3] drm/ast: Group DDC init code by data structure

2024-04-10 Thread Jocelyn Falempe

Hi,

Thanks for the patch, it looks good to me.

Reviewed-by: Jocelyn Falempe 

--

Jocelyn

On 03/04/2024 12:31, Thomas Zimmermann wrote:

Reorder the code to set up the DDC channel by data structure, so
that each data structure's init is in a separate block: first the
bit algo then the i2c adapter. Makes the code more readable. No
functional changes.

Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/ast/ast_ddc.c | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_ddc.c b/drivers/gpu/drm/ast/ast_ddc.c
index 3e156a6b6831d..4df52aeba4f7e 100644
--- a/drivers/gpu/drm/ast/ast_ddc.c
+++ b/drivers/gpu/drm/ast/ast_ddc.c
@@ -145,15 +145,7 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast)
return ERR_PTR(-ENOMEM);
ddc->ast = ast;
  
-	adapter = &ddc->adapter;

-   adapter->owner = THIS_MODULE;
-   adapter->dev.parent = dev->dev;
-   i2c_set_adapdata(adapter, ddc);
-   snprintf(adapter->name, sizeof(adapter->name), "AST DDC bus");
-
bit = &ddc->bit;
-   bit->udelay = 20;
-   bit->timeout = usecs_to_jiffies(2200);
bit->data = ddc;
bit->setsda = ast_ddc_algo_bit_data_setsda;
bit->setscl = ast_ddc_algo_bit_data_setscl;
@@ -161,8 +153,16 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast)
bit->getscl = ast_ddc_algo_bit_data_getscl;
bit->pre_xfer = ast_ddc_algo_bit_data_pre_xfer;
bit->post_xfer = ast_ddc_algo_bit_data_post_xfer;
+   bit->udelay = 20;
+   bit->timeout = usecs_to_jiffies(2200);
  
+	adapter = &ddc->adapter;

+   adapter->owner = THIS_MODULE;
adapter->algo_data = bit;
+   adapter->dev.parent = dev->dev;
+   snprintf(adapter->name, sizeof(adapter->name), "AST DDC bus");
+   i2c_set_adapdata(adapter, ddc);
+
ret = i2c_bit_add_bus(adapter);
if (ret) {
drm_err(dev, "Failed to register bit i2c\n");




[PATCH v2] drm: Document requirements for driver-specific KMS props in new drivers

2024-04-10 Thread Sebastian Wick


When extending support for a driver-specific KMS property to additional
drivers, we should apply all the requirements for new properties and
make sure the semantics are the same and documented.

v2: devs of the driver which introduced property shall help and ack

Signed-off-by: Sebastian Wick 
Acked-by: Maxime Ripard 
Acked-by: Daniel Vetter 
---
 Documentation/gpu/drm-kms.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 13d3627d8bc0..b98b98359c90 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -496,6 +496,13 @@ addition to the one mentioned above:
 
 * An IGT test must be submitted where reasonable.
 
+For historical reasons, non-standard, driver-specific properties exist. If a 
KMS
+driver wants to add support for one of those properties, the requirements for
+new properties apply where possible. Additionally, the documented behavior must
+match the de facto semantics of the existing property to ensure compatibility.
+Developers of the driver that first added the property should help with those
+tasks and must ACK the documented behavior if possible.
+
 Property Types and Blob Property Support
 
 
-- 
2.44.0



Re: [PATCH 3/3] drm/ast: Define struct ast_ddc in ast_ddc.c

2024-04-10 Thread Jocelyn Falempe

Hi,

Thanks for the patch, it looks good to me.

Reviewed-by: Jocelyn Falempe 

--

Jocelyn

On 03/04/2024 12:31, Thomas Zimmermann wrote:

Move the definition of struct ast_ddc to ast_ddc.c and return the i2c
adapter from ast_ddc_create(). Update callers accordingly. Avoids
including Linux i2c header files, except where required. No functional
changes.

Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/ast/ast_ddc.c  | 14 --
  drivers/gpu/drm/ast/ast_ddc.h  | 13 ++---
  drivers/gpu/drm/ast/ast_mode.c |  8 
  3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_ddc.c b/drivers/gpu/drm/ast/ast_ddc.c
index 4df52aeba4f7e..29cf5d157f344 100644
--- a/drivers/gpu/drm/ast/ast_ddc.c
+++ b/drivers/gpu/drm/ast/ast_ddc.c
@@ -21,12 +21,22 @@
   * of the Software.
   */
  
+#include 

+#include 
+
  #include 
  #include 
  
  #include "ast_ddc.h"

  #include "ast_drv.h"
  
+struct ast_ddc {

+   struct ast_device *ast;
+
+   struct i2c_algo_bit_data bit;
+   struct i2c_adapter adapter;
+};
+
  static void ast_ddc_algo_bit_data_setsda(void *data, int state)
  {
struct ast_ddc *ddc = data;
@@ -132,7 +142,7 @@ static void ast_ddc_release(struct drm_device *dev, void 
*res)
i2c_del_adapter(&ddc->adapter);
  }
  
-struct ast_ddc *ast_ddc_create(struct ast_device *ast)

+struct i2c_adapter *ast_ddc_create(struct ast_device *ast)
  {
struct drm_device *dev = &ast->base;
struct ast_ddc *ddc;
@@ -173,5 +183,5 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast)
if (ret)
return ERR_PTR(ret);
  
-	return ddc;

+   return &ddc->adapter;
  }
diff --git a/drivers/gpu/drm/ast/ast_ddc.h b/drivers/gpu/drm/ast/ast_ddc.h
index 08f3994e09ccd..85c93edc9ae12 100644
--- a/drivers/gpu/drm/ast/ast_ddc.h
+++ b/drivers/gpu/drm/ast/ast_ddc.h
@@ -3,18 +3,9 @@
  #ifndef __AST_DDC_H__
  #define __AST_DDC_H__
  
-#include 

-#include 
-
  struct ast_device;
+struct i2c_adapter;
  
-struct ast_ddc {

-   struct ast_device *ast;
-
-   struct i2c_adapter adapter;
-   struct i2c_algo_bit_data bit;
-};
-
-struct ast_ddc *ast_ddc_create(struct ast_device *ast);
+struct i2c_adapter *ast_ddc_create(struct ast_device *ast);
  
  #endif

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index bb9b66aba9ee9..ae21d89b899c8 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -1360,7 +1360,7 @@ static const struct drm_connector_funcs 
ast_vga_connector_funcs = {
  static int ast_vga_connector_init(struct drm_device *dev, struct 
drm_connector *connector)
  {
struct ast_device *ast = to_ast_device(dev);
-   struct ast_ddc *ddc;
+   struct i2c_adapter *ddc;
int ret;
  
  	ddc = ast_ddc_create(ast);

@@ -1371,7 +1371,7 @@ static int ast_vga_connector_init(struct drm_device *dev, 
struct drm_connector *
}
  
  	ret = drm_connector_init_with_ddc(dev, connector, &ast_vga_connector_funcs,

- DRM_MODE_CONNECTOR_VGA, 
&ddc->adapter);
+ DRM_MODE_CONNECTOR_VGA, ddc);
if (ret)
return ret;
  
@@ -1429,7 +1429,7 @@ static const struct drm_connector_funcs ast_sil164_connector_funcs = {

  static int ast_sil164_connector_init(struct drm_device *dev, struct 
drm_connector *connector)
  {
struct ast_device *ast = to_ast_device(dev);
-   struct ast_ddc *ddc;
+   struct i2c_adapter *ddc;
int ret;
  
  	ddc = ast_ddc_create(ast);

@@ -1440,7 +1440,7 @@ static int ast_sil164_connector_init(struct drm_device 
*dev, struct drm_connecto
}
  
  	ret = drm_connector_init_with_ddc(dev, connector, &ast_sil164_connector_funcs,

- DRM_MODE_CONNECTOR_DVII, 
&ddc->adapter);
+ DRM_MODE_CONNECTOR_DVII, ddc);
if (ret)
return ret;
  




Re: [PATCH v12 4/7] drm/meson: gate px_clk when setting rate

2024-04-10 Thread Nicolas Belin
Le mer. 3 avr. 2024 à 09:46, Neil Armstrong
 a écrit :
>
> Disable the px_clk when setting the rate to recover a fully
> configured and correctly reset VCLK clock tree after the rate
> is set.
>
> Fixes: 77d9e1e6b846 ("drm/meson: add support for MIPI-DSI transceiver")
> Signed-off-by: Neil Armstrong 
> ---
>  drivers/gpu/drm/meson/meson_dw_mipi_dsi.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c 
> b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> index a6bc1bdb3d0d..a10cff3ca1fe 100644
> --- a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> @@ -95,6 +95,7 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
> return ret;
> }
>
> +   clk_disable_unprepare(mipi_dsi->px_clk);
> ret = clk_set_rate(mipi_dsi->px_clk, mipi_dsi->mode->clock * 1000);
>
> if (ret) {
> @@ -103,6 +104,12 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
> return ret;
> }
>
> +   ret = clk_prepare_enable(mipi_dsi->px_clk);
> +   if (ret) {
> +   dev_err(mipi_dsi->dev, "Failed to enable DSI Pixel clock (ret 
> %d)\n", ret);
> +   return ret;
> +   }
> +
> switch (mipi_dsi->dsi_device->format) {
> case MIPI_DSI_FMT_RGB888:
> dpi_data_format = DPI_COLOR_24BIT;
>
> --
> 2.34.1
>

Looks good to me

Reviewed-by: Nicolas Belin 


Re: [PATCH v10 1/3] drm/buddy: Implement tracking clear page feature

2024-04-10 Thread Matthew Auld

On 08/04/2024 16:16, Arunpravin Paneer Selvam wrote:

- Add tracking clear page feature.

- Driver should enable the DRM_BUDDY_CLEARED flag if it
   successfully clears the blocks in the free path. On the otherhand,
   DRM buddy marks each block as cleared.

- Track the available cleared pages size

- If driver requests cleared memory we prefer cleared memory
   but fallback to uncleared if we can't find the cleared blocks.
   when driver requests uncleared memory we try to use uncleared but
   fallback to cleared memory if necessary.

- When a block gets freed we clear it and mark the freed block as cleared,
   when there are buddies which are cleared as well we can merge them.
   Otherwise, we prefer to keep the blocks as separated.

- Add a function to support defragmentation.

v1:
   - Depends on the flag check DRM_BUDDY_CLEARED, enable the block as
 cleared. Else, reset the clear flag for each block in the list(Christian)
   - For merging the 2 cleared blocks compare as below,
 drm_buddy_is_clear(block) != drm_buddy_is_clear(buddy)(Christian)
   - Defragment the memory beginning from min_order
 till the required memory space is available.

v2: (Matthew)
   - Add a wrapper drm_buddy_free_list_internal for the freeing of blocks
 operation within drm buddy.
   - Write a macro block_incompatible() to allocate the required blocks.
   - Update the xe driver for the drm_buddy_free_list change in arguments.
   - add a warning if the two blocks are incompatible on
 defragmentation
   - call full defragmentation in the fini() function
   - place a condition to test if min_order is equal to 0
   - replace the list with safe_reverse() variant as we might
 remove the block from the list.

v3:
   - fix Gitlab user reported lockup issue.
   - Keep DRM_BUDDY_HEADER_CLEAR define sorted(Matthew)
   - modify to pass the root order instead max_order in fini()
 function(Matthew)
   - change bool 1 to true(Matthew)
   - add check if min_block_size is power of 2(Matthew)
   - modify the min_block_size datatype to u64(Matthew)

v4:
   - rename the function drm_buddy_defrag with __force_merge.
   - Include __force_merge directly in drm buddy file and remove
 the defrag use in amdgpu driver.
   - Remove list_empty() check(Matthew)
   - Remove unnecessary space, headers and placement of new variables(Matthew)
   - Add a unit test case(Matthew)

v5:
   - remove force merge support to actual range allocation and not to bail
 out when contains && split(Matthew)
   - add range support to force merge function.

Signed-off-by: Arunpravin Paneer Selvam 
Signed-off-by: Matthew Auld 
Suggested-by: Christian König 
Suggested-by: Matthew Auld 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c  |   6 +-
  drivers/gpu/drm/drm_buddy.c   | 430 ++
  drivers/gpu/drm/i915/i915_ttm_buddy_manager.c |   6 +-
  drivers/gpu/drm/tests/drm_buddy_test.c|  28 +-
  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c  |   4 +-
  include/drm/drm_buddy.h   |  16 +-
  6 files changed, 368 insertions(+), 122 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 8db880244324..c0c851409241 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -571,7 +571,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager 
*man,
return 0;
  
  error_free_blocks:

-   drm_buddy_free_list(mm, &vres->blocks);
+   drm_buddy_free_list(mm, &vres->blocks, 0);
mutex_unlock(&mgr->lock);
  error_fini:
ttm_resource_fini(man, &vres->base);
@@ -604,7 +604,7 @@ static void amdgpu_vram_mgr_del(struct ttm_resource_manager 
*man,
  
  	amdgpu_vram_mgr_do_reserve(man);
  
-	drm_buddy_free_list(mm, &vres->blocks);

+   drm_buddy_free_list(mm, &vres->blocks, 0);
mutex_unlock(&mgr->lock);
  
  	atomic64_sub(vis_usage, &mgr->vis_usage);

@@ -912,7 +912,7 @@ void amdgpu_vram_mgr_fini(struct amdgpu_device *adev)
kfree(rsv);
  
  	list_for_each_entry_safe(rsv, temp, &mgr->reserved_pages, blocks) {

-   drm_buddy_free_list(&mgr->mm, &rsv->allocated);
+   drm_buddy_free_list(&mgr->mm, &rsv->allocated, 0);
kfree(rsv);
}
if (!adev->gmc.is_app_apu)
diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 5ebdd6f8f36e..83dbe252f727 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -38,8 +38,8 @@ static void drm_block_free(struct drm_buddy *mm,
kmem_cache_free(slab_blocks, block);
  }
  
-static void list_insert_sorted(struct drm_buddy *mm,

-  struct drm_buddy_block *block)
+static void list_insert(struct drm_buddy *mm,
+   struct drm_buddy_block *block)


Why the change here?


  {
struct drm_buddy_block *node;
struct list_head *head;
@@ -57,6 +57,

[PATCH v2 08/43] drm/fbdev: Add fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Add an fbdev emulation for SHMEM-based memory managers. The code is
similar to fbdev-generic, but does not require an addition shadow
buffer for mmap(). Fbdev-shmem operates directly on the buffer object's
SHMEM pages. Fbdev's deferred-I/O mechanism updates the hardware state
on write operations.

v2:
- use drm_driver_legacy_fb_format() (Geert)

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/Makefile  |   1 +
 drivers/gpu/drm/drm_fbdev_shmem.c | 316 ++
 include/drm/drm_fbdev_shmem.h |  15 ++
 3 files changed, 332 insertions(+)
 create mode 100644 drivers/gpu/drm/drm_fbdev_shmem.c
 create mode 100644 include/drm/drm_fbdev_shmem.h

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index a73c04d2d7a39..50a2f0cffdac2 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -107,6 +107,7 @@ drm_dma_helper-$(CONFIG_DRM_KMS_HELPER) += 
drm_fb_dma_helper.o
 obj-$(CONFIG_DRM_GEM_DMA_HELPER) += drm_dma_helper.o
 
 drm_shmem_helper-y := drm_gem_shmem_helper.o
+drm_shmem_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fbdev_shmem.o
 obj-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_shmem_helper.o
 
 drm_suballoc_helper-y := drm_suballoc.o
diff --git a/drivers/gpu/drm/drm_fbdev_shmem.c 
b/drivers/gpu/drm/drm_fbdev_shmem.c
new file mode 100644
index 0..a85a8a8e2eb8b
--- /dev/null
+++ b/drivers/gpu/drm/drm_fbdev_shmem.c
@@ -0,0 +1,316 @@
+// SPDX-License-Identifier: MIT
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/*
+ * struct fb_ops
+ */
+
+static int drm_fbdev_shmem_fb_open(struct fb_info *info, int user)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+
+   /* No need to take a ref for fbcon because it unbinds on unregister */
+   if (user && !try_module_get(fb_helper->dev->driver->fops->owner))
+   return -ENODEV;
+
+   return 0;
+}
+
+static int drm_fbdev_shmem_fb_release(struct fb_info *info, int user)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+
+   if (user)
+   module_put(fb_helper->dev->driver->fops->owner);
+
+   return 0;
+}
+
+FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(drm_fbdev_shmem,
+  drm_fb_helper_damage_range,
+  drm_fb_helper_damage_area);
+
+static int drm_fbdev_shmem_fb_mmap(struct fb_info *info, struct vm_area_struct 
*vma)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+   struct drm_framebuffer *fb = fb_helper->fb;
+   struct drm_gem_object *obj = drm_gem_fb_get_obj(fb, 0);
+   struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
+
+   if (shmem->map_wc)
+   vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+
+   return fb_deferred_io_mmap(info, vma);
+}
+
+static void drm_fbdev_shmem_fb_destroy(struct fb_info *info)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+
+   if (!fb_helper->dev)
+   return;
+
+   drm_fb_helper_fini(fb_helper);
+
+   drm_client_buffer_vunmap(fb_helper->buffer);
+   drm_client_framebuffer_delete(fb_helper->buffer);
+   drm_client_release(&fb_helper->client);
+   drm_fb_helper_unprepare(fb_helper);
+   kfree(fb_helper);
+}
+
+static const struct fb_ops drm_fbdev_shmem_fb_ops = {
+   .owner = THIS_MODULE,
+   .fb_open = drm_fbdev_shmem_fb_open,
+   .fb_release = drm_fbdev_shmem_fb_release,
+   __FB_DEFAULT_DEFERRED_OPS_RDWR(drm_fbdev_shmem),
+   DRM_FB_HELPER_DEFAULT_OPS,
+   __FB_DEFAULT_DEFERRED_OPS_DRAW(drm_fbdev_shmem),
+   .fb_mmap = drm_fbdev_shmem_fb_mmap,
+   .fb_destroy = drm_fbdev_shmem_fb_destroy,
+};
+
+static struct page *drm_fbdev_shmem_get_page(struct fb_info *info, unsigned 
long offset)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+   struct drm_framebuffer *fb = fb_helper->fb;
+   struct drm_gem_object *obj = drm_gem_fb_get_obj(fb, 0);
+   struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
+   unsigned int i = offset >> PAGE_SHIFT;
+   struct page *page;
+
+   if (fb_WARN_ON_ONCE(info, offset > obj->size))
+   return NULL;
+
+   page = shmem->pages[i]; // protected by active vmap
+   if (page)
+   get_page(page);
+   fb_WARN_ON_ONCE(info, !page);
+
+   return page;
+}
+
+/*
+ * struct drm_fb_helper
+ */
+
+static int drm_fbdev_shmem_helper_fb_probe(struct drm_fb_helper *fb_helper,
+  struct drm_fb_helper_surface_size 
*sizes)
+{
+   struct drm_client_dev *client = &fb_helper->client;
+   struct drm_device *dev = fb_helper->dev;
+   struct drm_client_buffer *buffer;
+   struct drm_gem_shmem_object *shmem;
+   struct drm_framebuffer *fb;
+   struct fb_info *info;
+   u32 format;
+   struct iosys_map map;
+   int ret;
+
+   drm_dbg_kms(dev, "surface width(%d), height(%d) and bpp(%d)\n",
+  

[PATCH v2 04/43] fbdev/deferred-io: Test screen_buffer for vmalloc'ed memory

2024-04-10 Thread Thomas Zimmermann
Framebuffers in virtual memory are available via screen_buffer. Use
it instead of screen_base and avoid the type casting.

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/video/fbdev/core/fb_defio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_defio.c 
b/drivers/video/fbdev/core/fb_defio.c
index f23b1cbe67192..b38f775cd39dd 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -25,11 +25,11 @@
 
 static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long 
offs)
 {
-   void *screen_base = (void __force *) info->screen_base;
+   const void *screen_buffer = info->screen_buffer;
struct page *page;
 
-   if (is_vmalloc_addr(screen_base + offs))
-   page = vmalloc_to_page(screen_base + offs);
+   if (is_vmalloc_addr(screen_buffer + offs))
+   page = vmalloc_to_page(screen_buffer + offs);
else
page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT);
 
-- 
2.44.0



[PATCH v2 03/43] fbdev/deferred-io: Clean up pageref on lastclose

2024-04-10 Thread Thomas Zimmermann
Clean up the pageref state as part of the lastclose helper. This
only requires to clear the page's mapping field. The pageref and
page can stay in place for the next opened instance of the frame-
buffer file.

With the change in the clean-up logic, there's no further need
to look up pages during the lastclose cleanup. The code instead
uses the existing pagerefs in its look-up table. It also avoids
using smem_len, which some driver might not set correctly.

v2:
- fix typos in commit message (Javier)

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/video/fbdev/core/fb_defio.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_defio.c 
b/drivers/video/fbdev/core/fb_defio.c
index bff1e300ed6bb..f23b1cbe67192 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -62,6 +62,14 @@ static struct fb_deferred_io_pageref 
*fb_deferred_io_pageref_lookup(struct fb_in
return pageref;
 }
 
+static void fb_deferred_io_pageref_clear(struct fb_deferred_io_pageref 
*pageref)
+{
+   struct page *page = pageref->page;
+
+   if (page)
+   page->mapping = NULL;
+}
+
 static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct 
fb_info *info,
 unsigned long 
offset,
 struct page 
*page)
@@ -330,16 +338,13 @@ EXPORT_SYMBOL_GPL(fb_deferred_io_open);
 
 static void fb_deferred_io_lastclose(struct fb_info *info)
 {
-   struct page *page;
-   int i;
+   unsigned long i;
 
flush_delayed_work(&info->deferred_work);
 
/* clear out the mapping that we setup */
-   for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) {
-   page = fb_deferred_io_page(info, i);
-   page->mapping = NULL;
-   }
+   for (i = 0; i < info->npagerefs; ++i)
+   fb_deferred_io_pageref_clear(&info->pagerefs[i]);
 }
 
 void fb_deferred_io_release(struct fb_info *info)
-- 
2.44.0



[PATCH v2 01/43] drm/fbdev-generic: Do not set physical framebuffer address

2024-04-10 Thread Thomas Zimmermann
Framebuffer memory is allocated via vzalloc() from non-contiguous
physical pages. The physical framebuffer start address is therefore
meaningless. Do not set it.

The value is not used within the kernel and only exported to userspace
on dedicated ARM configs. No functional change is expected.

v2:
- refer to vzalloc() in commit message (Javier)

Signed-off-by: Thomas Zimmermann 
Fixes: a5b44c4adb16 ("drm/fbdev-generic: Always use shadow buffering")
Cc: Thomas Zimmermann 
Cc: Javier Martinez Canillas 
Cc: Zack Rusin 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc:  # v6.4+
Reviewed-by: Javier Martinez Canillas 
Reviewed-by: Zack Rusin 
Reviewed-by: Sui Jingfeng 
Tested-by: Sui Jingfeng 
---
 drivers/gpu/drm/drm_fbdev_generic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fbdev_generic.c 
b/drivers/gpu/drm/drm_fbdev_generic.c
index be357f926faec..97e579c33d84a 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -113,7 +113,6 @@ static int drm_fbdev_generic_helper_fb_probe(struct 
drm_fb_helper *fb_helper,
/* screen */
info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
info->screen_buffer = screen_buffer;
-   info->fix.smem_start = 
page_to_phys(vmalloc_to_page(info->screen_buffer));
info->fix.smem_len = screen_size;
 
/* deferred I/O */
-- 
2.44.0



[PATCH v2 07/43] fbdev/deferred-io: Provide get_page hook in struct fb_deferred_io

2024-04-10 Thread Thomas Zimmermann
Add a callback for drivers to provide framebuffer pages to fbdev's
deferred-I/O helpers. Implementations need to acquire a reference on
the page before returning it. Returning NULL generates a SIGBUS
signal.

This will be useful for DRM's fbdev emulation with GEM-shmem buffer
objects.

v2:
- fix typo in commit message (Javier)

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/video/fbdev/core/fb_defio.c | 4 
 include/linux/fb.h  | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/video/fbdev/core/fb_defio.c 
b/drivers/video/fbdev/core/fb_defio.c
index 6e0bbcfdb01b5..51928ff7961a5 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -25,9 +25,13 @@
 
 static struct page *fb_deferred_io_get_page(struct fb_info *info, unsigned 
long offs)
 {
+   struct fb_deferred_io *fbdefio = info->fbdefio;
const void *screen_buffer = info->screen_buffer;
struct page *page = NULL;
 
+   if (fbdefio->get_page)
+   return fbdefio->get_page(info, offs);
+
if (is_vmalloc_addr(screen_buffer + offs))
page = vmalloc_to_page(screen_buffer + offs);
else if (info->fix.smem_start)
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 3417103885e27..4eb6afa93737c 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -225,6 +225,7 @@ struct fb_deferred_io {
struct mutex lock; /* mutex that protects the pageref list */
struct list_head pagereflist; /* list of pagerefs for touched pages */
/* callback */
+   struct page *(*get_page)(struct fb_info *info, unsigned long offset);
void (*deferred_io)(struct fb_info *info, struct list_head *pagelist);
 };
 #endif
-- 
2.44.0



[PATCH v2 19/43] drm/virtio: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: David Airlie 
Cc: Gerd Hoffmann 
Cc: Gurchetan Singh 
Cc: Chia-I Wu 
Tested-by: Dmitry Osipenko 
---
 drivers/gpu/drm/virtio/virtgpu_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c 
b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 9539aa28937fa..3d626bbaab9e4 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -35,7 +35,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "virtgpu_drv.h"
@@ -103,7 +103,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
if (ret)
goto err_deinit;
 
-   drm_fbdev_generic_setup(vdev->priv, 32);
+   drm_fbdev_shmem_setup(vdev->priv, 32);
return 0;
 
 err_deinit:
-- 
2.44.0



[PATCH v2 20/43] drm/vkms: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Rodrigo Siqueira 
Cc: Melissa Wen 
Cc: "Maíra Canal" 
Cc: Haneen Mohammed 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/vkms/vkms_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index dd0af086e7fa9..8dc9dc13896e9 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -223,7 +223,7 @@ static int vkms_create(struct vkms_config *config)
if (ret)
goto out_devres;
 
-   drm_fbdev_generic_setup(&vkms_device->drm, 0);
+   drm_fbdev_shmem_setup(&vkms_device->drm, 0);
 
return 0;
 
-- 
2.44.0



[PATCH v2 06/43] fbdev/deferred-io: Always call get_page() for framebuffer pages

2024-04-10 Thread Thomas Zimmermann
Unconditionally call get_page() after looking up a page from the
framebuffer memory. Guarantees that we always hold a reference.

This change also refactors the code such that it can support a
driver-supplied get_page helper. This will be useful for DRM's
fbdev emulation.

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/video/fbdev/core/fb_defio.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_defio.c 
b/drivers/video/fbdev/core/fb_defio.c
index fe84218ded457..6e0bbcfdb01b5 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long 
offs)
+static struct page *fb_deferred_io_get_page(struct fb_info *info, unsigned 
long offs)
 {
const void *screen_buffer = info->screen_buffer;
struct page *page = NULL;
@@ -33,6 +33,9 @@ static struct page *fb_deferred_io_page(struct fb_info *info, 
unsigned long offs
else if (info->fix.smem_start)
page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT);
 
+   if (page)
+   get_page(page);
+
return page;
 }
 
@@ -129,12 +132,10 @@ static vm_fault_t fb_deferred_io_fault(struct vm_fault 
*vmf)
if (offset >= info->fix.smem_len)
return VM_FAULT_SIGBUS;
 
-   page = fb_deferred_io_page(info, offset);
+   page = fb_deferred_io_get_page(info, offset);
if (!page)
return VM_FAULT_SIGBUS;
 
-   get_page(page);
-
if (vmf->vma->vm_file)
page->mapping = vmf->vma->vm_file->f_mapping;
else
-- 
2.44.0



[PATCH v2 09/43] drm/ast: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Dave Airlie 
Cc: Thomas Zimmermann 
Cc: Jocelyn Falempe 
Reviewed-by: Jocelyn Falempe 
---
 drivers/gpu/drm/ast/ast_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index f8c49ba68e789..aae019e79bda8 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -33,7 +33,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -360,7 +360,7 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
if (ret)
return ret;
 
-   drm_fbdev_generic_setup(drm, 32);
+   drm_fbdev_shmem_setup(drm, 32);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 02/43] fbdev/deferred-io: Move pageref setup into separate helper

2024-04-10 Thread Thomas Zimmermann
Set up struct fb_deferred_io_pageref in the new helper function
fb_deferred_io_pageref_lookup(), which runs when the pageref is first
taken. Remove the setup code from the rest of the code.

At first, the code allocates the memory of all pageref structs. The
setup of the various fields happens when the pageref is required.

v2:
- fix typo in commit message (Javier)

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/video/fbdev/core/fb_defio.c | 42 -
 1 file changed, 30 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_defio.c 
b/drivers/video/fbdev/core/fb_defio.c
index dae96c9f61cf8..bff1e300ed6bb 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -36,20 +36,43 @@ static struct page *fb_deferred_io_page(struct fb_info 
*info, unsigned long offs
return page;
 }
 
+static struct fb_deferred_io_pageref *fb_deferred_io_pageref_lookup(struct 
fb_info *info,
+   unsigned 
long offset,
+   struct page 
*page)
+{
+   unsigned long pgoff = offset >> PAGE_SHIFT;
+   struct fb_deferred_io_pageref *pageref;
+
+   if (fb_WARN_ON_ONCE(info, pgoff >= info->npagerefs))
+   return NULL; /* incorrect allocation size */
+
+   /* 1:1 mapping between pageref and page offset */
+   pageref = &info->pagerefs[pgoff];
+
+   if (pageref->page)
+   goto out;
+
+   pageref->page = page;
+   pageref->offset = pgoff << PAGE_SHIFT;
+   INIT_LIST_HEAD(&pageref->list);
+
+out:
+   if (fb_WARN_ON_ONCE(info, pageref->page != page))
+   return NULL; /* inconsistent state */
+   return pageref;
+}
+
 static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct 
fb_info *info,
 unsigned long 
offset,
 struct page 
*page)
 {
struct fb_deferred_io *fbdefio = info->fbdefio;
struct list_head *pos = &fbdefio->pagereflist;
-   unsigned long pgoff = offset >> PAGE_SHIFT;
struct fb_deferred_io_pageref *pageref, *cur;
 
-   if (WARN_ON_ONCE(pgoff >= info->npagerefs))
-   return NULL; /* incorrect allocation size */
-
-   /* 1:1 mapping between pageref and page offset */
-   pageref = &info->pagerefs[pgoff];
+   pageref = fb_deferred_io_pageref_lookup(info, offset, page);
+   if (!pageref)
+   return NULL;
 
/*
 * This check is to catch the case where a new process could start
@@ -60,9 +83,6 @@ static struct fb_deferred_io_pageref 
*fb_deferred_io_pageref_get(struct fb_info
if (!list_empty(&pageref->list))
goto pageref_already_added;
 
-   pageref->page = page;
-   pageref->offset = pgoff << PAGE_SHIFT;
-
if (unlikely(fbdefio->sort_pagereflist)) {
/*
 * We loop through the list of pagerefs before adding in
@@ -264,7 +284,7 @@ int fb_deferred_io_init(struct fb_info *info)
 {
struct fb_deferred_io *fbdefio = info->fbdefio;
struct fb_deferred_io_pageref *pagerefs;
-   unsigned long npagerefs, i;
+   unsigned long npagerefs;
int ret;
 
BUG_ON(!fbdefio);
@@ -286,8 +306,6 @@ int fb_deferred_io_init(struct fb_info *info)
ret = -ENOMEM;
goto err;
}
-   for (i = 0; i < npagerefs; ++i)
-   INIT_LIST_HEAD(&pagerefs[i].list);
info->npagerefs = npagerefs;
info->pagerefs = pagerefs;
 
-- 
2.44.0



[PATCH v2 23/43] drm/hisilicon/kirin: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by kirin. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Xinliang Liu 
Cc: Tian Tao 
Cc: Xinwei Kong 
Cc: Sumit Semwal 
Cc: Yongqin Liu 
Cc: John Stultz 
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 75292a2f46445..12666985686b9 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -237,7 +237,7 @@ static int kirin_drm_bind(struct device *dev)
if (ret)
goto err_kms_cleanup;
 
-   drm_fbdev_generic_setup(drm_dev, 32);
+   drm_fbdev_dma_setup(drm_dev, 32);
 
return 0;
 
-- 
2.44.0



[PATCH v2 10/43] drm/gud: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: "Noralf Trønnes" 
Acked-by: Noralf Trønnes 
---
 drivers/gpu/drm/gud/gud_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
index 9d7bf8ee45f13..4f5aa2e5cb890 100644
--- a/drivers/gpu/drm/gud/gud_drv.c
+++ b/drivers/gpu/drm/gud/gud_drv.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -622,7 +622,7 @@ static int gud_probe(struct usb_interface *intf, const 
struct usb_device_id *id)
 
drm_kms_helper_poll_init(drm);
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_shmem_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 34/43] drm/tiny/ili9225: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by ili9225. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: David Lechner 
Acked-by: David Lechner 
---
 drivers/gpu/drm/tiny/ili9225.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c
index dd8b0a181be94..537df5f5b8a6e 100644
--- a/drivers/gpu/drm/tiny/ili9225.c
+++ b/drivers/gpu/drm/tiny/ili9225.c
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -426,7 +426,7 @@ static int ili9225_probe(struct spi_device *spi)
 
spi_set_drvdata(spi, drm);
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_dma_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 21/43] drm/fbdev-dma: Implement damage handling and deferred I/O

2024-04-10 Thread Thomas Zimmermann
Add support for damage handling and deferred I/O to fbdev-dma. This
enables fbdev-dma to support all DMA-memory-based DRM drivers, even
such with a dirty callback in their framebuffers.

The patch adds the code for deferred I/O and also sets a dedicated
helper for struct fb_ops.fb_mmap that support coherent mappings.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/drm_fbdev_dma.c | 65 ++---
 1 file changed, 51 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 6c9427bb4053b..8ffd072368bca 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -4,6 +4,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -35,6 +36,22 @@ static int drm_fbdev_dma_fb_release(struct fb_info *info, 
int user)
return 0;
 }
 
+FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(drm_fbdev_dma,
+  drm_fb_helper_damage_range,
+  drm_fb_helper_damage_area);
+
+static int drm_fbdev_dma_fb_mmap(struct fb_info *info, struct vm_area_struct 
*vma)
+{
+   struct drm_fb_helper *fb_helper = info->par;
+   struct drm_framebuffer *fb = fb_helper->fb;
+   struct drm_gem_dma_object *dma = drm_fb_dma_get_gem_obj(fb, 0);
+
+   if (!dma->map_noncoherent)
+   vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+
+   return fb_deferred_io_mmap(info, vma);
+}
+
 static void drm_fbdev_dma_fb_destroy(struct fb_info *info)
 {
struct drm_fb_helper *fb_helper = info->par;
@@ -51,20 +68,13 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info)
kfree(fb_helper);
 }
 
-static int drm_fbdev_dma_fb_mmap(struct fb_info *info, struct vm_area_struct 
*vma)
-{
-   struct drm_fb_helper *fb_helper = info->par;
-
-   return drm_gem_prime_mmap(fb_helper->buffer->gem, vma);
-}
-
 static const struct fb_ops drm_fbdev_dma_fb_ops = {
.owner = THIS_MODULE,
.fb_open = drm_fbdev_dma_fb_open,
.fb_release = drm_fbdev_dma_fb_release,
-   __FB_DEFAULT_DMAMEM_OPS_RDWR,
+   __FB_DEFAULT_DEFERRED_OPS_RDWR(drm_fbdev_dma),
DRM_FB_HELPER_DEFAULT_OPS,
-   __FB_DEFAULT_DMAMEM_OPS_DRAW,
+   __FB_DEFAULT_DEFERRED_OPS_DRAW(drm_fbdev_dma),
.fb_mmap = drm_fbdev_dma_fb_mmap,
.fb_destroy = drm_fbdev_dma_fb_destroy,
 };
@@ -98,10 +108,6 @@ static int drm_fbdev_dma_helper_fb_probe(struct 
drm_fb_helper *fb_helper,
dma_obj = to_drm_gem_dma_obj(buffer->gem);
 
fb = buffer->fb;
-   if (drm_WARN_ON(dev, fb->funcs->dirty)) {
-   ret = -ENODEV; /* damage handling not supported; use generic 
emulation */
-   goto err_drm_client_buffer_delete;
-   }
 
ret = drm_client_buffer_vmap(buffer, &map);
if (ret) {
@@ -112,7 +118,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct 
drm_fb_helper *fb_helper,
}
 
fb_helper->buffer = buffer;
-   fb_helper->fb = buffer->fb;
+   fb_helper->fb = fb;
 
info = drm_fb_helper_alloc_info(fb_helper);
if (IS_ERR(info)) {
@@ -133,8 +139,19 @@ static int drm_fbdev_dma_helper_fb_probe(struct 
drm_fb_helper *fb_helper,
info->fix.smem_start = page_to_phys(virt_to_page(info->screen_buffer));
info->fix.smem_len = info->screen_size;
 
+   /* deferred I/O */
+   fb_helper->fbdefio.delay = HZ / 20;
+   fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io;
+
+   info->fbdefio = &fb_helper->fbdefio;
+   ret = fb_deferred_io_init(info);
+   if (ret)
+   goto err_drm_fb_helper_release_info;
+
return 0;
 
+err_drm_fb_helper_release_info:
+   drm_fb_helper_release_info(fb_helper);
 err_drm_client_buffer_vunmap:
fb_helper->fb = NULL;
fb_helper->buffer = NULL;
@@ -144,8 +161,28 @@ static int drm_fbdev_dma_helper_fb_probe(struct 
drm_fb_helper *fb_helper,
return ret;
 }
 
+static int drm_fbdev_dma_helper_fb_dirty(struct drm_fb_helper *helper,
+struct drm_clip_rect *clip)
+{
+   struct drm_device *dev = helper->dev;
+   int ret;
+
+   /* Call damage handlers only if necessary */
+   if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
+   return 0;
+
+   if (helper->fb->funcs->dirty) {
+   ret = helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1);
+   if (drm_WARN_ONCE(dev, ret, "Dirty helper failed: ret=%d\n", 
ret))
+   return ret;
+   }
+
+   return 0;
+}
+
 static const struct drm_fb_helper_funcs drm_fbdev_dma_helper_funcs = {
.fb_probe = drm_fbdev_dma_helper_fb_probe,
+   .fb_dirty = drm_fbdev_dma_helper_fb_dirty,
 };
 
 /*
-- 
2.44.0



[PATCH v2 12/43] drm/mgag200: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Dave Airlie 
Cc: Thomas Zimmermann 
Cc: Jocelyn Falempe 
Reviewed-by: Jocelyn Falempe 
---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c 
b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 573dbe256aa8b..65f2ed18b31c5 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -285,7 +285,7 @@ mgag200_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
 * FIXME: A 24-bit color depth does not work with 24 bpp on
 * G200ER. Force 32 bpp.
 */
-   drm_fbdev_generic_setup(dev, 32);
+   drm_fbdev_shmem_setup(dev, 32);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 13/43] drm/solomon: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Javier Martinez Canillas 
---
 drivers/gpu/drm/solomon/ssd130x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/solomon/ssd130x.c 
b/drivers/gpu/drm/solomon/ssd130x.c
index ebd943b9e357b..6f51bcf774e27 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2029,7 +2029,7 @@ struct ssd130x_device *ssd130x_probe(struct device *dev, 
struct regmap *regmap)
if (ret)
return ERR_PTR(dev_err_probe(dev, ret, "DRM device register 
failed\n"));
 
-   drm_fbdev_generic_setup(drm, 32);
+   drm_fbdev_shmem_setup(drm, 32);
 
return ssd130x;
 }
-- 
2.44.0



[PATCH v2 33/43] drm/tiny/ili9163: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by ili9163. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/tiny/ili9163.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ili9163.c b/drivers/gpu/drm/tiny/ili9163.c
index bc4384d410fcc..86f9d88349015 100644
--- a/drivers/gpu/drm/tiny/ili9163.c
+++ b/drivers/gpu/drm/tiny/ili9163.c
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -185,7 +185,7 @@ static int ili9163_probe(struct spi_device *spi)
if (ret)
return ret;
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_dma_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 17/43] drm/tiny/simpledrm: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Thomas Zimmermann 
Cc: Javier Martinez Canillas 
---
 drivers/gpu/drm/tiny/simpledrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 7ce1c46176750..3cb09ad5f7537 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1026,7 +1026,7 @@ static int simpledrm_probe(struct platform_device *pdev)
if (color_mode == 16)
color_mode = sdev->format->depth; // can be 15 or 16
 
-   drm_fbdev_generic_setup(dev, color_mode);
+   drm_fbdev_shmem_setup(dev, color_mode);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 27/43] drm/panel/panel-ilitek-9341: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by panel-ilitek-9341. Avoids
the overhead of fbdev-generic's additional shadow buffering. No
functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Neil Armstrong 
Cc: Jessica Zhang 
Cc: Sam Ravnborg 
---
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c 
b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
index 3574681891e81..89830582b5d79 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
@@ -31,7 +31,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -650,7 +650,7 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct 
gpio_desc *dc,
 
spi_set_drvdata(spi, drm);
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_dma_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 41/43] drm/tiny/st7735r: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by st7735r. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: David Lechner 
Acked-by: David Lechner 
---
 drivers/gpu/drm/tiny/st7735r.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index 477eb36fbb70d..1676da00883d3 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -18,7 +18,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -241,7 +241,7 @@ static int st7735r_probe(struct spi_device *spi)
 
spi_set_drvdata(spi, drm);
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_dma_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 39/43] drm/tiny/repaper: Use fbdev-dma

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-dma. Fbdev-dma now supports
damage handling, which is required by repaper. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: "Noralf Trønnes" 
Acked-by: Noralf Trønnes 
---
 drivers/gpu/drm/tiny/repaper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index 8fd6758f5725f..1f78aa3d26bbd 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1118,7 +1118,7 @@ static int repaper_probe(struct spi_device *spi)
 
DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 100);
 
-   drm_fbdev_generic_setup(drm, 0);
+   drm_fbdev_dma_setup(drm, 0);
 
return 0;
 }
-- 
2.44.0



[PATCH v2 11/43] drm/hyperv: Use fbdev-shmem

2024-04-10 Thread Thomas Zimmermann
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.

Signed-off-by: Thomas Zimmermann 
Cc: Deepak Rawat 
Reviewed-by: Deepak Rawat 
---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c 
b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
index cff85086f2d66..ff93e08d5036d 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
@@ -11,7 +11,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -149,7 +149,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
goto err_free_mmio;
}
 
-   drm_fbdev_generic_setup(dev, 0);
+   drm_fbdev_shmem_setup(dev, 0);
 
return 0;
 
-- 
2.44.0



  1   2   3   >