MTK 屏幕旋轉90度

http://blog.csdn.net/ouo555/article/details/44806837

1.屏幕顯示順時針旋轉90度

lk 橫屏logo,順時針旋轉90度顯示修改
bootable/bootloader/lk/project/len6735_65u_vo.mkjava

BOOT_LOGO = wxganl  
MTK_LCM_PHYSICAL_ROTATION = 90 

framebuffer順時針旋轉90度的修改:android

device/lentek/len6735_65u_vo/ProjectConfig.mksession

MTK_LCM_PHYSICAL_ROTATION = 90

 

2.觸摸屏上報座標映射

因爲LCD顯示旋轉了90度,對應的觸摸屏上報座標的也須要從新進行映射:
sudo subl ./kernel-3.10/drivers/input/touchscreen/mediatek/GT9XX/focaltech_core.c中修改static int fts_report_value(struct ts_event *data)
            input_report_abs(tpd->dev, ABS_MT_POSITION_X, data->au16_x[i]);//delete by dh
            input_report_abs(tpd->dev, ABS_MT_POSITION_Y, data->au16_y[i]);//delete by dh
            touchs |= BIT(data->au8_finger_id[i]);
            data->touchs |= BIT(data->au8_finger_id[i]);

3.重力傳感器方向修改

因爲屏幕默認顯示方向逆時針旋轉90度,默認的重力傳感器的方向也須要對應修改:kernel-3.10/drivers/misc/mediatek/mach/mt6735/len6735_65u_vo/accelerometer/mc3xxx_auto/mc3xxx_cust_acc.c
static struct acc_hw mc3xxx_cust_acc_hw = { .i2c_num = 2, //.direction = 4, 
     .direction = 7, .power_id = MT65XX_POWER_NONE,  /*!< LDO is not used */ .power_vol= VOL_DEFAULT,        /*!< LDO is not used */ .firlen = 0, //old value 16 /*!< don't enable low pass fileter */ 
     .is_batch_supported = false, }; 

4.默認屏幕方向設置函數

進入framework/base/services/core/java/com/android/server/wm/WindowMangerService.java動畫

修改int mRotation = 0 ;爲:
int mRotation = 1 ;

 

五、開機動畫顯示半屏的緣由,也旋轉90度spa

修改frameworks/native/services/surfaceflinger/DisplayDevice.cpp.net

setProjection(DisplayState::eOrientation90, mViewport, mFrame);

6.編譯成功刷入系統會出現開機動畫部分只顯示3/4解決方案以下: code

進入framework/base/cmds/bootanimation/BootAnimation.cpporm

修改status_t BootAnimation::readyToRun函數中的 spcontrol=session()- >createsurface(String8("BootAnimation"),dinfo.w,dinfo.h.PIXEL_FORMAT_RGB_565); 爲: spcontrol=session()- >createsurface(String8"BootAnimation"),dinfo.h,dinfo.w.PIXEL_FORMAT_RGB_565);

進入/framework/native/services/surfaceflinger/DisplayDevice.cppserver

修改函數 void DisplayDevice::setProjection(intorientation, conts Rect&newViewport,constRect&newFrame)中 if(!frame.isValid()){ frame = Rect(w,h);爲:
frame = Rect(h,w); }

 在Transform R;  下面添加
    orientation = DisplayState::eorientation90;
 

進入/framework/native/services/surfaceflinger/SurfaceFlinger.cpp

修改函數voidSurfaceFlinger::onInitializeDisplay()中: d.orientation = DisplayState::eOrientationDefault ;爲:
d.orientation=DisplayState::eOrientatio90;

 7.開機動畫顯示任然豎屏一下子的問題

進入PhoneWindowManager.java文件 5993行修改默認返回值

public class PhoneWindowManager implements WindowManagerPolicy { if (preferredRotation >= 0) { return preferredRotation; } -                    return Surface.ROTATION_0; +                    return Surface.ROTATION_90; }
相關文章
相關標籤/搜索