Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update android 5.0. #1

Open
wants to merge 1 commit into
base: lp5.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions cmhw/org/cyanogenmod/hardware/AdaptiveBacklight.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (C) 2013 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.cyanogenmod.hardware;

import org.cyanogenmod.hardware.util.FileUtils;

import android.os.SystemProperties;

import java.io.File;

/**
* Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer,
* QCOM CABL or Samsung CABC).
*/
public class AdaptiveBacklight {

private static String FILE_CABC = SystemProperties.get("ro.cm.hardware.cabc", "/sys/class/lcd/panel/power_reduce");

/**
* Whether device supports an adaptive backlight technology.
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
File f = new File(FILE_CABC);
return f.exists();
}

/**
* This method return the current activation status of the adaptive backlight technology.
*
* @return boolean Must be false when adaptive backlight is not supported or not activated, or
* the operation failed while reading the status; true in any other case.
*/
public static boolean isEnabled() {
if (Integer.parseInt(FileUtils.readOneLine(FILE_CABC)) == 1) {
return true;
} else {
return false;
}
}

/**
* This method allows to setup adaptive backlight technology status.
*
* @param status The new adaptive backlight status
* @return boolean Must be false if adaptive backlight is not supported or the operation
* failed; true in any other case.
*/
public static boolean setEnabled(boolean status) {
if (status == true) {
return FileUtils.writeLine(FILE_CABC, "1");
} else {
return FileUtils.writeLine(FILE_CABC, "0");
}
}
}
93 changes: 93 additions & 0 deletions cmhw/org/cyanogenmod/hardware/HighTouchSensitivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2014 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.cyanogenmod.hardware;

import org.cyanogenmod.hardware.util.FileUtils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import android.util.Log;

/**
* Glove mode / high touch sensitivity
*/
public class HighTouchSensitivity {

private static String TAG = "HighTouchSensitivity";

private static String COMMAND_PATH = "/sys/class/sec/tsp/cmd";
private static String COMMAND_LIST_PATH = "/sys/class/sec/tsp/cmd_list";
private static String COMMAND_RESULT_PATH = "/sys/class/sec/tsp/cmd_result";
private static String GLOVE_MODE = "glove_mode";
private static String GLOVE_MODE_ENABLE = "glove_mode,1";
private static String GLOVE_MODE_DISABLE = "glove_mode,0";
private static String STATUS_OK = ":OK";

/**
* Whether device supports high touch sensitivity.
*
* @return boolean Supported devices must return always true
*/
public static boolean isSupported() {
File f = new File(COMMAND_PATH);
if (f.exists()) {
BufferedReader reader = null;
try {
String currentLine;
reader = new BufferedReader(new FileReader(COMMAND_LIST_PATH));
while ((currentLine = reader.readLine()) != null) {
if (GLOVE_MODE.equals(currentLine))
return true;
}
} catch (IOException e) {
// Ignore exception, will be false anyway
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
// Ignore exception, no recovery possible
}
}
}
}
return false;
}

/** This method returns the current activation status of high touch sensitivity
*
* @return boolean Must be false if high touch sensitivity is not supported or not activated,
* or the operation failed while reading the status; true in any other case.
*/
public static boolean isEnabled() {
return FileUtils.readOneLine(COMMAND_RESULT_PATH).equals(GLOVE_MODE_ENABLE + STATUS_OK);
}

/**
* This method allows to setup high touch sensitivity status.
*
* @param status The new high touch sensitivity status
* @return boolean Must be false if high touch sensitivity is not supported or the operation
* failed; true in any other case.
*/
public static boolean setEnabled(boolean status) {
return FileUtils.writeLine(COMMAND_PATH, status ? GLOVE_MODE_ENABLE : GLOVE_MODE_DISABLE);
}
}
95 changes: 95 additions & 0 deletions cmhw/org/cyanogenmod/hardware/VibratorHW.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright (C) 2013 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.cyanogenmod.hardware;

import org.cyanogenmod.hardware.util.FileUtils;

import java.io.File;

public class VibratorHW {

private static String LEVEL_PATH = "/sys/class/timed_output/vibrator/pwm_value";
private static String LEVEL_MAX_PATH = "/sys/class/timed_output/vibrator/pwm_max";
private static String LEVEL_MIN_PATH = "/sys/class/timed_output/vibrator/pwm_min";
private static String LEVEL_DEFAULT_PATH = "/sys/class/timed_output/vibrator/pwm_default";
private static String LEVEL_THRESHOLD_PATH = "/sys/class/timed_output/vibrator/pwm_threshold";

public static boolean isSupported() {
File f = new File(LEVEL_PATH);
return f.exists();
}

public static int getMaxIntensity() {
File f = new File(LEVEL_MAX_PATH);

if(f.exists()) {
return Integer.parseInt(FileUtils.readOneLine(LEVEL_MAX_PATH));
} else {
return 100;
}
}

public static int getMinIntensity() {
File f = new File(LEVEL_MIN_PATH);

if(f.exists()) {
return Integer.parseInt(FileUtils.readOneLine(LEVEL_MIN_PATH));
} else {
return 0;
}
}

public static int getWarningThreshold() {
File f = new File(LEVEL_THRESHOLD_PATH);

if(f.exists()) {
return Integer.parseInt(FileUtils.readOneLine(LEVEL_THRESHOLD_PATH));
} else {
return 75;
}
}

public static int getCurIntensity() {
File f = new File(LEVEL_PATH);

if(f.exists()) {
return Integer.parseInt(FileUtils.readOneLine(LEVEL_PATH));
} else {
return 0;
}
}

public static int getDefaultIntensity() {
File f = new File(LEVEL_DEFAULT_PATH);

if(f.exists()) {
return Integer.parseInt(FileUtils.readOneLine(LEVEL_DEFAULT_PATH));
} else {
return 50;
}
}

public static boolean setIntensity(int intensity) {
File f = new File(LEVEL_PATH);

if(f.exists()) {
return FileUtils.writeLine(LEVEL_PATH, String.valueOf(intensity));
} else {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define SEC_LOG_OFF
#include "SEC_OSAL_Log.h"

#define H264_DEC_NUM_OF_EXTRA_BUFFERS 7
#define H264_DEC_NUM_OF_EXTRA_BUFFERS 1

#ifdef S3D_SUPPORT
#define ADD_SPS_PPS_I_FRAME
Expand Down
Empty file modified exynos3/s5pc110/include/s3c_bc.h
100644 → 100755
Empty file.
Empty file modified exynos3/s5pc110/include/s3c_mem.h
100644 → 100755
Empty file.
Empty file modified exynos3/s5pc110/include/s5p_fimc.h
100644 → 100755
Empty file.
Empty file modified exynos3/s5pc110/include/sec_format.h
100644 → 100755
Empty file.
Empty file modified exynos3/s5pc110/include/sec_lcd.h
100644 → 100755
Empty file.
21 changes: 19 additions & 2 deletions exynos3/s5pc110/include/sec_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ inline int HAL_PIXEL_FORMAT_2_V4L2_PIX(int HAL_PIXEL_FORMAT)
//V4L2_PIX = V4L2_PIX_FMT_BGR32; // this is not proper on fimc.
V4L2_PIX = V4L2_PIX_FMT_RGB32;
break;

case HAL_PIXEL_FORMAT_RGBA_5551:
V4L2_PIX = V4L2_PIX_FMT_RGB555X;
break;

case HAL_PIXEL_FORMAT_RGBA_4444:
V4L2_PIX = V4L2_PIX_FMT_RGB444;
break;

case HAL_PIXEL_FORMAT_YV12:
case HAL_PIXEL_FORMAT_YCbCr_420_P:
V4L2_PIX = V4L2_PIX_FMT_YUV420;
Expand Down Expand Up @@ -153,6 +162,14 @@ inline int V4L2_PIX_2_HAL_PIXEL_FORMAT(int V4L2_PIX)
HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_BGRA_8888;
break;

case V4L2_PIX_FMT_RGB555X:
HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_5551;
break;

case V4L2_PIX_FMT_RGB444:
HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_4444;
break;

case V4L2_PIX_FMT_YUV420:
//HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YV12;
HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YCbCr_420_P;
Expand Down Expand Up @@ -228,7 +245,7 @@ inline unsigned int FRAME_SIZE(int HAL_PIXEL_FORMAT, int w, int h)
switch (HAL_PIXEL_FORMAT) {
// 16bpp
case HAL_PIXEL_FORMAT_RGB_565:
//case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_5551:
//case HAL_PIXEL_FORMAT_ARGB_1555:
//case HAL_PIXEL_FORMAT_BGRA_5551:
//case HAL_PIXEL_FORMAT_ABGR_1555:
Expand All @@ -238,7 +255,7 @@ inline unsigned int FRAME_SIZE(int HAL_PIXEL_FORMAT, int w, int h)
//case HAL_PIXEL_FORMAT_BGRX_5551:
//case HAL_PIXEL_FORMAT_XBGR_1555:

//case HAL_PIXEL_FORMAT_RGBA_4444:
case HAL_PIXEL_FORMAT_RGBA_4444:
//case HAL_PIXEL_FORMAT_ARGB_4444:
//case HAL_PIXEL_FORMAT_BGRA_4444:
//case HAL_PIXEL_FORMAT_ABGR_4444:
Expand Down
Empty file modified exynos3/s5pc110/include/videodev2_samsung.h
100644 → 100755
Empty file.
8 changes: 7 additions & 1 deletion exynos3/s5pc110/power/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,17 @@ static void s5pc110_power_hint(struct power_module *module, power_hint_t hint,
struct s5pc110_power_module *s5pc110 = (struct s5pc110_power_module *) module;
char buf[80];
int len;
int duration = 1;

switch (hint) {
case POWER_HINT_INTERACTION:
case POWER_HINT_CPU_BOOST:
if (boostpulse_open(s5pc110) >= 0) {
len = write(s5pc110->boostpulse_fd, "1", 1);
if (data != NULL)
duration = (int) data;

snprintf(buf, sizeof(buf), "%d", duration);
len = write(s5pc110->boostpulse_fd, buf, strlen(buf));

if (len < 0) {
strerror_r(errno, buf, sizeof(buf));
Expand Down
2 changes: 1 addition & 1 deletion exynos3/s5pc110/sec_mm/sec_omx/sec_codecs/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ include $(SEC_CODECS)/video/mfc_c110/dec/Android.mk
include $(SEC_CODECS)/video/mfc_c110/enc/Android.mk
include $(SEC_CODECS)/video/mfc_c110/csc/Android.mk

ifeq ($(TARGET_SEC_OMX_BIG_MMAP_BUFFER_SIZE),true)
ifneq ($(TARGET_SEC_OMX_BIG_MMAP_BUFFER_SIZE),true)
LOCAL_CFLAGS += -DBIG_MMAP_BUFFER_SIZE
endif
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifdef BIG_MMAP_BUFFER_SIZE
#define MMAP_BUFFER_SIZE_MMAP (62*1024*1024)
#else
#define MMAP_BUFFER_SIZE_MMAP (20*1024*1024)
#define MMAP_BUFFER_SIZE_MMAP (35328*1024) // 34.5*1024*1024
#endif // BIG_MMAP_BUFFER_SIZE

#define S5PC110_MFC_DEV_NAME "/dev/s3c-mfc"
Expand Down
Loading