[system/displayd] rk3228 not use overscan here

This commit is contained in:
Firefly
2015-12-02 15:58:53 +08:00
committed by cjp
parent f3d468f828
commit de4a1869c3
2 changed files with 21 additions and 14 deletions

View File

@ -35,17 +35,17 @@ ScreenScaleManager::ScreenScaleManager() {
overscan_top = DEFALUT_SCREEN_SCALE;
if(overscan_bottom == 0)
overscan_bottom = DEFALUT_SCREEN_SCALE;
memset(property, 0, PROPERTY_VALUE_MAX);
sprintf(property, "overscan %d,%d,%d,%d", overscan_left, overscan_top, overscan_right, overscan_bottom);
// write(fd, property, strlen(property));
// write(fd, property, strlen(property));
close(fd);
property_set(PROPETY_OVERSCAN_MAIN, property);
}
fd = open(AuxDisplaySysNode, O_RDWR, 0);
if(fd > 0) {
if (property_get(PROPETY_OVERSCAN_AUX, property, NULL) > 0)
sscanf(property, "overscan %d,%d,%d,%d", &overscan_left, &overscan_top, &overscan_right, &overscan_bottom);
sscanf(property, "overscan %d,%d,%d,%d", &overscan_left, &overscan_top, &overscan_right, &overscan_bottom);
if(overscan_left == 0)
overscan_left = DEFALUT_SCREEN_SCALE;
@ -57,7 +57,7 @@ ScreenScaleManager::ScreenScaleManager() {
overscan_bottom = DEFALUT_SCREEN_SCALE;
memset(property, 0, PROPERTY_VALUE_MAX);
sprintf(property, "overscan %d,%d,%d,%d", overscan_left, overscan_top, overscan_right, overscan_bottom);
// write(fd, property, strlen(property));
// write(fd, property, strlen(property));
close(fd);
property_set(PROPETY_OVERSCAN_AUX, property);
}
@ -66,12 +66,12 @@ ScreenScaleManager::ScreenScaleManager() {
void ScreenScaleManager::InitSysNode(void) {
memset(MainDisplaySysNode, 0, 64);
memset(AuxDisplaySysNode, 0, 64);
char const * const device_template = "/sys/class/graphics/fb%u/lcdcid";
FILE *fd = NULL;
int i = 0, id = 0, id_fb0 = -1;
char name[64];
do
{
ALOGD("i is %d", i);
@ -94,12 +94,12 @@ void ScreenScaleManager::InitSysNode(void) {
}
i++;
} while (fd != NULL);
if(strlen(MainDisplaySysNode) == 0)
strcpy(MainDisplaySysNode, MAIN_DISPLAY_SCALE_FILE);
// if(strlen(AuxDisplaySysNode) == 0) {
// strcpy(AuxDisplaySysNode, AUX_DISPLAY_SCALE_FILE);
// }
// if(strlen(AuxDisplaySysNode) == 0) {
// strcpy(AuxDisplaySysNode, AUX_DISPLAY_SCALE_FILE);
// }
ALOGD("MainDisplaySysNode is %s", MainDisplaySysNode);
ALOGD("AuxDisplaySysNode is %s", AuxDisplaySysNode);
}
@ -111,14 +111,14 @@ int ScreenScaleManager::SSMReadCfg() {
void ScreenScaleManager::SSMCtrl(int display, int direction, int scalevalue) {
int fd = -1;
char property[PROPERTY_VALUE_MAX];
ALOGD("[%s] display %d, direction %d rate %d\n", __FUNCTION__, display, direction, scalevalue);
if(display == 0)
fd = open(MainDisplaySysNode, O_RDWR, 0);
else
fd = open(AuxDisplaySysNode, O_RDWR, 0);
if(fd < 0) return;
if (direction == DISPLAY_OVERSCAN_X) {
overscan_left = scalevalue;
overscan_right = scalevalue;
@ -139,10 +139,15 @@ void ScreenScaleManager::SSMCtrl(int display, int direction, int scalevalue) {
overscan_top = scalevalue;
overscan_bottom = scalevalue;
}
memset(property, 0, PROPERTY_VALUE_MAX);
sprintf(property, "overscan %d,%d,%d,%d", overscan_left, overscan_top, overscan_right, overscan_bottom);
#ifdef RK3228
//write(fd, property, strlen(property));
#else
write(fd, property, strlen(property));
#endif
close(fd);
if(display == 0)
property_set(PROPETY_OVERSCAN_MAIN, property);