全志 HDMI 显示亮度低

一、问题描述

全志T527在适配HDMI,让HDMI作为主显示时,出现亮度太低的问题

二、解决办法

1、调整uboot参数,显示720P画面

vi device/config/chips/t527/configs/sany_v7/uboot-board.dts

在T527中有显示相关的接口,enhance

该接口用于设置图像的亮度/对比度/饱和度/边缘锐度/细节增强/降噪的调节幅度。

2、调整亮度 

在设置之前请确保enhance_mode 的值为1,否则设置不会生效。

//设置disp0 的图像亮度为80

echo 0 > /sys/class/disp/disp/attr/enhance_mode

echo 80 > /sys/class/disp/disp/attr/enhance_bright

//设置disp1的图像亮度为80(HDMI)

echo 1 > /sys/class/disp/disp/attr/enhance_mode

echo 80 > /sys/class/disp/disp/attr/enhance_bright

cat sys/class/disp/disp/attr/enhance_bright

调整后,HDMI亮度变亮

3、定位对应代码。修改为亮度为默认80

bsp/drivers/video/sunxi/disp2/disp/dev_disp.c

static ssize_t disp_enhance_bright_show(struct device *dev,
    struct device_attribute *attr, char *buf)
{
    int num_screens = 2;
    struct disp_manager *mgr = NULL;
    struct disp_enhance *enhance = NULL;
    int value = 0;
    int real_mode = (g_enhance_mode == 3) ? 1 : g_enhance_mode;

    num_screens = bsp_disp_feat_get_num_screens();
    if (g_disp < num_screens)
        mgr = g_disp_drv.mgr[g_disp];

    if (mgr) {
        enhance = mgr->enhance;
        if (enhance && enhance->get_bright)
            value = enhance->get_bright(enhance);
    }

    return sprintf(buf, "%d %d\n", _csc_enhance_setting[real_mode][0], value);
}

static ssize_t disp_enhance_bright_store(struct device *dev,
    struct device_attribute *attr,
    const char *buf, size_t count)
{
    int err;
    unsigned long value;
    int num_screens = 2;
    struct disp_manager *mgr = NULL;
    struct disp_enhance *enhance = NULL;
    int real_mode = (g_enhance_mode == 3) ? 1 : g_enhance_mode;

    err = kstrtoul(buf, 10, &value);
    if (err) {
        DE_WARN("Invalid size\n");
        return err;
    }

    if (g_enhance_mode == 0)
        return count;

    num_screens = bsp_disp_feat_get_num_screens();
    if (g_disp < num_screens)
        mgr = g_disp_drv.mgr[g_disp];

    if (mgr) {
        enhance = mgr->enhance;
        if (enhance && enhance->set_bright) {
            _csc_enhance_setting[real_mode][0] = value;
            enhance->set_bright(enhance, value);
        }
#if defined(DE_VERSION_V35X)
#else
        if (enhance && enhance->set_mode) {
            enhance->set_mode(enhance, real_mode ? 0 : 1);
            enhance->set_mode(enhance, real_mode);
        }
#endif
    }

    return count;
}
static DEVICE_ATTR(enhance_bright, 0660,
    disp_enhance_bright_show, disp_enhance_bright_store);

代码中,disp_enhance_bright_show 和 disp_enhance_bright_store 这两个函数处理 enhance_bright 属性的显示和设置。

第一个值 _csc_enhance_setting[real_mode][0]:这是通过 disp_enhance_bright_store 函数设置的值,存储在 _csc_enhance_setting 数组中。

disp_enhance_bright_store 函数将用户输入的亮度值存储在这个数组里,并在调用 enhance->set_bright 时应用这个值。

第二个值 value:

这是通过 disp_enhance_bright_show 函数从显示管理器的 enhance 结构体中获取的当前亮度值。这个值是由 enhance->get_bright 函数返回的,代表当前实际的亮度设置。

修改_csc_enhance_setting数组中的默认值为80

路径:bsp/drivers/video/sunxi/disp2/disp/de/lowlevel_v35x/de35x/de_dcsc.c +513

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

春风从不入睡、

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值