summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2011-09-28 19:30:25 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-07-09 00:28:52 +0200
commitdb040b9e432b3684455f9dd76b3305255fea3db7 (patch)
tree9cf44581697eb797e64ed90756e895cc883c1d2d
parent7f743ba3cbe3aa390465e5fbc5528aaf01e01a93 (diff)
downloaddevice_samsung_crespo-db040b9e432b3684455f9dd76b3305255fea3db7.zip
device_samsung_crespo-db040b9e432b3684455f9dd76b3305255fea3db7.tar.gz
device_samsung_crespo-db040b9e432b3684455f9dd76b3305255fea3db7.tar.bz2
modified: camera (b&w preview and no postview for now), gralloc (enable plain alpha), added: libsamsung-ipc, corrected: debug.sf.hw.
Change-Id: Ib97907b6639611b73da38e4c1f1e298cdb1c8d2b
-rw-r--r--include/s3cfb.h142
-rw-r--r--libcamera/SecCameraHWInterface.cpp3
-rw-r--r--libgralloc/Android.mk3
-rw-r--r--libgralloc/framebuffer.cpp8
4 files changed, 156 insertions, 0 deletions
diff --git a/include/s3cfb.h b/include/s3cfb.h
new file mode 100644
index 0000000..90b49fc
--- /dev/null
+++ b/include/s3cfb.h
@@ -0,0 +1,142 @@
+/* linux/drivers/video/samsung/s3cfb.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * Header file for Samsung Display Driver (FIMD) driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef _S3CFB_H
+#define _S3CFB_H
+
+#ifdef __KERNEL__
+#include <linux/wait.h>
+#include <linux/mutex.h>
+#include <linux/fb.h>
+#ifdef CONFIG_HAS_WAKELOCK
+#include <linux/wakelock.h>
+#include <linux/earlysuspend.h>
+#endif
+#include <plat/fb.h>
+#endif
+
+/*
+ * C O M M O N D E F I N I T I O N S
+ *
+*/
+#define S3CFB_NAME "s3cfb"
+
+#define S3CFB_AVALUE(r, g, b) (((r & 0xf) << 8) | \
+ ((g & 0xf) << 4) | \
+ ((b & 0xf) << 0))
+#define S3CFB_CHROMA(r, g, b) (((r & 0xff) << 16) | \
+ ((g & 0xff) << 8) | \
+ ((b & 0xff) << 0))
+
+/*
+ * E N U M E R A T I O N S
+ *
+*/
+enum s3cfb_data_path_t {
+ DATA_PATH_FIFO = 0,
+ DATA_PATH_DMA = 1,
+ DATA_PATH_IPC = 2,
+};
+
+enum s3cfb_alpha_t {
+ PLANE_BLENDING,
+ PIXEL_BLENDING,
+};
+
+enum s3cfb_chroma_dir_t {
+ CHROMA_FG,
+ CHROMA_BG,
+};
+
+enum s3cfb_output_t {
+ OUTPUT_RGB,
+ OUTPUT_ITU,
+ OUTPUT_I80LDI0,
+ OUTPUT_I80LDI1,
+ OUTPUT_WB_RGB,
+ OUTPUT_WB_I80LDI0,
+ OUTPUT_WB_I80LDI1,
+};
+
+enum s3cfb_rgb_mode_t {
+ MODE_RGB_P = 0,
+ MODE_BGR_P = 1,
+ MODE_RGB_S = 2,
+ MODE_BGR_S = 3,
+};
+
+enum s3cfb_mem_owner_t {
+ DMA_MEM_NONE = 0,
+ DMA_MEM_FIMD = 1,
+ DMA_MEM_OTHER = 2,
+};
+
+/*
+ * S T R U C T U R E S F O R C U S T O M I O C T L S
+ *
+*/
+struct s3cfb_user_window {
+ int x;
+ int y;
+};
+
+struct s3cfb_user_plane_alpha {
+ int channel;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+};
+
+struct s3cfb_user_chroma {
+ int enabled;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+};
+
+struct s3cfb_next_info {
+ unsigned int phy_start_addr;
+ unsigned int xres; /* visible resolution*/
+ unsigned int yres;
+ unsigned int xres_virtual; /* virtual resolution*/
+ unsigned int yres_virtual;
+ unsigned int xoffset; /* offset from virtual to visible */
+ unsigned int yoffset; /* resolution */
+ unsigned int lcd_offset_x;
+ unsigned int lcd_offset_y;
+};
+
+/*
+ * C U S T O M I O C T L S
+ *
+*/
+#define S3CFB_WIN_POSITION _IOW('F', 203, \
+ struct s3cfb_user_window)
+#define S3CFB_WIN_SET_PLANE_ALPHA _IOW('F', 204, \
+ struct s3cfb_user_plane_alpha)
+#define S3CFB_WIN_SET_CHROMA _IOW('F', 205, \
+ struct s3cfb_user_chroma)
+#define S3CFB_SET_VSYNC_INT _IOW('F', 206, u32)
+#define S3CFB_GET_VSYNC_INT_STATUS _IOR('F', 207, u32)
+#define S3CFB_GET_LCD_WIDTH _IOR('F', 302, int)
+#define S3CFB_GET_LCD_HEIGHT _IOR('F', 303, int)
+#define S3CFB_SET_WRITEBACK _IOW('F', 304, u32)
+#define S3CFB_GET_CURR_FB_INFO _IOR('F', 305, struct s3cfb_next_info)
+#define S3CFB_SET_WIN_ON _IOW('F', 306, u32)
+#define S3CFB_SET_WIN_OFF _IOW('F', 307, u32)
+#define S3CFB_SET_WIN_PATH _IOW('F', 308, \
+ enum s3cfb_data_path_t)
+#define S3CFB_SET_WIN_ADDR _IOW('F', 309, unsigned long)
+#define S3CFB_SET_WIN_MEM _IOW('F', 310, \
+ enum s3cfb_mem_owner_t)
+
+#endif /* _S3CFB_H */
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 8a1275e..0987859 100644
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -507,6 +507,9 @@ int CameraHardwareSec::previewThread()
// Notify the client of a new frame.
if (mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) {
+ if (mExitPreviewThread || !mPreviewRunning)
+ return NO_ERROR;
+
mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, mCallbackCookie);
}
diff --git a/libgralloc/Android.mk b/libgralloc/Android.mk
index 74f3ce5..44c0746 100644
--- a/libgralloc/Android.mk
+++ b/libgralloc/Android.mk
@@ -22,6 +22,9 @@ LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/../include
+
LOCAL_SRC_FILES := \
gralloc.cpp \
framebuffer.cpp \
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 6a5497e..f155b54 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -35,6 +35,7 @@
#if HAVE_ANDROID_OS
#include <linux/fb.h>
+#include <s3cfb.h>
#endif
#include "gralloc_priv.h"
@@ -290,6 +291,13 @@ int mapFrameBufferLocked(struct private_module_t* module)
}
module->framebuffer->base = intptr_t(vaddr);
memset(vaddr, 0, fbSize);
+
+ struct s3cfb_user_plane_alpha user_alpha;
+
+ memset(&user_alpha, 0, sizeof(user_alpha));
+ if(ioctl(fd, S3CFB_WIN_SET_PLANE_ALPHA, &user_alpha) == -1)
+ return -errno;
+
return 0;
}