[kylin D2000]麒麟系统飞腾D2000下LVDS屏幕BIOS下能亮系统下不亮问题解决方法

1.拉取代码

通过以下命令拉取代码或者使用smifb2.zip 文件解压

git clone https://github.com/teddywlq/smifb2.git

代码信息

zwzn2064@zwzn2064-CVN-Z690D5-GAMING-PRO:~/smifb2$ ls
ddk750     hw750.c  hw768.h   Makefile         smi_dbg.h      smi_drv.c   smi_mode.c   smi_priv.h  smi_ttm.c  xorg.conf.multicard
ddk768     hw750.h  hw_com.h  Makefile.kernel  smi_debugfs.c  smi_drv.h   smi_plane.c  smi_snd.c   smi_ver.h  xorg.conf.SM768
dkms.conf  hw768.c  Kconfig   readme           smi_debugfs.h  smi_main.c  smi_prime.c  smi_snd.h   tags
zwzn2064@zwzn2064-CVN-Z690D5-GAMING-PRO:~/smifb2$ 

readme信息

1. Introduction
SiliconMotion SM750/SM768 Graphics PCI-E DRM Driver

2. Usage
This driver can be compiled under the kernel 5.x. 
1)  Please make sure that you are in console and run as root user.
2)  Open this driver directory, and use the "make" command, it will to generate the "smifb.ko".
3)      Install the module.
        make install
4)  use "depmod -a" to handle dependency descriptions for loadable kernel modules.
5)  On some ubuntu or debian OS, we need to update initramfs update-initramfs -u
5)      Reboot and restart graphic interface, 

Build essential package:
If there is build-mistake such as "/lib/modules/.../build: No such file or directory"
(Ubuntu version)
apt-get install linux-headers-$(uname -r) build-essential
(Fedora version)
yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)


Module Options
==============

Special configuration for smifb is usually unnecessary. There are a few
options, however.


From the command line, pass options to modprobe
modprobe smifb.ko lvds=1 width=1024 height=768

Or modify options on the fly at /sys/module/smifb/parameters directory 
change the parameter in place, and save the file.


Or for permanent option, create file like /etc/modprobe.d/smifb.conf with text
options smifb lvds=1 width=1024 height=768

Module Parameter
==============
You can use "modinfo smifb" to get detail information
2 修改代码

调整时序。结构体 mode_parameter_t 定义了一种模式参数,通常用于描述显示设备(如液晶显示器或其他图形显示设备)的时序和频率设置

jw@kylin:~/smifb2$ git diff ddk768/ddk768_mode.c
diff --git a/ddk768/ddk768_mode.c b/ddk768/ddk768_mode.c
index 2e556a9..5dfbbcf 100644
--- a/ddk768/ddk768_mode.c
+++ b/ddk768/ddk768_mode.c
@@ -263,7 +263,9 @@ static mode_parameter_t gLVDSModeParamTable[] =
  {1678,1280,1350,136, POS, 795, 768, 769, 3, POS, 80000000, 47676, 60, NEG},
 
 /* 1280 x 800  [8:5] -- Not a popular mode */
- {1650,1280,1344,136, NEG, 824, 800, 800, 3, NEG, 81600000, 49455, 60, NEG},
+// {1650,1280,1344,136, NEG, 824, 800, 800, 3, NEG, 81600000, 49455, 60, NEG},
+/* 1280 x 800  [8:5] -- New */
+  {1440,1280,1408,32, NEG, 823, 800, 817, 6, NEG, 71000000, 49305, 60, NEG},
 
 /* 1280 x 960  [4:3] */
 /* The first commented line below are taken from SM502, the rest timing are
jw@kylin:~/smifb2$ 
3.编译代码

将代码放到麒麟系统下,使用 make 命令编译代码,会生成smifb.ko 驱动模块

make
4 替换驱动

执行以下命令替换驱动,重新启动机器,屏幕就成功点亮了

rm /lib/modules/5.4.18-63.52-embedded-generic/kernel/drivers/gpu/drm/smidrm/smifb.ko.xz
cp smifb.ko /lib/modules/5.4.18-63.52-embedded-generic/kernel/drivers/gpu/drm/smidrm/
depmod -a
update-initramfs -u
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值