|
@@ -2823,24 +2823,11 @@ static void sde_crtc_frame_event_cb(void *data, u32 event, ktime_t ts)
|
|
spin_unlock_irqrestore(&sde_crtc->fevent_spin_lock, flags);
|
|
spin_unlock_irqrestore(&sde_crtc->fevent_spin_lock, flags);
|
|
|
|
|
|
if (!fevent) {
|
|
if (!fevent) {
|
|
- SDE_ERROR("crtc%d event %d overflow\n",
|
|
|
|
- crtc->base.id, event);
|
|
|
|
|
|
+ SDE_ERROR("crtc%d event %d overflow\n", DRMID(crtc), event);
|
|
SDE_EVT32(DRMID(crtc), event);
|
|
SDE_EVT32(DRMID(crtc), event);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- /* log and clear plane ubwc errors if any */
|
|
|
|
- if (event & (SDE_ENCODER_FRAME_EVENT_ERROR
|
|
|
|
- | SDE_ENCODER_FRAME_EVENT_PANEL_DEAD
|
|
|
|
- | SDE_ENCODER_FRAME_EVENT_DONE))
|
|
|
|
- sde_crtc_get_frame_data(crtc);
|
|
|
|
-
|
|
|
|
- if ((event & SDE_ENCODER_FRAME_EVENT_SIGNAL_RETIRE_FENCE) &&
|
|
|
|
- (sde_crtc && sde_crtc->retire_frame_event_sf)) {
|
|
|
|
- sde_crtc->retire_frame_event_time = ktime_get();
|
|
|
|
- sysfs_notify_dirent(sde_crtc->retire_frame_event_sf);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
fevent->event = event;
|
|
fevent->event = event;
|
|
fevent->ts = ts;
|
|
fevent->ts = ts;
|
|
fevent->crtc = crtc;
|
|
fevent->crtc = crtc;
|
|
@@ -3103,6 +3090,7 @@ static void sde_crtc_frame_event_work(struct kthread_work *work)
|
|
struct sde_kms *sde_kms;
|
|
struct sde_kms *sde_kms;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
bool in_clone_mode = false;
|
|
bool in_clone_mode = false;
|
|
|
|
+ int ret;
|
|
|
|
|
|
if (!work) {
|
|
if (!work) {
|
|
SDE_ERROR("invalid work handle\n");
|
|
SDE_ERROR("invalid work handle\n");
|
|
@@ -3137,6 +3125,17 @@ static void sde_crtc_frame_event_work(struct kthread_work *work)
|
|
if (!in_clone_mode && (fevent->event & (SDE_ENCODER_FRAME_EVENT_ERROR
|
|
if (!in_clone_mode && (fevent->event & (SDE_ENCODER_FRAME_EVENT_ERROR
|
|
| SDE_ENCODER_FRAME_EVENT_PANEL_DEAD
|
|
| SDE_ENCODER_FRAME_EVENT_PANEL_DEAD
|
|
| SDE_ENCODER_FRAME_EVENT_DONE))) {
|
|
| SDE_ENCODER_FRAME_EVENT_DONE))) {
|
|
|
|
+
|
|
|
|
+ ret = pm_runtime_resume_and_get(crtc->dev->dev);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ SDE_ERROR("failed to enable power resource %d\n", ret);
|
|
|
|
+ SDE_EVT32(ret, SDE_EVTLOG_ERROR);
|
|
|
|
+ } else {
|
|
|
|
+ /* log and clear plane ubwc errors if any */
|
|
|
|
+ sde_crtc_get_frame_data(crtc);
|
|
|
|
+ pm_runtime_put_sync(crtc->dev->dev);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (atomic_read(&sde_crtc->frame_pending) < 1) {
|
|
if (atomic_read(&sde_crtc->frame_pending) < 1) {
|
|
/* this should not happen */
|
|
/* this should not happen */
|
|
SDE_ERROR("crtc%d ts:%lld invalid frame_pending:%d\n",
|
|
SDE_ERROR("crtc%d ts:%lld invalid frame_pending:%d\n",
|
|
@@ -3168,11 +3167,17 @@ static void sde_crtc_frame_event_work(struct kthread_work *work)
|
|
SDE_ATRACE_END("signal_release_fence");
|
|
SDE_ATRACE_END("signal_release_fence");
|
|
}
|
|
}
|
|
|
|
|
|
- if (fevent->event & SDE_ENCODER_FRAME_EVENT_SIGNAL_RETIRE_FENCE)
|
|
|
|
|
|
+ if (fevent->event & SDE_ENCODER_FRAME_EVENT_SIGNAL_RETIRE_FENCE) {
|
|
|
|
+ if (sde_crtc->retire_frame_event_sf) {
|
|
|
|
+ sde_crtc->retire_frame_event_time = fevent->ts;
|
|
|
|
+ sysfs_notify_dirent(sde_crtc->retire_frame_event_sf);
|
|
|
|
+ }
|
|
|
|
+
|
|
/* this api should be called without spin_lock */
|
|
/* this api should be called without spin_lock */
|
|
_sde_crtc_retire_event(fevent->connector, fevent->ts,
|
|
_sde_crtc_retire_event(fevent->connector, fevent->ts,
|
|
(fevent->event & SDE_ENCODER_FRAME_EVENT_ERROR)
|
|
(fevent->event & SDE_ENCODER_FRAME_EVENT_ERROR)
|
|
? SDE_FENCE_SIGNAL_ERROR : SDE_FENCE_SIGNAL);
|
|
? SDE_FENCE_SIGNAL_ERROR : SDE_FENCE_SIGNAL);
|
|
|
|
+ }
|
|
|
|
|
|
if (fevent->event & SDE_ENCODER_FRAME_EVENT_PANEL_DEAD)
|
|
if (fevent->event & SDE_ENCODER_FRAME_EVENT_PANEL_DEAD)
|
|
SDE_ERROR("crtc%d ts:%lld received panel dead event\n",
|
|
SDE_ERROR("crtc%d ts:%lld received panel dead event\n",
|