vpp: don't overwrite on_pending state when enable vd layer [1/1]
authorBrian Zhu <brian.zhu@amlogic.com>
Tue, 16 Apr 2019 18:35:27 +0000 (02:35 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 18 Apr 2019 02:11:42 +0000 (19:11 -0700)
PD#OTT-3244

Problem:
When vd layer state is on_pending, calling enable videolayer
function will overwrite the state. Then it will not enable video
layer really.

Solution:
Add the judgement to check if the state is on_pending.

Verify:
verified on W400

Change-Id: I0513a6610fdb108bec05858c7f6c7976be5e7edb
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
drivers/amlogic/media/video_sink/video.c

index 664b2ee..ceadb2b 100644 (file)
@@ -322,7 +322,8 @@ static u32 frame_detect_drop_count;
        do { \
                unsigned long flags; \
                spin_lock_irqsave(&video_onoff_lock, flags); \
-               video_onoff_state = VIDEO_ENABLE_STATE_ON_REQ; \
+               if (video_onoff_state != VIDEO_ENABLE_STATE_ON_PENDING) \
+                       video_onoff_state = VIDEO_ENABLE_STATE_ON_REQ; \
                video_enabled = 1; \
                video_status_saved = 1; \
                spin_unlock_irqrestore(&video_onoff_lock, flags); \
@@ -342,7 +343,8 @@ static u32 frame_detect_drop_count;
        do { \
                unsigned long flags; \
                spin_lock_irqsave(&video2_onoff_lock, flags); \
-               video2_onoff_state = VIDEO_ENABLE_STATE_ON_REQ; \
+               if (video2_onoff_state != VIDEO_ENABLE_STATE_ON_PENDING) \
+                       video2_onoff_state = VIDEO_ENABLE_STATE_ON_REQ; \
                video2_enabled = 1; \
                video2_status_saved = 1; \
                spin_unlock_irqrestore(&video2_onoff_lock, flags); \