Merge "drm/msm/sde: add kernel traces to measure enable/disable/kickoff times"
This commit is contained in:
commit
41f7afc189
4 changed files with 44 additions and 3 deletions
|
@ -20,6 +20,7 @@
|
|||
#include "msm_kms.h"
|
||||
#include "sde_connector.h"
|
||||
#include "dsi_drm.h"
|
||||
#include "sde_trace.h"
|
||||
|
||||
#define to_dsi_bridge(x) container_of((x), struct dsi_bridge, base)
|
||||
#define to_dsi_state(x) container_of((x), struct dsi_connector_state, base)
|
||||
|
@ -138,19 +139,24 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
|
|||
return;
|
||||
}
|
||||
|
||||
SDE_ATRACE_BEGIN("dsi_bridge_pre_enable");
|
||||
rc = dsi_display_prepare(c_bridge->display);
|
||||
if (rc) {
|
||||
pr_err("[%d] DSI display prepare failed, rc=%d\n",
|
||||
c_bridge->id, rc);
|
||||
SDE_ATRACE_END("dsi_bridge_pre_enable");
|
||||
return;
|
||||
}
|
||||
|
||||
SDE_ATRACE_BEGIN("dsi_display_enable");
|
||||
rc = dsi_display_enable(c_bridge->display);
|
||||
if (rc) {
|
||||
pr_err("[%d] DSI display enable failed, rc=%d\n",
|
||||
c_bridge->id, rc);
|
||||
(void)dsi_display_unprepare(c_bridge->display);
|
||||
}
|
||||
SDE_ATRACE_END("dsi_display_enable");
|
||||
SDE_ATRACE_END("dsi_bridge_pre_enable");
|
||||
}
|
||||
|
||||
static void dsi_bridge_enable(struct drm_bridge *bridge)
|
||||
|
@ -201,19 +207,25 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
|
|||
return;
|
||||
}
|
||||
|
||||
SDE_ATRACE_BEGIN("dsi_bridge_post_disable");
|
||||
SDE_ATRACE_BEGIN("dsi_display_disable");
|
||||
rc = dsi_display_disable(c_bridge->display);
|
||||
if (rc) {
|
||||
pr_err("[%d] DSI display disable failed, rc=%d\n",
|
||||
c_bridge->id, rc);
|
||||
SDE_ATRACE_END("dsi_display_disable");
|
||||
return;
|
||||
}
|
||||
SDE_ATRACE_END("dsi_display_disable");
|
||||
|
||||
rc = dsi_display_unprepare(c_bridge->display);
|
||||
if (rc) {
|
||||
pr_err("[%d] DSI display unprepare failed, rc=%d\n",
|
||||
c_bridge->id, rc);
|
||||
SDE_ATRACE_END("dsi_bridge_post_disable");
|
||||
return;
|
||||
}
|
||||
SDE_ATRACE_END("dsi_bridge_post_disable");
|
||||
}
|
||||
|
||||
static void dsi_bridge_mode_set(struct drm_bridge *bridge,
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "msm_drv.h"
|
||||
#include "msm_kms.h"
|
||||
#include "msm_gem.h"
|
||||
#include "sde_trace.h"
|
||||
|
||||
struct msm_commit {
|
||||
struct drm_device *dev;
|
||||
|
@ -108,6 +109,7 @@ msm_disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
|
|||
struct drm_crtc_state *old_crtc_state;
|
||||
int i;
|
||||
|
||||
SDE_ATRACE_BEGIN("msm_disable");
|
||||
for_each_connector_in_state(old_state, connector, old_conn_state, i) {
|
||||
const struct drm_encoder_helper_funcs *funcs;
|
||||
struct drm_encoder *encoder;
|
||||
|
@ -188,6 +190,7 @@ msm_disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
|
|||
else
|
||||
funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
|
||||
}
|
||||
SDE_ATRACE_END("msm_disable");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -297,6 +300,7 @@ static void msm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
|
|||
int bridge_enable_count = 0;
|
||||
int i;
|
||||
|
||||
SDE_ATRACE_BEGIN("msm_enable");
|
||||
for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
|
||||
const struct drm_crtc_helper_funcs *funcs;
|
||||
|
||||
|
@ -364,8 +368,10 @@ static void msm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
|
|||
}
|
||||
|
||||
/* If no bridges were pre_enabled, skip iterating over them again */
|
||||
if (bridge_enable_count == 0)
|
||||
if (bridge_enable_count == 0) {
|
||||
SDE_ATRACE_END("msm_enable");
|
||||
return;
|
||||
}
|
||||
|
||||
for_each_connector_in_state(old_state, connector, old_conn_state, i) {
|
||||
struct drm_encoder *encoder;
|
||||
|
@ -385,6 +391,7 @@ static void msm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
|
|||
|
||||
drm_bridge_enable(encoder->bridge);
|
||||
}
|
||||
SDE_ATRACE_END("msm_enable");
|
||||
}
|
||||
|
||||
/* The (potentially) asynchronous part of the commit. At this point
|
||||
|
@ -457,7 +464,9 @@ static void _msm_drm_commit_work_cb(struct kthread_work *work)
|
|||
|
||||
commit = container_of(work, struct msm_commit, commit_work);
|
||||
|
||||
SDE_ATRACE_BEGIN("complete_commit");
|
||||
complete_commit(commit);
|
||||
SDE_ATRACE_END("complete_commit");
|
||||
}
|
||||
|
||||
static struct msm_commit *commit_init(struct drm_atomic_state *state)
|
||||
|
@ -553,9 +562,12 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||
struct msm_commit *commit;
|
||||
int i, ret;
|
||||
|
||||
SDE_ATRACE_BEGIN("atomic_commit");
|
||||
ret = drm_atomic_helper_prepare_planes(dev, state);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
SDE_ATRACE_END("atomic_commit");
|
||||
return ret;
|
||||
}
|
||||
|
||||
commit = commit_init(state);
|
||||
if (IS_ERR_OR_NULL(commit)) {
|
||||
|
@ -635,6 +647,7 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||
|
||||
if (async) {
|
||||
msm_queue_fence_cb(dev, &commit->fence_cb, commit->fence);
|
||||
SDE_ATRACE_END("atomic_commit");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -645,9 +658,11 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||
|
||||
complete_commit(commit);
|
||||
|
||||
SDE_ATRACE_END("atomic_commit");
|
||||
return 0;
|
||||
|
||||
error:
|
||||
drm_atomic_helper_cleanup_planes(dev, state);
|
||||
SDE_ATRACE_END("atomic_commit");
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "sde_connector.h"
|
||||
#include "sde_power_handle.h"
|
||||
#include "sde_core_perf.h"
|
||||
#include "sde_trace.h"
|
||||
|
||||
/* default input fence timeout, in ms */
|
||||
#define SDE_CRTC_INPUT_FENCE_TIMEOUT 2000
|
||||
|
@ -642,6 +643,7 @@ static void _sde_crtc_wait_for_fences(struct drm_crtc *crtc)
|
|||
* that each plane can check its fence status and react appropriately
|
||||
* if its fence has timed out.
|
||||
*/
|
||||
SDE_ATRACE_BEGIN("plane_wait_input_fence");
|
||||
drm_atomic_crtc_for_each_plane(plane, crtc) {
|
||||
if (wait_ms) {
|
||||
/* determine updated wait time */
|
||||
|
@ -653,6 +655,7 @@ static void _sde_crtc_wait_for_fences(struct drm_crtc *crtc)
|
|||
}
|
||||
sde_plane_wait_input_fence(plane, wait_ms);
|
||||
}
|
||||
SDE_ATRACE_END("plane_wait_input_fence");
|
||||
}
|
||||
|
||||
static void _sde_crtc_setup_mixer_for_encoder(
|
||||
|
@ -887,6 +890,7 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
|
|||
sde_kms = _sde_crtc_get_kms(crtc);
|
||||
priv = sde_kms->dev->dev_private;
|
||||
|
||||
SDE_ATRACE_BEGIN("crtc_commit");
|
||||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||
if (encoder->crtc != crtc)
|
||||
continue;
|
||||
|
@ -903,7 +907,7 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
|
|||
SDE_ERROR("crtc%d invalid frame pending\n",
|
||||
crtc->base.id);
|
||||
SDE_EVT32(DRMID(crtc), 0);
|
||||
return;
|
||||
goto end;
|
||||
} else if (atomic_inc_return(&sde_crtc->frame_pending) == 1) {
|
||||
/* acquire bandwidth and other resources */
|
||||
SDE_DEBUG("crtc%d first commit\n", crtc->base.id);
|
||||
|
@ -921,6 +925,9 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
|
|||
|
||||
sde_encoder_kickoff(encoder);
|
||||
}
|
||||
end:
|
||||
SDE_ATRACE_END("crtc_commit");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "sde_formats.h"
|
||||
#include "sde_encoder_phys.h"
|
||||
#include "sde_color_processing.h"
|
||||
#include "sde_trace.h"
|
||||
|
||||
#define SDE_DEBUG_ENC(e, fmt, ...) SDE_DEBUG("enc%d " fmt,\
|
||||
(e) ? (e)->base.base.id : -1, ##__VA_ARGS__)
|
||||
|
@ -514,6 +515,7 @@ static void sde_encoder_vblank_callback(struct drm_encoder *drm_enc,
|
|||
if (!drm_enc || !phy_enc)
|
||||
return;
|
||||
|
||||
SDE_ATRACE_BEGIN("encoder_vblank_callback");
|
||||
sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
|
||||
spin_lock_irqsave(&sde_enc->enc_spinlock, lock_flags);
|
||||
|
@ -522,6 +524,7 @@ static void sde_encoder_vblank_callback(struct drm_encoder *drm_enc,
|
|||
spin_unlock_irqrestore(&sde_enc->enc_spinlock, lock_flags);
|
||||
|
||||
atomic_inc(&phy_enc->vsync_cnt);
|
||||
SDE_ATRACE_END("encoder_vblank_callback");
|
||||
}
|
||||
|
||||
static void sde_encoder_underrun_callback(struct drm_encoder *drm_enc,
|
||||
|
@ -530,8 +533,10 @@ static void sde_encoder_underrun_callback(struct drm_encoder *drm_enc,
|
|||
if (!phy_enc)
|
||||
return;
|
||||
|
||||
SDE_ATRACE_BEGIN("encoder_underrun_callback");
|
||||
atomic_inc(&phy_enc->underrun_cnt);
|
||||
SDE_EVT32(DRMID(drm_enc), atomic_read(&phy_enc->underrun_cnt));
|
||||
SDE_ATRACE_END("encoder_underrun_callback");
|
||||
}
|
||||
|
||||
void sde_encoder_register_vblank_callback(struct drm_encoder *drm_enc,
|
||||
|
@ -832,6 +837,7 @@ void sde_encoder_kickoff(struct drm_encoder *drm_enc)
|
|||
SDE_ERROR("invalid encoder\n");
|
||||
return;
|
||||
}
|
||||
SDE_ATRACE_BEGIN("encoder_kickoff");
|
||||
sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
|
||||
SDE_DEBUG_ENC(sde_enc, "\n");
|
||||
|
@ -851,6 +857,7 @@ void sde_encoder_kickoff(struct drm_encoder *drm_enc)
|
|||
if (phys && phys->ops.handle_post_kickoff)
|
||||
phys->ops.handle_post_kickoff(phys);
|
||||
}
|
||||
SDE_ATRACE_END("encoder_kickoff");
|
||||
}
|
||||
|
||||
static int _sde_encoder_status_show(struct seq_file *s, void *data)
|
||||
|
|
Loading…
Add table
Reference in a new issue