Re: [Freedreno] [PATCH 5/9] drm/msm: Drop msm_gem_iova()

2022-03-30 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > From: Rob Clark > > There was only a single user, which could just as easily stash the iova > when pinning. > > Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/msm_fb.c | 16 ++-- > drivers/gpu

Re: [Freedreno] [PATCH 3/9] drm/msm/gem: Split out inuse helper

2022-03-30 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > From: Rob Clark > > Prep for a following patch. While we are at it, convert a few remaining > WARN_ON()s to GEM_WARN_ON(). Well... GEM_WARN_ON doesn't really look like a 'while we are at it'. It might be better to split it into a separate commi

[Freedreno] [PATCH v6 0/8] Add support for the eDP panel over aux_bus

2022-03-30 Thread Sankeerth Billakanti
This series adds support for generic eDP panel over aux_bus. These changes are dependent on the following series in order: https://patchwork.kernel.org/project/linux-arm-msm/list/?series=620127&state=* https://patchwork.kernel.org/project/linux-arm-msm/list/?series=616587&state=* https://patchwork

[Freedreno] [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus

2022-03-30 Thread Sankeerth Billakanti
This patch adds support for generic eDP sink through aux_bus. The eDP/DP controller driver should support aux transactions originating from the panel-edp driver and hence should be initialized and ready. The panel bridge supporting the panel should be ready before the bridge connector is initializ

[Freedreno] [PATCH v6 2/8] drm/msm/dp: wait for hpd high before aux transaction

2022-03-30 Thread Sankeerth Billakanti
The source device should ensure the sink is ready before proceeding to read the sink capability or performing any aux transactions. The sink will indicate its readiness by asserting the HPD line. The controller driver needs to wait for the hpd line to be asserted by the sink before performing any a

[Freedreno] [PATCH v6 3/8] drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP

2022-03-30 Thread Sankeerth Billakanti
The panel-edp enables the eDP panel power during probe, get_modes and enable. The eDP connect and disconnect interrupts for the eDP/DP controller are directly dependent on panel power. As eDP display can be assumed as always connected, the controller driver can skip the eDP connect and disconnect i

[Freedreno] [PATCH v6 4/8] drm/msm/dp: avoid handling masked interrupts

2022-03-30 Thread Sankeerth Billakanti
The interrupt register will still reflect the connect and disconnect interrupt status without generating an actual HW interrupt. The controller driver should not handle those masked interrupts. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/drm/msm/dp/dp_catalog.c | 5 +++-- 1 file changed,

[Freedreno] [PATCH v6 5/8] drm/msm/dp: prevent multiple votes for dp resources

2022-03-30 Thread Sankeerth Billakanti
The aux_bus support with the dp_display driver will enable the dp resources during msm_dp_modeset_init. The host_init has to return early if the core is already initialized to prevent putting an additional vote for the dp controller resources. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/

[Freedreno] [PATCH v6 6/8] drm/msm/dp: remove unnecessary delay during boot

2022-03-30 Thread Sankeerth Billakanti
Remove the unnecessary delay in executing the EV_HPD_INIT_SETUP event. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index

[Freedreno] [PATCH v6 7/8] drm/msm/dp: Support edp/dp without hpd

2022-03-30 Thread Sankeerth Billakanti
Some eDP sinks or platform boards will not support hpd. This patch adds support for those cases. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/drm/msm/dp/dp_catalog.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b

[Freedreno] [PATCH v6 8/8] drm/msm/dp: Handle eDP mode_valid differently from dp

2022-03-30 Thread Sankeerth Billakanti
The panel-edp driver modes needs to be validated differently from DP because the link capabilities are not available for EDP by that time. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/drm/msm/dp/dp_display.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/

Re: [Freedreno] [PATCH 3/9] drm/msm/gem: Split out inuse helper

2022-03-30 Thread Rob Clark
On Wed, Mar 30, 2022 at 4:32 AM Dmitry Baryshkov wrote: > > On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > > > From: Rob Clark > > > > Prep for a following patch. While we are at it, convert a few remaining > > WARN_ON()s to GEM_WARN_ON(). > > Well... GEM_WARN_ON doesn't really look like a

[Freedreno] [PATCH] drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP

2022-03-30 Thread Nathan Chancellor
When building with CONFIG_PM=y and CONFIG_PM_SLEEP=n (such as ARCH=riscv allmodconfig), the following warnings/errors occur: drivers/gpu/drm/msm/adreno/adreno_device.c:679:12: error: 'adreno_system_resume' defined but not used [-Werror=unused-function] 679 | static int adreno_system_resume(

[Freedreno] [PATCH v2 00/10] drm/msm: Userspace allocated GPU addresses

2022-03-30 Thread Rob Clark
From: Rob Clark The first six paches are various cleanups and simplifications. The next two get rid of redundant vma lookups in the submit and retire paths. Following that, fenced vma lets us indicate a fence value following which the vma is no longer used, which is needed because otherwise use

[Freedreno] [PATCH v2 01/10] drm/msm/gem: Move prototypes

2022-03-30 Thread Rob Clark
From: Rob Clark These belong more cleanly in the gem header. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.h | 23 --- drivers/gpu/drm/msm/msm_gem.h | 22 ++ 2 files changed, 22 insertions(+), 23 deletions(-) di

[Freedreno] [PATCH v2 02/10] drm/msm/gpu: Drop duplicate fence counter

2022-03-30 Thread Rob Clark
From: Rob Clark The ring seqno counter duplicates the fence-context last_fence counter. They end up getting incremented in lock-step, on the same scheduler thread, but the split just makes things less obvious. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 +- drivers

[Freedreno] [PATCH v2 03/10] drm/msm/gem: Convert some missed GEM_WARN_ON()s

2022-03-30 Thread Rob Clark
From: Rob Clark Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem_vma.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index f914ddbaea89..64906594fc65 100644 --- a/drivers/gpu/drm/msm/

[Freedreno] [PATCH v2 04/10] drm/msm/gem: Split out inuse helper

2022-03-30 Thread Rob Clark
From: Rob Clark Prep for a following patch, where it gets a bit more complicated. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 2 +- drivers/gpu/drm/msm/msm_gem.h | 1 + drivers/gpu/drm/msm/msm_gem_vma.c | 9 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) d

[Freedreno] [PATCH v2 05/10] drm/msm/gem: Drop PAGE_SHIFT for address space mm

2022-03-30 Thread Rob Clark
From: Rob Clark Get rid of all the unnecessary conversion between address/size and page offsets. It just confuses things. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 5 ++--- drivers/gpu/dr

[Freedreno] [PATCH v2 07/10] drm/msm/gem: Rework vma lookup and pin

2022-03-30 Thread Rob Clark
From: Rob Clark Combines duplicate vma lookup in the get_and_pin path. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 50 ++- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_ge

[Freedreno] [PATCH v2 06/10] drm/msm: Drop msm_gem_iova()

2022-03-30 Thread Rob Clark
From: Rob Clark There was only a single user, which could just as easily stash the iova when pinning. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_fb.c | 16 ++-- drivers/gpu/drm/msm/msm_gem.c | 16 drivers/gpu/drm/msm/msm_ge

[Freedreno] [PATCH v2 08/10] drm/msm/gem: Split vma lookup and pin

2022-03-30 Thread Rob Clark
From: Rob Clark This way we only lookup vma once per object per submit, for both the submit and retire path. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c| 60 +--- drivers/gpu/drm/msm/msm_gem.h| 9 +++-- drivers/gpu/drm/msm/msm_gem_submit.

[Freedreno] [PATCH v2 09/10] drm/msm/gem: Add fenced vma unpin

2022-03-30 Thread Rob Clark
From: Rob Clark With userspace allocated iova (next patch), we can have a race condition where userspace observes the fence completion and deletes the vma before retire_submit() gets around to unpinning the vma. To handle this, add a fenced unpin which drops the refcount but tracks the fence, an

[Freedreno] [PATCH v2 10/10] drm/msm: Add a way for userspace to allocate GPU iova

2022-03-30 Thread Rob Clark
From: Rob Clark The motivation at this point is mainly native userspace mesa driver in a VM guest. The one remaining synchronous "hotpath" is buffer allocation, because guest needs to wait to know the bo's iova before it can start emitting cmdstream/state that references the new bo. By allocati

Re: [Freedreno] [PATCH v6 8/8] drm/msm/dp: Handle eDP mode_valid differently from dp

2022-03-30 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 19:04, Sankeerth Billakanti wrote: > > The panel-edp driver modes needs to be validated differently from DP > because the link capabilities are not available for EDP by that time. > > Signed-off-by: Sankeerth Billakanti This should not be necessary after https://patchwork.

Re: [Freedreno] [PATCH v6 4/8] drm/msm/dp: avoid handling masked interrupts

2022-03-30 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 19:03, Sankeerth Billakanti wrote: > > The interrupt register will still reflect the connect and disconnect > interrupt status without generating an actual HW interrupt. > The controller driver should not handle those masked interrupts. > > Signed-off-by: Sankeerth Billakant

[Freedreno] [PATCH v2 0/4] drm/msm/dp: simplify dp_connector_get_modes()

2022-03-30 Thread Dmitry Baryshkov
As noted by Ville Syrjälä [1] the dp_connector_get_modes() has weird on-stack interim copy of the mode. When reviewing the mentioned patch I noticed that the rest of the code in dp_connector_get_modes() is weird, unused since September of 2020 and can be removed. This series removes dead weird code

[Freedreno] [PATCH v2 2/4] drm/msm/dp: simplify dp_connector_get_modes()

2022-03-30 Thread Dmitry Baryshkov
Since dp_panel_get_modes() handling for dp_mode was removed, dp_display_get_modes also doesn't change the passed dp_mode, drop the unused dp_mode variable being allocated unused and then freed. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov --- drivers/gpu/

[Freedreno] [PATCH v2 4/4] drm/msm/dp: make dp_connector_mode_valid() more precise

2022-03-30 Thread Dmitry Baryshkov
Make dp_connector_mode_valid() return precise MODE_CLOCK_HIGH rather than generic MODE_BAD in case the mode clock is higher than DP_MAX_PIXEL_CLK_KHZ (675 MHz). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[Freedreno] [PATCH v2 3/4] drm/msm/dp: remove max_pclk_khz field from dp_panel/dp_display

2022-03-30 Thread Dmitry Baryshkov
Since the last commit, the max_pclk_khz became constant, it's set to DP_MAX_PIXEL_CLK_KHZ and never changed afterwards. Remove it completely and use DP_MAX_PIXEL_CLK_KHZ directly. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_

[Freedreno] [PATCH v2 1/4] drm/msm/dp: drop dp_mode argument from dp_panel_get_modes()

2022-03-30 Thread Dmitry Baryshkov
Since the commit ab205927592b ("drm/msm/dp: remove mode hard-coding in case of DP CTS") the function dp_panel_get_modes() doesn't use (or fill) the dp_mode argument. Drop it completely. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/

Re: [Freedreno] [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus

2022-03-30 Thread Dmitry Baryshkov
On 30/03/2022 19:02, Sankeerth Billakanti wrote: This patch adds support for generic eDP sink through aux_bus. The eDP/DP controller driver should support aux transactions originating from the panel-edp driver and hence should be initialized and ready. The panel bridge supporting the panel shoul

Re: [Freedreno] [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus

2022-03-30 Thread Doug Anderson
Hi, On Wed, Mar 30, 2022 at 4:19 PM Dmitry Baryshkov wrote: > > + bridge->ops = > > + DRM_BRIDGE_OP_DETECT | > > + DRM_BRIDGE_OP_HPD | > > + DRM_BRIDGE_OP_MODES; > > I think OP_MODES should be used for eDP, shouldn't it? No.

Re: [Freedreno] [PATCH v6 4/8] drm/msm/dp: avoid handling masked interrupts

2022-03-30 Thread Sankeerth Billakanti (QUIC)
Hi Dmitry, > On Wed, 30 Mar 2022 at 19:03, Sankeerth Billakanti > wrote: > > > > The interrupt register will still reflect the connect and disconnect > > interrupt status without generating an actual HW interrupt. > > The controller driver should not handle those masked interrupts. > > > > Signed

Re: [Freedreno] [PATCH v6 8/8] drm/msm/dp: Handle eDP mode_valid differently from dp

2022-03-30 Thread Sankeerth Billakanti (QUIC)
Hi Dmitry, > On Wed, 30 Mar 2022 at 19:04, Sankeerth Billakanti > wrote: > > > > The panel-edp driver modes needs to be validated differently from DP > > because the link capabilities are not available for EDP by that time. > > > > Signed-off-by: Sankeerth Billakanti > > This should not be nece

Re: [Freedreno] [PATCH] dt-bindings: display: msm: dsi: remove address/size cells

2022-03-30 Thread Vinod Koul
On 29-03-22, 10:52, Rob Herring wrote: > On Tue, Mar 29, 2022 at 12:01:52PM +0530, Vinod Koul wrote: > > On 28-03-22, 13:21, Rob Herring wrote: > > > On Mon, Mar 28, 2022 at 12:18 PM Krzysztof Kozlowski > > > wrote: > > > > > > > > On 28/03/2022 19:16, Vinod Koul wrote: > > > > > On 28-03-22, 19:4