Project

General

Profile

Actions

Bug #693

closed

Rotation doesn't work with display

Added by Hammel about 5 years ago. Updated 11 months ago.

Status:
Rejected
Priority:
Immediate
Assignee:
Target version:
-
Start date:
02 Mar 2019
Due date:
% Done:

50%

Estimated time:
Severity:
02 - High

Description

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

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.

Also:

Related issues

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

Actions
Actions #1

Updated by Hammel about 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" 
EndSection

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, X.org 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;
        }
        else
        {   
            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 11 months ago

  • Status changed from In Progress to Rejected

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

Actions

Also available in: Atom PDF