Power & Source of Big Ideas

Can the screen be used in Landscape mode?

Moderators: chensy, FATechsupport

Has anyone worked out if the screen can be used in Landscape mode?

I need to write a quick test programme to see if we can force this into landscape from code but wondering if anyone has done this already and can confirm it works?

I have a design from a previous Olimex board I want to port to the M3 and T3 and it would save me having to do new screen layouts in portrait if this was possible.
Is Qt involved?
davef wrote:
Is Qt involved?


No, Android with native coding in Android Studio.
The most easy way to achieve this is by using one of the many screen rotation apps from the play store, for example that one: https://play.google.com/store/apps/deta ... trol&hl=en

If you create your own app in Android Studio you can also mark your Activity to be landscape only in the manifest. See https://developer.android.com/guide/top ... tml#screen for more info.
Alternatively this can also be done by code: https://developer.android.com/reference ... tation(int)
Not required. I rebuild the kernel and Android OS from source so now it boots in landscape mode.

I also added GSM modem support so now also have data coverage outside WiFi areas.
That's certainly the easiest :lol:
v8dave wrote:
Not required. I rebuild the kernel and Android OS from source so now it boots in landscape mode.

I also added GSM modem support so now also have data coverage outside WiFi areas.


Our LCD device is 480x854.
I've swapped xresol/yresol in kernel frame buffer source code,(not changing cpu MLC resolution register value)
so that it is reported to android to 854 x 480 and make android to prepare screen with landscape mode correctly.
So that when the buffer is actually displayed to frame buffer hardware we rotate 90 degree in android source code by modifiing the following source codes:

DisplayDevice.cpp::DisplayDevice() constructor source

In that constructor setProjection() method is called with orientation 90 degree.
But the screen is not displayed correctly in landscape mode.

Can you let me know the source code list to change?
Or if patch file is available that will be do enough too for me.

Thank you.
I am overseas just now but I will post a link to the source for you and details of how to change it on my return next week.
sylee0319 wrote:
v8dave wrote:
Not required. I rebuild the kernel and Android OS from source so now it boots in landscape mode.

I also added GSM modem support so now also have data coverage outside WiFi areas.


Our LCD device is 480x854.
I've swapped xresol/yresol in kernel frame buffer source code,(not changing cpu MLC resolution register value)
so that it is reported to android to 854 x 480 and make android to prepare screen with landscape mode correctly.
So that when the buffer is actually displayed to frame buffer hardware we rotate 90 degree in android source code by modifiing the following source codes: Sarkari Result TurboTax Rufus
DisplayDevice.cpp::DisplayDevice() constructor source

In that constructor setProjection() method is called with orientation 90 degree.
But the screen is not displayed correctly in landscape mode.

Can you let me know the source code list to change?
Or if patch file is available that will be do enough too for me.

Thank you.

Has anyone worked out if the screen can be used in Landscape mode?
JAGITA wrote:
Has anyone worked out if the screen can be used in Landscape mode?


Yes, it can but you will need to build from source to do it. I got this code below from FriendlyArm on what needs to be changed on the code to set the display to Landscape for the T3 and T3 Plus.

The flasher will still be in portrait but the final Android build will be in landscape after it boots.

Code: Select all

1、Open framework/base/core/res/res/values/config.xml
    Modify config_lidOpenRotation = 0 ;----> config_lidOpenRotation = 90 ;
2、Open framework/base/services/core/java/com/android/server/wm/WindowMangerService.java
    Modify int mRotation = 0 ;-----> int mRotation = 1 ;
3、Open framework/base/services/surfaceflinger/DisplayDevice.cpp
    Modify setProjection(Displaystate::eOrientationDefault, mViewprot ,mFrame )------>
   setProjection( Displaystate::eOrientation90 ,mViewprot , mFrame )
Compile the  source code and fuse successfully, booting the board, but there will be a problem, you can modify as following:

1、Open framework/base/cmds/bootanimation/BootAnimation.cpp
    Modify 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);
2、/framework/native/services/surfaceflinger/DisplayDevice.cpp
   void DisplayDevice::setProjection(intorientation, conts Rect&newViewport,constRect&newFrame)中
if(!frame.isValid()){
frame = Rect(w,h);----->frame = Rect(h,w);
}
Add this code under Transform R:
 orientation = DisplayState::eorientation90
   
3、/framework/native/services/surfaceflinger/surfaceFlinger.cpp
    voidSurfaceFlinger::onInitializeDisplay():
d.orientation = DisplayState::eOrientationDefault ;----->d.orientation=DisplayState::eOrientatio90;

Compile the source code again.
sylee0319 wrote:
v8dave wrote:
Not required. I rebuild the kernel and Android OS from source so now it boots in landscape mode.

I also added GSM modem support so now also have data coverage outside WiFi areas.


Our LCD device is 480x854.
I've swapped xresol/yresol in kernFileZilla Malwarebytes Rufusel frame buffer source code,(not changing cpu MLC resolution register value)
so that it is reported to android to 854 x 480 and make android to prepare screen with landscape mode correctly.
So that when the buffer is actually displayed to frame buffer hardware we rotate 90 degree in android source code by modifiing the following source codes:

DisplayDevice.cpp::DisplayDevice() constructor source

In that constructor setProjection() method is called with orientation 90 degree.
But the screen is not displayed correctly in landscape mode.

Can you let me know the source code list to change?
Or if patch file is available that will be do enough too for me.

Thank you.

I need to write a quick test programme to see if we can force this into landscape from code but wondering if anyone has done this already and can confirm it works?

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 4 guests