[Freedreno] [PATCH v3 5/8] drm/msm/dpu: enable INTF TE operations only when supported by HW

2023-09-03 Thread Dmitry Baryshkov
The DPU_INTF_TE bit is set for all INTF blocks on DPU >= 5.0, however only INTF_1 and INTF_2 actually support tearing control (both are INTF_DSI). Rather than trying to limit the DPU_INTF_TE feature bit to those two INTF instances, check for the major && INTF type. Reviewed-by: Marijn Suijten

[Freedreno] [PATCH v3 8/8] drm/msm/dpu: move INTF tearing checks to dpu_encoder_phys_cmd_init

2023-09-03 Thread Dmitry Baryshkov
As the INTF is fixed at the encoder creation time, we can move the check whether INTF supports tearchck to dpu_encoder_phys_cmd_init(). This function can return an error if INTF doesn't have required feature. Performing this check in dpu_encoder_phys_cmd_tearcheck_config() is less useful, as this

[Freedreno] [PATCH v3 0/8] drm/msm/dpu: move INTF tearing checks to dpu_encoder_phys_cmd_ini

2023-09-03 Thread Dmitry Baryshkov
rop two feature flags, DPU_INTF_TE and DPU_PINGPONG_TE, in favour of performing the MDSS revision checks instead. Changes since v2: - Added guarding checks for hw_intf and hw_pp in debug print (Marijn) - Removed extra empty lines (Marijn) Changes since v1: - Added missing patch - Reworked commit

[Freedreno] [PATCH v3 4/8] drm/msm/dpu: inline _setup_intf_ops()

2023-09-03 Thread Dmitry Baryshkov
Inline the _setup_intf_ops() function, it makes it easier to handle different conditions involving INTF configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 48 ++--- 1 file changed, 22 insertions(+), 26

[Freedreno] [PATCH v3 1/8] drm/msm/dpu: inline _setup_pingpong_ops()

2023-09-03 Thread Dmitry Baryshkov
Inline the _setup_pingpong_ops() function, it makes it easier to handle different conditions involving PINGPONG configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 39 --- 1 file changed, 17

[Freedreno] [PATCH v3 7/8] drm/msm/dpu: drop useless check from dpu_encoder_phys_cmd_te_rd_ptr_irq()

2023-09-03 Thread Dmitry Baryshkov
The dpu_encoder_phys_cmd_te_rd_ptr_irq() function uses neither hw_intf nor hw_pp data, so we can drop the corresponding check. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 1 file changed, 8 deletions(-) diff

[Freedreno] [PATCH v3 3/8] drm/msm/dpu: drop the DPU_PINGPONG_TE flag

2023-09-03 Thread Dmitry Baryshkov
The DPU_PINGPONG_TE flag became unused, we can drop it now. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff

[Freedreno] [PATCH v3 2/8] drm/msm/dpu: enable PINGPONG TE operations only when supported by HW

2023-09-03 Thread Dmitry Baryshkov
The DPU_PINGPONG_TE bit is set for all PINGPONG blocks on DPU < 5.0. Rather than checking for the flag, check for the presense of the corresponding interrupt line. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 6 --

[Freedreno] [PATCH v3 6/8] drm/msm/dpu: drop DPU_INTF_TE feature flag

2023-09-03 Thread Dmitry Baryshkov
Replace the only user of the DPU_INTF_TE feature flag with the direct DPU version comparison. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 5 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 -

[Freedreno] [PATCH 3/3] drm/msm/dpu: move encoder status to standard encoder debugfs dir

2023-09-03 Thread Dmitry Baryshkov
Now as we have standard per-encoder debugfs directory, move DPU encoder status file to that directory. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 45 +++-- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git

[Freedreno] [PATCH 0/3] drm: introduce per-encoder debugfs directory

2023-09-03 Thread Dmitry Baryshkov
Each of connectors and CRTCs used by the DRM device provides debugfs directory, which is used by several standard debugfs files and can further be extended by the driver. Add such generic debugfs directories for encoder. As a showcase for this dir, migrate `bridge_chains' debugfs file (which

[Freedreno] [PATCH 1/3] drm/encoder: register per-encoder debugfs dir

2023-09-03 Thread Dmitry Baryshkov
Each of connectors and CRTCs used by the DRM device provides debugfs directory, which is used by several standard debugfs files and can further be extended by the driver. Add such generic debugfs directories for encoder. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_debugfs.c | 25

[Freedreno] [PATCH 2/3] drm/bridge: migrate bridge_chains to per-encoder file

2023-09-03 Thread Dmitry Baryshkov
Instead of having a single file with all bridge chains, list bridges under a corresponding per-encoder debugfs directory. Example of the listing: $ cat /sys/kernel/debug/dri/0/encoder-0/bridges bridge[0]: dsi_mgr_bridge_funcs type: [0] Unknown ops: [0] bridge[1]:

Re: [Freedreno] [PATCH 0/7] drm/msm/dp: Simplify DPCD related code with helpers

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: This driver open-codes a few of the DPCD register reads when it can be simplified by using the helpers instead. This series reworks the MSM DP driver to use the DPCD helpers and removes some dead code along the way. There's the potential for even more

Re: [Freedreno] [PATCH 7/7] drm/msm/dp: Remove dp_display_is_ds_bridge()

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: This function is simply drm_dp_is_branch() so use that instead of open-coding it. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_display.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-)

Re: [Freedreno] [PATCH 6/7] drm/msm/dp: Inline dp_link_parse_sink_count()

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: The function dp_link_parse_sink_count() is really just drm_dp_read_sink_count(). It debug prints out the bit for content protection (DP_SINK_CP_READY), but that is not useful beyond debug because 'link->dp_link.sink_count' is overwritten to only contain

Re: [Freedreno] [PATCH 5/7] drm/msm/dp: Simplify with drm_dp_{max_link_rate, max_lane_count}()

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: These are open-coded versions of common functions. Replace them with the common code to improve readability. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_panel.c | 4 ++-- 1 file changed, 2

Re: [Freedreno] [PATCH 4/7] drm/msm/dp: Remove aux_cfg_update_done and related code

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: The member 'aux_cfg_update_done' is always false. This is dead code that never runs. Remove it. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_panel.c | 15 --- 1 file changed, 15

Re: [Freedreno] [PATCH 3/7] drm/msm/dp: Remove dead code related to downstream cap info

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: We read the downstream port count and capability info but never use it anywhere. Remove 'ds_port_cnt' and 'ds_cap_info' and any associated code from this driver. Fold the check for 'dfp_present' into a call to drm_dp_is_branch() at the one place it is

Re: [Freedreno] [PATCH 2/7] drm/msm/dp: Use drm_dp_read_sink_count() helper

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: Use the common function drm_dp_read_sink_count() instead of open-coding it. This shrinks the kernel text a tiny bit. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_panel.c | 19 +++ 1

Re: [Freedreno] [PATCH 1/7] drm/msm/dp: Replace open-coded drm_dp_read_dpcd_caps()

2023-09-03 Thread Dmitry Baryshkov
On 29/08/2023 21:47, Stephen Boyd wrote: This function duplicates the common function drm_dp_read_dpcd_caps(). The array of DPCD registers filled in is one size larger than the function takes, but from what I can tell that extra byte was never used. Resize the array and use the common function

[Freedreno] [PATCH] drm/msm/dp: support setting the DP subconnector type

2023-09-03 Thread Dmitry Baryshkov
Read the downstream port info and set the subconnector type accordingly. Signed-off-by: Dmitry Baryshkov --- Dependencies: https://patchwork.freedesktop.org/series/123221/ --- drivers/gpu/drm/msm/dp/dp_display.c | 9 - drivers/gpu/drm/msm/dp/dp_panel.c | 5 +

Re: [Freedreno] [PATCH v1] drm/msm/dp: do not reinitialize phy unless retry during link training

2023-09-03 Thread Dmitry Baryshkov
On 09/08/2023 01:19, Kuogee Hsieh wrote: DP PHY re-initialization done using dp_ctrl_reinitialize_mainlink() will cause PLL unlocked initially and then PLL gets locked at the end of initialization. PLL_UNLOCKED interrupt will fire during this time if the interrupt mask is enabled. However

[Freedreno] [RFC PATCH v1 11/12] usb: typec: qcom: extract DRM bridge functionality to separate file

2023-09-03 Thread Dmitry Baryshkov
In order to simplify source code and to reduce the amount of ifdefs in the C files, extract the DRM bridge functionality to the separate file. Suggested-by: Heikki Krogerus Suggested-by: Bryan O'Donoghue Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/tcpm/qcom/Makefile | 4 ++

[Freedreno] [RFC PATCH v1 09/12] usb: typec: tcpm: support generating Type-C port names for userspace

2023-09-03 Thread Dmitry Baryshkov
We need a way to generate and return the Type-C port device names. For example, it is going to be used by the DRM to provide PATH property for DisplayPort connectors. Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/tcpm/tcpm.c | 14 ++ include/linux/usb/tcpm.h | 2 ++ 2

[Freedreno] [RFC PATCH v1 08/12] usb: typec: support generating Type-C port names for userspace

2023-09-03 Thread Dmitry Baryshkov
We need a way to generate and return the Type-C port device names. For example, it is going to be used by the DRM to provide PATH property for DisplayPort connectors. Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/class.c | 14 ++ include/linux/usb/typec.h | 2 ++ 2 files

[Freedreno] [RFC PATCH v1 04/12] drm/bridge-connector: set the PATH property for the connector

2023-09-03 Thread Dmitry Baryshkov
In order to properly identify connectors (in particular, DisplayPort connectors wrapped into USB-C) allow bridge drivers to specify the value to be used for connector's PATH property. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 12

[Freedreno] [RFC PATCH v1 07/12] soc: qcom: pmic_glink_altmode: report that this is a Type-C connector

2023-09-03 Thread Dmitry Baryshkov
Set the bridge's path property to point out that this connector is wrapped into the Type-C port. We can not really identify the exact Type-C port because it is registered separately, by another driver, which is not mandatory and the corresponding device is not even present on some of platforms,

[Freedreno] [RFC PATCH v1 02/12] drm/sysfs: link DRM connector device to the connector's fw nodes

2023-09-03 Thread Dmitry Baryshkov
Setup the of_node and fwnode fields for the DRM connector device, making respective links to appear in /sys. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_sysfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index

[Freedreno] [RFC PATCH v1 12/12] usb: typec: qcom: define the bridge's path

2023-09-03 Thread Dmitry Baryshkov
In order to notify the userspace about the DRM connector's USB-C port, export the corresponding port's name as the bridge's path field. Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 11 +++ drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_drm.c | 4

[Freedreno] [RFC PATCH v1 05/12] drm/bridge: remove conditionals around devicetree pointers

2023-09-03 Thread Dmitry Baryshkov
Remove ifdef CONFIG_OF around the drm_bridge::of_node field. This follow the correponding change to struct device we had since 2.6.39. Having conditional around the of_node pointers turns out to make driver code use ugly #ifdef blocks. Drop the conditionals and remove the #ifdef blocks from the

[Freedreno] [RFC PATCH v1 10/12] usb: typec: qcom: implement proper error path in probe()

2023-09-03 Thread Dmitry Baryshkov
Implement proper error path in the qcom_pmic_typec_probe(). This makes sure that we properly disable hardware blocks and do not leak memory. Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver") Signed-off-by: Dmitry Baryshkov ---

[Freedreno] [RFC PATCH v1 06/12] soc: qcom: pmic_glink_altmode: fix DRM connector type

2023-09-03 Thread Dmitry Baryshkov
During discussions regarding USB-C vs native DisplayPort it was pointed out that other implementations (i915, AMD) are using DRM_MODE_CONNECTOR_DisplayPort for both native and USB-C-wrapped DP output. Follow this example and make the pmic_glink_altmode driver also report DipslayPort connector

[Freedreno] [RFC PATCH v1 03/12] drm/connector: extend PATH property to covert Type-C case

2023-09-03 Thread Dmitry Baryshkov
Userspace needs to identify whether the DisplayPort connector is a native one or it is wrapped into the USB-C port. Moreover the userspace might need to point user to the exact location of this Type-C port on the laptop case. Existing USB-C altmode implementations (i915, amdgpu) have used the

[Freedreno] [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors"

2023-09-03 Thread Dmitry Baryshkov
The kdev->fwnode pointer is never set in drm_sysfs_connector_add(), so dev_fwnode() checks never succeed, making the respective commit NOP. And if drm_sysfs_connector_add() is modified to set kdev->fwnode, it breaks drivers already using components (as it was pointed at [1]), resulting in a

[Freedreno] [RFC PATCH v1 00/12] drm, usb/typec: uABI for USB-C DisplayPort connectors

2023-09-03 Thread Dmitry Baryshkov
During the discussion regarding DisplayPort wrapped in the USB-C connectors (via the USB-C altmode) it was pointed out that currently there is no good way to let userspace know if the DRM connector in question is the 'native' DP connector or if it is the USB-C connector. An attempt to use

Re: [Freedreno] [PATCH v4 0/3] drm: simplify support for transparent DRM bridges

2023-09-03 Thread Dmitry Baryshkov
On Tue, 22 Aug 2023 at 17:17, Laurent Pinchart wrote: > > Hi Dmitry, > > Thank you for the patches. > > On Thu, Aug 17, 2023 at 05:55:13PM +0300, Dmitry Baryshkov wrote: > > Supporting DP/USB-C can result in a chain of several transparent > > bridges (PHY, redrivers, mux, etc). This results in

Re: [Freedreno] [PATCH v4 4/4] drm/msm/dsi: Enable widebus for DSI

2023-09-03 Thread Marijn Suijten
On 2023-08-22 10:42:07, Jessica Zhang wrote: > DSI 6G v2.5.x+ supports a data-bus widen mode that allows DSI to send > 48 bits of compressed data instead of 24. > > Enable this mode whenever DSC is enabled for supported chipsets. > > Signed-off-by: Jessica Zhang > --- >

[Freedreno] [PATCH v2 4/6] drm_dbg: add trailing newlines to msgs

2023-09-03 Thread Jim Cromie
By at least strong convention, a print-buffer's trailing newline says "message complete, send it". The exception (no TNL, followed by a call to pr_cont) proves the general rule. Most DRM.debug calls already comport with this: 207 DRM_DEV_DEBUG, 1288 drm_dbg. Clean up the remainders, in

Re: [Freedreno] [PATCH v4 4/4] drm/msm/dsi: Enable widebus for DSI

2023-09-03 Thread Dmitry Baryshkov
On 22/08/2023 20:42, Jessica Zhang wrote: DSI 6G v2.5.x+ supports a data-bus widen mode that allows DSI to send 48 bits of compressed data instead of 24. Enable this mode whenever DSC is enabled for supported chipsets. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi.c | 2

Re: [Freedreno] [PATCH v4 2/4] drm/msm/dpu: Enable widebus for DSI INTF

2023-09-03 Thread Dmitry Baryshkov
On 22/08/2023 20:42, Jessica Zhang wrote: DPU supports a data-bus widen mode for DSI INTF. Enable this mode for all supported chipsets if widebus is enabled for DSI. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +--