This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM625:AM6254-linux6.1.33+qt5.15.7-QML

Guru**** 2337870 points
Other Parts Discussed in Thread: AM625
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1524312/am625-am6254-linux6-1-33-qt5-15-7-qml

器件型号:AM625

工具/软件:

您好、

  我使用 Linux 6.1.33 和 QT 版本 QT5.15.7 通过 QML 接口进行 Qt 应用开发。 当前的主要现象是、运行 QML 应用一段时间后、使用 ToolButton 和 Canvas 等画布区域会出现问题、从而导致图像显示异常。 接口的情况是,程序运行后,整个接口的输出通道会发生变化,输出通道 (Canvs canvas) 会实时更新和刷新,并且制冷温度和 UV (ToolButton) 透明度会定期变化。 其他位置保持不变。 下图展示了该现象

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、
    该问题似乎特定于 Qt 应用程序开发、通常与 AM625 SoC 无关。 我建议您在相关的在线论坛上提问。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    以下是分析过程、源代码跟踪过程和数据
    使用屏幕 1280x800 (LVDS)
    修改 Qt 源代码、并在绑定后读取纹理数据。

    QT Opengles 纹理相册管理负责创建和分配纹理、创建一个大的纹理块 (2048x1024) 作为一个整体、然后使用子纹理进行图像数据存储和分配。

    qtdeclative/quick/scenegraph/util/qsgopenglatlasteture.cpp src

    目前,在纹理绑定后,从 GPU 读取纹理缓冲区的操作被添加。 出现问题时、单击“应用“将读取创建子纹理以保存图像的所有图像数据。 正常运行时、图像读取是正常的、但出现异常时、GPU 缓冲区也会出现问题。

    将纹理保存到图像代码、如下所示

     if(qApp->property("save_image") =="1"){ 
            GLuint fbo;
            glGenFramebuffers(1, &fbo);
            glBindFramebuffer(GL_FRAMEBUFFER, fbo);
            glFramebufferTexture2D(GL_FRAMEBUFFER,
                                  GL_COLOR_ATTACHMENT0,
                                  GL_TEXTURE_2D,
                                  m_texture_id, 0);
    
            int count =g_textures.size();
            qDebug()<<"save texture image ++++++++++++++++++++++++++++++++++++++++++++++++++"<<count;
            for(int i=0; i<count; i++){
                QRect r= g_textures[i]->atlasSubRect();
    
                int x = r.x();
                int y = r.y();
                int w = r.width();
                int h = r.height();
    
                GLubyte* pixels = (GLubyte*)malloc(w * h * 4);
                glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
                QImage img(pixels, w, h, QImage::Format_ARGB32_Premultiplied);
                qDebug() <<"text_save ="<<i<< img.save(QString("/home/root/image/%1.png").arg(i));
                free(pixels);
            }
    
            glBindFramebuffer(GL_FRAMEBUFFER, 0);
            glDeleteFramebuffers(1, &fbo);
    
            qApp->setProperty("save_image", "0");
        }

    在纹理管理中、您可以在每次更新或创建纹理时查看纹理更新日志。

    QML:符合家庭条件
    qt.scenegraphy.time.texture: atlastexture 上传时间: 1ms (100x80)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (48x48)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (60x60)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (60x60)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (60x60)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (23x23)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (114x114)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (91x91)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (91x91)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)
    Qt.scenegraphy.time.texture:atlastexture 上传时间:0ms (40x40)

    Qt.scenegraphy.time.texture: atlasTexture 上传时间: 0ms (40x40)/*应用程序顶部有四个按钮,左侧有三个按钮(65x65 是纹理的大小)*/
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (65x65)/*关于 ToolButton 图标的大小*/
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (65x65)/*设置 ToolButton 图标*/
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (65x65)/*维护 ToolButton 图标*/

    Qt.scenegraphy.time.texture: atlastexture 上传时间: 0ms (60x60)

    Qt.scenegraphy.time.texture: atlastexture 上传时间: 5 毫秒 (227x168 )/*进入走廊*/
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 2 毫秒 (227x168 )/*输出走廊*/

    从日志中可以看出,当纹理更新时,该纹理缓冲区将被释放并重新分配,即使纹理中新分配的子纹理的位置偏移和大小从未改变,且没有 65x65 的修改日志信息)纹理大小已在未来收到。 因此、改变 ToolButton 图标大小是很奇怪的。

    更新画布(走廊)绘图一次的过程。

    tlasBase:删除删除纹理 RECT= QRect (218,0229x170)
    AtlasBase:删除纹理 RECT= QRect (218,170229x170)
    Qt.scenegrap.time.texture: atlastexture 上传时间: 3mS (227x168)
    Qt.scenegraphy.time.texture: atlastexture 上传时间: 2 毫秒 (227x168)

    在 QT 事件阶段从 QT 源代码创建 2048 * 1024 纹理缓冲区。 有纹理分配时、指定位置和大小、然后将数据复制到此区域。

    在 QT 中处理纹理数据上传功能。

    void Atlas::uploadBgra(Texture *texture)
    {
        QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
        const QRect &r = texture->atlasSubRect();
        QImage image = texture->image();
    
        if (image.isNull())
            return;
        
        if (image.format() != QImage::Format_ARGB32_Premultiplied
                && image.format() != QImage::Format_RGB32) {
            image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
        }
    
        if (m_debug_overlay) {
            QPainter p(&image);
            p.setCompositionMode(QPainter::CompositionMode_SourceAtop);
            p.fillRect(0, 0, image.width(), image.height(), QBrush(QColor::fromRgbF(0, 1, 1, 0.5)));
        }
    
        QVarLengthArray<quint32, 512> tmpBits(qMax(image.width() + 2, image.height() + 2));
        int iw = image.width();
        int ih = image.height();
        int bpl = image.bytesPerLine() / 4;
        const quint32 *src = (const quint32 *) image.constBits();
        quint32 *dst = tmpBits.data();
    
        // top row, padding corners
        dst[0] = src[0];
        memcpy(dst + 1, src, iw * sizeof(quint32));
        dst[1 + iw] = src[iw-1];
        funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x(), r.y(), iw + 2, 1, m_externalFormat, GL_UNSIGNED_BYTE, dst);
    
        // bottom row, padded corners
        const quint32 *lastRow = src + bpl * (ih - 1);
        dst[0] = lastRow[0];
        memcpy(dst + 1, lastRow, iw * sizeof(quint32));
        dst[1 + iw] = lastRow[iw-1];
        funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x(), r.y() + ih + 1, iw + 2, 1, m_externalFormat, GL_UNSIGNED_BYTE, dst);
    
        // left column
        for (int i=0; i<ih; ++i)
            dst[i] = src[i * bpl];
        funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x(), r.y() + 1, 1, ih, m_externalFormat, GL_UNSIGNED_BYTE, dst);
    
        // right column
        for (int i=0; i<ih; ++i)
            dst[i] = src[i * bpl + iw - 1];
        funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + iw + 1, r.y() + 1, 1, ih, m_externalFormat, GL_UNSIGNED_BYTE, dst);
    
        // Inner part of the image....
        if (bpl != iw) {
            int sy = r.y() + 1;
            int ey = sy + r.height() - 2;
            for (int y = sy; y < ey; ++y) {
                funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + 1, y, r.width() - 2, 1, m_externalFormat, GL_UNSIGNED_BYTE, src);
                src += bpl;
            }
        } else {
            funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, m_externalFormat, GL_UNSIGNED_BYTE, src);
        }
    }

    日志中的一触式数据
    轻触一次可打印当前上传的数据信息。

    e2e.ti.com/.../7752.log.txt

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    下面是显示正常和异常情况的比较图

    异常显示期间、这些图像是从 GPU 捕获的

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    我们的调查已经取得了最新进展,使用 QSG_Atlas_size_limit=0 将纹理 Atlas 更改为独立纹理,这个问题不再重现。 因此,我们目前的结论是,它与 QT 无关,而与子纹理的 GPU 处理有关。 我们目前使用的是 SDK 9.0 和 Linux 6.1.33。 请问将来 GPU 固件是否有任何更新、以及是否可以直接使用

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    是否可以在我们最新的 SDK 11 上运行您的实验? 此外、 您的应用程序如何终止、您是以 root 身份运行的?

    此致、
    Krunal

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Krunal、

    我不确定 AM62X 是否具有 与 TDA4X 相同的 GPU 驱动程序错误?

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1316731/faq-tda4vl-q1-what-are-the-gpu-driver-bug-fixes-for-sdk-8-6-or-earlier

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    否、我认为 TDA4x 错误不适用于 AM62x 驱动程序。 根据我与 GPU 团队的内部讨论、我们认为这不是 GPU 问题。 在 Qt 中、如果应用程序 不平稳地存在(Weston 被杀死或类似的东西)、Qt5 将对缓存文件写入损坏。  客户可以尝试以下操作  

    Qt_disable_Shader_disk_cache=1

    此致、
    Krunal

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    我认为 GPU 问题的原因如下:

    1.使用 Alta 纹理图册进行处理时,将创建一个空纹理(即共享纹理 ID 的大缓冲区),用于管理和存储整个显示的图像。 每个图像用作区域(即子纹理)的缓冲区、当修改某个图像时、相应的区域(即子纹理)将会更新。 当 GPU 负载较高时、修改某个子纹理区域会导致缓冲区中的其他未修改纹理区域数据被修改。

    2.使用多个图像创建纹理时(为每个图像指定纹理 ID)、以这种方式绘制的数据是正常的。

    基于现象 1 和 2、我认为当 GPU 压力高时、驱动程序处理子纹理更新时未修改子纹理区域的纹理数据将被清除或修改。

    3.我目前保持原始测试环境不变、将 GPU 相关的驱动程序和固件更新为 SDK 9.2、此问题将不再重现。

    QT5.15.7 没有 QT-DISABLE_SHADLER-DISKACHE=1 环境变量。 我们尝试修改环境变量以导出 QML-DISABLE-DISKACHE=1 以进行测试。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    使用 export QML-DISABLE_DISK_CAHE=1 环境变量、仍然可以重现此问题

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你(们)好、 克鲁纳尔

    客户更新了 SDK9.2、发现此问题未重现。 有没有从 SDK9.1 更改为 SDK9.2、特别是与 GPU 相关的?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    我们以前使用过 SDK9.0。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    GPU 驱动程序已从 23.1 (SDK9.0) 更新为 23.3 (SDK9.2)。  我们的 GPU 供应商更新了一些问题、我可以向 GPU 驱动程序团队寻求指导、但很难直接说出问题。  

    此致、
    Krunal