From 41a8a0b4a06cfe4072985c7724b6189d59c610ca Mon Sep 17 00:00:00 2001 From: "jung-min.oh" Date: Wed, 21 Sep 2011 21:13:02 +0900 Subject: libhwcomposer: fix a bug fix a bug and add error handling code Change-Id: Ibe2c70cf6718a964b23b9832626613cc73855116 Signed-off-by: jung-min.oh --- libhwcomposer/SecHWC.cpp | 2 +- libhwcomposer/SecHWCUtils.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'libhwcomposer') diff --git a/libhwcomposer/SecHWC.cpp b/libhwcomposer/SecHWC.cpp index cbed30d..59736ed 100644 --- a/libhwcomposer/SecHWC.cpp +++ b/libhwcomposer/SecHWC.cpp @@ -150,7 +150,7 @@ static int get_hwc_compos_decision(hwc_layer_t* cur) return compositionType; if((prev_handle->usage & GRALLOC_USAGE_PHYS_CONTIG) && - (cur->blending = HWC_BLENDING_NONE)) + (cur->blending == HWC_BLENDING_NONE)) compositionType = HWC_OVERLAY; else compositionType = HWC_FRAMEBUFFER; diff --git a/libhwcomposer/SecHWCUtils.cpp b/libhwcomposer/SecHWCUtils.cpp index 7c89f47..c184348 100644 --- a/libhwcomposer/SecHWCUtils.cpp +++ b/libhwcomposer/SecHWCUtils.cpp @@ -388,6 +388,8 @@ int fimc_v4l2_clr_buf(int fd) int fimc_handle_oneshot(int fd, struct fimc_buf *fimc_buf) { + int ret =0; + if (fimc_v4l2_stream_on(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT) < 0) { LOGE("Fail : v4l2_stream_on()"); return -1; @@ -395,14 +397,17 @@ int fimc_handle_oneshot(int fd, struct fimc_buf *fimc_buf) if (fimc_v4l2_queue(fd, fimc_buf) < 0) { LOGE("Fail : v4l2_queue()"); - return -1; + ret = -1; + goto stream_off; } if (fimc_v4l2_dequeue(fd) < 0) { LOGE("Fail : v4l2_dequeue()"); - return -1; + ret = -1; + goto stream_off; } +stream_off: if (fimc_v4l2_stream_off(fd) < 0) { LOGE("Fail : v4l2_stream_off()"); return -1; @@ -413,7 +418,7 @@ int fimc_handle_oneshot(int fd, struct fimc_buf *fimc_buf) return -1; } - return 0; + return ret; } static int get_src_phys_addr(struct hwc_context_t *ctx, -- cgit v1.1