Re: [Freedreno] [PATCH v2 1/2] drm/dp: Add callbacks to make using DP AUX bus properly easier

2022-05-04 Thread Dmitry Baryshkov
On 04/05/2022 01:40, Douglas Anderson wrote: As talked about in this patch in the kerneldoc of of_dp_aux_populate_ep_device() and also in the past in commit a1e3667a9835 ("drm/bridge: ti-sn65dsi86: Promote the AUX channel to its own sub-dev"), it can be difficult for eDP controller drivers to kno

Re: [Freedreno] [PATCH] drm: Document that power requirements for DP AUX transfers

2022-05-04 Thread Ville Syrjälä
On Tue, May 03, 2022 at 04:21:08PM -0700, Douglas Anderson wrote: > When doing DP AUX transfers there are two actors that need to be > powered in order for the DP AUX transfer to work: the DP source and > the DP sync. Commit bacbab58f09d ("drm: Mention the power state > requirement on side-channel

Re: [Freedreno] [PATCH 0/3] drm: move dsc data pointer from drm_panel to mipi_dsi_device

2022-05-04 Thread Vinod Koul
On 01-05-22, 18:12, Dmitry Baryshkov wrote: > To properly support DSC the sink driver (panel) has to pass DSC pps data > to the source (DSI host). The commit 0f40ba48de3b ("drm/msm/dsi: Pass > DSC params to drm_panel") added a pointer to the DSC data to the struct > drm_panel. However this is not t

Re: [Freedreno] [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing

2022-05-04 Thread Vinod Koul
On 30-04-22, 20:55, Dmitry Baryshkov wrote: > The downstream uses read-modify-write for updating command mode > compression registers. Let's follow this approach. This also fixes the > following warning: > > drivers/gpu/drm/msm/dsi/dsi_host.c:918:23: warning: variable 'reg_ctrl' set > but not use

Re: [Freedreno] [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing

2022-05-04 Thread Vinod Koul
On 30-04-22, 22:28, Dmitry Baryshkov wrote: > On 30/04/2022 21:58, Marijn Suijten wrote: > > On 2022-04-30 20:55:33, Dmitry Baryshkov wrote: > > > The downstream uses read-modify-write for updating command mode > > > compression registers. Let's follow this approach. This also fixes the > > > follo

Re: [Freedreno] [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing

2022-05-04 Thread Vinod Koul
On 01-05-22, 22:41, Marijn Suijten wrote: > On 2022-04-30 22:28:42, Dmitry Baryshkov wrote: > > On 30/04/2022 21:58, Marijn Suijten wrote: > > > On 2022-04-30 20:55:33, Dmitry Baryshkov wrote: > > >> The downstream uses read-modify-write for updating command mode > > >> compression registers. Let's

Re: [Freedreno] [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing

2022-05-04 Thread Vinod Koul
On 02-05-22, 10:43, Marijn Suijten wrote: > On 2022-05-02 01:44:20, Dmitry Baryshkov wrote: > that require DSC for the screen to work. I've been told the series > didn't result in positive screen output way back in its infancy, but I would be intrested to hear about that. I have only pixel3 at my

Re: [Freedreno] [PATCH v2 1/2] drm/dp: Add callbacks to make using DP AUX bus properly easier

2022-05-04 Thread Doug Anderson
Hi, On Wed, May 4, 2022 at 3:41 AM Dmitry Baryshkov wrote: > > > - We had forgotten a EXPORT_SYMBOL_GPL on the non "devm" populate > >function. > > This can go to a separate patch, so that the fix can be backported to > earlier kernels. Please don't forget the Fixes: tag. Sure. Will do for v

Re: [Freedreno] [PATCH] drm/msm/dsi: fix address for second DSI PHY on SDM660

2022-05-04 Thread Konrad Dybcio
On 03/05/2022 22:43, Dmitry Baryshkov wrote: Correct a typo in the address of the second DSI PHY in the SDM660 device config. Fixes: 694dd304cc29 ("drm/msm/dsi: Add phy configuration for SDM630/636/660") Cc: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- Gah

Re: [Freedreno] [PATCH] drm: Document that power requirements for DP AUX transfers

2022-05-04 Thread Doug Anderson
Hi, On Wed, May 4, 2022 at 5:21 AM Ville Syrjälä wrote: > > On Tue, May 03, 2022 at 04:21:08PM -0700, Douglas Anderson wrote: > > When doing DP AUX transfers there are two actors that need to be > > powered in order for the DP AUX transfer to work: the DP source and > > the DP sync. Commit bacbab

Re: [Freedreno] [PATCH] drm: Document that power requirements for DP AUX transfers

2022-05-04 Thread Lyude Paul
On Wed, 2022-05-04 at 09:04 -0700, Doug Anderson wrote: > Hi, > > On Wed, May 4, 2022 at 5:21 AM Ville Syrjälä > wrote: > > > > On Tue, May 03, 2022 at 04:21:08PM -0700, Douglas Anderson wrote: > > > When doing DP AUX transfers there are two actors that need to be > > > powered in order for the

Re: [Freedreno] [PATCH v3] drm/msm/dp: fix event thread stuck in wait_event after kthread_stop()

2022-05-04 Thread Dmitry Baryshkov
On 03/05/2022 19:25, Kuogee Hsieh wrote: Event thread supposed to exit from its while loop after kthread_stop(). However there may has possibility that event thread is pending in the middle of wait_event due to condition checking never become true. To make sure event thread exit its loop after kt

Re: [Freedreno] [PATCH v3] drm/msm/dp: fix event thread stuck in wait_event after kthread_stop()

2022-05-04 Thread Dmitry Baryshkov
On 03/05/2022 19:25, Kuogee Hsieh wrote: Event thread supposed to exit from its while loop after kthread_stop(). However there may has possibility that event thread is pending in the middle of wait_event due to condition checking never become true. To make sure event thread exit its loop after kt

Re: [Freedreno] [PATCH] drm/msm: Limit command submission when no IOMMU

2022-05-04 Thread Dmitry Baryshkov
On 02/05/2022 20:29, Rob Clark wrote: From: Rob Clark Running the GPU without an IOMMU is not really a supported (or sane) configuration. Yet it can be useful during SoC bringup (ie. if the iommu driver doesn't work yet). Lets limit it to users who already have /dev/mem access, to avoid the c

Re: [Freedreno] [PATCH v3] drm/msm/dp: fix event thread stuck in wait_event after kthread_stop()

2022-05-04 Thread Stephen Boyd
Quoting Kuogee Hsieh (2022-05-03 09:25:36) > Event thread supposed to exit from its while loop after kthread_stop(). > However there may has possibility that event thread is pending in the > middle of wait_event due to condition checking never become true. > To make sure event thread exit its loop

[Freedreno] [PULL] drm/msm: several fixes for 5.19

2022-05-04 Thread Dmitry Baryshkov
This pull request contains few tiny fixes targeting 5.19. The biggest one is the fix for the dp event thread wait condition. The following changes since commit 36a1d1bda77e1851bddfa9cf4e8ada94476dbaff: drm/msm: Fix null pointer dereferences without iommu (2022-05-02 10:11:44 -0700) are availa

[Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Douglas Anderson
When rebooting on my sc7280-herobrine based device, I got a crash. Upon debugging, I found that I was in msm_drv_shutdown() and my "pdev" was the one associated with mdss_probe(). >From source, I found that mdss_probe() has the line: platform_set_drvdata(pdev, mdss); ...where "mdss" is of type "

Re: [Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Abhinav Kumar
On 5/4/2022 3:49 PM, Douglas Anderson wrote: When rebooting on my sc7280-herobrine based device, I got a crash. Upon debugging, I found that I was in msm_drv_shutdown() and my "pdev" was the one associated with mdss_probe(). From source, I found that mdss_probe() has the line: platform_se

Re: [Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Dmitry Baryshkov
On Thu, 5 May 2022 at 01:49, Douglas Anderson wrote: > > When rebooting on my sc7280-herobrine based device, I got a > crash. Upon debugging, I found that I was in msm_drv_shutdown() and my > "pdev" was the one associated with mdss_probe(). > > From source, I found that mdss_probe() has the line:

Re: [Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Dmitry Baryshkov
On Thu, 5 May 2022 at 02:29, Abhinav Kumar wrote: > > > > On 5/4/2022 3:49 PM, Douglas Anderson wrote: > > When rebooting on my sc7280-herobrine based device, I got a > > crash. Upon debugging, I found that I was in msm_drv_shutdown() and my > > "pdev" was the one associated with mdss_probe(). > >

Re: [Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Abhinav Kumar
On 5/4/2022 4:30 PM, Dmitry Baryshkov wrote: On Thu, 5 May 2022 at 02:29, Abhinav Kumar wrote: On 5/4/2022 3:49 PM, Douglas Anderson wrote: When rebooting on my sc7280-herobrine based device, I got a crash. Upon debugging, I found that I was in msm_drv_shutdown() and my "pdev" was the on

[Freedreno] [PATCH v2] drm/msm: Fix shutdown

2022-05-04 Thread Douglas Anderson
When rebooting on my sc7280-herobrine based device, I got a crash. Upon debugging, I found that I was in msm_drv_shutdown() and my "pdev" was the one associated with mdss_probe(). >From source, I found that mdss_probe() has the line: platform_set_drvdata(pdev, mdss); ...where "mdss" is of type "

Re: [Freedreno] [PATCH] drm/msm: Fix shutdown

2022-05-04 Thread Doug Anderson
Hi, On Wed, May 4, 2022 at 4:29 PM Dmitry Baryshkov wrote: > > On Thu, 5 May 2022 at 01:49, Douglas Anderson wrote: > > > > When rebooting on my sc7280-herobrine based device, I got a > > crash. Upon debugging, I found that I was in msm_drv_shutdown() and my > > "pdev" was the one associated wit

[Freedreno] [PATCH v2 1/5] drm/msm/dpu: check both DPU and MDSS devices for the IOMMU

2022-05-04 Thread Dmitry Baryshkov
Follow the lead of MDP5 driver and check both DPU and MDSS devices for the IOMMU specifiers. Historically DPU devices had IOMMU specified in the MDSS device tree node, but as some of MDP5 devices are being converted to the supported by the DPU driver, the driver should adapt and check both devices

[Freedreno] [PATCH v2 0/5] drm/msm: fixes for KMS iommu handling

2022-05-04 Thread Dmitry Baryshkov
This series started from the applied and then reverted [2] patch by Robin Murphy [1]. After the MDSS rework [3] has landed it is now possible to reapply the extended version of the original patch. While we are at it, also rework the IOMMU init code for DPU and MDP5 drivers. For MDP5 this moves iom

[Freedreno] [PATCH v2 2/5] drm/msm/mdp5: move iommu_domain_alloc() call close to its usage

2022-05-04 Thread Dmitry Baryshkov
Move iommu_domain_alloc() in front of adress space/IOMMU initialization. This allows us to drop final bits of struct mdp5_cfg_platform which remained from the pre-DT days. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 16 drivers/gpu/drm/msm/disp

[Freedreno] [PATCH v2 3/5] drm/msm: Stop using iommu_present()

2022-05-04 Thread Dmitry Baryshkov
Even if some IOMMU has registered itself on the platform "bus", that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. On Qualcomm platforms the IOMMU can be specified either for the MDP/DPU device or for its paren

[Freedreno] [PATCH v2 5/5] drm/msm: switch msm_kms_init_aspace() to use device_iommu_mapped()

2022-05-04 Thread Dmitry Baryshkov
Change msm_kms_init_aspace() to use generic function device_iommu_mapped() instead of the fwnode-specific interface dev_iommu_fwspec_get(). While we are at it, stop referencing platform_bus_type directly and use the bus of the IOMMU device. Suggested-by: Robin Murphy Signed-off-by: Dmitry Baryshk

[Freedreno] [PATCH v2 4/5] drm/msm: move KMS aspace init to the separate helper

2022-05-04 Thread Dmitry Baryshkov
MDP5 and DPU drivers have the same piece of code now to initialize IOMMU and GEM address space. Move it to the msm_drv.c Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 32 ++ drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 33 --- driver

[Freedreno] [PATCH] drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected

2022-05-04 Thread Jessica Zhang
mdp5_get_global_state runs the risk of hitting an EDEADLK when aqcuiring the modeset lock, but currently mdp5_pipe_release doesn't check for if an error is returned. Because of this, there is a possibility of mdp5_pipe_release hitting a NULL dereference error. To avoid this, let's have mdp5_pipe_r

[Freedreno] [PATCH v2] drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected

2022-05-04 Thread Jessica Zhang
mdp5_get_global_state runs the risk of hitting a -EDEADLK when acquiring the modeset lock, but currently mdp5_pipe_release doesn't check for if an error is returned. Because of this, there is a possibility of mdp5_pipe_release hitting a NULL dereference error. To avoid this, let's have mdp5_pipe_r

Re: [Freedreno] [PATCH v2] drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected

2022-05-04 Thread Rob Clark
On Wed, May 4, 2022 at 6:55 PM Jessica Zhang wrote: > > mdp5_get_global_state runs the risk of hitting a -EDEADLK when acquiring > the modeset lock, but currently mdp5_pipe_release doesn't check for if > an error is returned. Because of this, there is a possibility of > mdp5_pipe_release hitting a