Linux Luban cat screen and touch [Switch the screen to MIPI-1080P when using Luban cat for the first time] [Rotate the screen to horizontal screen display] [Permanently modify the screen and touch direction]

First use Luban cat to switch the screen to MIPI-1080P

Luban cat information:
boards are purchased from the following address: https://detail.tmall.com/item.htm?_u=110jcean66aa&id=694560455663&spm=a1z09.2.0.0.56f52e8dj4eUdI&skuId=5156903694777
Luban cat official documents and tutorials: https:// doc.embedfire.com/linux/rk356x/quick_start/zh/latest/quick_start/lubancat/lubancat.htmlVideo
tutorial: https://space.bilibili.com/356820657/channel/collectiondetail?sid=1352573
The physical picture of the board is as follows:
insert image description here
Burn the Luban cat image
According to the video tutorial, here use EMMC to burn the image, select the following image: insert image description here
E:\Study\Luban cat\3-Linux image\Debian system image\universal image (extboot)-applicable to all boards\ 20230712\LubanCat-rk3566\lubancat-rk3566-debian10-xfce-20230712_update\lubancat-rk3566-debian10-xfce-20230712_update.img
Note: Short circuit the MR point first, and then power on again. At this time, the software can recognize the MASKROM device (as shown above ), then disconnect the MR point, and then click the upgrade button to burn the
image. After successful burning, you can see the following print indicating that the system is running, but because the default screen uses HDMI, and the screen we connected is MIPI, so we can't see the display:
insert image description here
here use the serial port to log in to the system
insert image description here
to modify the screen to MIPI
Enter the "fire-config" command to enter the configuration interface:
insert image description here
enter the screen configuration:
insert image description here
insert image description here
select 1080P here:
Note: use the space bar to switch here (please see the following instructions: https://doc.embedfire.com/linux/rk356x/quick_start/zh /latest/quick_start/fireconfig/fireconfig.html)
insert image description here
select finish and exit, then enter the "reboot" command to restart:
insert image description here
insert image description here
you can see that the screen is displayed normally:

Luban cat modified the screen to adapt to MIPI

Rotate the screen to landscape

But now the screen is vertical, and our usage habit is horizontal. Enter the system and enter the following command:
"xrandr --output DSI-1 --rotate left"

Last login: Thu Feb 14 18:13:09 CST 2019 on ttyFIQ0

 
           OO                            OO
           OOOO                        OOOO
           OOOOO                     OOOOOO
           OOOOOOO                 .OOOOOOO
           OOOOOOOOO              OOOOOOOOO
           OOOOOOOOOOO          OOOOOOOOOOO
           OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
           OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
           OOOOO\    OOOOOOOOOOOO    /OOOOO
           OOOOOOOOO    OOOOOO     OOOOOOOO
           OOOOO/    OOOOOOOOOOOOO   \OOOOO
           OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
           OOOOOOOOOOOOOO\ ̄/OOOOOOOOOOOOOO
           OOOOOOOOOOOOOOO\/OOOOOOOOOOOOOOO
           OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 
  _            _                     ____        _
 | |    _   _ | |__    ____  _____  / ___| ____ | |_   
 | |   | | | || '_ \  / _  ||  _  || |    / _  || __|
 | |___| |_| || |_) || (_| || | | || |___| (_| || |_
 |_____|\__._||_.__/  \__'_||_| |_| \____|\__'_| \__| 


Welcome to Debian GNU/Linux 10 (buster) (GNU/Linux 4.19.232 aarch64)

 * Documentation:  http://doc.embedfire.com
 * Management:     http://www.embedfire.com
Linux lubancat 4.19.232 #7 SMP Mon Jul 10 16:21:10 CST 2023 aarch64

System information as of Thu Feb 14 18:21:53 CST 2019

System load:   1.70 0.39 0.13   Up time:       0 min
Memory usage:  20 % of 1957MB   IP:            
CPU temp:      44°C             GPU temp:      44°C           
Usage of /:    42% of 7.1G   

root@lubancat:~# xrand
-bash: xrand: command not found
root@lubancat:~# xrandr
Screen 0: minimum 320 x 200, current 1080 x 1920, maximum 8192 x 8192
DSI-1 connected primary 1080x1920+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1080x1920     60.00*+
root@lubancat:~# xrandr --help
usage: xrandr [options]
  where options are:
  --display <display> or -d <display>
  --help
  -o <normal,inverted,left,right,0,1,2,3>
            or --orientation <normal,inverted,left,right,0,1,2,3>
  -q        or --query
  -s <size>/<width>x<height> or --size <size>/<width>x<height>
  -r <rate> or --rate <rate> or --refresh <rate>
  -v        or --version
  -x        (reflect in x)
  -y        (reflect in y)
  --screen <screen>
  --verbose
  --current
  --dryrun
  --nograb
  --prop or --properties
  --fb <width>x<height>
  --fbmm <width>x<height>
  --dpi <dpi>/<output>
  --output <output>
      --auto
      --mode <mode>
      --preferred
      --pos <x>x<y>
      --rate <rate> or --refresh <rate>
      --reflect normal,x,y,xy
      --rotate normal,inverted,left,right
      --left-of <output>
      --right-of <output>
      --above <output>
      --below <output>
      --same-as <output>
      --set <property> <value>
      --scale <x>x<y>
      --scale-from <w>x<h>
      --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>
      --off
      --crtc <crtc>
      --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]
      --gamma <r>:<g>:<b>
      --brightness <value>
      --primary
  --noprimary
  --newmode <name> <clock MHz>
            <hdisp> <hsync-start> <hsync-end> <htotal>
            <vdisp> <vsync-start> <vsync-end> <vtotal>
            [flags...]
            Valid flags: +HSync -HSync +VSync -VSync
                         +CSync -CSync CSync Interlace DoubleScan
  --rmmode <name>
  --addmode <output> <name>
  --delmode <output> <name>
  --listproviders
  --setprovideroutputsource <prov-xid> <source-xid>
  --setprovideroffloadsink <prov-xid> <sink-xid>
  --listmonitors
  --listactivemonitors
  --setmonitor <name> {
    
    auto|<w>/<mmw>x<h>/<mmh>+<x>+<y>} {
    
    none|<output>,<output>,...}
  --delmonitor <name>
root@lubancat:~# xrandr
Screen 0: minimum 320 x 200, current 1080 x 1920, maximum 8192 x 8192
DSI-1 connected primary 1080x1920+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1080x1920     60.00*+
root@lubancat:~# xrandr --output DSI-1 --rotate left
xrandr: --rotate: invalid argument 'leftxr'
Try 'xrandr --help' for more information.
root@lubancat:~# xrandr --output DSI-1 --rotate left
[  511.134234] rockchip-vop2 fe040000.vop: [drm:vop2_crtc_atomic_disable] Crtc atomic disable vp0
[  511.177205] [drm:vop2_plane_atomic_check] *ERROR* Cluster0-win0 is invisible(src: pos[0, 0] rect[64 x 64] dst: pos[833, 1856] rect[64 x 64]
[  511.250694] rockchip-vop2 fe040000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 1080x1920p0, type: 16 for vp0
[  511.251431] dw-mipi-dsi fe060000.dsi: [drm:dw_mipi_dsi_encoder_enable] final DSI-Link bandwidth: 870 x 4 Mbps
root@lubancat:~# 

You can see that the screen has become the horizontal screen we want
insert image description here
, but here we find that the touch is abnormal

Abnormal touch of Luban cat

Here use "fire-config" to modify the touch direction:
insert image description here
insert image description here
Rotate 90 degrees to the left:
insert image description here
After selecting finish, you can see that the screen returns to normal:

Luban cat touch is normal

Screen and touch direction modifications are permanently saved

But I tested and found that this method will return to the original vertical screen at the next restart. Here we need to find a way to save the screen settings! According to Lubanmao’s official statement, the solution to this problem is to
start a self-starting service. This service is used to modify the direction of the screen, although I think this is not the most authentic method, and then modify the "/etc/X11/xorg.conf.d/20-modesetting.conf" file according to the official reminder to permanently modify the screen and touch direction , the modified "20-modesetting.conf" file is as follows:

root@lubancat:~# cat /etc/X11/xorg.conf.d/20-modesetting.conf   
Section "Device"
    Identifier  "Rockchip Graphics"
    Driver      "modesetting"

### Use Rockchip RGA 2D HW accel
#    Option      "AccelMethod"    "exa"

### Use GPU HW accel
    Option      "AccelMethod"    "glamor"

    Option      "DRI"            "2"

### Set to "always" to avoid tearing, could lead to up 50% performance loss
    Option      "FlipFB"         "none"

### Limit flip rate and drop frames for "FlipFB" to reduce performance lost
#    Option      "MaxFlipRate"    "25"

    Option      "NoEDID"         "true"
EndSection

Section "Screen"
    Identifier  "Default Screen"
    Device      "Rockchip Graphics"
    Monitor     "Default Monitor"
EndSection

### Valid values for rotation are "normal", "left", "right"
Section "Monitor"
    Identifier  "Default Monitor"
    Option      "Rotate" "left"
EndSection

Section "InputClass"
         Identifier "Goodix Capacitive TouchScreen"
         MatchProduct "Goodix Capacitive TouchScreen"
         Option "TransformationMatrix" " 0 -1 1 1 0 0 0 0 1 
EndSection

Among them, "Monitor" modifies the direction of the screen, and "InputClass" modifies the direction of the touch. The effect is actually the same as these two sentences:

xrandr --output DSI-1 --rotate left
xinput set-prop 9 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1

The final effect is as follows:

Luban cat screen and touch permanent save

There is another problem here, that is, the log will be output to the screen when booting. After the above modification, the desktop screen is reversed, but the screen is not reversed when printing the log. Here, modify "/boot/uEnv/uEnv. txt" file as follows:

uname_r=4.19.232
size=0x1000000
cmdline="earlyprintk console=ttyFIQ0 console=tty1 fbcon=rotate:3 consoleblank=0  
loglevel=7 rootwait rw rootfstype=ext4"

enable_uboot_overlays=1
#overlay_start

#40pin
#dtoverlay=/dtb/overlay/rk3566-lubancat-msata-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-i2c3-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-i2c5-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm8-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm9-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm10-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm11-ir-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm12-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm13-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm13-m1-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm14-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm14-m1-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm15-ir-m0-overlay.dtbo
#dtoverlay=/dtb/overlay/rk356x-lubancat-pwm15-ir-m1-overlay.dtbo
"/boot/uEnv/uEnv.txt" 51L, 2575C written        

The main thing here is to add the content "fbcon=rotate:3"
and the final effect is as follows:

Luban cat boot log screen rotation

Guess you like

Origin blog.csdn.net/chengdong1314/article/details/132035193