Skip to content

Commit

Permalink
DPU: fix crash of switch dsi and resolve compilation warnings
Browse files Browse the repository at this point in the history
1. fix the bug of zero pointer crash during the switch DSI
2. resolve warnings of DPU during compilation

Signed-off-by: forain <[email protected]>
  • Loading branch information
forain authored and Tianyu-Fu committed Jul 17, 2024
1 parent 25eedaf commit ebdd1a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions drivers/gpu/drm/verisilicon/dw_mipi_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ static int dw_mipi_dsi_read(struct dw_mipi_dsi *dsi,
return ret;
}

ret = dsi_read(dsi, DSI_GEN_PLD_DATA, &val);
if (unlikely(ret))
return ret;
ret = dsi_read(dsi, DSI_GEN_PLD_DATA, &val);
if (unlikely(ret))
return ret;

for (j = 0; j < 4 && j + i < len; j++)
buf[i + j] = val >> (8 * j);
Expand Down Expand Up @@ -833,7 +833,8 @@ static void bridge_post_disable(struct drm_bridge *bridge)
* This needs to be fixed in the drm_bridge framework and the API
* needs to be updated to manage our own call chains...
*/
primary->panel_bridge->funcs->post_disable(primary->panel_bridge);
if (primary->panel_bridge->funcs->post_disable)
primary->panel_bridge->funcs->post_disable(primary->panel_bridge);

if (primary->secondary_dsi)
dw_mipi_dsi_disable(primary->secondary_dsi);
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/verisilicon/vs_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static ssize_t log_show(struct kobject *kobj, struct kobj_attribute *attr, char
is_current_master ? 'y' : 'n',
priv->authenticated ? 'y' : 'n',
// from_kuid_munged(seq_user_ns(m), uid)
uid,
__kuid_val(uid),
priv->magic);
rcu_read_unlock();
}
Expand Down Expand Up @@ -195,7 +195,6 @@ static ssize_t log_show(struct kobject *kobj, struct kobj_attribute *attr, char
list_for_each_entry(drm_crtc, &drm_dev->mode_config.crtc_list, head) {
// struct vs_crtc *crtc = to_vs_crtc(drm_crtc);
struct drm_crtc *crtc = drm_crtc->state->crtc;
struct vs_crtc_state *crtc_state = to_vs_crtc_state(drm_crtc->state);

len += scnprintf(buf + len, PAGE_SIZE - len,
"crtc[%u]: %s\n"
Expand All @@ -215,7 +214,6 @@ static ssize_t log_show(struct kobject *kobj, struct kobj_attribute *attr, char

list_for_each_entry(plane, &drm_dev->mode_config.plane_list, head) {
struct drm_plane_state *state = plane->state;
struct vs_plane_state *plane_state = to_vs_plane_state(state);
struct drm_rect src = drm_plane_state_src(state);
struct drm_rect dest = drm_plane_state_dest(state);

Expand Down
2 changes: 2 additions & 0 deletions drivers/phy/synopsys/phy-dw-mipi-dphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ static int dw_dphy_runtime_resume(struct device *dev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int dw_dphy_resume(struct device *dev)
{
int ret;
Expand Down Expand Up @@ -793,6 +794,7 @@ static int dw_dphy_suspend(struct device *dev)

return 0;
}
#endif

static const struct dev_pm_ops dw_dphy_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_dphy_suspend,
Expand Down

0 comments on commit ebdd1a0

Please sign in to comment.