Skip to content

Commit fdcb8fe

Browse files
Jessica Zhanglumag
authored andcommitted
drm/msm/dpu: Drop encoder vsync_event
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 <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/550983/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 57a1ca6 commit fdcb8fe

File tree

2 files changed

+1
-87
lines changed

2 files changed

+1
-87
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,13 @@ enum dpu_enc_rc_states {
152152
* @crtc_frame_event_cb_data: callback handler private data
153153
* @frame_done_timeout_ms: frame done timeout in ms
154154
* @frame_done_timer: watchdog timer for frame done event
155-
* @vsync_event_timer: vsync timer
156155
* @disp_info: local copy of msm_display_info struct
157156
* @idle_pc_supported: indicate if idle power collaps is supported
158157
* @rc_lock: resource control mutex lock to protect
159158
* virt encoder over various state changes
160159
* @rc_state: resource controller state
161160
* @delayed_off_work: delayed worker to schedule disabling of
162161
* clks and resources after IDLE_TIMEOUT time.
163-
* @vsync_event_work: worker to handle vsync event for autorefresh
164162
* @topology: topology of the display
165163
* @idle_timeout: idle timeout duration in milliseconds
166164
* @wide_bus_en: wide bus is enabled on this interface
@@ -194,15 +192,13 @@ struct dpu_encoder_virt {
194192

195193
atomic_t frame_done_timeout_ms;
196194
struct timer_list frame_done_timer;
197-
struct timer_list vsync_event_timer;
198195

199196
struct msm_display_info disp_info;
200197

201198
bool idle_pc_supported;
202199
struct mutex rc_lock;
203200
enum dpu_enc_rc_states rc_state;
204201
struct delayed_work delayed_off_work;
205-
struct kthread_work vsync_event_work;
206202
struct msm_display_topology topology;
207203

208204
u32 idle_timeout;
@@ -1770,49 +1766,6 @@ int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, ktime_t *wakeup_time)
17701766
return 0;
17711767
}
17721768

1773-
static void dpu_encoder_vsync_event_handler(struct timer_list *t)
1774-
{
1775-
struct dpu_encoder_virt *dpu_enc = from_timer(dpu_enc, t,
1776-
vsync_event_timer);
1777-
struct drm_encoder *drm_enc = &dpu_enc->base;
1778-
struct msm_drm_private *priv;
1779-
struct msm_drm_thread *event_thread;
1780-
1781-
if (!drm_enc->dev || !drm_enc->crtc) {
1782-
DPU_ERROR("invalid parameters\n");
1783-
return;
1784-
}
1785-
1786-
priv = drm_enc->dev->dev_private;
1787-
1788-
if (drm_enc->crtc->index >= ARRAY_SIZE(priv->event_thread)) {
1789-
DPU_ERROR("invalid crtc index\n");
1790-
return;
1791-
}
1792-
event_thread = &priv->event_thread[drm_enc->crtc->index];
1793-
if (!event_thread) {
1794-
DPU_ERROR("event_thread not found for crtc:%d\n",
1795-
drm_enc->crtc->index);
1796-
return;
1797-
}
1798-
1799-
del_timer(&dpu_enc->vsync_event_timer);
1800-
}
1801-
1802-
static void dpu_encoder_vsync_event_work_handler(struct kthread_work *work)
1803-
{
1804-
struct dpu_encoder_virt *dpu_enc = container_of(work,
1805-
struct dpu_encoder_virt, vsync_event_work);
1806-
ktime_t wakeup_time;
1807-
1808-
if (dpu_encoder_vsync_time(&dpu_enc->base, &wakeup_time))
1809-
return;
1810-
1811-
trace_dpu_enc_vsync_event_work(DRMID(&dpu_enc->base), wakeup_time);
1812-
mod_timer(&dpu_enc->vsync_event_timer,
1813-
nsecs_to_jiffies(ktime_to_ns(wakeup_time)));
1814-
}
1815-
18161769
static u32
18171770
dpu_encoder_dsc_initial_line_calc(struct drm_dsc_config *dsc,
18181771
u32 enc_ip_width)
@@ -1972,7 +1925,6 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
19721925
{
19731926
struct dpu_encoder_virt *dpu_enc;
19741927
struct dpu_encoder_phys *phys;
1975-
ktime_t wakeup_time;
19761928
unsigned long timeout_ms;
19771929
unsigned int i;
19781930

@@ -1998,14 +1950,6 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
19981950
phys->ops.handle_post_kickoff(phys);
19991951
}
20001952

2001-
if (dpu_enc->disp_info.intf_type == INTF_DSI &&
2002-
!dpu_encoder_vsync_time(drm_enc, &wakeup_time)) {
2003-
trace_dpu_enc_early_kickoff(DRMID(drm_enc),
2004-
ktime_to_ms(wakeup_time));
2005-
mod_timer(&dpu_enc->vsync_event_timer,
2006-
nsecs_to_jiffies(ktime_to_ns(wakeup_time)));
2007-
}
2008-
20091953
DPU_ATRACE_END("encoder_kickoff");
20101954
}
20111955

@@ -2439,21 +2383,14 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
24392383
timer_setup(&dpu_enc->frame_done_timer,
24402384
dpu_encoder_frame_done_timeout, 0);
24412385

2442-
if (disp_info->intf_type == INTF_DSI)
2443-
timer_setup(&dpu_enc->vsync_event_timer,
2444-
dpu_encoder_vsync_event_handler,
2445-
0);
2446-
else if (disp_info->intf_type == INTF_DP)
2386+
if (disp_info->intf_type == INTF_DP)
24472387
dpu_enc->wide_bus_en = msm_dp_wide_bus_available(
24482388
priv->dp[disp_info->h_tile_instance[0]]);
24492389

24502390
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
24512391
dpu_encoder_off_work);
24522392
dpu_enc->idle_timeout = IDLE_TIMEOUT;
24532393

2454-
kthread_init_work(&dpu_enc->vsync_event_work,
2455-
dpu_encoder_vsync_event_work_handler);
2456-
24572394
memcpy(&dpu_enc->disp_info, disp_info, sizeof(*disp_info));
24582395

24592396
DPU_DEBUG_ENC(dpu_enc, "created\n");

drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -453,29 +453,6 @@ TRACE_EVENT(dpu_enc_trigger_flush,
453453
__entry->extra_flush_bits, __entry->pending_flush_ret)
454454
);
455455

456-
DECLARE_EVENT_CLASS(dpu_enc_ktime_template,
457-
TP_PROTO(uint32_t drm_id, ktime_t time),
458-
TP_ARGS(drm_id, time),
459-
TP_STRUCT__entry(
460-
__field( uint32_t, drm_id )
461-
__field( ktime_t, time )
462-
),
463-
TP_fast_assign(
464-
__entry->drm_id = drm_id;
465-
__entry->time = time;
466-
),
467-
TP_printk("id=%u, time=%lld", __entry->drm_id,
468-
ktime_to_ms(__entry->time))
469-
);
470-
DEFINE_EVENT(dpu_enc_ktime_template, dpu_enc_vsync_event_work,
471-
TP_PROTO(uint32_t drm_id, ktime_t time),
472-
TP_ARGS(drm_id, time)
473-
);
474-
DEFINE_EVENT(dpu_enc_ktime_template, dpu_enc_early_kickoff,
475-
TP_PROTO(uint32_t drm_id, ktime_t time),
476-
TP_ARGS(drm_id, time)
477-
);
478-
479456
DECLARE_EVENT_CLASS(dpu_id_event_template,
480457
TP_PROTO(uint32_t drm_id, u32 event),
481458
TP_ARGS(drm_id, event),

0 commit comments

Comments
 (0)