您尚未登录。

楼主 # 2024-08-28 22:06:36

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

问题卡了两周,各位路过的大佬帮忙看看呗!感激不尽

使用T113S3 tina linux驱动ST7701S RGB屏幕,打开lvgl demo,显示分了两半的问题:
_20240828220036.png

通过指令保存的图片是正常的:

echo 0 > /sys/class/disp/disp/attr/disp
echo /data/1.bmp > /sys/class/disp/disp/attr/capture_dump

_20240828220041.png

厂家给的参数:
HS:10   HBP:30   HFP: 50
VS:2      VBP:15   VFP:17
400*960

DTS部分配置如下:

&disp {
	disp_init_enable         = <1>;
	disp_mode                = <0>;

	screen0_output_type      = <1>;
	screen0_output_mode      = <4>;

	screen1_output_type      = <3>;
	screen1_output_mode      = <4>;
	
	screen1_output_format    = <0>;
	screen1_output_bits      = <0>;
	screen1_output_eotf      = <4>;
	screen1_output_cs        = <257>;
	screen1_output_range     = <2>;
	screen1_output_scan      = <0>;
	screen1_output_aspect_ratio = <8>;
	dev0_output_type         = <1>;
	dev0_output_mode         = <4>;
	dev0_screen_id           = <0>;
	dev0_do_hpd              = <0>;

	dev1_output_type         = <4>;
	dev1_output_mode         = <10>;
	dev1_screen_id           = <1>;
	dev1_do_hpd              = <1>;

	def_output_dev           = <0>;
	disp_rotation_used		 = <1>;
	degree0					 = <0>;
	fb0_format               = <0>;
	fb0_buffer_num           = <1>;
	fb0_width                = <400>;
	fb0_height               = <960>;  /*read from lcd*/
	fb1_format               = <0>;
	fb1_width                = <0>;
	fb1_height               = <0>;
	chn_cfg_mode             = <1>;

	disp_para_zone           = <1>;
};
&lcd0 {
    lcd_used            = <1>;
    lcd_driver_name     = "st7701s_rgb";

    lcd_if              = <0>;  //0:rgb 1:CPU/I80 2:保留 3:lvds 4:dsi
    lcd_hv_if           = <0>;  //0:并行rgb

    lcd_width           = <46>; //物理宽度 mm
    lcd_height          = <110>;  //物理高度 mm
    lcd_x               = <400>; //宽度
    lcd_y               = <960>; //高度
    lcd_dclk_freq       = <29>;  //屏幕时钟 MHz

    lcd_hbp             = <40>;  //hbp+hspw,从时序图可以看到hspw包含在hbp中,所以只需要填写hbp的值
    lcd_ht              = <490>;  //lcd_x+hs+hbp+hspw
    lcd_hspw            = <10>;  //hspw

    lcd_vbp             = <17>;  //vbp+vspw
    lcd_vt              = <994>;  //lcd_y+vs+vbp+vspw
    lcd_vspw            = <2>;   //vspw
        
    lcd_backlight       = <50>; //背光默认亮度
    lcd_pwm_used        = <1>;  //使用背光
    lcd_pwm_ch          = <7>;  //使用pwm通道7
    lcd_pwm_freq        = <10000>; //PWM 频率,单位 Hz
    lcd_pwm_pol         = <0>;  //背光 PWM 的极性
    lcd_pwm_max_limit   = <255>;
    lcd_bright_curve_en = <0>;

    lcd_dsi_if          = <0>;
    lcd_dsi_lane        = <4>;
    lcd_lvds_if         = <0>;
    lcd_lvds_colordepth = <0>;
    lcd_lvds_mode       = <0>;
    lcd_frm             = <1>;
    lcd_hv_clk_phase    = <0>;
    lcd_hv_sync_polarity= <0>;
    lcd_io_phase        = <0x0000>;
    lcd_gamma_en        = <0>;
    lcd_bright_curve_en = <0>;
    lcd_cmap_en         = <0>;
    lcd_fsync_en        = <0>;
    lcd_fsync_act_time  = <1000>;
    lcd_fsync_dis_time  = <1000>;
    lcd_fsync_pol       = <0>;

    deu_mode            = <0>;
    lcdgamma4iep        = <22>;
    smart_color         = <90>;

    pinctrl-0 = <&rgb18_pins_a>;
    pinctrl-1 = <&rgb18_pins_b>;

    lcd_gpio_0 = <&pio PE 9 GPIO_ACTIVE_HIGH>; //RST
    lcd_gpio_1 = <&pio PE 8 GPIO_ACTIVE_HIGH>; //CS
    lcd_gpio_2 = <&pio PE 7 GPIO_ACTIVE_HIGH>; //SDA
    lcd_gpio_3 = <&pio PE 6 GPIO_ACTIVE_HIGH>; //SCK
};

驱动源码如下:

#include "st7701s_rgb.h"
#include "default_panel.h"
//s32 sunxi_lcd_gpio_set_value(u32 screen_id, u32 io_index, u32 value)

#define st7701s_spi_scl_1   sunxi_lcd_gpio_set_value(0, 3, 1)
#define st7701s_spi_scl_0   sunxi_lcd_gpio_set_value(0, 3, 0)
#define st7701s_spi_sdi_1   sunxi_lcd_gpio_set_value(0, 2, 1)
#define st7701s_spi_sdi_0   sunxi_lcd_gpio_set_value(0, 2, 0)
#define st7701s_spi_cs_1    sunxi_lcd_gpio_set_value(0, 1, 1)
#define st7701s_spi_cs_0    sunxi_lcd_gpio_set_value(0, 1, 0)
#define st7701s_spi_reset_1 sunxi_lcd_gpio_set_value(0, 0, 1)
#define st7701s_spi_reset_0 sunxi_lcd_gpio_set_value(0, 0, 0)

static void LCD_power_on(u32 sel);
static void LCD_power_off(u32 sel);
static void LCD_bl_open(u32 sel);
static void LCD_bl_close(u32 sel);

static void LCD_panel_init(u32 sel);
static void LCD_panel_exit(u32 sel);

static void LCD_cfg_panel_info(panel_extend_para *info)
{
    u32 i = 0, j = 0;
    u32 items;
    u8 lcd_gamma_tbl[][2] = {
        /* {input value, corrected value} */
        {0, 0},
        {15, 15},
        {30, 30},
        {45, 45},
        {60, 60},
        {75, 75},
        {90, 90},
        {105, 105},
        {120, 120},
        {135, 135},
        {150, 150},
        {165, 165},
        {180, 180},
        {195, 195},
        {210, 210},
        {225, 225},
        {240, 240},
        {255, 255},
    };

    u32 lcd_cmap_tbl[2][3][4] = {
        {
         {LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3},
         {LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3},
         {LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3},
         },
        {
         {LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0},
         {LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0},
         {LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0},
         },
    };

    items = sizeof(lcd_gamma_tbl) / 2;
    for (i = 0; i < items - 1; i++) {
        u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0];

        for (j = 0; j < num; j++) {
            u32 value = 0;

            value =
                lcd_gamma_tbl[i][1] +
                ((lcd_gamma_tbl[i + 1][1] -
                  lcd_gamma_tbl[i][1]) * j) / num;
            info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] =
                (value << 16) + (value << 8) + value;
        }
    }
    info->lcd_gamma_tbl[255] =
        (lcd_gamma_tbl[items - 1][1] << 16) +
        (lcd_gamma_tbl[items - 1][1] << 8) + lcd_gamma_tbl[items - 1][1];

    memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl));

}

static s32 LCD_open_flow(u32 sel)
{
    printk("=====================LCD_open_flow\n");
    /* open lcd power, and delay 50ms */
    LCD_OPEN_FUNC(sel, LCD_power_on, 20);
    /* open lcd power, than delay 200ms */
    LCD_OPEN_FUNC(sel, LCD_panel_init, 20);
    /* open lcd controller, and delay 100ms */
    LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 100);
    /* open lcd backlight, and delay 0ms */
    LCD_OPEN_FUNC(sel, LCD_bl_open, 0);

    return 0;
}

static s32 LCD_close_flow(u32 sel)
{
    /* close lcd backlight, and delay 0ms */
    LCD_CLOSE_FUNC(sel, LCD_bl_close, 0);
    /* close lcd controller, and delay 0ms */
    LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 0);
    /* open lcd power, than delay 200ms */
    LCD_CLOSE_FUNC(sel, LCD_panel_exit, 200);
    /* close lcd power, and delay 500ms */
    LCD_CLOSE_FUNC(sel, LCD_power_off, 500);

    return 0;
}

static void LCD_power_on(u32 sel)
{
    printk("=====================LCD_power_on\n");
    /* config lcd_power pin to open lcd power0 */
    sunxi_lcd_power_enable(sel, 0);
    sunxi_lcd_pin_cfg(sel, 1);

}

static void LCD_power_off(u32 sel)
{
    sunxi_lcd_pin_cfg(sel, 0);
    /* config lcd_power pin to close lcd power0 */
    sunxi_lcd_power_disable(sel, 0);
}

static void LCD_bl_open(u32 sel)
{
    printk("=====================LCD_bl_open\n");
    sunxi_lcd_pwm_enable(sel);
    sunxi_lcd_backlight_enable(sel);
}

static void LCD_bl_close(u32 sel)
{
    /* config lcd_bl_en pin to close lcd backlight */
    sunxi_lcd_backlight_disable(sel);
    sunxi_lcd_pwm_disable(sel);
}

//three line 9bit mode
static void LCD_WRITE_DATA(u32 value)
{
    u32 i;
    st7701s_spi_cs_0;
    st7701s_spi_sdi_1;
    st7701s_spi_scl_0;
    sunxi_lcd_delay_us(10);
    st7701s_spi_scl_1;
    for (i = 0; i < 8; i++) {
        sunxi_lcd_delay_us(10);
        if (value & 0x80)
            st7701s_spi_sdi_1;
        else
            st7701s_spi_sdi_0;
        value <<= 1;
        sunxi_lcd_delay_us(10);
        st7701s_spi_scl_0;
        st7701s_spi_scl_1;
    }
    sunxi_lcd_delay_us(10);
    st7701s_spi_cs_1;
}

static void LCD_WRITE_COMMAND(u32 value)
{
    u32 i;
    st7701s_spi_cs_0;
    st7701s_spi_sdi_0;
    st7701s_spi_scl_0;
    sunxi_lcd_delay_us(10);
    st7701s_spi_scl_1;
    for (i = 0; i < 8; i++) {
        sunxi_lcd_delay_us(10);
        if (value & 0x80)
            st7701s_spi_sdi_1;
        else
            st7701s_spi_sdi_0;
        st7701s_spi_scl_0;
        sunxi_lcd_delay_us(10);
        st7701s_spi_scl_1;
        value <<= 1;
    }
    sunxi_lcd_delay_us(10);
    st7701s_spi_cs_1;
}

static void LCD_panel_init(u32 sel)
{
    printk("=====================LCD_panel_init\n");
    //ST7701S+AUO4.58
    LCD_WRITE_COMMAND (0xFF);     
    LCD_WRITE_DATA (0x77); 
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x13);   

    LCD_WRITE_COMMAND (0xEF);     
    LCD_WRITE_DATA (0x08);   

    LCD_WRITE_COMMAND (0xFF);     
    LCD_WRITE_DATA (0x77);   
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x10);   

    LCD_WRITE_COMMAND (0xC0);     
    LCD_WRITE_DATA (0x77);   
    LCD_WRITE_DATA (0x00);   

    LCD_WRITE_COMMAND (0xC1);     
    LCD_WRITE_DATA (0x09);   
    LCD_WRITE_DATA (0x08);   

    LCD_WRITE_COMMAND (0xC2);//inv     
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0x02);  

    LCD_WRITE_COMMAND (0xC3); //????    
    LCD_WRITE_DATA (0x02); //82 HVmode    02 DEmode 
    

    LCD_WRITE_COMMAND (0xCC);     
    LCD_WRITE_DATA (0x10);   

    LCD_WRITE_COMMAND (0xB0);     
    LCD_WRITE_DATA (0x40);   
    LCD_WRITE_DATA (0x14);   
    LCD_WRITE_DATA (0x59);   
    LCD_WRITE_DATA (0x10);   
    LCD_WRITE_DATA (0x12);   
    LCD_WRITE_DATA (0x08);   
    LCD_WRITE_DATA (0x03);   
    LCD_WRITE_DATA (0x09);   
    LCD_WRITE_DATA (0x05);   
    LCD_WRITE_DATA (0x1E);   
    LCD_WRITE_DATA (0x05);   
    LCD_WRITE_DATA (0x14);   
    LCD_WRITE_DATA (0x10);   
    LCD_WRITE_DATA (0x68);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x15);   

    LCD_WRITE_COMMAND (0xB1);     
    LCD_WRITE_DATA (0x40);   
    LCD_WRITE_DATA (0x08);   
    LCD_WRITE_DATA (0x53);   
    LCD_WRITE_DATA (0x09);   
    LCD_WRITE_DATA (0x11);   
    LCD_WRITE_DATA (0x09);   
    LCD_WRITE_DATA (0x02);   
    LCD_WRITE_DATA (0x07);   
    LCD_WRITE_DATA (0x09);   
    LCD_WRITE_DATA (0x1A);   
    LCD_WRITE_DATA (0x04);   
    LCD_WRITE_DATA (0x12);   
    LCD_WRITE_DATA (0x12);   
    LCD_WRITE_DATA (0x64);   
    LCD_WRITE_DATA (0x29);   
    LCD_WRITE_DATA (0x29);   

    LCD_WRITE_COMMAND (0xFF);     
    LCD_WRITE_DATA (0x77);   
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x11);   

    LCD_WRITE_COMMAND (0xB0);     
    LCD_WRITE_DATA (0x6D);  //6D 

    LCD_WRITE_COMMAND (0xB1);   //vcom  
    LCD_WRITE_DATA (0x1D);   

    LCD_WRITE_COMMAND (0xB2);     
    LCD_WRITE_DATA (0x87);   

    LCD_WRITE_COMMAND (0xB3);     
    LCD_WRITE_DATA (0x80);   

    LCD_WRITE_COMMAND (0xB5);     
    LCD_WRITE_DATA (0x49);   

    LCD_WRITE_COMMAND (0xB7);     
    LCD_WRITE_DATA (0x85);   

    LCD_WRITE_COMMAND (0xB8);     
    LCD_WRITE_DATA (0x20);   

    LCD_WRITE_COMMAND (0xC1);     
    LCD_WRITE_DATA (0x78);   

    LCD_WRITE_COMMAND (0xC2);     
    LCD_WRITE_DATA (0x78);   

    LCD_WRITE_COMMAND (0xD0);     
    LCD_WRITE_DATA (0x88);   

    LCD_WRITE_COMMAND (0xE0);     
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x02);   

    LCD_WRITE_COMMAND (0xE1);     
    LCD_WRITE_DATA (0x02);   
    LCD_WRITE_DATA (0x8C);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x03);   
    LCD_WRITE_DATA (0x8C);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   

    LCD_WRITE_COMMAND (0xE2);     
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0xC9);   
    LCD_WRITE_DATA (0x3C);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0xCA);   
    LCD_WRITE_DATA (0x3C);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   

    LCD_WRITE_COMMAND (0xE3);     
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   

    LCD_WRITE_COMMAND (0xE4);     
    LCD_WRITE_DATA (0x44);   
    LCD_WRITE_DATA (0x44);   

    LCD_WRITE_COMMAND (0xE5);     
    LCD_WRITE_DATA (0x05);   
    LCD_WRITE_DATA (0xCD);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0xC9);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x07);   
    LCD_WRITE_DATA (0xCF);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x03);   
    LCD_WRITE_DATA (0xCB);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   

    LCD_WRITE_COMMAND (0xE6);     
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x33);   
    LCD_WRITE_DATA (0x33);   

    LCD_WRITE_COMMAND (0xE7);     
    LCD_WRITE_DATA (0x44);   
    LCD_WRITE_DATA (0x44);   

    LCD_WRITE_COMMAND (0xE8);     
    LCD_WRITE_DATA (0x06);   
    LCD_WRITE_DATA (0xCE);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x02);   
    LCD_WRITE_DATA (0xCA);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x08);   
    LCD_WRITE_DATA (0xD0);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x04);   
    LCD_WRITE_DATA (0xCC);   
    LCD_WRITE_DATA (0x82);   
    LCD_WRITE_DATA (0x82);   

    LCD_WRITE_COMMAND (0xEB);     
    LCD_WRITE_DATA (0x08);   
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0xE4);   
    LCD_WRITE_DATA (0xE4);   
    LCD_WRITE_DATA (0x88);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x40);   

    LCD_WRITE_COMMAND (0xEC);     
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   

    LCD_WRITE_COMMAND (0xED);     
    LCD_WRITE_DATA (0xFF);   
    LCD_WRITE_DATA (0xF0);   
    LCD_WRITE_DATA (0x07);   
    LCD_WRITE_DATA (0x65);   
    LCD_WRITE_DATA (0x4F);   
    LCD_WRITE_DATA (0xFC);   
    LCD_WRITE_DATA (0xC2);   
    LCD_WRITE_DATA (0x2F);   
    LCD_WRITE_DATA (0xF2);   
    LCD_WRITE_DATA (0x2C);   
    LCD_WRITE_DATA (0xCF);   
    LCD_WRITE_DATA (0xF4);   
    LCD_WRITE_DATA (0x56);   
    LCD_WRITE_DATA (0x70);   
    LCD_WRITE_DATA (0x0F);   
    LCD_WRITE_DATA (0xFF);   

    LCD_WRITE_COMMAND (0xEF);     
    LCD_WRITE_DATA (0x10);   
    LCD_WRITE_DATA (0x0D);   
    LCD_WRITE_DATA (0x04);   
    LCD_WRITE_DATA (0x08);   
    LCD_WRITE_DATA (0x3F);   
    LCD_WRITE_DATA (0x1F);   

    LCD_WRITE_COMMAND (0xFF);     
    LCD_WRITE_DATA (0x77);   
    LCD_WRITE_DATA (0x01);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   
    LCD_WRITE_DATA (0x00);   

    LCD_WRITE_COMMAND (0x11);     

    sunxi_lcd_delay_ms(120);                

    LCD_WRITE_COMMAND (0x35);     
    LCD_WRITE_DATA (0x00);   

    LCD_WRITE_COMMAND (0x3A);     
    LCD_WRITE_DATA (0x66);   

    //LCD_WRITE_COMMAND (0x11);
    //sunxi_lcd_delay_ms(120);

    LCD_WRITE_COMMAND (0x29); 
    return;
}

static void LCD_panel_exit(u32 sel)
{
    return;
}

/* sel: 0:lcd0; 1:lcd1 */
static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3)
{
    return 0;
}

__lcd_panel_t st7701s_rgb_panel = {
    /* panel driver name, must mach the lcd_drv_name in sys_config.fex */
    .name = "st7701s_rgb",
    .func = {
         .cfg_panel_info = LCD_cfg_panel_info,
         .cfg_open_flow = LCD_open_flow,
         .cfg_close_flow = LCD_close_flow,
         .lcd_user_defined_func = LCD_user_defined_func,
         }
    ,
};

离线

楼主 #1 2024-08-28 22:08:41

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

补充下运行时的屏参

root@TinaLinux:/data# cat /sys/class/disp/disp/attr/sys
screen 0:
de_rate 300000000 hz, ref_fps:60
mgr0: 400x960 fmt[rgb] cs[0x204] range[full] eotf[0x4] bits[8bits] err[0] force_sync[0] unblank direct_show[false] iommu[1]
dmabuf: cache[0] cache max[0] umap skip[0] umap skip max[4]
        lcd output      backlight( 50)  fps:77.5         400x 960
        err:0   skip:19 irq:1880        vsync:0 vsync_skip:0
   BUF    enable ch[1] lyr[0] z[16] prem[N] a[pixel 255] fmt[  0] fb[ 400, 960; 400, 960; 400, 960] crop[   0,   0, 400, 960] frame[   0,   0, 400, 960] addr[       0,       0,       0] flags[0x       0] trd[0,0]
depth[ 0] 

离线

#2 2024-08-29 09:56:45

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,348
积分: 9202

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

LCD_panel_init()

这个里面是初始化成 400*960 吗?





离线

楼主 #3 2024-08-29 22:54:45

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

晕哥 说:

LCD_panel_init()

这个里面是初始化成 400*960 吗?

感谢晕哥指点,是的,这个LCD_panel_init函数中的参数是根据厂家提供的启动参数配置。

今天我改了下lcd_dclk_freq,从29改到20,现在显示是这样的,会不会是PCB设计的原因呢?
_20240829225341.png

root@TinaLinux:/# cat /sys/class/disp/disp/attr/sys
screen 0:
de_rate 300000000 hz, ref_fps:47
mgr0: 400x960 fmt[rgb] cs[0x204] range[full] eotf[0x4] bits[8bits] err[0] force_sync[0] unblank direct_show[false] iommu[1]
dmabuf: cache[0] cache max[0] umap skip[0] umap skip max[12]
        lcd output      backlight( 50)  fps:49.7         400x 960
        err:0   skip:42 irq:1399        vsync:0 vsync_skip:0
   BUF    enable ch[1] lyr[0] z[16] prem[N] a[pixel 255] fmt[  0] fb[ 400, 960; 400, 960; 400, 960] crop[   0,   0, 400, 960] frame[   0,   0, 400, 960] addr[       0,       0,       0] flags[0x       0] trd[0,0]

另外,界面抖动得比较厉害,左侧有明显颗粒

最近编辑记录 kemp (2024-08-30 11:37:13)

离线

楼主 #4 2024-08-29 22:56:45

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

另外,界面抖动得比较厉害,左侧有明显颗粒

离线

楼主 #5 2024-08-30 09:57:28

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

我对比了下ST7701S手册中,描述到支持最高分辨率480RGBX864 in resolution
但是LCD_panel_init初始的C0H部分,Display Line Setting的是960,不知道是否会有影响呢?
LNESET (C0h/C000h): Display Line Setting
LDE_EN=”0”,no add delta line , NL= (Line[6:0]+1)*8

LCD_WRITE_COMMAND (0xC0);     
LCD_WRITE_DATA (0x77);   
LCD_WRITE_DATA (0x00);   
(0x77+1)*8 = 960

离线

#6 2024-08-30 10:35:56

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,348
积分: 9202

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

我翻了一下 →→→ST7701S手册←←←

支持以下分辨率

Display Resolution
- 480*RGB (H) *960(V) (FWVGA)
- 480*RGB (H) *864(V) (WVGA)
- 480*RGB (H) *854(V)
- 480*RGB (H) *800(V)
- 480*RGB (H) *720(V)
- 480*RGB (H) *640(V) (VGA)
- 480*RGB (H) *360(V)

如果没猜错的话,接受分辨率应该是480*RGB (H) *960(V) (FWVGA)

实际面板被剪裁到了 400*960,你问下供应商是不是这样?





离线

楼主 #7 2024-08-30 11:34:01

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

@晕哥
实际面板参数如下
LCM outline size 40.37 (H) x 117.90 (V) mm
Active area 36.77 (H) x 110.30 (V) mm
Number of pixels 320(H)X960(V)
Pixel arrangement RGB stripe - Pixel Pitch 114.9x114.9 um
Controller / Driver ST7701S
Data interface SPI3W+RGB18bit

我使用400x960是因为厂家给的参数是这样的:
HS:10   HBP:30   HFP: 50
VS:2      VBP:15   VFP:17
400*960


我这边拿到的ST7701S手册看,只能看到这样的分辨率,难道是旧版本?
Display Resolution
- 480*RGB (H) *864(V) (WVGA)
- 480*RGB (H) *854(V)
- 480*RGB (H) *800(V)
- 480*RGB (H) *720(V)
- 480*RGB (H) *640(V) (VGA)
- 480*RGB (H) *360(V)

最近编辑记录 kemp (2024-08-30 11:37:02)

离线

#8 2024-08-30 11:45:36

JUN626
会员
注册时间: 2020-11-29
已发帖子: 48
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

有没有可能,哪一个环节400*960,写成了960*400?

离线

楼主 #9 2024-08-30 22:23:39

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

JUN626 说:

有没有可能,哪一个环节400*960,写成了960*400?

好像就两个地方,一个是DTS、另一个是屏驱文件的初始化参数,好像还真没有整错

离线

#10 2024-08-31 14:39:32

zzm24
会员
注册时间: 2018-05-07
已发帖子: 120
积分: 107

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

关注后续,分辨率问题图像应该是斜纹,如果是压力测试花屏可能是DDR频率,这个控件轮廓是正确的,就是加上了一层雪花,怪哉

离线

楼主 #11 2024-08-31 20:11:07

kemp
会员
注册时间: 2023-10-10
已发帖子: 25
积分: 43

Re: 使用T113S3 tina linux驱动ST7701S RGB长条屏幕,显示lvgl demo分两半问题

zzm24 说:

关注后续,分辨率问题图像应该是斜纹,如果是压力测试花屏可能是DDR频率,这个控件轮廓是正确的,就是加上了一层雪花,怪哉

我目前没啥头绪,难道是硬件PCB设计原因?
但是echo 8 > /sys/class/disp/disp/attr/colorbar显示的,又正常很多,就是顶部显示有颗粒感而已。

_20240831200902.jpg

LVGL应用部分改过不同LV_COLOR_DEPTH,都无法解决这个问题。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn