泰山派关于debian系统的横屏显示和触摸的更改方法

更改显示和触摸的原因,因为在3.1英寸竖屏下很多页面显示不完整,使用体验不好。

(1)手动旋转使用xrandr命令实现:这里/是或者的意思,四种方向选一个就可以了。

xrandr -o left/right/normal/inverted

这种是临时改变,要永久改变就要直接更改配置文件。

(2)通过访问/etc/X11/xorg.conf.d/20-modesetting.conf文件实现永久改变。

vim /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" "normal"
EndSection

其中Section "Monitor"下的【Identifier "Default Monitor"】表示旋转屏幕Default Monitor,【Option "Rotate" "right"】表示向右旋转。这样修改后,重启设备,屏幕旋转设置生效。

查看当前可用屏幕ID

sudo cat /sys/kernel/debug/dri/0/summary

以上操作都是直接操作泰山派实现,想要系统编译就直接默认横屏我们就需要进行下面的操作。

(3)在ubuntu下找到配置文件进行修改,修改/debian/overlay/etc/X11/xorg.conf.d/20-modesetting.conf。

vim ~/zero/tspi/tspi_linux_sdk_repo_20240131/debian/overlay/etc/X11/xorg.conf.d/20-modesetting.conf

其中~/zero/tspi/tspi_linux_sdk_repo_20240131/这是我的文件存放路径,请以自己的为准,但后面的大家都一样了,打开之后按照步骤一修改就可以。

7888e73135e94142abda00414a8d22cc.png

(4)更改触摸,在完成竖屏触摸的情况下,我们更改三个地方就可以完成更改触摸了,文件是修改/kernel/drivers/input/touchscreen/my_touch/mytouch.c,更改我打有注释的几行代码就可以了。

MY_SWAP(input_x,input_y);//横屏时打开,竖屏时要屏蔽
        if(event_flag == 0){
            // 如果是按下上报按下和坐标
            input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
          //  input_report_abs(ts->input_dev, ABS_MT_POSITION_X, 480-input_x);//竖屏参数
            input_report_abs(ts->input_dev, ABS_MT_POSITION_X, input_x);//横屏参数
            input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, input_y);
        }else if (event_flag == 2){
            // 如果是长按直接上报数据
           // input_report_abs(ts->input_dev, ABS_MT_POSITION_X, 480-input_x);//竖屏参数
            input_report_abs(ts->input_dev, ABS_MT_POSITION_X, input_x);//横屏参数
            input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, input_y);
        }else if(event_flag == 1){
            // 触摸抬起,上报事件
            input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false);
        }
//  input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, 480, 0, 0); //竖屏参数
//  input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, 800, 0, 0); //竖屏参数

    input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, 800, 0, 0);
    input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, 480, 0, 0);

关于开机logo我觉得对我不是很有影响,我这里就不改了,具体可以参考泰山派的教程文档。

 

  • 9
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值