Fix hibmc driver bugs
Subsystems (3)
Yongbang Shi
maintainerv2 cover Fix hibmc driver bugs
From: Baihan Li <[email protected]>
There are some bugfix for hibmc-drm driver.
---
ChangeLog:
v1 -> v2:
- use the hibmc_ddc_del() in hibmc_connector_destroy(), suggested by Dmitry Baryshkov.
- fix the tag, suggested by Dmitry Baryshkov.
- don't use the flag, and use more checks in detect_ctx(), suggested by Dmitry Baryshkov.
- delete if (dev->registered), suggested by Dmitry Baryshkov.
- add explanations in commit, suggested by Dmitry Baryshkov.
- delete if (!dp->is_connected) in hibmc_dp_mode_valid(), suggested by Dmitry Baryshkov.
- don't tie VGA and DP status, suggested by Dmitry Baryshkov.
- use crtc clone to let 2 connectors can display simultaneous
- separate the patch, suggested by Dmitry Baryshkov.
---
Baihan Li (10):
drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init
failed
drm/hisilicon/hibmc: fix dp probabilistical detect errors after HPD
irq
drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local drm/hisilicon/hibmc: fix the hibmc loaded failed bug drm/hisilicon/hibmc: fix rare monitors cannot display problem drm/hisilicon/hibmc: add dp mode valid check drm/hisilicon/hibmc: fix dp and vga cannot show together drm/hisilicon/hibmc: fix no showing when no connectors connected drm/hisilicon/hibmc: fix no showing problem with loading hibmc
manually
drm/hisilicon/hibmc: adapting modification for the former commit
drivers/gpu/drm/hisilicon/hibmc/dp/dp_comm.h | 4 +- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 48 +++++++++---- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 8 +++ drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c | 33 ++++++--- .../gpu/drm/hisilicon/hibmc/dp/dp_serdes.c | 12 ---- .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 70 +++++++++++++++++-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 +++--- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 + .../gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 5 ++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 12 ++-- 10 files changed, 163 insertions(+), 52 deletions(-)
Signature · 1 line
2.33.0
Yongbang Shi
maintainerPATCH v2 1/10 drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init failed
From: Baihan Li <[email protected]>
Currently the driver missed to clean the i2c adapter when vdac init failed. It may cause resource leak.
---
ChangeLog:
v1 -> v2:
- use the hibmc_ddc_del() in hibmc_connector_destroy(), suggested by Dmitry Baryshkov.
- fix the tag, suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 5 +++++ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +1 -0
@@ -69,6 +69,7 @@ int hibmc_de_init(struct hibmc_drm_private *priv);int hibmc_vdac_init (struct hibmc_drm_private *priv);int hibmc_ddc_create (struct drm_device *drm_dev,struct hibmc_vdac *connector); +void hibmc_ddc_del (struct hibmc_vdac *vdac);int hibmc_dp_init (struct hibmc_drm_private *priv);
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c +5 -0
@@ -95,3 +95,8 @@ int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_vdac *vdac)return i2c_bit_add_bus (&vdac->adapter); } + +void hibmc_ddc_del (struct hibmc_vdac *vdac) +{ +i2c_del_adapter (&vdac->adapter); +}
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +8 -3
@@ -53,7 +53,7 @@ static void hibmc_connector_destroy(struct drm_connector *connector) {struct hibmc_vdac *vdac =to_hibmc_vdac (connector); -i2c_del_adapter (&vdac->adapter); +hibmc_ddc_del (vdac);drm_connector_cleanup (connector); }
@@ -110,7 +110,7 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) ret =drmm_encoder_init (dev, encoder,NULL ,DRM_MODE_ENCODER_DAC ,NULL );if (ret) {drm_err (dev,"failed to init encoder: %d\n" , ret); -return ret; + goto err; }drm_encoder_helper_add (encoder, &hibmc_encoder_helper_funcs);
@@ -121,7 +121,7 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) &vdac->adapter);if (ret) {drm_err (dev,"failed to init connector: %d\n" , ret); -return ret; + goto err; }drm_connector_helper_add (connector, &hibmc_connector_helper_funcs);
@@ -131,4 +131,9 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) connector->polled =DRM_CONNECTOR_POLL_CONNECT |DRM_CONNECTOR_POLL_DISCONNECT ;return 0 ; + +err: +hibmc_ddc_del (vdac); + +return ret; }
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 01/10] drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init failed
Quoted 13 lines · Yongbang Shi
From: Baihan Li <[email protected]>
Currently the driver missed to clean the i2c adapter when vdac init failed. It may cause resource leak.
Fixes a0d078d06e516 ("drm/hisilicon: Features to support reading resolutions from EDID")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>---
ChangeLog:
v1 -> v2:
- use thehibmc_ddc_del()inhibmc_connector_destroy(), suggested by Dmitry Baryshkov.
- fix the tag, suggested by Dmitry Baryshkov.
Quoted 6 lines
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 5 +++++ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerPATCH v2 2/10 drm/hisilicon/hibmc: fix dp probabilistical detect errors after HPD irq
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
The debouncing when HPD pulled out still remains sometimes, 200ms still can not ensure helper_detect() is correct. So add more checks and hibmc_dp_link_training0() in detect_ctx().
---
ChangeLog:
v1 -> v2:
- don't use the flag, and use more checks in detect_ctx(), suggested by Dmitry Baryshkov.
- delete if (dev->registered), suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 24 +++++++++++++++---- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 2 ++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 19 +++++++++++---- 3 files changed, 36 insertions(+), 9 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +19 -5
@@ -238,19 +238,33 @@ void hibmc_dp_display_en(struct hibmc_dp *dp, bool enable)msleep (50 ); } -int hibmc_dp_mode_set (struct hibmc_dp *dp,struct drm_display_mode *mode) +int hibmc_dp_detect_link (struct hibmc_dp *dp) {struct hibmc_dp_dev *dp_dev = dp->dp_dev; -int ret; +int ret =0 ; + +mutex_lock (&dp->link_train_mutex);if (!dp_dev->link.status.channel_equalized) { ret =hibmc_dp_link_training (dp_dev); -if (ret) { +if (ret)drm_err (dp->drm_dev,"dp link training failed, ret: %d\n" , ret); -return ret; - } } +mutex_unlock (&dp->link_train_mutex); + +return ret; +} + +int hibmc_dp_mode_set (struct hibmc_dp *dp,struct drm_display_mode *mode) +{ +struct hibmc_dp_dev *dp_dev = dp->dp_dev; +int ret; + + ret =hibmc_dp_detect_link (dp); +if (ret) +return ret; +hibmc_dp_display_en (dp, false);hibmc_dp_link_cfg (dp_dev, mode);
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h +2 -0
@@ -50,9 +50,11 @@ struct hibmc_dp {struct drm_dp_aux aux;struct hibmc_dp_cbar_cfg cfg;u32 irq_status; +struct mutex link_train_mutex;/* link training mutex */ };int hibmc_dp_hw_init (struct hibmc_dp *dp); +int hibmc_dp_detect_link (struct hibmc_dp *dp);int hibmc_dp_mode_set (struct hibmc_dp *dp,struct drm_display_mode *mode);void hibmc_dp_display_en (struct hibmc_dp *dp,bool enable);void hibmc_dp_set_cbar (struct hibmc_dp *dp,const struct hibmc_dp_cbar_cfg *cfg);
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +15 -4
@@ -34,9 +34,19 @@ static int hibmc_dp_connector_get_modes(struct drm_connector *connector)static int hibmc_dp_detect (struct drm_connector *connector,struct drm_modeset_acquire_ctx *ctx,bool force) { -mdelay (200 ); +struct hibmc_dp *dp =to_hibmc_dp (connector); + +if (!(dp->irq_status &DP_MASKED_SINK_HPD_PLUG_INT )) +return connector_status_disconnected; + +if (drm_connector_helper_detect_from_ddc (connector, ctx, force) != + connector_status_connected) +return connector_status_disconnected; -return drm_connector_helper_detect_from_ddc (connector, ctx, force); +if (hibmc_dp_detect_link (dp)) +return connector_status_connected; + +return connector_status_disconnected; }static const struct drm_connector_helper_funcs hibmc_dp_conn_helper_funcs = {
@@ -128,8 +138,7 @@ irqreturn_t hibmc_dp_hpd_isr(int irq, void *arg)hibmc_dp_reset_link (&priv->dp); } -if (dev->registered) -drm_connector_helper_hpd_irq_event (&priv->dp.connector); +drm_connector_helper_hpd_irq_event (&priv->dp.connector);drm_dev_exit (idx);
@@ -178,5 +187,7 @@ int hibmc_dp_init(struct hibmc_drm_private *priv) connector->polled =DRM_CONNECTOR_POLL_HPD ; +mutex_init (&dp->link_train_mutex); +return 0 ; }
Signature · 1 line
2.33.0
Yongbang Shi
maintainerPATCH v2 3/10 drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
The local variable is passed in request_irq (), and there will be use after free problem, which will make request_irq failed. Using the global irq name instead of it to fix.
---
ChangeLog:
v1 -> v2:
- add explanations in commit, suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +3 -7
@@ -32,7 +32,7 @@DEFINE_DRM_GEM_FOPS (hibmc_fops); -static const char *g_irqs_names_map[HIBMC_MAX_VECTORS ] = {"vblank" ,"hpd" }; +static const char *g_irqs_names_map[HIBMC_MAX_VECTORS ] = {"hibmc-vblank" ,"hibmc-hpd" };static irqreturn_t hibmc_interrupt (int irq,void *arg) {
@@ -277,7 +277,6 @@ static void hibmc_unload(struct drm_device *dev)static int hibmc_msi_init (struct drm_device *dev) {struct pci_dev *pdev =to_pci_dev (dev->dev); -char name[32 ] = {0 };int valid_irq_num;int irq;int ret;
@@ -292,9 +291,6 @@ static int hibmc_msi_init(struct drm_device *dev) valid_irq_num = ret;for (int i =0 ; i < valid_irq_num; i++) { -snprintf (name,ARRAY_SIZE (name) -1 ,"%s-%s-%s" , - dev->driver->name,pci_name (pdev), g_irqs_names_map[i]); - irq =pci_irq_vector (pdev, i);if (i)
@@ -302,10 +298,10 @@ static int hibmc_msi_init(struct drm_device *dev) ret =devm_request_threaded_irq (&pdev->dev, irq, hibmc_dp_interrupt, hibmc_dp_hpd_isr, -IRQF_SHARED , name, dev); +IRQF_SHARED , g_irqs_names_map[i], dev); else ret =devm_request_irq (&pdev->dev, irq, hibmc_interrupt, -IRQF_SHARED , name, dev); +IRQF_SHARED , g_irqs_names_map[i], dev);if (ret) {drm_err (dev,"install irq failed: %d\n" , ret);return ret;
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 03/10] drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local
Quoted 9 lines · Yongbang Shi
From: Baihan Li <[email protected]>
The local variable is passed in
request_irq(), and there will be use after free problem, which will makerequest_irqfailed. Using the global irq name instead of it to fix.Fixes b11bc1ae4658 ("drm/hisilicon/hibmc: Add MSI irq getting and requesting for HPD")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>
Quoted 8 lines
---
ChangeLog:
v1 -> v2:
- add explanations in commit, suggested by Dmitry Baryshkov.--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerPATCH v2 4/10 drm/hisilicon/hibmc: fix the hibmc loaded failed bug
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
When hibmc loaded failed, the driver use hibmc_unload to free the resource, but the mutexes in mode.config are not init, which will access an NULL pointer. Just change goto statement to return, because hibnc_hw_init() doesn't need to free anything.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +2 -2
@@ -319,13 +319,13 @@ static int hibmc_load(struct drm_device *dev) ret =hibmc_hw_init (priv);if (ret) - goto err; +return ret; ret =drmm_vram_helper_init (dev,pci_resource_start (pdev,0 ),pci_resource_len (pdev,0 ));if (ret) {drm_err (dev,"Error initializing VRAM MM; %d\n" , ret); - goto err; +return ret; } ret =hibmc_kms_init (priv);
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 04/10] drm/hisilicon/hibmc: fix the hibmc loaded failed bug
Quoted 7 lines · Yongbang Shi
From: Baihan Li <[email protected]>
When hibmc loaded failed, the driver use
hibmc_unloadto free the resource, but the mutexes in mode.config are not init, which will access an NULL pointer. Just change goto statement to return, becausehibnc_hw_init()doesn't need to free anything.
Quoted 7 lines
Fixes b3df5e65cc03 ("drm/hibmc: Drop drm_vblank_cleanup")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerPATCH v2 5/10 drm/hisilicon/hibmc: fix rare monitors cannot display problem
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
In some case, the dp link training success at 8.1Gbps, but the sink's maximum supported rate is less than 8.1G. So change the default 8.1Gbps link rate to the rate that reads from devices' capabilities.
---
ChangeLog:
v1 -> v2:
- fix the tag, suggested by Dmitry Baryshkov.
- add explanations in commit, suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_comm.h | 4 ++- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 6 +--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c | 33 +++++++++++++------ .../gpu/drm/hisilicon/hibmc/dp/dp_serdes.c | 12 ------- 4 files changed, 27 insertions(+), 28 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/dp/dp_comm.h +3 -1
@@ -25,6 +25,9 @@ struct hibmc_link_status {struct hibmc_link_cap {u8 link_rate;u8 lanes; +int rx_dpcd_revision; +bool is_tps3; +bool is_tps4; };struct hibmc_dp_link {
@@ -62,7 +65,6 @@ struct hibmc_dp_dev {void hibmc_dp_aux_init (struct hibmc_dp *dp);int hibmc_dp_link_training (struct hibmc_dp_dev *dp); -int hibmc_dp_serdes_init (struct hibmc_dp_dev *dp);int hibmc_dp_serdes_rate_switch (u8 rate,struct hibmc_dp_dev *dp);int hibmc_dp_serdes_set_tx_cfg (struct hibmc_dp_dev *dp,u8 train_set[HIBMC_DP_LANE_NUM_MAX ]);
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +1 -5
@@ -154,7 +154,6 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp) {struct drm_device *drm_dev = dp->drm_dev;struct hibmc_dp_dev *dp_dev; -int ret; dp_dev =devm_kzalloc (drm_dev->dev,sizeof (struct hibmc_dp_dev ),GFP_KERNEL );if (!dp_dev)
@@ -166,13 +165,10 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp) dp_dev->dev = drm_dev; dp_dev->base = dp->mmio +HIBMC_DP_OFFSET ; + dp_dev->serdes_base = dp_dev->base +HIBMC_DP_HOST_OFFSET ;hibmc_dp_aux_init (dp); - ret =hibmc_dp_serdes_init (dp_dev); -if (ret) -return ret; - dp_dev->link.cap.lanes =0x2 ; dp_dev->link.cap.link_rate =DP_LINK_BW_8_1 ;
drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c +23 -10
@@ -39,6 +39,14 @@ static int hibmc_dp_link_training_configure(struct hibmc_dp_dev *dp)/* enhanced frame */ hibmc_dp_reg_write_field (dp,HIBMC_DP_VIDEO_CTRL ,HIBMC_DP_CFG_STREAM_FRAME_MODE ,0x1 ); + ret =hibmc_dp_get_serdes_rate_cfg (dp); +if (ret <0 ) +return ret; + + ret =hibmc_dp_serdes_rate_switch (ret, dp); +if (ret) +return ret; +/* set rate and lane count */ buf[0 ] = dp->link.cap.link_rate; buf[1 ] =DP_LANE_COUNT_ENHANCED_FRAME_EN | dp->link.cap.lanes;
@@ -325,6 +333,20 @@ static int hibmc_dp_link_downgrade_training_eq(struct hibmc_dp_dev *dp)return hibmc_dp_link_reduce_rate (dp); } +static void hibmc_dp_update_caps (struct hibmc_dp_dev *dp) +{ + dp->link.cap.rx_dpcd_revision = dp->dpcd[DP_DPCD_REV ]; + + dp->link.cap.is_tps3 = (dp->dpcd[DP_DPCD_REV ] >=DP_DPCD_REV_13 ) && + (dp->dpcd[DP_MAX_LANE_COUNT ] &DP_TPS3_SUPPORTED ); + dp->link.cap.is_tps4 = (dp->dpcd[DP_DPCD_REV ] >=DP_DPCD_REV_14 ) && + (dp->dpcd[DP_MAX_DOWNSPREAD ] &DP_TPS4_SUPPORTED ); + dp->link.cap.link_rate = dp->dpcd[DP_MAX_LINK_RATE ]; + dp->link.cap.lanes = dp->dpcd[DP_MAX_LANE_COUNT ] &DP_MAX_LANE_COUNT_MASK ; +if (dp->link.cap.lanes >HIBMC_DP_LANE_NUM_MAX ) + dp->link.cap.lanes =HIBMC_DP_LANE_NUM_MAX ; +} +int hibmc_dp_link_training (struct hibmc_dp_dev *dp) {struct hibmc_dp_link *link = &dp->link;
@@ -334,16 +356,7 @@ int hibmc_dp_link_training(struct hibmc_dp_dev *dp)if (ret)drm_err (dp->dev,"dp aux read dpcd failed, ret: %d\n" , ret); - dp->link.cap.link_rate = dp->dpcd[DP_MAX_LINK_RATE ]; - dp->link.cap.lanes =0x2 ; - - ret =hibmc_dp_get_serdes_rate_cfg (dp); -if (ret <0 ) -return ret; - - ret =hibmc_dp_serdes_rate_switch (ret, dp); -if (ret) -return ret; +hibmc_dp_update_caps (dp);while (true) { ret =hibmc_dp_link_training_cr_pre (dp);
drivers/gpu/drm/hisilicon/hibmc/dp/dp_serdes.c +0 -12
@@ -57,15 +57,3 @@ int hibmc_dp_serdes_rate_switch(u8 rate, struct hibmc_dp_dev *dp)return 0 ; } - -int hibmc_dp_serdes_init (struct hibmc_dp_dev *dp) -{ - dp->serdes_base = dp->base +HIBMC_DP_HOST_OFFSET ; - -writel (FIELD_PREP (HIBMC_DP_PMA_TXDEEMPH ,DP_SERDES_VOL0_PRE0 ), - dp->serdes_base +HIBMC_DP_PMA_LANE0_OFFSET ); -writel (FIELD_PREP (HIBMC_DP_PMA_TXDEEMPH ,DP_SERDES_VOL0_PRE0 ), - dp->serdes_base +HIBMC_DP_PMA_LANE1_OFFSET ); - -return hibmc_dp_serdes_rate_switch (DP_SERDES_BW_8_1 , dp); -}
Signature · 1 line
2.33.0
Yongbang Shi
maintainerPATCH v2 6/10 drm/hisilicon/hibmc: add dp mode valid check
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
If DP is connected, add mode check and BW check in mode_valid_ctx() to ensure DP's cfg is usable.
---
ChangeLog:
v1 -> v2:
- delete if (!dp->is_connected) in hibmc_dp_mode_valid(), suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 10 ++++ drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 6 +++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 51 +++++++++++++++++++ 3 files changed, 67 insertions(+)
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +10 -0
@@ -273,6 +273,16 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp) dp->dp_dev->link.status.channel_equalized = false; } +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.link_rate; +} + +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.lanes; +} +static const struct hibmc_dp_color_raw g_rgb_raw[] = { {CBAR_COLOR_BAR ,0x000 ,0x000 ,0x000 }, {CBAR_WHITE ,0xfff ,0xfff ,0xfff },
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h +6 -0
@@ -12,6 +12,10 @@#include <drm/drm_print.h> #include <drm/display/drm_dp_helper.h> +/* 27 * 10000000 * 80% = 216000000 */ +#define DP_MODE_VALI_CAL 216000000 +#define BPP_24 24 +struct hibmc_dp_dev ;enum hibmc_dp_cbar_pattern {
@@ -62,5 +66,7 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp);void hibmc_dp_hpd_cfg (struct hibmc_dp *dp);void hibmc_dp_enable_int (struct hibmc_dp *dp);void hibmc_dp_disable_int (struct hibmc_dp *dp); +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp); +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp);#endif
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +51 -0
66 lines not on this page · raw message
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 06/10] drm/hisilicon/hibmc: add dp mode valid check
Quoted 104 lines · Yongbang Shi
From: Baihan Li <[email protected]>
If DP is connected, add mode check and BW check in
mode_valid_ctx()to ensure DP's cfg is usable.Fixes f9698f802e50 ("drm/hisilicon/hibmc: Restructuring the header dp_reg.h")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>---
ChangeLog:
v1 -> v2:
- delete if (!dp->is_connected) inhibmc_dp_mode_valid(), suggested by Dmitry Baryshkov.--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 10 ++++ drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 6 +++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 51 +++++++++++++++++++ 3 files changed, 67 insertions(+)drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +10
-0@@ -273,6 +273,16 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp) dp->dp_dev->link.status.channel_equalized = false; } +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.link_rate; +} + +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.lanes; +} +static const struct hibmc_dp_color_raw g_rgb_raw[] = { {CBAR_COLOR_BAR ,0x000 ,0x000 ,0x000 }, {CBAR_WHITE ,0xfff ,0xfff ,0xfff },drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h +6
-0@@ -12,6 +12,10 @@#include <drm/drm_print.h> #include <drm/display/drm_dp_helper.h> +/* 27 * 10000000 * 80% = 216000000 */ +#define DP_MODE_VALI_CAL 216000000 +#define BPP_24 24 +struct hibmc_dp_dev ;enum hibmc_dp_cbar_pattern {@@ -62,5 +66,7 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp);void hibmc_dp_hpd_cfg (struct hibmc_dp *dp);void hibmc_dp_enable_int (struct hibmc_dp *dp);void hibmc_dp_disable_int (struct hibmc_dp *dp); +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp); +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp);#endif drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +27
-0@@ -15,6 +15,28 @@#define DP_MASKED_SINK_HPD_PLUG_INT BIT(2) +struct hibmc_dp_disp_clk { +u16 hdisplay; +u16 vdisplay; +u32 clock; +}; + +static const struct hibmc_dp_disp_clk hibmc_dp_clk_table[] = { + {640 ,480 ,25175 },/* 25175 khz */ + {800 ,600 ,40000 },/* 40000 khz */ + {1024 ,768 ,65000 },/* 65000 khz */ + {1152 ,864 ,80000 },/* 80000 khz */ + {1280 ,768 ,79500 },/* 79500 khz */ + {1280 ,720 ,74250 },/* 74250 khz */ + {1280 ,960 ,108000 },/* 108000 khz */ + {1280 ,1024 ,108000 },/* 108000 khz */ + {1440 ,900 ,106500 },/* 106500 khz */ + {1600 ,900 ,108000 },/* 108000 khz */ + {1600 ,1200 ,162000 },/* 162000 khz */ + {1920 ,1080 ,148500 },/* 148500 khz */ + {1920 ,1200 ,193250 },/* 193250 khz */ +}; +static int hibmc_dp_connector_get_modes (struct drm_connector *connector) {const struct drm_edid *drm_edid;@@ -49,9 +71,38 @@ static int hibmc_dp_detect(struct drm_connector *connector,return connector_status_disconnected; } +static int hibmc_dp_mode_valid (struct drm_connector *connector, +const struct drm_display_mode *mode, +struct drm_modeset_acquire_ctx *ctx, +enum drm_mode_status *status) +{
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c static int hibmc_dp_detect(struct drm_connector *connector, · line 88
Quoted 10 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +10
-0+struct hibmc_dp *dp =to_hibmc_dp (connector); +u64 cur_val, max_val; + +/* check DP link BW */ + cur_val = (u64 )mode->htotal * mode->vtotal *drm_mode_vrefresh (mode) *BPP_24 ; + max_val = (u64 )hibmc_dp_get_link_rate (dp) *DP_MODE_VALI_CAL *hibmc_dp_get_lanes (dp); + + *status = cur_val > max_val ?MODE_CLOCK_HIGH :MODE_OK ; + +/* check the clock */
Why? Is it really fixed to the values in the table?
Quoted 23 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +14
-0+for (size_t i =0 ; i <ARRAY_SIZE (hibmc_dp_clk_table); i++) { +if (hibmc_dp_clk_table[i].hdisplay == mode->hdisplay && + hibmc_dp_clk_table[i].vdisplay == mode->vdisplay) { +if (hibmc_dp_clk_table[i].clock != mode->clock) { + *status =MODE_CLOCK_RANGE ; +return 0 ; + } + } + } + +return 0 ; +} +static const struct drm_connector_helper_funcs hibmc_dp_conn_helper_funcs = { .get_modes = hibmc_dp_connector_get_modes, .detect_ctx = hibmc_dp_detect, + .mode_valid_ctx = hibmc_dp_mode_valid, };static int hibmc_dp_late_register (struct drm_connector *connector)Signature · 1 line
2.33.0
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerRe: [PATCH v2 drm-dp 06/10] drm/hisilicon/hibmc: add dp mode valid check
Quoted 101 lines · Yongbang Shi
Quoted 99 lines
From: Baihan Li <[email protected]>
If DP is connected, add mode check and BW check in
mode_valid_ctx()to ensure DP's cfg is usable.Fixes f9698f802e50 ("drm/hisilicon/hibmc: Restructuring the header dp_reg.h")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>---
ChangeLog:
v1 -> v2:
- delete if (!dp->is_connected) inhibmc_dp_mode_valid(), suggested by Dmitry Baryshkov.--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 10 ++++ drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 6 +++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 51 +++++++++++++++++++ 3 files changed, 67 insertions(+)drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +10
-0@@ -273,6 +273,16 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp) dp->dp_dev->link.status.channel_equalized = false; } +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.link_rate; +} + +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp) +{ +return dp->dp_dev->link.cap.lanes; +} +static const struct hibmc_dp_color_raw g_rgb_raw[] = { {CBAR_COLOR_BAR ,0x000 ,0x000 ,0x000 }, {CBAR_WHITE ,0xfff ,0xfff ,0xfff },drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h +6
-0@@ -12,6 +12,10 @@#include <drm/drm_print.h> #include <drm/display/drm_dp_helper.h> +/* 27 * 10000000 * 80% = 216000000 */ +#define DP_MODE_VALI_CAL 216000000 +#define BPP_24 24 +struct hibmc_dp_dev ;enum hibmc_dp_cbar_pattern {@@ -62,5 +66,7 @@ void hibmc_dp_reset_link(struct hibmc_dp *dp);void hibmc_dp_hpd_cfg (struct hibmc_dp *dp);void hibmc_dp_enable_int (struct hibmc_dp *dp);void hibmc_dp_disable_int (struct hibmc_dp *dp); +u8 hibmc_dp_get_link_rate (struct hibmc_dp *dp); +u8 hibmc_dp_get_lanes (struct hibmc_dp *dp);#endif drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +22
-0@@ -15,6 +15,28 @@#define DP_MASKED_SINK_HPD_PLUG_INT BIT(2) +struct hibmc_dp_disp_clk { +u16 hdisplay; +u16 vdisplay; +u32 clock; +}; + +static const struct hibmc_dp_disp_clk hibmc_dp_clk_table[] = { + {640 ,480 ,25175 },/* 25175 khz */ + {800 ,600 ,40000 },/* 40000 khz */ + {1024 ,768 ,65000 },/* 65000 khz */ + {1152 ,864 ,80000 },/* 80000 khz */ + {1280 ,768 ,79500 },/* 79500 khz */ + {1280 ,720 ,74250 },/* 74250 khz */ + {1280 ,960 ,108000 },/* 108000 khz */ + {1280 ,1024 ,108000 },/* 108000 khz */ + {1440 ,900 ,106500 },/* 106500 khz */ + {1600 ,900 ,108000 },/* 108000 khz */ + {1600 ,1200 ,162000 },/* 162000 khz */ + {1920 ,1080 ,148500 },/* 148500 khz */ + {1920 ,1200 ,193250 },/* 193250 khz */ +}; +static int hibmc_dp_connector_get_modes (struct drm_connector *connector) {const struct drm_edid *drm_edid;@@ -49,9 +71,38 @@ static int hibmc_dp_detect(struct drm_connector *connector,return connector_status_disconnected; }
Quoted 16 lines
Quoted 5 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +5
-0+static int hibmc_dp_mode_valid (struct drm_connector *connector, +const struct drm_display_mode *mode, +struct drm_modeset_acquire_ctx *ctx, +enum drm_mode_status *status) +{drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c static int hibmc_dp_detect(struct drm_connector *connector, · line 88
Quoted 10 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +10
-0+struct hibmc_dp *dp =to_hibmc_dp (connector); +u64 cur_val, max_val; + +/* check DP link BW */ + cur_val = (u64 )mode->htotal * mode->vtotal *drm_mode_vrefresh (mode) *BPP_24 ; + max_val = (u64 )hibmc_dp_get_link_rate (dp) *DP_MODE_VALI_CAL *hibmc_dp_get_lanes (dp); + + *status = cur_val > max_val ?MODE_CLOCK_HIGH :MODE_OK ; + +/* check the clock */ Why? Is it really fixed to the values in the table?
Right, our chip spec said that one resolution can only support one clock, and we only support 11 clocks above in the struct hibmc_dp_disp_clk{}, which is the limited of our display block.
Thanks,
Baihan.
Quoted 23 lines
Quoted 23 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c +14
-0+for (size_t i =0 ; i <ARRAY_SIZE (hibmc_dp_clk_table); i++) { +if (hibmc_dp_clk_table[i].hdisplay == mode->hdisplay && + hibmc_dp_clk_table[i].vdisplay == mode->vdisplay) { +if (hibmc_dp_clk_table[i].clock != mode->clock) { + *status =MODE_CLOCK_RANGE ; +return 0 ; + } + } + } + +return 0 ; +} +static const struct drm_connector_helper_funcs hibmc_dp_conn_helper_funcs = { .get_modes = hibmc_dp_connector_get_modes, .detect_ctx = hibmc_dp_detect, + .mode_valid_ctx = hibmc_dp_mode_valid, };static int hibmc_dp_late_register (struct drm_connector *connector)Signature · 1 line
2.33.0
Yongbang Shi
maintainerPATCH v2 7/10 drm/hisilicon/hibmc: fix dp and vga cannot show together
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
If VGA and DP connected together, there will be only one can get crtc. Add encoder possible_clones to support two connectors enable.
---
ChangeLog:
v1 -> v2:
- don't tie VGA and DP status, suggested by Dmitry Baryshkov.
- use crtc clone to let 2 connectors can display simultaneous
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +8 -0
@@ -115,6 +115,8 @@ static const struct drm_mode_config_funcs hibmc_mode_funcs = {static int hibmc_kms_init (struct hibmc_drm_private *priv) {struct drm_device *dev = &priv->dev; +struct drm_encoder *encoder; +u32 clone_mask =0 ;int ret; ret =drmm_mode_config_init (dev);
@@ -154,6 +156,12 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)return ret; } +drm_for_each_encoder (encoder, dev) + clone_mask |=drm_encoder_mask (encoder); + +drm_for_each_encoder (encoder, dev) + encoder->possible_clones = clone_mask; +return 0 ; }
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together
Quoted 9 lines · Yongbang Shi
From: Baihan Li <[email protected]>
If VGA and DP connected together, there will be only one can get crtc. Add encoder
possible_clonesto support two connectors enable.Fixes 0ab6ea261c1f ("drm/hisilicon/hibmc: add dp module in hibmc")Fixes 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>
Quoted 5 lines
---
ChangeLog:
v1 -> v2:
- don't tie VGA and DP status, suggested by Dmitry Baryshkov.
- use crtc clone to let 2 connectors can display simultaneous
How does this help? I had an impression that your hw can actually display only either to DP or to VGA. Can it send the same (aka cloned) video stream to both connectors at the same time?
Quoted 4 lines
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerRe: [PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together
Quoted 16 lines · Yongbang Shi
Quoted 9 lines
From: Baihan Li <[email protected]>
If VGA and DP connected together, there will be only one can get crtc. Add encoder
possible_clonesto support two connectors enable.Fixes 0ab6ea261c1f ("drm/hisilicon/hibmc: add dp module in hibmc")Fixes 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>Quoted 5 lines
---
ChangeLog:
v1 -> v2:
- don't tie VGA and DP status, suggested by Dmitry Baryshkov.
- use crtc clone to let 2 connectors can display simultaneous
Quoted 3 lines
How does this help? I had an impression that your hw can actually display only either to DP or to VGA. Can it send the same (aka cloned) video stream to both connectors at the same time?
Right, we support it. We support using KVM remotely operated, and local maintenance using DP at the same time. KVM and VGA are both using VDAC connector in driver. Actually, there are three outputs showing at the same time.
Thanks,
Baihan.
Quoted 4 lines
Quoted 4 lines
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Yongbang Shi
maintainerPATCH v2 8/10 drm/hisilicon/hibmc: fix no showing when no connectors connected
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
Our chip support KVM over IP feature, so hibmc driver need to support displaying without any connectors plugged in. Deleting the detect_ctx() of VGA to make it connected when no connector is detected.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +0 -1
@@ -60,7 +60,6 @@ static void hibmc_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs hibmc_connector_helper_funcs = { .get_modes = hibmc_connector_get_modes, - .detect_ctx = drm_connector_helper_detect_from_ddc, };static const struct drm_connector_funcs hibmc_connector_funcs = {
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 08/10] drm/hisilicon/hibmc: fix no showing when no connectors connected
Quoted 5 lines · Yongbang Shi
From: Baihan Li <[email protected]>
Our chip support KVM over IP feature, so hibmc driver need to support displaying without any connectors plugged in. Deleting the
detect_ctx()of VGA to make it connected when no connector is detected.
I think, there is more than that. Please see how AST driver handles the same issue. I think you need something similar.
Quoted 23 lines
Fixes 4c962bc929f1 ("drm/hisilicon/hibmc: Add vga connector detect functions")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +0
-1@@ -60,7 +60,6 @@ static void hibmc_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs hibmc_connector_helper_funcs = { .get_modes = hibmc_connector_get_modes, - .detect_ctx = drm_connector_helper_detect_from_ddc, };static const struct drm_connector_funcs hibmc_connector_funcs = {Signature · 1 line
2.33.0
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerRe: [PATCH v2 drm-dp 08/10] drm/hisilicon/hibmc: fix no showing when no connectors connected
Quoted 9 lines · Yongbang Shi
Quoted 5 lines
From: Baihan Li <[email protected]>
Our chip support KVM over IP feature, so hibmc driver need to support displaying without any connectors plugged in. Deleting the
detect_ctx()of VGA to make it connected when no connector is detected.I think, there is more than that. Please see how AST driver handles the same issue. I think you need something similar.
Okay, thanks for your advice!
Quoted 22 lines
Quoted 22 lines
Fixes 4c962bc929f1 ("drm/hisilicon/hibmc: Add vga connector detect functions")Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +0
-1@@ -60,7 +60,6 @@ static void hibmc_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs hibmc_connector_helper_funcs = { .get_modes = hibmc_connector_get_modes, - .detect_ctx = drm_connector_helper_detect_from_ddc, };static const struct drm_connector_funcs hibmc_connector_funcs = {Signature · 1 line
2.33.0
Yongbang Shi
maintainerPATCH v2 9/10 drm/hisilicon/hibmc: fix no showing problem with loading hibmc manually
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
When using command rmmod and insmod, there is no showing in second time insmoding. Because DP controller won't send HPD signals, if connection doesn't change or controller isn't reset. So add reset before unreset in hibmc_dp_hw_init().
---
ChangeLog:
v1 -> v2:
- fix the tag, suggested by Dmitry Baryshkov.
- separate the patch, suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +2 -0
@@ -178,6 +178,8 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp)writel (0 , dp_dev->base +HIBMC_DP_INTR_ENABLE );writel (HIBMC_DP_INT_RST , dp_dev->base +HIBMC_DP_INTR_ORIGINAL_STATUS );/* rst */ +writel (0 , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL ); +usleep_range (30 ,50 );writel (HIBMC_DP_DPTX_RST , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL );/* clock enable */ writel (HIBMC_DP_CLK_EN , dp_dev->base +HIBMC_DP_DPTX_CLK_CTRL );
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 09/10] drm/hisilicon/hibmc: fix no showing problem with loading hibmc manually
Quoted 9 lines · Yongbang Shi
From: Baihan Li <[email protected]>
When using command rmmod and insmod, there is no showing in second time insmoding. Because DP controller won't send HPD signals, if connection doesn't change or controller isn't reset. So add reset before unreset in
hibmc_dp_hw_init().Fixes 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")Fixes 94ee73ee3020 ("drm/hisilicon/hibmc: add dp hw moduel in hibmc driver")
So, which one had the issue?
Quoted 27 lines
Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>---
ChangeLog:
v1 -> v2:
- fix the tag, suggested by Dmitry Baryshkov.
- separate the patch, suggested by Dmitry Baryshkov.--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +2
-0@@ -178,6 +178,8 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp)writel (0 , dp_dev->base +HIBMC_DP_INTR_ENABLE );writel (HIBMC_DP_INT_RST , dp_dev->base +HIBMC_DP_INTR_ORIGINAL_STATUS );/* rst */ +writel (0 , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL ); +usleep_range (30 ,50 );writel (HIBMC_DP_DPTX_RST , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL );/* clock enable */ writel (HIBMC_DP_CLK_EN , dp_dev->base +HIBMC_DP_DPTX_CLK_CTRL );Signature · 1 line
2.33.0
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerPATCH v2 10/10 drm/hisilicon/hibmc: adapting modification for the former commit
In reply to Yongbang ShiFrom: Baihan Li <[email protected]>
Add colorbar disable operation and move hdcp opreation behind the reset controller operation.
---
ChangeLog:
v1 -> v2:
- separate the patch, suggested by Dmitry Baryshkov.
--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +4 -2
@@ -172,15 +172,17 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp) dp_dev->link.cap.lanes =0x2 ; dp_dev->link.cap.link_rate =DP_LINK_BW_8_1 ; -/* hdcp data */ -writel (HIBMC_DP_HDCP , dp_dev->base +HIBMC_DP_HDCP_CFG );/* int init */ writel (0 , dp_dev->base +HIBMC_DP_INTR_ENABLE );writel (HIBMC_DP_INT_RST , dp_dev->base +HIBMC_DP_INTR_ORIGINAL_STATUS ); +/* clr colorbar */ +writel (0 , dp_dev->base +HIBMC_DP_COLOR_BAR_CTRL );/* rst */ writel (0 , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL );usleep_range (30 ,50 );writel (HIBMC_DP_DPTX_RST , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL ); +/* hdcp data */ +writel (HIBMC_DP_HDCP , dp_dev->base +HIBMC_DP_HDCP_CFG );/* clock enable */ writel (HIBMC_DP_CLK_EN , dp_dev->base +HIBMC_DP_DPTX_CLK_CTRL );
Signature · 1 line
2.33.0
Re: [PATCH v2 drm-dp 10/10] drm/hisilicon/hibmc: adapting modification for the former commit
Quoted 4 lines · Yongbang Shi
From: Baihan Li <[email protected]>
Add colorbar disable operation and move hdcp opreation behind the reset controller operation.
Two items => two commits
You missed the 'why' part of the commit message.
Quoted 3 lines
Fixes 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")Fixes 94ee73ee3020 ("drm/hisilicon/hibmc: add dp hw moduel in hibmc driver")
Which one is wrong?
Quoted 37 lines
Signed-off-by Baihan Li <[email protected]>Signed-off-by Yongbang Shi <[email protected]>---
ChangeLog:
v1 -> v2:
- separate the patch, suggested by Dmitry Baryshkov.--- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c +4
-2@@ -172,15 +172,17 @@ int hibmc_dp_hw_init(struct hibmc_dp *dp) dp_dev->link.cap.lanes =0x2 ; dp_dev->link.cap.link_rate =DP_LINK_BW_8_1 ; -/* hdcp data */ -writel (HIBMC_DP_HDCP , dp_dev->base +HIBMC_DP_HDCP_CFG );/* int init */ writel (0 , dp_dev->base +HIBMC_DP_INTR_ENABLE );writel (HIBMC_DP_INT_RST , dp_dev->base +HIBMC_DP_INTR_ORIGINAL_STATUS ); +/* clr colorbar */ +writel (0 , dp_dev->base +HIBMC_DP_COLOR_BAR_CTRL );/* rst */ writel (0 , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL );usleep_range (30 ,50 );writel (HIBMC_DP_DPTX_RST , dp_dev->base +HIBMC_DP_DPTX_RST_CTRL ); +/* hdcp data */ +writel (HIBMC_DP_HDCP , dp_dev->base +HIBMC_DP_HDCP_CFG );/* clock enable */ writel (HIBMC_DP_CLK_EN , dp_dev->base +HIBMC_DP_DPTX_CLK_CTRL );Signature · 1 line
2.33.0
Signature · 2 lines
With best wishes Dmitry
Yongbang Shi
maintainerGracious ping for this bugfix series, it's been posted a week!
Quoted 44 lines
From: Baihan Li <[email protected]>
There are some bugfix for hibmc-drm driver.
---
ChangeLog:
v1 -> v2:
- use thehibmc_ddc_del()inhibmc_connector_destroy(), suggested by Dmitry Baryshkov.
- fix the tag, suggested by Dmitry Baryshkov.
- don't use the flag, and use more checks indetect_ctx(), suggested by Dmitry Baryshkov.
- delete if (dev->registered), suggested by Dmitry Baryshkov.
- add explanations in commit, suggested by Dmitry Baryshkov.
- delete if (!dp->is_connected) inhibmc_dp_mode_valid(), suggested by Dmitry Baryshkov.
- don't tie VGA and DP status, suggested by Dmitry Baryshkov.
- use crtc clone to let 2 connectors can display simultaneous
- separate the patch, suggested by Dmitry Baryshkov.
---Baihan Li (10):
drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init
failed
drm/hisilicon/hibmc: fix dp probabilistical detect errors after HPD
irq
drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local drm/hisilicon/hibmc: fix the hibmc loaded failed bug drm/hisilicon/hibmc: fix rare monitors cannot display problem drm/hisilicon/hibmc: add dp mode valid check drm/hisilicon/hibmc: fix dp and vga cannot show together drm/hisilicon/hibmc: fix no showing when no connectors connected drm/hisilicon/hibmc: fix no showing problem with loading hibmc
manually
drm/hisilicon/hibmc: adapting modification for the former commitdrivers/gpu/drm/hisilicon/hibmc/dp/dp_comm.h | 4 +- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 48 +++++++++---- drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.h | 8 +++ drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c | 33 ++++++--- .../gpu/drm/hisilicon/hibmc/dp/dp_serdes.c | 12 ---- .../gpu/drm/hisilicon/hibmc/hibmc_drm_dp.c | 70 +++++++++++++++++-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 +++--- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 + .../gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 5 ++ .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 12 ++-- 10 files changed, 163 insertions(+), 52 deletions(-)