[Freedreno] [PATCH v2] drm/msm: reduce usage of round_pixclk callback

2022-01-05 Thread Dmitry Baryshkov
The round_pixclk() callback returns different rate only on MDP4 in HDMI (DTV) case. Stop using this callback in other cases to simplify mode_valid callbacks. Signed-off-by: Dmitry Baryshkov --- Changes since v1: - Rebased on top of HDMI changes - Dropped eDP part, driver got removed --- drive

Re: [Freedreno] [PATCH v4 01/34] component: Introduce struct aggregate_device

2022-01-05 Thread Stephen Boyd
Quoting Greg Kroah-Hartman (2021-12-21 01:29:59) > > @@ -471,9 +477,17 @@ int component_master_add_with_match(struct device > > *parent, > > if (!master) > > return -ENOMEM; > > > > + id = ida_alloc(&aggregate_ida, GFP_KERNEL); > > + if (id < 0) { > > + kfre

Re: [Freedreno] [PATCH v4 01/34] component: Introduce struct aggregate_device

2022-01-05 Thread Stephen Boyd
Quoting Greg Kroah-Hartman (2021-12-21 01:28:10) > On Thu, Dec 02, 2021 at 02:26:59PM -0800, Stephen Boyd wrote: > > Replace 'struct master' with 'struct aggregate_device' and then rename > > 'master' to 'adev' everywhere in the code. While we're here, put a > > struct device inside the aggregate d

Re: [Freedreno] [v1 1/2] dt-bindings: msm/dsi: Add 10nm dsi phy tuning properties

2022-01-05 Thread Stephen Boyd
Quoting Rajeev Nandan (2021-12-30 01:24:35) > Add 10nm dsi phy tuning properties for phy drive strength and > phy drive level adjustemnt. s/adjustemnt/adjustment/ Please add the details about parasitics and eye shape tuning to this commit text. > > Signed-off-by: Rajeev Nandan > --- > .../devi

Re: [Freedreno] [PATCH] drm/msm/dpu: remove extra wrappers around dpu_core_irq

2022-01-05 Thread Abhinav Kumar
On 11/25/2021 6:18 PM, Dmitry Baryshkov wrote: Remove extra dpu_irq_* wrappers from dpu_kms.c, merge them directly into dpu_core_irq_* functions. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h | 12 - .../gpu/drm/msm

[Freedreno] [PATCH 3/4] drm/msm: split the main platform driver

2022-01-05 Thread Dmitry Baryshkov
Currently the msm platform driver is a multiplex handling several cases: - headless GPU-only driver, - MDP4 with flat device nodes, - MDP5/DPU MDSS with all the nodes being children of MDSS node. This results in not-so-perfect code, checking the hardware version (MDP4/MDP5/DPU) in several places,

[Freedreno] [PATCH 4/4] drm/msm: stop using device's match data pointer

2022-01-05 Thread Dmitry Baryshkov
Let's make the match's data pointer a (sub-)driver's private data. The only user currently is the msm_drm_init() function, using this data to select kms_init callback. Pass this callback through the driver's private data instead. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/

[Freedreno] [PATCH 2/4] drm/msm: remove extra indirection for msm_mdss

2022-01-05 Thread Dmitry Baryshkov
Since now there is just one mdss subdriver, drop all the indirection, make msm_mdss struct completely opaque (and defined inside msm_mdss.c) and call mdss functions directly. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 44 drivers/gpu/drm/msm/msm_kms.h |

[Freedreno] [PATCH 1/4] drm/msm: unify MDSS drivers

2022-01-05 Thread Dmitry Baryshkov
MDP5 and DPU1 both provide the driver handling the MDSS region, which handles the irq domain and (incase of DPU1) adds some init for the UBWC controller. Unify those two pieces of code into a common driver. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/Makefile | 3 +

[Freedreno] [PATCH 0/4] drm/msm: rework MDSS drivers

2022-01-05 Thread Dmitry Baryshkov
These patches coninue work started by AngeloGioacchino Del Regno in the previous cycle by further decoupling and dissecting MDSS and MDP drivers probe/binding paths. This removes code duplication between MDP5 and DPU1 MDSS drivers, by merging them and moving to the top level. This patchset depend

Re: [Freedreno] [PATCH v2 3/3] drm/msm: move msm_readl/_writel to msm_drv.h

2022-01-05 Thread Dmitry Baryshkov
On Thu, 6 Jan 2022 at 02:43, Stephen Boyd wrote: > > Quoting Dmitry Baryshkov (2022-01-05 15:27:00) > > With the reglog removal, msm_readl/_writel became single line wrappers > > around readl/writel. Move those two wrappers and msm_rmw to msm_drv.h to > > remove need for extra function calls when

Re: [Freedreno] [PATCH v2 3/3] drm/msm: move msm_readl/_writel to msm_drv.h

2022-01-05 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-01-05 15:27:00) > With the reglog removal, msm_readl/_writel became single line wrappers > around readl/writel. Move those two wrappers and msm_rmw to msm_drv.h to > remove need for extra function calls when doing register writes. > > Signed-off-by: Dmitry Baryshkov

Re: [Freedreno] [PATCH v2 2/3] drm/msm: drop dbgname argument from msm_ioremap*()

2022-01-05 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-01-05 15:26:59) > msm_ioremap() functions take additional argument dbgname which is now > unused. > > Signed-off-by: Dmitry Baryshkov > --- Reviewed-by: Stephen Boyd

Re: [Freedreno] [PATCH v2 1/3] drm/msm: drop register logging support

2022-01-05 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-01-05 15:26:58) > Register logging was used during early stages of msm driver development > to compare upstream and downstream register traces. However the tool was > never updated to work with mdp5 hardware. Later it was dropped > completely when Rob imported freedre

[Freedreno] [PATCH v2 3/3] drm/msm: move msm_readl/_writel to msm_drv.h

2022-01-05 Thread Dmitry Baryshkov
With the reglog removal, msm_readl/_writel became single line wrappers around readl/writel. Move those two wrappers and msm_rmw to msm_drv.h to remove need for extra function calls when doing register writes. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 20

[Freedreno] [PATCH v2 1/3] drm/msm: drop register logging support

2022-01-05 Thread Dmitry Baryshkov
Register logging was used during early stages of msm driver development to compare upstream and downstream register traces. However the tool was never updated to work with mdp5 hardware. Later it was dropped completely when Rob imported freedreno tools into mesa. All this makes DRM_MSM_REGISTER_LOG

[Freedreno] [PATCH v2 2/3] drm/msm: drop dbgname argument from msm_ioremap*()

2022-01-05 Thread Dmitry Baryshkov
msm_ioremap() functions take additional argument dbgname which is now unused. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 8 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 2 +- drivers/gpu/drm/msm/dis

[Freedreno] [PATCH v4 5/5] drm/msm/dpu: move VBIF blocks handling to dpu_rm

2022-01-05 Thread Dmitry Baryshkov
Move handling of VBIF blocks into dpu_rm. This serves the purpose of unification of handling of all hardware blocks inside the DPU driver. This removes hand-coded loops in dpu_vbif (which look for necessary VBIF instance by looping through the dpu_kms->hw_vbif and comparing vbif_idx). Signed-off-b

[Freedreno] [PATCH v4 4/5] drm/msm/dpu: stop embedding dpu_hw_blk into dpu_hw_intf

2022-01-05 Thread Dmitry Baryshkov
Now as dpu_hw_intf is not hanled by dpu_rm_get_assigned_resources, there is no point in embedding the (empty) struct dpu_hw_blk into dpu_hw_intf (and using typecasts between dpu_hw_blk and dpu_hw_intf). Drop it and use dpu_hw_intf directly. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm

[Freedreno] [PATCH v4 3/5] drm/msm/dpu: get INTF blocks directly rather than through RM

2022-01-05 Thread Dmitry Baryshkov
INTF blocks are not really handled by resource manager, they are assigned at dpu_encoder_setup_display using dpu_encoder_get_intf(). Then this allocation is passed to RM and then returned to then dpu_encoder. So allocate them outside of RM and use them directly. Signed-off-by: Dmitry Baryshkov --

[Freedreno] [PATCH v4 2/5] drm/msm/dpu: add DSPP blocks teardown

2022-01-05 Thread Dmitry Baryshkov
Add missing calls to dpu_hw_dspp_destroy() to free resources allocated for DSPP hardware blocks. Fixes: e47616df008b ("drm/msm/dpu: add support for color processing blocks in dpu driver") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 8 1 file changed, 8

[Freedreno] [PATCH v4 1/5] drm/msm/dpu: drop unused lm_max_width from RM

2022-01-05 Thread Dmitry Baryshkov
No code uses lm_max_width from resource manager, so drop it. Instead of calculating the lm_max_width, code can use max_mixer_width field from the hw catalog. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 12 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 4

[Freedreno] [PATCH v4 0/5] drm/msm/dpu: simplify RM code

2022-01-05 Thread Dmitry Baryshkov
INTF blocks are not really handled by resource manager, they are assigned at dpu_encoder_setup_display using dpu_encoder_get_intf(). Then this allocation is passed to RM and then returned to then dpu_encoder. So allocate them outside of RM and use them directly. While we are at it, drop the lm_max

Re: [Freedreno] [PATCH] drm/msm/dp: Simplify dp_debug_init() and dp_debug_get()

2022-01-05 Thread Stephen Boyd
Quoting Christophe JAILLET (2021-12-22 11:33:47) > dp_debug_init() always returns 0. So, make it a void function and simplify > the only caller accordingly. > > While at it remove a useless 'rc' initialization in dp_debug_get() > > Signed-off-by: Christophe JAILLET > --- Reviewed-by: Stephen Boyd

Re: [Freedreno] [PATCH v2] drm/msm/dp: populate connector of struct dp_panel

2022-01-05 Thread Stephen Boyd
Quoting Kuogee Hsieh (2021-12-29 11:17:02) > There is kernel crashed due to unable to handle kernel NULL > pointer dereference of dp_panel->connector while running DP link > layer compliance test case 4.2.2.6 (EDID Corruption Detection). Can you explain how we get into that situation? Like "We ne

Re: [Freedreno] [PATCH] drm/msm/dp: stop link training after link training 2 failed

2022-01-05 Thread Stephen Boyd
Quoting Kuogee Hsieh (2022-01-04 15:52:07) > Each DP link training contains link training 1 followed by link > training 2. There is maximum of 5 retries of DP link training > before declared link training failed. It is required to stop link > training at end of link training 2 if it is failed so t

Re: [Freedreno] [PATCH v2] drm/msm/dp: add support of tps4 (training pattern 4) for HBR3

2022-01-05 Thread Stephen Boyd
Quoting Kuogee Hsieh (2021-12-29 10:15:45) > diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h > b/drivers/gpu/drm/msm/dp/dp_catalog.h > index 6965afa..7dea101 100644 > --- a/drivers/gpu/drm/msm/dp/dp_catalog.h > +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h > @@ -94,7 +94,7 @@ void dp_catalog_ctrl_mai

Re: [Freedreno] [PATCH] drm/msm/dp: Fix a potential double free in an error handling path

2022-01-05 Thread Christophe JAILLET
Le 05/01/2022 à 21:09, Stephen Boyd a écrit : Quoting Christophe JAILLET (2021-12-26 07:14:05) 'dp_bridge' is devm_alloc'ed, so there is no need to free it explicitly or there will be a double free(). Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Si

Re: [Freedreno] [PATCH] drm/msm/dp: Fix a potential double free in an error handling path

2022-01-05 Thread Stephen Boyd
Quoting Christophe JAILLET (2021-12-26 07:14:05) > 'dp_bridge' is devm_alloc'ed, so there is no need to free it explicitly or > there will be a double free(). > > Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable > and disable") > Signed-off-by: Christophe JAILLET > ---