android Q System Rotation problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

android Q System Rotation problem

958 Views
aber
Contributor III

Hi 

    We need to rotate 180° the system on android10. For reference https://community.nxp.com/t5/i-MX-Processors/Android-10-i-MX8MMini-g2d-rotation-issue/m-p/1187205#M1... , the system can rotate normally but the playing video cannot be rotated. Is there a good solution?

 

Tks!

0 Kudos
3 Replies

944 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello aber,

 

If the patch does not work for you?, sorry this will be add it to the next android, however You can try to modify "info.orientation = 0;" to other value, which shown below code:

for (const auto& hwConfig : getHwComposer().getConfigs(type)) {
        DisplayInfo info = DisplayInfo();

        float xdpi = hwConfig->getDpiX();
        float ydpi = hwConfig->getDpiY();

        if (type == DisplayDevice::DISPLAY_PRIMARY) {
            // The density of the device is provided by a build property
            float density = Density::getBuildDensity() / 160.0f;
            if (density == 0) {
                // the build doesn't provide a density -- this is wrong!
                // use xdpi instead
                ALOGE("ro.sf.lcd_density must be defined as a build property");
                density = xdpi / 160.0f;
            }
            if (Density::getEmuDensity()) {
                // if "qemu.sf.lcd_density" is specified, it overrides everything
                xdpi = ydpi = density = Density::getEmuDensity();
                density /= 160.0f;
            }
            info.density = density;

            // TODO: this needs to go away (currently needed only by webkit)
            sp<const DisplayDevice> hw(getDefaultDisplayDeviceLocked());
            info.orientation = hw ? hw->getOrientation() : 0;
        } else {
            // TODO: where should this value come from?
            static const int TV_DENSITY = 213;
            info.density = TV_DENSITY / 160.0f;
            info.orientation = 0;
        }

 

Regards

 

0 Kudos

843 Views
aber
Contributor III

Hello  Bio_TICFSL

  My problem is still unresolved, and I found that the problem is similar to the one I encountered after searching the forum. Our default mipi resolution is 800x1280, which may be the cause of the problem。

https://community.nxp.com/t5/i-MX-Processors/How-To-Rotate-90-Degree-Video-For-Display-In-I-MX8X/m-p...

 

0 Kudos

938 Views
aber
Contributor III

Hi  Bio_TICFSL

Thank you for replying in your busy schedule. According to your prompt, I modified it and it didn't work. The video playback interface is the other way around.

info.orientation I am forced to modify it to 2 。The source code is based on Q10.0.0_2.5.0

diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 535e5029e..32e609e57 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -840,6 +840,7 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& displayToken,
info.density = TV_DENSITY / 160.0f;
info.orientation = 0;
}
+ info.orientation = 2;

info.xdpi = xdpi;
info.ydpi = ydpi;

 

0 Kudos