Page 1 of 1

Can the screen be used in Landscape mode?

Posted: Wed Apr 26, 2017 4:52 am
by v8dave
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.

Re: Can the screen be used in Landscape mode?

Posted: Wed Apr 26, 2017 4:55 am
by davef
Is Qt involved?

Re: Can the screen be used in Landscape mode?

Posted: Wed Apr 26, 2017 5:34 am
by v8dave
davef wrote:
Is Qt involved?


No, Android with native coding in Android Studio.

Re: Can the screen be used in Landscape mode?

Posted: Tue Feb 20, 2018 5:43 am
by EndlessDelirium
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)

Re: Can the screen be used in Landscape mode?

Posted: Tue Feb 20, 2018 5:47 am
by v8dave
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.

Re: Can the screen be used in Landscape mode?

Posted: Wed Feb 21, 2018 8:15 am
by EndlessDelirium
That's certainly the easiest :lol:

Re: Can the screen be used in Landscape mode?

Posted: Wed May 02, 2018 6:31 am
by sylee0319
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.

Re: Can the screen be used in Landscape mode?

Posted: Mon May 07, 2018 12:50 pm
by v8dave
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.

Re: Can the screen be used in Landscape mode?

Posted: Sun Jan 27, 2019 6:30 pm
by JAGITA
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?

Re: Can the screen be used in Landscape mode?

Posted: Tue Jan 29, 2019 12:35 am
by v8dave
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.

Re: Can the screen be used in Landscape mode?

Posted: Thu Mar 28, 2019 4:40 pm
by KALIYATSIA
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?