Bug #693


Rotation doesn't work with display

Added by Hammel over 5 years ago. Updated about 1 year ago.

Target version:
Start date:
02 Mar 2019
Due date:
% Done:


Estimated time:
02 - High


Setting display_rotate=1 rotates the screen and but the display only uses about half the screen space.
Setting lcd_display_rotate=1 rotates the screen but not

xrandr also doesn't seem to work but it's possible it won't work without the VC4 driver loaded. This driver can break some things. There is an alternative driver, vc4-fkms-v3d available that may work better.


Related issues

Related to Xeon - Feature #699: Create launcher for phoneClosedHammel10 Mar 2019

Actions #1

Updated by Hammel over 5 years ago

  • % Done changed from 0 to 10

xorg.conf can rotate and does fill the screen:

Section "Device"                                  
        Identifier          "Builtin Default fbdev Device 0" 
        Driver              "fbturbo" 
        Option              "Rotate" "CW" 

But this needs to also have tslib rotated. Doing that requires adding "rot=1" to the linear filter in /etc/ts.conf. However, that didn't seem to work when I tried it. I still get the wrong coordinates passed in. I may need to tell the launcher that we're in rotated mode, or maybe tell the touchProcessor API that we're rotated.

Actions #2

Updated by Hammel about 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 10 to 30

I found a solution for rotation but it feels a bit like a hack. First, can be rotated by adding the following line to the Devices section for fbturbo.

Option              "Rotate" "CCW" 

Next, the launcher now has an -r option to enable rotation. If enabled, we swap the x and y coordinates and convert the new X to be the display height - the touch point. This means it only supports CCW rotations. That's the hack. It looks like this.

        if ( isCLIFlagSet( CLI_ROTATE) )
            piboxLogger(LOG_INFO, "Rotation is enabled.\n");
            posY = region->x;
            posX = piboxGetDisplayHeight() - region->y;
            posX = region->x;
            posY = region->y;

I didn't get the values I wanted from tslib when I told it to rotate. I still think using tslib's rotation option is the right solution so I'm going to keep working on that for a bit before committing the hack.

Actions #3

Updated by Hammel about 5 years ago

So I played with it a bit more and realized that I not only have to rotate but invert axis configurations, but the latter requires knowing the display size when the config is created. It's not really programmatic or generic (rotation is generic - it doesn't need to know display size). So using tslib configuration isn't really useful.

So for now, even though it's a hack, I'm going with my earlier fix. There's probably a better way to do this, like by adding a config file for libpibox's tslib support that knows to rotate properly. That's something I'll need to do for all apps eventually. For now it just needs to be available for the launcher.

Still need to commit and push.

Actions #4

Updated by Hammel about 5 years ago

  • Project changed from Xeon to libpibox
  • Target version deleted (v0.1)
  • % Done changed from 30 to 50

Committed and pushed.

Keeping it open (and moving to libpibox) till I migrate the solution to libpibox.

Actions #5

Updated by Hammel about 5 years ago

  • Target version set to 1.1.0 - Upgrades
Actions #6

Updated by Hammel over 4 years ago

  • Project changed from libpibox to Xeon
  • Target version deleted (1.1.0 - Upgrades)

Moving to Xeon since none of the other systems based on PiBox require this feature.

Actions #7

Updated by Hammel about 1 year ago

  • Status changed from In Progress to Rejected

Rejecting issue due to migration from custom hardware to PinePhone Pro.


Also available in: Atom PDF