Add support for DisplayPort driver on SnapDragon
Subsystems (6)
v10 cover Add support for DisplayPort driver on SnapDragon
These patches add Display-Port driver on SnapDragon/msm hardware. This series also contains device-tree bindings for msm DP driver. It also contains Makefile and Kconfig changes to compile msm DP driver.
The block diagram of DP driver is shown below:
+-------------+
|DRM FRAMEWORK|
+------+------+
|
+----v----+
| DP DRM |
+----+----+
|
+----v----+
+------------+| DP +----------++------+
+ +---+| DISPLAY |+---+ | |
| + +-+-----+-+ | | |
| | | | | | |
| | | | | | |
| | | | | | |
v v v v v v v
+------+ +------+ +---+ +----+ +----+ +---+ +-----+
| DP | | DP | |DP | | DP | | DP | |DP | | DP |
|PARSER| | HPD | |AUX| |LINK| |CTRL| |PHY| |POWER|
+--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
| | |
+--v---+ +v-----v+
|DEVICE| | DP |
| TREE | |CATALOG|
+------+ +---+---+
|
+---v----+
|CTRL/PHY|
| HW |
+--------+Changes in v7:
- Modify cover letter description and fix title.
- Introduce dp-controller.yaml for common bindings across SOC
- Rename dp-sc7180.yaml to dp-controller-sc7180.yaml for SC7180 bindings
- Rename compatible string to qcom,sc7180-dp
- Add assigned-clocks and assigned-clock-parents properties in bindings
- Remove redundant code from driver
- Extend series to include HPD detection logic
Changes in v8:
- Add MDSS AHB clock in bindings
- Replace mode->vrefresh use with drm_mode_vrefresh API
- Remove redundant aux config code from parser and aux module
- Assign default max lanes if data-lanes property is not available
- Fix use-after-free during DP driver remove
- Unregister hardware clocks during driver cleanup
Changes in v9:
- Drop YAML bindings change from the series
- Use assigne-clock-parents property and remove clk_set_parent use from code
- Access register address space without name
- Fix DP register dump utility
- Disable DP clocks after vsync generated
- Avoid 64-bit modulo operation
- Drop any unused code and fix function proptotyes to avoid W=1 warnings
- Drop DRM_MSM_DP_10NM_PLL config as only 10nm PLL is available
Changes in v10:
- Fix help description of Kconfig entry
Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver
Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU
Tanmay Shah (1):
drm/msm/dp: Add Display Port HPD feature
drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/msm/Kconfig | 9 + drivers/gpu/drm/msm/Makefile | 14 + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27 +- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 8 + drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 83 +- drivers/gpu/drm/msm/dp/dp_aux.c | 510 +++++ drivers/gpu/drm/msm/dp/dp_aux.h | 29 + drivers/gpu/drm/msm/dp/dp_catalog.c | 1030 ++++++++++ drivers/gpu/drm/msm/dp/dp_catalog.h | 104 + drivers/gpu/drm/msm/dp/dp_ctrl.c | 1693 +++++++++++++++++ drivers/gpu/drm/msm/dp/dp_ctrl.h | 35 + drivers/gpu/drm/msm/dp/dp_display.c | 1017 ++++++++++ drivers/gpu/drm/msm/dp/dp_display.h | 31 + drivers/gpu/drm/msm/dp/dp_drm.c | 168 ++ drivers/gpu/drm/msm/dp/dp_drm.h | 18 + drivers/gpu/drm/msm/dp/dp_hpd.c | 69 + drivers/gpu/drm/msm/dp/dp_hpd.h | 79 + drivers/gpu/drm/msm/dp/dp_link.c | 1214 ++++++++++++ drivers/gpu/drm/msm/dp/dp_link.h | 132 ++ drivers/gpu/drm/msm/dp/dp_panel.c | 486 +++++ drivers/gpu/drm/msm/dp/dp_panel.h | 95 + drivers/gpu/drm/msm/dp/dp_parser.c | 269 +++ drivers/gpu/drm/msm/dp/dp_parser.h | 138 ++ drivers/gpu/drm/msm/dp/dp_pll.c | 99 + drivers/gpu/drm/msm/dp/dp_pll.h | 61 + drivers/gpu/drm/msm/dp/dp_pll_10nm.c | 917 +++++++++ drivers/gpu/drm/msm/dp/dp_pll_private.h | 98 + drivers/gpu/drm/msm/dp/dp_power.c | 373 ++++ drivers/gpu/drm/msm/dp/dp_power.h | 103 + drivers/gpu/drm/msm/dp/dp_reg.h | 517 +++++ drivers/gpu/drm/msm/msm_drv.c | 2 + drivers/gpu/drm/msm/msm_drv.h | 59 +- include/drm/drm_dp_helper.h | 1 + 34 files changed, 9471 insertions(+), 19 deletions(-) create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.c create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.h create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_10nm.c create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_private.h create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
base-commit: 418eda8f3fe292782c150266d693d55d284c0c98
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v10 1/5 drm: add constant N value in helper file
From: Chandan Uddaraju <[email protected]>
The constant N value (0x8000) is used by i915 DP driver. Define this value in dp helper header file to use in multiple Display Port drivers. Change i915 driver accordingly.
Change in v6: Change commit message
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- include/drm/drm_dp_helper.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -8114,7 +8114,7 @@ static void compute_m_n(unsigned int m, unsigned int n,* which the devices expect also in synchronous clock mode. */ if (constant_n) - *ret_n =0x8000 ; + *ret_n =DP_LINK_CONSTANT_N_VALUE ;else *ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);
include/drm/drm_dp_helper.h +1 -0
@@ -1134,6 +1134,7 @@#define DP_MST_PHYSICAL_PORT_0 0#define DP_MST_LOGICAL_PORT_0 8 +#define DP_LINK_CONSTANT_N_VALUE 0x8000#define DP_LINK_STATUS_SIZE 6bool drm_dp_channel_eq_ok (const u8 link_status[DP_LINK_STATUS_SIZE ],int lane_count);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v10 2/5 drm/msm/dp: add displayPort driver support
In reply to Tanmay ShahFrom: Chandan Uddaraju <[email protected]>
Add the needed displayPort files to enable DP driver on msm target.
"dp_display" module is the main module that calls into other sub-modules. "dp_drm" file represents the interface between DRM framework and DP driver.
changes in v2:
-- Update copyright markings on all relevant files.
-- Change pr_err() to DRM_ERROR()
-- Use APIs directly instead of function pointers.
-- Use drm_display_mode structure to store link parameters. -- Use macros for register definitions instead of hardcoded values. -- Replace writel_relaxed/readl_relaxed with writel/readl
and remove memory barriers.
-- Remove unnecessary NULL checks.
-- Use drm helper functions for dpcd read/write.
-- Use DRM_DEBUG_DP for debug msgs.
changes in V3:
-- Removed changes in dpu_io_util.[ch]
-- Added locking around "is_connected" flag and removed atomic_set() -- Removed the argument validation checks in all the static functions
except initialization functions and few API across msm/dp files.
-- Removed hardcoded values for register reads/writes
-- Removed vreg related generic structures.
-- Added return values where ever necessary.
-- Updated dp_ctrl_on function.
-- Calling the ctrl specific catalog functions directly instead of
function pointers.
-- Added separate change that adds standard value in drm_dp_helper file. -- Added separate change in this list that is used to initialize DP. -- Added change to use drm_dp_get_adjust_request_voltage() function.
changes in V4:
-- Fix mvid, nvid calculation.
-- Shift video timings to align to bottom right. -- Fix register offsets for pixel_m and pixel_n. -- Fix TPG programming sequence.
-- Update DP ack override register to recommended value. -- Added code to log displayport registers.
-- Update aux setup with recommended settings. -- Fix TU calculations for all resolutions.
-- Limit linkrate to HBR2 until HBR3 support is added. -- Update DPCD read sequence.
-- Update code comments in dp_power_init() of V3. -- Remove extcon dependencies.
-- Move drm helper functions locally.
changes in V5:
-- Addressed comments from Jordan.
Changes in v6
-- Access DP as one big register region.
Access DP modules using offsets from one base address derived from dts.
-- Use default value of pixel clock instead of reading from dts. -- Add default value of AUX LUT settings, however, override
them if relative property is defined in dts.
-- Access data-lane property as an array instead of integer
using "data-lanes" name.
-- Remove redundant IO and pinctrl code.
-- Access clock names without _clk suffix
-- Rename pixel clock to stream_pixel
-- Use new API for edid quirks and use new constant name
DP_PHY_TEST_PATTERN.
-- Remove pll references from base driver change
Changes in v7:
-- Remove parsing of AUX configuration properties and use default values -- Remove set parent for pixel clk source
-- Remove redundant cell-index property parsing and dp_cc_io io read -- Change driver's compatible string
-- Fix use-after-free memory corruption
Changes in v8:
-- Replace mode->vrefresh use with drm_mode_vrefresh API.
-- Remove redundant aux config code from parser and aux module -- Replace dp_aux structure with drm_dp_aux from dp_helpers.
As aux config properties are removed, no need of dp_aux structure.
-- Delete driver component during driver remove.
This fixes use-after-free bug if DP device node is child node of MDSS device.
-- Assign default max lanes if data-lanes property is not available
Changes in v9:
-- Remove clk_set_parent for link clock source.
-- Remove register address space parsing by name. -- Fix DP register dump utility
-- Disable DP clocks ater last vsync generated so that timing
generator can be off gracefully.
-- Drop unused code, fix function prototypes and return type -- Avoid 64-bit modulo operation
Changes in v10:
-- Fix help description of DisplayPort driver's Kconfig entry
--- drivers/gpu/drm/msm/Kconfig | 8 + drivers/gpu/drm/msm/Makefile | 12 + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 19 + .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 8 + drivers/gpu/drm/msm/dp/dp_aux.c | 510 +++++ drivers/gpu/drm/msm/dp/dp_aux.h | 29 + drivers/gpu/drm/msm/dp/dp_catalog.c | 1004 ++++++++++ drivers/gpu/drm/msm/dp/dp_catalog.h | 101 + drivers/gpu/drm/msm/dp/dp_ctrl.c | 1694 +++++++++++++++++ drivers/gpu/drm/msm/dp/dp_ctrl.h | 35 + drivers/gpu/drm/msm/dp/dp_display.c | 907 +++++++++ drivers/gpu/drm/msm/dp/dp_display.h | 28 + drivers/gpu/drm/msm/dp/dp_drm.c | 168 ++ drivers/gpu/drm/msm/dp/dp_drm.h | 18 + drivers/gpu/drm/msm/dp/dp_hpd.c | 69 + drivers/gpu/drm/msm/dp/dp_hpd.h | 79 + drivers/gpu/drm/msm/dp/dp_link.c | 1214 ++++++++++++ drivers/gpu/drm/msm/dp/dp_link.h | 132 ++ drivers/gpu/drm/msm/dp/dp_panel.c | 486 +++++ drivers/gpu/drm/msm/dp/dp_panel.h | 95 + drivers/gpu/drm/msm/dp/dp_parser.c | 267 +++ drivers/gpu/drm/msm/dp/dp_parser.h | 139 ++ drivers/gpu/drm/msm/dp/dp_power.c | 363 ++++ drivers/gpu/drm/msm/dp/dp_power.h | 65 + drivers/gpu/drm/msm/dp/dp_reg.h | 489 +++++ drivers/gpu/drm/msm/msm_drv.c | 2 + drivers/gpu/drm/msm/msm_drv.h | 53 +- 27 files changed, 7991 insertions(+), 3 deletions(-) create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
drivers/gpu/drm/msm/Kconfig +8 -0
@@ -57,6 +57,14 @@ config DRM_MSM_HDMI_HDCP help Choose this option to enable HDCP state machine +config DRM_MSM_DP + bool "Enable DisplayPort support in MSM DRM driver" + depends on DRM_MSM + help + Compile in support for DP driver in MSM DRM driver. DP external + display support is enabled through this config option. It can + be primary or secondary display on device. + config DRM_MSM_DSI bool "Enable DSI support in MSM DRM driver" depends on DRM_MSM
drivers/gpu/drm/msm/Makefile +12 -0
@@ -2,6 +2,7 @@ ccflags-y := -I $(srctree)/$(src) ccflags-y += -I $(srctree)/$(src)/disp/dpu1 ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi +ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp msm-y := \ adreno/adreno_device.o \
@@ -99,6 +100,17 @@ msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o msm-$(CONFIG_DRM_MSM_GPU_STATE) += adreno/a6xx_gpu_state.o +msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ + dp/dp_catalog.o \ + dp/dp_ctrl.o \ + dp/dp_display.o \ + dp/dp_drm.o \ + dp/dp_hpd.o \ + dp/dp_link.o \ + dp/dp_panel.o \ + dp/dp_parser.o \ + dp/dp_power.o + msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +19 -0
@@ -965,6 +965,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,trace_dpu_enc_mode_set (DRMID (drm_enc)); +if (drm_enc->encoder_type ==DRM_MODE_ENCODER_TMDS && priv->dp) +msm_dp_display_mode_set (priv->dp, drm_enc, mode, adj_mode); +list_for_each_entry (conn_iter, connector_list, head)if (conn_iter->encoder == drm_enc) conn = conn_iter;
@@ -1107,6 +1110,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc) {struct dpu_encoder_virt *dpu_enc =NULL ;int ret =0 ; +struct msm_drm_private *priv;struct drm_display_mode *cur_mode =NULL ;if (!drm_enc) {
@@ -1117,6 +1121,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)mutex_lock (&dpu_enc->enc_lock); cur_mode = &dpu_enc->base.crtc->state->adjusted_mode; + priv = drm_enc->dev->dev_private;trace_dpu_enc_enable (DRMID (drm_enc), cur_mode->hdisplay, cur_mode->vdisplay);
@@ -1137,6 +1142,15 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)_dpu_encoder_virt_enable_helper (drm_enc); +if (drm_enc->encoder_type ==DRM_MODE_ENCODER_TMDS && priv->dp) { + ret =msm_dp_display_enable (priv->dp, + drm_enc); +if (ret) { +DPU_ERROR_ENC (dpu_enc,"dp display enable failed: %d\n" , + ret); + goto out; + } + } dpu_enc->enabled = true; out:
@@ -1199,6 +1213,11 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)dpu_rm_release (global_state, drm_enc); +if (drm_enc->encoder_type ==DRM_MODE_ENCODER_TMDS && priv->dp) { +if (msm_dp_display_disable (priv->dp, drm_enc)) +DPU_ERROR_ENC (dpu_enc,"dp display disable failed\n" ); + } +mutex_unlock (&dpu_enc->enc_lock); }
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +8 -0
@@ -100,6 +100,14 @@ static void drm_mode_to_intf_timing_params(* display_v_end -= mode->hsync_start - mode->hdisplay; * } */ +/* for DP/EDP, Shift timings to align it to bottom right */ +if ((phys_enc->hw_intf->cap->type ==INTF_DP ) || + (phys_enc->hw_intf->cap->type ==INTF_EDP )) { + timing->h_back_porch += timing->h_front_porch; + timing->h_front_porch =0 ; + timing->v_back_porch += timing->v_front_porch; + timing->v_front_porch =0 ; + } }static u32 get_horizontal_total (const struct intf_timing_params *timing)
drivers/gpu/drm/msm/dp/dp_aux.c new file +510 -0
510 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_aux.h new file +29 -0
@@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DP_AUX_H_ +#define _DP_AUX_H_ + +#include "dp_catalog.h" +#include <drm/drm_dp_helper.h> + +#define DP_AUX_ERR_NONE 0 +#define DP_AUX_ERR_ADDR -1 +#define DP_AUX_ERR_TOUT -2 +#define DP_AUX_ERR_NACK -3 +#define DP_AUX_ERR_DEFER -4 +#define DP_AUX_ERR_NACK_DEFER -5 + +int dp_aux_register (struct drm_dp_aux *dp_aux); +void dp_aux_unregister (struct drm_dp_aux *dp_aux); +void dp_aux_isr (struct drm_dp_aux *dp_aux); +void dp_aux_init (struct drm_dp_aux *dp_aux); +void dp_aux_deinit (struct drm_dp_aux *dp_aux); +void dp_aux_reconfig (struct drm_dp_aux *dp_aux); + +struct drm_dp_aux *dp_aux_get (struct device *dev,struct dp_catalog *catalog); +void dp_aux_put (struct drm_dp_aux *aux); + +#endif /*__DP_AUX_H_*/
drivers/gpu/drm/msm/dp/dp_catalog.c new file +1004 -0
1,004 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_catalog.h new file +101 -0
101 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_ctrl.c new file +1694 -0
1,255 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_ctrl.h new file +35 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/msm/dp/dp_display.c new file +907 -0
907 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_display.h new file +28 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/msm/dp/dp_drm.c new file +168 -0
168 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_drm.h new file +18 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/msm/dp/dp_hpd.c new file +69 -0
69 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_hpd.h new file +79 -0
79 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_link.c new file +1214 -0
1,214 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_link.h new file +132 -0
132 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_panel.c new file +486 -0
486 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_panel.h new file +95 -0
95 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_parser.c new file +267 -0
267 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_parser.h new file +139 -0
139 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_power.c new file +363 -0
363 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_power.h new file +65 -0
65 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_reg.h new file +489 -0
489 lines not on this page · raw message
drivers/gpu/drm/msm/msm_drv.h +50 -3
53 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Part of the diff is not shown here. View the raw message.
Re: [PATCH v10 2/5] drm/msm/dp: add displayPort driver support
Hello,
Quoted 1 line · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
[skipped]
drivers/gpu/drm/msm/dp/dp_parser.c line 213
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +12
-0+ }else if ((dp_parser_check_prefix ("ctrl" , clk_name) || +dp_parser_check_prefix ("stream" , clk_name)) && + ctrl_clk_index < ctrl_clk_count) { +struct dss_clk *clk = + &ctrl_power->clk_config[ctrl_clk_index]; +strlcpy (clk->clk_name, clk_name,sizeof (clk->clk_name)); + ctrl_clk_index++; + +if (!strncmp (clk_name,"ctrl_link" , +strlen ("ctrl_link" )) || + !strncmp (clk_name,"stream_pixel" , +strlen ("ctrl_pixel" )))
This should be "stream_pixel", I believe. I don't like macros, but most probably it would help here. Also function/brace alignment could be better (sorry, it really hides the issue here).
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +5
-0+ clk->type =DSS_CLK_PCLK ; + else + clk->type = DSS_CLK_AHB; + } + }
Signature · 2 lines
With best wishes Dmitry
Re: [Freedreno] [PATCH v10 2/5] drm/msm/dp: add displayPort driver support
Quoted 7 lines · Dmitry Baryshkov
Hello,
Quoted 1 line · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
[skipped]
Quoted 17 lines
drivers/gpu/drm/msm/dp/dp_parser.c line 213
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +12
-0+ }else if ((dp_parser_check_prefix ("ctrl" , clk_name) || +dp_parser_check_prefix ("stream" , clk_name)) && + ctrl_clk_index < ctrl_clk_count) { +struct dss_clk *clk = + &ctrl_power->clk_config[ctrl_clk_index]; +strlcpy (clk->clk_name, clk_name,sizeof (clk->clk_name)); + ctrl_clk_index++; + +if (!strncmp (clk_name,"ctrl_link" , +strlen ("ctrl_link" )) || + !strncmp (clk_name,"stream_pixel" , +strlen ("ctrl_pixel" )))This should be "
stream_pixel", I believe. I don't like macros, but most probably it would help here. Also function/brace alignment could be better (sorry, it really hides the issue here).
Thanks for reviews and good catch!! I completely missed it when I renamed "ctrl_pixel". Use of "stream_pixel" is very limited. So, instead of macros direct name is used. Fixing function and brace alignment sounds good idea insted.
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +5
-0+ clk->type =DSS_CLK_PCLK ; + else + clk->type = DSS_CLK_AHB; + } + }
Re: [Freedreno] [PATCH v10 2/5] drm/msm/dp: add displayPort driver support
Quoted 26 lines · Tanmay Shah
Quoted 7 lines · Dmitry Baryshkov
Hello,
Quoted 1 line · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
[skipped]
Quoted 17 lines
drivers/gpu/drm/msm/dp/dp_parser.c line 213
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +12
-0+ }else if ((dp_parser_check_prefix ("ctrl" , clk_name) || +dp_parser_check_prefix ("stream" , clk_name)) && + ctrl_clk_index < ctrl_clk_count) { +struct dss_clk *clk = + &ctrl_power->clk_config[ctrl_clk_index]; +strlcpy (clk->clk_name, clk_name,sizeof (clk->clk_name)); + ctrl_clk_index++; + +if (!strncmp (clk_name,"ctrl_link" , +strlen ("ctrl_link" )) || + !strncmp (clk_name,"stream_pixel" , +strlen ("ctrl_pixel" )))This should be "
stream_pixel", I believe. I don't like macros, but most probably it would help here. Also function/brace alignment could be better (sorry, it really hides the issue here).
Quoted 7 lines
Thanks for reviews and good catch!! I completely missed it when I renamed "
ctrl_pixel".
Use of "stream_pixel" is very limited. So, instead of macros direct name is used.
Fixing function and brace alignment sounds good idea insted.Quoted 1 line
Actually I will reuse dp_parser_check_prefix utility. It's already doing same Job.
Quoted 10 lines
Quoted 6 lines
drivers/gpu/drm/msm/dp/dp_parser.c line 218
Quoted 6 lines
drivers/gpu/drm/msm/dp/dp_parser.c new file +5
-0+ clk->type =DSS_CLK_PCLK ; + else + clk->type = DSS_CLK_AHB; + } + }_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v10 3/5 drm/msm/dp: add support for DP PLL driver
In reply to Tanmay ShahFrom: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.
The DP driver calls the DP PLL driver registration. The DP driver sets the link and pixel clock sources.
Changes in v2:
-- Update copyright markings on all relevant files. -- Use DRM_DEBUG_DP for debug msgs.
Changes in v4:
-- Update the DP link clock provider names
Changes in V5:
-- Addressed comments from Stephen Boyd, Rob clark.
Changes in V6:
-- Remove PLL as separate driver and include PLL as DP module -- Remove redundant clock parsing from PLL module and make DP as
clock provider
-- Map USB3 DPCOM and PHY IO using hardcoded register address and
move mapping form parser to PLL module
-- Access DP PHY modules from same base address using offsets instead of
deriving base address of individual module from device tree.
-- Remove dp_pll_10nm_util.c and include its functionality in
dp_pll_10nm.c
-- Introduce new data structures private to PLL module
Changes in v7:
-- Remove DRM_MSM_DP_PLL config from Makefile and Kconfig -- Remove set_parent from determin_rate API
-- Remove phy_pll_vco_div_clk from parent list -- Remove flag CLK_DIVIDER_ONE_BASED
-- Remove redundant cell-index property parsing
Changes in v8:
-- Unregister hardware clocks during driver cleanup
Changes in v9:
-- Remove redundant Kconfig option DRM_MSM_DP_10NM_PLL
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/Makefile | 4 +- drivers/gpu/drm/msm/dp/dp_catalog.c | 31 +- drivers/gpu/drm/msm/dp/dp_display.c | 18 +- drivers/gpu/drm/msm/dp/dp_display.h | 3 + drivers/gpu/drm/msm/dp/dp_parser.c | 2 + drivers/gpu/drm/msm/dp/dp_parser.h | 7 +- drivers/gpu/drm/msm/dp/dp_pll.c | 99 +++ drivers/gpu/drm/msm/dp/dp_pll.h | 61 ++ drivers/gpu/drm/msm/dp/dp_pll_10nm.c | 917 ++++++++++++++++++++++++ drivers/gpu/drm/msm/dp/dp_pll_private.h | 98 +++ drivers/gpu/drm/msm/dp/dp_power.c | 10 + drivers/gpu/drm/msm/dp/dp_power.h | 40 +- drivers/gpu/drm/msm/dp/dp_reg.h | 16 + 14 files changed, 1290 insertions(+), 17 deletions(-) create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.c create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.h create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_10nm.c create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_private.h
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -60,6 +60,7 @@ config DRM_MSM_HDMI_HDCP config DRM_MSM_DP bool "Enable DisplayPort support in MSM DRM driver" depends on DRM_MSM + default y help Compile in support for DP driver in MSM DRM driver. DP external display support is enabled through this config option. It can
drivers/gpu/drm/msm/Makefile +3 -1
@@ -109,7 +109,9 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ dp/dp_link.o \ dp/dp_panel.o \ dp/dp_parser.o \ - dp/dp_power.o + dp/dp_power.o \ + dp/dp_pll.o \ + dp/dp_pll_10nm.o msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
drivers/gpu/drm/msm/dp/dp_catalog.c +21 -10
@@ -5,6 +5,7 @@#define pr_fmt (fmt) "[drm-dp] %s: " fmt, __func__ +#include <linux/rational.h> #include <linux/delay.h> #include <linux/iopoll.h> #include <linux/rational.h>
@@ -131,51 +132,58 @@ static inline void dp_write_ahb(struct dp_catalog_private *catalog,static inline void dp_write_phy (struct dp_catalog_private *catalog,u32 offset,u32 data) { + offset +=DP_PHY_REG_OFFSET ;/* * To make sure phy reg writes happens before any other operation, * this function uses writel() instread of writel_relaxed() */ -writel (data, catalog->io->phy_io.base + offset); +writel (data, catalog->io->phy_reg.base + offset); }static inline u32 dp_read_phy (struct dp_catalog_private *catalog,u32 offset) { + offset +=DP_PHY_REG_OFFSET ;/* * To make sure phy reg writes happens before any other operation, * this function uses writel() instread of writel_relaxed() */ -return readl_relaxed (catalog->io->phy_io.base + offset); +return readl_relaxed (catalog->io->phy_reg.base + offset); }static inline void dp_write_pll (struct dp_catalog_private *catalog,u32 offset,u32 data) { -writel_relaxed (data, catalog->io->dp_pll_io.base + offset); + offset +=DP_PHY_PLL_OFFSET ; +writel_relaxed (data, catalog->io->phy_reg.base + offset); }static inline void dp_write_ln_tx0 (struct dp_catalog_private *catalog,u32 offset,u32 data) { -writel_relaxed (data, catalog->io->ln_tx0_io.base + offset); + offset +=DP_PHY_LN_TX0_OFFSET ; +writel_relaxed (data, catalog->io->phy_reg.base + offset); }static inline void dp_write_ln_tx1 (struct dp_catalog_private *catalog,u32 offset,u32 data) { -writel_relaxed (data, catalog->io->ln_tx1_io.base + offset); + offset +=DP_PHY_LN_TX1_OFFSET ; +writel_relaxed (data, catalog->io->phy_reg.base + offset); }static inline u32 dp_read_ln_tx0 (struct dp_catalog_private *catalog,u32 offset) { -return readl_relaxed (catalog->io->ln_tx0_io.base + offset); + offset +=DP_PHY_LN_TX0_OFFSET ; +return readl_relaxed (catalog->io->phy_reg.base + offset); }static inline u32 dp_read_ln_tx1 (struct dp_catalog_private *catalog,u32 offset) { -return readl_relaxed (catalog->io->ln_tx1_io.base + offset); + offset +=DP_PHY_LN_TX1_OFFSET ; +return readl_relaxed (catalog->io->phy_reg.base + offset); } static inline void dp_write_usb_cm(struct dp_catalog_private *catalog,
@@ -386,13 +394,16 @@ void dp_catalog_dump_regs(struct dp_catalog *dp_catalog)dump_regs (catalog->io->usb3_dp_com.base, catalog->io->usb3_dp_com.len);pr_info ("LN TX0 regs\n" ); -dump_regs (catalog->io->ln_tx0_io.base, catalog->io->ln_tx0_io.len); +dump_regs (catalog->io->phy_reg.base +DP_PHY_LN_TX0_OFFSET , +DP_PHY_LN_TX0_SIZE );pr_info ("LN TX1 regs\n" ); -dump_regs (catalog->io->ln_tx1_io.base, catalog->io->ln_tx1_io.len); +dump_regs (catalog->io->phy_reg.base +DP_PHY_LN_TX1_OFFSET , +DP_PHY_LN_TX1_SIZE );pr_info ("DP PHY regs\n" ); -dump_regs (catalog->io->phy_io.base, catalog->io->phy_io.len); +dump_regs (catalog->io->phy_reg.base +DP_PHY_REG_OFFSET , +DP_PHY_REG_SIZE ); }void dp_catalog_aux_setup (struct dp_catalog *dp_catalog)
drivers/gpu/drm/msm/dp/dp_display.c +17 -1
@@ -22,6 +22,7 @@#include "dp_ctrl.h" #include "dp_display.h" #include "dp_drm.h" +#include "dp_pll.h" static struct msm_dp *g_dp_display;#define HPD_STRING_SIZE 30
@@ -42,6 +43,7 @@ struct dp_display_private {struct dp_usbpd *usbpd;struct dp_parser *parser; +struct msm_dp_pll *pll;struct dp_power *power;struct dp_catalog *catalog;struct drm_dp_aux *aux;
@@ -232,7 +234,6 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) edid = dp->panel->edid; dp->audio_supported =drm_detect_monitor_audio (edid); -dp_panel_handle_sink_request (dp->panel); dp->dp_display.max_pclk_khz =DP_MAX_PIXEL_CLK_KHZ ;
@@ -410,6 +411,7 @@ static void dp_display_deinit_sub_modules(struct dp_display_private *dp)dp_ctrl_put (dp->ctrl);dp_panel_put (dp->panel);dp_aux_put (dp->aux); +dp_pll_put (dp->pll); }static int dp_init_sub_modules (struct dp_display_private *dp)
@@ -420,6 +422,9 @@ static int dp_init_sub_modules(struct dp_display_private *dp)struct dp_panel_in panel_in = { .dev = dev, }; +struct dp_pll_in pll_in = { + .pdev = dp->pdev, + };/* Callback APIs used for cable status change event */ cb->configure = dp_display_usbpd_configure_cb;
@@ -450,6 +455,17 @@ static int dp_init_sub_modules(struct dp_display_private *dp) goto error; } + pll_in.parser = dp->parser; + dp->pll =dp_pll_get (&pll_in); +if (IS_ERR_OR_NULL (dp->pll)) { + rc = -EINVAL ; +DRM_ERROR ("failed to initialize pll, rc = %d\n" , rc); + dp->pll =NULL ; + goto error; + } + + dp->parser->pll = dp->pll; + dp->power =dp_power_get (dp->parser);if (IS_ERR (dp->power)) { rc =PTR_ERR (dp->power);
drivers/gpu/drm/msm/dp/dp_display.h +3 -0
@@ -25,4 +25,7 @@ int dp_display_request_irq(struct msm_dp *dp_display);bool dp_display_check_video_test (struct msm_dp *dp_display);int dp_display_get_test_bpp (struct msm_dp *dp_display); +void __init msm_dp_pll_driver_register (void ); +void __exit msm_dp_pll_driver_unregister(void); +#endif /* _DP_DISPLAY_H_ */
drivers/gpu/drm/msm/dp/dp_parser.c +2 -0
@@ -6,6 +6,7 @@#include <linux/of_gpio.h> #include "dp_parser.h" +#include "dp_reg.h" static const struct dp_regulator_cfg sdm845_dp_reg_cfg = { .num =2 ,
@@ -52,6 +53,7 @@ static void dp_parser_unmap_io_resources(struct dp_parser *parser)struct dp_io *io = &parser->io;msm_dss_iounmap (&io->dp_controller); +msm_dss_iounmap (&io->phy_reg);msm_dss_iounmap (&io->usb3_dp_com); }
drivers/gpu/drm/msm/dp/dp_parser.h +3 -4
@@ -10,6 +10,7 @@#include "dpu_io_util.h" #include "msm_drv.h" +#include "dp_pll.h" #define DP_LABEL "MDSS DP DISPLAY"#define DP_MAX_PIXEL_CLK_KHZ 675000
@@ -66,10 +67,7 @@ struct dp_display_data {*/ struct dp_io {struct dss_io_data dp_controller; -struct dss_io_data phy_io; -struct dss_io_data ln_tx0_io; -struct dss_io_data ln_tx1_io; -struct dss_io_data dp_pll_io; +struct dss_io_data phy_reg;struct dss_io_data usb3_dp_com; };
@@ -117,6 +115,7 @@ struct dp_parser {struct dp_pinctrl pinctrl;struct dp_io io;struct dp_display_data disp_data; +struct msm_dp_pll *pll;const struct dp_regulator_cfg *regulator_cfg;u32 max_dp_lanes;
drivers/gpu/drm/msm/dp/dp_pll.c new file +99 -0
99 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_pll.h new file +61 -0
61 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_pll_10nm.c new file +917 -0
917 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +98 -0
98 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_power.c +10 -0
@@ -101,6 +101,16 @@ static int dp_power_clk_init(struct dp_power_private *power) core = &power->parser->mp[DP_CORE_PM ]; ctrl = &power->parser->mp[DP_CTRL_PM ]; +if (power->parser->pll && power->parser->pll->get_provider) { + rc = power->parser->pll->get_provider (power->parser->pll, + &power->link_provider, &power->pixel_provider); +if (rc) { +DRM_ERROR ("%s:provider failed,don't set parent\n" , + __func__); +return 0 ; + } + } + rc =msm_dss_get_clk (dev, core->clk_config, core->num_clk);if (rc) { DRM_ERROR("failed to get %s clk. err=%d\n",
drivers/gpu/drm/msm/dp/dp_power.h +39 -1
@@ -14,7 +14,6 @@* @init: initializes the regulators/core clocks/GPIOs/pinctrl * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl * @clk_enable: enable/disable the DP clocks -* @set_link_clk_parent: set the parent of DP link clock * @set_pixel_clk_parent: set the parent of DP pixel clock */ struct dp_power {
@@ -22,10 +21,49 @@ struct dp_power {bool link_clks_on; }; +/** +* dp_power_init() - enable power supplies for display controller +* +* @power: instance of power module +* @flip: bool for flipping gpio direction +* return: 0 if success or error if failure. +* +* This API will turn on the regulators and configures gpio's +* aux/hpd. +*/ int dp_power_init (struct dp_power *power,bool flip); + +/** +* dp_power_deinit() - turn off regulators and gpios. +* +* @power: instance of power module +* return: 0 for success +* +* This API turns off power and regulators. +*/ int dp_power_deinit (struct dp_power *power); + +/** +* dp_power_clk_enable() - enable display controller clocks +* +* @power: instance of power module +* @pm_type: type of pm, core/ctrl/phy +* @enable: enables or disables +* return: pointer to allocated power module data +* +* This API will call setrate and enable for DP clocks +*/ +int dp_power_clk_enable (struct dp_power *power,enum dp_pm_type pm_type,bool enable); +/** +* dp_power_set_link_clk_parent() - configures parent of link clocks +* +* @power: instance of power module +* return: 0 for success, error for failures +* +* This API will set the link clock parent source +*/ int dp_power_set_link_clk_parent (struct dp_power *power);/**
drivers/gpu/drm/msm/dp/dp_reg.h +16 -0
@@ -6,6 +6,22 @@#ifndef _DP_REG_H_#define _DP_REG_H_ +/* DP PHY Register Regions */ +#define REG_DP_PHY_REGION_BASE (0x088ea000) +#define REG_DP_PHY_REGION_SIZE (0x00000C00) + +#define REG_USB3_DP_COM_REGION_BASE (0x088e8000) +#define REG_USB3_DP_COM_REGION_SIZE (0x00000020) + +#define DP_PHY_PLL_OFFSET (0x00000000) +#define DP_PHY_PLL_SIZE (0x00000200) +#define DP_PHY_REG_OFFSET (0x00000A00) +#define DP_PHY_REG_SIZE (0x00000200) +#define DP_PHY_LN_TX0_OFFSET (0x00000200) +#define DP_PHY_LN_TX0_SIZE (0x00000200) +#define DP_PHY_LN_TX1_OFFSET (0x00000600) +#define DP_PHY_LN_TX1_SIZE (0x00000200) +/* DP_TX Registers */ #define REG_DP_HW_VERSION (0x00000000)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.
[skipped]
Quoted 30 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +24
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 10 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +10
-0+ +struct dp_pll_vco_clk { +struct clk_hw hw; +unsigned long rate;/* current vco rate */ +u64 min_rate;/* min vco rate */ +u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {
This struct should probably go into dp_pll_10nm.c. dp_pll_7nm.c, for example, will use slightly different structure.
drivers/gpu/drm/msm/dp/dp_pll_private.h line 42
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +8
-0+struct msm_dp_pll *base; + +int id; +struct platform_device *pdev; + +/* private clocks: */ +bool fixed_factor_clk[NUM_DP_CLOCKS_MAX ]; +struct clk_hw *hws[NUM_DP_CLOCKS_MAX ];
Then these two fields can use exact number of clocks rather than NUM_DP_CLOCKS_MAX.
Quoted 44 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +44
-0+u32 num_hws; + +/* lane and orientation settings */ +u8 lane_cnt; +u8 orientation; + +/* COM PHY settings */ +u32 hsclk_sel; +u32 dec_start_mode0; +u32 div_frac_start1_mode0; +u32 div_frac_start2_mode0; +u32 div_frac_start3_mode0; +u32 integloop_gain0_mode0; +u32 integloop_gain1_mode0; +u32 vco_tune_map; +u32 lock_cmp1_mode0; +u32 lock_cmp2_mode0; +u32 lock_cmp3_mode0; +u32 lock_cmp_en; + +/* PHY vco divider */ +u32 phy_vco_div; +/* +* Certain pll's needs to update the same vco rate after resume in +* suspend/resume scenario. Cached the vco rate for such plls. +*/ +unsigned long vco_cached_rate; +u32 cached_cfg0; +u32 cached_cfg1; +u32 cached_outdiv; + +uint32_t index; +}; + +static inline struct dp_pll_vco_clk *to_dp_vco_hw (struct clk_hw *hw) +{ + return container_of(hw, struct dp_pll_vco_clk, hw); +} + +#define to_msm_dp_pll (vco) ((struct msm_dp_pll *)vco->priv) + +#define to_dp_pll_db (x) ((struct dp_pll_db *)x->priv) + +int dp_vco_set_rate_10nm(struct clk_hw *hw, unsigned long rate,
drivers/gpu/drm/msm/dp/dp_pll_private.h line 96
Quoted 10 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +10
-0+ unsigned long parent_rate); +unsigned long dp_vco_recalc_rate_10nm (struct clk_hw *hw, +unsigned long parent_rate); +long dp_vco_round_rate_10nm (struct clk_hw *hw,unsigned long rate, +unsigned long *parent_rate); +int dp_vco_prepare_10nm (struct clk_hw *hw); +void dp_vco_unprepare_10nm (struct clk_hw *hw); + +int msm_dp_pll_10nm_init (struct msm_dp_pll *dp_pll,int id); +void msm_dp_pll_10nm_deinit (struct msm_dp_pll *dp_pll);
These functions don't seem to be used outside of dp_pll_10nm. What about making them static?
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 44 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Quoted 36 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +3
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+ */drivers/gpu/drm/msm/dp/dp_pll_private.h new file +25
-0+ +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */
Quoted 9 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.
Sure, it sounds good. I will give it try. Thanks!
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 42
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +8
-0+struct msm_dp_pll *base; + +int id; +struct platform_device *pdev; + +/* private clocks: */ +bool fixed_factor_clk[NUM_DP_CLOCKS_MAX ]; +struct clk_hw *hws[NUM_DP_CLOCKS_MAX ];Then these two fields can use exact number of clocks rather than
NUM_DP_CLOCKS_MAX.
I didn't get this. I think NUM_DP_CLOCKS_MAX is doing same?
Quoted 50 lines
Quoted 50 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +24
-0+u32 num_hws; + +/* lane and orientation settings */ +u8 lane_cnt; +u8 orientation; + +/* COM PHY settings */ +u32 hsclk_sel; +u32 dec_start_mode0; +u32 div_frac_start1_mode0; +u32 div_frac_start2_mode0; +u32 div_frac_start3_mode0; +u32 integloop_gain0_mode0; +u32 integloop_gain1_mode0; +u32 vco_tune_map; +u32 lock_cmp1_mode0; +u32 lock_cmp2_mode0; +u32 lock_cmp3_mode0; +u32 lock_cmp_en; + +/* PHY vco divider */ +u32 phy_vco_div; +/* +* Certain pll's needs to update the same vco rate after resume in
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +25
-0+* suspend/resume scenario. Cached the vco rate for such plls. +*/ +unsigned long vco_cached_rate; +u32 cached_cfg0; +u32 cached_cfg1; +u32 cached_outdiv; + +uint32_t index; +}; + +static inline struct dp_pll_vco_clk *to_dp_vco_hw (struct clk_hw *hw) +{ + return container_of(hw, struct dp_pll_vco_clk, hw); +} + +#define to_msm_dp_pll (vco) ((struct msm_dp_pll *)vco->priv) + +#define to_dp_pll_db (x) ((struct dp_pll_db *)x->priv) + +int dp_vco_set_rate_10nm (struct clk_hw *hw,unsigned long rate, +unsigned long parent_rate); +unsigned long dp_vco_recalc_rate_10nm (struct clk_hw *hw, +unsigned long parent_rate); +long dp_vco_round_rate_10nm (struct clk_hw *hw,unsigned long rate, +unsigned long *parent_rate);
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 96
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+int dp_vco_prepare_10nm (struct clk_hw *hw); +void dp_vco_unprepare_10nm (struct clk_hw *hw); + +int msm_dp_pll_10nm_init (struct msm_dp_pll *dp_pll,int id); +void msm_dp_pll_10nm_deinit (struct msm_dp_pll *dp_pll);These functions don't seem to be used outside of
dp_pll_10nm. What about making them static?
I can't declare static to "init" and "deinit" as they are exported to dp_pll.c. Rest of them I can move to dp_pll_10nm and then define static.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 69 lines · Tanmay Shah
Quoted 43 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Quoted 35 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 9 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+ u64 max_rate; /* max vco rate */ + void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Sure, it sounds good. I will give it try. Thanks!
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 42
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +8
-0+ struct msm_dp_pll *base; + + int id; + struct platform_device *pdev; + + /* private clocks: */ + bool fixed_factor_clk[NUM_DP_CLOCKS_MAX]; + struct clk_hw *hws[NUM_DP_CLOCKS_MAX];Then these two fields can use exact number of clocks rather than
NUM_DP_CLOCKS_MAX.
Quoted 1 line
I didn't get this. I think
NUM_DP_CLOCKS_MAXis doing same?
Not exactly. We'd need fixed_factor_clk[4] for 10nm rather than 6. It's not that important, just a small nitpick.
Quoted 58 lines
Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +49
-0+ u32 num_hws; + + /* lane and orientation settings */ + u8 lane_cnt; + u8 orientation; + + /* COM PHY settings */ + u32 hsclk_sel; + u32 dec_start_mode0; + u32 div_frac_start1_mode0; + u32 div_frac_start2_mode0; + u32 div_frac_start3_mode0; + u32 integloop_gain0_mode0; + u32 integloop_gain1_mode0; + u32 vco_tune_map; + u32 lock_cmp1_mode0; + u32 lock_cmp2_mode0; + u32 lock_cmp3_mode0; + u32 lock_cmp_en; + + /* PHY vco divider */ + u32 phy_vco_div; + /* + * Certain pll's needs to update the same vco rate after resume in + * suspend/resume scenario. Cached the vco rate for such plls. + */ + unsigned long vco_cached_rate; + u32 cached_cfg0; + u32 cached_cfg1; + u32 cached_outdiv; + + uint32_t index; +}; + +static inline struct dp_pll_vco_clk *to_dp_vco_hw (struct clk_hw *hw) +{ + return container_of(hw, struct dp_pll_vco_clk, hw); +} + +#define to_msm_dp_pll (vco) ((struct msm_dp_pll *)vco->priv) + +#define to_dp_pll_db (x) ((struct dp_pll_db *)x->priv) + +int dp_vco_set_rate_10nm (struct clk_hw *hw,unsigned long rate, + unsigned long parent_rate); +unsigned long dp_vco_recalc_rate_10nm (struct clk_hw *hw, + unsigned long parent_rate); +long dp_vco_round_rate_10nm (struct clk_hw *hw,unsigned long rate, + unsigned long *parent_rate);Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 96
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+int dp_vco_prepare_10nm (struct clk_hw *hw); +void dp_vco_unprepare_10nm (struct clk_hw *hw); + +int msm_dp_pll_10nm_init (struct msm_dp_pll *dp_pll,int id); +void msm_dp_pll_10nm_deinit (struct msm_dp_pll *dp_pll);These functions don't seem to be used outside of
dp_pll_10nm. What about making them static?
Quoted 2 lines
I can't declare static to "init" and "deinit" as they are exported to
dp_pll.c. Rest of them I can move todp_pll_10nmand then define static.
Please exuse me for not being exact enough. Of course I meant dp_vco_FOO_10nm() functions, not init/exit.
BTW: as I'm looking onto 7nm dp pll, which naming would you prefer?
We can have separate DP_PLL_10nm/DP_PLL_7nm namespaces (as DSI PLLs do) or I can override only a set of constants (like downstream driver does).
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 137 lines · Dmitry Baryshkov
Quoted 70 lines · Tanmay Shah
Quoted 44 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Quoted 36 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +3
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+ */drivers/gpu/drm/msm/dp/dp_pll_private.h new file +25
-0+ +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 9 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Sure, it sounds good. I will give it try. Thanks!
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 42
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +8
-0+struct msm_dp_pll *base; + +int id; +struct platform_device *pdev; + +/* private clocks: */ +bool fixed_factor_clk[NUM_DP_CLOCKS_MAX ]; +struct clk_hw *hws[NUM_DP_CLOCKS_MAX ];Then these two fields can use exact number of clocks rather than
NUM_DP_CLOCKS_MAX.Quoted 1 line
I didn't get this. I think
NUM_DP_CLOCKS_MAXis doing same?Not exactly. We'd need fixed_factor_clk[4] for 10nm rather than 6. It's not that important, just a small nitpick.
Quoted 60 lines
Quoted 59 lines
Quoted 46 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +24
-0+u32 num_hws; + +/* lane and orientation settings */ +u8 lane_cnt; +u8 orientation; + +/* COM PHY settings */ +u32 hsclk_sel; +u32 dec_start_mode0; +u32 div_frac_start1_mode0; +u32 div_frac_start2_mode0; +u32 div_frac_start3_mode0; +u32 integloop_gain0_mode0; +u32 integloop_gain1_mode0; +u32 vco_tune_map; +u32 lock_cmp1_mode0; +u32 lock_cmp2_mode0; +u32 lock_cmp3_mode0; +u32 lock_cmp_en; + +/* PHY vco divider */ +u32 phy_vco_div; +/* +* Certain pll's needs to update the same vco rate after resume in
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +11
-0+* suspend/resume scenario. Cached the vco rate for such plls. +*/ +unsigned long vco_cached_rate; +u32 cached_cfg0; +u32 cached_cfg1; +u32 cached_outdiv; + +uint32_t index; +}; + +static inline struct dp_pll_vco_clk *to_dp_vco_hw(struct clk_hw*hw)
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +9
-0+{ + return container_of(hw, struct dp_pll_vco_clk, hw); +} + +#define to_msm_dp_pll (vco) ((struct msm_dp_pll *)vco->priv) + +#define to_dp_pll_db (x) ((struct dp_pll_db *)x->priv) + +int dp_vco_set_rate_10nm(struct clk_hw *hw, unsigned long rate,drivers/gpu/drm/msm/dp/dp_pll_private.h line 96
Quoted 10 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +10
-0+ unsigned long parent_rate); +unsigned long dp_vco_recalc_rate_10nm (struct clk_hw *hw, +unsigned long parent_rate); +long dp_vco_round_rate_10nm (struct clk_hw *hw,unsigned long rate, +unsigned long *parent_rate); +int dp_vco_prepare_10nm (struct clk_hw *hw); +void dp_vco_unprepare_10nm (struct clk_hw *hw); + +int msm_dp_pll_10nm_init (struct msm_dp_pll *dp_pll,int id); +void msm_dp_pll_10nm_deinit (struct msm_dp_pll *dp_pll);These functions don't seem to be used outside of
dp_pll_10nm. What about making them static?
Quoted 6 lines
Quoted 2 lines
I can't declare static to "init" and "deinit" as they are exported to
dp_pll.c. Rest of them I can move todp_pll_10nmand then define static.Please exuse me for not being exact enough. Of course I meant
dp_vco_FOO_10nm()functions, not init/exit.
Ok got it. Sorry I didn't mean to nitpick here.
Quoted 2 lines
BTW: as I'm looking onto 7nm dp pll, which naming would you prefer?
I didn't get this. Did you mean naming convention of functions and structure between 7nm and 10 nm? Could you point me where 7nm dp pll code is posted?
Quoted 3 lines
We can have separate DP_PLL_10nm/DP_PLL_7nm namespaces (as DSI PLLs do) or I can override only a set of constants (like downstream driver does).
Having separate namespace sounds good.
Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
In reply to Dmitry BaryshkovQuoted 46 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hQuoted 34 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */
Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.
Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
https://lore.kernel.org/dri-devel/[email protected]/
BR,
-R
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 66 lines · Rob Clark
Quoted 46 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hQuoted 34 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
Quoted 2 lines
I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and I have done something similar, with the PLL driver in the QMP phy, although not based on sboyd's series (along with some typec changes to negotiate the DP alt mode and get HPD events, etc.). I don't think having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need to be aware of the DP PLL/PHY driver, it only needs to set the link/pixel clock rates which are in dispcc (and those then have the PLL clocks as a parent).
FYI, since it sounds you are considering landing this: it is completely broken, for example:
- ioremap()'s to #define'd addresses in the PLL driver
- main DP driver reading/writing to registers in the PHY region, but getting the base address from devicetree was removed since earlier revisions, so it just fails completely. Look at usb3_dp_com (for example), which in dp_catalog_ctrl_usb_reset() would be used to overwrite registers already being driven by the qmp phy driver - but now the usb3_dp_com.base is never initialized.
-Jonathan
Quoted 7 lines
BR,
-R
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 71 lines · Jonathan Marek
Quoted 66 lines · Rob Clark
Quoted 46 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hQuoted 34 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
Quoted 2 lines
Quoted 8 lines
I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and I have done something similar, with the PLL driver in the QMP phy, although not based on sboyd's series (along with some typec changes to negotiate the DP alt mode and get HPD events, etc.). I don't think having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need to be aware of the DP PLL/PHY driver, it only needs to set the link/pixel clock rates which are in dispcc (and those then have the PLL clocks as a parent).
yeah, in the dp case, having phy split out makes a ton of sense.. it would maybe be a nice cleanup in other cases (dsi, hdmi) but the combination of usb+dp makes burying this in drm not so great..
It would be good if you could work w/ sboyd on this.. based on what I've seen on previous gens, it is probably a different phy driver for 7nm vs 10nm, but I think where we want to end up upstream is with phy split out of drm.
Quoted 9 lines
FYI, since it sounds you are considering landing this: it is completely broken, for example:
- ioremap()'s to #define'd addresses in the PLL driver
- main DP driver reading/writing to registers in the PHY region, but getting the base address from devicetree was removed since earlier revisions, so it just fails completely. Look atusb3_dp_com(for example), which indp_catalog_ctrl_usb_reset()would be used to overwrite registers already being driven by the qmp phy driver - but now the usb3_dp_com.base is never initialized.
Yeah, the idea to land dp isn't that it is perfect (or even not broken), so much as having something upstream gives a common base for others to work against.. maybe we should make the dp parts 'depends on STAGING'?
I could keep a separate msm-next-dp branch that I rebase, to give a common point for folks working dp support for various different gens to coordinate work on.. that kinda sounds like a bunch of extra work for me, so might as well land what we have somehow and work together from there ;-)
But it does sound like you are making the case for including the patch to drop the pll stuff and use phy framework as part of what initially goes upstream.
BR,
-R
Quoted 10 lines
-Jonathan
Quoted 7 lines
BR,
-R
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 114 lines · Rob Clark
Quoted 14 lines · Jonathan Marek
Quoted 12 lines · Rob Clark
Quoted 10 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hdrivers/gpu/drm/msm/dp/dp_pll_private.h line 3
Quoted 8 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +3
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
Quoted 21 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +21
-0+*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000ULdrivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 10 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +10
-0+ +struct dp_pll_vco_clk { +struct clk_hw hw; +unsigned long rate;/* current vco rate */ +u64 min_rate;/* min vco rate */ +u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Quoted 10 lines
Quoted 10 lines
Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
https://lore.kernel.org/dri-devel/20200611091919.108018-1-swboyd@chromium.
org/Quoted 10 lines
Quoted 1 line
I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and I have done something similar, with the PLL driver in the QMP phy, although not based on sboyd's series (along with some typec changes to negotiate the DP alt mode and get HPD events, etc.). I don't think having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need to be aware of the DP PLL/PHY driver, it only needs to set the link/pixel clock rates which are in dispcc (and those then have the PLL clocks as a parent).
yeah, in the dp case, having phy split out makes a ton of sense.. it would maybe be a nice cleanup in other cases (dsi, hdmi) but the combination of usb+dp makes burying this in drm not so great..
It would be good if you could work w/ sboyd on this.. based on what I've seen on previous gens, it is probably a different phy driver for 7nm vs 10nm, but I think where we want to end up upstream is with phy split out of drm.
Quoted 9 lines
FYI, since it sounds you are considering landing this: it is completely broken, for example:
- ioremap()'s to #define'd addresses in the PLL driver
- main DP driver reading/writing to registers in the PHY region, but getting the base address from devicetree was removed since earlier revisions, so it just fails completely. Look atusb3_dp_com(for example), which indp_catalog_ctrl_usb_reset()would be used to overwrite registers already being driven by the qmp phy driver - but now the usb3_dp_com.base is never initialized.Yeah, the idea to land dp isn't that it is perfect (or even not broken), so much as having something upstream gives a common base for others to work against.. maybe we should make the dp parts 'depends on STAGING'?
I could keep a separate msm-next-dp branch that I rebase, to give a common point for folks working dp support for various different gens to coordinate work on.. that kinda sounds like a bunch of extra work for me, so might as well land what we have somehow and work together from there ;-)
Quoted 4 lines
But it does sound like you are making the case for including the patch to drop the pll stuff and use phy framework as part of what initially goes upstream.
I agree with Rob on landing what we have in DP driver. Of course, by addressing any outstanding comments. That would help in setting base functional code for DisplayPort Bring-up. Other features such as PHY compliance and DP audio are dependent on these changes.
We don't want to keep PLL code in drm/msm directory and so we have removed bindings of PLL from DP node. Once base driver is merged, we can rebase Stephen's QMP PHY changes and merge them. Stephen's changes are removing PLL code from drm/msm directory already.
Other dependent patches for DisplayPort driver on msm are posted here:
https://lore.kernel.org/dri-devel/[email protected]/
https://lore.kernel.org/dri-devel/[email protected]/
Quoted 17 lines
BR,
-RQuoted 10 lines
-Jonathan
Quoted 7 lines
BR,
-R
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
In reply to Rob ClarkQuoted 81 lines · Rob Clark
Quoted 71 lines · Jonathan Marek
Quoted 66 lines · Rob Clark
Quoted 46 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hQuoted 34 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
Quoted 2 lines
Quoted 8 lines
I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and I have done something similar, with the PLL driver in the QMP phy, although not based on sboyd's series (along with some typec changes to negotiate the DP alt mode and get HPD events, etc.). I don't think having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need to be aware of the DP PLL/PHY driver, it only needs to set the link/pixel clock rates which are in dispcc (and those then have the PLL clocks as a parent).
Quoted 8 lines
yeah, in the dp case, having phy split out makes a ton of sense.. it would maybe be a nice cleanup in other cases (dsi, hdmi) but the combination of usb+dp makes burying this in drm not so great..
It would be good if you could work w/ sboyd on this.. based on what I've seen on previous gens, it is probably a different phy driver for 7nm vs 10nm, but I think where we want to end up upstream is with phy split out of drm.
7nm differs in registers programming, so it would end up with a separate set of tables in qmp phy driver. There is also a 14nm version of dp phy, but I don't know if it usable in any actual hardware design.
Signature · 2 lines
With best wishes Dmitry
Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver
Quoted 87 lines · Dmitry Baryshkov
Quoted 85 lines · Rob Clark
Quoted 71 lines · Jonathan Marek
Quoted 66 lines · Rob Clark
Quoted 46 lines · Dmitry Baryshkov
Quoted 4 lines · Tanmay Shah
From: Chandan Uddaraju <[email protected]>
Add the needed DP PLL specific files to support
display port interface on msm targets.[skipped]
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/msm/dp/dp_pll_private.hQuoted 34 lines
new file mode 100644
index 000000000000..475ba6ed59abdrivers/gpu/drm/msm/dp/dp_pll_private.h new file +29
-0@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef __DP_PLL_10NM_H +#define __DP_PLL_10NM_H + +#include "dp_pll.h" +#include "dp_reg.h" + +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000 1620000UL +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000 2700000UL +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000 5400000UL +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000 8100000UL + +#define NUM_DP_CLOCKS_MAX 6 + +#define DP_PHY_PLL_POLL_SLEEP_US 500 +#define DP_PHY_PLL_POLL_TIMEOUT_US 10000 + +#define DP_VCO_RATE_8100MHZDIV1000 8100000UL +#define DP_VCO_RATE_9720MHZDIV1000 9720000UL +#define DP_VCO_RATE_10800MHZDIV1000 10800000UL + +struct dp_pll_vco_clk { + struct clk_hw hw; + unsigned long rate; /* current vco rate */ + u64 min_rate; /* min vco rate */Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h line 34
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_pll_private.h new file +5
-0+u64 max_rate;/* max vco rate */ +void *priv; +}; + +struct dp_pll_db {This struct should probably go into
dp_pll_10nm.c.dp_pll_7nm.c, for example, will use slightly different structure.Note that sboyd has a WIP series to move all of the pll code out to a phy driver. If there is work already happening on 7nm support, it might be better to go with the separate phy driver approach? I'm still a bit undecided about whether to land the dp code initially with the pll stuff in drm, and then continue refactoring to move to separate phy driver upstream, or to strip out the pll code from the beginning. If you/someone is working on 7nm support, then feedback about which approach is easier is welcome.
Quoted 2 lines
Quoted 8 lines
I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and I have done something similar, with the PLL driver in the QMP phy, although not based on sboyd's series (along with some typec changes to negotiate the DP alt mode and get HPD events, etc.). I don't think having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need to be aware of the DP PLL/PHY driver, it only needs to set the link/pixel clock rates which are in dispcc (and those then have the PLL clocks as a parent).
yeah, in the dp case, having phy split out makes a ton of sense.. it would maybe be a nice cleanup in other cases (dsi, hdmi) but the combination of usb+dp makes burying this in drm not so great..
Quoted 9 lines
Quoted 4 lines
It would be good if you could work w/ sboyd on this.. based on what I've seen on previous gens, it is probably a different phy driver for 7nm vs 10nm, but I think where we want to end up upstream is with phy split out of drm.
7nm differs in registers programming, so it would end up with a separate set of tables in qmp phy driver. There is also a 14nm version of dp phy, but I don't know if it usable in any actual hardware design.
I'll defer to Stephen about phy stuff, but was kinda just expecting to have different phy drivers for different process sizes, rather than trying to bundle it all in one phy driver. At least what I've seen before for dsi/hdmi/etc phy's is that the register programming is different enough to not really share much.
BR,
-R
PATCH v10 4/5 drm/msm/dpu: add display port support in DPU
In reply to Tanmay ShahFrom: Jeykumar Sankaran <[email protected]>
Add display port support in DPU by creating hooks
for DP encoder enumeration and encoder mode
initialization.
changes in v2:
- rebase on [2] (Sean Paul)
- remove unwanted error checks and
switch cases (Jordan Crouse)
[1] https://lwn.net/Articles/768265/
[2] https://lkml.org/lkml/2018/11/17/87
changes in V3:
-- Moved this change as part of the DP driver changes. -- Addressed compilation issues on the latest code base.
Changes in v6:
-- Fix checkpatch.pl warning
Changes in v7: Remove depends-on tag from commit message.
Changes in v8: None
Changes in v9: None
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 65 +++++++++++++++++---- 2 files changed, 58 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +4 -4
@@ -1992,7 +1992,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, {int ret =0 ;int i =0 ; -enum dpu_intf_type intf_type; +enum dpu_intf_type intf_type =INTF_NONE ;struct dpu_enc_phys_init_params phys_params;if (!dpu_enc) {
@@ -2014,9 +2014,9 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,case DRM_MODE_ENCODER_DSI : intf_type =INTF_DSI ;break ; -default : -DPU_ERROR_ENC (dpu_enc,"unsupported display interface type\n" ); -return -EINVAL ; +case DRM_MODE_ENCODER_TMDS : + intf_type =INTF_DP ; +break ; }WARN_ON (disp_info->num_of_h_tiles <1 );
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +54 -11
85 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v10 5/5 drm/msm/dp: Add Display Port HPD feature
In reply to Tanmay ShahConfigure HPD registers in DP controller and
enable HPD interrupt.
Add interrupt to handle HPD connect and disconnect events.
Changes in v8: None
--- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 18 ++++ drivers/gpu/drm/msm/dp/dp_catalog.c | 63 ++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.h | 5 +- drivers/gpu/drm/msm/dp/dp_ctrl.c | 1 - drivers/gpu/drm/msm/dp/dp_display.c | 108 ++++++++++++++++++++++-- drivers/gpu/drm/msm/dp/dp_reg.h | 12 +++ drivers/gpu/drm/msm/msm_drv.h | 6 ++ 7 files changed, 180 insertions(+), 33 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +18 -0
@@ -765,6 +765,23 @@ static void dpu_irq_preinstall(struct msm_kms *kms)dpu_core_irq_preinstall (dpu_kms); } +static int dpu_irq_postinstall (struct msm_kms *kms) +{ +struct msm_drm_private *priv; +struct dpu_kms *dpu_kms =to_dpu_kms (kms); + +if (!dpu_kms || !dpu_kms->dev) +return -EINVAL ; + + priv = dpu_kms->dev->dev_private; +if (!priv) +return -EINVAL ; + +msm_dp_irq_postinstall (priv->dp); + +return 0 ; +} +static void dpu_irq_uninstall (struct msm_kms *kms) {struct dpu_kms *dpu_kms =to_dpu_kms (kms);
@@ -775,6 +792,7 @@ static void dpu_irq_uninstall(struct msm_kms *kms)static const struct msm_kms_funcs kms_funcs = { .hw_init = dpu_kms_hw_init, .irq_preinstall = dpu_irq_preinstall, + .irq_postinstall = dpu_irq_postinstall, .irq_uninstall = dpu_irq_uninstall, .irq = dpu_irq, .enable_commit = dpu_kms_enable_commit,
drivers/gpu/drm/msm/dp/dp_catalog.c +39 -24
81 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_catalog.h +4 -1
@@ -75,7 +75,10 @@ void dp_catalog_ctrl_reset(struct dp_catalog *dp_catalog);void dp_catalog_ctrl_usb_reset (struct dp_catalog *dp_catalog,bool flip);bool dp_catalog_ctrl_mainlink_ready (struct dp_catalog *dp_catalog);void dp_catalog_ctrl_enable_irq (struct dp_catalog *dp_catalog,bool enable); -void dp_catalog_ctrl_hpd_config (struct dp_catalog *dp_catalog,bool enable); +void dp_catalog_hpd_config_intr (struct dp_catalog *dp_catalog, +u32 intr_mask,bool en); +void dp_catalog_ctrl_hpd_config (struct dp_catalog *dp_catalog); +u32 dp_catalog_hpd_get_intr_status (struct dp_catalog *dp_catalog);void dp_catalog_ctrl_phy_reset (struct dp_catalog *dp_catalog);void dp_catalog_ctrl_phy_lane_cfg (struct dp_catalog *dp_catalog,bool flipped,u8 lane_cnt);
drivers/gpu/drm/msm/dp/dp_ctrl.c +0 -1
@@ -1563,7 +1563,6 @@ int dp_ctrl_on(struct dp_ctrl *dp_ctrl) rate = ctrl->panel->link_info.rate;dp_power_clk_enable (ctrl->power,DP_CORE_PM , true); -dp_catalog_ctrl_hpd_config (ctrl->catalog, true);if (ctrl->link->sink_request &DP_TEST_LINK_PHY_TEST_PATTERN ) {DRM_DEBUG_DP ("using phy test link parameters\n" );
drivers/gpu/drm/msm/dp/dp_display.c +101 -7
162 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_reg.h +12 -0
@@ -54,10 +54,22 @@#define DP_DP_IRQ_HPD_INT_MASK (0x00000002)#define DP_DP_HPD_REPLUG_INT_MASK (0x00000004)#define DP_DP_HPD_UNPLUG_INT_MASK (0x00000008) +#define DP_DP_HPD_INT_MASK (DP_DP_HPD_PLUG_INT_MASK | \ + DP_DP_IRQ_HPD_INT_MASK | \ + DP_DP_HPD_REPLUG_INT_MASK | \ + DP_DP_HPD_UNPLUG_INT_MASK) +#define DP_DP_HPD_STATE_STATUS_CONNECTED (0x40000000) +#define DP_DP_HPD_STATE_STATUS_PENDING (0x20000000) +#define DP_DP_HPD_STATE_STATUS_DISCONNECTED (0x00000000) +#define DP_DP_HPD_STATE_STATUS_MASK (0xE0000000)#define REG_DP_DP_HPD_REFTIMER (0x00000018) +#define DP_DP_HPD_REFTIMER_ENABLE (1 << 16) +#define REG_DP_DP_HPD_EVENT_TIME_0 (0x0000001C)#define REG_DP_DP_HPD_EVENT_TIME_1 (0x00000020) +#define DP_DP_HPD_EVENT_TIME_0_VAL (0x3E800FA) +#define DP_DP_HPD_EVENT_TIME_1_VAL (0x1F407D0)#define REG_DP_AUX_CTRL (0x00000030)#define DP_AUX_CTRL_ENABLE (0x00000001)
drivers/gpu/drm/msm/msm_drv.h +6 -0
@@ -391,6 +391,7 @@ int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder);void msm_dp_display_mode_set (struct msm_dp *dp,struct drm_encoder *encoder,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode); +void msm_dp_irq_postinstall (struct msm_dp *dp_display);#else static inline int __init msm_dp_register (void )
@@ -422,6 +423,11 @@ static inline void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_display_mode *adjusted_mode) { } + +static inline void msm_dp_irq_postinstall (struct msm_dp *dp_display) +{ +} +#endif void __init msm_mdp_register (void );
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project