msm: vidc: Adds new event type
Adds new event type to convey about the resources
requirement.
Change-Id: I7ea67231c247dc983463a02b828c10adc486b60d
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
diff --git a/drivers/media/video/msm_vidc/msm_vidc_common.c b/drivers/media/video/msm_vidc/msm_vidc_common.c
index ba5fdc4..a5cff9c 100644
--- a/drivers/media/video/msm_vidc/msm_vidc_common.c
+++ b/drivers/media/video/msm_vidc/msm_vidc_common.c
@@ -25,6 +25,11 @@
__rc; \
})
+#define V4L2_EVENT_SEQ_CHANGED_SUFFICIENT \
+ V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_SUFFICIENT
+#define V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT \
+ V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_INSUFFICIENT
+
struct msm_vidc_core *get_vidc_core(int core_id)
{
struct msm_vidc_core *core;
@@ -199,9 +204,20 @@
struct msm_vidc_cb_event *event_notify;
if (response) {
inst = (struct msm_vidc_inst *)response->session_id;
- dqevent.type = V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED;
dqevent.id = 0;
event_notify = (struct msm_vidc_cb_event *) response->data;
+ switch (event_notify->hal_event_type) {
+ case HAL_EVENT_SEQ_CHANGED_SUFFICIENT_RESOURCES:
+ dqevent.type =
+ V4L2_EVENT_SEQ_CHANGED_SUFFICIENT;
+ break;
+ case HAL_EVENT_SEQ_CHANGED_INSUFFICIENT_RESOURCES:
+ dqevent.type =
+ V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
+ break;
+ default:
+ break;
+ }
inst->reconfig_height = event_notify->height;
inst->reconfig_width = event_notify->width;
inst->in_reconfig = true;
diff --git a/drivers/media/video/msm_vidc/vidc_hal_api.h b/drivers/media/video/msm_vidc/vidc_hal_api.h
index b3ea92a..332bbac 100644
--- a/drivers/media/video/msm_vidc/vidc_hal_api.h
+++ b/drivers/media/video/msm_vidc/vidc_hal_api.h
@@ -793,6 +793,12 @@
HAL_UNUSED_FLUSH = 0x10000000,
};
+enum hal_event_type {
+ HAL_EVENT_SEQ_CHANGED_SUFFICIENT_RESOURCES,
+ HAL_EVENT_SEQ_CHANGED_INSUFFICIENT_RESOURCES,
+ HAL_UNUSED_SEQCHG = 0x10000000,
+};
+
/* HAL Response */
enum command_response {
@@ -843,6 +849,7 @@
u32 status;
u32 height;
u32 width;
+ u32 hal_event_type;
};
/* Data callback structure */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 63ebdea..42f7349 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2296,10 +2296,13 @@
#define V4L2_EVENT_PRIVATE_START 0x08000000
#define V4L2_EVENT_MSM_VIDC_START (V4L2_EVENT_PRIVATE_START + 0x00001000)
-#define V4L2_EVENT_MSM_VIDC_FLUSH_DONE (V4L2_EVENT_PRIVATE_START + 1)
-#define V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED \
- (V4L2_EVENT_PRIVATE_START + 2)
-#define V4L2_EVENT_MSM_VIDC_CLOSE_DONE (V4L2_EVENT_PRIVATE_START + 3)
+#define V4L2_EVENT_MSM_VIDC_FLUSH_DONE (V4L2_EVENT_MSM_VIDC_START + 1)
+#define V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_SUFFICIENT \
+ (V4L2_EVENT_MSM_VIDC_START + 2)
+#define V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_INSUFFICIENT \
+ (V4L2_EVENT_MSM_VIDC_START + 3)
+#define V4L2_EVENT_MSM_VIDC_CLOSE_DONE (V4L2_EVENT_MSM_VIDC_START + 4)
+
/* Payload for V4L2_EVENT_VSYNC */
struct v4l2_event_vsync {