Commit 1d2fa58e authored by Samuel Iglesias Gonsalvez's avatar Samuel Iglesias Gonsalvez Committed by Rob Clark

drm/msm: export hangcheck_period in debugfs

While keeping the previous default value for hangcheck period,
we allow now the possibility of configuring its value via
debugfs.
Signed-off-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Link: https://lore.kernel.org/r/20210607104441.184700-1-siglesias@igalia.comSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent f6d62d09
...@@ -226,6 +226,9 @@ void msm_debugfs_init(struct drm_minor *minor) ...@@ -226,6 +226,9 @@ void msm_debugfs_init(struct drm_minor *minor)
debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root, debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
dev, &msm_gpu_fops); dev, &msm_gpu_fops);
debugfs_create_u32("hangcheck_period_ms", 0600, minor->debugfs_root,
&priv->hangcheck_period);
if (priv->kms && priv->kms->funcs->debugfs_init) if (priv->kms && priv->kms->funcs->debugfs_init)
priv->kms->funcs->debugfs_init(priv->kms, minor); priv->kms->funcs->debugfs_init(priv->kms, minor);
} }
......
...@@ -459,6 +459,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) ...@@ -459,6 +459,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
mdss = priv->mdss; mdss = priv->mdss;
priv->wq = alloc_ordered_workqueue("msm", 0); priv->wq = alloc_ordered_workqueue("msm", 0);
priv->hangcheck_period = DRM_MSM_HANGCHECK_DEFAULT_PERIOD;
INIT_LIST_HEAD(&priv->objects); INIT_LIST_HEAD(&priv->objects);
mutex_init(&priv->obj_lock); mutex_init(&priv->obj_lock);
......
...@@ -244,6 +244,9 @@ struct msm_drm_private { ...@@ -244,6 +244,9 @@ struct msm_drm_private {
struct shrinker shrinker; struct shrinker shrinker;
struct drm_atomic_state *pm_state; struct drm_atomic_state *pm_state;
/* For hang detection, in ms */
unsigned int hangcheck_period;
}; };
struct msm_format { struct msm_format {
......
...@@ -561,8 +561,9 @@ static void recover_worker(struct kthread_work *work) ...@@ -561,8 +561,9 @@ static void recover_worker(struct kthread_work *work)
static void hangcheck_timer_reset(struct msm_gpu *gpu) static void hangcheck_timer_reset(struct msm_gpu *gpu)
{ {
struct msm_drm_private *priv = gpu->dev->dev_private;
mod_timer(&gpu->hangcheck_timer, mod_timer(&gpu->hangcheck_timer,
round_jiffies_up(jiffies + DRM_MSM_HANGCHECK_JIFFIES)); round_jiffies_up(jiffies + msecs_to_jiffies(priv->hangcheck_period)));
} }
static void hangcheck_handler(struct timer_list *t) static void hangcheck_handler(struct timer_list *t)
......
...@@ -122,8 +122,7 @@ struct msm_gpu { ...@@ -122,8 +122,7 @@ struct msm_gpu {
*/ */
#define DRM_MSM_INACTIVE_PERIOD 66 /* in ms (roughly four frames) */ #define DRM_MSM_INACTIVE_PERIOD 66 /* in ms (roughly four frames) */
#define DRM_MSM_HANGCHECK_PERIOD 500 /* in ms */ #define DRM_MSM_HANGCHECK_DEFAULT_PERIOD 500 /* in ms */
#define DRM_MSM_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_MSM_HANGCHECK_PERIOD)
struct timer_list hangcheck_timer; struct timer_list hangcheck_timer;
/* work for handling GPU recovery: */ /* work for handling GPU recovery: */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment