drm: msm: add support for ltm off event
Clients of local tone mapping engine need to know when hardware block was turned off, to enable mutually exclusively display features. Change adds support for ltm off event notification via custom event interface of drm. Change-Id: Ibfe2f85eadb0b939deee56194387b51b1e5ca8b9 Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
9e60a4854b
commit
097da1a65c
@@ -2899,6 +2899,7 @@ static void _sde_cp_crtc_enable_ltm_hist(struct sde_crtc *sde_crtc,
|
|||||||
sde_crtc->ltm_hist_en = true;
|
sde_crtc->ltm_hist_en = true;
|
||||||
hw_dspp->ops.setup_ltm_hist_ctrl(hw_dspp, hw_cfg,
|
hw_dspp->ops.setup_ltm_hist_ctrl(hw_dspp, hw_cfg,
|
||||||
true, addr);
|
true, addr);
|
||||||
|
SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
|
spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
|
||||||
}
|
}
|
||||||
@@ -2909,15 +2910,30 @@ static void _sde_cp_crtc_disable_ltm_hist(struct sde_crtc *sde_crtc,
|
|||||||
{
|
{
|
||||||
unsigned long irq_flags;
|
unsigned long irq_flags;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
bool notify = false;
|
||||||
|
u8 hist_off = 1;
|
||||||
|
struct drm_event event;
|
||||||
|
|
||||||
spin_lock_irqsave(&sde_crtc->ltm_lock, irq_flags);
|
spin_lock_irqsave(&sde_crtc->ltm_lock, irq_flags);
|
||||||
|
notify = sde_crtc->ltm_hist_en;
|
||||||
sde_crtc->ltm_hist_en = false;
|
sde_crtc->ltm_hist_en = false;
|
||||||
INIT_LIST_HEAD(&sde_crtc->ltm_buf_free);
|
INIT_LIST_HEAD(&sde_crtc->ltm_buf_free);
|
||||||
INIT_LIST_HEAD(&sde_crtc->ltm_buf_busy);
|
INIT_LIST_HEAD(&sde_crtc->ltm_buf_busy);
|
||||||
for (i = 0; i < sde_crtc->ltm_buffer_cnt; i++)
|
for (i = 0; i < sde_crtc->ltm_buffer_cnt; i++)
|
||||||
list_add(&sde_crtc->ltm_buffers[i]->node,
|
list_add(&sde_crtc->ltm_buffers[i]->node,
|
||||||
&sde_crtc->ltm_buf_free);
|
&sde_crtc->ltm_buf_free);
|
||||||
|
hw_dspp->ops.setup_ltm_hist_ctrl(hw_dspp, NULL,
|
||||||
|
false, 0);
|
||||||
spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
|
spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
|
||||||
|
event.type = DRM_EVENT_LTM_OFF;
|
||||||
|
event.length = sizeof(hist_off);
|
||||||
|
if (notify) {
|
||||||
|
SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
|
||||||
|
msm_mode_object_event_notify(&sde_crtc->base.base,
|
||||||
|
sde_crtc->base.dev, &event,
|
||||||
|
(u8 *)&hist_off);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sde_cp_ltm_hist_interrupt_cb(void *arg, int irq_idx)
|
static void sde_cp_ltm_hist_interrupt_cb(void *arg, int irq_idx)
|
||||||
@@ -3317,3 +3333,9 @@ static void _sde_cp_crtc_update_ltm_roi(struct sde_crtc *sde_crtc,
|
|||||||
|
|
||||||
sde_crtc->ltm_cfg = *cfg_param;
|
sde_crtc->ltm_cfg = *cfg_param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sde_cp_ltm_off_event_handler(struct drm_crtc *crtc_drm, bool en,
|
||||||
|
struct sde_irq_callback *hist_irq)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -182,4 +182,12 @@ int sde_cp_ltm_hist_interrupt(struct drm_crtc *crtc_drm, bool en,
|
|||||||
int sde_cp_ltm_wb_pb_interrupt(struct drm_crtc *crtc_drm, bool en,
|
int sde_cp_ltm_wb_pb_interrupt(struct drm_crtc *crtc_drm, bool en,
|
||||||
struct sde_irq_callback *hist_irq);
|
struct sde_irq_callback *hist_irq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sde_cp_ltm_off_event_handler: API to enable/disable LTM off notification
|
||||||
|
* @crtc: Pointer to crtc.
|
||||||
|
* @en: Variable to enable/disable notification.
|
||||||
|
* @irq: Pointer to irq callback
|
||||||
|
*/
|
||||||
|
int sde_cp_ltm_off_event_handler(struct drm_crtc *crtc_drm, bool en,
|
||||||
|
struct sde_irq_callback *hist_irq);
|
||||||
#endif /*_SDE_COLOR_PROCESSING_H */
|
#endif /*_SDE_COLOR_PROCESSING_H */
|
||||||
|
@@ -66,6 +66,7 @@ static struct sde_crtc_custom_events custom_events[] = {
|
|||||||
{DRM_EVENT_SDE_POWER, sde_crtc_pm_event_handler},
|
{DRM_EVENT_SDE_POWER, sde_crtc_pm_event_handler},
|
||||||
{DRM_EVENT_LTM_HIST, sde_cp_ltm_hist_interrupt},
|
{DRM_EVENT_LTM_HIST, sde_cp_ltm_hist_interrupt},
|
||||||
{DRM_EVENT_LTM_WB_PB, sde_cp_ltm_wb_pb_interrupt},
|
{DRM_EVENT_LTM_WB_PB, sde_cp_ltm_wb_pb_interrupt},
|
||||||
|
{DRM_EVENT_LTM_OFF, sde_cp_ltm_off_event_handler},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* default input fence timeout, in ms */
|
/* default input fence timeout, in ms */
|
||||||
|
Reference in New Issue
Block a user