Re: [PATCH] drm/amdgpu: Avoid possible buffer overflow

2023-08-20 Thread Su Hui
On 2023/8/21 14:47, Christophe JAILLET wrote: Le 21/08/2023 à 08:19, Su Hui a écrit : smatch error: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. change the assignment order to avoid buffer o

[PATCH v2 7/7] Revert "drm/amd/amdgpu: switch on/off vcn power profile mode"

2023-08-20 Thread Arvind Yadav
This reverts commit 5ce71f59bb9bd3d8a09b96afdbc92975cb6dc303. Reason for revert: New amdgpu_workload_profile* api is added to switch on/off profile mode. These new api will allow to change the GPU power profile based on a submitted job. Cc: Shashank Sharma Cc: Christian Koenig Cc: Alex Deucher

[PATCH v2 6/7] drm/amdgpu: switch workload context to/from compute

2023-08-20 Thread Arvind Yadav
This patch switches the GPU workload mode to/from compute mode, while submitting compute workload. Cc: Christian Koenig Signed-off-by: Alex Deucher Signed-off-by: Shashank Sharma Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 +--- 1 file changed, 5 inserti

[PATCH v2 5/7] drm/amdgpu: Switch on/off GPU workload profile

2023-08-20 Thread Arvind Yadav
This patch is to switch the GPU workload profile based on the submitted job. The workload profile is reset to default when the job is done. Cc: Shashank Sharma Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 + 1 file chang

[PATCH v2 4/7] drm/amdgpu: Add suspend function to clear the GPU power profile.

2023-08-20 Thread Arvind Yadav
This patch adds a suspend function that will clear the GPU power profile before going into suspend state. v2: - Add the new suspend function based on review comment. Cc: Shashank Sharma Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/amdgpu/amdgpu_de

[PATCH v2 3/7] drm/amdgpu: Add new function to put GPU power profile

2023-08-20 Thread Arvind Yadav
This patch adds a function which will clear the GPU power profile after job finished. This is how it works: - schedular will set the GPU power profile based on ring_type. - Schedular will clear the GPU Power profile once job finished. - Here, the *_workload_profile_set function will set the GPU

[PATCH v2 2/7] drm/amdgpu: Add new function to set GPU power profile

2023-08-20 Thread Arvind Yadav
This patch adds a function which will change the GPU power profile based on a submitted job. This can optimize the power performance when the workload is on. v2: - Splitting workload_profile_set and workload_profile_put into two separate patches. - Addressed review comment. Cc: Shashank Sharma

[PATCH v2 1/7] drm/amdgpu: Added init/fini functions for workload

2023-08-20 Thread Arvind Yadav
The'struct amdgpu_smu_workload' initialization/cleanup functions is added by this patch. v2: - Splitting big patch into separate patches. - Added new fini function. Cc: Shashank Sharma Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/amdgpu/Makefile

[PATCH v2 0/7] GPU workload hints for better performance

2023-08-20 Thread Arvind Yadav
AMDGPU SOCs supports dynamic workload based power profiles, which can provide fine-tuned performance for a particular type of workload. This patch series adds an interface to set/reset these power profiles based on the submitted job. The driver can dynamically switch the power profiles based on sub

Re: [PATCH v4] PCI/VGA: Make the vga_is_firmware_default() less arch-dependent

2023-08-20 Thread suijingfeng
Hi, On 2023/8/18 18:20, suijingfeng wrote: 1) The "weird" logic completely overrides whatever decision VGAARB ever made. It seems to say that the decision ever made by VGAARB is useless. Well, I think VGAARB shouldn't endure this; VGAARB has to be small. VGAARB have to be smart! The "w

Re: [PATCH] drm/amdgpu: Avoid possible buffer overflow

2023-08-20 Thread Christophe JAILLET
Le 21/08/2023 à 08:19, Su Hui a écrit : smatch error: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. change the assignment order to avoid buffer overflow. Fixes: c40bdfb2ffa4 ("drm/amdgpu: fix

Re: [PATCH v9 2/7] drm/mediatek: Add crtc path enum for all_drm_priv array

2023-08-20 Thread 胡俊光

[PATCH] drm/ast: Avoid possible NULL dereference

2023-08-20 Thread Su Hui
smatch error: drivers/gpu/drm/ast/ast_dp501.c:227 ast_launch_m68k() error: we previously assumed 'ast->dp501_fw' could be null (see line 223) when "!ast->dp501_fw" and "ast_load_dp501_microcode(dev) >= 0" is true, there will be a NULL dereference of 'ast->dp501_fw'. Fixes: 12f8030e05c6 ("drm/ast:

[PATCH v2 4/4] drm/amdgpu: Bump amdgpu driver version.

2023-08-20 Thread Tatsuyuki Ishi
From: Bas Nieuwenhuizen For detection of the new explicit sync functionality without having to try the ioctl. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Tatsuyuki Ishi --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH v2 3/4] drm/amdgpu: Add option to disable implicit sync for a context.

2023-08-20 Thread Tatsuyuki Ishi
From: Bas Nieuwenhuizen This changes all BO usages in a submit to BOOKKEEP instead of READ, which effectively disables implicit sync for these submits. This is configured at a context level using the existing IOCTL. Signed-off-by: Bas Nieuwenhuizen Co-developed-by: Tatsuyuki Ishi Signed-off-b

[PATCH v2 2/4] drm/amdgpu: Allow explicit sync for VM ops.

2023-08-20 Thread Tatsuyuki Ishi
From: Bas Nieuwenhuizen This should be okay because moves themselves use KERNEL usage and hence still sync with BOOKKEEP usage. Then any later submits still wait on any pending VM operations. (i.e. we only made VM ops not wait on BOOKKEEP submits, not the other way around) Signed-off-by: Bas N

[PATCH v2 1/4] drm/amdgpu: Add separate mode for syncing DMA_RESV_USAGE_BOOKKEEP.

2023-08-20 Thread Tatsuyuki Ishi
From: Bas Nieuwenhuizen To prep for allowing different sync modes in a follow-up patch. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Tatsuyuki Ishi --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/am

[PATCH v2 0/4] amdgpu: Allow explicitly synchronized submissions.

2023-08-20 Thread Tatsuyuki Ishi
This adds a context option to use DMA_RESV_USAGE_BOOKKEEP for userspace submissions. This is a respin of [1] but rebased on top of the newly introduced drm_exec helpers. Disabling implicit sync is something we've wanted in RADV for a while for resolving some corner cases. A more immediate thing th

[PATCH] drm/amdgpu: Avoid possible buffer overflow

2023-08-20 Thread Su Hui
smatch error: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. change the assignment order to avoid buffer overflow. Fixes: c40bdfb2ffa4 ("drm/amdgpu: fix incorrect VCN revision in SRIOV") Signed-o

Re: [PATCH v5,4/4] drm/mediatek: dp: Add support MT8188 dp/edp function

2023-08-20 Thread 胡俊光

Re: [PATCH v5,3/4] drm/mediatek: dp: Add the audio divider to mtk_dp_data struct

2023-08-20 Thread 胡俊光

Re: [PATCH v5, 2/4] drm/mediatek: dp: Add the audio packet flag to mtk_dp_data struct

2023-08-20 Thread 胡俊光

Re: [RESEND PATCH v10 25/25] dept: Track the potential waits of PG_{locked,writeback}

2023-08-20 Thread Byungchul Park
On Mon, Aug 21, 2023 at 05:25:41AM +0100, Matthew Wilcox wrote: > On Mon, Aug 21, 2023 at 12:46:37PM +0900, Byungchul Park wrote: > > @@ -377,44 +421,88 @@ static __always_inline int Page##uname(struct page > > *page) \ > > #define SETPAGEFLAG(uname, lname, policy)

Re: [RESEND PATCH v10 08/25] dept: Apply sdt_might_sleep_{start,end}() to PG_{locked,writeback} wait

2023-08-20 Thread Byungchul Park
On Mon, Aug 21, 2023 at 05:09:44AM +0100, Matthew Wilcox wrote: > On Mon, Aug 21, 2023 at 12:46:20PM +0900, Byungchul Park wrote: > > @@ -1219,6 +1220,9 @@ static inline bool folio_trylock_flag(struct folio > > *folio, int bit_nr, > > /* How many times do we accept lock stealing from under a wait

Re: [RESEND PATCH v10 25/25] dept: Track the potential waits of PG_{locked,writeback}

2023-08-20 Thread Matthew Wilcox
On Mon, Aug 21, 2023 at 12:46:37PM +0900, Byungchul Park wrote: > @@ -377,44 +421,88 @@ static __always_inline int Page##uname(struct page > *page) \ > #define SETPAGEFLAG(uname, lname, policy)\ > static __always_inline

Re: [RESEND PATCH v10 08/25] dept: Apply sdt_might_sleep_{start,end}() to PG_{locked,writeback} wait

2023-08-20 Thread Matthew Wilcox
On Mon, Aug 21, 2023 at 12:46:20PM +0900, Byungchul Park wrote: > @@ -1219,6 +1220,9 @@ static inline bool folio_trylock_flag(struct folio > *folio, int bit_nr, > /* How many times do we accept lock stealing from under a waiter? */ > int sysctl_page_lock_unfairness = 5; > > +static struct dept

[RESEND PATCH v10 18/25] dept: Apply timeout consideration to wait_for_completion()/complete()

2023-08-20 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 4 ++-- kernel/sched/completion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inclu

[RESEND PATCH v10 00/25] DEPT(Dependency Tracker)

2023-08-20 Thread Byungchul Park
>From now on, I can work on LKML again! I'm wondering if DEPT has been helping kernel debugging well even though it's a form of patches yet. I'm happy to see that DEPT reports a real problem in practice. See: https://lore.kernel.org/lkml/6383cde5-cf4b-facf-6e07-1378a4856...@i-love.sakura.ne.j

[RESEND PATCH v10 25/25] dept: Track the potential waits of PG_{locked, writeback}

2023-08-20 Thread Byungchul Park
Currently, Dept only tracks the real waits of PG_{locked,writeback} that actually happened having gone through __schedule() to avoid false positives. However, it ends in limited capacity for deadlock detection, because anyway there might be still way more potential dependencies by the waits that ha

[RESEND PATCH v10 08/25] dept: Apply sdt_might_sleep_{start, end}() to PG_{locked, writeback} wait

2023-08-20 Thread Byungchul Park
Makes Dept able to track dependencies by PG_{locked,writeback} waits. Signed-off-by: Byungchul Park --- mm/filemap.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index 83dda76d1fc3..eed64dc88e43 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -44,6

[RESEND PATCH v10 23/25] dept: Record the latest one out of consecutive waits of the same class

2023-08-20 Thread Byungchul Park
The current code records all the waits for later use to track relation between waits and events in each context. However, since the same class is handled the same way, it'd be okay to record only one on behalf of the others if they all have the same class. Even though it's the ideal to search the

[RESEND PATCH v10 24/25] dept: Make Dept able to work with an external wgen

2023-08-20 Thread Byungchul Park
There is a case where total maps for its wait/event is so large in size. For instance, struct page for PG_locked and PG_writeback is the case. The additional memory size for the maps would be 'the # of pages * sizeof(struct dept_map)' if each struct page keeps its map all the way, which might be to

[RESEND PATCH v10 16/25] dept: Apply sdt_might_sleep_{start, end}() to dma fence wait

2023-08-20 Thread Byungchul Park
Makes Dept able to track dma fence waits. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index f177c56269bb..ad2d7a94c868 100644 --- a/drivers/dma-buf/dma-fence.c +++

[RESEND PATCH v10 21/25] dept: Apply timeout consideration to hashed-waitqueue wait

2023-08-20 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to hashed-waitqueue wait, assuming an input 'ret' in ___wait_var_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 2 +- 1 file changed, 1 insertion(+), 1 del

[RESEND PATCH v10 06/25] dept: Add proc knobs to show stats and dependency graph

2023-08-20 Thread Byungchul Park
It'd be useful to show Dept internal stats and dependency graph on runtime via proc for better information. Introduced the knobs. Signed-off-by: Byungchul Park --- kernel/dependency/Makefile| 1 + kernel/dependency/dept.c | 24 +++- kernel/dependency/dept_internal.h | 26 ++

[RESEND PATCH v10 12/25] dept: Distinguish each syscall context from another

2023-08-20 Thread Byungchul Park
It enters kernel mode on each syscall and each syscall handling should be considered independently from the point of view of Dept. Otherwise, Dept may wrongly track dependencies across different syscalls. That might be a real dependency from user mode. However, now that Dept just started to work,

[RESEND PATCH v10 19/25] dept: Apply timeout consideration to swait

2023-08-20 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to swait, assuming an input 'ret' in ___swait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/swait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[RESEND PATCH v10 07/25] dept: Apply sdt_might_sleep_{start, end}() to wait_for_completion()/complete()

2023-08-20 Thread Byungchul Park
Makes Dept able to track dependencies by wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h inde

[RESEND PATCH v10 22/25] dept: Apply timeout consideration to dma fence wait

2023-08-20 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to dma fence wait. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c

[RESEND PATCH v10 13/25] dept: Distinguish each work from another

2023-08-20 Thread Byungchul Park
Workqueue already provides concurrency control. By that, any wait in a work doesn't prevents events in other works with the control enabled. Thus, each work would better be considered a different context. So let Dept assign a different context id to each work. Signed-off-by: Byungchul Park ---

[RESEND PATCH v10 05/25] dept: Tie to Lockdep and IRQ tracing

2023-08-20 Thread Byungchul Park
Yes. How to place Dept in here looks so ugly. But it's inevitable as long as relying on Lockdep. The way should be enhanced gradually. 1. Basically relies on Lockdep to track typical locks and IRQ things. 2. Dept fails to recognize IRQ situation so it generates false alarms when raw_l

[RESEND PATCH v10 20/25] dept: Apply timeout consideration to waitqueue wait

2023-08-20 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[RESEND PATCH v10 10/25] dept: Apply sdt_might_sleep_{start, end}() to waitqueue wait

2023-08-20 Thread Byungchul Park
Makes Dept able to track dependencies by waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index a0307b516b09..ff349e609da7 100644 --- a/include/linux/wait.h +++ b/include/lin

[RESEND PATCH v10 11/25] dept: Apply sdt_might_sleep_{start, end}() to hashed-waitqueue wait

2023-08-20 Thread Byungchul Park
Makes Dept able to track dependencies by hashed-waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..fe89282c3e96 100644 --- a/include/linux/wait_

[RESEND PATCH v10 17/25] dept: Track timeout waits separately with a new Kconfig

2023-08-20 Thread Byungchul Park
Waits with valid timeouts don't actually cause deadlocks. However, Dept has been reporting the cases as well because it's worth informing the circular dependency for some cases where, for example, timeout is used to avoid a deadlock but not meant to be expired. However, yes, there are also a lot o

[RESEND PATCH v10 09/25] dept: Apply sdt_might_sleep_{start, end}() to swait

2023-08-20 Thread Byungchul Park
Makes Dept able to track dependencies by swaits. Signed-off-by: Byungchul Park --- include/linux/swait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/swait.h b/include/linux/swait.h index 6a8c22b8c2a5..02848211cef5 100644 --- a/include/linux/swait.h +++ b/include/linux/sw

[RESEND PATCH v10 15/25] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2023-08-20 Thread Byungchul Park
cb92173d1f0 ("locking/lockdep, cpu/hotplug: Annotate AP thread") was introduced to make lockdep_assert_cpus_held() work in AP thread. However, the annotation is too strong for that purpose. We don't have to use more than try lock annotation for that. Furthermore, now that Dept was introduced, fal

[RESEND PATCH v10 02/25] dept: Implement Dept(Dependency Tracker)

2023-08-20 Thread Byungchul Park
CURRENT STATUS -- Lockdep tracks acquisition order of locks in order to detect deadlock, and IRQ and IRQ enable/disable state as well to take accident acquisitions into account. Lockdep should be turned off once it detects and reports a deadlock since the data structure and algorithm a

[RESEND PATCH v10 14/25] dept: Add a mechanism to refill the internal memory pools on running out

2023-08-20 Thread Byungchul Park
Dept engine works in a constrained environment. For example, Dept cannot make use of dynamic allocation e.g. kmalloc(). So Dept has been using static pools to keep memory chunks Dept uses. However, Dept would barely work once any of the pools gets run out. So implemented a mechanism for the refill

[RESEND PATCH v10 04/25] dept: Add lock dependency tracker APIs

2023-08-20 Thread Byungchul Park
Wrapped the base APIs for easier annotation on typical lock. Signed-off-by: Byungchul Park --- include/linux/dept_ldt.h | 77 1 file changed, 77 insertions(+) create mode 100644 include/linux/dept_ldt.h diff --git a/include/linux/dept_ldt.h b/include/li

[RESEND PATCH v10 03/25] dept: Add single event dependency tracker APIs

2023-08-20 Thread Byungchul Park
Wrapped the base APIs for easier annotation on wait and event. Start with supporting waiters on each single event. More general support for multiple events is a future work. Do more when the need arises. How to annotate (the simplest way): 1. Initaialize a map for the interesting wait. /*

[RESEND PATCH v10 01/25] llist: Move llist_{head, node} definition to types.h

2023-08-20 Thread Byungchul Park
llist_head and llist_node can be used by very primitives. For example, Dept for tracking dependency uses llist things in its header. To avoid header dependency, move those to types.h. Signed-off-by: Byungchul Park --- include/linux/llist.h | 8 include/linux/types.h | 8 2 file

[PATCH v3 RESEND 9/9] drm/bridge: imx: Add i.MX93 MIPI DSI support

2023-08-20 Thread Liu Ying
Freescale i.MX93 SoC embeds a Synopsys Designware MIPI DSI host controller and a Synopsys Designware MIPI DPHY. Some configurations and extensions to them are controlled by i.MX93 media blk-ctrl. Add a DRM bridge for i.MX93 MIPI DSI by using existing DW MIPI DSI bridge helpers and implementing i.

[PATCH v3 RESEND 8/9] dt-bindings: display: bridge: Document Freescale i.MX93 MIPI DSI

2023-08-20 Thread Liu Ying
Freescale i.MX93 SoC embeds a Synopsys Designware MIPI DSI host controller and a Synopsys Designware MIPI DPHY. Some configurations and extensions to them are controlled by i.MX93 media blk-ctrl. Signed-off-by: Liu Ying Reviewed-by: Rob Herring --- v2->v3: * No change. v1->v2: * Add Rob's R-b

[PATCH v3 RESEND 7/9] drm/bridge: synopsys: dw-mipi-dsi: Disable HSTX and LPRX timeout check

2023-08-20 Thread Liu Ying
According to Synopsys DW MIPI DSI host databook, HSTX and LPRX timeout contention detections are measured in TO_CLK_DIVISION cycles. However, the current driver programs magic values to TO_CLK_DIVISION, HSTX_TO_CNT and LPRX_TO_CNT register fields, which makes timeout error event wrongly happen for

[PATCH v3 RESEND 6/9] drm/bridge: synopsys: dw-mipi-dsi: Set minimum lane byte clock cycles for HSA and HBP

2023-08-20 Thread Liu Ying
According to Synopsys support channel, each region of HSA, HBP and HFP must have minimum number of 10 bytes where constant 4 bytes are for HSS or HSE and 6 bytes are for blanking packet(header + CRC). Hence, the below table comes in. ++--+---+ | data lanes | min lbcc | byt

[PATCH v3 RESEND 5/9] drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc

2023-08-20 Thread Liu Ying
To get better accuration, use pixel clock rate to calculate lbcc instead of lane_mbps since the pixel clock rate is in KHz while lane_mbps is in MHz. Without this, distorted image can be seen on a HDMI monitor connected with i.MX93 11x11 EVK through ADV7535 DSI to HDMI bridge in 1920x1080p@60 video

[PATCH v3 RESEND 4/9] drm/bridge: synopsys: dw-mipi-dsi: Add mode fixup support

2023-08-20 Thread Liu Ying
Vendor drivers may need to fixup mode due to pixel clock tree limitation, so introduce the ->mode_fixup() callcack to struct dw_mipi_dsi_plat_data and call it at atomic check stage if available. Signed-off-by: Liu Ying --- v1->v3: * No change. drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 14

[PATCH v3 RESEND 3/9] drm/bridge: synopsys: dw-mipi-dsi: Force input bus flags

2023-08-20 Thread Liu Ying
The DATAEN_ACTIVE_LOW bit in DSI_DPI_CFG_POL register is set to zero, so set the DRM_BUS_FLAG_DE_HIGH flag in input_bus_cfg.flags. It appears that the DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE flag also makes sense, so set it in input_bus_cfg.flags too. With this patch, the flags set by drm_atomic_brid

[PATCH v3 RESEND 2/9] drm/bridge: synopsys: dw-mipi-dsi: Add input bus format negotiation support

2023-08-20 Thread Liu Ying
Introduce ->get_input_bus_fmts() callback to struct dw_mipi_dsi_plat_data so that vendor drivers can implement specific methods to get input bus formats for Synopsys DW MIPI DSI. While at it, implement a generic callback for ->atomic_get_input_bus_fmts(), where we try to get the input bus formats

[PATCH v3 RESEND 1/9] drm/bridge: synopsys: dw-mipi-dsi: Add dw_mipi_dsi_get_bridge() helper

2023-08-20 Thread Liu Ying
Add dw_mipi_dsi_get_bridge() helper so that it can be used by vendor drivers which implement vendor specific extensions to Synopsys DW MIPI DSI. Signed-off-by: Liu Ying --- v1->v3: * No change. drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 6 ++ include/drm/bridge/dw_mipi_dsi.h

[PATCH v3 RESEND 0/9] drm/bridge: imx: Add i.MX93 MIPI DSI support

2023-08-20 Thread Liu Ying
Hi, This series aims to add MIPI DSI support for Freescale i.MX93 SoC. There is a Synopsys DesignWare MIPI DSI host controller and a Synopsys Designware MIPI DPHY embedded in i.MX93. Some configurations and extensions to them are controlled by i.MX93 media blk-ctrl. Add a DRM bridge for i.MX93

Re: [PATCH drm-misc-next] drm/nouveau: uvmm: fix unset region pointer on remap

2023-08-20 Thread Dave Airlie
Reviewed-by: Dave Airlie On Mon, 21 Aug 2023 at 08:29, Danilo Krummrich wrote: > > Transfer the region pointer of a uvma to the new uvma(s) on re-map to > prevent potential shader faults when the re-mapped uvma(s) are unmapped. > > Signed-off-by: Danilo Krummrich > --- > drivers/gpu/drm/nouvea

Re: [RFC PATCH 2/3] drm/virtio: new fence for every plane update

2023-08-20 Thread Kim, Dongwon
On 8/17/2023 7:21 PM, Dmitry Osipenko wrote: ... +static struct +drm_plane_state *virtio_gpu_plane_duplicate_state(struct drm_plane *plane) +{ + struct virtio_gpu_plane_state *new; + + if (WARN_ON(!plane->state)) + return NULL; When plane->state can be NULL? Honestly

Re: [PATCH v11 3/8] drm: Remove usage of deprecated DRM_INFO in DRM core

2023-08-20 Thread Laurent Pinchart
Hi Siddh, Thank you for the patch. On Sun, Aug 20, 2023 at 05:10:39PM +0530, Siddh Raman Pant wrote: > drm_print.h says DRM_INFO is deprecated in favor of drm_info(). > > Signed-off-by: Siddh Raman Pant Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/drm_client_modeset.c | 2 +- > dri

[PATCH drm-misc-next] drm/nouveau: uvmm: fix unset region pointer on remap

2023-08-20 Thread Danilo Krummrich
Transfer the region pointer of a uvma to the new uvma(s) on re-map to prevent potential shader faults when the re-mapped uvma(s) are unmapped. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/no

Re: Implement svm without BO concept in xe driver

2023-08-20 Thread Dave Airlie
On Thu, 17 Aug 2023 at 12:13, Zeng, Oak wrote: > > > -Original Message- > > From: Dave Airlie > > Sent: August 16, 2023 6:52 PM > > To: Felix Kuehling > > Cc: Zeng, Oak ; Christian König > > ; Thomas Hellström > > ; Brost, Matthew > > ; maarten.lankho...@linux.intel.com; > > Vishwanathap

[PATCH drm-misc-next 3/3] drm/nouveau: gpuva mgr dma-resv/extobj handling, GEM validation

2023-08-20 Thread Danilo Krummrich
Make use of the DRM GPUVA managers GPU-VM common dma-resv, external GEM object tracking, dma-resv locking, evicted GEM object tracking and validation features. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_bo.c| 4 +- drivers/gpu/drm/nouveau/nouveau_exec.c | 51 ++--

[PATCH drm-misc-next 2/3] drm/gpuva_mgr: generalize dma_resv/extobj handling and GEM validation

2023-08-20 Thread Danilo Krummrich
So far the DRM GPUVA manager offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more complex mapping operations on the GPU VA space. However, there are more design patterns commonly used by drivers, which

[PATCH drm-misc-next 1/3] drm: drm_exec: build always builtin

2023-08-20 Thread Danilo Krummrich
drm_exec must always be builtin for the DRM GPUVA manager to depend on it. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/Kconfig | 6 -- drivers/gpu/drm/Makefile| 3 +-- drivers/gpu/drm/nouveau/Kconfig | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a

[PATCH drm-misc-next 0/3] [RFC] DRM GPUVA Manager GPU-VM features

2023-08-20 Thread Danilo Krummrich
So far the DRM GPUVA manager offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more complex mapping operations on the GPU VA space. However, there are more design patterns commonly used by drivers, which

[BUG]: amdgpu: soft lockup - CPU#1 stuck for 26s! [systemd-udevd:635]

2023-08-20 Thread Mirsad Todorovac
Hi, This soft lockup occurs on amdgpu vanilla torvalds kernel with KCSAN turned on. The platform is Ubuntu 22.04 LTS. Please find config and lshw here: https://domac.alu.unizg.hr/~mtodorov/linux/bugreports/amdgpu/6.5-rc7/ Here is the log excerpt: [ 69.050693] ===

Re: [RFC PATCH 3/3] drm/virtio: drm_gem_plane_helper_prepare_fb for obj synchronization

2023-08-20 Thread Kim, Dongwon
On 8/17/2023 7:33 PM, Dmitry Osipenko wrote: On 7/13/23 01:44, Dongwon Kim wrote: This helper is needed for framebuffer synchronization. Old framebuffer data is often displayed on the guest display without this helper. Cc: Gerd Hoffmann Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- dr

[BUG]: amdgpu: soft lockup - CPU#1 stuck for 26s! [systemd-udevd:635]

2023-08-20 Thread Mirsad Todorovac
Hi, This soft lockup occurs on amdgpu vanilla torvalds kernel with KCSAN turned on. The platform is Ubuntu 22.04 LTS. [ 69.050693] == [ 69.198264] watchdog: BUG: soft lockup - CPU#1 stuck for 26s! [systemd-udevd:635] [ 69.1

[pull] drm/msm: drm-msm-next-2023-08-20 for v6.6

2023-08-20 Thread Rob Clark
Hi Dave, This is the pull for v6.6, see below for description. It includes a backmerge of msm-fixes to resolve conflicts. The following changes since commit cd036d542afb82adfbbd43c5dbeb7010e8e91ee7: drm/msm/a6xx: Add A610 speedbin support (2023-06-18 11:35:27 -0700) are available in the Git

[PATCH v11 8/8] drm: Remove usage of deprecated DRM_DEBUG_KMS in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_DEBUG_KMS is deprecated in favor of drm_dbg_kms(). Reviewed-by: Laurent Pinchart Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_client_modeset.c | 112 +++ drivers/gpu/drm/drm_color_mgmt.c | 4 +- drivers/gpu/drm/drm_connector.c |

[PATCH v11 6/8] drm: Remove usage of deprecated DRM_DEBUG in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_DEBUG is deprecated in favor of drm_dbg_core(). Reviewed-by: Laurent Pinchart Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_agpsupport.c | 4 +- drivers/gpu/drm/drm_bufs.c| 114 +++--- drivers/gpu/drm/drm_context.c | 14 ++--

[PATCH v11 5/8] drm: Remove usage of deprecated DRM_ERROR in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_ERROR is deprecated in favor of drm_err(). Reviewed-by: Laurent Pinchart Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_bridge.c | 8 drivers/gpu/drm/drm_bufs.c | 8 drivers/gpu/drm/drm_client_modeset.c | 4 ++-- drivers/gpu/d

[PATCH v11 3/8] drm: Remove usage of deprecated DRM_INFO in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_INFO is deprecated in favor of drm_info(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_client_modeset.c | 2 +- drivers/gpu/drm/drm_connector.c | 7 --- drivers/gpu/drm/drm_drv.c| 2 +- drivers/gpu/drm/drm_pci.c| 2 +- 4 files cha

[PATCH v11 7/8] drm: Remove usage of deprecated DRM_DEBUG_DRIVER in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_DEBUG_DRIVER is deprecated. Thus, use newer drm_dbg_driver(). Also fix the deprecation comment in drm_print.h which mentions drm_dbg() instead of drm_dbg_driver(). Reviewed-by: Laurent Pinchart Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_mipi_dbi.c | 10 +--

[PATCH v11 4/8] drm: Remove usage of deprecated DRM_NOTE in DRM core

2023-08-20 Thread Siddh Raman Pant
drm_print.h says DRM_NOTE is deprecated in favor of drm_notice(). Reviewed-by: Laurent Pinchart Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_displayid.c | 2 +- drivers/gpu/drm/drm_kms_helper_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH v11 0/8] drm: Remove usage of deprecated DRM_* macros in DRM core

2023-08-20 Thread Siddh Raman Pant
This patchset aims to completely remove usages of deprecated DRM_* macros from the DRM core (i.e. drivers/gpu/drm/*.c). This patchset should be applied in order as changes are dependent. Thanks, Siddh --- v10 -> v11 (today): - Rebased to drm-misc-next. - Dropped the last patch removing print st

[PATCH v11 2/8] drm/print: Fix and add support for NULL as first argument in drm_* macros

2023-08-20 Thread Siddh Raman Pant
Comments say macros DRM_DEBUG_* are deprecated in favor of drm_dbg_*(NULL, ...), but they have broken support for it, as the macro will result in `(NULL) ? (NULL)->dev : NULL`. Thus, fix them by separating logic to get dev ptr in a new function, which will return the dev ptr if arg is not NULL. Us

[PATCH v11 1/8] Revert "drm: mipi-dsi: Convert logging to drm_* functions."

2023-08-20 Thread Siddh Raman Pant
This reverts commit 1040e424353f5f4d39f6f3aa8723eb3bd6ea6446. It used an incorrect way to use drm_* functions. Only drm_device ptrs should be passed, but the mentioned commit passed mipi_dsi_host ptr. It worked by accident due to macro magic. Reported-by: Jani Nikula Reviewed-by: Jani Nikula Re

Re: [PATCH v3 1/1] backlight: hid_bl: Add VESA VCP HID backlight driver

2023-08-20 Thread Christophe JAILLET
Le 20/08/2023 à 11:41, Julius Zint a écrit : The HID spec defines the following Usage IDs (p. 345 ff): - Monitor Page (0x80) -> Monitor Control (0x01) - VESA Virtual Controls Page (0x82) -> Brightness (0x10) Apple made use of them in their Apple Studio Display and most likely on other external

[PATCH 4/4] drm/amdgpu: Use kvzalloc() to simplify code

2023-08-20 Thread Christophe JAILLET
kvzalloc() can be used instead of kvmalloc() + memset() + explicit NULL assignments. It is less verbose and more future proof. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/d

[PATCH 2/4] drm/amdgpu: Remove a redundant sanity check

2023-08-20 Thread Christophe JAILLET
The case where 'num_entries' is too big, is already handled by struct_size(), because kvmalloc() would fail. It will return -ENOMEM instead of -EINVAL, but it is only related to a unlikely to happen sanity check. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c

[PATCH 3/4] drm/amdgpu: Remove amdgpu_bo_list_array_entry()

2023-08-20 Thread Christophe JAILLET
Now that there is an explicit flexible array at the end of 'struct amdgpu_bo_list', it can be used to remove amdgpu_bo_list_array_entry() and simplify some macro. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.

[PATCH 1/4] drm/amdgpu: Explicitly add a flexible array at the end of 'struct amdgpu_bo_list'

2023-08-20 Thread Christophe JAILLET
'struct amdgpu_bo_list' is really used as if it was ended by a flex array. So make it more explicit and add a 'struct amdgpu_bo_list_entry entries[]' field at the end of the structure. This way, struct_size() can be used when it is allocated. It is less verbose. Signed-off-by: Christophe JAILLET

[PATCH 0/4] drm/amdgpu: Explicitly add a flexible array at the end of 'struct amdgpu_bo_list' and simplify amdgpu_bo_list_create()

2023-08-20 Thread Christophe JAILLET
This serie simplifies amdgpu_bo_list_create() and usage of the 'struct amdgpu_bo_list'. It is compile tested only. Christophe JAILLET (4): drm/amdgpu: Explicitly add a flexible array at the end of 'struct amdgpu_bo_list' drm/amdgpu: Remove a redundant sanity check drm/amdgpu: Remove amd

[PATCH v3 1/1] backlight: hid_bl: Add VESA VCP HID backlight driver

2023-08-20 Thread Julius Zint
The HID spec defines the following Usage IDs (p. 345 ff): - Monitor Page (0x80) -> Monitor Control (0x01) - VESA Virtual Controls Page (0x82) -> Brightness (0x10) Apple made use of them in their Apple Studio Display and most likely on other external displays (LG UltraFine 5k, Pro Display XDR). T

[PATCH v3 0/1] HID backlight driver

2023-08-20 Thread Julius Zint
This patch adds support for HID backlight devices, found in the Apple Studio Display. Changes in v1 [1]: - Add USB backlight driver for Studio Display Changes in v2 [2]: - Rewrite from a USB driver to a HID driver Changes in v3: - Added missing hid_bl prefix for some functions - Early ex

[PATCH] dt-bindings: display: msm/dp: restrict opp-table to objects

2023-08-20 Thread Krzysztof Kozlowski
Simple 'opp-table:true' accepts a boolean property as opp-table, so restrict it to object to properly enforce real OPP table nodes. Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/display/msm/dp-controller.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

Re: [PATCH v2 14/15] dt-bindings: gpu: mali-valhall-csf: Add initial bindings for panthor driver

2023-08-20 Thread Krzysztof Kozlowski
On 09/08/2023 18:53, Boris Brezillon wrote: > From: Liviu Dudau > > Arm has introduced a new v10 GPU architecture that replaces the Job Manager > interface with a new Command Stream Frontend. It adds firmware driven > command stream queues that can be used by kernel and user space to submit > job