Re: [Freedreno] [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime

2022-09-12 Thread Doug Anderson
Hi, On Mon, Sep 12, 2022 at 7:10 PM Dmitry Baryshkov wrote: > > On 12/09/2022 18:40, Johan Hovold wrote: > > Device-managed resources allocated post component bind must be tied to > > the lifetime of the aggregate DRM device or they will not necessarily be > > released when binding of the aggrega

Re: [Freedreno] [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime

2022-09-12 Thread kernel test robot
Hi Johan, I love your patch! Yet something to improve: [auto build test ERROR on next-20220912] [also build test ERROR on v6.0-rc5] [cannot apply to drm-misc/drm-misc-next drm/drm-next drm-intel/for-linux-next drm-tip/drm-tip linus/master v6.0-rc5 v6.0-rc4 v6.0-rc3] [If your patch is applied to

Re: [Freedreno] [PATCH] drm/msm/mdp5: fix kernel panic during shutdown

2022-09-12 Thread Abhinav Kumar
Hi Fabien Thanks for the patch. I believe this issue should get resolved with https://patchwork.freedesktop.org/patch/490326/ as this avoids the override. I have acked that change and will pick it up for the next fixes. Thanks Abhinav On 9/9/2022 8:28 AM, Fabien Parent wrote: The kernel

Re: [Freedreno] [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime

2022-09-12 Thread Steev Klimaszewski
On 9/12/22 1:10 PM, Dmitry Baryshkov wrote: On 12/09/2022 18:40, Johan Hovold wrote: Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This

Re: [Freedreno] [PATCH v5 3/3] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed

2022-09-12 Thread Kuogee Hsieh
On 9/12/2022 11:37 AM, Dmitry Baryshkov wrote: On 12/09/2022 19:23, Kuogee Hsieh wrote: Bring sink out of D3 (power down) mode into D0 (normal operation) mode by setting DP_SET_POWER_D0 bit to DP_SET_POWER dpcd register. This patch will retry 3 times if written to DP_SET_POWER register failed.

Re: [Freedreno] [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 22:21, Kuogee Hsieh wrote: On 9/12/2022 11:39 AM, Dmitry Baryshkov wrote: On 12/09/2022 19:23, Kuogee Hsieh wrote: DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CT

Re: [Freedreno] [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training

2022-09-12 Thread Kuogee Hsieh
On 9/12/2022 11:39 AM, Dmitry Baryshkov wrote: On 12/09/2022 19:23, Kuogee Hsieh wrote: DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CTRL register to 0 before start link traini

Re: [Freedreno] [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 19:23, Kuogee Hsieh wrote: DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CTRL register to 0 before start link training. At rare case that DP MSA timing parameters may

Re: [Freedreno] [PATCH v5 3/3] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 19:23, Kuogee Hsieh wrote: Bring sink out of D3 (power down) mode into D0 (normal operation) mode by setting DP_SET_POWER_D0 bit to DP_SET_POWER dpcd register. This patch will retry 3 times if written to DP_SET_POWER register failed. Could you please elaborate this change? Can the

Re: [Freedreno] [PATCH v5 2/3] drm/msm/dp: replace variable err with len at dp_aux_link_power_up()

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 19:23, Kuogee Hsieh wrote: drm_dp_dpcd_readb() will return 1 to indicate one byte had been read successfully. This patch replace variable "err" with "len" have more correct meaning. changes in v5: -- split into 3 patches Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov

Re: [Freedreno] [PATCH 0/2] Add support for HDR color formats

2022-09-12 Thread Dmitry Baryshkov
On 01/09/2022 23:34, Jessica Zhang wrote: Add support for HDR color formats. XR30 linear/compressed format has been validated with null_platform_test on SC7180, and P010 linear has been validated with plane_test (also on SC7180). Are they supported on sdm845? On msm8998? Jessica Zhang (2):

Re: [Freedreno] [PATCH 2/2] drm/msm/dpu: Add support for P010 format

2022-09-12 Thread Rob Clark
On Thu, Sep 1, 2022 at 1:34 PM Jessica Zhang wrote: > > Add support for P010 color format. This adds support for both linear and > compressed formats. > > Signed-off-by: Jessica Zhang Reviewed-by: Rob Clark > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c| 17 - > drive

Re: [Freedreno] [PATCH 1/2] drm/msm/dpu: Add support for XR30 format

2022-09-12 Thread Rob Clark
On Thu, Sep 1, 2022 at 1:34 PM Jessica Zhang wrote: > > Add support for XR30 color format. This supports both linear and > compressed formats. > > Signed-off-by: Jessica Zhang Reviewed-by: Rob Clark > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c| 7 +++ > drivers/gpu/drm/msm/disp

Re: [Freedreno] [PATCH 5/7] drm/msm/dp: fix bridge lifetime

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the

Re: [Freedreno] [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the

Re: [Freedreno] [PATCH 3/7] drm/msm/dp: fix IRQ lifetime

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the DP IRQ, which will

Re: [Freedreno] [PATCH 7/7] drm/msm: drop modeset sanity checks

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Drop the overly defensive modeset sanity checks of function parameters which have already been checked or used by the callers. Signed-off-by: Johan Hovold Again, please split into dp and dsi patches. After that: Reviewed-by: Dmitry Baryshkov ---

Re: [Freedreno] [PATCH v3] drm/msm/dp: add atomic_check to bridge ops

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 20:34, Kuogee Hsieh wrote: DRM commit_tails() will disable downstream crtc/encoder/bridge if both disable crtc is required and crtc->active is set before pushing a new frame downstream. There is a rare case that user space display manager issue an extra screen update immediately fo

Re: [Freedreno] [PATCH 6/7] drm/msm/hdmi: fix IRQ lifetime

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the HDMI IRQ, which wi

Re: [Freedreno] [PATCH 2/7] drm/msm: fix memory corruption with too many bridges

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: Add the missing sanity checks on the bridge counter to avoid corrupting data beyond the fixed-sized bridge array in case there are ever more than eight bridges. a3376e3ec81c ("drm/msm: convert to drm_bridge") ab5b0107ccf3 ("drm/msm: Initial add eDP suppor

Re: [Freedreno] [PATCH 1/7] drm/msm: fix use-after-free on probe deferral

2022-09-12 Thread Dmitry Baryshkov
On 12/09/2022 18:40, Johan Hovold wrote: The bridge counter was never reset when tearing down the DRM device so that stale pointers to deallocated structures would be accessed on the next tear down (e.g. after a second late bind deferral). Given enough bridges and a few probe deferrals this coul

[Freedreno] [PATCH v3] drm/msm/dp: add atomic_check to bridge ops

2022-09-12 Thread Kuogee Hsieh
DRM commit_tails() will disable downstream crtc/encoder/bridge if both disable crtc is required and crtc->active is set before pushing a new frame downstream. There is a rare case that user space display manager issue an extra screen update immediately followed by close DRM device while down strea

Re: [Freedreno] [PATCH 0/7] drm/msm: probe deferral fixes

2022-09-12 Thread Abhinav Kumar
Adding kuogee to this series Hi Johan Thanks for posting this. We will take a look at this, re-validate and give our reviews/tested-bys. Thanks Abhinav On 9/12/2022 8:40 AM, Johan Hovold wrote: The MSM DRM is currently broken in multiple ways with respect to probe deferral. Not only does the

Re: [Freedreno] [PATCH v2] drm/msm/dp: add atomic_check to bridge ops

2022-09-12 Thread Abhinav Kumar
On 9/9/2022 10:16 AM, Kuogee Hsieh wrote: DRM commit_tails() will disable downstream crtc/encoder/bridge if both disable crtc is required and crtc->active is set before pushing a new frame downstream. There is a rare case that user space display manager issue an extra screen update immediatel

[Freedreno] [PATCH v5 0/3] cleared DP_DOWNSPREAD_CTRL register

2022-09-12 Thread Kuogee Hsieh
cleared DP_DOWNSPREAD_CTRL register before start link training Kuogee Hsieh (3): drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training drm/msm/dp: replace variable err with len at dp_aux_link_power_up() drm/msm/dp: retry 3 times if set sink to D0 poweer state failed

[Freedreno] [PATCH 0/7] drm/msm: probe deferral fixes

2022-09-12 Thread Johan Hovold
The MSM DRM is currently broken in multiple ways with respect to probe deferral. Not only does the driver currently fail to probe again after a late deferral, but due to a related use-after-free bug this also triggers NULL-pointer dereferences. These bugs are not new but have become critical with

[Freedreno] [PATCH 7/7] drm/msm: drop modeset sanity checks

2022-09-12 Thread Johan Hovold
Drop the overly defensive modeset sanity checks of function parameters which have already been checked or used by the callers. Signed-off-by: Johan Hovold --- drivers/gpu/drm/msm/dp/dp_display.c | 7 +-- drivers/gpu/drm/msm/dsi/dsi.c | 7 +-- 2 files changed, 2 insertions(+), 12 de

[Freedreno] [PATCH 5/7] drm/msm/dp: fix bridge lifetime

2022-09-12 Thread Johan Hovold
Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the aggregate device when binding is later retr

[Freedreno] [PATCH 3/7] drm/msm/dp: fix IRQ lifetime

2022-09-12 Thread Johan Hovold
Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the DP IRQ, which will otherwise remain requested so that the nex

[Freedreno] [PATCH 1/7] drm/msm: fix use-after-free on probe deferral

2022-09-12 Thread Johan Hovold
The bridge counter was never reset when tearing down the DRM device so that stale pointers to deallocated structures would be accessed on the next tear down (e.g. after a second late bind deferral). Given enough bridges and a few probe deferrals this could currently also lead to data beyond the br

[Freedreno] [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime

2022-09-12 Thread Johan Hovold
Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This can lead resource leaks or failure to bind the aggregate device when binding is later retr

[Freedreno] [PATCH 6/7] drm/msm/hdmi: fix IRQ lifetime

2022-09-12 Thread Johan Hovold
Device-managed resources allocated post component bind must be tied to the lifetime of the aggregate DRM device or they will not necessarily be released when binding of the aggregate device is deferred. This is specifically true for the HDMI IRQ, which will otherwise remain requested so that the n

[Freedreno] [PATCH 2/7] drm/msm: fix memory corruption with too many bridges

2022-09-12 Thread Johan Hovold
Add the missing sanity checks on the bridge counter to avoid corrupting data beyond the fixed-sized bridge array in case there are ever more than eight bridges. a3376e3ec81c ("drm/msm: convert to drm_bridge") ab5b0107ccf3 ("drm/msm: Initial add eDP support in msm drm driver (v5)") a689554ba6ed ("d

[Freedreno] [PATCH v5 3/3] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed

2022-09-12 Thread Kuogee Hsieh
Bring sink out of D3 (power down) mode into D0 (normal operation) mode by setting DP_SET_POWER_D0 bit to DP_SET_POWER dpcd register. This patch will retry 3 times if written to DP_SET_POWER register failed. Changes in v5: -- split into two patches Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm

[Freedreno] [PATCH v5 2/3] drm/msm/dp: replace variable err with len at dp_aux_link_power_up()

2022-09-12 Thread Kuogee Hsieh
drm_dp_dpcd_readb() will return 1 to indicate one byte had been read successfully. This patch replace variable "err" with "len" have more correct meaning. changes in v5: -- split into 3 patches Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_link.c | 14 +++--- 1 file changed,

[Freedreno] [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training

2022-09-12 Thread Kuogee Hsieh
DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CTRL register to 0 before start link training. At rare case that DP MSA timing parameters may be mis-interpreted by the sink which cause

Re: [Freedreno] [PATCH v1 0/7] drm/bridge_connector: perform HPD enablement automatically

2022-09-12 Thread Dmitry Baryshkov
On Mon, 12 Sept 2022 at 11:51, Tomi Valkeinen wrote: > > Hi, > > On 29/04/2022 21:51, Dmitry Baryshkov wrote: > > From all the drivers using drm_bridge_connector only iMX/dcss and OMAP > > DRM driver do a proper work of calling > > drm_bridge_connector_en/disable_hpd() in right places. Rather tha

Re: [Freedreno] [PATCH v1 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()

2022-09-12 Thread Tomi Valkeinen
On 29/04/2022 21:51, Dmitry Baryshkov wrote: Now as all drivers stopped calling drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() it is safe to remove them complelely. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 25 --

Re: [Freedreno] [PATCH v1 0/7] drm/bridge_connector: perform HPD enablement automatically

2022-09-12 Thread Tomi Valkeinen
Hi, On 29/04/2022 21:51, Dmitry Baryshkov wrote: From all the drivers using drm_bridge_connector only iMX/dcss and OMAP DRM driver do a proper work of calling drm_bridge_connector_en/disable_hpd() in right places. Rather than teaching each and every driver how to properly handle drm_bridge_conn