Loading drivers/gpu/drm/msm/msm_drv.c +21 −0 Original line number Diff line number Diff line Loading @@ -668,6 +668,27 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) } } /** * Since pp interrupt is heavy weight, try to queue the work * into a dedicated worker thread, so that they dont interrupt * other important events. */ kthread_init_worker(&priv->pp_event_worker); priv->pp_event_thread = kthread_run(kthread_worker_fn, &priv->pp_event_worker, "pp_event"); ret = sched_setscheduler(priv->pp_event_thread, SCHED_FIFO, ¶m); if (ret) pr_warn("pp_event thread priority update failed: %d\n", ret); if (IS_ERR(priv->pp_event_thread)) { dev_err(dev, "failed to create pp_event kthread\n"); priv->pp_event_thread = NULL; goto fail; } ret = drm_vblank_init(ddev, priv->num_crtcs); if (ret < 0) { dev_err(dev, "failed to initialize vblank\n"); Loading drivers/gpu/drm/msm/msm_drv.h +4 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark <robdclark@gmail.com> * Loading Loading @@ -578,6 +578,9 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; struct task_struct *pp_event_thread; struct kthread_worker pp_event_worker; unsigned int num_encoders; struct drm_encoder *encoders[MAX_ENCODERS]; Loading drivers/gpu/drm/msm/sde/sde_color_processing.c +4 −2 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,8 @@ static void sde_cp_ad_interrupt_cb(void *arg, int irq_idx) { struct sde_crtc *crtc = arg; sde_crtc_event_queue(&crtc->base, sde_cp_notify_ad_event, NULL); sde_crtc_event_queue(&crtc->base, sde_cp_notify_ad_event, NULL, true); } static void sde_cp_notify_ad_event(struct drm_crtc *crtc_drm, void *arg) Loading Loading @@ -1834,7 +1835,8 @@ static void sde_cp_hist_interrupt_cb(void *arg, int irq_idx) } /* notify histogram event */ sde_crtc_event_queue(crtc_drm, sde_cp_notify_hist_event, NULL); sde_crtc_event_queue(crtc_drm, sde_cp_notify_hist_event, NULL, true); } static void sde_cp_notify_hist_event(struct drm_crtc *crtc_drm, void *arg) Loading drivers/gpu/drm/msm/sde/sde_crtc.c +7 −2 Original line number Diff line number Diff line Loading @@ -5927,7 +5927,8 @@ static void _sde_crtc_event_cb(struct kthread_work *work) } int sde_crtc_event_queue(struct drm_crtc *crtc, void (*func)(struct drm_crtc *crtc, void *usr), void *usr) void (*func)(struct drm_crtc *crtc, void *usr), void *usr, bool color_processing_event) { unsigned long irq_flags; struct sde_crtc *sde_crtc; Loading Loading @@ -5966,6 +5967,10 @@ int sde_crtc_event_queue(struct drm_crtc *crtc, /* queue new event request */ kthread_init_work(&event->kt_work, _sde_crtc_event_cb); if (color_processing_event) kthread_queue_work(&priv->pp_event_worker, &event->kt_work); else kthread_queue_work(&priv->event_thread[crtc_id].worker, &event->kt_work); Loading drivers/gpu/drm/msm/sde/sde_crtc.h +3 −1 Original line number Diff line number Diff line Loading @@ -664,10 +664,12 @@ static inline bool sde_crtc_is_reset_required(struct drm_crtc *crtc) * @crtc: Pointer to drm crtc structure * @func: Pointer to callback function * @usr: Pointer to user data to be passed to callback * @color_processing_event: True if color processing event * Returns: Zero on success */ int sde_crtc_event_queue(struct drm_crtc *crtc, void (*func)(struct drm_crtc *crtc, void *usr), void *usr); void (*func)(struct drm_crtc *crtc, void *usr), void *usr, bool color_processing_event); /** * sde_crtc_res_add - add given resource to resource pool in crtc state Loading Loading
drivers/gpu/drm/msm/msm_drv.c +21 −0 Original line number Diff line number Diff line Loading @@ -668,6 +668,27 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) } } /** * Since pp interrupt is heavy weight, try to queue the work * into a dedicated worker thread, so that they dont interrupt * other important events. */ kthread_init_worker(&priv->pp_event_worker); priv->pp_event_thread = kthread_run(kthread_worker_fn, &priv->pp_event_worker, "pp_event"); ret = sched_setscheduler(priv->pp_event_thread, SCHED_FIFO, ¶m); if (ret) pr_warn("pp_event thread priority update failed: %d\n", ret); if (IS_ERR(priv->pp_event_thread)) { dev_err(dev, "failed to create pp_event kthread\n"); priv->pp_event_thread = NULL; goto fail; } ret = drm_vblank_init(ddev, priv->num_crtcs); if (ret < 0) { dev_err(dev, "failed to initialize vblank\n"); Loading
drivers/gpu/drm/msm/msm_drv.h +4 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark <robdclark@gmail.com> * Loading Loading @@ -578,6 +578,9 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; struct task_struct *pp_event_thread; struct kthread_worker pp_event_worker; unsigned int num_encoders; struct drm_encoder *encoders[MAX_ENCODERS]; Loading
drivers/gpu/drm/msm/sde/sde_color_processing.c +4 −2 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,8 @@ static void sde_cp_ad_interrupt_cb(void *arg, int irq_idx) { struct sde_crtc *crtc = arg; sde_crtc_event_queue(&crtc->base, sde_cp_notify_ad_event, NULL); sde_crtc_event_queue(&crtc->base, sde_cp_notify_ad_event, NULL, true); } static void sde_cp_notify_ad_event(struct drm_crtc *crtc_drm, void *arg) Loading Loading @@ -1834,7 +1835,8 @@ static void sde_cp_hist_interrupt_cb(void *arg, int irq_idx) } /* notify histogram event */ sde_crtc_event_queue(crtc_drm, sde_cp_notify_hist_event, NULL); sde_crtc_event_queue(crtc_drm, sde_cp_notify_hist_event, NULL, true); } static void sde_cp_notify_hist_event(struct drm_crtc *crtc_drm, void *arg) Loading
drivers/gpu/drm/msm/sde/sde_crtc.c +7 −2 Original line number Diff line number Diff line Loading @@ -5927,7 +5927,8 @@ static void _sde_crtc_event_cb(struct kthread_work *work) } int sde_crtc_event_queue(struct drm_crtc *crtc, void (*func)(struct drm_crtc *crtc, void *usr), void *usr) void (*func)(struct drm_crtc *crtc, void *usr), void *usr, bool color_processing_event) { unsigned long irq_flags; struct sde_crtc *sde_crtc; Loading Loading @@ -5966,6 +5967,10 @@ int sde_crtc_event_queue(struct drm_crtc *crtc, /* queue new event request */ kthread_init_work(&event->kt_work, _sde_crtc_event_cb); if (color_processing_event) kthread_queue_work(&priv->pp_event_worker, &event->kt_work); else kthread_queue_work(&priv->event_thread[crtc_id].worker, &event->kt_work); Loading
drivers/gpu/drm/msm/sde/sde_crtc.h +3 −1 Original line number Diff line number Diff line Loading @@ -664,10 +664,12 @@ static inline bool sde_crtc_is_reset_required(struct drm_crtc *crtc) * @crtc: Pointer to drm crtc structure * @func: Pointer to callback function * @usr: Pointer to user data to be passed to callback * @color_processing_event: True if color processing event * Returns: Zero on success */ int sde_crtc_event_queue(struct drm_crtc *crtc, void (*func)(struct drm_crtc *crtc, void *usr), void *usr); void (*func)(struct drm_crtc *crtc, void *usr), void *usr, bool color_processing_event); /** * sde_crtc_res_add - add given resource to resource pool in crtc state Loading