Re: [PATCH v2] drm/msm/dpu: Drop encoder vsync_event

2023-08-04 Thread Dmitry Baryshkov


On Wed, 02 Aug 2023 10:01:13 -0700, Jessica Zhang wrote:
> Drop vsync_event and vsync_event_work handlers as they are unnecessary.
> In addition drop the dpu_enc_ktime_template event class as it will be
> unused after the vsync_event handlers are dropped.
> 
> 

Applied, thanks!

[1/1] drm/msm/dpu: Drop encoder vsync_event
  https://gitlab.freedesktop.org/lumag/msm/-/commit/fdcb8fe0c9f0

Best regards,
-- 
Dmitry Baryshkov 


Re: [PATCH v2] drm/msm/dpu: Drop encoder vsync_event

2023-08-04 Thread Dmitry Baryshkov
On Wed, 2 Aug 2023 at 20:01, Jessica Zhang  wrote:
>
> Drop vsync_event and vsync_event_work handlers as they are unnecessary.
> In addition drop the dpu_enc_ktime_template event class as it will be
> unused after the vsync_event handlers are dropped.
>
> Signed-off-by: Jessica Zhang 
> ---
> Changes in v2:
> - Dropped dpu_enc_early_kickoff event and dpu_enc_ktime_template event class
> - Link to v1: 
> https://lore.kernel.org/r/20230801-encoder-cleanup-v1-1-f9e37fe27...@quicinc.com
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 65 
> +
>  drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h   | 23 --
>  2 files changed, 1 insertion(+), 87 deletions(-)

Reviewed-by: Dmitry Baryshkov 



-- 
With best wishes
Dmitry


[PATCH v2] drm/msm/dpu: Drop encoder vsync_event

2023-08-02 Thread Jessica Zhang
Drop vsync_event and vsync_event_work handlers as they are unnecessary.
In addition drop the dpu_enc_ktime_template event class as it will be
unused after the vsync_event handlers are dropped.

Signed-off-by: Jessica Zhang 
---
Changes in v2:
- Dropped dpu_enc_early_kickoff event and dpu_enc_ktime_template event class
- Link to v1: 
https://lore.kernel.org/r/20230801-encoder-cleanup-v1-1-f9e37fe27...@quicinc.com
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 65 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h   | 23 --
 2 files changed, 1 insertion(+), 87 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index f0a2a1dca741..d34e684a4178 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -152,7 +152,6 @@ enum dpu_enc_rc_states {
  * @crtc_frame_event_cb_data:  callback handler private data
  * @frame_done_timeout_ms: frame done timeout in ms
  * @frame_done_timer:  watchdog timer for frame done event
- * @vsync_event_timer: vsync timer
  * @disp_info: local copy of msm_display_info struct
  * @idle_pc_supported: indicate if idle power collaps is supported
  * @rc_lock:   resource control mutex lock to protect
@@ -160,7 +159,6 @@ enum dpu_enc_rc_states {
  * @rc_state:  resource controller state
  * @delayed_off_work:  delayed worker to schedule disabling of
  * clks and resources after IDLE_TIMEOUT time.
- * @vsync_event_work:  worker to handle vsync event for autorefresh
  * @topology:   topology of the display
  * @idle_timeout:  idle timeout duration in milliseconds
  * @wide_bus_en:   wide bus is enabled on this interface
@@ -194,7 +192,6 @@ struct dpu_encoder_virt {
 
atomic_t frame_done_timeout_ms;
struct timer_list frame_done_timer;
-   struct timer_list vsync_event_timer;
 
struct msm_display_info disp_info;
 
@@ -202,7 +199,6 @@ struct dpu_encoder_virt {
struct mutex rc_lock;
enum dpu_enc_rc_states rc_state;
struct delayed_work delayed_off_work;
-   struct kthread_work vsync_event_work;
struct msm_display_topology topology;
 
u32 idle_timeout;
@@ -1770,49 +1766,6 @@ int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, 
ktime_t *wakeup_time)
return 0;
 }
 
-static void dpu_encoder_vsync_event_handler(struct timer_list *t)
-{
-   struct dpu_encoder_virt *dpu_enc = from_timer(dpu_enc, t,
-   vsync_event_timer);
-   struct drm_encoder *drm_enc = _enc->base;
-   struct msm_drm_private *priv;
-   struct msm_drm_thread *event_thread;
-
-   if (!drm_enc->dev || !drm_enc->crtc) {
-   DPU_ERROR("invalid parameters\n");
-   return;
-   }
-
-   priv = drm_enc->dev->dev_private;
-
-   if (drm_enc->crtc->index >= ARRAY_SIZE(priv->event_thread)) {
-   DPU_ERROR("invalid crtc index\n");
-   return;
-   }
-   event_thread = >event_thread[drm_enc->crtc->index];
-   if (!event_thread) {
-   DPU_ERROR("event_thread not found for crtc:%d\n",
-   drm_enc->crtc->index);
-   return;
-   }
-
-   del_timer(_enc->vsync_event_timer);
-}
-
-static void dpu_encoder_vsync_event_work_handler(struct kthread_work *work)
-{
-   struct dpu_encoder_virt *dpu_enc = container_of(work,
-   struct dpu_encoder_virt, vsync_event_work);
-   ktime_t wakeup_time;
-
-   if (dpu_encoder_vsync_time(_enc->base, _time))
-   return;
-
-   trace_dpu_enc_vsync_event_work(DRMID(_enc->base), wakeup_time);
-   mod_timer(_enc->vsync_event_timer,
-   nsecs_to_jiffies(ktime_to_ns(wakeup_time)));
-}
-
 static u32
 dpu_encoder_dsc_initial_line_calc(struct drm_dsc_config *dsc,
  u32 enc_ip_width)
@@ -1972,7 +1925,6 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
 {
struct dpu_encoder_virt *dpu_enc;
struct dpu_encoder_phys *phys;
-   ktime_t wakeup_time;
unsigned long timeout_ms;
unsigned int i;
 
@@ -1998,14 +1950,6 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
phys->ops.handle_post_kickoff(phys);
}
 
-   if (dpu_enc->disp_info.intf_type == INTF_DSI &&
-   !dpu_encoder_vsync_time(drm_enc, _time)) {
-   trace_dpu_enc_early_kickoff(DRMID(drm_enc),
-   ktime_to_ms(wakeup_time));
-   mod_timer(_enc->vsync_event_timer,
-   nsecs_to_jiffies(ktime_to_ns(wakeup_time)));
-   }
-
DPU_ATRACE_END("encoder_kickoff");
 }
 
@@ -2439,11 +2383,7 @@ struct drm_encoder *dpu_encoder_init(struct